mirror of
https://github.com/YunoHost-Apps/peertube-search-index_ynh.git
synced 2024-09-03 19:56:30 +02:00
cleaning
This commit is contained in:
parent
d109dfb7bb
commit
a659b91efe
7 changed files with 8 additions and 36 deletions
|
@ -20,7 +20,7 @@ code = "https://framagit.org/framasoft/peertube/search-index"
|
|||
fund = "https://framasoft.org/fr/#support"
|
||||
|
||||
[integration]
|
||||
yunohost = ">= 11.2.18"
|
||||
yunohost = ">= 11.2.29"
|
||||
helpers_version = "2.1"
|
||||
architectures = "all"
|
||||
multi_instance = true
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
||||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ ynh_config_change_url_nginx
|
|||
#=================================================
|
||||
ynh_script_progression "Starting $app's systemd service..."
|
||||
|
||||
# Start a systemd service
|
||||
ynh_systemctl --service="$app" --action="start" --log_path="systemd" --wait_until="Server listening on port"
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -27,8 +27,7 @@ systemctl start elasticsearch.service
|
|||
ynh_script_progression "Setting up source files..."
|
||||
|
||||
_git_clone_or_pull "$install_dir/sources"
|
||||
#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:$app" "$install_dir"
|
||||
|
||||
#=================================================
|
||||
# BUILDING
|
||||
#=================================================
|
||||
|
@ -36,9 +35,9 @@ ynh_script_progression "Building..."
|
|||
|
||||
pushd "$install_dir/sources"
|
||||
|
||||
ynh_exec_as_app node_load_PATH" yarn install --pure-lockfile
|
||||
ynh_hide_warnings ynh_exec_as_app yarn install --pure-lockfile
|
||||
ynh_exec_as_app mkdir -p "dist"
|
||||
ynh_exec_as_app node_load_PATH" npm run build
|
||||
ynh_hide_warnings ynh_exec_as_app npm run build
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
|
@ -48,22 +47,16 @@ ynh_script_progression "Adding a config file..."
|
|||
|
||||
ynh_config_add --template="default.yaml" --destination="$install_dir/sources/config/production.yaml"
|
||||
|
||||
#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 400 "$install_dir/sources/config/production.yaml"
|
||||
#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/sources/config/production.yaml"
|
||||
|
||||
#=================================================
|
||||
# SYSTEM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression "Adding system configurations related to $app..."
|
||||
|
||||
# Create a dedicated NGINX config
|
||||
ynh_config_add_nginx
|
||||
|
||||
# Create a dedicated systemd config
|
||||
ynh_config_add_systemd
|
||||
yunohost service add "$app" --description="$app search index daemon"
|
||||
|
||||
# Use logrotate to manage application logfile(s)
|
||||
ynh_config_add_logrotate
|
||||
|
||||
#=================================================
|
||||
|
@ -71,7 +64,6 @@ ynh_config_add_logrotate
|
|||
#=================================================
|
||||
ynh_script_progression "Starting $app's systemd service..."
|
||||
|
||||
# Start a systemd service
|
||||
ynh_systemctl --service="$app" --action="start" --log_path="systemd" --wait_until="Server listening on port"
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -8,18 +8,14 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
ynh_script_progression "Removing system configurations related to $app..."
|
||||
|
||||
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
||||
if ynh_hide_warnings yunohost service status "$app" >/dev/null; then
|
||||
yunohost service remove "$app"
|
||||
fi
|
||||
|
||||
# Remove the dedicated systemd config
|
||||
ynh_config_remove_systemd
|
||||
|
||||
# Remove the app-specific logrotate config
|
||||
ynh_config_remove_logrotate
|
||||
|
||||
# Remove the dedicated NGINX config
|
||||
ynh_config_remove_nginx
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
||||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
|
@ -26,8 +25,6 @@ ynh_script_progression "Restoring the app main directory..."
|
|||
|
||||
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:$app" "$install_dir"
|
||||
#=================================================
|
||||
# RESTORE SYSTEM CONFIGURATIONS
|
||||
#=================================================
|
||||
|
@ -37,6 +34,7 @@ ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
|
||||
ynh_restore "/etc/systemd/system/$app.service"
|
||||
systemctl enable "$app.service" --quiet
|
||||
|
||||
yunohost service add "$app" --description="$app search index daemon"
|
||||
|
||||
ynh_restore "/etc/logrotate.d/$app"
|
||||
|
|
|
@ -37,28 +37,22 @@ if [ -d "$install_dir/.git" ]; then
|
|||
mv "${install_dir}__tmp__" "$install_dir"
|
||||
fi
|
||||
|
||||
# Fix upgrade from 0.0.1.2022.06.03~ynh1
|
||||
#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 750 "$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:$app" "$install_dir"
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
ynh_script_progression "Upgrading source files..."
|
||||
|
||||
_git_clone_or_pull "$install_dir/sources"
|
||||
#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:$app" "$install_dir"
|
||||
|
||||
#=================================================
|
||||
# BUILDING
|
||||
#=================================================
|
||||
ynh_script_progression "Building..."
|
||||
|
||||
pushd "$install_dir/sources"
|
||||
|
||||
ynh_exec_as_app node_load_PATH" yarn install --pure-lockfile
|
||||
ynh_hide_warnings ynh_exec_as_app yarn install --pure-lockfile
|
||||
ynh_exec_as_app mkdir -p "dist"
|
||||
ynh_exec_as_app node_load_PATH" npm run build
|
||||
ynh_hide_warnings ynh_exec_as_app npm run build
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
|
@ -68,22 +62,16 @@ ynh_script_progression "Updating a config file..."
|
|||
|
||||
ynh_config_add --template="default.yaml" --destination="$install_dir/sources/config/production.yaml"
|
||||
|
||||
#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 400 "$install_dir/sources/config/production.yaml"
|
||||
#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/sources/config/production.yaml"
|
||||
|
||||
#=================================================
|
||||
# REAPPLY SYSTEM CONFIGURATIONS
|
||||
#=================================================
|
||||
ynh_script_progression "Upgrading system configurations related to $app..."
|
||||
|
||||
# Create a dedicated NGINX config
|
||||
ynh_config_add_nginx
|
||||
|
||||
# Create a dedicated systemd config
|
||||
ynh_config_add_systemd
|
||||
yunohost service add "$app" --description="$app search index daemon"
|
||||
|
||||
# Use logrotate to manage app-specific logfile(s)
|
||||
ynh_config_add_logrotate
|
||||
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue