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

Fix linter

This commit is contained in:
ericgaspar 2021-03-10 19:59:19 +01:00
parent a9c19edeb1
commit 39675ab63d
No known key found for this signature in database
GPG key ID: 574F281483054D44
7 changed files with 35 additions and 48 deletions

View file

@ -3,7 +3,7 @@
"SiteURL": "__URL__",
"WebsocketURL": "",
"LicenseFileLocation": "",
"ListenAddress": "__PORT__",
"ListenAddress": "127.0.0.1:__PORT__",
"ConnectionSecurity": "",
"TLSCertFile": "",
"TLSKeyFile": "",
@ -144,7 +144,7 @@
},
"SqlSettings": {
"DriverName": "mysql",
"DataSource": "__DB_USER__:__DB_PASS__@tcp(localhost:3306)/__DB_NAME__?charset=utf8mb4,utf8",
"DataSource": "__DB_USER__:__DB_PWD__@tcp(localhost:3306)/__DB_NAME__?charset=utf8mb4,utf8",
"DataSourceReplicas": [],
"DataSourceSearchReplicas": [],
"MaxIdleConns": 20,
@ -185,7 +185,7 @@
"EnableFile": true,
"FileLevel": "INFO",
"FileJson": true,
"FileLocation": "__LOG__",
"FileLocation": "__LOGS_PATH__",
"AdvancedLoggingConfig": ""
},
"PasswordSettings": {
@ -201,7 +201,7 @@
"EnableMobileDownload": true,
"MaxFileSize": 52428800,
"DriverName": "local",
"Directory": "__DATA__",
"Directory": "__DATA_PATH__",
"EnablePublicLink": false,
"PublicLinkSalt": "",
"InitialFont": "nunito-bold.ttf",
@ -224,12 +224,12 @@
"UseChannelInEmailNotifications": false,
"RequireEmailVerification": false,
"FeedbackName": "Mattermost notification",
"FeedbackEmail": "__FEEDBACK__",
"FeedbackEmail": "no-reply@__DOMAIN__",
"ReplyToAddress": "",
"FeedbackOrganization": "",
"EnableSMTPAuth": false,
"SMTPUsername": "mattermost",
"SMTPPassword": "__USER_PW__",
"SMTPPassword": "__USER_PWD__",
"SMTPServer": "localhost",
"SMTPPort": "25",
"SMTPServerTimeout": 10,

View file

@ -34,6 +34,7 @@ location __PATH__/ {
#proxy_cache_use_stale timeout;
#proxy_cache_lock on;
proxy_pass http://127.0.0.1:__PORT__;
# Yunohost addition: redirect HTTP to HTTPS
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;

View file

@ -122,7 +122,7 @@ ynh_store_file_checksum --file="$final_path/config/config.json"
ynh_script_progression --message="Starting a systemd service..." --weight=2
# Start a systemd service
ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Started Mattermost"
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Started Mattermost"
#=================================================
# RELOAD NGINX

View file

@ -54,7 +54,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=6
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=password --value=$password
ynh_app_setting_set --app=$app --key=language --value=$language
@ -138,19 +137,24 @@ ynh_use_logrotate
#=================================================
ynh_script_progression --message="Modifying a config file..." --weight=3
cp ../conf/config.json $final_path/config/config.json
#cp ../conf/config.json $final_path/config/config.json
user_pwd=$(ynh_string_random --length=24)
url=https://$domain$path_url
ynh_add_config --template="../conf/config.json" --destination="$final_path/config/config.json"
# Main config File
ynh_replace_string --match_string="__URL__" --replace_string="https://$domain$path_url" --target_file="$final_path/config/config.json"
ynh_replace_string --match_string="__PORT__" --replace_string="127.0.0.1:$port" --target_file="$final_path/config/config.json"
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config/config.json"
ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/config/config.json"
ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="$final_path/config/config.json"
ynh_replace_string --match_string="__DATA__" --replace_string="$data_path" --target_file="$final_path/config/config.json"
ynh_replace_string --match_string="__FEEDBACK__" --replace_string="no-reply@${domain}" --target_file="$final_path/config/config.json"
ynh_replace_string --match_string="__USER_PW__" --replace_string="$(ynh_string_random --length=24)" --target_file="$final_path/config/config.json"
ynh_replace_string --match_string="__LOG__" --replace_string="$logs_path" --target_file="$final_path/config/config.json"
ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/config/config.json"
# ynh_replace_string --match_string="__URL__" --replace_string="$url" --target_file="$final_path/config/config.json"
# ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config/config.json"
# ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config/config.json"
# ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/config/config.json"
# ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/config/config.json"
# ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$data_path" --target_file="$final_path/config/config.json"
# ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/config/config.json"
# ynh_replace_string --match_string="__USER_PWD__" --replace_string="$user_pwd" --target_file="$final_path/config/config.json"
# ynh_replace_string --match_string="__LOGS_PATH__" --replace_string="$logs_path" --target_file="$final_path/config/config.json"
# ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/config/config.json"
ynh_store_file_checksum --file="$final_path/config/config.json"
@ -203,7 +207,7 @@ yunohost service add $app --description="Collaboration platform built for develo
ynh_script_progression --message="Starting a systemd service..." --weight=2
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started Mattermost"
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Started Mattermost"
#=================================================
# SETUP SSOWAT

View file

@ -27,7 +27,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
# REMOVE SERVICE FROM ADMIN PANEL
#=================================================
# Remove the service from the list of services known by Yunohost (added from `yunohost service add`)
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status $app >/dev/null
then
ynh_script_progression --message="Removing $app service..." --weight=1

View file

@ -115,7 +115,7 @@ yunohost service add $app --description="Collaboration platform built for develo
ynh_script_progression --message="Starting a systemd service..." --weight=2
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started Mattermost"
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Started Mattermost"
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION

View file

@ -28,7 +28,6 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
port=$(ynh_app_setting_get --app=$app --key=port)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
language=$(ynh_app_setting_get --app=$app --key=language)
@ -47,14 +46,6 @@ upgrade_type=$(ynh_check_app_version_changed)
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
# Convert is_public from "Yes"/"No" to 1 / 0
if [[ $is_public == "Yes" ]]; then
is_public=1
elif [[ $is_public == "No" ]]; then
is_public=0
fi
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
# Save the port used if not present
if [ -z "$port" ]; then
port=8065
@ -78,6 +69,13 @@ if [ -z "$db_name" ]; then
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -155,22 +153,6 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=2
# Create a dedicated systemd config
ynh_add_systemd_config
#=================================================
# SPECIFIC UPGRADE STEPS
#=================================================
# # Fix log FileLocation path (changed in Mattermost 3.8, makes Mattermost >= 4.2 crash)
# # https://docs.mattermost.com/administration/changelog.html#release-v3-8-3
# ynh_replace_string --match_string "\"FileLocation\": \"/var/log/mattermost.log\"" --replace_string "\"FileLocation\": \"/var/log\"" --target_file "$config_file"
# # Move log files to a directory (rather than directly in /var/log)
# # See https://github.com/YunoHost-Apps/mattermost_ynh/issues/61
# mkdir -p "$logs_path"
# ynh_replace_string --match_string "\"FileLocation\": \"/var/log\"" --replace_string "\"FileLocation\": \"$logs_path\"" --target_file "$config_file"
# if [ -f "/var/log/${app}.log" ]; then
# mv "/var/log/${app}.log" "$logs_path/"
# fi
#=================================================
# CREATE DIRECTORY FOR DATA
#=================================================
@ -212,7 +194,7 @@ yunohost service add $app --description="Collaboration platform built for develo
ynh_script_progression --message="Starting a systemd service..." --weight=2
# Start a systemd service
ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Started Mattermost"
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Started Mattermost"
#=================================================
# RELOAD NGINX