Compare commits
11 Commits
671bfc5a99
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
38a75be17a
|
|||
|
6de6a7e1c0
|
|||
|
c5bde2c411
|
|||
|
349a8a05e1
|
|||
|
4fb6d71a77
|
|||
|
1af3f39722
|
|||
|
b53adb411c
|
|||
|
2da562ffcb
|
|||
|
0f78f4cebc
|
|||
|
5de2b67275
|
|||
|
1857bd66c5
|
@@ -7,10 +7,8 @@ env:
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 12 3 * *"
|
- cron: "0 12 * * 3"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
@@ -48,7 +46,7 @@ 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 }}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
docker build \
|
docker build \
|
||||||
--tag ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-php74-${{ matrix.arch }} \
|
--tag ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-php74-${{ matrix.arch }} \
|
||||||
--platform linux/${{ matrix.arch }} -f Dockerfile-php74 .
|
--platform linux/${{ matrix.arch }} --no-cache -f Dockerfile-php74 .
|
||||||
docker push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-php74-${{ matrix.arch }}
|
docker push ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest-php74-${{ matrix.arch }}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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 }}`
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ services:
|
|||||||
DISABLE_WEBROOT_CHOWN: 1 # default: 0
|
DISABLE_WEBROOT_CHOWN: 1 # default: 0
|
||||||
DISABLE_SFTP: 1 # default: 0
|
DISABLE_SFTP: 1 # default: 0
|
||||||
DISABLE_STATS: 1 # default: 0
|
DISABLE_STATS: 1 # default: 0
|
||||||
|
DISABLE_STATS_HOURLY: 1 # default: 0
|
||||||
|
DISABLE_WEBDAV: 1 # default: 0
|
||||||
```
|
```
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ worker_processes auto;
|
|||||||
pcre_jit on;
|
pcre_jit on;
|
||||||
|
|
||||||
# Configures default error logger.
|
# Configures default error logger.
|
||||||
error_log /data/logs/nginx-error.log warn;
|
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;
|
||||||
@@ -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" '
|
||||||
@@ -96,7 +100,7 @@ http {
|
|||||||
'"$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.
|
# Sets the path, format, and configuration for a buffered log write.
|
||||||
access_log /data/logs/nginx-access.log main;
|
access_log /var/log/nginx/access.log main;
|
||||||
|
|
||||||
|
|
||||||
# Includes virtual hosts configs.
|
# Includes virtual hosts configs.
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ FPM_MAX_SPARE_SERVERS=${FPM_MAX_SPARE_SERVERS:-3}
|
|||||||
DISABLE_WEBROOT_CHOWN=${DISABLE_WEBROOT_CHOWN:-0}
|
DISABLE_WEBROOT_CHOWN=${DISABLE_WEBROOT_CHOWN:-0}
|
||||||
DISABLE_SFTP=${DISABLE_SFTP:-0}
|
DISABLE_SFTP=${DISABLE_SFTP:-0}
|
||||||
DISABLE_STATS=${DISABLE_STATS:-0}
|
DISABLE_STATS=${DISABLE_STATS:-0}
|
||||||
|
DISABLE_STATS_HOURLY=${DISABLE_STATS_HOURLY:-0}
|
||||||
|
DISABLE_WEBDAV=${DISABLE_WEBDAV:-0}
|
||||||
|
|
||||||
export USERNAME
|
export USERNAME
|
||||||
export GROUPNAME
|
export GROUPNAME
|
||||||
@@ -51,6 +53,8 @@ export FPM_MAX_SPARE_SERVERS
|
|||||||
export DISABLE_WEBROOT_CHOWN
|
export DISABLE_WEBROOT_CHOWN
|
||||||
export DISABLE_SFTP
|
export DISABLE_SFTP
|
||||||
export DISABLE_STATS
|
export DISABLE_STATS
|
||||||
|
export DISABLE_STATS_HOURLY
|
||||||
|
export DISABLE_WEBDAV
|
||||||
|
|
||||||
# run all scripts in order
|
# run all scripts in order
|
||||||
run-parts /app/entrypoint.sh.d
|
run-parts /app/entrypoint.sh.d
|
||||||
@@ -78,8 +82,10 @@ echo "# Starting cron"
|
|||||||
crond -b
|
crond -b
|
||||||
|
|
||||||
# start ssh
|
# start ssh
|
||||||
|
if [ "${DISABLE_SFTP}" -ne 1 ] ; then
|
||||||
echo "# Starting ssh"
|
echo "# Starting ssh"
|
||||||
/usr/sbin/sshd -e
|
/usr/sbin/sshd -e
|
||||||
|
fi
|
||||||
|
|
||||||
# start nginx
|
# start nginx
|
||||||
echo "# Starting nginx"
|
echo "# Starting nginx"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ ${PATH_LOGS}/nginx-access.log {
|
|||||||
compress
|
compress
|
||||||
delaycompress
|
delaycompress
|
||||||
sharedscripts
|
sharedscripts
|
||||||
|
nodateext
|
||||||
su ${USERNAME} ${GROUPNAME}
|
su ${USERNAME} ${GROUPNAME}
|
||||||
postrotate
|
postrotate
|
||||||
/usr/sbin/nginx -s reopen
|
/usr/sbin/nginx -s reopen
|
||||||
|
|||||||
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
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ ${DISABLE_WEBDAV} -eq 1 ] ; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo "# Configuring webdav"
|
echo "# Configuring webdav"
|
||||||
|
|
||||||
cat > /etc/nginx/http.d/webdav.conf <<EOF
|
cat > /etc/nginx/http.d/webdav.conf <<EOF
|
||||||
|
|||||||
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
|
||||||
Reference in New Issue
Block a user