From 6450b761e0c7d5b2f6831346d1cb5b571a509abb Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Sat, 18 Feb 2023 21:48:51 +0100 Subject: [PATCH] Expose 'account-domain' setting at install --- conf/config.yaml | 2 +- manifest.json | 16 +++++++++++++++- scripts/install | 2 ++ scripts/restore | 1 + scripts/upgrade | 2 ++ 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/conf/config.yaml b/conf/config.yaml index c4b3895..e8e4835 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -65,7 +65,7 @@ host: "__DOMAIN__" # https://docs.gotosocial.org/installation_guide/advanced/#can-i-host-my-instance-at-fediexampleorg-but-have-just-exampleorg-in-my-username # # Default: "" -account-domain: "" +account-domain: "__ACCOUNT_DOMAIN__" # String. Protocol to use for the server. Only change to http for local testing! # This should be the protocol part of the URI that your server is actually reachable on. So even if you're diff --git a/manifest.json b/manifest.json index 983e871..90f0382 100644 --- a/manifest.json +++ b/manifest.json @@ -41,7 +41,21 @@ }, { "name": "domain", - "type": "domain" + "type": "domain", + "example": "gts.example.org" + }, + { + "name": "account_domain", + "type": "domain", + "ask": { + "en": "Domain to use when federating profiles.", + "fr": "Domaine à utiliser lors de la fédération des profils." + }, + "help": { + "en": "This is useful when you want your server to be at eg., \"gts.example.org\", but you want the domain on accounts to be \"example.org\" because it looks better or is just shorter/easier to remember. ⚠️ WARNING: This cannot be changed after installation, as the main domain parameter.", + "fr": "Cette option est utile lorsque vous souhaitez que votre serveur se trouve à l'adresse \"gts.example.org\", par exemple, mais que vous souhaitez que le domaine des comptes soit \"example.org\" parce que c'est plus joli, plus court ou plus facile à retenir. ⚠️ ATTENTION : Ce paramètre ne peut etre modifié après installation, tout comme le paramètre du domaine principal." + }, + "example": "example.org" }, { "name": "admin", diff --git a/scripts/install b/scripts/install index 9aedefc..eb257ec 100755 --- a/scripts/install +++ b/scripts/install @@ -29,6 +29,7 @@ app="$YNH_APP_INSTANCE_NAME" landing_page_user="" domain="$YNH_APP_ARG_DOMAIN" +account_domain"$YNH_APP_ARG_ACCOUNT_DOMAIN" path_url="/" client_max_body_size="100M" @@ -95,6 +96,7 @@ ynh_app_setting_set --app="$app" --key=final_path --value="$final_path" ynh_app_setting_set --app="$app" --key=landing_page_user --value="$landing_page_user" ynh_app_setting_set --app="$app" --key=domain --value="$domain" +ynh_app_setting_set --app="$app" --key=account_domain --value="$account_domain" ynh_app_setting_set --app="$app" --key=path_url --value="$path_url" ynh_app_setting_set --app="$app" --key=client_max_body_size --value="$client_max_body_size" diff --git a/scripts/restore b/scripts/restore index 0072052..455ecbb 100755 --- a/scripts/restore +++ b/scripts/restore @@ -33,6 +33,7 @@ final_path=$(ynh_app_setting_get --app="$app" --key=final_path) landing_page_user=$(ynh_app_setting_get --app="$app" --key=landing_page_user) domain=$(ynh_app_setting_get --app="$app" --key=domain) +account_domain=$(ynh_app_setting_get --app="$app" --key=account_domain) port=$(ynh_app_setting_get --app="$app" --key=port) path_url=$(ynh_app_setting_get --app="$app" --key=path_url) diff --git a/scripts/upgrade b/scripts/upgrade index a97c398..a8ed52a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -232,9 +232,11 @@ then advanced_rate_limit_requests="300" # declaration of new parameter instance_expose_suspended_web="false" + account_domain="" # registration of parameters ynh_app_setting_set --app="$app" --key=advanced_rate_limit_requests --value="$advanced_rate_limit_requests" ynh_app_setting_set --app="$app" --key=instance_expose_suspended_web --value="$instance_expose_suspended_web" + ynh_app_setting_set --app="$app" --key=account_domain --value="$account_domain" fi #=================================================