Linux pkgs: move data directory to /srv/sftpgo

This commit is contained in:
Nicola Murino 2020-10-14 22:25:58 +02:00
parent 00510a6af8
commit 555394b95e
No known key found for this signature in database
GPG key ID: 2F1FB59433D5A8CB
7 changed files with 34 additions and 5 deletions

View file

@ -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.

View file

@ -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.

View file

@ -61,7 +61,7 @@ config_files:
empty_folders:
- /var/lib/sftpgo
- /srv/sftpgo/data
- /srv/sftpgo
overrides:
deb:

View file

@ -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#
#DEBHELPER#

View file

@ -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

View file

@ -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

View file

@ -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 || :