Update to 2021-12-01 19:13

This commit is contained in:
Daniel Berteaud
2021-12-01 19:13:34 +01:00
commit 4c4556c660
2153 changed files with 60999 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
#!/bin/bash
set -eo pipefail
rm -f {{ sftpgo_root_dir }}/backup/*.sql.zst {{ sftpgo_root_dir }}/backup/id_*

View File

@@ -0,0 +1,16 @@
#!/bin/bash
set -eo pipefail
/usr/bin/mysqldump \
{% if sftpgo_db_server not in ['localhost', '127.0.0.1'] %}
--user={{ sftpgo_db_user | quote }} \
--password={{ sftpgo_db_pass | quote }} \
--host={{ sftpgo_db_server | quote }} \
--port={{ sftpgo_db_port }} \
{% endif %}
--quick --single-transaction \
--add-drop-table {{ sftpgo_db_name }} | \
zstd -c > {{ sftpgo_root_dir }}/backup/{{ sftpgo_db_name }}.sql.zst
cp -a {{ sftpgo_root_dir }}/etc/id_* {{ sftpgo_root_dir }}/backup/

View File

@@ -0,0 +1,33 @@
[Unit]
Description=SFTPGo Server
After=network.target mariadb.service mysqld.service postgresql.service
[Service]
User={{ sftpgo_user }}
Group={{ sftpgo_user }}
Type=simple
WorkingDirectory={{ sftpgo_root_dir }}/data
ExecStart={{ sftpgo_root_dir }}/app/sftpgo --config-file={{ sftpgo_root_dir }}/etc/sftpgo.yml --config-dir={{ sftpgo_root_dir }}/etc --log-file-path='' serve
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=mixed
Restart=always
StartLimitInterval=0
RestartSec=10s
PrivateTmp=true
PrivateDevices=yes
ProtectSystem=strict
ReadWritePaths={{ sftpgo_root_dir }}/etc/ {{ sftpgo_root_dir }}/data/ {{ sftpgo_root_dir }}/tmp
ProtectHome=yes
NoNewPrivileges=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
UMask=077
MemoryLimit=2048M
# Allow binding on privileged ports
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,3 @@
---
{{ sftpgo_conf | to_nice_yaml(indent=2, width=1000) }}