1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/shiori_ynh.git synced 2024-09-03 20:26:17 +02:00
This commit is contained in:
Éric Gaspar 2023-10-03 11:27:25 +02:00
parent 9d4e16840c
commit fdc07530c7
5 changed files with 24 additions and 3 deletions

4
conf/.env Normal file
View file

@ -0,0 +1,4 @@
SHIORI_WEBROOT=__PATH__
SHIORI_PORT__PORT__
SHIORI_DIR=__DATA_DIR__
SHIORI_DATABASE_URL="postgres://__DB_USER__:__DB_PWD__@hostname/__DB_NAME__?sslmode=verify-full"

View file

@ -8,9 +8,8 @@ Type=simple
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
WorkingDirectory=__INSTALL_DIR__/ WorkingDirectory=__INSTALL_DIR__/
ExecStart=__INSTALL_DIR__/shiori serve --port __PORT__ --webroot __PATH__ ExecStart=__INSTALL_DIR__/shiori serve
Restart=always Restart=always
Environment="SHIORI_DIR=__DATA_DIR__"
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -69,4 +69,8 @@ ram.runtime = "50M"
api.auth_header = false api.auth_header = false
[resources.apt] [resources.apt]
packages = "sqlite3" packages = "postgresql"
[resources.database]
type = "postgresql"

View file

@ -41,6 +41,13 @@ ynh_backup --src_path="/etc/logrotate.d/$app"
ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP THE PostgreSQL DATABASE
#=================================================
ynh_print_info --message="Backing up the PostgreSQL database..."
ynh_psql_dump_db --database="$db_name" > db.sql
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -30,6 +30,13 @@ ynh_restore_file --origin_path="$data_dir" --not_mandatory
chown -R $app:www-data "$data_dir" chown -R $app:www-data "$data_dir"
#=================================================
# RESTORE THE PostgreSQL DATABASE
#=================================================
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1
ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
#================================================= #=================================================
# RESTORE SYSTEM CONFIGURATIONS # RESTORE SYSTEM CONFIGURATIONS
#================================================= #=================================================