diff --git a/conf/config.inc.php b/conf/config.inc.php index 04eb4d8..21b1c22 100644 --- a/conf/config.inc.php +++ b/conf/config.inc.php @@ -1,7 +1,7 @@ <?php $_config['sql_host'] = 'localhost'; -$_config['sql_user'] = '__DB_NAME__'; +$_config['sql_user'] = '__DB_USER__'; $_config['sql_pass'] = '__DB_PWD__'; $_config['sql_db'] = '__DB_NAME__'; diff --git a/manifest.toml b/manifest.toml index ceac0c1..81597de 100644 --- a/manifest.toml +++ b/manifest.toml @@ -58,6 +58,9 @@ ram.runtime = "50M" [resources.apt] packages = "mariadb-server, php8.2-fpm, php8.2-mysql" + 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" [resources.database] type = "mysql" diff --git a/scripts/_common.sh b/scripts/_common.sh index 944a65e..44277c5 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,6 +4,8 @@ # COMMON VARIABLES #================================================= +nodejs_version=20 + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 4c3225d..8c52572 100644 --- a/scripts/install +++ b/scripts/install @@ -9,6 +9,14 @@ source _common.sh source /usr/share/yunohost/helpers +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=7 + +# Install Nodejs +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -50,6 +58,18 @@ ynh_add_config --template="../conf/config.inc.php" --destination="$install_dir/c chmod 400 "$install_dir/config.inc.php" chown $app:$app "$install_dir/config.inc.php" +#================================================= +# INSTALL THE LOUNGE +#================================================= +ynh_script_progression --message="Installing $app..." --weight=10 + +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 + mv $install_dir/dist/ $install_dir +popd + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index b220a97..9c84697 100644 --- a/scripts/remove +++ b/scripts/remove @@ -20,6 +20,9 @@ ynh_remove_nginx_config # Remove the dedicated php-fpm config ynh_remove_fpm_config +# Remove NodeJS +ynh_remove_nodejs + #================================================= # END OF SCRIPT #=================================================