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

Merge pull request #97 from YunoHost-Apps/config-panel

Config panel
This commit is contained in:
Maniack Crudelis 2020-04-22 17:19:29 +02:00 committed by GitHub
commit 053e3fee8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 110 additions and 26 deletions

View file

@ -1,6 +1,6 @@
# Etherpad with mypads plugin for YunoHost
[![Integration level](https://dash.yunohost.org/integration/etherpad_mypads.svg)](https://dash.yunohost.org/appci/app/etherpad_mypads)
[![Integration level](https://dash.yunohost.org/integration/etherpad_mypads.svg)](https://dash.yunohost.org/appci/app/etherpad_mypads) ![](https://ci-apps.yunohost.org/ci/badges/etherpad_mypads.status.svg) [![](https://ci-apps.yunohost.org/ci/badges/etherpad_mypads.maintain.svg)](https://github.com/YunoHost/Apps/#what-to-do-if-i-cant-maintain-my-app-anymore-)
[![Install Etherpad with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=etherpad_mypads)
*[Lire ce readme en français.](./README_fr.md)*
@ -42,7 +42,7 @@ Supported, with LDAP.
* x86-64b - [![](https://ci-apps.yunohost.org/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/etherpad_mypads/)
* ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/etherpad_mypads/)
* Jessie x86-64b - [![](https://ci-stretch.nohost.me/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/etherpad_mypads/)
* Buster x86-64b - [![](https://ci-buster.nohost.me/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-buster.nohost.me/ci/apps/etherpad_mypads/)
## Limitations

View file

@ -1,6 +1,6 @@
# Etherpad avec plugin mypads pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/etherpad_mypads.svg)](https://dash.yunohost.org/appci/app/etherpad_mypads)
[![Niveau d'intégration](https://dash.yunohost.org/integration/etherpad_mypads.svg)](https://dash.yunohost.org/appci/app/etherpad_mypads) ![](https://ci-apps.yunohost.org/ci/badges/etherpad_mypads.status.svg) [![](https://ci-apps.yunohost.org/ci/badges/etherpad_mypads.maintain.svg)](https://github.com/YunoHost/Apps/#what-to-do-if-i-cant-maintain-my-app-anymore-)
[![Installer Etherpad avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=etherpad_mypads)
*[Read this readme in english.](./README.md)*
@ -42,7 +42,7 @@ Supportée, avec LDAP.
* x86-64b - [![](https://ci-apps.yunohost.org/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/etherpad_mypads/)
* ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/etherpad_mypads/)
* Jessie x86-64b - [![](https://ci-stretch.nohost.me/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/etherpad_mypads/)
* Buster x86-64b - [![](https://ci-buster.nohost.me/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-buster.nohost.me/ci/apps/etherpad_mypads/)
## Limitations

View file

@ -9,6 +9,24 @@
export="libreoffice"
mypads=1
useldap=1
; Actions
is_public=0|1
; Config_panel
main.export.export=none|abiword|libreoffice
main.pad_configuration.pad_config_nocolors=1|0
main.pad_configuration.pad_config_showlinenumbers=0|1
main.pad_configuration.pad_config_chatandusers=1|0
main.pad_configuration.pad_config_alwaysshowchat=1|0
main.pad_configuration.pad_config_show_markdown=1|0
main.pad_configuration.pad_config_pageview=1|0
main.pad_configuration.pad_config_automatic_logout=0|1
main.mypads_configuration.mypads=0|1
main.mypads_configuration.useldap=0|1
main.is_public.is_public=1|0
main.overwrite_files.overwrite_settings=0|1
main.overwrite_files.overwrite_credentials=0|1
main.overwrite_files.overwrite_nginx=0|1
main.overwrite_files.overwrite_systemd=0|1
; Checks
pkg_linter=1
setup_sub_dir=1
@ -21,6 +39,8 @@
multi_instance=0
port_already_use=1 (9001)
change_url=1
actions=1
config_panel=1
;; Test sans mypads
; Manifest
domain="domain.tld" (DOMAIN)
@ -68,7 +88,7 @@
Level 5=auto
;;; Options
Email=
Notification=down
Notification=change
;;; Upgrade options
; commit=8bf300413ec3adcb416d168d2e9e98975dd9405b
name= Fix nodejs & global update

View file

@ -14,7 +14,7 @@
"email": "maniackc_dev@crudelis.fr"
},
"requirements": {
"yunohost": ">= 3.5"
"yunohost": ">= 3.6"
},
"multi_instance": true,
"services": [

View file

@ -9,6 +9,13 @@
source scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
@ -29,14 +36,14 @@ then
# abiword is already a dependence of etherpad_mypads.
# abiword should be removed.
abiword=0
action1=installed
action2=Installing
action1=removed
action2=Removing
else
# abiword isn't a dependence of etherpad_mypads.
# abiword should be installed.
abiword=1
action1=removed
action2=Removing
action1=installed
action2=Installing
fi
ynh_print_info --message="Abiword will be $action1."

View file

@ -9,6 +9,13 @@
source scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
@ -29,14 +36,14 @@ then
# libreoffice is already a dependence of etherpad_mypads.
# libreoffice should be removed.
libreoffice=0
action1=installed
action2=Installing
action1=removed
action2=Removing
else
# libreoffice isn't a dependence of etherpad_mypads.
# libreoffice should be installed.
libreoffice=1
action1=removed
action2=Removing
action1=installed
action2=Installing
fi
ynh_print_info --message="Libreoffice will be $action1."

View file

@ -9,6 +9,13 @@
source scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS
#=================================================

View file

@ -8,6 +8,13 @@
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS
#=================================================

View file

@ -9,6 +9,13 @@
source scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS
#=================================================

View file

@ -6,11 +6,12 @@
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
# Load common variables for all scripts.
source _variables
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
@ -157,6 +158,11 @@ show_config() {
#=================================================
apply_config() {
#=================================================
# MODIFY ETHERPAD CONFIG
#=================================================
restart_etherpad=0
# Change configuration if needed
@ -245,6 +251,9 @@ apply_config() {
ynh_replace_string --match_string="\(\"abiword\" *: \).*," --replace_string="\1null," --target_file="$config_file"
ynh_replace_string --match_string="\(\"soffice\" *: \).*," --replace_string="\1null," --target_file="$config_file"
fi
ynh_app_setting_set --app=$app --key=export --value="$export"
restart_etherpad=1
fi
@ -261,6 +270,9 @@ apply_config() {
fi
popd
chown -R $app: $final_path/node_modules
ynh_app_setting_set --app=$app --key=mypads --value="$mypads"
restart_etherpad=1
fi
@ -273,6 +285,9 @@ apply_config() {
else
ynh_replace_string --match_string="\(.*\) //useldap" --replace_string="//noldap\1" --target_file="$final_path/settings.json"
fi
ynh_app_setting_set --app=$app --key=useldap --value="$useldap"
restart_etherpad=1
fi
@ -283,14 +298,25 @@ apply_config() {
ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120"
fi
#=================================================
# MODIFY PUBLIC ACCESSIBILITY
#=================================================
# Change public accessibility
if [ "$is_public" = "1" ]
if [ "$is_public" != "$old_is_public" ]
then
yunohost app action run $app public_private --args is_public=1
else
yunohost app action run $app public_private --args is_public=0
if [ "$is_public" = "1" ]
then
yunohost app action run $app public_private --args is_public=1
else
yunohost app action run $app public_private --args is_public=0
fi
fi
#=================================================
# MODIFY OVERWRITTING SETTINGS
#=================================================
# Set overwrite_settings
ynh_app_setting_set --app=$app --key=overwrite_settings --value="$overwrite_settings"
# Set overwrite_credentials

View file

@ -6,11 +6,12 @@
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
# Load common variables for all scripts.
source _variables
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE FAILURE OF THE SCRIPT
#=================================================

View file

@ -6,11 +6,12 @@
# IMPORT GENERIC HELPERS
#=================================================
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
# Load common variables for all scripts.
source ../settings/scripts/_variables
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================

View file

@ -6,11 +6,12 @@
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
# Load common variables for all scripts.
source _variables
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================