mirror of
https://github.com/YunoHost-Apps/weblate_ynh.git
synced 2024-10-01 13:35:04 +02:00
Fix restoration
This commit is contained in:
parent
946da28c3b
commit
ca3582ac02
3 changed files with 9 additions and 5 deletions
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
The YunoHost team uses [Weblate](https://weblate.org) for translations: https://translate.yunohost.org
|
The YunoHost team uses [Weblate](https://weblate.org) for translations: https://translate.yunohost.org
|
||||||
|
|
||||||
|
## Admin
|
||||||
|
|
||||||
|
An admin user is created at installation, the password is *weblate*.
|
||||||
|
|
||||||
## Weblate and databases
|
## Weblate and databases
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ ynh_psql_execute_as_root () {
|
||||||
ynh_psql_execute_file_as_root() {
|
ynh_psql_execute_file_as_root() {
|
||||||
file="$1"
|
file="$1"
|
||||||
db="$2"
|
db="$2"
|
||||||
sudo -u postgres psql "$db" <<< "$file"
|
su -c "psql $db" postgres < $file
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create a database, an user and its password. Then store the password in the app's config
|
# Create a database, an user and its password. Then store the password in the app's config
|
||||||
|
|
|
@ -31,6 +31,7 @@ domain=$(ynh_app_setting_get $app domain)
|
||||||
path_url=$(ynh_app_setting_get $app path)
|
path_url=$(ynh_app_setting_get $app path)
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
db_name=$(ynh_app_setting_get $app db_name)
|
db_name=$(ynh_app_setting_get $app db_name)
|
||||||
|
db_pwd=$(ynh_app_setting_get "$app" psqlpwd)
|
||||||
smtp_pwd=$(ynh_app_setting_get $app smtppwd)
|
smtp_pwd=$(ynh_app_setting_get $app smtppwd)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -85,16 +86,15 @@ ynh_install_app_dependencies libxml2-dev libxslt-dev libfreetype6-dev \
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_psql_test_if_first_run
|
ynh_psql_test_if_first_run
|
||||||
|
|
||||||
db_pwd=$(ynh_app_setting_get "$app" pgsqlpwd)
|
|
||||||
ynh_psql_setup_db "$db_name" "$db_name" "$db_pwd"
|
ynh_psql_setup_db "$db_name" "$db_name" "$db_pwd"
|
||||||
ynh_psql_connect_as "$db_name" "$db_pwd" "$db_name" < ./db.sql
|
ynh_psql_execute_file_as_root ./db.sql "$db_name"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE SERVICE
|
# RESTORE THE SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_restore_file "/etc/systemd/system/$app.service"
|
ynh_restore_file "/etc/systemd/system/$app.service"
|
||||||
|
systemctl enable "$app.service"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||||
|
@ -121,4 +121,5 @@ ynh_restore_file "/etc/logrotate.d/$app"
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
systemctl reload "$app.service"
|
systemctl stop "$app.service"
|
||||||
|
systemctl start "$app.service"
|
||||||
|
|
Loading…
Reference in a new issue