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 #140 from YunoHost-Apps/remove-automatic-logut

Remove automatic logut
This commit is contained in:
Éric Gaspar 2021-05-15 07:38:51 +02:00 committed by GitHub
commit 6f809fbe90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 8 additions and 56 deletions

View file

@ -1,6 +1,12 @@
Changelog Changelog
========= =========
## [1.8.13~ynh2]() - 2021-05-14
#### Disabled
* [ep_automatic_logut plugin](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/pull/140/files)
## [1.8.13~ynh1]() - 2021-03-23 ## [1.8.13~ynh1]() - 2021-03-23
#### Changed #### Changed

View file

@ -54,7 +54,6 @@ You can also find a configuration file for Etherpad at this path `/var/www/ether
* [ep_align](https://www.npmjs.com/package/ep_align) - *Add Left/Center/Right/Justify to lines of text in a pad* * [ep_align](https://www.npmjs.com/package/ep_align) - *Add Left/Center/Right/Justify to lines of text in a pad*
* [ep_author_hover](https://www.npmjs.com/package/ep_author_hover) - *Adds author names to span titles* * [ep_author_hover](https://www.npmjs.com/package/ep_author_hover) - *Adds author names to span titles*
* [ep_automatic_logut](https://www.npmjs.com/package/ep_automatic_logut) - *Automatically disconnects user after some period of time (Prevent server overload)*
* [ep_comments_page](https://www.npmjs.com/package/ep_comments_page) - *Adds comments on sidebar and link it to the text.* * [ep_comments_page](https://www.npmjs.com/package/ep_comments_page) - *Adds comments on sidebar and link it to the text.*
* [ep_countable](https://www.npmjs.com/package/ep_countable) - *Adds paragraphs, words and characters count* * [ep_countable](https://www.npmjs.com/package/ep_countable) - *Adds paragraphs, words and characters count*
* [ep_delete_empty_pads](https://www.npmjs.com/package/ep_delete_empty_pads) - *Delete pads which were never edited* * [ep_delete_empty_pads](https://www.npmjs.com/package/ep_delete_empty_pads) - *Delete pads which were never edited*

View file

@ -53,7 +53,6 @@ Vous pouvez accéder à deux panneaux d'administration différents, pour Etherpa
* [ep_align](https://www.npmjs.com/package/ep_align) - *Ajoute Gauche/Centre/Droite/Justifier à des lignes de texte dans un pad* * [ep_align](https://www.npmjs.com/package/ep_align) - *Ajoute Gauche/Centre/Droite/Justifier à des lignes de texte dans un pad*
* [ep_author_hover](https://www.npmjs.com/package/ep_author_hover) - *Ajoute des noms d'auteurs* * [ep_author_hover](https://www.npmjs.com/package/ep_author_hover) - *Ajoute des noms d'auteurs*
* [ep_automatic_logut](https://www.npmjs.com/package/ep_automatic_logut) - *Déconnecte automatiquement l'utilisateur après une certaine période de temps (Prévient la surcharge du serveur)*
* [ep_comments_page](https://www.npmjs.com/package/ep_comments_page) - *Ajoute des commentaires sur la sidebar et le lie au texte.* * [ep_comments_page](https://www.npmjs.com/package/ep_comments_page) - *Ajoute des commentaires sur la sidebar et le lie au texte.*
* [ep_countable](https://www.npmjs.com/package/ep_countable) - *Ajoute l'afficher le nombre de paragraphes, de mots et de caractères* * [ep_countable](https://www.npmjs.com/package/ep_countable) - *Ajoute l'afficher le nombre de paragraphes, de mots et de caractères*
* [ep_delete_empty_pads](https://www.npmjs.com/package/ep_delete_empty_pads) - *Supprimer les pads qui n'ont jamais été édités* * [ep_delete_empty_pads](https://www.npmjs.com/package/ep_delete_empty_pads) - *Supprimer les pads qui n'ont jamais été édités*

View file

@ -18,7 +18,6 @@
main.pad_configuration.pad_config_chatandusers=1|0 main.pad_configuration.pad_config_chatandusers=1|0
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.mypads_configuration.mypads=0|1 main.mypads_configuration.mypads=0|1
main.mypads_configuration.useldap=0|1 main.mypads_configuration.useldap=0|1
main.overwrite_files.overwrite_settings=0|1 main.overwrite_files.overwrite_settings=0|1

View file

@ -204,9 +204,6 @@
}, },
// Plugins config // Plugins config
// ep_automatic_logut
"automatic_logut_mins_show" : true, // Show logout time selector
"automatic_logut_url" : "../../", // Redirection URL address
// ep_markdown // ep_markdown
"ep_markdown_default": false, // Setting as default "ep_markdown_default": false, // Setting as default

View file

@ -41,11 +41,6 @@ name = "Etherpad configuration"
ask = "Show markdown syntax?" ask = "Show markdown syntax?"
type = "boolean" type = "boolean"
default = false default = false
[main.pad_configuration.pad_config_automatic_logout]
ask = "Automatic logout"
type = "boolean"
default = true
[main.mypads_configuration] [main.mypads_configuration]

View file

@ -16,7 +16,6 @@ mypads_version=1.7.20
# Plugin versions # Plugin versions
ep_align_version=0.3.34 ep_align_version=0.3.34
ep_author_hover_version=0.3.19 ep_author_hover_version=0.3.19
ep_automatic_logut_version=1.0.8
ep_comments_page_version=0.1.60 ep_comments_page_version=0.1.60
ep_countable_version=0.0.11 ep_countable_version=0.0.11
ep_delete_empty_pads_version=0.0.7 ep_delete_empty_pads_version=0.0.7

View file

@ -8,7 +8,6 @@
# Load common variables for all scripts. # Load common variables for all scripts.
source _variables source _variables
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -67,17 +66,6 @@ pad_config_alwaysshowchat="${YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_ALWAYS
old_pad_config_show_markdown="$(get_config_value ep_markdown_default)" old_pad_config_show_markdown="$(get_config_value ep_markdown_default)"
pad_config_show_markdown="${YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_SHOW_MARKDOWN:-$old_pad_config_show_markdown}" pad_config_show_markdown="${YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_SHOW_MARKDOWN:-$old_pad_config_show_markdown}"
# Enable/disable ep_automatic_logut
if grep -q "//.*\"automatic_logut_" $config_file
then
# Disable
old_pad_config_automatic_logout=0
else
# Enable
old_pad_config_automatic_logout=1
fi
pad_config_automatic_logout="${YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_AUTOMATIC_LOGOUT:-$old_pad_config_automatic_logout}"
# MyPads # MyPads
if [ -d $final_path/node_modules/ep_mypads ] if [ -d $final_path/node_modules/ep_mypads ]
then then
@ -131,7 +119,6 @@ show_config() {
ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_CHATANDUSERS=$pad_config_chatandusers" ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_CHATANDUSERS=$pad_config_chatandusers"
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_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"
ynh_return "YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_SETTINGS=$overwrite_settings" ynh_return "YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_SETTINGS=$overwrite_settings"
@ -193,25 +180,6 @@ apply_config() {
restart_etherpad=1 restart_etherpad=1
fi fi
# Plugin option ep_automatic_logut
if [ "$pad_config_automatic_logout" != "$old_pad_config_automatic_logout" ]
then
ynh_use_nodejs
#pushd "$final_path/src"
#ynh_secure_remove --file="$final_path/src/package-lock.json" #added to fix saveError ENOENT: no such file or directory
if [ "$pad_config_automatic_logout" = "0" ]
then
ynh_replace_string --match_string="^\(.*\"automatic_logut.*$\)" --replace_string="\/\/\1" --target_file="$config_file"
ynh_exec_as $app env "$ynh_node_load_PATH" npm uninstall ep_automatic_logut
else
ynh_replace_string --match_string="^\/\/\(.*\"automatic_logut.*$\)" --replace_string="\1" --target_file="$config_file"
ynh_exec_as $app env "$ynh_node_load_PATH" npm install ep_automatic_logut@${ep_automatic_logut_version}
fi
popd
chown -R $app: $final_path/node_modules
restart_etherpad=1
fi
# Export # Export
if [ "$export" != "$old_export" ] if [ "$export" != "$old_export" ]
then then

View file

@ -238,8 +238,6 @@ pushd "$final_path"
ynh_npm install ep_align@${ep_align_version} >> $install_log 2>&1 ynh_npm install ep_align@${ep_align_version} >> $install_log 2>&1
# Framapad - Adds author names to span titles # Framapad - Adds author names to span titles
ynh_npm install ep_author_hover@${ep_author_hover_version} >> $install_log 2>&1 ynh_npm install ep_author_hover@${ep_author_hover_version} >> $install_log 2>&1
# Automatically disconnects user after some period of time (Prevent server overload)
ynh_npm install ep_automatic_logut@${ep_automatic_logut_version} >> $install_log 2>&1
# Framapad - Adds comments on sidebar and link it to the text. # Framapad - Adds comments on sidebar and link it to the text.
ynh_npm install ep_comments_page@${ep_comments_page_version} >> $install_log 2>&1 ynh_npm install ep_comments_page@${ep_comments_page_version} >> $install_log 2>&1
# Framapad - Displays paragraphs, sentences, words and characters counts. # Framapad - Displays paragraphs, sentences, words and characters counts.
@ -280,10 +278,7 @@ then
ynh_replace_string --match_string="^ *\"FOOTER\": .*2.0" --replace_string="& | <a href='../admin'>Etherpad admin</a>" --target_file=$final_path/node_modules/ep_mypads/static/l10n/en.json ynh_replace_string --match_string="^ *\"FOOTER\": .*2.0" --replace_string="& | <a href='../admin'>Etherpad admin</a>" --target_file=$final_path/node_modules/ep_mypads/static/l10n/en.json
ynh_replace_string --match_string="^ *\"FOOTER\": .*2.0" --replace_string="& | <a href='../admin'>Etherpad admin</a>" --target_file=$final_path/node_modules/ep_mypads/static/l10n/fr.json ynh_replace_string --match_string="^ *\"FOOTER\": .*2.0" --replace_string="& | <a href='../admin'>Etherpad admin</a>" --target_file=$final_path/node_modules/ep_mypads/static/l10n/fr.json
## Find the /div just after the field to open a pad # Find the /div just after the field to open a pad in order to add a link to MyPads plugin.
#mod_line=$(grep -nA5 "index.createOpenPad" $final_path/src/templates/index.html | grep "</div>" | cut -d '-' -f 1)
## In order to add a link to MyPads plugin.
#sed -i "$mod_line s@div>@&\n\t<center><br><font size="5"><a href="./mypads/">MyPads</a></font></center>@" $final_path/src/templates/index.html
sed -i '157i<center><br><font size="4"><a href="./mypads/" style="text-decoration: none; color: #555">MyPads</a></font></center>' $final_path/src/templates/index.html sed -i '157i<center><br><font size="4"><a href="./mypads/" style="text-decoration: none; color: #555">MyPads</a></font></center>' $final_path/src/templates/index.html
fi fi

View file

@ -288,8 +288,6 @@ pushd "$final_path"
ynh_npm install ep_align@${ep_align_version} >> $install_log 2>&1 ynh_npm install ep_align@${ep_align_version} >> $install_log 2>&1
# Framapad - Adds author names to span titles # Framapad - Adds author names to span titles
ynh_npm install ep_author_hover@${ep_author_hover_version} >> $install_log 2>&1 ynh_npm install ep_author_hover@${ep_author_hover_version} >> $install_log 2>&1
# Automatically disconnects user after some period of time (Prevent server overload)
ynh_npm install ep_automatic_logut@${ep_automatic_logut_version} >> $install_log 2>&1
# Framapad - Adds comments on sidebar and link it to the text. # Framapad - Adds comments on sidebar and link it to the text.
ynh_npm install ep_comments_page@${ep_comments_page_version} >> $install_log 2>&1 ynh_npm install ep_comments_page@${ep_comments_page_version} >> $install_log 2>&1
# Framapad - Displays paragraphs, sentences, words and characters counts. # Framapad - Displays paragraphs, sentences, words and characters counts.
@ -440,10 +438,7 @@ fi
if [ "$upgrade_type" == "UPGRADE_APP" ] && [ $mypads -eq 1 ] if [ "$upgrade_type" == "UPGRADE_APP" ] && [ $mypads -eq 1 ]
then then
# # Find the /div just after the field to open a pad # Find the /div just after the field to open a pad in order to add a link to mypads plugin.
# mod_line=$(grep -nA5 "index.createOpenPad" $final_path/src/templates/index.html | grep "</div>" | cut -d '-' -f 1)
# # In order to add a link to mypads plugin.
# sed -i "$mod_line s@div>@&\n\t<center><br><font size="5"><a href="./mypads/">MyPads</a></font></center>@" $final_path/src/templates/index.html
sed -i '157i<center><br><font size="4"><a href="./mypads/" style="text-decoration: none; color: #555">MyPads</a></font></center>' $final_path/src/templates/index.html sed -i '157i<center><br><font size="4"><a href="./mypads/" style="text-decoration: none; color: #555">MyPads</a></font></center>' $final_path/src/templates/index.html
fi fi