summarylogtreecommitdiffstats
path: root/sftpgo.install
diff options
context:
space:
mode:
Diffstat (limited to 'sftpgo.install')
-rw-r--r--sftpgo.install23
1 files changed, 8 insertions, 15 deletions
diff --git a/sftpgo.install b/sftpgo.install
index 7b07b717ccbc..f64e1b59280b 100644
--- a/sftpgo.install
+++ b/sftpgo.install
@@ -1,3 +1,11 @@
+post_install() {
+ setcap cap_net_bind_service=+ep /usr/bin/sftpgo
+}
+
+post_upgrade() {
+ setcap cap_net_bind_service=+ep /usr/bin/sftpgo
+}
+
pre_remove() {
systemctl stop sftpgo.service
cat <<EOF
@@ -6,18 +14,3 @@ pre_remove() {
==> group 'sftpgo'
EOF
}
-
-post_upgrade() {
- if (( $(vercmp $2 1.0.0-4) < 0 )); then
- chown -R 315:315 /etc/sftpgo /var/lib/sftpgo
- chmod 750 /etc/sftpgo /var/lib/sftpgo
- chmod 640 /etc/sftpgo/sftpgo.json
- cat <<EOF
-==> After this update SFTPGo will run using the dedicated "sftpgo"
-==> system user, you will probably need to manually fix the
-==> permissions for the SFTPGo virtual users home directory using
-==>
-==> chown -R sftpgo:sftpgo </path/to/sftpgo/home/dir>
-EOF
-fi
-}