mirror of
https://github.com/YunoHost-Apps/gotosocial_ynh.git
synced 2024-09-03 19:16:06 +02:00
reverting all "account_domain" stuff
This commit is contained in:
parent
3088ea005d
commit
cc6618188e
9 changed files with 5 additions and 97 deletions
|
@ -5,8 +5,6 @@
|
|||
|
||||
;; Test complet
|
||||
; Manifest
|
||||
main_domain="gts.domain.tld"
|
||||
account_domain="domain.tld"
|
||||
admin="xana"
|
||||
email="user@example.com"
|
||||
password="1Strong-Password"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
# Verifying of it's the "account_domain"
|
||||
set $is_account_domain 0;
|
||||
if ($host = __ACCOUNT_DOMAIN__) {
|
||||
set $is_account_domain 1;
|
||||
}
|
||||
|
||||
location / {
|
||||
location __PATH__/ {
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
|
@ -12,29 +6,10 @@ location / {
|
|||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Host $host;
|
||||
|
||||
# If we're on the "account_domain, redirect to the main domain"
|
||||
if ($is_account_domain = 1) {
|
||||
rewrite ^ https://__MAIN_DOMAIN__$request_uri? permanent;
|
||||
}
|
||||
|
||||
if ($is_account_domain = 0) {
|
||||
proxy_pass http://localhost:__PORT__;
|
||||
}
|
||||
|
||||
client_max_body_size __CLIENT_MAX_BODY_SIZE__;
|
||||
|
||||
# Include SSOWAT user panel.
|
||||
include conf.d/yunohost_panel.conf.inc;
|
||||
}
|
||||
|
||||
# redirect the account_domain .well-known to the main domain one
|
||||
location = /.well-known/webfinger {
|
||||
if ($is_account_domain = 1) {
|
||||
rewrite ^.*$ https://__MAIN_DOMAIN__/.well-known/webfinger permanent;
|
||||
}
|
||||
}
|
||||
location = /.well-known/nodeinfo {
|
||||
if ($is_account_domain = 1) {
|
||||
rewrite ^.*$ https://__MAIN_DOMAIN__/.well-known/nodeinfo permanent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,23 +40,10 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"name": "main_domain",
|
||||
"name": "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: The domain filled in must be parent to the one previously filled in. This cannot be changed after installation, as the main domain parameter. By default, set this parameter to the same as the previously defined domain.",
|
||||
"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 : Le domaine renseigné doit être parent à celui renseigné précédemment ! Ce paramètre ne peut etre modifié après installation, tout comme le paramètre du domaine principal. Par défaut, mettez ce paramètre à l'identique du domaine renseigné précédemment."
|
||||
},
|
||||
"example": "example.org"
|
||||
},
|
||||
{
|
||||
"name": "admin",
|
||||
"type": "string",
|
||||
|
|
|
@ -29,7 +29,6 @@ ynh_print_info --message="Loading installation settings..."
|
|||
app="$YNH_APP_INSTANCE_NAME"
|
||||
|
||||
domain=$(ynh_app_setting_get --app="$app" --key=domain)
|
||||
account_domain=$(ynh_app_setting_get --app="$app" --key=account_domain)
|
||||
|
||||
db_name=$(ynh_app_setting_get --app="$app" --key=db_name)
|
||||
|
||||
|
@ -64,7 +63,6 @@ ynh_backup --src_path="$datadir" --is_big
|
|||
#=================================================
|
||||
|
||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
ynh_backup --src_path="/etc/nginx/conf.d/$account_domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC BACKUP
|
||||
|
|
|
@ -28,8 +28,7 @@ app="$YNH_APP_INSTANCE_NAME"
|
|||
|
||||
landing_page_user=""
|
||||
|
||||
domain="$YNH_APP_ARG_MAIN_DOMAIN"
|
||||
account_domain="$YNH_APP_ARG_ACCOUNT_DOMAIN"
|
||||
domain="$YNH_APP_ARG_DOMAIN"
|
||||
path_url="/"
|
||||
|
||||
client_max_body_size="100M"
|
||||
|
@ -96,7 +95,6 @@ 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"
|
||||
|
@ -210,23 +208,9 @@ chown -R "$app:www-data" "$final_path"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
|
||||
|
||||
main_domain="$domain"
|
||||
|
||||
# Create a dedicated NGINX config for the main domain
|
||||
ynh_add_nginx_config
|
||||
|
||||
# Create a dedicated NGINX config for the account domain, if applicable
|
||||
if [ "$domain" != "$account_domain" ] && [ -n "$account_domain" ]; then
|
||||
|
||||
# switching domain name for tricking ynh_add_nginx_config (who supports only the 'domain' variable)
|
||||
domain="$account_domain"
|
||||
|
||||
ynh_add_nginx_config
|
||||
|
||||
# undo the trick
|
||||
domain="$main_domain"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# CREATE DATA DIRECTORY
|
||||
#=================================================
|
||||
|
|
|
@ -17,7 +17,6 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
|
|||
app="$YNH_APP_INSTANCE_NAME"
|
||||
|
||||
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)
|
||||
db_name=$(ynh_app_setting_get --app="$app" --key=db_name)
|
||||
db_user=$(ynh_app_setting_get --app="$app" --key=db_user)
|
||||
|
@ -82,23 +81,9 @@ ynh_secure_remove --file="$datadir"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
|
||||
|
||||
main_domain="$domain"
|
||||
|
||||
# Remove the dedicated NGINX config of the main domain
|
||||
ynh_remove_nginx_config
|
||||
|
||||
# Remove the dedicated NGINX config for the account domain, if applicable
|
||||
if [ "$domain" != "$account_domain" ] && [ -n "$account_domain" ]; then
|
||||
|
||||
# switching domain name for tricking ynh_add_nginx_config (who supports only the 'domain' variable)
|
||||
domain="$account_domain"
|
||||
|
||||
ynh_remove_nginx_config
|
||||
|
||||
# undo the trick
|
||||
domain="$main_domain"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# REMOVE LOGROTATE CONFIGURATION
|
||||
#=================================================
|
||||
|
|
|
@ -33,7 +33,6 @@ 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)
|
||||
|
||||
|
@ -96,7 +95,6 @@ test ! -d "$final_path" \
|
|||
ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$account_domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
|
|
|
@ -21,7 +21,6 @@ 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)
|
||||
|
||||
|
@ -233,11 +232,9 @@ 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
|
||||
|
||||
#=================================================
|
||||
|
@ -278,23 +275,9 @@ chown -R "$app:www-data" "$final_path"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Upgrading NGINX web server configuration..."
|
||||
|
||||
main_domain="$domain"
|
||||
|
||||
# Create a dedicated NGINX config for the main domain
|
||||
ynh_add_nginx_config
|
||||
|
||||
# Create a dedicated NGINX config for the account domain, if applicable
|
||||
if [ "$domain" != "$account_domain" ] && [ -n "$account_domain" ]; then
|
||||
|
||||
# switching domain name for tricking ynh_add_nginx_config (who supports only the 'domain' variable)
|
||||
domain="$account_domain"
|
||||
|
||||
ynh_add_nginx_config
|
||||
|
||||
# undo the trick
|
||||
domain="$main_domain"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# UPGRADE DEPENDENCIES
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue