mirror of
https://github.com/YunoHost-Apps/etherpad_mypads_ynh.git
synced 2024-09-03 18:36:09 +02:00
abiword, libreoffice or nothing
This commit is contained in:
parent
7cc8d9dbd7
commit
6a749a6cfb
7 changed files with 52 additions and 32 deletions
|
@ -9,8 +9,6 @@ Ce package etherpad utilise les mêmes plugins que [Framapad](https://framapad.o
|
||||||
http://etherpad.org/
|
http://etherpad.org/
|
||||||
https://git.framasoft.org/framasoft/ep_mypads
|
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.**
|
**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:**
|
**Mise à jour du package:**
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;; Test complet
|
;; Test complet avec libreoffice
|
||||||
auto_remove=1
|
auto_remove=1
|
||||||
; Manifest
|
; Manifest
|
||||||
domain="domain.tld" (DOMAIN)
|
domain="domain.tld" (DOMAIN)
|
||||||
|
@ -6,7 +6,7 @@
|
||||||
password="password"
|
password="password"
|
||||||
language="en"
|
language="en"
|
||||||
is_public=1 (PUBLIC|public=1|private=0)
|
is_public=1 (PUBLIC|public=1|private=0)
|
||||||
abiword="0"
|
export="libreoffice"
|
||||||
; Checks
|
; Checks
|
||||||
pkg_linter=1
|
pkg_linter=1
|
||||||
setup_sub_dir=0
|
setup_sub_dir=0
|
||||||
|
@ -28,7 +28,18 @@
|
||||||
password="password"
|
password="password"
|
||||||
language="en"
|
language="en"
|
||||||
is_public=1 (PUBLIC|public=1|private=0)
|
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
|
; Checks
|
||||||
setup_root=1
|
setup_root=1
|
||||||
;;; Levels
|
;;; Levels
|
||||||
|
|
|
@ -68,13 +68,14 @@
|
||||||
},
|
},
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
"name": "export",
|
"name": "export",
|
||||||
"ask": {
|
"ask": {
|
||||||
"en": "Choose abiword or libreoffice (more stable)",
|
"en": "Use abiword (~260Mo) or libreoffice (~400Mo) (more stable) to expand export possibilities (pdf, doc) ?",
|
||||||
"fr": "Choisissez abiword ou libreoffice (plus stable)"
|
"fr": "Utiliser abiword (~260Mo) ou libre office (~400Mo) (plus stable) pour étendre les possibilités d'export (pdf, doc) ?"
|
||||||
},
|
},
|
||||||
"choices" : ["abiword", "libreoffice"],
|
"choices" : ["none", "abiword", "libreoffice"],
|
||||||
"default" : "libreoffice"
|
"default" : "none"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,17 +82,12 @@ ynh_app_setting_set $app port $port
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
if [ $export -eq 1 ]
|
if [ "$export" = "abiword" ]; then
|
||||||
then
|
|
||||||
ynh_install_app_dependencies abiword
|
ynh_install_app_dependencies abiword
|
||||||
|
elif [ "$export" = "libreoffice" ]; then
|
||||||
|
ynh_install_app_dependencies unoconv libreoffice-writer
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $export -eq 2 ]
|
|
||||||
then
|
|
||||||
ynh_install_app_dependencies unoconv libreoffice-writer
|
|
||||||
|
|
||||||
fi
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL NODEJS
|
# INSTALL NODEJS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -124,7 +119,7 @@ ynh_nginx_config
|
||||||
# CREATE DEDICATED USER
|
# 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
|
# SPECIFIC SETUP
|
||||||
|
@ -163,13 +158,11 @@ 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 "__DB_PWD__" "$db_pwd" "$final_path/credentials.json"
|
||||||
ynh_replace_string "__ADMIN__" "$admin" "$final_path/credentials.json"
|
ynh_replace_string "__ADMIN__" "$admin" "$final_path/credentials.json"
|
||||||
ynh_replace_string "__PASSWD__" "$password" "$final_path/credentials.json"
|
ynh_replace_string "__PASSWD__" "$password" "$final_path/credentials.json"
|
||||||
if [ "$export" -eq 1 ]
|
if [ "$export" = "abiword" ]
|
||||||
then
|
then
|
||||||
abiword_path=`which abiword` # Récupère l'emplacement de l'exécutable de abiword
|
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
|
ynh_replace_string "\"abiword\" : null" "\"abiword\" : \"$abiword_path\"" "$final_path/settings.json" # Renseigne l'emplacement de abiword dans la config de etherpad
|
||||||
fi
|
elif [ "$export" = "libreoffice" ]
|
||||||
|
|
||||||
if [ "$export" -eq 2 ]
|
|
||||||
then
|
then
|
||||||
soffice_path=`which soffice` # Récupère l'emplacement de l'exécutable de abiword
|
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
|
ynh_replace_string "\"soffice\" : null" "\"soffice\" : \"$soffice_path\"" "$final_path/settings.json" # Renseigne l'emplacement de abiword dans la config de etherpad
|
||||||
|
@ -223,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_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_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_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_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
|
sudo chown -R $app: $final_path/node_modules
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
domain=$(ynh_app_setting_get $app domain)
|
domain=$(ynh_app_setting_get $app domain)
|
||||||
port=$(ynh_app_setting_get $app port)
|
port=$(ynh_app_setting_get $app port)
|
||||||
db_name=$(ynh_app_setting_get $app db_name)
|
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
|
# STANDARD REMOVE
|
||||||
|
@ -42,7 +42,7 @@ fi
|
||||||
# REMOVE DEPENDENCIES
|
# REMOVE DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
if [ $abiword -eq 1 ]
|
if [ "$export" != "none" ]
|
||||||
then
|
then
|
||||||
ynh_remove_app_dependencies
|
ynh_remove_app_dependencies
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -31,7 +31,7 @@ domain=$(ynh_app_setting_get $app domain)
|
||||||
path_url=$(ynh_app_setting_get $app path_url)
|
path_url=$(ynh_app_setting_get $app path_url)
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
db_name=$(ynh_app_setting_get $app db_name)
|
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
|
# 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
|
# 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
|
# SPECIFIC RESTORE
|
||||||
|
@ -90,9 +90,10 @@ ynh_restore_file "/etc/logrotate.d/$app"
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
if [ $abiword -eq 1 ]
|
if [ "$export" = "abiword" ]; then
|
||||||
then
|
|
||||||
ynh_install_app_dependencies abiword
|
ynh_install_app_dependencies abiword
|
||||||
|
elif [ "$export" = "libreoffice" ]; then
|
||||||
|
ynh_install_app_dependencies unoconv libreoffice-writer
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -21,7 +21,7 @@ language=$(ynh_app_setting_get $app language)
|
||||||
is_public=$(ynh_app_setting_get $app is_public)
|
is_public=$(ynh_app_setting_get $app is_public)
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
port=$(ynh_app_setting_get $app port)
|
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)
|
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
|
ynh_app_setting_set $app abiword $abiword
|
||||||
fi
|
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
|
# 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 "__DB_PWD__" "$db_pwd" "$final_path/credentials.json"
|
||||||
ynh_replace_string "__ADMIN__" "$admin" "$final_path/credentials.json"
|
ynh_replace_string "__ADMIN__" "$admin" "$final_path/credentials.json"
|
||||||
ynh_replace_string "__PASSWD__" "$password" "$final_path/credentials.json"
|
ynh_replace_string "__PASSWD__" "$password" "$final_path/credentials.json"
|
||||||
if [ $abiword -eq 1 ]
|
if [ "$export" = "abiword" ]
|
||||||
then
|
then
|
||||||
abiword_path=`which abiword` # Récupère l'emplacement de l'exécutable de abiword
|
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
|
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
|
fi
|
||||||
if test -z $language; then
|
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
|
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
|
# 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
|
# SECURING FILES AND DIRECTORIES
|
||||||
|
|
Loading…
Add table
Reference in a new issue