Skip to content

Commit b01bb97

Browse files
committed
desc update
1 parent 0aa6e2c commit b01bb97

File tree

6 files changed

+21
-12
lines changed

6 files changed

+21
-12
lines changed

config/crontabs/root

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# * * * * * - time options, see more https://crontab.guru/
66
# flock - lock files are used to determine if a script or application is already running
77
# >> - append, > renew log file
8-
# >>/var/log/cron.log 2>&1 - send output to log
9-
# >/dev/null 2>&1 - send output to black hole
8+
# >> /var/log/cron.log 2>&1 - send output to log
9+
# > /dev/null 2>&1 - send output to black hole
1010
# 2>&1 redirects the output include both the Standard Error and Standard Out. Look details https://tldp.org/LDP/abs/html/io-redirection.html
1111

1212
# Example
@@ -20,8 +20,6 @@
2020
# WordPress cron run by system cron
2121
*/30 * * * * docker exec ${APP_NAME}_wordpress flock -n /var/log/wordpress/wp-cron.lck php /var/www/html/wp-cron.php >> /var/log/cron.log 2>&1
2222

23-
# Remove wp-cron log file once a week
24-
#1 3 * * 2 rm /var/log/cron/wp-cron.log >/dev/null 2>&1
2523

2624
# Backup database and media
2725
15 3 * * * start-backup.sh daily >> /var/log/cron.log 2>&1

config/nginx/templates/partials/basic_auth_enable.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Edit .template file to change settings
33

44
location ^~ /wp-login.php {
5-
auth_basic "Restricted Area: Look password in .env.secret";
5+
auth_basic "Restricted Area";
66
auth_basic_user_file /etc/nginx/auth/.wplogin;
77

88
include /etc/nginx/conf.d/partials/php.conf;

config/nginx/templates/partials/https.conf.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ server {
4141

4242
include /etc/nginx/conf.d/partials/logs.conf;
4343

44+
# Check and include Basic Auth config (15-setup-basic-auth.sh)
45+
include /etc/nginx/conf.d/partials/basic_auth_${APP_BA}.conf;
46+
4447
include /etc/nginx/conf.d/partials/wordpress.conf;
4548

4649
include /etc/nginx/conf.d/partials/php.conf;

docker/cron/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Based on https://habr.com/ru/company/redmadrobot/blog/305364/
2+
# https://github.com/renskiy/cron-docker-image
3+
# Thanks to renskiy
4+
15
FROM alpine:3.14
26

37
RUN set -ex \

docker/cron/start-backup.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,15 @@ if [ "$MODE" == "weekly" ]; then
2828
fi
2929

3030

31-
32-
33-
# Create backups directory (if not exist)
34-
mkdir -p "$BACKUPS_DIR"
35-
mkdir -p "$BACKUPS_DIR"/"$MODE"
36-
3731
# Check is backup enable
3832
if [ ! "$APP_WP_BACKUP_ENABLE" ] || [ "$APP_WP_BACKUP_ENABLE" == 0 ]; then
3933
echo "[Fail] Backup is disabled in .env file"; exit 1;
4034
fi
4135

36+
# Create backups directory (if not exist)
37+
mkdir -p "$BACKUPS_DIR"
38+
mkdir -p "$BACKUPS_DIR"/"$MODE"
39+
4240
# Wait 3 times
4341
for i in {1..3}
4442
do
@@ -51,7 +49,6 @@ do
5149
fi
5250
done
5351

54-
5552
# Make database backup
5653
docker exec "$DATABASE_CONTAINER" \
5754
mysqldump -u "$MYSQL_ROOT_USER" --password="$MYSQL_ROOT_PASSWORD" "$MYSQL_DATABASE" \

docker/cron/start-cron.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/usr/bin/env bash
22

3+
# Based on https://habr.com/ru/company/redmadrobot/blog/305364/
4+
# https://github.com/renskiy/cron-docker-image
5+
# Thanks to renskiy
6+
7+
# Stop when error
8+
set -e
9+
310
# setting user for additional cron jobs
411
case $1 in
512
-u=*|--user=*)

0 commit comments

Comments
 (0)