1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/librespeed_ynh.git synced 2024-09-03 19:36:23 +02:00

edit manifest + add mail for contact

This commit is contained in:
rungeard 2021-05-12 19:25:08 +02:00
parent e218132d2d
commit 04b541f57d
2 changed files with 23 additions and 12 deletions

View file

@ -3,10 +3,10 @@
"id": "librespeed",
"packaging_format": 1,
"description": {
"en": "This is a very lightweight Speedtest implemented in Javascript, using XMLHttpRequest and Web Workers.",
"fr": "Test de vitesse de connexion très léger implémenté en Javascript, utilisant XMLHttpRequest et Web Workers."
"en": "Very lightweight Speedtest.",
"fr": "Test de vitesse de connexion très léger."
},
"version": "1.0~ynh1",
"version": "5.2.4~ynh1",
"url": "https://librespeed.org/",
"upstream": {
"license": "GPL-3.0",
@ -56,6 +56,15 @@
"fr": "Ce mot de passe permet d'accéder aux statistiques des tests"
},
"example": "Choose a password"
},
{
"name": "mail",
"type": "string",
"help": {
"en": "Email address to contact for stats deletion requests",
"fr": "Couriel à contacter pour demander une suppression des statistiques"
},
"example": "webmaster@example.com"
}
]
}

View file

@ -28,6 +28,7 @@ domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH
is_public=$YNH_APP_ARG_IS_PUBLIC
password=$YNH_APP_ARG_PASSWORD
mail=$YNH_APP_ARG_MAIL
### If it's a multi-instance app, meaning it can be installed several times independently
### The id of the app as stated in the manifest is available as $YNH_APP_ID
@ -119,8 +120,6 @@ ynh_setup_source --dest_dir="$final_path"
# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder -
# this will be treated as a security issue.
#mv $final_path/'example-singleServer-full.html' "$final_path/index.html"
chmod 750 "$final_path"
chown -R $app:www-data $final_path
chmod o-rwx $final_path
@ -163,14 +162,17 @@ ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name
#=================================================
ynh_script_progression --message="Configuring LibreSpeed..."
rc_conf="$final_path/results/telemetry_settings.php"
conf_telemetry="$final_path/results/telemetry_settings.php"
conf_index="$final_path/example-singleServer-full.html"
ynh_replace_string --match_string="stats_password = 'PASSWORD'" --replace_string="stats_password = '$password'" --target_file="$rc_conf"
ynh_replace_string --match_string="MySql_username = 'USERNAME'" --replace_string="MySql_username = '$db_user'" --target_file="$rc_conf"
ynh_replace_string --match_string="MySql_password = 'PASSWORD'" --replace_string="MySql_password = '$db_pwd'" --target_file="$rc_conf"
ynh_replace_string --match_string="MySql_databasename = 'DB_NAME'" --replace_string="MySql_databasename = '$db_name'" --target_file="$rc_conf"
ynh_replace_string --match_string="MySql_hostname = 'DB_HOSTNAME'" --replace_string="MySql_hostname = 'localhost'" --target_file="$rc_conf"
ynh_replace_string --match_string="enable_id_obfuscation = false" --replace_string="enable_id_obfuscation = true" --target_file="$rc_conf"
ynh_replace_string --match_string="stats_password = 'PASSWORD'" --replace_string="stats_password = '$password'" --target_file="$conf_telemetry"
ynh_replace_string --match_string="MySql_username = 'USERNAME'" --replace_string="MySql_username = '$db_user'" --target_file="$conf_telemetry"
ynh_replace_string --match_string="MySql_password = 'PASSWORD'" --replace_string="MySql_password = '$db_pwd'" --target_file="$conf_telemetry"
ynh_replace_string --match_string="MySql_databasename = 'DB_NAME'" --replace_string="MySql_databasename = '$db_name'" --target_file="$conf_telemetry"
ynh_replace_string --match_string="MySql_hostname = 'DB_HOSTNAME'" --replace_string="MySql_hostname = 'localhost'" --target_file="$conf_telemetry"
ynh_replace_string --match_string="enable_id_obfuscation = false" --replace_string="enable_id_obfuscation = true" --target_file="$conf_telemetry"
ynh_replace_string --match_string='<a href="mailto:PUT@YOUR_EMAIL.HERE">TO BE FILLED BY DEVELOPER</a>.' --replace_string='<a href="mailto:'$mail'">'$mail'</a>.' --target_file="$conf_index"
#=================================================
# GENERIC FINALIZATION