mirror of
https://github.com/YunoHost-Apps/mastodon_ynh.git
synced 2024-09-03 19:46:02 +02:00
Merge pull request #277 from YunoHost-Apps/testing
[fix] Set REDIS_NAMESPACE for multiple instances
This commit is contained in:
commit
8d43dff87a
4 changed files with 12 additions and 1 deletions
|
@ -14,6 +14,7 @@ LOCAL_DOMAIN=__DOMAIN__
|
||||||
# -----
|
# -----
|
||||||
REDIS_HOST=localhost
|
REDIS_HOST=localhost
|
||||||
REDIS_PORT=6379
|
REDIS_PORT=6379
|
||||||
|
REDIS_NAMESPACE=__REDIS_NAMESPACE__
|
||||||
|
|
||||||
# PostgreSQL
|
# PostgreSQL
|
||||||
# ----------
|
# ----------
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"en": "A libre and federated social network.",
|
"en": "A libre and federated social network.",
|
||||||
"fr": "Un réseau social libre et fédéré."
|
"fr": "Un réseau social libre et fédéré."
|
||||||
},
|
},
|
||||||
"version": "3.3.0~ynh3",
|
"version": "3.3.0~ynh4",
|
||||||
"url": "https://github.com/tootsuite/mastodon",
|
"url": "https://github.com/tootsuite/mastodon",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
|
|
|
@ -162,6 +162,9 @@ config="$final_path/live/.env.production"
|
||||||
|
|
||||||
language="$(echo $language | head -c 2)"
|
language="$(echo $language | head -c 2)"
|
||||||
|
|
||||||
|
redis_namespace=${app}_production
|
||||||
|
ynh_app_setting_set --app="$app" --key=redis_namespace --value="$redis_namespace"
|
||||||
|
|
||||||
secret_key_base=$(ynh_string_random --length=128)
|
secret_key_base=$(ynh_string_random --length=128)
|
||||||
ynh_app_setting_set --app="$app" --key=secret_key_base --value="$secret_key_base"
|
ynh_app_setting_set --app="$app" --key=secret_key_base --value="$secret_key_base"
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
admin=$(ynh_app_setting_get --app=$app --key=admin)
|
admin=$(ynh_app_setting_get --app=$app --key=admin)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
language=$(ynh_app_setting_get --app=$app --key=language)
|
language=$(ynh_app_setting_get --app=$app --key=language)
|
||||||
|
redis_namespace=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_user=$(ynh_sanitize_dbid --db_name=$app)
|
db_user=$(ynh_sanitize_dbid --db_name=$app)
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
||||||
|
@ -111,6 +112,12 @@ if [[ -z "$vapid_private_key" ]]; then
|
||||||
ynh_app_setting_set "$app" vapid_public_key "$vapid_public_key"
|
ynh_app_setting_set "$app" vapid_public_key "$vapid_public_key"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If redis_namespace doesn't exist, create it
|
||||||
|
if [[ -z "$redis_namespace" ]]; then
|
||||||
|
redis_namespace=${app}_production
|
||||||
|
ynh_app_setting_set --app=$app --key=redis_namespace --value=$redis_namespace
|
||||||
|
fi
|
||||||
|
|
||||||
#Remove previous added repository
|
#Remove previous added repository
|
||||||
ynh_remove_extra_repo
|
ynh_remove_extra_repo
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue