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
* Installation on domain's root
* Installation on domain root or sub-directory
* Notification emails
* Push notifications
* Service control in Yunohost Services panel
## 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))
## About telemetrics

View file

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

View file

@ -1,6 +1,6 @@
# 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 Connection "upgrade";
client_max_body_size 50M;
@ -15,7 +15,7 @@ location ~ /api/v[0-9]+/(users/)?websocket$ {
proxy_pass http://127.0.0.1:__PORT__;
}
location / {
location __PATH__/ {
client_max_body_size 50M;
proxy_set_header Connection "";
proxy_set_header Host $http_host;

View file

@ -31,6 +31,16 @@
},
"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",
"type": "boolean",

View file

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

View file

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

View file

@ -21,6 +21,7 @@ ynh_abort_if_errors
app=$YNH_APP_INSTANCE_NAME
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)
port=$(ynh_app_setting_get $app port)
mattermost_user="$app"
@ -55,7 +56,7 @@ ynh_clean_setup () {
fi
# Restore the backup
ynh_restore_upgradebackup
else
# Backup restoration is not available:
# let's try at least to restart the server.