From c26ef5a0127aab5b5afc60d4d74e3c62aa793ffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 24 Nov 2023 12:29:01 +0100 Subject: [PATCH] fix --- conf/.env | 14 ++++++++++++++ manifest.toml | 2 +- scripts/install | 1 + scripts/upgrade | 32 ++++++++++++++++++++++---------- 4 files changed, 38 insertions(+), 11 deletions(-) diff --git a/conf/.env b/conf/.env index e69de29..f3d147d 100644 --- a/conf/.env +++ b/conf/.env @@ -0,0 +1,14 @@ +DATABASE_URL="file:./database/db.sqlite" + +# Next Auth +# You can generate a new secret on the command line with: +# openssl rand -base64 32 +# https://next-auth.js.org/configuration/options#secret +NEXTAUTH_URL="http://127.0.0.1:__PORT__" + +NEXTAUTH_SECRET="__SECRET__" + +# Disable analytics +NEXT_PUBLIC_DISABLE_ANALYTICS="true" + +DEFAULT_COLOR_SCHEME="light" \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index 615510d..dfd938c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -51,7 +51,7 @@ ram.runtime = "50M" main.url = "/" [resources.apt] - packages = "" + packages = "sqlite3" extras.yarn.repo = "deb https://dl.yarnpkg.com/debian/ stable main" extras.yarn.key = "https://dl.yarnpkg.com/debian/pubkey.gpg" extras.yarn.packages = "yarn" diff --git a/scripts/install b/scripts/install index 4b1f104..afb929f 100755 --- a/scripts/install +++ b/scripts/install @@ -57,6 +57,7 @@ pushd $install_dir ynh_use_nodejs ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH NODE_ENV=production yarn build + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn db:migrate popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 55f7d22..6379485 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -55,22 +55,34 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 - env_path="$PATH" # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="Customizable browser's home page" --log="/var/log/$app/$app.log" +#================================================= +# ADD A CONFIGURATION +#================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 + +ynh_add_config --template=".env" --destination="$install_dir/.env" + +chmod 400 "$install_dir/.env" +chown $app:$app "$install_dir/.env" + +#================================================= +# INSTALL HOMARR +#================================================= +ynh_script_progression --message="Building the app..." --weight=20 + +pushd $install_dir + ynh_use_nodejs + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH NODE_ENV=production yarn build + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn db:migrate +popd + #================================================= # START SYSTEMD SERVICE #=================================================