1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/etherpad_ynh.git synced 2024-09-03 18:36:10 +02:00
This commit is contained in:
ericgaspar 2021-07-18 10:55:36 +02:00
parent d6d99247a9
commit 6ae5b5c708
No known key found for this signature in database
GPG key ID: 574F281483054D44
6 changed files with 17 additions and 50 deletions

View file

@ -1,8 +1,3 @@
# See here for more information
# https://github.com/YunoHost/package_check#syntax-check_process-file
# Move this file from check_process.default to check_process when you have filled it.
;; Test complet
; Manifest
domain="domain.tld"
@ -10,8 +5,7 @@
admin="john"
language="fr"
is_public=1
password="pass"
port="9001"
password="password"
; Checks
pkg_linter=1
setup_sub_dir=1

View file

@ -20,16 +20,3 @@ nodejs_version=14
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================
# Execute a command as another user
# usage: ynh_exec_as USER COMMAND [ARG ...]
ynh_exec_as() {
local USER=$1
shift 1
if [[ $USER = $(whoami) ]]; then
eval "$@"
else
sudo -u "$USER" "$@"
fi
}

View file

@ -115,7 +115,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=6
# Start a systemd service
ynh_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="Your Etherpad version is"
sleep 120
#=================================================
# END OF SCRIPT

View file

@ -103,6 +103,10 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
git clone --branch master https://github.com/ether/etherpad-lite.git "$final_path" --quiet
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -121,7 +125,7 @@ chown -R $app: $final_path
pushd "$final_path" || ynh_die
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 install ep_automatic_logut ep_countable ep_spellcheck ep_delete_empty_pads ep_subscript_and_superscript ep_headings2 ep_author_hover ep_markdown ep_comments_page ep_align ep_font_color
#ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm install ep_automatic_logut ep_countable ep_spellcheck ep_delete_empty_pads ep_subscript_and_superscript ep_headings2 ep_author_hover ep_markdown ep_comments_page ep_align ep_font_color
popd || ynh_die
#=================================================
@ -132,15 +136,7 @@ ynh_script_progression --message="Configuring Etherpad..." --weight=6
ynh_add_config --template="../conf/settings.json" --destination="$final_path/settings.json"
ynh_add_config --template="../conf/credentials.json" --destination="$final_path/credentials.json"
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
# Set permissions to app files
chown -R $app: $final_path
chmod 600 $final_path/credentials.json
chmod 400 $final_path/credentials.json
#=================================================
# SETUP SYSTEMD
@ -148,7 +144,7 @@ chmod 600 $final_path/credentials.json
ynh_script_progression --message="Configuring a systemd service..." --weight=4
# Create a dedicated systemd config
ynh_add_systemd_config --others_var="ynh_node_load_PATH"
ynh_add_systemd_config
#=================================================
# INTEGRATE SERVICE IN YUNOHOST

View file

@ -66,6 +66,11 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$final_path"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
chmod 600 $final_path/credentials.json
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
@ -86,14 +91,6 @@ ynh_psql_test_if_first_run
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
#=================================================
# RESTORE USER RIGHTS
#=================================================
# Restore permissions on app files
chown -R $app: $final_path
chmod 600 $final_path/credentials.json
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
@ -115,7 +112,6 @@ systemctl enable $app.service --quiet
ynh_script_progression --message="Starting a systemd service..." --weight=8
ynh_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="Your Etherpad version is"
sleep 120
#=================================================
# GENERIC FINALIZATION

View file

@ -125,14 +125,9 @@ then
popd
fi
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
# Set permissions on app files
chown -R $app: $final_path
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
chmod 600 $final_path/credentials.json
#=================================================
@ -141,7 +136,7 @@ chmod 600 $final_path/credentials.json
ynh_script_progression --message="Upgrading systemd configuration..." --weight=2
# Create a dedicated systemd config
ynh_add_systemd_config --others_var="ynh_node_load_PATH"
ynh_add_systemd_config
#=================================================
# INTEGRATE SERVICE IN YUNOHOST