mirror of
https://github.com/YunoHost-Apps/facilmap_ynh.git
synced 2024-09-03 18:36:07 +02:00
commit
2955ee2740
12 changed files with 61 additions and 31 deletions
|
@ -18,7 +18,7 @@ It shall NOT be edited by hand.
|
||||||
|
|
||||||
Collaborative maps and routing with a straightforward interface
|
Collaborative maps and routing with a straightforward interface
|
||||||
|
|
||||||
**Shipped version:** 3.4.0~ynh3
|
**Shipped version:** 4.1.1~ynh1
|
||||||
|
|
||||||
**Demo:** <https://facilmap.org/>
|
**Demo:** <https://facilmap.org/>
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ No se debe editar a mano.
|
||||||
|
|
||||||
Collaborative maps and routing with a straightforward interface
|
Collaborative maps and routing with a straightforward interface
|
||||||
|
|
||||||
**Versión actual:** 3.4.0~ynh3
|
**Versión actual:** 4.1.1~ynh1
|
||||||
|
|
||||||
**Demo:** <https://facilmap.org/>
|
**Demo:** <https://facilmap.org/>
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ EZ editatu eskuz.
|
||||||
|
|
||||||
Collaborative maps and routing with a straightforward interface
|
Collaborative maps and routing with a straightforward interface
|
||||||
|
|
||||||
**Paketatutako bertsioa:** 3.4.0~ynh3
|
**Paketatutako bertsioa:** 4.1.1~ynh1
|
||||||
|
|
||||||
**Demoa:** <https://facilmap.org/>
|
**Demoa:** <https://facilmap.org/>
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ Il NE doit PAS être modifié à la main.
|
||||||
Cartes et itinéraires collaboratifs avec une interface simple.
|
Cartes et itinéraires collaboratifs avec une interface simple.
|
||||||
|
|
||||||
|
|
||||||
**Version incluse :** 3.4.0~ynh3
|
**Version incluse :** 4.1.1~ynh1
|
||||||
|
|
||||||
**Démo :** <https://facilmap.org/>
|
**Démo :** <https://facilmap.org/>
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ NON debe editarse manualmente.
|
||||||
|
|
||||||
Collaborative maps and routing with a straightforward interface
|
Collaborative maps and routing with a straightforward interface
|
||||||
|
|
||||||
**Versión proporcionada:** 3.4.0~ynh3
|
**Versión proporcionada:** 4.1.1~ynh1
|
||||||
|
|
||||||
**Demo:** <https://facilmap.org/>
|
**Demo:** <https://facilmap.org/>
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
Collaborative maps and routing with a straightforward interface
|
Collaborative maps and routing with a straightforward interface
|
||||||
|
|
||||||
**分发版本:** 3.4.0~ynh3
|
**分发版本:** 4.1.1~ynh1
|
||||||
|
|
||||||
**演示:** <https://facilmap.org/>
|
**演示:** <https://facilmap.org/>
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,10 @@ Type=simple
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
Environment=NODE_ENV=production
|
Environment=NODE_ENV=production
|
||||||
Environment=DOTENV_CONFIG_PATH=__INSTALL_DIR__/etc/facilmap.env
|
Environment=DOTENV_CONFIG_PATH=__INSTALL_DIR__/config.env
|
||||||
Environment="__YNH_NODE_LOAD_PATH__"
|
Environment="__YNH_NODE_LOAD_PATH__"
|
||||||
ExecStart=__INSTALL_DIR__/bin/facilmap-server
|
WorkingDirectory=__INSTALL_DIR__/server
|
||||||
WorkingDirectory=__INSTALL_DIR__
|
ExecStart=/usr/bin/yarn server
|
||||||
StandardOutput=syslog
|
StandardOutput=syslog
|
||||||
StandardError=syslog
|
StandardError=syslog
|
||||||
SyslogIdentifier=__APP__
|
SyslogIdentifier=__APP__
|
||||||
|
|
|
@ -7,7 +7,7 @@ name = "Facilmap"
|
||||||
description.en = "Collaborative maps and routing with a straightforward interface"
|
description.en = "Collaborative maps and routing with a straightforward interface"
|
||||||
description.fr = "Carte collaborative avec une interface simple et pratique"
|
description.fr = "Carte collaborative avec une interface simple et pratique"
|
||||||
|
|
||||||
version = "3.4.0~ynh3"
|
version = "4.1.1~ynh1"
|
||||||
|
|
||||||
maintainers = ["Squeak"]
|
maintainers = ["Squeak"]
|
||||||
|
|
||||||
|
@ -23,11 +23,14 @@ code = "https://github.com/FacilMap/facilmap"
|
||||||
yunohost = ">= 11.2"
|
yunohost = ">= 11.2"
|
||||||
architectures = "all"
|
architectures = "all"
|
||||||
multi_instance = true
|
multi_instance = true
|
||||||
|
|
||||||
ldap = false
|
ldap = false
|
||||||
|
|
||||||
sso = false
|
sso = false
|
||||||
disk = "50M"
|
|
||||||
ram.build = "50M"
|
disk = "1000M"
|
||||||
ram.runtime = "50M"
|
ram.build = "2000M"
|
||||||
|
ram.runtime = "450M"
|
||||||
|
|
||||||
[install]
|
[install]
|
||||||
[install.domain]
|
[install.domain]
|
||||||
|
@ -81,6 +84,13 @@ ram.runtime = "50M"
|
||||||
|
|
||||||
[resources]
|
[resources]
|
||||||
|
|
||||||
|
[resources.sources]
|
||||||
|
|
||||||
|
[resources.sources.main]
|
||||||
|
url = "https://github.com/FacilMap/facilmap/archive/refs/tags/v4.1.1.tar.gz"
|
||||||
|
sha256 = "72cf9f7fbc6e9d5c73f7c1af02be63d2c5a99d13cf89c96af834db6004c89cf6"
|
||||||
|
autoupdate.strategy = "latest_github_tag"
|
||||||
|
|
||||||
[resources.ports]
|
[resources.ports]
|
||||||
|
|
||||||
[resources.system_user]
|
[resources.system_user]
|
||||||
|
@ -93,5 +103,9 @@ ram.runtime = "50M"
|
||||||
[resources.apt]
|
[resources.apt]
|
||||||
packages = "mariadb-server"
|
packages = "mariadb-server"
|
||||||
|
|
||||||
|
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]
|
[resources.database]
|
||||||
type = "mysql"
|
type = "mysql"
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
|
|
||||||
nodejs_version=20
|
nodejs_version=20
|
||||||
|
|
||||||
facilmap_version=4.1.1
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -16,6 +16,15 @@ ynh_script_progression --message="Installing NodeJS..." --weight=6
|
||||||
|
|
||||||
ynh_install_nodejs --nodejs_version=$nodejs_version
|
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Setting up source files..." --weight=1
|
||||||
|
|
||||||
|
ynh_setup_source --dest_dir="$install_dir"
|
||||||
|
|
||||||
|
chown -R "$app:www-data" "$install_dir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE A MYSQL DATABASE
|
# CREATE A MYSQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -28,10 +37,12 @@ ynh_mysql_execute_as_root --database="$db_name" --sql="ALTER DATABASE $db_name C
|
||||||
#=================================================
|
#=================================================
|
||||||
# BUILD NODE DEPENDENCIES
|
# BUILD NODE DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Building with NodeJS..." --weight=20
|
ynh_script_progression --message="Building $app..." --weight=10
|
||||||
|
|
||||||
pushd "$install_dir"
|
pushd "$install_dir"
|
||||||
ynh_exec_as $app "$ynh_node_load_PATH" "$ynh_npm" install --prefix "$install_dir" -g facilmap-server@"$facilmap_version" 2>/dev/null
|
ynh_use_nodejs
|
||||||
|
ynh_exec_warn_less env $ynh_node_load_PATH yarn install
|
||||||
|
ynh_exec_warn_less env $ynh_node_load_PATH yarn build
|
||||||
popd
|
popd
|
||||||
|
|
||||||
chmod 750 "$install_dir"
|
chmod 750 "$install_dir"
|
||||||
|
@ -43,11 +54,10 @@ chown -R "$app:www-data" "$install_dir"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Adding configuration..." --weight=2
|
ynh_script_progression --message="Adding configuration..." --weight=2
|
||||||
|
|
||||||
mkdir -p "$install_dir/etc"
|
ynh_add_config --template="config.env" --destination="$install_dir/config.env"
|
||||||
ynh_add_config --template="config.env" --destination="$install_dir/etc/facilmap.env"
|
|
||||||
|
|
||||||
chown -R "$app:www-data" "$install_dir/etc"
|
chown -R "$app:www-data" "$install_dir/config.env"
|
||||||
chmod 400 "$install_dir/etc/facilmap.env"
|
chmod 400 "$install_dir/config.env"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SYSTEM CONFIGURATION
|
# SYSTEM CONFIGURATION
|
||||||
|
|
|
@ -24,8 +24,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
|
||||||
|
|
||||||
ynh_restore_file --origin_path="$install_dir"
|
ynh_restore_file --origin_path="$install_dir"
|
||||||
|
|
||||||
chmod 750 "$install_dir"
|
|
||||||
chmod -R o-rwx "$install_dir"
|
|
||||||
chown -R "$app:www-data" "$install_dir"
|
chown -R "$app:www-data" "$install_dir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -33,7 +31,6 @@ chown -R "$app:www-data" "$install_dir"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the MySQL database..." --weight=1
|
ynh_script_progression --message="Restoring the MySQL database..." --weight=1
|
||||||
|
|
||||||
# echo "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"
|
|
||||||
ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql
|
ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -25,15 +25,26 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||||
|
|
||||||
|
ynh_setup_source --dest_dir="$install_dir"
|
||||||
|
|
||||||
|
chown -R "$app:www-data" "$install_dir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# SPECIFIC UPGRADE
|
||||||
#=================================================
|
#=================================================
|
||||||
# BUILD NODE DEPENDENCIES
|
# BUILD NODE DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Install $app..." --weight=20
|
ynh_script_progression --message="Install $app..." --weight=10
|
||||||
|
|
||||||
pushd $install_dir
|
pushd "$install_dir"
|
||||||
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" install --prefix "$install_dir" -g facilmap-server@"$facilmap_version" 2>/dev/null
|
ynh_use_nodejs
|
||||||
|
ynh_exec_warn_less env $ynh_node_load_PATH yarn install
|
||||||
|
ynh_exec_warn_less env $ynh_node_load_PATH yarn build
|
||||||
popd
|
popd
|
||||||
|
|
||||||
chmod 750 "$install_dir"
|
chmod 750 "$install_dir"
|
||||||
|
@ -45,11 +56,10 @@ chown -R "$app:www-data" "$install_dir"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating config files..." --weight=2
|
ynh_script_progression --message="Updating config files..." --weight=2
|
||||||
|
|
||||||
mkdir -p "$install_dir/etc"
|
ynh_add_config --template="config.env" --destination="$install_dir/config.env"
|
||||||
ynh_add_config --template="config.env" --destination="$install_dir/etc/facilmap.env"
|
|
||||||
|
|
||||||
chown -R "$app:www-data" "$install_dir/etc"
|
chown -R "$app:www-data" "$install_dir/config.env"
|
||||||
chmod 400 "$install_dir/etc/facilmap.env"
|
chmod 400 "$install_dir/config.env"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
@ -77,6 +87,7 @@ yunohost service add "$app" --description="Collaborative maps and routing" --log
|
||||||
|
|
||||||
# Use logrotate to manage app-specific logfile(s)
|
# Use logrotate to manage app-specific logfile(s)
|
||||||
ynh_use_logrotate --non-append
|
ynh_use_logrotate --non-append
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue