mirror of
https://github.com/YunoHost-Apps/etherpad_mypads_ynh.git
synced 2024-09-03 18:36:09 +02:00
commit
fc2a35c7b3
7 changed files with 59 additions and 28 deletions
|
@ -9,8 +9,6 @@ Ce package etherpad utilise les mêmes plugins que [Framapad](https://framapad.o
|
|||
http://etherpad.org/
|
||||
https://git.framasoft.org/framasoft/ep_mypads
|
||||
|
||||
Le script installe les paquets *npm* et *nodejs-legacy*, ainsi que *abiword* si l'option est selectionnée.
|
||||
|
||||
**En raison du plugin mypads, cette version d'etherpad doit être installée à la racine d'un domaine ou d'un sous-domaine dédié. Autrement, mypads sera inaccessible.**
|
||||
|
||||
**Mise à jour du package:**
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;; Test complet
|
||||
;; Test complet avec libreoffice
|
||||
auto_remove=1
|
||||
; Manifest
|
||||
domain="domain.tld" (DOMAIN)
|
||||
|
@ -6,7 +6,7 @@
|
|||
password="password"
|
||||
language="en"
|
||||
is_public=1 (PUBLIC|public=1|private=0)
|
||||
abiword="0"
|
||||
export="libreoffice"
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=0
|
||||
|
@ -28,7 +28,18 @@
|
|||
password="password"
|
||||
language="en"
|
||||
is_public=1 (PUBLIC|public=1|private=0)
|
||||
abiword="1"
|
||||
export="abiword"
|
||||
; Checks
|
||||
setup_root=1
|
||||
;; Test sans export
|
||||
auto_remove=1
|
||||
; Manifest
|
||||
domain="domain.tld" (DOMAIN)
|
||||
admin="john" (USER)
|
||||
password="password"
|
||||
language="en"
|
||||
is_public=1 (PUBLIC|public=1|private=0)
|
||||
export="none"
|
||||
; Checks
|
||||
setup_root=1
|
||||
;;; Levels
|
||||
|
|
|
@ -69,13 +69,13 @@
|
|||
"default": true
|
||||
},
|
||||
{
|
||||
"name": "abiword",
|
||||
"type": "boolean",
|
||||
"name": "export",
|
||||
"ask": {
|
||||
"en": "Use abiword (~260Mo) to expand export possibilities (pdf, doc) ?",
|
||||
"fr": "Utiliser abiword (~260Mo) pour étendre les possibilités d'export (pdf, doc) ?"
|
||||
"en": "Use abiword (~260Mo) or libreoffice (~400Mo) (more stable) to expand export possibilities (pdf, doc) ?",
|
||||
"fr": "Utiliser abiword (~260Mo) ou libre office (~400Mo) (plus stable) pour étendre les possibilités d'export (pdf, doc) ?"
|
||||
},
|
||||
"default": false
|
||||
"choices" : ["none", "abiword", "libreoffice"],
|
||||
"default" : "none"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ admin=$YNH_APP_ARG_ADMIN
|
|||
password=$YNH_APP_ARG_PASSWORD
|
||||
language=$YNH_APP_ARG_LANGUAGE
|
||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||
abiword=$YNH_APP_ARG_ABIWORD
|
||||
export=$YNH_APP_ARG_EXPORT
|
||||
path_url="" # Assure la compatibilité avec les fonctions utilisant $path_url
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
@ -67,7 +67,7 @@ ynh_app_setting_set $app admin $admin
|
|||
ynh_app_setting_set $app is_public $is_public
|
||||
ynh_app_setting_set $app password $password
|
||||
ynh_app_setting_set $app language $language
|
||||
ynh_app_setting_set $app abiword $abiword
|
||||
ynh_app_setting_set $app export $export
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
|
@ -82,9 +82,10 @@ ynh_app_setting_set $app port $port
|
|||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
|
||||
if [ $abiword -eq 1 ]
|
||||
then
|
||||
if [ "$export" = "abiword" ]; then
|
||||
ynh_install_app_dependencies abiword
|
||||
elif [ "$export" = "libreoffice" ]; then
|
||||
ynh_install_app_dependencies unoconv libreoffice-writer
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
@ -118,7 +119,7 @@ ynh_nginx_config
|
|||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
|
||||
ynh_system_user_create $app /home/$app # Créer un utilisateur système dédié à l'app
|
||||
ynh_system_user_create $app $final_path # Créer un utilisateur système dédié à l'app
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
|
@ -157,10 +158,14 @@ ynh_replace_string "__DB_USER__" "$db_name" "$final_path/credentials.json"
|
|||
ynh_replace_string "__DB_PWD__" "$db_pwd" "$final_path/credentials.json"
|
||||
ynh_replace_string "__ADMIN__" "$admin" "$final_path/credentials.json"
|
||||
ynh_replace_string "__PASSWD__" "$password" "$final_path/credentials.json"
|
||||
if [ "$abiword" -eq 1 ]
|
||||
if [ "$export" = "abiword" ]
|
||||
then
|
||||
abiword_path=`which abiword` # Récupère l'emplacement de l'exécutable de abiword
|
||||
ynh_replace_string "\"abiword\" : null" "\"abiword\" : \"$abiword_path\"" "$final_path/settings.json" # Renseigne l'emplacement de abiword dans la config de etherpad
|
||||
elif [ "$export" = "libreoffice" ]
|
||||
then
|
||||
soffice_path=`which soffice` # Récupère l'emplacement de l'exécutable de abiword
|
||||
ynh_replace_string "\"soffice\" : null" "\"soffice\" : \"$soffice_path\"" "$final_path/settings.json" # Renseigne l'emplacement de abiword dans la config de etherpad
|
||||
fi
|
||||
ynh_replace_string "__LANGUAGE__" "$language" "$final_path/settings.json"
|
||||
ynh_store_file_checksum "$final_path/settings.json" # Enregistre la somme de contrôle du fichier de config
|
||||
|
@ -211,7 +216,6 @@ sudo_path npm install ep_page_view >> $install_log 2>&1 # Framapad - Add support
|
|||
sudo_path npm install ep_spellcheck >> $install_log 2>&1 # Framapad - Add support to do 'Spell checking'
|
||||
sudo_path npm install ep_subscript_and_superscript >> $install_log 2>&1 # Framapad - Add support for Subscript and Superscript
|
||||
sudo_path npm install ep_table_of_contents >> $install_log 2>&1 # Framapad - View a table of contents for your pad
|
||||
# sudo_path npm install ep_unoconv" # Framapad - Use unoconv instead of abiword to export pads.
|
||||
sudo_path 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
|
||||
sudo chown -R $app: $final_path/node_modules
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
domain=$(ynh_app_setting_get $app domain)
|
||||
port=$(ynh_app_setting_get $app port)
|
||||
db_name=$(ynh_app_setting_get $app db_name)
|
||||
abiword=$(ynh_app_setting_get $app abiword)
|
||||
export=$(ynh_app_setting_get $app export)
|
||||
|
||||
#=================================================
|
||||
# STANDARD REMOVE
|
||||
|
@ -42,7 +42,7 @@ fi
|
|||
# REMOVE DEPENDENCIES
|
||||
#=================================================
|
||||
|
||||
if [ $abiword -eq 1 ]
|
||||
if [ "$export" != "none" ]
|
||||
then
|
||||
ynh_remove_app_dependencies
|
||||
fi
|
||||
|
|
|
@ -31,7 +31,7 @@ domain=$(ynh_app_setting_get $app domain)
|
|||
path_url=$(ynh_app_setting_get $app path_url)
|
||||
final_path=$(ynh_app_setting_get $app final_path)
|
||||
db_name=$(ynh_app_setting_get $app db_name)
|
||||
abiword=$(ynh_app_setting_get $app abiword)
|
||||
export=$(ynh_app_setting_get $app export)
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
|
@ -68,7 +68,7 @@ ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql
|
|||
# RECREATE OF THE DEDICATED USER
|
||||
#=================================================
|
||||
|
||||
ynh_system_user_create $app /home/$app # Recreate the dedicated user, if not exist
|
||||
ynh_system_user_create $app $final_path # Recreate the dedicated user, if not exist
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC RESTORE
|
||||
|
@ -90,9 +90,10 @@ ynh_restore_file "/etc/logrotate.d/$app"
|
|||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
|
||||
if [ $abiword -eq 1 ]
|
||||
then
|
||||
if [ "$export" = "abiword" ]; then
|
||||
ynh_install_app_dependencies abiword
|
||||
elif [ "$export" = "libreoffice" ]; then
|
||||
ynh_install_app_dependencies unoconv libreoffice-writer
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -21,7 +21,7 @@ language=$(ynh_app_setting_get $app language)
|
|||
is_public=$(ynh_app_setting_get $app is_public)
|
||||
final_path=$(ynh_app_setting_get $app final_path)
|
||||
port=$(ynh_app_setting_get $app port)
|
||||
abiword=$(ynh_app_setting_get $app abiword)
|
||||
export=$(ynh_app_setting_get $app export)
|
||||
db_name=$(ynh_app_setting_get $app db_name)
|
||||
|
||||
#=================================================
|
||||
|
@ -46,6 +46,19 @@ if [ -z $abiword ]; then # Si abiword n'est pas renseigné dans app setting
|
|||
ynh_app_setting_set $app abiword $abiword
|
||||
fi
|
||||
|
||||
if [ -n $abiword ]; then # Si abiword est renseigné dans app setting
|
||||
if [ $abiword -eq 1 ]; then
|
||||
export=abiword
|
||||
fi
|
||||
ynh_app_setting_set $app export $export
|
||||
ynh_app_setting_delete $app abiword
|
||||
fi
|
||||
|
||||
if [ -z $export ]; then # Si export n'est pas renseigné dans app setting
|
||||
export=none
|
||||
ynh_app_setting_set $app export $export
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
|
@ -114,10 +127,14 @@ password=$(ynh_app_setting_get $app password)
|
|||
ynh_replace_string "__DB_PWD__" "$db_pwd" "$final_path/credentials.json"
|
||||
ynh_replace_string "__ADMIN__" "$admin" "$final_path/credentials.json"
|
||||
ynh_replace_string "__PASSWD__" "$password" "$final_path/credentials.json"
|
||||
if [ $abiword -eq 1 ]
|
||||
if [ "$export" = "abiword" ]
|
||||
then
|
||||
abiword_path=`which abiword` # Récupère l'emplacement de l'exécutable de abiword
|
||||
ynh_replace_string "\"abiword\" : null" "\"abiword\" : \"$abiword_path\"" "$final_path/settings.json" # Renseigne l'emplacement de abiword dans la config de etherpad
|
||||
elif [ "$export" = "libreoffice" ]
|
||||
then
|
||||
soffice_path=`which soffice` # Récupère l'emplacement de l'exécutable de abiword
|
||||
ynh_replace_string "\"soffice\" : null" "\"soffice\" : \"$soffice_path\"" "$final_path/settings.json" # Renseigne l'emplacement de abiword dans la config de etherpad
|
||||
fi
|
||||
if test -z $language; then
|
||||
language=en # En cas d'upgrade d'une version ne gérant pas la langue, la langue est anglais par défaut
|
||||
|
@ -131,7 +148,7 @@ ynh_store_file_checksum "$final_path/credentials.json" # Réenregistre la somme
|
|||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
|
||||
ynh_system_user_create $app /home/$app # Create the dedicated user, if not exist
|
||||
ynh_system_user_create $app $final_path # Create the dedicated user, if not exist
|
||||
|
||||
#=================================================
|
||||
# SECURING FILES AND DIRECTORIES
|
||||
|
|
Loading…
Add table
Reference in a new issue