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,15 @@
[http]
port = {{ documize_port }}
[database]
{% if documize_db_engine == 'mysql' %}
type = "mysql"
connection = "{{ documize_db_user }}:{{ documize_db_pass }}@tcp({{ documize_db_server }}:{{ documize_db_port }})/{{ documize_db_name }}"
{% elif documize_db_engine == 'postgres' %}
type = "postgresql"
connection = "host={{ documize_db_server }} port={{ documize_db_port }} dbname={{ documize_db_name }} user={{ documize_db_user }} password={{ documize_db_pass }} sslmode=disable"
{% endif %}
salt = "{{ documize_salt }}"
[install]
location = "selfhost"

View File

@@ -0,0 +1,24 @@
[Unit]
Description=Documize Documentation Manager
After=network.target postgresql.service mariadb.service
[Service]
Type=simple
User={{ documize_user }}
ExecStart={{ documize_root_dir }}/bin/documize {{ documize_root_dir }}/etc/documize.conf
WorkingDirectory={{ documize_root_dir }}/tmp
Restart=always
NoNewPrivileges=true
PrivateDevices=true
ProtectControlGroups=true
ProtectHome=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectSystem=strict
RestrictRealtime=true
ReadWritePaths=/run
PrivateTmp=true
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,3 @@
#!/bin/bash -e
rm -f {{ documize_root_dir }}/backup/*

View File

@@ -0,0 +1,26 @@
#!/bin/sh
set -eo pipefail
{% if documize_db_engine == 'mysql' %}
/usr/bin/mysqldump \
{% if documize_db_server not in ['127.0.0.1','localhost'] %}
--user={{ documize_db_user | quote }} \
--password={{ documize_db_pass | quote }} \
--host={{ documize_db_server | quote }} \
{% endif %}
--quick --single-transaction \
--add-drop-table {{ documize_db_name | quote }} | zstd -c > "{{ documize_root_dir }}/backup/{{ documize_db_name }}.sql.zst"
{% elif documize_db_engine == 'postgres' %}
{% if documize_db_server not in ['127.0.0.1','localhost'] %}
PGPASSWORD={{ documize_db_pass | quote }} /usr/pgsql-14/bin/pg_dump \
--clean \
--create \
--username={{ documize_db_user | quote }} \
--host={{ documize_db_server | quote }} \
{{ documize_db_name | quote }} | \
{% else %}
su - postgres -c "/usr/pgsql-14/bin/pg_dump --clean --create {{ documize_db_name | quote }}" | \
{% endif %}
zstd -c > "{{ documize_root_dir }}/backup/{{ documize_db_name }}.sql.zst"
{% endif %}