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 #33 from YunoHost-Apps/testing

Testing
This commit is contained in:
Maniack Crudelis 2018-05-20 09:42:25 +02:00 committed by GitHub
commit 9dad238059
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 157 additions and 110 deletions

View file

@ -12,12 +12,16 @@ 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.6.3 **Shipped version:** 1.6.5
## Screenshots ## Screenshots
![](http://etherpad.org/img/screenshot.png) ![](http://etherpad.org/img/screenshot.png)
## Demo
* [Official demo](https://oasis.sandstorm.io/appdemo/h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60)
## Configuration ## Configuration
You can access to 2 different admin panels, for etherpad by accessing `domain.tld/admin` and for mypads by `domain.tld/mypads/?/admin`. You can access to 2 different admin panels, for etherpad by accessing `domain.tld/admin` and for mypads by `domain.tld/mypads/?/admin`.
@ -25,19 +29,19 @@ Or, you can find a config file for etherpad at this path `/var/www/etherpad_mypa
## Documentation ## Documentation
* Official documentation: http://etherpad.org/doc/v1.6.3 * Official documentation: http://etherpad.org/doc/v1.6.5
* YunoHost documentation: There no other documentations, feel free to contribute. * YunoHost documentation: There no other documentations, feel free to contribute.
## YunoHost specific features ## YunoHost specific features
#### Multi-users support #### Multi-users support
Supported, **without LDAP nor SSO**. Supported, with LDAP.
#### Supported architectures #### Supported architectures
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/jenkins/job/etherpad_mypads%20(Community)/badge/icon)](https://ci-apps.yunohost.org/jenkins/job/etherpad_mypads%20(Community)/) * x86-64b - [![Build Status](https://ci-apps.yunohost.org/jenkins/job/etherpad_mypads%20(Community)/badge/icon)](https://ci-apps.yunohost.org/jenkins/job/etherpad_mypads%20(Community)/)
* ARMv8-A - [![Build Status](https://ci-apps.yunohost.org/jenkins/job/etherpad_mypads%20(Community)%20(%7EARM%7E)/badge/icon)](https://ci-apps.yunohost.org/jenkins/job/etherpad_mypads%20(Community)%20(%7EARM%7E)/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/jenkins/job/etherpad_mypads%20(Community)%20(%7EARM%7E)/badge/icon)](https://ci-apps-arm.yunohost.org/jenkins/job/etherpad_mypads%20(Community)%20(%7EARM%7E)/)
## Limitations ## Limitations
@ -45,21 +49,21 @@ Supported, **without LDAP nor SSO**.
* This package will install the following plugins: * This package will install the following plugins:
* 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 - *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 - *Automatically disconnects user after some period of time (Prevent server overload)* * [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 - *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 - *Displays paragraphs, sentences, words and characters counts.* * [ep_countable](https://www.npmjs.com/package/ep_countable) - *Displays paragraphs, sentences, words and characters counts.*
* 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*
* ep_font_color - *Apply colors to fonts* * [ep_font_color](https://www.npmjs.com/package/ep_font_color) - *Apply colors to fonts*
* ep_headings2 - *Adds heading support to Etherpad Lite.* * [ep_headings2](https://www.npmjs.com/package/ep_headings2) - *Adds heading support to Etherpad Lite.*
* ep_markdown - *Edit and Export as Markdown in Etherpad* * [ep_markdown](https://www.npmjs.com/package/ep_markdown) - *Edit and Export as Markdown in Etherpad*
* ep_mypads - *Groups and private pads for etherpad* * [ep_mypads](https://www.npmjs.com/package/ep_mypads) - *Groups and private pads for etherpad*
* ep_page_view - *Add support to do 'page view', with a toggle on/off option in Settings, also Page Breaks with Control Enter* * [ep_page_view](https://www.npmjs.com/package/ep_page_view) - *Add support to do 'page view', with a toggle on/off option in Settings, also Page Breaks with Control Enter*
* ep_spellcheck - *Add support to do 'Spell checking'* * [ep_spellcheck](https://www.npmjs.com/package/ep_spellcheck) - *Add support to do 'Spell checking'*
* ep_subscript_and_superscript - *Add support for Subscript and Superscript* * [ep_subscript_and_superscript](https://www.npmjs.com/package/ep_subscript_and_superscript) - *Add support for Subscript and Superscript*
* ep_table_of_contents - *View a table of contents for your pad* * [ep_table_of_contents](https://www.npmjs.com/package/ep_table_of_contents) - *View a table of contents for your pad*
* ep_user_font_size - *User Pad Contents font size can be set in settings, this does not effect other peoples views* * [ep_user_font_size](https://www.npmjs.com/package/ep_user_font_size) - *User Pad Contents font size can be set in settings, this does not effect other peoples views*
## Links ## Links

View file

@ -12,12 +12,16 @@ 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.6.3 **Version embarquée:** 1.6.5
## Captures d'écran ## Captures d'écran
![](http://etherpad.org/img/screenshot.png) ![](http://etherpad.org/img/screenshot.png)
## Démo
* [Démo officielle](https://oasis.sandstorm.io/appdemo/h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60)
## Configuration ## Configuration
Vous pouvez accéder à 2 panneaux d'administration différents, pour etherpad en accédant à `domain.tld/admin` et pour mypads par `domain.tld/mypads/?/admin`. Vous pouvez accéder à 2 panneaux d'administration différents, pour etherpad en accédant à `domain.tld/admin` et pour mypads par `domain.tld/mypads/?/admin`.
@ -25,19 +29,19 @@ Ou, vous pouvez trouver un fichier de configuration pour etherpad à `/var/www/e
## Documentation ## Documentation
* Documentation officielle: http://etherpad.org/doc/v1.6.3 * Documentation officielle: http://etherpad.org/doc/v1.6.5
* Documentation YunoHost: Il n'y a pas d'autre documentation, n'hésitez pas à contribuer. * Documentation YunoHost: Il n'y a pas d'autre documentation, n'hésitez pas à contribuer.
## Fonctionnalités spécifiques à YunoHost ## Fonctionnalités spécifiques à YunoHost
#### Support multi-utilisateurs #### Support multi-utilisateurs
Supportée, **sans LDAP ni SSO**. Supportée, avec LDAP.
#### Architectures supportées. #### Architectures supportées.
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/jenkins/job/etherpad_mypads%20(Community)/badge/icon)](https://ci-apps.yunohost.org/jenkins/job/etherpad_mypads%20(Community)/) * x86-64b - [![Build Status](https://ci-apps.yunohost.org/jenkins/job/etherpad_mypads%20(Community)/badge/icon)](https://ci-apps.yunohost.org/jenkins/job/etherpad_mypads%20(Community)/)
* ARMv8-A - [![Build Status](https://ci-apps.yunohost.org/jenkins/job/etherpad_mypads%20(Community)%20(%7EARM%7E)/badge/icon)](https://ci-apps.yunohost.org/jenkins/job/etherpad_mypads%20(Community)%20(%7EARM%7E)/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/jenkins/job/etherpad_mypads%20(Community)%20(%7EARM%7E)/badge/icon)](https://ci-apps-arm.yunohost.org/jenkins/job/etherpad_mypads%20(Community)%20(%7EARM%7E)/)
## Limitations ## Limitations
@ -45,21 +49,21 @@ Supportée, **sans LDAP ni SSO**.
* Ce paquet installera les plugins suivants: * Ce paquet installera les plugins suivants:
* 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 - *Ajoute des noms d'auteurs* * [ep_author_hover](https://www.npmjs.com/package/ep_author_hover) - *Ajoute des noms d'auteurs*
* ep_automatic_logut - *Déconnecte automatiquement l'utilisateur après une certaine période de temps (Prévient la surcharge du serveur)* * [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 - *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 - *Affiche les paragraphes, phrases, mots et nombres de caractères.* * [ep_countable](https://www.npmjs.com/package/ep_countable) - *Affiche les paragraphes, phrases, mots et nombres de caractères.*
* 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*
* ep_font_color - *Appliquer les couleurs aux polices de caractères* * [ep_font_color](https://www.npmjs.com/package/ep_font_color) - *Appliquer les couleurs aux polices de caractères*
* ep_headings2 - *Ajoute le support de titre à Etherpad Lite.* * [ep_headings2](https://www.npmjs.com/package/ep_headings2) - *Ajoute le support de titre à Etherpad Lite.*
* ep_markdown - *Modifier et exporter en tant que Markdown dans Etherpad* * [ep_markdown](https://www.npmjs.com/package/ep_markdown) - *Modifier et exporter en tant que Markdown dans Etherpad*
* ep_mypads - *Groupes et pads privés pour etherpad* * [ep_mypads](https://www.npmjs.com/package/ep_mypads) - *Groupes et pads privés pour etherpad*
* ep_page_view - *Ajouter la prise en charge de 'page view', avec une option d'activation/désactivation dans Paramètres, ainsi que 'Page Breaks' avec Control + Entrée* * [ep_page_view](https://www.npmjs.com/package/ep_page_view) - *Ajouter la prise en charge de 'page view', avec une option d'activation/désactivation dans Paramètres, ainsi que 'Page Breaks' avec Control + Entrée*
* ep_spellcheck - *Ajouter le support pour faire de la vérification orthographique* * [ep_spellcheck](https://www.npmjs.com/package/ep_spellcheck) - *Ajouter le support pour faire de la vérification orthographique*
* ep_subscript_and_superscript - *Ajouter la prise en charge de Subscript et Superscript*. * [ep_subscript_and_superscript](https://www.npmjs.com/package/ep_subscript_and_superscript) - *Ajouter la prise en charge de Subscript et Superscript*.
* ep_table_of_contents - *Voir une table des matières pour votre pad* * [ep_table_of_contents](https://www.npmjs.com/package/ep_table_of_contents) - *Voir une table des matières pour votre pad*
* ep_user_font_size - *Permet de définir taille de la police dans les paramètres, cela n'affecte pas les vues des autres personnes*. * [ep_user_font_size](https://www.npmjs.com/package/ep_user_font_size)- *Permet de définir taille de la police dans les paramètres, cela n'affecte pas les vues des autres personnes*.
## Liens ## Liens

2
YEP.md
View file

@ -32,7 +32,7 @@
#### [Level 4](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-4) #### [Level 4](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-4)
[YEP 4.1 - Lier au ldap](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-41) [YEP 4.1 - Lier au ldap](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-41)
`Not yet validated` `Validated`
[YEP 4.2 - Lier l'authentification au sso](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-42) [YEP 4.2 - Lier l'authentification au sso](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-42)
`Not yet validated` `Not yet validated`

View file

@ -69,9 +69,8 @@
Level 1=auto Level 1=auto
Level 2=auto Level 2=auto
Level 3=auto Level 3=auto
# Level 4: Pas de support ldap. https://framagit.org/framasoft/ep_mypads/issues/31#note_30898 # Level 4: https://github.com/YunoHost-Apps/etherpad_mypads_ynh/blob/51ddcd64d68398018e3af6637339e2c20c4dc9a7/conf/settings.json#L90-L113
Level 4=na Level 4=1
# Level 5: https://github.com/YunoHost-Apps/etherpad_mypads_ynh/issues/11
Level 5=auto Level 5=auto
Level 6=auto Level 6=auto
Level 7=auto Level 7=auto

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/ether/etherpad-lite/archive/1.6.3.tar.gz SOURCE_URL=https://github.com/ether/etherpad-lite/archive/1.6.5.tar.gz
SOURCE_SUM=b82c249377f7a0c702d6a51affd32eba SOURCE_SUM=e0c5fac06a4ec37cfba66f4514bc27ef
SOURCE_SUM_PRG=md5sum SOURCE_SUM_PRG=md5sum
ARCH_FORMAT=tar.gz ARCH_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -6,7 +6,6 @@ After=syslog.target network.target
Type=simple Type=simple
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
ExecStartPre=__NODEJS__
Environment="PATH=__ENV_PATH__" Environment="PATH=__ENV_PATH__"
ExecStart=__FINALPATH__/bin/safeRun.sh /var/log/__APP__/etherpad.log ExecStart=__FINALPATH__/bin/safeRun.sh /var/log/__APP__/etherpad.log
Restart=always Restart=always

View file

@ -6,7 +6,7 @@
"en": "Framapad clone, a online editor providing collaborative editing in real-time.", "en": "Framapad clone, a online editor providing collaborative editing in real-time.",
"fr": "Clone de Framapad, un éditeur en ligne fournissant l'édition collaborative en temps réel." "fr": "Clone de Framapad, un éditeur en ligne fournissant l'édition collaborative en temps réel."
}, },
"version": "1.6.3~ynh2", "version": "1.6.5~ynh2",
"url": "https://framapad.org", "url": "https://framapad.org",
"license": "Apache-2.0", "license": "Apache-2.0",
"maintainer": { "maintainer": {

View file

@ -26,24 +26,16 @@ CHECK_SIZE () { # Vérifie avant chaque backup que l'espace est suffisant
# EXPERIMENTAL HELPERS # EXPERIMENTAL HELPERS
#================================================= #=================================================
# INFOS
# n (Node version management) utilise la variable PATH pour stocker le path de la version de node à utiliser.
# C'est ainsi qu'il change de version
# ynh_install_nodejs installe la version de nodejs demandée en argument, avec n
# ynh_use_nodejs active une version de nodejs dans le script courant
# 3 variables sont mises à disposition, et 2 sont stockées dans la config de l'app
# - nodejs_path: Le chemin absolu de cette version de node
# Utilisé pour des appels directs à node.
# - nodejs_version: Simplement le numéro de version de nodejs pour cette application
# - nodejs_use_version: Un alias pour charger une version de node dans le shell courant.
# Utilisé pour démarrer un service ou un script qui utilise node ou npm
# Dans ce cas, c'est $PATH qui contient le chemin de la version de node. Il doit être propagé sur les autres shell si nécessaire.
n_install_dir="/opt/node_n" n_install_dir="/opt/node_n"
node_version_path="/opt/node_n/n/versions/node" node_version_path="$n_install_dir/n/versions/node"
# N_PREFIX est le dossier de n, il doit être chargé dans les variables d'environnement pour n. # N_PREFIX is the directory of n, it needs to be loaded as a environment variable.
export N_PREFIX="$n_install_dir" export N_PREFIX="$n_install_dir"
# Install Node version management
#
# [internal]
#
# usage: ynh_install_n
ynh_install_n () { ynh_install_n () {
echo "Installation of N - Node.js version management" >&2 echo "Installation of N - Node.js version management" >&2
# Build an app.src for n # Build an app.src for n
@ -57,34 +49,52 @@ SOURCE_SUM=2ba3c9d4dd3c7e38885b37e02337906a1ee91febe6d5c9159d89a9050f2eea8f" > "
PREFIX=$N_PREFIX make install 2>&1) PREFIX=$N_PREFIX make install 2>&1)
} }
# Load the version of node for an app, and set variables.
#
# ynh_use_nodejs has to be used in any app scripts before using node for the first time.
#
# 2 variables are available:
# - $nodejs_path: The absolute path of node for the chosen version.
# - $nodejs_version: Just the version number of node for this app. Stored as 'nodejs_version' in settings.yml.
# And 2 alias stored in variables:
# - $nodejs_use_version: An old variable, not used anymore. Keep here to not break old apps
# NB: $PATH will contain the path to node, it has to be propagated to any other shell which needs to use it.
# That's means it has to be added to any systemd script.
#
# usage: ynh_use_nodejs
ynh_use_nodejs () { ynh_use_nodejs () {
nodejs_version=$(ynh_app_setting_get $app nodejs_version) nodejs_version=$(ynh_app_setting_get $app nodejs_version)
load_n_path="[[ :$PATH: == *\":$n_install_dir/bin:\"* ]] || PATH=\"$n_install_dir/bin:$PATH\"; N_PREFIX="$n_install_dir"" nodejs_use_version="echo \"Deprecated command, should be removed\""
nodejs_use_version="$n_install_dir/bin/n -q $nodejs_version"
# "Load" a version of node
eval $load_n_path; $nodejs_use_version
# Get the absolute path of this version of node # Get the absolute path of this version of node
nodejs_path="$(n bin $nodejs_version)" nodejs_path="$node_version_path/$nodejs_version/bin"
# Make an alias for node use # Load the path of this version of node in $PATH
ynh_node_exec="eval $load_n_path; n use $nodejs_version" [[ :$PATH: == *":$nodejs_path"* ]] || PATH="$nodejs_path:$PATH"
} }
# Install a specific version of nodejs
#
# n (Node version management) uses the PATH variable to store the path of the version of node it is going to use.
# That's how it changes the version
#
# ynh_install_nodejs will install the version of node provided as argument by using n.
#
# usage: ynh_install_nodejs [nodejs_version]
# | arg: nodejs_version - Version of node to install.
# If possible, prefer to use major version number (e.g. 8 instead of 8.10.0).
# The crontab will handle the update of minor versions when needed.
ynh_install_nodejs () { ynh_install_nodejs () {
# Use n, https://github.com/tj/n to manage the nodejs versions # Use n, https://github.com/tj/n to manage the nodejs versions
nodejs_version="$1" nodejs_version="$1"
local n_install_script="https://git.io/n-install"
# Create $n_install_dir # Create $n_install_dir
mkdir -p "$n_install_dir" mkdir -p "$n_install_dir"
# Load n path in PATH # Load n path in PATH
CLEAR_PATH="$n_install_dir/bin:$PATH" CLEAR_PATH="$n_install_dir/bin:$PATH"
# Remove /usr/local/bin in PATH in case of node has already setup. # Remove /usr/local/bin in PATH in case of node prior installation
PATH=$(echo $CLEAR_PATH | sed 's@/usr/local/bin:@@') PATH=$(echo $CLEAR_PATH | sed 's@/usr/local/bin:@@')
# Move an existing node binary, to avoid to block n. # Move an existing node binary, to avoid to block n.
@ -92,7 +102,7 @@ ynh_install_nodejs () {
test -x /usr/bin/npm && mv /usr/bin/npm /usr/bin/npm_n test -x /usr/bin/npm && mv /usr/bin/npm /usr/bin/npm_n
# If n is not previously setup, install it # If n is not previously setup, install it
if ! test n --version > /dev/null 2>&1 if ! test $(n --version > /dev/null 2>&1)
then then
ynh_install_n ynh_install_n
fi fi
@ -114,7 +124,7 @@ ynh_install_nodejs () {
real_nodejs_version=$(find $node_version_path/$nodejs_version* -maxdepth 0 | sort --version-sort | tail --lines=1) real_nodejs_version=$(find $node_version_path/$nodejs_version* -maxdepth 0 | sort --version-sort | tail --lines=1)
real_nodejs_version=$(basename $real_nodejs_version) real_nodejs_version=$(basename $real_nodejs_version)
# Create a symbolic link for this major version. If the file doesn't already exist # Create a symbolic link for this major version if the file doesn't already exist
if [ ! -e "$node_version_path/$nodejs_version" ] if [ ! -e "$node_version_path/$nodejs_version" ]
then then
ln --symbolic --force --no-target-directory $node_version_path/$real_nodejs_version $node_version_path/$nodejs_version ln --symbolic --force --no-target-directory $node_version_path/$real_nodejs_version $node_version_path/$nodejs_version
@ -132,27 +142,40 @@ ynh_install_nodejs () {
ynh_use_nodejs ynh_use_nodejs
} }
# Remove the version of node used by the app.
#
# This helper will check if another app uses the same version of node,
# if not, this version of node will be removed.
# If no other app uses node, n will be also removed.
#
# usage: ynh_remove_nodejs
ynh_remove_nodejs () { ynh_remove_nodejs () {
ynh_use_nodejs nodejs_version=$(ynh_app_setting_get $app nodejs_version)
# Remove the line for this app # Remove the line for this app
sed --in-place "/$YNH_APP_ID:$nodejs_version/d" "$n_install_dir/ynh_app_version" sed --in-place "/$YNH_APP_ID:$nodejs_version/d" "$n_install_dir/ynh_app_version"
# If none another app uses this version of nodejs, remove it. # If no other app uses this version of nodejs, remove it.
if ! grep --quiet "$nodejs_version" "$n_install_dir/ynh_app_version" if ! grep --quiet "$nodejs_version" "$n_install_dir/ynh_app_version"
then then
n rm $nodejs_version $n_install_dir/bin/n rm $nodejs_version
fi fi
# If none another app uses n, remove n # If no other app uses n, remove n
if [ ! -s "$n_install_dir/ynh_app_version" ] if [ ! -s "$n_install_dir/ynh_app_version" ]
then then
ynh_secure_remove "$n_install_dir" ynh_secure_remove "$n_install_dir"
ynh_secure_remove "/usr/local/n" ynh_secure_remove "/usr/local/n"
sed --in-place "/N_PREFIX/d" /root/.bashrc
fi fi
} }
# Set a cron design to update your node versions
#
# [internal]
#
# This cron will check and update all minor node versions used by your apps.
#
# usage: ynh_cron_upgrade_node
ynh_cron_upgrade_node () { ynh_cron_upgrade_node () {
# Build the update script # Build the update script
cat > "$n_install_dir/node_update.sh" << EOF cat > "$n_install_dir/node_update.sh" << EOF
@ -275,6 +298,17 @@ ynh_print_err () {
ynh_print_log "[ERR] ${1}" >&2 ynh_print_log "[ERR] ${1}" >&2
} }
# Execute a command and force the result to be printed on stdout
#
# usage: ynh_exec_warn_less command to execute
# usage: ynh_exec_warn_less "command to execute | following command"
# In case of use of pipes, you have to use double quotes. Otherwise, this helper will be executed with the first command, then be send to the next pipe.
#
# | arg: command - command to execute
ynh_exec_warn_less () {
eval $@ 2>&1
}
# Remove any logs for all the following commands. # Remove any logs for all the following commands.
# #
# usage: ynh_print_OFF # usage: ynh_print_OFF
@ -449,8 +483,16 @@ Automatic diagnosis data from YunoHost
$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')" $(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')"
# Define binary to use for mail command
if [ -e /usr/bin/bsd-mailx ]
then
local mail_bin=/usr/bin/bsd-mailx
else
local mail_bin=/usr/bin/mail.mailutils
fi
# Send the email to the recipients # Send the email to the recipients
echo "$mail_message" | mail -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients" echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients"
} }
#================================================= #=================================================

View file

@ -8,3 +8,7 @@ libreoffice_app_dependencies="unoconv libreoffice-writer"
# Version of nodejs # Version of nodejs
nodejs_version=4 nodejs_version=4
# Version of mypads
# This variable is mostly used to force an upgrade of the package in case of new versions of mypads.
mypads_version=1.4.5

View file

@ -198,7 +198,6 @@ chmod 600 $final_path/credentials.json # Restrict access to credentials.json
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================
ynh_replace_string "__NODEJS__" "$nodejs_use_version" "../conf/systemd.service"
ynh_replace_string "__ENV_PATH__" "$PATH" "../conf/systemd.service" ynh_replace_string "__ENV_PATH__" "$PATH" "../conf/systemd.service"
ynh_add_systemd_config ynh_add_systemd_config
@ -213,8 +212,7 @@ yunohost service add $app --log "/var/log/$app/etherpad.log"
# INSTALL FRAMAPAD'S PLUGINS # INSTALL FRAMAPAD'S PLUGINS
#================================================= #=================================================
script_dir="$PWD" pushd "$final_path"
cd "$final_path"
npm install ep_align # Add Left/Center/Right/Justify to lines of text in a pad npm install ep_align # Add Left/Center/Right/Justify to lines of text in a pad
npm install ep_author_hover >> $install_log 2>&1 # Framapad - Adds author names to span titles npm install ep_author_hover >> $install_log 2>&1 # Framapad - Adds author names to span titles
npm install ep_automatic_logut >> $install_log 2>&1 # Automatically disconnects user after some period of time (Prevent server overload) npm install ep_automatic_logut >> $install_log 2>&1 # Automatically disconnects user after some period of time (Prevent server overload)
@ -225,13 +223,14 @@ npm install ep_font_color >> $install_log 2>&1 # Framapad - Apply colors to font
npm install ep_headings2 >> $install_log 2>&1 # Framapad - Adds heading support to Etherpad Lite. npm install ep_headings2 >> $install_log 2>&1 # Framapad - Adds heading support to Etherpad Lite.
npm install ep_markdown >> $install_log 2>&1 # Framapad - Edit and Export as Markdown in Etherpad npm install ep_markdown >> $install_log 2>&1 # Framapad - Edit and Export as Markdown in Etherpad
if [ $mypads -eq 1 ]; then if [ $mypads -eq 1 ]; then
npm install ep_mypads >> $install_log 2>&1 # Framapad - Groups and private pads for etherpad npm install ep_mypads@${mypads_version} >> $install_log 2>&1 # Framapad - Groups and private pads for etherpad
fi fi
npm install ep_page_view >> $install_log 2>&1 # Framapad - Add support to do 'page view', with a toggle on/off option in Settings, also Page Breaks with Control Enter npm install ep_page_view >> $install_log 2>&1 # Framapad - Add support to do 'page view', with a toggle on/off option in Settings, also Page Breaks with Control Enter
npm install ep_spellcheck >> $install_log 2>&1 # Framapad - Add support to do 'Spell checking' npm install ep_spellcheck >> $install_log 2>&1 # Framapad - Add support to do 'Spell checking'
npm install ep_subscript_and_superscript >> $install_log 2>&1 # Framapad - Add support for Subscript and Superscript npm install ep_subscript_and_superscript >> $install_log 2>&1 # Framapad - Add support for Subscript and Superscript
npm install ep_table_of_contents >> $install_log 2>&1 # Framapad - View a table of contents for your pad npm install ep_table_of_contents >> $install_log 2>&1 # Framapad - View a table of contents for your pad
npm install ep_user_font_size >> $install_log 2>&1 # Framapad - User Pad Contents font size can be set in settings, this does not effect other peoples views npm install ep_user_font_size >> $install_log 2>&1 # Framapad - User Pad Contents font size can be set in settings, this does not effect other peoples views
popd
chown -R $app: $final_path/node_modules chown -R $app: $final_path/node_modules
#================================================= #=================================================
@ -282,8 +281,8 @@ ynh_check_starting "You can access your Etherpad instance at" "/var/log/$app/eth
if [ $mypads -eq 1 ] if [ $mypads -eq 1 ]
then then
ynh_replace_string "__LANGUAGE__" "$language" "$script_dir/../conf/lang_mypads.sql" ynh_replace_string "__LANGUAGE__" "$language" "../conf/lang_mypads.sql"
mysql -u $db_name -p$db_pwd $db_name < "$script_dir/../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_check_starting "You can access your Etherpad instance at" "/var/log/$app/etherpad.log" "120" ynh_check_starting "You can access your Etherpad instance at" "/var/log/$app/etherpad.log" "120"
@ -295,26 +294,19 @@ fi
if [ $mypads -eq 1 ] if [ $mypads -eq 1 ]
then then
Informations1="You can access 2 different admin panels, for etherpad by accessing https://$domain${path_url%/}/admin and for mypads by accessing https://$domain${path_url%/}/mypads/?/admin." Informations="You can access 2 different admin panels, for etherpad by accessing https://$domain${path_url%/}/admin and for mypads by accessing https://$domain${path_url%/}/mypads/?/admin."
Informations2="
Because there's no LDAP support with mypads plugin, no user is created at the installation.
You have to connect to the admin panel to create the first users.
"
else else
Informations1="You can access the admin panel by accessing https://$domain${path_url%/}/admin." Informations="You can access the admin panel by accessing https://$domain${path_url%/}/admin."
Informations2=""
fi fi
ynh_print_OFF ynh_print_OFF
message="$Informations1 message="$Informations
Or, you can find a config file for etherpad at this path /var/www/etherpad_mypads/settings.json. Or, you can find a config file for etherpad at this path /var/www/etherpad_mypads/settings.json.
Your credentials for the admin panel are: Your credentials for the admin panel are:
- login : $admin - login : $admin
- password : $password - password : $password
$Informations2
If you are facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/etherpad_mypads_ynh" If you are facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/etherpad_mypads_ynh"
ynh_send_readme_to_admin "$message" "$admin" ynh_send_readme_to_admin "$message" "$admin"

View file

@ -160,26 +160,19 @@ ynh_check_starting "You can access your Etherpad instance at" "/var/log/$app/eth
if [ $mypads -eq 1 ] if [ $mypads -eq 1 ]
then then
Informations1="You can access 2 different admin panels, for etherpad by accessing https://$domain${path_url%/}/admin and for mypads by accessing https://$domain${path_url%/}/mypads/?/admin." Informations="You can access 2 different admin panels, for etherpad by accessing https://$domain${path_url%/}/admin and for mypads by accessing https://$domain${path_url%/}/mypads/?/admin."
Informations2="
Because there's no ldap support with mypads plugin, no user is created at the installation.
You have to connect to the admin panel to create the first users.
"
else else
Informations1="You can access to the admin panel, by accessing https://$domain${path_url%/}/admin." Informations="You can access to the admin panel, by accessing https://$domain${path_url%/}/admin."
Informations2=""
fi fi
ynh_print_OFF ynh_print_OFF
message="$Informations1 message="$Informations
Or, you can find a config file for etherpad at this path /var/www/etherpad_mypads/settings.json. Or, you can find a config file for etherpad at this path /var/www/etherpad_mypads/settings.json.
Your credentials for the admin panel are: Your credentials for the admin panel are:
- login : $admin - login : $admin
- password : $password - password : $password
$Informations2
If you are facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/etherpad_mypads_ynh" If you are facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/etherpad_mypads_ynh"
ynh_send_readme_to_admin "$message" "$admin" ynh_send_readme_to_admin "$message" "$admin"

View file

@ -146,8 +146,19 @@ ynh_install_nodejs $nodejs_version
# UPGRADE NPM MODULES # UPGRADE NPM MODULES
#================================================= #=================================================
# Update the main modules of etherpad
(cd "$final_path/src"
npm cache clean npm cache clean
npm update ynh_exec_warn_less npm update)
# Then update the additionnal modules
while read node_module
do
echo "Update $node_module"
(cd "$final_path/node_modules/$node_module"
npm cache clean
ynh_exec_warn_less npm update)
done <<< "$(ls -1 "$final_path/node_modules")"
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
@ -221,7 +232,6 @@ ynh_use_logrotate --non-append
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================
ynh_replace_string "__NODEJS__" "$nodejs_use_version" "../conf/systemd.service"
ynh_replace_string "__ENV_PATH__" "$PATH" "../conf/systemd.service" ynh_replace_string "__ENV_PATH__" "$PATH" "../conf/systemd.service"
ynh_add_systemd_config ynh_add_systemd_config