mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-25 00:50:31 +00:00
Linux pkgs: move data directory to /srv/sftpgo
This commit is contained in:
parent
00510a6af8
commit
555394b95e
7 changed files with 34 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
|||
# SFTPGo with Docker and Alpine
|
||||
|
||||
:warning: The recommended way to run SFTPGo on Docker is to use the official [images](https://github.com/users/drakkan/packages/container/package/sftpgo). The documentation here is now obsolete.
|
||||
:warning: The recommended way to run SFTPGo on Docker is to use the official [images](https://hub.docker.com/r/drakkan/sftpgo). The documentation here is now obsolete.
|
||||
|
||||
This DockerFile is made to build image to host multiple instances of SFTPGo started with different users.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Dockerfile based on Debian stable
|
||||
|
||||
:warning: The recommended way to run SFTPGo on Docker is to use the official [images](https://github.com/users/drakkan/packages/container/package/sftpgo). The documentation here is now obsolete.
|
||||
:warning: The recommended way to run SFTPGo on Docker is to use the official [images](https://hub.docker.com/r/drakkan/sftpgo). The documentation here is now obsolete.
|
||||
|
||||
Please read the comments inside the `Dockerfile` to learn how to customize things for your setup.
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ config_files:
|
|||
|
||||
empty_folders:
|
||||
- /var/lib/sftpgo
|
||||
- /srv/sftpgo/data
|
||||
- /srv/sftpgo
|
||||
|
||||
overrides:
|
||||
deb:
|
||||
|
|
|
@ -28,6 +28,15 @@ if [ "$1" = "configure" ]; then
|
|||
chmod 640 /etc/sftpgo/sftpgo.json
|
||||
echo "Please be sure to have the python3-requests package installed if you want to use the REST API CLI"
|
||||
fi
|
||||
|
||||
# check permissions for /srv/sftpgo and adjust them if needed
|
||||
if [ -d /srv/sftpgo ]; then
|
||||
if [ $(stat -c '%U' /srv/sftpgo) != sftpgo ]; then
|
||||
echo "Set permissions for /srv/sftpgo"
|
||||
chown -R sftpgo:sftpgo /srv/sftpgo
|
||||
chmod 750 /srv/sftpgo
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
|
@ -28,6 +28,15 @@ if [ "$1" = "configure" ]; then
|
|||
chmod 640 /etc/sftpgo/sftpgo.json
|
||||
echo "Please be sure to have the python3-requests package installed if you want to use the REST API CLI"
|
||||
fi
|
||||
|
||||
# check permissions for /srv/sftpgo and adjust them if needed
|
||||
if [ -d /srv/sftpgo ]; then
|
||||
if [ $(stat -c '%U' /srv/sftpgo) != sftpgo ]; then
|
||||
echo "Set permissions for /srv/sftpgo"
|
||||
chown -R sftpgo:sftpgo /srv/sftpgo
|
||||
chmod 750 /srv/sftpgo
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
|
||||
|
|
|
@ -15,4 +15,5 @@ if [ "$1" = "purge" ]; then
|
|||
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||
deb-systemd-helper purge 'sftpgo.service' >/dev/null || true
|
||||
deb-systemd-helper unmask 'sftpgo.service' >/dev/null || true
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -19,7 +19,17 @@ if [ $1 -eq 1 ]; then
|
|||
/usr/bin/chown -R sftpgo:sftpgo /etc/sftpgo /var/lib/sftpgo /srv/sftpgo
|
||||
/usr/bin/chmod 750 /etc/sftpgo /var/lib/sftpgo /srv/sftpgo
|
||||
/usr/bin/chmod 640 /etc/sftpgo/sftpgo.json
|
||||
echo "Please be sure to have the python requests library installed if you want to use the REST API CLI"
|
||||
/bin/echo "Please be sure to have the python requests library installed if you want to use the REST API CLI"
|
||||
fi
|
||||
|
||||
# check permissions for /srv/sftpgo and adjust them if needed
|
||||
if [ -d /srv/sftpgo ]; then
|
||||
if [ $(/usr/bin/stat -c '%U' /srv/sftpgo) != sftpgo ]; then
|
||||
/bin/echo "Set permissions for /srv/sftpgo"
|
||||
/usr/bin/chown -R sftpgo:sftpgo /srv/sftpgo
|
||||
/usr/bin/chmod 750 /srv/sftpgo
|
||||
fi
|
||||
fi
|
||||
|
||||
# reload to pick up any changes to systemd files
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
|
|
Loading…
Reference in a new issue