mirror of
https://github.com/YunoHost-Apps/etherpad_ynh.git
synced 2024-09-03 18:36:10 +02:00
cleaning
This commit is contained in:
parent
9bd26bde83
commit
3f7f3d3173
6 changed files with 10 additions and 57 deletions
|
@ -17,7 +17,7 @@ admindoc = "https://etherpad.org/doc/v2.0.2/"
|
||||||
code = "https://github.com/ether/etherpad-lite"
|
code = "https://github.com/ether/etherpad-lite"
|
||||||
|
|
||||||
[integration]
|
[integration]
|
||||||
yunohost = ">= 11.2.18"
|
yunohost = ">= 11.2.29"
|
||||||
helpers_version = "2.1"
|
helpers_version = "2.1"
|
||||||
architectures = "all"
|
architectures = "all"
|
||||||
multi_instance = true
|
multi_instance = true
|
||||||
|
|
|
@ -22,7 +22,6 @@ ynh_config_change_url_nginx
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression "Starting $app's systemd service..."
|
ynh_script_progression "Starting $app's systemd service..."
|
||||||
|
|
||||||
# Start a systemd service
|
|
||||||
ynh_systemctl --service=$app --action=restart --log_path=systemd --wait_until="Your Etherpad version is"
|
ynh_systemctl --service=$app --action=restart --log_path=systemd --wait_until="Your Etherpad version is"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -15,7 +15,6 @@ ynh_nodejs_install
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression "Creating a Redis database..."
|
ynh_script_progression "Creating a Redis database..."
|
||||||
|
|
||||||
# Configure redis
|
|
||||||
redis_db=$(ynh_redis_get_free_db)
|
redis_db=$(ynh_redis_get_free_db)
|
||||||
ynh_app_setting_set --key=redis_db --value="$redis_db"
|
ynh_app_setting_set --key=redis_db --value="$redis_db"
|
||||||
|
|
||||||
|
@ -26,8 +25,6 @@ ynh_script_progression "Setting up source files..."
|
||||||
|
|
||||||
ynh_setup_source --dest_dir=$install_dir
|
ynh_setup_source --dest_dir=$install_dir
|
||||||
|
|
||||||
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
|
|
||||||
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SYSTEM CONFIGURATION
|
# SYSTEM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -60,21 +57,14 @@ fi
|
||||||
ynh_config_add --template="settings.json" --destination="$install_dir/settings.json"
|
ynh_config_add --template="settings.json" --destination="$install_dir/settings.json"
|
||||||
ynh_config_add --template="credentials.json" --destination="$install_dir/credentials.json"
|
ynh_config_add --template="credentials.json" --destination="$install_dir/credentials.json"
|
||||||
|
|
||||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 600 "$install_dir/settings.json"
|
|
||||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/settings.json"
|
|
||||||
|
|
||||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 600 "$install_dir/credentials.json"
|
|
||||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/credentials.json"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL ETHERPAD
|
# INSTALL ETHERPAD
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression "Installing $app..."
|
ynh_script_progression "Installing $app..."
|
||||||
|
|
||||||
pushd $install_dir
|
pushd $install_dir
|
||||||
|
ynh_hide_warnings corepack enable && corepack prepare pnpm@latest --activate
|
||||||
ynh_hide_warnings env node_load_PATH corepack enable && corepack prepare pnpm@latest --activate
|
ynh_hide_warnings pnpm --recursive i --production
|
||||||
ynh_hide_warnings env node_load_PATH pnpm --recursive i --production
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STANDARD REMOVE
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -10,14 +10,6 @@ ynh_script_progression "Restoring the app main directory..."
|
||||||
|
|
||||||
ynh_restore "$install_dir"
|
ynh_restore "$install_dir"
|
||||||
|
|
||||||
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
|
|
||||||
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
|
|
||||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 600 "$install_dir/settings.json"
|
|
||||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/settings.json"
|
|
||||||
|
|
||||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 600 "$install_dir/credentials.json"
|
|
||||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/credentials.json"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REINSTALL DEPENDENCIES
|
# REINSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -26,8 +18,7 @@ ynh_script_progression "Reinstalling dependencies..."
|
||||||
ynh_nodejs_install
|
ynh_nodejs_install
|
||||||
|
|
||||||
pushd "$install_dir"
|
pushd "$install_dir"
|
||||||
|
ynh_hide_warnings corepack enable && corepack prepare pnpm@latest --activate
|
||||||
ynh_hide_warnings env node_load_PATH corepack enable && corepack prepare pnpm@latest --activate
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -15,29 +15,13 @@ ynh_systemctl --service=$app --action=stop --log_path="systemd"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression "Ensuring downward compatibility..."
|
ynh_script_progression "Ensuring downward compatibility..."
|
||||||
|
|
||||||
if [ -z "${language:-}" ]; then
|
ynh_app_setting_set_default --key=language --value=en
|
||||||
# If upgrading from a version which doesn't support translations, set language to English by default
|
|
||||||
language=en
|
|
||||||
ynh_app_setting_set --key=language --value=$language
|
|
||||||
fi
|
|
||||||
|
|
||||||
# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=export --value=none
|
ynh_app_setting_set_default --key=export --value=none
|
||||||
if [ -z "${export:-}" ]; then
|
|
||||||
export=none
|
|
||||||
ynh_app_setting_set --key=export --value=$export
|
|
||||||
fi
|
|
||||||
|
|
||||||
# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=path --value="/"
|
ynh_app_setting_set_default --key=path --value="/"
|
||||||
if [ -z "${path:-}" ]; then
|
|
||||||
path="/"
|
|
||||||
ynh_app_setting_set --key=path --value=$path
|
|
||||||
fi
|
|
||||||
|
|
||||||
# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=password --value=$(ynh_string_random --length=32)
|
ynh_app_setting_set_default --key=password --value=$(ynh_string_random --length=32)
|
||||||
if [ -z "${password:-}" ]; then
|
|
||||||
password=$(ynh_string_random --length=32)
|
|
||||||
ynh_app_setting_set --key=password --value="$password"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
|
@ -46,8 +30,6 @@ ynh_script_progression "Upgrading source files..."
|
||||||
|
|
||||||
ynh_setup_source --dest_dir="$install_dir" --full_replace --keep="settings.json credentials.json"
|
ynh_setup_source --dest_dir="$install_dir" --full_replace --keep="settings.json credentials.json"
|
||||||
|
|
||||||
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
|
|
||||||
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -82,21 +64,14 @@ fi
|
||||||
ynh_config_add --template="settings.json" --destination="$install_dir/settings.json"
|
ynh_config_add --template="settings.json" --destination="$install_dir/settings.json"
|
||||||
ynh_config_add --template="credentials.json" --destination="$install_dir/credentials.json"
|
ynh_config_add --template="credentials.json" --destination="$install_dir/credentials.json"
|
||||||
|
|
||||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 600 "$install_dir/settings.json"
|
|
||||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/settings.json"
|
|
||||||
|
|
||||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 600 "$install_dir/credentials.json"
|
|
||||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/credentials.json"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL ETHERPAD
|
# INSTALL ETHERPAD
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression "Installing $app..."
|
ynh_script_progression "Installing $app..."
|
||||||
|
|
||||||
pushd $install_dir
|
pushd $install_dir
|
||||||
|
ynh_hide_warnings corepack enable && corepack prepare pnpm@latest --activate
|
||||||
ynh_hide_warnings env node_load_PATH corepack enable && corepack prepare pnpm@latest --activate
|
ynh_hide_warnings pnpm --recursive i --production
|
||||||
ynh_hide_warnings env node_load_PATH pnpm --recursive i --production
|
|
||||||
ynh_safe_rm "$install_dir/var/minified*"
|
ynh_safe_rm "$install_dir/var/minified*"
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue