2
0

Compare commits

..

5 Commits

8 changed files with 34 additions and 7 deletions

BIN
.metadata

Binary file not shown.

View File

@ -11,6 +11,8 @@
#
# Author: Kovács Zoltán <kovacs.zoltan@smartfront.hu>
# License: GNU/GPL v3+ (https://www.gnu.org/licenses/gpl-3.0.en.html)
# 2025-05-21 v0.3.1
# fix: Wrong variable name (BASE_DIR instead of SERVICE_BASE) in a check.
# 2025-05-20 v0.3
# fix: Wrong output redirection order (>/dev/null 2>&1 was reversed).
# 2024-08-25 v0.2
@ -134,7 +136,7 @@ fi
# The service must be running - silently gives up here if not.
#
[[ -z "$(cd "$BASE_DIR"; "$DOCKER_COMPOSE" $commandstring ps --services --filter "status=running")" ]] \
[[ -z "$(cd "$SERVICE_BASE"; "$DOCKER_COMPOSE" $commandstring ps --services --filter "status=running")" ]] \
&& exit 1
# Attempts the backup commit.

View File

@ -21,6 +21,11 @@
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# This hack reverts a modification in Filebrowser (2.33.1):
# https://github.com/filebrowser/filebrowser/commit/8a14018861fe581672bbd27cdc3ae5691f70a108
# We don't force to download PDFs.
more_clear_headers -t 'application/pdf' 'Content-Disposition';
#websockets
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;

View File

@ -20,8 +20,12 @@ services:
volumes:
# The Linux user defined above must have R/W access here.
- ./storage/volumes/staticweb:/srv
- ./storage/volumes/filebrowser_data/filebrowser.json:/.filebrowser.json
- ./storage/volumes/filebrowser_data/database.db:/.database.db
# Proper mounts before 2.33.0 version (2025-06-18).
#- ./storage/volumes/filebrowser_data/database.db:/.database.db
#- ./storage/volumes/filebrowser_data/filebrowser.json:/.filebrowser.json
# Proper mounts since 2.33.0 version (2025-06-18).
- ./storage/volumes/filebrowser_data/database.db:/database/filebrowser.db
- ./storage/volumes/filebrowser_data/filebrowser-new.json:/config/settings.json
extra_hosts:
- "host.docker.internal:host-gateway"
labels:

View File

@ -0,0 +1,8 @@
{
"port": 80,
"baseURL": "/",
"address": "",
"log": "stdout",
"database": "/database/filebrowser.db",
"root": "/srv"
}

View File

@ -11,6 +11,8 @@
#
# Author: Kovács Zoltán <kovacs.zoltan@smartfront.hu>
# License: GNU/GPL v3+ (https://www.gnu.org/licenses/gpl-3.0.en.html)
# 2025-05-21 v0.3.1
# fix: Wrong variable name (BASE_DIR instead of SERVICE_BASE) in a check.
# 2025-05-20 v0.3
# fix: The docker itself was missing from the dependency list :(.
# fix: Wrong output redirection order (>/dev/null 2>&1 was reversed).
@ -135,7 +137,7 @@ fi
# The service must be running - silently gives up here if not.
#
[[ -z "$(cd "$BASE_DIR"; "$DOCKER_COMPOSE" $commandstring ps --services --filter "status=running")" ]] \
[[ -z "$(cd "$SERVICE_BASE"; "$DOCKER_COMPOSE" $commandstring ps --services --filter "status=running")" ]] \
&& exit 1
# Attempts the backup commit.
@ -149,6 +151,7 @@ if [ ! -d "$GITDIR/.git" ]; then
fi
# Stages all the files and non-empty folders.
"$GIT" --git-dir="$GITDIR/.git" --work-tree="$SOURCEDIR" add . >/dev/null
# Stores the file system metadata as well, if the tool has been installed.
if [ ! -z "$(which metastore)" -a -x "$(which metastore)" ]; then
# This commamd silently creates the metastore file if it doesnt' exist yet.

View File

@ -10,6 +10,8 @@
#
# Author: Kovács Zoltán <kovacsz@marcusconsulting.hu>
# License: GNU/GPL v3+ (https://www.gnu.org/licenses/gpl-3.0.en.html)
# 2025-05-26 v0.3
# mod: The .gz extension has been added to the CLASSES_PATTERN.
# 2025-04-02 v0.2
# fix: Omits all warnings about missing source folder(s).
# 2025-03-06 v0.1 Initial release
@ -22,7 +24,7 @@ PAR_RETAINDAYS=${PAR_RETAINDAYS:-"1"} # Days to retain the copies
PAR_TARBALLDIR=${PAR_TARBALLDIR:-""} # Absolute path to tgz dumps
# Other initialisations.
CLASSES_PATTERN="^([^.]*)\..*\.$HOSTNAME\.(dmp|sql\.gz|tgz|log)$"
CLASSES_PATTERN="^([^.]*)\..*\.$HOSTNAME\.(dmp|sql\.gz|gz|tgz|log)$"
DUMPPATH="storage/backups/dumps" # Default path to DB dumps
EXPORTPATH="storage/backups/export" # Default path to export dir
TARBALLPATH="storage/backups/tarballs" # Default path to tgz dumps

View File

@ -6,6 +6,8 @@
# Author: Kovács Zoltán <kovacsz@marcusconsulting.hu>
# License: GNU/GPL v3+ (https://www.gnu.org/licenses/gpl-3.0.en.html)
#
# 2025-06-01 v0.4
# fix: better continuation of existing log file (even if empty).
# 2025-03-29 v0.3
# mod: no longer repeats existing log lines.
# 2025-02-26 v0.2
@ -103,10 +105,11 @@ else
[[ -n "$logline" ]] \
&& timestamp="$(echo "$logline" | "$CUT" -d' ' -f1 2>/dev/null)" \
|| timestamp="invalid"
# Checks the validity.
# If the log does not contain a valid last timestamp, we write log lines
# created since the last time the container was started.
[[ $("$DATE" -d "$timestamp" >/dev/null 2>&1; echo $?) -eq 0 ]] \
&& since="$timestamp" \
|| since="1970-01-01T00:00Z"
|| since="$("$DOCKER" inspect -f '{{ .State.StartedAt }}' $container)"
# Only logs the new lines (actually repeats the last one - TODO!).
"$DOCKER" logs -t --since "$since" -f $container >> "$BASE_DIR/$LOGDIR/$service.log" 2>&1 &
fi