This commit is contained in:
Yeray 2024-07-27 21:29:21 +02:00
parent 6690840df1
commit 2910a8753f
2 changed files with 24 additions and 21 deletions

View File

@ -49,8 +49,11 @@ ram.runtime = "50M"
default = "none"
[resources]
[resources.system_user]
[resources.install_dir]
[resources.permissions]
main.url = "/"

View File

@ -28,17 +28,17 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version"
ynh_use_nodejs
#=================================================
# CREATE A POSTGRESQL DATABASE
# DISABLED: CREATE A POSTGRESQL DATABASE
#=================================================
ynh_script_progression --message="Creating a PostgreSQL database..."
# ynh_script_progression --message="Creating a PostgreSQL database..."
ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;" --database=$db_name
# ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;" --database=$db_name
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..."
echo $git_url
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
@ -48,42 +48,42 @@ chown -R "$app:$app" "$install_dir"
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..."
# ynh_script_progression --message="Adding a configuration file..."
ynh_add_config --template="config.sample.yml" --destination="$install_dir/config.yml"
# ynh_add_config --template="config.sample.yml" --destination="$install_dir/config.yml"
chmod 400 "$install_dir/config.yml"
chown "$app:$app" "$install_dir/config.yml"
# chmod 400 "$install_dir/config.yml"
# chown "$app:$app" "$install_dir/config.yml"
#=================================================
# SYSTEM CONFIGURATION
#=================================================
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
# ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config
# # Create a dedicated NGINX config
# ynh_add_nginx_config
# Create a dedicated systemd config
ynh_add_systemd_config
yunohost service add "$app" --description="$app daemon for Wiki.js" --log="/var/log/$app/$app.log"
# # Create a dedicated systemd config
# ynh_add_systemd_config
# yunohost service add "$app" --description="$app daemon for Custom Node.js App" --log="/var/log/$app/$app.log"
#=================================================
# CREATE LDAP USER
#=================================================
ynh_script_progression --message="Creating LDAP user..."
# ynh_script_progression --message="Creating LDAP user..."
yunohost user create "$ldap_user" --fullname "SvcWikijsLdap" --domain "$domain" --password "$ldap_password" -q 0
# yunohost user create "$ldap_user" --fullname "SvcWikijsLdap" --domain "$domain" --password "$ldap_password" -q 0
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..."
# ynh_script_progression --message="Starting a systemd service..."
# Start a systemd service
ynh_systemd_action --service_name="$app" --action="start" --log_path=systemd --line_match="HTTP Server:"
# ynh_systemd_action --service_name="$app" --action="start" --log_path=systemd --line_match="HTTP Server:"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of $app completed"
# ynh_script_progression --message="Installation of $app completed"