Compare commits
42 Commits
21153f7909
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
38a75be17a
|
|||
|
6de6a7e1c0
|
|||
|
c5bde2c411
|
|||
|
349a8a05e1
|
|||
|
4fb6d71a77
|
|||
|
1af3f39722
|
|||
|
b53adb411c
|
|||
|
2da562ffcb
|
|||
|
0f78f4cebc
|
|||
|
5de2b67275
|
|||
|
1857bd66c5
|
|||
|
671bfc5a99
|
|||
|
dfdea84bf7
|
|||
|
9a838df27c
|
|||
|
b8c4e51fbe
|
|||
|
8d534bfd9b
|
|||
|
7323fab689
|
|||
|
796341c7a0
|
|||
|
21f3e27039
|
|||
|
092e9d552b
|
|||
|
6ec02743da
|
|||
|
0a518f539e
|
|||
|
1dcd1585fe
|
|||
|
5cc5576369
|
|||
|
7f60c9b07e
|
|||
|
85f45d8145
|
|||
|
2b0b477c7d
|
|||
|
d4a3894a93
|
|||
|
9b5adecca0
|
|||
|
13d29c224a
|
|||
|
d5a452dbf8
|
|||
|
a8d8d3d994
|
|||
|
6adf27483d
|
|||
|
0a2ebf0bdb
|
|||
|
30ad82a0f8
|
|||
|
8e9f4384b4
|
|||
|
c27fb9d71e
|
|||
|
f91afcfb4f
|
|||
|
04fda43862
|
|||
|
7c66e29dd3
|
|||
|
b50a6e80c2
|
|||
|
0daadbf0f1
|
@@ -7,10 +7,8 @@ env:
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 12 3 * *"
|
- cron: "0 12 * * 3"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
@@ -48,16 +46,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
docker build \
|
docker build \
|
||||||
--tag ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-${{ matrix.arch }} \
|
--tag ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-${{ matrix.arch }} \
|
||||||
--platform linux/${{ matrix.arch }} -f Dockerfile .
|
--platform linux/${{ matrix.arch }} --no-cache -f Dockerfile .
|
||||||
docker push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-${{ matrix.arch }}
|
docker push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-${{ matrix.arch }}
|
||||||
|
|
||||||
- name: Build and publish php74
|
|
||||||
run: |
|
|
||||||
docker build \
|
|
||||||
--tag ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-php74-${{ matrix.arch }} \
|
|
||||||
--platform linux/${{ matrix.arch }} -f Dockerfile-php74 .
|
|
||||||
docker push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-php74-${{ matrix.arch }}
|
|
||||||
|
|
||||||
|
|
||||||
manifest:
|
manifest:
|
||||||
name: update docker manifest
|
name: update docker manifest
|
||||||
@@ -82,10 +73,3 @@ jobs:
|
|||||||
--amend ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-arm64
|
--amend ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-arm64
|
||||||
docker manifest push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest
|
docker manifest push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest
|
||||||
|
|
||||||
- name: latest
|
|
||||||
run: |
|
|
||||||
docker manifest create \
|
|
||||||
${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-php74 \
|
|
||||||
--amend ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-php74-amd64 \
|
|
||||||
--amend ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-php74-arm64
|
|
||||||
docker manifest push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-php74
|
|
||||||
|
|||||||
67
.gitea/workflows/build_and_publish_php74.yaml
Normal file
67
.gitea/workflows/build_and_publish_php74.yaml
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
---
|
||||||
|
name: Container Publish - php7.4 version
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: docker.asperti.com
|
||||||
|
REPOSITORY: paspo/webserver-nginx
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
on-success-skip:
|
||||||
|
runs-on:
|
||||||
|
labels: ubuntu-latest
|
||||||
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||||
|
steps:
|
||||||
|
- run: exit_with_success
|
||||||
|
|
||||||
|
build-image:
|
||||||
|
runs-on:
|
||||||
|
labels: [ubuntu-latest, "arch-${{ matrix.arch }}"]
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
arch: [amd64, arm64]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and publish php74
|
||||||
|
run: |
|
||||||
|
docker build \
|
||||||
|
--tag ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-php74-${{ matrix.arch }} \
|
||||||
|
--platform linux/${{ matrix.arch }} --no-cache -f Dockerfile-php74 .
|
||||||
|
docker push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-php74-${{ matrix.arch }}
|
||||||
|
|
||||||
|
|
||||||
|
manifest:
|
||||||
|
name: update docker manifest
|
||||||
|
needs: build-image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Login to registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
- name: latest
|
||||||
|
run: |
|
||||||
|
docker manifest create \
|
||||||
|
${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-php74 \
|
||||||
|
--amend ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-php74-amd64 \
|
||||||
|
--amend ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-php74-arm64
|
||||||
|
docker manifest push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-php74
|
||||||
@@ -62,4 +62,4 @@ jobs:
|
|||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
format: markdown
|
format: markdown
|
||||||
message: |
|
message: |
|
||||||
Found **${{ steps.vulncount.outputs.VULNCOUNT }}** vulnerabilities in `${{ github.repository }}`
|
Found **${{ steps.vulncount.outputs.VULNCOUNT }}** vulnerabilities in `${{ env.REGISTRY }}/${{ env.REPOSITORY }}:${{ matrix.tag }}`
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
FROM alpine:3.21
|
FROM alpine:3.22
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
apk --no-cache upgrade && \
|
apk --no-cache upgrade && \
|
||||||
apk --no-cache add tini nginx openssh-server nginx-mod-http-dav-ext \
|
apk --no-cache add tini nginx curl logrotate openssh-server nginx-mod-http-dav-ext goaccess \
|
||||||
php84 php84-fpm php84-mbstring php84-curl php84-ctype php84-dom php84-gd php84-json php84-openssl php84-session php84-simplexml php84-xml php84-zip \
|
php84 php84-fpm php84-mbstring php84-curl php84-ctype php84-dom php84-gd php84-json php84-openssl php84-session php84-simplexml php84-xml php84-zip \
|
||||||
php84-apcu php84-opcache php84-pecl-yaml php84-sqlite3 php84-mysqli \
|
php84-apcu php84-opcache php84-pecl-yaml php84-sqlite3 php84-mysqli \
|
||||||
php83 php83-fpm php83-mbstring php83-curl php83-ctype php83-dom php83-gd php83-json php83-openssl php83-session php83-simplexml php83-xml php83-zip \
|
php83 php83-fpm php83-mbstring php83-curl php83-ctype php83-dom php83-gd php83-json php83-openssl php83-session php83-simplexml php83-xml php83-zip \
|
||||||
@@ -12,7 +12,7 @@ RUN \
|
|||||||
|
|
||||||
COPY rootfs /
|
COPY rootfs /
|
||||||
|
|
||||||
VOLUME [ "/data/www", "/ssh" ]
|
VOLUME [ "/data" ]
|
||||||
|
|
||||||
ENV \
|
ENV \
|
||||||
USERNAME=theuser \
|
USERNAME=theuser \
|
||||||
@@ -23,4 +23,6 @@ ENV \
|
|||||||
WEBDAV_PORT=8080 \
|
WEBDAV_PORT=8080 \
|
||||||
TZ=Etc/UTC
|
TZ=Etc/UTC
|
||||||
|
|
||||||
|
HEALTHCHECK --timeout=10s --start-period=5s CMD curl --silent --fail -o /dev/null http://127.0.0.1:80/
|
||||||
|
|
||||||
ENTRYPOINT [ "/sbin/tini", "/app/entrypoint.sh" ]
|
ENTRYPOINT [ "/sbin/tini", "/app/entrypoint.sh" ]
|
||||||
|
|||||||
32
README.md
32
README.md
@@ -1,7 +1,5 @@
|
|||||||
# webserver-nginx
|
# webserver-nginx
|
||||||
|
|
||||||
[](https://drone.asperti.com/paspo/docker-webserver-nginx)
|
|
||||||
|
|
||||||
Small webserver with PHP support and SFTP access
|
Small webserver with PHP support and SFTP access
|
||||||
|
|
||||||
## usage
|
## usage
|
||||||
@@ -13,24 +11,42 @@ services:
|
|||||||
web:
|
web:
|
||||||
image: docker.asperti.com/paspo/webserver-nginx
|
image: docker.asperti.com/paspo/webserver-nginx
|
||||||
ports:
|
ports:
|
||||||
- 8888:80
|
- 8888:80 # web server
|
||||||
- 2222:22
|
- 8890:8080 # webdav access
|
||||||
|
- 2222:22 # sftp access
|
||||||
volumes:
|
volumes:
|
||||||
- ./www:/data/www
|
- ./data:/data
|
||||||
- ./ssh:/ssh # add authorized_keys file here
|
|
||||||
- ./extra_nginx.conf:/etc/nginx/custom.d/extra.conf # optional
|
- ./extra_nginx.conf:/etc/nginx/custom.d/extra.conf # optional
|
||||||
- ./htpasswd:/app/htpasswd # optional, for webdav auth
|
|
||||||
environment:
|
environment:
|
||||||
|
LOG_DAYS: 14 # default 7
|
||||||
WEBDAV_PORT: 8080 # default: 8080
|
WEBDAV_PORT: 8080 # default: 8080
|
||||||
PHP: php84 # none (default), php82, php83, php84
|
PHP: php84 # none (default), php82, php83, php84
|
||||||
POSTSIZE: 256M # default: 256M
|
POSTSIZE: 256M # default: 256M
|
||||||
PUID: 1000 # default: 1000
|
PUID: 1000 # default: 1000
|
||||||
PGID: 1000 # default: 1000
|
PGID: 1000 # default: 1000
|
||||||
|
USERNAME: theuser # default: theuser
|
||||||
|
GROUPNAME: thegroup # default: thegroup
|
||||||
TZ: Etc/UTC # default: Etc/UTC
|
TZ: Etc/UTC # default: Etc/UTC
|
||||||
FPM_MAX_CHILDREN: 5 # default: 5
|
FPM_MAX_CHILDREN: 5 # default: 5
|
||||||
FPM_START_SERVERS: 1 # default: 1
|
FPM_START_SERVERS: 1 # default: 1
|
||||||
FPM_MIN_SPARE_SERVERS: 1 # default: 1
|
FPM_MIN_SPARE_SERVERS: 1 # default: 1
|
||||||
FPM_MAX_SPARE_SERVERS: 3 # default: 3
|
FPM_MAX_SPARE_SERVERS: 3 # default: 3
|
||||||
|
DISABLE_WEBROOT_CHOWN: 1 # default: 0
|
||||||
|
DISABLE_SFTP: 1 # default: 0
|
||||||
|
DISABLE_STATS: 1 # default: 0
|
||||||
|
DISABLE_STATS_HOURLY: 1 # default: 0
|
||||||
|
DISABLE_WEBDAV: 1 # default: 0
|
||||||
```
|
```
|
||||||
|
|
||||||
The `/data/www` directory and its contents will be chowned to `$PUID:$PGID` and chmodded to `0755` for directories and `0644` for files at container start.
|
The `/data/www` and `/data/logs` directories and their contents will be chowned to `$PUID:$PGID` and chmodded to `0755` for directories and `0644` for files at container start.
|
||||||
|
|
||||||
|
## data direcvtory layout
|
||||||
|
|
||||||
|
| directory | content |
|
||||||
|
|-----------|-----------------------------------------------|
|
||||||
|
| auth | htpasswd files for stats and webdav |
|
||||||
|
| logs | nginx access logs (logrotated) and error logs |
|
||||||
|
| ssh | host keys and authorized keys |
|
||||||
|
| stats | html statistical report |
|
||||||
|
| stats.db | internal statistical db |
|
||||||
|
| www | webroot |
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
services:
|
|
||||||
web:
|
|
||||||
image: docker.asperti.com/paspo/webserver-nginx
|
|
||||||
ports:
|
|
||||||
- 8888:80
|
|
||||||
- 2222:22
|
|
||||||
volumes:
|
|
||||||
- ./www:/data/www
|
|
||||||
- ./ssh:/ssh # add authorized_keys file here
|
|
||||||
environment:
|
|
||||||
PHP: php84 # none (default), php82, php83, php84
|
|
||||||
@@ -79,7 +79,9 @@ if [ -f /ssh/authorized_keys ] ; then
|
|||||||
chown "${USERNAME}:${GROUPNAME}" /ssh/authorized_keys
|
chown "${USERNAME}:${GROUPNAME}" /ssh/authorized_keys
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chmod 0700 "${WEBROOT}/.ssh"
|
if [ -d "${PATH_WEBROOT}/.ssh" ] ; then
|
||||||
|
chmod 0700 "${PATH_WEBROOT}/.ssh"
|
||||||
|
fi
|
||||||
/usr/sbin/sshd -e
|
/usr/sbin/sshd -e
|
||||||
|
|
||||||
cat > /etc/nginx/conf.d/user.conf <<EOF
|
cat > /etc/nginx/conf.d/user.conf <<EOF
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ server {
|
|||||||
root /data/www;
|
root /data/www;
|
||||||
# server_name localhost;
|
# server_name localhost;
|
||||||
|
|
||||||
#access_log /var/log/nginx/host.access.log main;
|
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ server {
|
|||||||
root /data/www;
|
root /data/www;
|
||||||
# server_name localhost;
|
# server_name localhost;
|
||||||
|
|
||||||
#access_log /var/log/nginx/host.access.log main;
|
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
index index.php index.html index.htm;
|
index index.php index.html index.htm;
|
||||||
|
|
||||||
|
|||||||
@@ -89,6 +89,10 @@ http {
|
|||||||
'' close;
|
'' close;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# use real IPs instead of docker ones
|
||||||
|
set_real_ip_from 172.18.0.0/16;
|
||||||
|
real_ip_header X-Forwarded-For;
|
||||||
|
real_ip_recursive on;
|
||||||
|
|
||||||
# Specifies the main log format.
|
# Specifies the main log format.
|
||||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
|
|||||||
@@ -1,128 +1,92 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
WEBROOT=/data/www
|
PATH_BASE=/data
|
||||||
|
PATH_WEBROOT=${PATH_BASE}/www
|
||||||
|
PATH_STATS=${PATH_BASE}/stats
|
||||||
|
PATH_STATSDB=${PATH_BASE}/stats.db
|
||||||
|
PATH_LOGS=${PATH_BASE}/logs
|
||||||
|
PATH_AUTH=${PATH_BASE}/auth
|
||||||
|
PATH_SSH_HOST=${PATH_BASE}/ssh
|
||||||
|
|
||||||
WEBDAV_PORT=${WEBDAV_PORT:-8080}
|
WEBDAV_PORT=${WEBDAV_PORT:-8080}
|
||||||
|
LOG_DAYS=${LOG_DAYS:-7}
|
||||||
|
|
||||||
PHP=${PHP:-none}
|
PHP=${PHP:-none}
|
||||||
POSTSIZE=${POSTSIZE:-256M}
|
POSTSIZE=${POSTSIZE:-256M}
|
||||||
USERNAME=${USERNAME:-theuser}
|
USERNAME=${USERNAME:-theuser}
|
||||||
PUID=${PUID:-1000}
|
PUID=${PUID:-1000}
|
||||||
GROUPNAME=${GROUPNAME:-thegroup}
|
GROUPNAME=${GROUPNAME:-thegroup}
|
||||||
PGID=${PGID:-1000}
|
PGID=${PGID:-1000}
|
||||||
RANDOMPWD=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13)
|
|
||||||
addgroup -g "${PGID}" "${GROUPNAME}"
|
|
||||||
addgroup nginx "${GROUPNAME}"
|
|
||||||
adduser -DH -h "${WEBROOT}" -G "${GROUPNAME}" -u "${PUID}" "${USERNAME}"
|
|
||||||
printf '%s\n%s' "${RANDOMPWD}" "${RANDOMPWD}" | passwd "${USERNAME}"
|
|
||||||
echo "password for the user \"${USERNAME}\" is: ${RANDOMPWD}"
|
|
||||||
|
|
||||||
echo "chowning to ${PUID}:${GROUPNAME}..."
|
|
||||||
chown "${PUID}:${GROUPNAME}" "${WEBROOT}" -R
|
|
||||||
find "${WEBROOT}" -type d -exec chmod 0755 {} \;
|
|
||||||
find "${WEBROOT}" -type f -exec chmod 0644 {} \;
|
|
||||||
echo "...done"
|
|
||||||
|
|
||||||
FPM_MAX_CHILDREN=${FPM_MAX_CHILDREN:-5}
|
FPM_MAX_CHILDREN=${FPM_MAX_CHILDREN:-5}
|
||||||
FPM_START_SERVERS=${FPM_START_SERVERS:-1}
|
FPM_START_SERVERS=${FPM_START_SERVERS:-1}
|
||||||
FPM_MIN_SPARE_SERVERS=${FPM_MIN_SPARE_SERVERS:-1}
|
FPM_MIN_SPARE_SERVERS=${FPM_MIN_SPARE_SERVERS:-1}
|
||||||
FPM_MAX_SPARE_SERVERS=${FPM_MAX_SPARE_SERVERS:-3}
|
FPM_MAX_SPARE_SERVERS=${FPM_MAX_SPARE_SERVERS:-3}
|
||||||
|
|
||||||
# set php config
|
DISABLE_WEBROOT_CHOWN=${DISABLE_WEBROOT_CHOWN:-0}
|
||||||
case "${PHP}" in
|
DISABLE_SFTP=${DISABLE_SFTP:-0}
|
||||||
"php84"|"php83"|"php82")
|
DISABLE_STATS=${DISABLE_STATS:-0}
|
||||||
cat >"/etc/${PHP}/php-fpm.d/www.conf" <<EOF
|
DISABLE_STATS_HOURLY=${DISABLE_STATS_HOURLY:-0}
|
||||||
[www]
|
DISABLE_WEBDAV=${DISABLE_WEBDAV:-0}
|
||||||
user = ${USERNAME}
|
|
||||||
group = ${GROUPNAME}
|
|
||||||
listen = 127.0.0.1:9000
|
|
||||||
pm = dynamic
|
|
||||||
pm.max_children = ${FPM_MAX_CHILDREN}
|
|
||||||
pm.start_servers = ${FPM_START_SERVERS}
|
|
||||||
pm.min_spare_servers = ${FPM_MIN_SPARE_SERVERS}
|
|
||||||
pm.max_spare_servers = ${FPM_MAX_SPARE_SERVERS}
|
|
||||||
EOF
|
|
||||||
cat >"/etc/${PHP}/conf.d/post_size.ini" <<EOF
|
|
||||||
upload_max_size = ${POSTSIZE}
|
|
||||||
post_max_size = ${POSTSIZE}
|
|
||||||
upload_max_filesize = ${POSTSIZE}
|
|
||||||
upload_tmp_dir = /tmp
|
|
||||||
EOF
|
|
||||||
;;
|
|
||||||
*) ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
cat >"/etc/nginx/custom.d/post_size.conf" <<EOF
|
export USERNAME
|
||||||
client_max_body_size ${POSTSIZE};
|
export GROUPNAME
|
||||||
EOF
|
export PATH_BASE
|
||||||
|
export PATH_WEBROOT
|
||||||
|
export PATH_STATS
|
||||||
|
export PATH_STATSDB
|
||||||
|
export PATH_LOGS
|
||||||
|
export PATH_AUTH
|
||||||
|
export PATH_SSH_HOST
|
||||||
|
export WEBDAV_PORT
|
||||||
|
export POSTSIZE
|
||||||
|
export LOG_DAYS
|
||||||
|
export PHP
|
||||||
|
export PUID
|
||||||
|
export PGID
|
||||||
|
|
||||||
|
export FPM_MAX_CHILDREN
|
||||||
|
export FPM_START_SERVERS
|
||||||
|
export FPM_MIN_SPARE_SERVERS
|
||||||
|
export FPM_MAX_SPARE_SERVERS
|
||||||
|
|
||||||
|
export DISABLE_WEBROOT_CHOWN
|
||||||
|
export DISABLE_SFTP
|
||||||
|
export DISABLE_STATS
|
||||||
|
export DISABLE_STATS_HOURLY
|
||||||
|
export DISABLE_WEBDAV
|
||||||
|
|
||||||
|
# run all scripts in order
|
||||||
|
run-parts /app/entrypoint.sh.d
|
||||||
|
|
||||||
# start php
|
# start php
|
||||||
case "${PHP}" in
|
case "${PHP}" in
|
||||||
"php84")
|
"php84")
|
||||||
cp /app/nginx/php84.conf /etc/nginx/custom.d/
|
echo "# Starting PH 8.4"
|
||||||
cp /app/nginx/default_php.conf /etc/nginx/http.d/default.conf
|
|
||||||
/usr/sbin/php-fpm84 -D
|
/usr/sbin/php-fpm84 -D
|
||||||
;;
|
;;
|
||||||
"php83")
|
"php83")
|
||||||
cp /app/nginx/php83.conf /etc/nginx/custom.d/
|
echo "# Starting PH 8.3"
|
||||||
cp /app/nginx/default_php.conf /etc/nginx/http.d/default.conf
|
|
||||||
/usr/sbin/php-fpm83 -D
|
/usr/sbin/php-fpm83 -D
|
||||||
;;
|
;;
|
||||||
"php82")
|
"php82")
|
||||||
cp /app/nginx/php82.conf /etc/nginx/custom.d/
|
echo "# Starting PH 8.2"
|
||||||
cp /app/nginx/default_php.conf /etc/nginx/http.d/default.conf
|
|
||||||
/usr/sbin/php-fpm82 -D
|
/usr/sbin/php-fpm82 -D
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
cp /app/nginx/default_nophp.conf /etc/nginx/http.d/default.conf
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# start ssh
|
# start cron
|
||||||
for keytype in ecdsa rsa ed25519 ; do
|
echo "# Starting cron"
|
||||||
if [ ! -r "/ssh/ssh_host_${keytype}_key" ] ; then
|
crond -b
|
||||||
/usr/bin/ssh-keygen -t "${keytype}" -f "/ssh/ssh_host_${keytype}_key" -N ""
|
|
||||||
fi
|
|
||||||
chmod 0600 "/ssh/ssh_host_${keytype}_key"
|
|
||||||
chmod 0644 "/ssh/ssh_host_${keytype}_key.pub"
|
|
||||||
done
|
|
||||||
|
|
||||||
# set authorized_keys permissions
|
# start ssh
|
||||||
if [ -f /ssh/authorized_keys ] ; then
|
if [ "${DISABLE_SFTP}" -ne 1 ] ; then
|
||||||
chmod 0600 /ssh/authorized_keys
|
echo "# Starting ssh"
|
||||||
chown "${USERNAME}:${GROUPNAME}" /ssh/authorized_keys
|
/usr/sbin/sshd -e
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chmod 0700 "${WEBROOT}/.ssh"
|
# start nginx
|
||||||
/usr/sbin/sshd -e
|
echo "# Starting nginx"
|
||||||
|
|
||||||
cat > /etc/nginx/conf.d/user.conf <<EOF
|
|
||||||
user ${USERNAME} ${GROUPNAME};
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# fix permissions for upload
|
|
||||||
chown "${USERNAME}" /var/lib/nginx /var/lib/nginx/tmp
|
|
||||||
|
|
||||||
cat > /etc/nginx/http.d/webdav.conf <<EOF
|
|
||||||
server {
|
|
||||||
listen ${WEBDAV_PORT} default_server;
|
|
||||||
listen [::]:${WEBDAV_PORT} default_server;
|
|
||||||
root ${WEBROOT};
|
|
||||||
|
|
||||||
location / {
|
|
||||||
autoindex on;
|
|
||||||
autoindex_exact_size off;
|
|
||||||
autoindex_localtime on;
|
|
||||||
dav_methods PUT DELETE MKCOL COPY MOVE;
|
|
||||||
dav_ext_methods PROPFIND OPTIONS;
|
|
||||||
create_full_put_path on;
|
|
||||||
dav_access user:rw;
|
|
||||||
}
|
|
||||||
|
|
||||||
auth_basic "Restricted area";
|
|
||||||
auth_basic_user_file /app/htpasswd;
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
touch /app/htpasswd
|
|
||||||
|
|
||||||
echo starting nginx
|
|
||||||
nginx
|
nginx
|
||||||
|
|||||||
11
rootfs/app/entrypoint.sh.d/10_user.sh
Executable file
11
rootfs/app/entrypoint.sh.d/10_user.sh
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "# Creating user and group"
|
||||||
|
|
||||||
|
RANDOMPWD=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13)
|
||||||
|
|
||||||
|
addgroup -g "${PGID}" "${GROUPNAME}"
|
||||||
|
addgroup nginx "${GROUPNAME}"
|
||||||
|
adduser -DH -h "${PATH_WEBROOT}" -G "${GROUPNAME}" -u "${PUID}" "${USERNAME}"
|
||||||
|
printf '%s\n%s' "${RANDOMPWD}" "${RANDOMPWD}" | passwd "${USERNAME}"
|
||||||
|
echo "password for the user \"${USERNAME}\" is: ${RANDOMPWD}"
|
||||||
12
rootfs/app/entrypoint.sh.d/90_chown_webroot.sh
Executable file
12
rootfs/app/entrypoint.sh.d/90_chown_webroot.sh
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "# Started background chowning of ${PATH_WEBROOT} to ${USERNAME}:${GROUPNAME} (${PUID}:${PGID})..."
|
||||||
|
|
||||||
|
if [ ${DISABLE_WEBROOT_CHOWN} -eq 1 ] ; then
|
||||||
|
echo chowning skipped because of DISABLE_WEBROOT_CHOWN
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
chown "${USERNAME}:${GROUPNAME}" "${PATH_WEBROOT}" -R
|
||||||
|
find "${PATH_WEBROOT}" -type d -exec chmod 0755 {} \; &
|
||||||
|
find "${PATH_WEBROOT}" -type f -exec chmod 0644 {} \; &
|
||||||
25
rootfs/app/entrypoint.sh.d/90_logs.sh
Executable file
25
rootfs/app/entrypoint.sh.d/90_logs.sh
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "# Configuring logrotate"
|
||||||
|
|
||||||
|
# make sure path exists
|
||||||
|
mkdir -p "${PATH_LOGS}"
|
||||||
|
chown -R "${USERNAME}:${GROUPNAME}" "${PATH_LOGS}"
|
||||||
|
|
||||||
|
# configure logrotate
|
||||||
|
cat >/etc/logrotate.d/nginx <<EOF
|
||||||
|
${PATH_LOGS}/nginx-access.log {
|
||||||
|
missingok
|
||||||
|
daily
|
||||||
|
rotate ${LOG_DAYS}
|
||||||
|
compress
|
||||||
|
delaycompress
|
||||||
|
sharedscripts
|
||||||
|
nodateext
|
||||||
|
su ${USERNAME} ${GROUPNAME}
|
||||||
|
postrotate
|
||||||
|
/usr/sbin/nginx -s reopen
|
||||||
|
nice -n 19 /app/stats.sh
|
||||||
|
endscript
|
||||||
|
}
|
||||||
|
EOF
|
||||||
24
rootfs/app/entrypoint.sh.d/90_nginx.sh
Executable file
24
rootfs/app/entrypoint.sh.d/90_nginx.sh
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "# Configuring nginx"
|
||||||
|
|
||||||
|
cat > /etc/nginx/conf.d/user.conf <<EOF
|
||||||
|
user ${USERNAME} ${GROUPNAME};
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# fix permissions for upload
|
||||||
|
chown "${USERNAME}" /var/lib/nginx /var/lib/nginx/tmp
|
||||||
|
|
||||||
|
cat >"/etc/nginx/custom.d/post_size.conf" <<EOF
|
||||||
|
client_max_body_size ${POSTSIZE};
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat >"/etc/nginx/conf.d/errorlog.conf" <<EOF
|
||||||
|
# Configures default error logger.
|
||||||
|
error_log ${PATH_LOGS}/nginx-error.log warn;
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat >"/etc/nginx/http.d/accesslog.conf" <<EOF
|
||||||
|
# Sets the path, format, and configuration for a buffered log write.
|
||||||
|
access_log ${PATH_LOGS}/nginx-access.log main;
|
||||||
|
EOF
|
||||||
45
rootfs/app/entrypoint.sh.d/90_php.sh
Executable file
45
rootfs/app/entrypoint.sh.d/90_php.sh
Executable file
@@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "# Configuring PHP"
|
||||||
|
|
||||||
|
# set php config
|
||||||
|
case "${PHP}" in
|
||||||
|
"php84"|"php83"|"php82")
|
||||||
|
cat >"/etc/${PHP}/php-fpm.d/www.conf" <<EOF
|
||||||
|
[www]
|
||||||
|
user = ${USERNAME}
|
||||||
|
group = ${GROUPNAME}
|
||||||
|
listen = 127.0.0.1:9000
|
||||||
|
pm = dynamic
|
||||||
|
pm.max_children = ${FPM_MAX_CHILDREN}
|
||||||
|
pm.start_servers = ${FPM_START_SERVERS}
|
||||||
|
pm.min_spare_servers = ${FPM_MIN_SPARE_SERVERS}
|
||||||
|
pm.max_spare_servers = ${FPM_MAX_SPARE_SERVERS}
|
||||||
|
EOF
|
||||||
|
cat >"/etc/${PHP}/conf.d/post_size.ini" <<EOF
|
||||||
|
upload_max_size = ${POSTSIZE}
|
||||||
|
post_max_size = ${POSTSIZE}
|
||||||
|
upload_max_filesize = ${POSTSIZE}
|
||||||
|
upload_tmp_dir = /tmp
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
*) ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "${PHP}" in
|
||||||
|
"php84")
|
||||||
|
cp /app/nginx/php84.conf /etc/nginx/custom.d/
|
||||||
|
cp /app/nginx/default_php.conf /etc/nginx/http.d/default.conf
|
||||||
|
;;
|
||||||
|
"php83")
|
||||||
|
cp /app/nginx/php83.conf /etc/nginx/custom.d/
|
||||||
|
cp /app/nginx/default_php.conf /etc/nginx/http.d/default.conf
|
||||||
|
;;
|
||||||
|
"php82")
|
||||||
|
cp /app/nginx/php82.conf /etc/nginx/custom.d/
|
||||||
|
cp /app/nginx/default_php.conf /etc/nginx/http.d/default.conf
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
cp /app/nginx/default_nophp.conf /etc/nginx/http.d/default.conf
|
||||||
|
;;
|
||||||
|
esac
|
||||||
56
rootfs/app/entrypoint.sh.d/90_ssh.sh
Executable file
56
rootfs/app/entrypoint.sh.d/90_ssh.sh
Executable file
@@ -0,0 +1,56 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ ${DISABLE_SFTP} -eq 1 ] ; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "# Configuring ssh"
|
||||||
|
|
||||||
|
# make sure directory exists
|
||||||
|
mkdir -p "${PATH_SSH_HOST}"
|
||||||
|
|
||||||
|
for keytype in ecdsa rsa ed25519 ; do
|
||||||
|
if [ ! -r "${PATH_SSH_HOST}/ssh_host_${keytype}_key" ] ; then
|
||||||
|
/usr/bin/ssh-keygen -t "${keytype}" -f "${PATH_SSH_HOST}/ssh_host_${keytype}_key" -N ""
|
||||||
|
fi
|
||||||
|
chmod 0600 "${PATH_SSH_HOST}/ssh_host_${keytype}_key"
|
||||||
|
chmod 0644 "${PATH_SSH_HOST}/ssh_host_${keytype}_key.pub"
|
||||||
|
done
|
||||||
|
|
||||||
|
# set authorized_keys permissions
|
||||||
|
if [ -f "${PATH_SSH_HOST}/authorized_keys" ] ; then
|
||||||
|
chmod 0600 "${PATH_SSH_HOST}/authorized_keys"
|
||||||
|
chown "${USERNAME}:${GROUPNAME}" "${PATH_SSH_HOST}/authorized_keys"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d "${PATH_WEBROOT}/.ssh" ] ; then
|
||||||
|
chmod 0700 "${PATH_WEBROOT}/.ssh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# configure sshd
|
||||||
|
cat >/etc/ssh/sshd_config.d/sshd.conf <<EOF
|
||||||
|
HostKey ${PATH_SSH_HOST}/ssh_host_rsa_key
|
||||||
|
HostKey ${PATH_SSH_HOST}/ssh_host_ecdsa_key
|
||||||
|
HostKey ${PATH_SSH_HOST}/ssh_host_ed25519_key
|
||||||
|
|
||||||
|
#SyslogFacility AUTH
|
||||||
|
LogLevel INFO
|
||||||
|
LoginGraceTime 1m
|
||||||
|
PermitRootLogin no
|
||||||
|
PubkeyAuthentication yes
|
||||||
|
MaxAuthTries 3
|
||||||
|
PrintMotd no
|
||||||
|
|
||||||
|
AuthorizedKeysFile ${PATH_SSH_HOST}/authorized_keys
|
||||||
|
PasswordAuthentication no
|
||||||
|
|
||||||
|
AllowAgentForwarding no
|
||||||
|
AllowTcpForwarding no
|
||||||
|
GatewayPorts no
|
||||||
|
X11Forwarding no
|
||||||
|
|
||||||
|
Subsystem sftp internal-sftp
|
||||||
|
|
||||||
|
ChrootDirectory ${PATH_BASE}
|
||||||
|
ForceCommand internal-sftp -d ${PATH_WEBROOT}
|
||||||
|
EOF
|
||||||
22
rootfs/app/entrypoint.sh.d/90_stats.sh
Executable file
22
rootfs/app/entrypoint.sh.d/90_stats.sh
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ ${DISABLE_STATS} -eq 1 ] ; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "# Configuring stats"
|
||||||
|
|
||||||
|
# make sure paths exists
|
||||||
|
mkdir -p "${PATH_AUTH}" "${PATH_STATS}" "${PATH_STATSDB}"
|
||||||
|
touch "${PATH_AUTH}/stats"
|
||||||
|
chown -R "${USERNAME}:${GROUPNAME}" "${PATH_AUTH}" "${PATH_STATS}" "${PATH_STATSDB}"
|
||||||
|
|
||||||
|
# stats endpoint
|
||||||
|
cat > /etc/nginx/local.d/stats.conf <<EOF
|
||||||
|
location ^~ /stats {
|
||||||
|
root ${PATH_STATS};
|
||||||
|
auth_basic "Restricted area";
|
||||||
|
auth_basic_user_file ${PATH_AUTH}/stats;
|
||||||
|
try_files /index.html =404;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
14
rootfs/app/entrypoint.sh.d/90_stats_hourly.sh
Executable file
14
rootfs/app/entrypoint.sh.d/90_stats_hourly.sh
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ ${DISABLE_STATS} -eq 1 ] ; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ${DISABLE_STATS_HOURLY} -eq 1 ] ; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "# Configuring hourly stats"
|
||||||
|
|
||||||
|
# stats endpoint
|
||||||
|
ln -s /app/stats_hourly.sh /etc/periodic/hourly/stats
|
||||||
33
rootfs/app/entrypoint.sh.d/90_webdav.sh
Executable file
33
rootfs/app/entrypoint.sh.d/90_webdav.sh
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ ${DISABLE_WEBDAV} -eq 1 ] ; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "# Configuring webdav"
|
||||||
|
|
||||||
|
cat > /etc/nginx/http.d/webdav.conf <<EOF
|
||||||
|
server {
|
||||||
|
listen ${WEBDAV_PORT} default_server;
|
||||||
|
listen [::]:${WEBDAV_PORT} default_server;
|
||||||
|
root ${PATH_WEBROOT};
|
||||||
|
|
||||||
|
location / {
|
||||||
|
autoindex on;
|
||||||
|
autoindex_exact_size off;
|
||||||
|
autoindex_localtime on;
|
||||||
|
dav_methods PUT DELETE MKCOL COPY MOVE;
|
||||||
|
dav_ext_methods PROPFIND OPTIONS;
|
||||||
|
create_full_put_path on;
|
||||||
|
dav_access user:rw;
|
||||||
|
}
|
||||||
|
|
||||||
|
auth_basic "Restricted area";
|
||||||
|
auth_basic_user_file ${PATH_AUTH}/webdav;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# authentication
|
||||||
|
mkdir -p "${PATH_AUTH}"
|
||||||
|
touch "${PATH_AUTH}/webdav"
|
||||||
|
chown -R "${USERNAME}:${GROUPNAME}" "${PATH_AUTH}"
|
||||||
@@ -7,8 +7,6 @@ server {
|
|||||||
root /data/www;
|
root /data/www;
|
||||||
# server_name localhost;
|
# server_name localhost;
|
||||||
|
|
||||||
#access_log /var/log/nginx/host.access.log main;
|
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ server {
|
|||||||
root /data/www;
|
root /data/www;
|
||||||
# server_name localhost;
|
# server_name localhost;
|
||||||
|
|
||||||
#access_log /var/log/nginx/host.access.log main;
|
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
index index.php index.html index.htm;
|
index index.php index.html index.htm;
|
||||||
|
|
||||||
|
|||||||
15
rootfs/app/stats.sh
Executable file
15
rootfs/app/stats.sh
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "${DISABLE_STATS:-0}" -eq 1 ] ; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
PATH_BASE=/data
|
||||||
|
PATH_STATS=${PATH_BASE}/stats
|
||||||
|
PATH_STATSDB=${PATH_BASE}/stats.db
|
||||||
|
PATH_LOGS=${PATH_BASE}/logs
|
||||||
|
|
||||||
|
/usr/bin/goaccess "${PATH_LOGS}/nginx-access.log.1" \
|
||||||
|
--agent-list --anonymize-ip --real-os --exclude-ip 127.0.0.1 \
|
||||||
|
--output "${PATH_STATS}/index.html" --log-format COMBINED \
|
||||||
|
--tz="${TZ}" "--db-path=${PATH_STATSDB}" --persist --restore
|
||||||
15
rootfs/app/stats_hourly.sh
Executable file
15
rootfs/app/stats_hourly.sh
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "${DISABLE_STATS:-0}" -eq 1 ] ; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
PATH_BASE=/data
|
||||||
|
PATH_STATS=${PATH_BASE}/stats
|
||||||
|
PATH_STATSDB=${PATH_BASE}/stats.db
|
||||||
|
PATH_LOGS=${PATH_BASE}/logs
|
||||||
|
|
||||||
|
/usr/bin/goaccess "${PATH_LOGS}/nginx-access.log" \
|
||||||
|
--agent-list --anonymize-ip --real-os --exclude-ip 127.0.0.1 \
|
||||||
|
--output "${PATH_STATS}/index.html" --log-format COMBINED \
|
||||||
|
--tz="${TZ}" "--db-path=${PATH_STATSDB}" --persist --restore
|
||||||
@@ -8,9 +8,6 @@ worker_processes auto;
|
|||||||
# Enables the use of JIT for regular expressions to speed-up their processing.
|
# Enables the use of JIT for regular expressions to speed-up their processing.
|
||||||
pcre_jit on;
|
pcre_jit on;
|
||||||
|
|
||||||
# Configures default error logger.
|
|
||||||
error_log /var/log/nginx/error.log warn;
|
|
||||||
|
|
||||||
# Includes files with directives to load dynamic modules.
|
# Includes files with directives to load dynamic modules.
|
||||||
include /etc/nginx/modules/*.conf;
|
include /etc/nginx/modules/*.conf;
|
||||||
|
|
||||||
@@ -88,15 +85,16 @@ http {
|
|||||||
'' close;
|
'' close;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# use real IPs instead of docker ones
|
||||||
|
set_real_ip_from 172.18.0.0/16;
|
||||||
|
real_ip_header X-Forwarded-For;
|
||||||
|
real_ip_recursive on;
|
||||||
|
|
||||||
# Specifies the main log format.
|
# Specifies the main log format.
|
||||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
'$status $body_bytes_sent "$http_referer" '
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
|
|
||||||
# Sets the path, format, and configuration for a buffered log write.
|
|
||||||
access_log /var/log/nginx/access.log main;
|
|
||||||
|
|
||||||
|
|
||||||
# Includes virtual hosts configs.
|
# Includes virtual hosts configs.
|
||||||
include /etc/nginx/http.d/*.conf;
|
include /etc/nginx/http.d/*.conf;
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
HostKey /ssh/ssh_host_rsa_key
|
|
||||||
HostKey /ssh/ssh_host_ecdsa_key
|
|
||||||
HostKey /ssh/ssh_host_ed25519_key
|
|
||||||
|
|
||||||
#SyslogFacility AUTH
|
|
||||||
LogLevel INFO
|
|
||||||
LoginGraceTime 1m
|
|
||||||
PermitRootLogin no
|
|
||||||
PubkeyAuthentication yes
|
|
||||||
MaxAuthTries 3
|
|
||||||
PrintMotd no
|
|
||||||
|
|
||||||
AuthorizedKeysFile /ssh/authorized_keys
|
|
||||||
PasswordAuthentication no
|
|
||||||
|
|
||||||
AllowAgentForwarding no
|
|
||||||
AllowTcpForwarding no
|
|
||||||
GatewayPorts no
|
|
||||||
X11Forwarding no
|
|
||||||
|
|
||||||
Subsystem sftp internal-sftp
|
|
||||||
|
|
||||||
ChrootDirectory /data
|
|
||||||
ForceCommand internal-sftp -d /data/www
|
|
||||||
Reference in New Issue
Block a user