1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/umami_ynh.git synced 2024-10-01 13:34:50 +02:00

Merge pull request #41 from YunoHost-Apps/testing

Testing
This commit is contained in:
eric_G 2023-12-14 10:01:54 +01:00 committed by GitHub
commit c26d302b7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 87 additions and 28 deletions

View file

@ -31,7 +31,7 @@ Umami is a simple, easy to use, self-hosted web analytics solution. The goal is
- Privacy-focused
**Shipped version:** 2.8.0~ynh1
**Shipped version:** 2.9.0~ynh1
**Demo:** https://app.umami.is/share/8rmHaheU/umami.is

View file

@ -31,7 +31,7 @@ Umami is a simple, easy to use, self-hosted web analytics solution. The goal is
- Privacy-focused
**Version incluse :** 2.8.0~ynh1
**Version incluse :** 2.9.0~ynh1
**Démo :** https://app.umami.is/share/8rmHaheU/umami.is

View file

@ -3,3 +3,4 @@ DATABASE_URL=postgresql://__DB_USER__:__DB_PWD__@127.0.0.1:5432/__DB_NAME__
DISABLE_TELEMETRY=1
PORT=__PORT__
DEFAULT_LOCALE="__LANGUAGE__"
NODE_ENV=production

View file

@ -6,7 +6,7 @@ After=network.target
Type=simple
User=__APP__
Group=__APP__
WorkingDirectory=__INSTALL_DIR__/
WorkingDirectory=__INSTALL_DIR__/release
Environment=NODE_ENV=production
Environment="__YNH_NODE_LOAD_PATH__"
Environment=NEXT_TELEMETRY_DISABLED=1

View file

@ -5,9 +5,9 @@ name = "Umami"
description.en = "Simple, fast, privacy-focused alternative to Google Analytics"
description.fr = "Analyse de trafic web simple et respectueux"
version = "2.8.0~ynh1"
version = "2.9.0~ynh1"
maintainers = ["eric_G"]
maintainers = ["orhtej2"]
[upstream]
license = "MIT"
@ -47,8 +47,8 @@ ram.runtime = "50M"
[resources.sources.main]
url = "https://github.com/mikecao/umami/archive/refs/tags/v2.8.0.tar.gz"
sha256 = "c12d698672952f20cbff63d73854e11ae68af4d14654cb6352702aa9ca0f9614"
url = "https://github.com/mikecao/umami/archive/refs/tags/v2.9.0.tar.gz"
sha256 = "42f1b7b85dc41b1300ad3b61bc0eda8eee82eb0ff414ab055f9057410b83bd93"
autoupdate.strategy = "latest_github_tag"
[resources.system_user]

View file

@ -23,7 +23,7 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
ynh_script_progression --message="Setting up source files..." --weight=5
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
ynh_setup_source --dest_dir="$install_dir/build"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
@ -46,10 +46,10 @@ yunohost service add $app --description="Web Analytics" --log="/var/log/$app/$ap
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_add_config --template="../conf/.env" --destination="$install_dir/.env"
ynh_add_config --template="../conf/.env" --destination="$install_dir/build/.env"
chmod 650 "$install_dir/.env"
chown $app:$app "$install_dir/.env"
chmod 650 "$install_dir/build/.env"
chown $app:$app "$install_dir/build/.env"
ynh_script_progression --message="Provisioning pgcrypto..." --weight=1
@ -60,12 +60,34 @@ ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pgcrypto;" --data
#=================================================
ynh_script_progression --message="Configuring the app..." --weight=15
pushd $install_dir
pushd "$install_dir/build"
ynh_use_nodejs
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 NEXT_TELEMETRY_DISABLED=1 yarn build
# Actual app is a subset of release assets
# List of deps based on Dockerfile: https://github.com/umami-software/umami/blob/master/Dockerfile
ynh_secure_remove --file="node_modules/"
mv next.config.js .next/standalone/
mv public .next/standalone/
mv prisma .next/standalone/
mv scripts .next/standalone/
mv .next/static .next/standalone/.next
popd
mkdir "$install_dir/release"
chmod -R o-rwx "$install_dir/release"
chown -R $app:www-data "$install_dir/release"
mv -f $install_dir/build/.next/standalone/* $install_dir/build/.next/standalone/.[!.]* $install_dir/release
pushd "$install_dir/release"
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn add npm-run-all dotenv prisma
popd
ynh_secure_remove --file="$install_dir/.cache"
ynh_secure_remove --file="$install_dir/build"
#=================================================
# START SYSTEMD SERVICE
#=================================================

View file

@ -41,16 +41,25 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
if [ "$upgrade_type" == "UPGRADE_APP" ]
if $(ynh_compare_current_package_version --comparison le --version "2.7.0~ynh4")
then
ynh_script_progression --message="Upgrading source files..." --weight=5
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 #--keep=".env"
# Purge old root directory's contents
ynh_script_progression --message="Removing old files..." --weight=2
mkdir /tmp/release
chmod -R o-rwx /tmp/release
chown -R $app:www-data /tmp/release
mv -f $install_dir/* $install_dir/.[!.]* /tmp/release
mv /tmp/release $install_dir/
fi
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
if [[ "$upgrade_type" == "UPGRADE_APP" || $(ynh_compare_current_package_version --comparison le --version "2.7.0~ynh4") ]]; then
ynh_script_progression --message="Upgrading source files..." --weight=5
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir/build" --full_replace=1 #--keep=".env"
fi
chmod -R o-rwx "$install_dir/build"
chown -R $app:www-data "$install_dir/build"
#=================================================
# UPGRADE DEPENDENCIES
@ -78,10 +87,10 @@ yunohost service add $app --description="Web Analytics" --log="/var/log/$app/$ap
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_add_config --template="../conf/.env" --destination="$install_dir/.env"
ynh_add_config --template="../conf/.env" --destination="$install_dir/build/.env"
chmod 650 "$install_dir/.env"
chown $app:$app "$install_dir/.env"
chmod 650 "$install_dir/build/.env"
chown $app:$app "$install_dir/build/.env"
ynh_script_progression --message="Provisioning pgcrypto..." --weight=1
@ -90,14 +99,41 @@ ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pgcrypto;" --data
#=================================================
# CONFIGURE THE APP
#=================================================
if [[ "$upgrade_type" == "UPGRADE_APP" || $(ynh_compare_current_package_version --comparison le --version "2.7.0~ynh4") ]]; then
ynh_script_progression --message="Configuring the app..." --weight=15
pushd $install_dir
pushd $install_dir/build
ynh_use_nodejs
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 NEXT_TELEMETRY_DISABLED=1 yarn build
# Actual app is a subset of release assets
# List of deps based on Dockerfile: https://github.com/umami-software/umami/blob/master/Dockerfile
ynh_secure_remove --file="node_modules/"
mv next.config.js .next/standalone/
mv public .next/standalone/
mv prisma .next/standalone/
mv scripts .next/standalone/
mv .next/static .next/standalone/.next
popd
ynh_secure_remove --file="$install_dir/release"
mkdir "$install_dir/release"
chmod -R o-rwx "$install_dir/release"
chown -R $app:www-data "$install_dir/release"
mv -f $install_dir/build/.next/standalone/* $install_dir/build/.next/standalone/.[!.]* $install_dir/release
pushd "$install_dir/release"
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn add npm-run-all dotenv prisma
popd
fi
ynh_secure_remove --file="$install_dir/.cache"
ynh_secure_remove --file="$install_dir/build"
#=================================================
# START SYSTEMD SERVICE
#=================================================