mirror of
https://github.com/YunoHost-Apps/etherpad_mypads_ynh.git
synced 2024-09-03 18:36:09 +02:00
Fix
This commit is contained in:
parent
fe66afce1f
commit
5d3ce9996e
14 changed files with 62 additions and 113 deletions
|
@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to
|
||||||
Etherpad is a highly customizable Open Source online editor providing collaborative editing in really real-time.
|
Etherpad is a highly customizable Open Source online editor providing collaborative editing in really real-time.
|
||||||
This package will install the same plugins than [Framapad](https://framapad.org/).
|
This package will install the same plugins than [Framapad](https://framapad.org/).
|
||||||
|
|
||||||
**Shipped version:** 1.8.4
|
**Shipped version:** 1.8.12
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ Si vous n'avez pas YunoHost, merci de regarder [ici](https://yunohost.org/#/inst
|
||||||
Etherpad est un éditeur en ligne Open Source hautement personnalisable qui permet l'édition collaborative en temps réel.
|
Etherpad est un éditeur en ligne Open Source hautement personnalisable qui permet l'édition collaborative en temps réel.
|
||||||
Ce paquet installera les mêmes plugins que [Framapad](https://framapad.org/).
|
Ce paquet installera les mêmes plugins que [Framapad](https://framapad.org/).
|
||||||
|
|
||||||
**Version embarquée :** 1.8.4
|
**Version embarquée :** 1.8.12
|
||||||
|
|
||||||
## Captures d'écran
|
## Captures d'écran
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
main.pad_configuration.pad_config_alwaysshowchat=1|0
|
main.pad_configuration.pad_config_alwaysshowchat=1|0
|
||||||
main.pad_configuration.pad_config_show_markdown=1|0
|
main.pad_configuration.pad_config_show_markdown=1|0
|
||||||
main.pad_configuration.pad_config_automatic_logout=0|1
|
main.pad_configuration.pad_config_automatic_logout=0|1
|
||||||
main.pad_configuration.pad_config_skinname=noskin|colibris|noskin
|
|
||||||
main.mypads_configuration.mypads=0|1
|
main.mypads_configuration.mypads=0|1
|
||||||
main.mypads_configuration.useldap=0|1
|
main.mypads_configuration.useldap=0|1
|
||||||
main.is_public.is_public=1|0
|
main.is_public.is_public=1|0
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
"__ADMIN__": {
|
"__ADMIN__": {
|
||||||
// 1) "password" can be replaced with "hash" if you install ep_hash_auth
|
// 1) "password" can be replaced with "hash" if you install ep_hash_auth
|
||||||
// 2) please note that if password is null, the user will not be created
|
// 2) please note that if password is null, the user will not be created
|
||||||
"password": "__PASSWD__",
|
"password": "__PASSWORD__",
|
||||||
"is_admin": true
|
"is_admin": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,9 +6,10 @@ After=syslog.target network.target
|
||||||
Type=simple
|
Type=simple
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
Environment="PATH=__ENV_PATH__"
|
WorkingDirectory=__FINALPATH__
|
||||||
Environment=NODE_ENV=production
|
Environment=NODE_ENV=production
|
||||||
ExecStart=__FINALPATH__/src/bin/run.sh /var/log/__APP__/etherpad.log
|
Environment="__YNH_NODE_LOAD_PATH__"
|
||||||
|
ExecStart=__FINALPATH__/src/bin/run.sh
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
|
@ -46,13 +46,7 @@ name = "Etherpad configuration"
|
||||||
ask = "Automatic logout"
|
ask = "Automatic logout"
|
||||||
type = "boolean"
|
type = "boolean"
|
||||||
default = true
|
default = true
|
||||||
|
|
||||||
[main.pad_configuration.pad_config_skinname]
|
|
||||||
ask = "Theme Name"
|
|
||||||
choices = ["noskin", "colibris"]
|
|
||||||
default = "noskin"
|
|
||||||
help = "noskin is the traditional Etherpad theme. colibris is the new theme."
|
|
||||||
|
|
||||||
|
|
||||||
[main.mypads_configuration]
|
[main.mypads_configuration]
|
||||||
name = "Mypads configuration"
|
name = "Mypads configuration"
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"en": "Online editor providing collaborative editing in real-time.",
|
"en": "Online editor providing collaborative editing in real-time.",
|
||||||
"fr": "Éditeur en ligne fournissant l'édition collaborative en temps réel."
|
"fr": "Éditeur en ligne fournissant l'édition collaborative en temps réel."
|
||||||
},
|
},
|
||||||
"version": "1.8.4~ynh3",
|
"version": "1.8.12~ynh1",
|
||||||
"url": "https://framapad.org",
|
"url": "https://framapad.org",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
"email": "maniackc_dev@crudelis.fr"
|
"email": "maniackc_dev@crudelis.fr"
|
||||||
}],
|
}],
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 3.8.1"
|
"yunohost": ">= 4.1.7"
|
||||||
},
|
},
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
|
@ -30,38 +30,22 @@
|
||||||
{
|
{
|
||||||
"name": "domain",
|
"name": "domain",
|
||||||
"type": "domain",
|
"type": "domain",
|
||||||
"ask": {
|
|
||||||
"en": "Choose a domain for Etherpad MyPads",
|
|
||||||
"fr": "Choisissez un domaine pour Etherpad MyPads"
|
|
||||||
},
|
|
||||||
"example": "sub.domain.org"
|
"example": "sub.domain.org"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "path",
|
"name": "path",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"ask": {
|
|
||||||
"en": "Choose a path for Etherpad MyPads",
|
|
||||||
"fr": "Choisissez un chemin pour Etherpad MyPads"
|
|
||||||
},
|
|
||||||
"example": "/pad",
|
"example": "/pad",
|
||||||
"default": "/pad"
|
"default": "/pad"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "admin",
|
"name": "admin",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"ask": {
|
|
||||||
"en": "Choose the Etherpad MyPads administrator (must be an existing YunoHost user)",
|
|
||||||
"fr": "Choisissez l'administrateur Etherpad MyPads (doit être un utilisateur YunoHost existant)"
|
|
||||||
},
|
|
||||||
"example": "john"
|
"example": "john"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "password",
|
"name": "password",
|
||||||
"type": "password",
|
"type": "password",
|
||||||
"ask": {
|
|
||||||
"en": "Set the administrator password (between 8 and 30 characters)",
|
|
||||||
"fr": "Définissez le mot de passe administrateur (entre 8 et 30 caractères)"
|
|
||||||
},
|
|
||||||
"example": "Choose a password"
|
"example": "Choose a password"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -77,10 +61,6 @@
|
||||||
{
|
{
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"ask": {
|
|
||||||
"en": "Is it a public website?",
|
|
||||||
"fr": "Est-ce un site public ?"
|
|
||||||
},
|
|
||||||
"help": {
|
"help": {
|
||||||
"en": "If your Etherpad instance is public, everyone will be able to create a pad or see an existing one.",
|
"en": "If your Etherpad instance is public, everyone will be able to create a pad or see an existing one.",
|
||||||
"fr": "Si votre instance Etherpad est publique, tout le monde pourra créer un pad ou voir un pad existant."
|
"fr": "Si votre instance Etherpad est publique, tout le monde pourra créer un pad ou voir un pad existant."
|
||||||
|
|
|
@ -7,7 +7,7 @@ abiword_app_depencencies="abiword"
|
||||||
libreoffice_app_dependencies="unoconv libreoffice-writer"
|
libreoffice_app_dependencies="unoconv libreoffice-writer"
|
||||||
|
|
||||||
# NodeJS version
|
# NodeJS version
|
||||||
nodejs_version=12
|
nodejs_version=14
|
||||||
|
|
||||||
# MyPads version
|
# MyPads version
|
||||||
# This variable is mostly used to force an upgrade of the package in case of new versions of MyPads.
|
# This variable is mostly used to force an upgrade of the package in case of new versions of MyPads.
|
||||||
|
|
|
@ -87,7 +87,7 @@ ynh_store_file_checksum --file="$config_file"
|
||||||
ynh_script_progression --message="Restarting Etherpad..." --weight=9
|
ynh_script_progression --message="Restarting Etherpad..." --weight=9
|
||||||
|
|
||||||
# Wait for etherpad to be fully started
|
# Wait for etherpad to be fully started
|
||||||
ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120"
|
ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -130,7 +130,7 @@ ynh_systemd_action --action=reload --service_name=nginx
|
||||||
ynh_script_progression --message="Restarting Etherpad..." --weight=10
|
ynh_script_progression --message="Restarting Etherpad..." --weight=10
|
||||||
|
|
||||||
# Wait for etherpad to be fully started
|
# Wait for etherpad to be fully started
|
||||||
ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120"
|
ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DEACTIVE MAINTENANCE MODE
|
# DEACTIVE MAINTENANCE MODE
|
||||||
|
|
|
@ -78,16 +78,6 @@ else
|
||||||
fi
|
fi
|
||||||
pad_config_automatic_logout="${YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_AUTOMATIC_LOGOUT:-$old_pad_config_automatic_logout}"
|
pad_config_automatic_logout="${YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_AUTOMATIC_LOGOUT:-$old_pad_config_automatic_logout}"
|
||||||
|
|
||||||
# Etherpad skin
|
|
||||||
old_pad_config_skinname="$(get_config_value skinName)"
|
|
||||||
if [ "$old_pad_config_skinname" = "no-skin" ]; then
|
|
||||||
old_pad_config_skinname=noskin
|
|
||||||
fi
|
|
||||||
pad_config_skinname="${YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_SKINNAME:-$old_pad_config_skinname}"
|
|
||||||
if [ "$pad_config_skinname" = "no-skin" ]; then
|
|
||||||
pad_config_skinname=noskin
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Mypads
|
# Mypads
|
||||||
if [ -d $final_path/node_modules/ep_mypads ]
|
if [ -d $final_path/node_modules/ep_mypads ]
|
||||||
then
|
then
|
||||||
|
@ -146,7 +136,6 @@ show_config() {
|
||||||
ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_ALWAYSSHOWCHAT=$pad_config_alwaysshowchat"
|
ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_ALWAYSSHOWCHAT=$pad_config_alwaysshowchat"
|
||||||
ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_SHOW_MARKDOWN=$pad_config_show_markdown"
|
ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_SHOW_MARKDOWN=$pad_config_show_markdown"
|
||||||
ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_AUTOMATIC_LOGOUT=$pad_config_automatic_logout"
|
ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_AUTOMATIC_LOGOUT=$pad_config_automatic_logout"
|
||||||
ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_SKINNAME=$pad_config_skinname"
|
|
||||||
|
|
||||||
ynh_return "YNH_CONFIG_MAIN_MYPADS_CONFIGURATION_MYPADS=$mypads"
|
ynh_return "YNH_CONFIG_MAIN_MYPADS_CONFIGURATION_MYPADS=$mypads"
|
||||||
ynh_return "YNH_CONFIG_MAIN_MYPADS_CONFIGURATION_USELDAP=$useldap"
|
ynh_return "YNH_CONFIG_MAIN_MYPADS_CONFIGURATION_USELDAP=$useldap"
|
||||||
|
@ -230,17 +219,6 @@ apply_config() {
|
||||||
restart_etherpad=1
|
restart_etherpad=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Plugin option ep_page_view_default
|
|
||||||
if [ "$pad_config_skinname" != "$old_pad_config_skinname" ]
|
|
||||||
then
|
|
||||||
if [ "$pad_config_skinname" = "noskin" ]; then
|
|
||||||
pad_config_skinname="no-skin"
|
|
||||||
fi
|
|
||||||
ynh_replace_string --match_string="\( *\"skinName\" *: \).*," --replace_string="\1\"$pad_config_skinname\"," --target_file="$config_file"
|
|
||||||
ynh_app_setting_set --app=$app --key=pad_config_skinname --value="$pad_config_skinname"
|
|
||||||
restart_etherpad=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Export
|
# Export
|
||||||
if [ "$export" != "$old_export" ]
|
if [ "$export" != "$old_export" ]
|
||||||
then
|
then
|
||||||
|
@ -310,7 +288,7 @@ apply_config() {
|
||||||
if [ $restart_etherpad -eq 1 ]
|
if [ $restart_etherpad -eq 1 ]
|
||||||
then
|
then
|
||||||
# Wait for etherpad to be fully started
|
# Wait for etherpad to be fully started
|
||||||
ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120"
|
ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -161,16 +161,22 @@ ynh_use_logrotate --specific_user=$app/$app
|
||||||
ynh_script_progression --message="Installing Etherpad..." --weight=90
|
ynh_script_progression --message="Installing Etherpad..." --weight=90
|
||||||
|
|
||||||
# Install dependencies and proceed to the installation
|
# Install dependencies and proceed to the installation
|
||||||
ynh_use_nodejs
|
# ynh_use_nodejs
|
||||||
(
|
# (
|
||||||
cd "$final_path"
|
# cd "$final_path"
|
||||||
mkdir -p node_modules
|
# mkdir -p node_modules
|
||||||
cd node_modules
|
# cd node_modules
|
||||||
[ -e ep_etherpad-lite ] || ln -s ../src ep_etherpad-lite
|
# [ -e ep_etherpad-lite ] || ln -s ../src ep_etherpad-lite
|
||||||
cd ep_etherpad-lite
|
# cd ep_etherpad-lite
|
||||||
chown -R $app: $final_path
|
# chown -R $app: $final_path
|
||||||
ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" install --save --loglevel warn
|
# ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" install --save --loglevel warn
|
||||||
)
|
# )
|
||||||
|
|
||||||
|
chown -R $app: $final_path
|
||||||
|
pushd $final_path
|
||||||
|
ynh_use_nodejs
|
||||||
|
ynh_exec_as $app env "$ynh_node_load_PATH" bin/installDeps.sh
|
||||||
|
popd
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CONFIGURE ETHERPAD
|
# CONFIGURE ETHERPAD
|
||||||
|
@ -178,12 +184,8 @@ ynh_use_nodejs
|
||||||
ynh_script_progression --message="Configuring Etherpad..." --weight=6
|
ynh_script_progression --message="Configuring Etherpad..." --weight=6
|
||||||
|
|
||||||
cp ../conf/settings.json "$final_path/settings.json"
|
cp ../conf/settings.json "$final_path/settings.json"
|
||||||
cp ../conf/credentials.json "$final_path/credentials.json"
|
|
||||||
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/settings.json"
|
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/settings.json"
|
||||||
ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_name" --target_file="$final_path/credentials.json"
|
|
||||||
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/credentials.json"
|
|
||||||
ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/credentials.json"
|
|
||||||
ynh_print_OFF; ynh_replace_special_string --match_string="__PASSWD__" --replace_string="$password" --target_file="$final_path/credentials.json"; ynh_print_ON
|
|
||||||
if [ "$export" = "abiword" ]
|
if [ "$export" = "abiword" ]
|
||||||
then
|
then
|
||||||
# Get abiword binary path
|
# Get abiword binary path
|
||||||
|
@ -207,8 +209,8 @@ fi
|
||||||
|
|
||||||
# Calculate and store the config file checksum into the app settings
|
# Calculate and store the config file checksum into the app settings
|
||||||
ynh_store_file_checksum --file="$final_path/settings.json"
|
ynh_store_file_checksum --file="$final_path/settings.json"
|
||||||
# Calculate and store the config file checksum into the app settings
|
|
||||||
ynh_store_file_checksum --file="$final_path/credentials.json"
|
ynh_add_config --template="../conf/credentials.json" --destination="$final_path/credentials.json"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SECURING FILES AND DIRECTORIES
|
# SECURING FILES AND DIRECTORIES
|
||||||
|
@ -224,9 +226,8 @@ chmod 600 $final_path/credentials.json
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring a systemd service..." --weight=4
|
ynh_script_progression --message="Configuring a systemd service..." --weight=4
|
||||||
|
|
||||||
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
|
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config --others_var="ynh_node_load_PATH"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||||
|
@ -295,7 +296,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP FAIL2BAN
|
# SETUP FAIL2BAN
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring Fail2ban..." --weight=13
|
ynh_script_progression --message="Configuring Fail2Ban..." --weight=13
|
||||||
|
|
||||||
# Create a dedicated fail2ban config
|
# Create a dedicated fail2ban config
|
||||||
ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-access.log" --failregex="<HOST> .* .POST /mypads/api/auth/login HTTP/1.1. 400" --max_retry=5
|
ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-access.log" --failregex="<HOST> .* .POST /mypads/api/auth/login HTTP/1.1. 400" --max_retry=5
|
||||||
|
@ -325,7 +326,7 @@ ynh_systemd_action --action=reload --service_name=nginx
|
||||||
ynh_script_progression --message="Restarting Etherpad..." --weight=20
|
ynh_script_progression --message="Restarting Etherpad..." --weight=20
|
||||||
|
|
||||||
# Wait for etherpad to be fully started
|
# Wait for etherpad to be fully started
|
||||||
ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120"
|
ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120"
|
||||||
|
|
||||||
if [ $mypads -eq 1 ]
|
if [ $mypads -eq 1 ]
|
||||||
then
|
then
|
||||||
|
@ -333,7 +334,7 @@ then
|
||||||
mysql -u $db_name -p$db_pwd $db_name < "../conf/lang_mypads.sql"
|
mysql -u $db_name -p$db_pwd $db_name < "../conf/lang_mypads.sql"
|
||||||
|
|
||||||
# Wait for etherpad to be fully started
|
# Wait for etherpad to be fully started
|
||||||
ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120"
|
ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -173,7 +173,7 @@ ynh_systemd_action --action=reload --service_name=nginx
|
||||||
ynh_script_progression --message="Restarting Etherpad..." --weight=8
|
ynh_script_progression --message="Restarting Etherpad..." --weight=8
|
||||||
|
|
||||||
# Wait for etherpad to be fully started
|
# Wait for etherpad to be fully started
|
||||||
ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120"
|
ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DEACTIVE MAINTENANCE MODE
|
# DEACTIVE MAINTENANCE MODE
|
||||||
|
|
|
@ -27,6 +27,8 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
export=$(ynh_app_setting_get --app=$app --key=export)
|
export=$(ynh_app_setting_get --app=$app --key=export)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
|
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||||
|
ynh_print_OFF; password=$(ynh_app_setting_get --app=$app --key=password); ynh_print_ON
|
||||||
mypads=$(ynh_app_setting_get --app=$app --key=mypads)
|
mypads=$(ynh_app_setting_get --app=$app --key=mypads)
|
||||||
useldap=$(ynh_app_setting_get --app=$app --key=useldap)
|
useldap=$(ynh_app_setting_get --app=$app --key=useldap)
|
||||||
overwrite_settings=$(ynh_app_setting_get --app=$app --key=overwrite_settings)
|
overwrite_settings=$(ynh_app_setting_get --app=$app --key=overwrite_settings)
|
||||||
|
@ -40,14 +42,13 @@ pad_config_showlinenumbers=$(ynh_app_setting_get --app=$app --key=pad_config_sho
|
||||||
pad_config_chatandusers=$(ynh_app_setting_get --app=$app --key=pad_config_chatandusers)
|
pad_config_chatandusers=$(ynh_app_setting_get --app=$app --key=pad_config_chatandusers)
|
||||||
pad_config_alwaysshowchat=$(ynh_app_setting_get --app=$app --key=pad_config_alwaysshowchat)
|
pad_config_alwaysshowchat=$(ynh_app_setting_get --app=$app --key=pad_config_alwaysshowchat)
|
||||||
pad_config_show_markdown=$(ynh_app_setting_get --app=$app --key=pad_config_show_markdown)
|
pad_config_show_markdown=$(ynh_app_setting_get --app=$app --key=pad_config_show_markdown)
|
||||||
pad_config_skinname=$(ynh_app_setting_get --app=$app --key=pad_config_skinname)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Wait for etherpad to be fully started
|
# Wait for etherpad to be fully started
|
||||||
ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120"
|
ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120"
|
||||||
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
upgrade_type=$(ynh_check_app_version_changed)
|
||||||
|
|
||||||
|
@ -209,13 +210,6 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading NodeJS..." --weight=4
|
ynh_script_progression --message="Upgrading NodeJS..." --weight=4
|
||||||
|
|
||||||
# Remove the old nvm helper.
|
|
||||||
if [ -d /opt/nvm ]
|
|
||||||
then
|
|
||||||
ynh_secure_remove --file="/opt/nvm"
|
|
||||||
sed --in-place "/NVM_DIR/d" /root/.bashrc
|
|
||||||
fi
|
|
||||||
|
|
||||||
ynh_install_nodejs --nodejs_version=$nodejs_version
|
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -231,9 +225,24 @@ ynh_exec_warn_less npm cache clean --force
|
||||||
ynh_secure_remove --file="$final_path/src/package-lock.json"
|
ynh_secure_remove --file="$final_path/src/package-lock.json"
|
||||||
ynh_exec_warn_less ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" update)
|
ynh_exec_warn_less ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" update)
|
||||||
|
|
||||||
|
|
||||||
|
pushd $final_path
|
||||||
|
ynh_use_nodejs
|
||||||
|
ynh_exec_as $app env "$ynh_node_load_PATH" src/bin/installDeps.sh
|
||||||
|
#ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm cache clean --force
|
||||||
|
#ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm install --upgrade
|
||||||
|
ynh_exec_as $app env "$ynh_node_load_PATH" npm install ep_automatic_logut ep_countable ep_delete_empty_pads ep_subscript_and_superscript ep_headings2 ep_author_hover ep_markdown ep_comments_page ep_align ep_font_color ep_font_size ep_spellcheck ep_table_of_contents >> $install_log 2>&1
|
||||||
|
if [ $mypads -eq 1 ]; then
|
||||||
|
# Framapad - Groups and private pads for Etherpad
|
||||||
|
ynh_exec_as $app env "$ynh_node_load_PATH" npm install ep_mypads >> $install_log 2>&1
|
||||||
|
fi
|
||||||
|
popd
|
||||||
|
|
||||||
|
|
||||||
# Then update the additionnal modules
|
# Then update the additionnal modules
|
||||||
(cd "$final_path"
|
(cd "$final_path"
|
||||||
ynh_exec_warn_less npm cache clean --force
|
#ynh_exec_warn_less npm cache clean --force
|
||||||
|
ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm cache clean --force
|
||||||
while read node_module
|
while read node_module
|
||||||
do
|
do
|
||||||
# Ignore ep_etherpad-lite, this part is updated before in this script.
|
# Ignore ep_etherpad-lite, this part is updated before in this script.
|
||||||
|
@ -251,9 +260,12 @@ do
|
||||||
if [ -n "${module_version}" ]; then
|
if [ -n "${module_version}" ]; then
|
||||||
module_version=@${module_version}
|
module_version=@${module_version}
|
||||||
fi
|
fi
|
||||||
ynh_exec_warn_less ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" install --upgrade ${node_module}${module_version} || true
|
ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm install --upgrade ${node_module}${module_version} || true
|
||||||
done <<< "$(ls -1 "$final_path/node_modules" | grep "^ep_")")
|
done <<< "$(ls -1 "$final_path/node_modules" | grep "^ep_")")
|
||||||
|
|
||||||
|
# ynh_exec_warn_less ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" install --upgrade ${node_module}${module_version} || true
|
||||||
|
# done <<< "$(ls -1 "$final_path/node_modules" | grep "^ep_")")
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# SPECIFIC UPGRADE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -315,9 +327,6 @@ then
|
||||||
if [ -n "$pad_config_show_markdown" ]; then
|
if [ -n "$pad_config_show_markdown" ]; then
|
||||||
ynh_replace_string --match_string="\(\"ep_markdown_default\" *: \).*," --replace_string="\1$pad_config_show_markdown," --target_file="$final_path/settings.json"
|
ynh_replace_string --match_string="\(\"ep_markdown_default\" *: \).*," --replace_string="\1$pad_config_show_markdown," --target_file="$final_path/settings.json"
|
||||||
fi
|
fi
|
||||||
if [ -n "$pad_config_skinname" ]; then
|
|
||||||
ynh_replace_string --match_string="\(\"skinName\" *: \).*," --replace_string="\1\"$pad_config_skinname\"," --target_file="$final_path/settings.json"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Recalculate and store the checksum of the file for the next upgrade.
|
# Recalculate and store the checksum of the file for the next upgrade.
|
||||||
ynh_store_file_checksum --file="$final_path/settings.json"
|
ynh_store_file_checksum --file="$final_path/settings.json"
|
||||||
|
@ -326,19 +335,7 @@ then
|
||||||
# Overwrite the credentials config file only if it's allowed
|
# Overwrite the credentials config file only if it's allowed
|
||||||
if [ $overwrite_credentials -eq 1 ]
|
if [ $overwrite_credentials -eq 1 ]
|
||||||
then
|
then
|
||||||
# Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
|
ynh_add_config --template="../conf/credentials.json" --destination="$final_path/credentials.json"
|
||||||
ynh_backup_if_checksum_is_different --file="$final_path/credentials.json"
|
|
||||||
cp ../conf/credentials.json "$final_path/credentials.json"
|
|
||||||
|
|
||||||
ynh_replace_string --match_string="__DB_USER__" --replace_string="$app" --target_file="$final_path/credentials.json"
|
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
|
||||||
ynh_print_OFF; password=$(ynh_app_setting_get --app=$app --key=password); ynh_print_ON
|
|
||||||
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/credentials.json"
|
|
||||||
ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/credentials.json"
|
|
||||||
ynh_print_OFF; ynh_replace_special_string --match_string="__PASSWD__" --replace_string="$password" --target_file="$final_path/credentials.json"; ynh_print_ON
|
|
||||||
|
|
||||||
# Recalculate and store the checksum of the file for the next upgrade.
|
|
||||||
ynh_store_file_checksum --file="$final_path/credentials.json"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -390,8 +387,7 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=2
|
||||||
# Overwrite the systemd configuration only if it's allowed
|
# Overwrite the systemd configuration only if it's allowed
|
||||||
if [ $overwrite_systemd -eq 1 ]
|
if [ $overwrite_systemd -eq 1 ]
|
||||||
then
|
then
|
||||||
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
|
ynh_add_systemd_config --others_var="ynh_node_load_PATH"
|
||||||
ynh_add_systemd_config
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue