mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 06:34:25 -04:00
Set archivebox UID/GID via envvars
This commit is contained in:
parent
1442e73f22
commit
db96e7d75b
1 changed files with 8 additions and 0 deletions
|
@ -3,6 +3,14 @@
|
||||||
DATA_DIR="${DATA_DIR:-/data}"
|
DATA_DIR="${DATA_DIR:-/data}"
|
||||||
ARCHIVEBOX_USER="${ARCHIVEBOX_USER:-archivebox}"
|
ARCHIVEBOX_USER="${ARCHIVEBOX_USER:-archivebox}"
|
||||||
|
|
||||||
|
# Set the archivebox user UID & GID
|
||||||
|
if [[ -n "$ARCHIVEBOX_UID" && "$ARCHIVEBOX_UID" != 0 ]]; then
|
||||||
|
usermod -u "$ARCHIVEBOX_UID" "$ARCHIVEBOX_USER" > /dev/null 2>&1
|
||||||
|
fi
|
||||||
|
if [[ -n "$ARCHIVEBOX_GID" && "$ARCHIVEBOX_GID" != 0 ]]; then
|
||||||
|
groupmod -g "$ARCHIVEBOX_GID" "$ARCHIVEBOX_USER" > /dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
# Set the permissions of the data dir to match the archivebox user
|
# Set the permissions of the data dir to match the archivebox user
|
||||||
if [[ -d "$DATA_DIR/archive" ]]; then
|
if [[ -d "$DATA_DIR/archive" ]]; then
|
||||||
# check data directory permissions
|
# check data directory permissions
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue