1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/homarr_ynh.git synced 2024-09-03 19:26:00 +02:00
This commit is contained in:
Éric Gaspar 2023-11-24 12:29:01 +01:00
parent 4845df14d7
commit c26ef5a012
4 changed files with 38 additions and 11 deletions

View file

@ -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"

View file

@ -51,7 +51,7 @@ ram.runtime = "50M"
main.url = "/" main.url = "/"
[resources.apt] [resources.apt]
packages = "" packages = "sqlite3"
extras.yarn.repo = "deb https://dl.yarnpkg.com/debian/ stable main" extras.yarn.repo = "deb https://dl.yarnpkg.com/debian/ stable main"
extras.yarn.key = "https://dl.yarnpkg.com/debian/pubkey.gpg" extras.yarn.key = "https://dl.yarnpkg.com/debian/pubkey.gpg"
extras.yarn.packages = "yarn" extras.yarn.packages = "yarn"

View file

@ -57,6 +57,7 @@ pushd $install_dir
ynh_use_nodejs 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 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 NODE_ENV=production yarn build
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn db:migrate
popd popd
#================================================= #=================================================

View file

@ -55,22 +55,34 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# SETUP SYSTEMD
#=================================================
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
env_path="$PATH" env_path="$PATH"
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_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" 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 # START SYSTEMD SERVICE
#================================================= #=================================================