mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-26 15:55:56 +02:00
Update to 2021-12-01 19:13
This commit is contained in:
5
roles/sftpgo/templates/post-backup.j2
Normal file
5
roles/sftpgo/templates/post-backup.j2
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
rm -f {{ sftpgo_root_dir }}/backup/*.sql.zst {{ sftpgo_root_dir }}/backup/id_*
|
16
roles/sftpgo/templates/pre-backup.j2
Normal file
16
roles/sftpgo/templates/pre-backup.j2
Normal 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/
|
33
roles/sftpgo/templates/sftpgo.service.j2
Normal file
33
roles/sftpgo/templates/sftpgo.service.j2
Normal 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
|
3
roles/sftpgo/templates/sftpgo.yml.j2
Normal file
3
roles/sftpgo/templates/sftpgo.yml.j2
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
|
||||
{{ sftpgo_conf | to_nice_yaml(indent=2, width=1000) }}
|
Reference in New Issue
Block a user