mirror of
https://github.com/YunoHost-Apps/umami_ynh.git
synced 2024-10-01 13:34:50 +02:00
commit
00c5a35c1a
12 changed files with 48 additions and 47 deletions
|
@ -31,7 +31,7 @@ Umami is a simple, easy to use, self-hosted web analytics solution. The goal is
|
|||
- Open-source
|
||||
|
||||
|
||||
**Shipped version:** 1.32.1~ynh1
|
||||
**Shipped version:** 1.33~ynh1
|
||||
|
||||
**Demo:** https://app.umami.is/share/8rmHaheU/umami.is
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ Umami is a simple, easy to use, self-hosted web analytics solution. The goal is
|
|||
- Open-source
|
||||
|
||||
|
||||
**Version incluse :** 1.32.1~ynh1
|
||||
**Version incluse :** 1.33~ynh1
|
||||
|
||||
**Démo :** https://app.umami.is/share/8rmHaheU/umami.is
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
language="fr"
|
||||
admin="john"
|
||||
password="1Strong-Password"
|
||||
port="666"
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=0
|
||||
|
@ -15,15 +14,15 @@
|
|||
setup_private=1
|
||||
setup_public=1
|
||||
upgrade=1
|
||||
#upgrade=1 from_commit=CommitHash
|
||||
# 1.32.1~ynh1
|
||||
#upgrade=1 from_commit=267cb1aced761924cca8a2608be3a1b9bd14605c
|
||||
backup_restore=1
|
||||
multi_instance=1
|
||||
port_already_use=0
|
||||
change_url=1
|
||||
;;; Options
|
||||
Email=
|
||||
Notification=none
|
||||
;;; Upgrade options
|
||||
; commit=CommitHash
|
||||
name=Name and date of the commit.
|
||||
; commit=267cb1aced761924cca8a2608be3a1b9bd14605c
|
||||
name=# 1.32.1~ynh1
|
||||
manifest_arg=domain=DOMAIN&path=PATH&is_public=1&language=fr&admin=USER&password=pass&port=666&
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
DATABASE_URL=postgresql://__DB_USER__:__DB_PWD__@localhost:5432/__DB_NAME__
|
||||
HASH_SALT=__SALT__
|
||||
DISABLE_TELEMETRY = 1
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
SOURCE_URL=https://github.com/mikecao/umami/archive/refs/tags/v1.32.1.tar.gz
|
||||
SOURCE_SUM=6cad8de19879a3d48844efcfc2f794203ab5ae5ab1900bf58b936147f4491dd3
|
||||
SOURCE_URL=https://github.com/mikecao/umami/archive/refs/tags/v1.33.tar.gz
|
||||
SOURCE_SUM=22d29436d582f26ca913b7a641a03f3c6b82f6263a5e0fc0e4eae5ef7c8116b5
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=tar.gz
|
||||
SOURCE_IN_SUBDIR=true
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Simple, fast, privacy-focused alternative to Google Analytics",
|
||||
"fr": "Analyse de trafic web simple et respectueux"
|
||||
},
|
||||
"version": "1.32.1~ynh1",
|
||||
"version": "1.33~ynh1",
|
||||
"url": "https://umami.is/",
|
||||
"upstream": {
|
||||
"license": "MIT",
|
||||
|
@ -26,7 +26,7 @@
|
|||
"multi_instance": true,
|
||||
"services": [
|
||||
"nginx",
|
||||
"mysql"
|
||||
"postgresql"
|
||||
],
|
||||
"arguments": {
|
||||
"install": [
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#=================================================
|
||||
|
||||
# dependencies used by the app
|
||||
pkg_dependencies="postgresql"
|
||||
pkg_dependencies="postgresql postgresql-contrib"
|
||||
|
||||
nodejs_version=16
|
||||
|
||||
|
|
|
@ -56,9 +56,9 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
ynh_backup --src_path="/etc/systemd/system/$app.service"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE POSTGRESQL DATABASE
|
||||
# BACKUP THE DATABASE
|
||||
#=================================================
|
||||
ynh_print_info --message="Backing up the PostgreSQL database..."
|
||||
ynh_print_info --message="Backing up the database..."
|
||||
|
||||
ynh_psql_dump_db --database="$db_name" > db.sql
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@ ynh_abort_if_errors
|
|||
domain=$YNH_APP_ARG_DOMAIN
|
||||
path_url="/"
|
||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||
salt=$(ynh_string_random --length=16)
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -72,6 +71,9 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
|||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||
ynh_use_nodejs
|
||||
|
||||
# Install Yarn
|
||||
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
|
@ -81,9 +83,9 @@ ynh_script_progression --message="Configuring system user..." --weight=1
|
|||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||
|
||||
#=================================================
|
||||
# CREATE A POSTGRESQL DATABASE
|
||||
# CREATE A DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2
|
||||
ynh_script_progression --message="Creating a database..." --weight=2
|
||||
|
||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||
db_user=$db_name
|
||||
|
@ -119,8 +121,8 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1
|
|||
|
||||
ynh_add_config --template="../conf/.env" --destination="$final_path/.env"
|
||||
|
||||
#chmod 650 "$final_path/.env"
|
||||
#chown $app:$app "$final_path/.env"
|
||||
chmod 650 "$final_path/.env"
|
||||
chown $app:$app "$final_path/.env"
|
||||
|
||||
#=================================================
|
||||
# CONFIGURE THE APP
|
||||
|
@ -128,12 +130,11 @@ ynh_add_config --template="../conf/.env" --destination="$final_path/.env"
|
|||
ynh_script_progression --message="Configuring the app..." --weight=15
|
||||
|
||||
pushd $final_path
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install
|
||||
ynh_psql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" < $final_path/sql/schema.postgresql.sql
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn build
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn update-db
|
||||
popd
|
||||
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
|
|
|
@ -52,9 +52,9 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight=
|
|||
ynh_remove_logrotate
|
||||
|
||||
#=================================================
|
||||
# REMOVE THE POSTGRESQL DATABASE
|
||||
# REMOVE THE DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing the PostgreSQL database..." --weight=2
|
||||
ynh_script_progression --message="Removing the database..." --weight=2
|
||||
|
||||
# Remove a database if it exists, along with the associated user
|
||||
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
|
||||
|
|
|
@ -24,7 +24,7 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading installation settings..." --time --weight=1
|
||||
ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -38,7 +38,7 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
|||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
#=================================================
|
||||
ynh_script_progression --message="Validating restoration parameters..." --time --weight=1
|
||||
ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
||||
|
||||
test ! -d $final_path \
|
||||
|| ynh_die --message="There is already a directory: $final_path "
|
||||
|
@ -48,7 +48,7 @@ test ! -d $final_path \
|
|||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Recreating the dedicated system user..." --time --weight=1
|
||||
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
|
||||
|
||||
# Create the dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||
|
@ -56,7 +56,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||
#=================================================
|
||||
# RESTORE THE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the app main directory..." --time --weight=1
|
||||
ynh_script_progression --message="Restoring the app main directory..." --weight=5
|
||||
|
||||
ynh_restore_file --origin_path="$final_path"
|
||||
|
||||
|
@ -69,29 +69,27 @@ chown -R $app:www-data "$final_path"
|
|||
#=================================================
|
||||
# REINSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reinstalling dependencies..." --time --weight=1
|
||||
ynh_script_progression --message="Reinstalling dependencies..." --weight=10
|
||||
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
# Install Nodejs
|
||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||
|
||||
# Install Yarn
|
||||
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the NGINX web server configuration..." --time --weight=1
|
||||
ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE MYSQL DATABASE
|
||||
# RESTORE THE DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the MySQL database..." --time --weight=1
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE POSTGRESQL DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=6
|
||||
ynh_script_progression --message="Restoring the database..." --weight=6
|
||||
|
||||
ynh_psql_test_if_first_run
|
||||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||
|
@ -100,7 +98,7 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
|
|||
#=================================================
|
||||
# RESTORE SYSTEMD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the systemd configuration..." --time --weight=1
|
||||
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||
systemctl enable $app.service --quiet
|
||||
|
@ -108,14 +106,14 @@ systemctl enable $app.service --quiet
|
|||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1
|
||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||
|
||||
yunohost service add $app --description="Web Analytics" --log="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..." --time --weight=1
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||
|
||||
|
@ -124,7 +122,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap
|
|||
#=================================================
|
||||
# RELOAD NGINX AND PHP-FPM
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
@ -132,4 +130,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Restoration completed for $app" --time --last
|
||||
ynh_script_progression --message="Restoration completed for $app" --last
|
||||
|
|
|
@ -20,7 +20,6 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
|
@ -81,10 +80,14 @@ chown -R $app:www-data "$final_path"
|
|||
ynh_script_progression --message="Upgrading dependencies..." --weight=10
|
||||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
# Install Nodejs
|
||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||
ynh_use_nodejs
|
||||
|
||||
# Install Yarn
|
||||
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -99,8 +102,9 @@ ynh_add_nginx_config
|
|||
ynh_script_progression --message="Configuring the app..." --weight=15
|
||||
|
||||
pushd $final_path
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn build
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn update-db
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue