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

app: implement subpath support

This commit is contained in:
Pierre de La Morinerie 2020-02-08 23:33:19 +01:00
parent 849d75bcbc
commit f07b4a7822
7 changed files with 21 additions and 11 deletions

View file

@ -24,14 +24,13 @@ You can either :
## What works ## What works
* Installation on domain's root * Installation on domain root or sub-directory
* Notification emails * Notification emails
* Push notifications * Push notifications
* Service control in Yunohost Services panel * Service control in Yunohost Services panel
## TODO ## TODO
* Allow installation in sub-directory (only root-domains for now, see [#8](https://github.com/YunoHost-Apps/mattermost_ynh/issues/8))
* LDAP integration (only paid Entreprise Edition, see [#58](https://github.com/YunoHost-Apps/mattermost_ynh/issues/58)) * LDAP integration (only paid Entreprise Edition, see [#58](https://github.com/YunoHost-Apps/mattermost_ynh/issues/58))
## About telemetrics ## About telemetrics

View file

@ -1,7 +1,7 @@
;; Mattermost ;; Mattermost
; Manifest ; Manifest
domain="ynhtests.local" (DOMAIN) domain="ynhtests.local" (DOMAIN)
path="" (PATH) path="/path" (PATH)
admin_email="john@gmail.com" admin_email="john@gmail.com"
admin_password="MattermostPassword!42" admin_password="MattermostPassword!42"
admin_locale="fr" admin_locale="fr"
@ -10,6 +10,7 @@
analytics=0 analytics=0
; Checks ; Checks
pkg_linter=1 pkg_linter=1
setup_sub_dir=1
setup_root=1 setup_root=1
setup_private=1 setup_private=1
setup_public=1 setup_public=1
@ -20,14 +21,12 @@
# Checks not supported yet # Checks not supported yet
change_url=0 change_url=0
# Checks not applicable # Checks not applicable
setup_sub_dir=0
setup_nourl=0 setup_nourl=0
incorrect_path=0
;;; Levels ;;; Levels
Level 1=auto Level 1=auto
Level 2=auto Level 2=auto
Level 3=auto Level 3=auto
Level 4=na Level 4=auto
Level 5=auto Level 5=auto
Level 6=auto Level 6=auto
Level 7=auto Level 7=auto

View file

@ -1,6 +1,6 @@
# Directives from the Mattermost installation guide # Directives from the Mattermost installation guide
location ~ /api/v[0-9]+/(users/)?websocket$ { location ~ __PATH__/api/v[0-9]+/(users/)?websocket$ {
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade"; proxy_set_header Connection "upgrade";
client_max_body_size 50M; client_max_body_size 50M;
@ -15,7 +15,7 @@ location ~ /api/v[0-9]+/(users/)?websocket$ {
proxy_pass http://127.0.0.1:__PORT__; proxy_pass http://127.0.0.1:__PORT__;
} }
location / { location __PATH__/ {
client_max_body_size 50M; client_max_body_size 50M;
proxy_set_header Connection ""; proxy_set_header Connection "";
proxy_set_header Host $http_host; proxy_set_header Host $http_host;

View file

@ -31,6 +31,16 @@
}, },
"example": "domain.org" "example": "domain.org"
}, },
{
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for Mattermost",
"fr": "Choisissez un chemin pour Mattermost"
},
"example": "/chat",
"default": "/chat"
},
{ {
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",

View file

@ -21,13 +21,13 @@ ynh_abort_if_errors
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
admin_email=$YNH_APP_ARG_ADMIN_EMAIL admin_email=$YNH_APP_ARG_ADMIN_EMAIL
admin_password=$YNH_APP_ARG_ADMIN_PASSWORD admin_password=$YNH_APP_ARG_ADMIN_PASSWORD
admin_locale=$YNH_APP_ARG_ADMIN_LOCALE admin_locale=$YNH_APP_ARG_ADMIN_LOCALE
team_display_name=$YNH_APP_ARG_TEAM_DISPLAY_NAME team_display_name=$YNH_APP_ARG_TEAM_DISPLAY_NAME
analytics=$YNH_APP_ARG_ANALYTICS analytics=$YNH_APP_ARG_ANALYTICS
path_url="/"
#================================================= #=================================================
# CHECK IF THE APP CAN BE INSTALLED # CHECK IF THE APP CAN BE INSTALLED
@ -71,6 +71,7 @@ ynh_webpath_available "$domain" "$path_url"
ynh_webpath_register "$app" "$domain" "$path_url" ynh_webpath_register "$app" "$domain" "$path_url"
# Store setting # Store setting
ynh_app_setting_set "$app" domain "$domain" ynh_app_setting_set "$app" domain "$domain"
ynh_app_setting_set "$app" path "$path_url"
#================================================= #=================================================
# FIND AN AVAILABLE PORT # FIND AN AVAILABLE PORT

View file

@ -21,7 +21,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get $app domain)
is_public=$(ynh_app_setting_get $app is_public) is_public=$(ynh_app_setting_get $app is_public)
path_url="/" path_url=$(ynh_app_setting_get $app path)
final_path="/var/www/$app" final_path="/var/www/$app"
data_path="/home/yunohost.app/$app" data_path="/home/yunohost.app/$app"
logs_path="/var/log/$app" logs_path="/var/log/$app"

View file

@ -21,6 +21,7 @@ ynh_abort_if_errors
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get $app domain)
path_url=$(ynh_app_setting_get $app path) # used during nginx configuration
is_public=$(ynh_app_setting_get $app is_public) is_public=$(ynh_app_setting_get $app is_public)
port=$(ynh_app_setting_get $app port) port=$(ynh_app_setting_get $app port)
mattermost_user="$app" mattermost_user="$app"