mirror of
https://github.com/YunoHost-Apps/galene_ynh.git
synced 2024-09-03 18:36:31 +02:00
Fix
This commit is contained in:
parent
8392c7495f
commit
5c1fe076f4
2 changed files with 15 additions and 27 deletions
|
@ -180,7 +180,7 @@ chown -R $app:root $final_path
|
|||
chmod -R 755 $final_path
|
||||
chown -R $app:root /var/log/$app
|
||||
chown -R $app:root /etc/$app
|
||||
chown turnserver:root $coturn_config_path
|
||||
chown turnserver:root /etc/$app/coturn.conf
|
||||
chmod -R u=rwX,g=rX,o= /etc/$app
|
||||
chmod 770 $final_path/Coturn_config_rotate.sh
|
||||
setfacl -R -m user:turnserver:rX /etc/$app
|
||||
|
|
|
@ -47,20 +47,6 @@ if [ -z "$final_path" ]; then
|
|||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
fi
|
||||
|
||||
if [ -z "$final_path/groups" ]; then
|
||||
# Define app's groups directory
|
||||
groups="$final_path/groups"
|
||||
#Create groups folder
|
||||
mkdir -p "$groups"
|
||||
fi
|
||||
|
||||
if [ -z "$final_path/data" ]; then
|
||||
# Define app's data directory
|
||||
data="$final_path/data"
|
||||
# Create data folder
|
||||
mkdir -p "$data"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
|
@ -103,12 +89,26 @@ then
|
|||
|
||||
ynh_setup_source --dest_dir="$final_path" --source_id="$architecture"
|
||||
|
||||
groups="$final_path/groups"
|
||||
data="$final_path/data"
|
||||
|
||||
mkdir -p "$groups"
|
||||
mkdir -p "$data"
|
||||
|
||||
# Copy the admin saved settings from tmp directory to final path
|
||||
cp -ar "$tmpdir/groups" "$final_path/groups"
|
||||
|
||||
# Remove the tmp directory securely
|
||||
ynh_secure_remove --file="$tmpdir"
|
||||
|
||||
ynh_backup_if_checksum_is_different --file="$final_path/data/passwd"
|
||||
ynh_add_config --template="../conf/passwd" --destination="$final_path/data/passwd"
|
||||
ynh_store_file_checksum --file="$final_path/data/passwd"
|
||||
|
||||
ynh_backup_if_checksum_is_different --file="$final_path/data/ice-servers.json"
|
||||
ynh_add_config --template="../conf/ice-servers.json" --destination="$final_path/data/ice-servers.json"
|
||||
ynh_store_file_checksum --file="$final_path/data/ice-servers.json"
|
||||
|
||||
# Recreate certificates
|
||||
pushd "$final_path/data"
|
||||
ynh_exec_warn_less openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out cert.pem \
|
||||
|
@ -207,18 +207,6 @@ ynh_replace_string --match_string=__IPV4__ --replace_string=$public_ip4 --target
|
|||
ynh_replace_string --match_string=__IPV6__ --replace_string=$public_ip6 --target_file="$final_path/Coturn_config_rotate.sh"
|
||||
chmod +x $final_path/Coturn_config_rotate.sh
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
|
||||
ynh_backup_if_checksum_is_different --file="$final_path/data/passwd"
|
||||
ynh_add_config --template="../conf/passwd" --destination="$final_path/data/passwd"
|
||||
ynh_store_file_checksum --file="$final_path/data/passwd"
|
||||
|
||||
ynh_backup_if_checksum_is_different --file="$final_path/data/ice-servers.json"
|
||||
ynh_add_config --template="../conf/ice-servers.json" --destination="$final_path/data/ice-servers.json"
|
||||
ynh_store_file_checksum --file="$final_path/data/ice-servers.json"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue