mirror of
https://github.com/YunoHost-Apps/peertube_ynh.git
synced 2024-09-03 19:56:29 +02:00
Shellcheck corrections
This commit is contained in:
parent
8eb702ab62
commit
8c8cd96094
4 changed files with 21 additions and 26 deletions
|
@ -30,9 +30,9 @@ ynh_abort_if_errors
|
|||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
final_path=$(ynh_app_setting_get $app final_path)
|
||||
domain=$(ynh_app_setting_get $app domain)
|
||||
db_name=$(ynh_app_setting_get $app psql_db)
|
||||
final_path=$(ynh_app_setting_get "$app" final_path)
|
||||
domain=$(ynh_app_setting_get "$app" domain)
|
||||
db_name=$(ynh_app_setting_get "$app" psql_db)
|
||||
|
||||
#=================================================
|
||||
# STANDARD BACKUP STEPS
|
||||
|
|
|
@ -114,7 +114,7 @@ ynh_app_setting_set "$app" psqlpwd "$db_pwd"
|
|||
ynh_psql_test_if_first_run
|
||||
ynh_psql_create_user "$app" "$db_pwd"
|
||||
ynh_psql_execute_as_root \
|
||||
"CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER "$app";"
|
||||
"CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER $app;"
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
|
@ -144,7 +144,7 @@ ynh_add_nginx_config
|
|||
|
||||
|
||||
# Set right permissions for curl install
|
||||
chown -R ""$app":"$app""$datadir"
|
||||
chown -R "$app":"$app" "$datadir"
|
||||
|
||||
# Reload Nginx
|
||||
systemctl reload nginx
|
||||
|
@ -153,12 +153,12 @@ systemctl reload nginx
|
|||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
|
||||
ynh_replace_string "__domain__" "$domain" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__db_name__" "$app" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__app__" "$app" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__db_pwd__" "$db_pwd" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__email__" "$admin_email" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__PORT__" "$port" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__domain__" "$domain" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__db_name__" "$app" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__app__" "$app" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__db_pwd__" "$db_pwd" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__email__" "$admin_email" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__PORT__" "$port" "$final_path/config/production.yaml"
|
||||
|
||||
|
||||
#=================================================
|
||||
|
@ -223,9 +223,9 @@ systemctl reload nginx
|
|||
|
||||
message="PeerTube was successfully installed :)
|
||||
|
||||
Please open "https://$domain$path_url"
|
||||
Please open 'https://$domain$path_url'
|
||||
|
||||
Here is the admin password: "$admin_pass"
|
||||
Here is the admin password: '$admin_pass'
|
||||
|
||||
If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/peertube_ynh"
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -20,7 +20,6 @@ domain=$(ynh_app_setting_get "$app" domain)
|
|||
path_url="/"
|
||||
is_public=$(ynh_app_setting_get "$app" is_public)
|
||||
admin_email=$(ynh_app_setting_get "$app" admin_email)
|
||||
admin_pass=$(ynh_app_setting_get "$app" admin_pass)
|
||||
final_path=$(ynh_app_setting_get "$app" final_path)
|
||||
port=$(ynh_app_setting_get "$app" port)
|
||||
db_name=$(ynh_app_setting_get "$app" psql_db)
|
||||
|
@ -133,12 +132,12 @@ systemctl reload nginx
|
|||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
|
||||
ynh_replace_string "__domain__" "$domain" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__db_name__" "$app" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__app__" "$app" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__db_pwd__" "$db_pwd" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__email__" "$admin_email" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__PORT__" "$port" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__domain__" "$domain" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__db_name__" "$app" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__app__" "$app" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__db_pwd__" "$db_pwd" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__email__" "$admin_email" "$final_path/config/production.yaml"
|
||||
ynh_replace_string "__PORT__" "$port" "$final_path/config/production.yaml"
|
||||
|
||||
|
||||
# Recalculate and store the config file checksum into the app settings
|
||||
|
@ -167,12 +166,12 @@ chown -R "$app":"$app" "$final_path" "$datadir"
|
|||
# SETUP SSOWAT
|
||||
#=================================================
|
||||
|
||||
if [ $is_public -eq 0 ]
|
||||
if [ "$is_public" -eq 0 ]
|
||||
then # Remove the public access
|
||||
ynh_app_setting_delete "$app" skipped_uris
|
||||
fi
|
||||
# Make app public if necessary
|
||||
if [ $is_public -eq 1 ]
|
||||
if [ "$is_public" -eq 1 ]
|
||||
then
|
||||
# unprotected_uris allows SSO credentials to be passed anyway
|
||||
ynh_app_setting_set "$app" unprotected_uris "/"
|
||||
|
@ -183,6 +182,3 @@ fi
|
|||
#=================================================
|
||||
|
||||
systemctl reload nginx
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue