1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/minio_ynh.git synced 2024-09-03 19:46:18 +02:00

Moving to two domains...

This commit is contained in:
Limezy 2022-03-25 23:09:04 +07:00
parent b6de80c82f
commit a527d2a60b
10 changed files with 39 additions and 48 deletions

View file

@ -1,5 +1,5 @@
MINIO_ROOT_USER=__APP__
MINIO_ROOT_PASSWORD=__MINIO_KEY__
MINIO_VOLUMES="__DATADIR__/"
MINIO_BROWSER_REDIRECT_URL=https://__DOMAIN__
MINIO_BROWSER_REDIRECT_URL=https://__CONSOLE_DOMAIN__
MINIO_OPTS="-C __FINAL_PATH__/ --address 127.0.0.1:__PORT__ --console-address :__CONSOLE_PORT__"

View file

@ -1,4 +1,4 @@
location /server/ {
location / {
# Force usage of https
if ($scheme = http) {
@ -19,25 +19,3 @@ location /server/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location / {
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
proxy_pass http://127.0.0.1:__CONSOLE_PORT__/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_cache_bypass $http_upgrade;
proxy_ignore_client_abort on;
client_max_body_size 200M;
# forward headers
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}

21
conf/nginx_console.conf Normal file
View file

@ -0,0 +1,21 @@
location / {
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
proxy_pass http://127.0.0.1:__CONSOLE_PORT__/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_cache_bypass $http_upgrade;
proxy_ignore_client_abort on;
client_max_body_size 200M;
# forward headers
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}

View file

@ -29,13 +29,17 @@
"install" : [
{
"name": "domain",
"type": "domain"
"type": "domain",
"example": "minio.domain.tld",
"ask": "Enter a domain for MinIO server. This has to be a fully dedicated domain"
},
{
"name": "is_public",
"type": "boolean",
"default": true
}
"name": "console_domain",
"type": "domain",
"example": "console.minio.domain.tld",
"ask": "Enter a domain for MinIO console. This has to be a fully dedicated domain",
"optional": true
},
]
}
}

View file

@ -1,19 +1 @@
#!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
# dependencies used by the app
#=================================================
# PERSONAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================

View file

@ -30,6 +30,7 @@ app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)
console_domain=$(ynh_app_setting_get --app=$app --key=console_domain)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
mc_path=$(ynh_app_setting_get --app=$app --key=mc_path)

View file

@ -25,8 +25,9 @@ ynh_abort_if_errors
#=================================================
domain=$YNH_APP_ARG_DOMAIN
console_domain=$YNH_APP_ARG_CONSOLE_DOMAIN
path_url="/"
is_public=$YNH_APP_ARG_IS_PUBLIC
is_public=1
minio_key=$(ynh_string_random)
architecture=$YNH_ARCH
@ -51,6 +52,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
ynh_script_progression --message="Storing installation settings..." --weight=1
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=console_domain --value=$console_domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=minio_key --value=$minio_key
ynh_app_setting_set --app=$app --key=mc_path --value=$mc_path

View file

@ -17,6 +17,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
console_domain=$(ynh_app_setting_get --app=$app --key=console_domain)
port=$(ynh_app_setting_get --app=$app --key=port)
console_port=$(ynh_app_setting_get --app=$app --key=console_port)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)

View file

@ -29,6 +29,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
console_domain=$(ynh_app_setting_get --app=$app --key=console_domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)

View file

@ -17,6 +17,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
console_domain=$(ynh_app_setting_get --app=$app --key=console_domain)
port=$(ynh_app_setting_get --app=$app --key=port)
path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)