diff --git a/README.md b/README.md index e3a268e..298662d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Framagames for YunoHost -[![Integration level](https://dash.yunohost.org/integration/framagames.svg)](https://dash.yunohost.org/appci/app/framagames) ![Working status](https://ci-apps.yunohost.org/ci/badges/framagames.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/framagames.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/framagames.svg)](https://ci-apps.yunohost.org/ci/apps/framagames/) ![Working status](https://ci-apps.yunohost.org/ci/badges/framagames.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/framagames.maintain.svg) [![Install Framagames with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=framagames) @@ -18,7 +18,7 @@ It shall NOT be edited by hand. Set of games Framagames from Framasoft. -**Shipped version:** 1.0~ynh5 +**Shipped version:** 2022.12.28~ynh1 ## Documentation and resources - Official app website: diff --git a/README_es.md b/README_es.md index 8d06a02..b30e640 100644 --- a/README_es.md +++ b/README_es.md @@ -5,7 +5,7 @@ No se debe editar a mano. # Framagames para Yunohost -[![Nivel de integración](https://dash.yunohost.org/integration/framagames.svg)](https://dash.yunohost.org/appci/app/framagames) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/framagames.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/framagames.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/framagames.svg)](https://ci-apps.yunohost.org/ci/apps/framagames/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/framagames.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/framagames.maintain.svg) [![Instalar Framagames con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=framagames) @@ -18,7 +18,7 @@ No se debe editar a mano. Set of games Framagames from Framasoft. -**Versión actual:** 1.0~ynh5 +**Versión actual:** 2022.12.28~ynh1 ## Documentaciones y recursos - Sitio web oficial: diff --git a/README_eu.md b/README_eu.md index 81488e0..63720c4 100644 --- a/README_eu.md +++ b/README_eu.md @@ -5,7 +5,7 @@ EZ editatu eskuz. # Framagames YunoHost-erako -[![Integrazio maila](https://dash.yunohost.org/integration/framagames.svg)](https://dash.yunohost.org/appci/app/framagames) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/framagames.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/framagames.maintain.svg) +[![Integrazio maila](https://dash.yunohost.org/integration/framagames.svg)](https://ci-apps.yunohost.org/ci/apps/framagames/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/framagames.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/framagames.maintain.svg) [![Instalatu Framagames YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=framagames) @@ -18,7 +18,7 @@ EZ editatu eskuz. Set of games Framagames from Framasoft. -**Paketatutako bertsioa:** 1.0~ynh5 +**Paketatutako bertsioa:** 2022.12.28~ynh1 ## Dokumentazioa eta baliabideak - Aplikazioaren webgune ofiziala: diff --git a/README_fr.md b/README_fr.md index af3232f..55dc94a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main. # Framagames pour YunoHost -[![Niveau d’intégration](https://dash.yunohost.org/integration/framagames.svg)](https://dash.yunohost.org/appci/app/framagames) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/framagames.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/framagames.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/framagames.svg)](https://ci-apps.yunohost.org/ci/apps/framagames/) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/framagames.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/framagames.maintain.svg) [![Installer Framagames avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=framagames) @@ -18,7 +18,7 @@ Il NE doit PAS être modifié à la main. Set of games Framagames from Framasoft. -**Version incluse :** 1.0~ynh5 +**Version incluse :** 2022.12.28~ynh1 ## Documentations et ressources - Site officiel de l’app : diff --git a/README_gl.md b/README_gl.md index dea44f8..f4fa522 100644 --- a/README_gl.md +++ b/README_gl.md @@ -5,7 +5,7 @@ NON debe editarse manualmente. # Framagames para YunoHost -[![Nivel de integración](https://dash.yunohost.org/integration/framagames.svg)](https://dash.yunohost.org/appci/app/framagames) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/framagames.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/framagames.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/framagames.svg)](https://ci-apps.yunohost.org/ci/apps/framagames/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/framagames.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/framagames.maintain.svg) [![Instalar Framagames con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=framagames) @@ -18,7 +18,7 @@ NON debe editarse manualmente. Set of games Framagames from Framasoft. -**Versión proporcionada:** 1.0~ynh5 +**Versión proporcionada:** 2022.12.28~ynh1 ## Documentación e recursos - Web oficial da app: diff --git a/README_zh_Hans.md b/README_zh_Hans.md index b501648..de2191a 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -5,7 +5,7 @@ # YunoHost 上的 Framagames -[![集成程度](https://dash.yunohost.org/integration/framagames.svg)](https://dash.yunohost.org/appci/app/framagames) ![工作状态](https://ci-apps.yunohost.org/ci/badges/framagames.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/framagames.maintain.svg) +[![集成程度](https://dash.yunohost.org/integration/framagames.svg)](https://ci-apps.yunohost.org/ci/apps/framagames/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/framagames.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/framagames.maintain.svg) [![使用 YunoHost 安装 Framagames](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=framagames) @@ -18,7 +18,7 @@ Set of games Framagames from Framasoft. -**分发版本:** 1.0~ynh5 +**分发版本:** 2022.12.28~ynh1 ## 文档与资源 - 官方应用网站: diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf deleted file mode 100644 index 700c37c..0000000 --- a/conf/extra_php-fpm.conf +++ /dev/null @@ -1,4 +0,0 @@ -; Additional php.ini defines, specific to this pool of workers. - -php_admin_value[upload_max_filesize] = 50M -php_admin_value[post_max_size] = 50M diff --git a/conf/nginx.conf b/conf/nginx.conf index 74155b1..b746c20 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,24 +2,9 @@ location __PATH__/ { # Path to source - alias __INSTALL_DIR__/; + alias __INSTALL_DIR__/www/; - index index.php index.html; - - # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file - client_max_body_size 10G; - - try_files $uri $uri/ index.php; - location ~ [^/]\.php(/|$) { - fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; - - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param REMOTE_USER $remote_user; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param SCRIPT_FILENAME $request_filename; - } + index index.html; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; diff --git a/manifest.toml b/manifest.toml index bb5ee91..7ddd6c6 100644 --- a/manifest.toml +++ b/manifest.toml @@ -1,3 +1,5 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json + packaging_format = 2 id = "framagames" @@ -5,7 +7,7 @@ name = "Framagames" description.en = "Set of games Framagames from Framasoft" description.fr = "Ensemble de jeux Framagames venant de Framasoft" -version = "1.0~ynh5" +version = "2022.12.28~ynh1" maintainers = [] @@ -38,11 +40,11 @@ ram.runtime = "50M" [resources] - [resources.sources.main] + [resources.sources.main] + url = "https://framagit.org/framasoft/framagames/-/archive/5510754d92e9649aa1808ffb1d3255d5da1ebf47/framagames-5510754d92e9649aa1808ffb1d3255d5da1ebf47.tar.bz2" + sha256 = "3a58583fd0e7a7b81d4b2db0ff04a588eb0a04c574f0f36d681a2969e6648e9d" - url = "https://framagit.org/framasoft/framagames/-/archive/6808f75cd18f4a1bb0345ce65d055e2dfef8c0b7/framagames-6808f75cd18f4a1bb0345ce65d055e2dfef8c0b7.tar.gz" - sha256 = "6c2bf60663dad46ac6660ddb3634d1c05dcf38cea1f2687b8ee26743deb8a10e" - autoupdate.strategy = "latest_gitlab_commit" + autoupdate.strategy = "latest_gitlab_commit" [resources.system_user] @@ -50,6 +52,3 @@ ram.runtime = "50M" [resources.permissions] main.url = "/" - - [resources.apt] - packages = "php8.2-fpm" diff --git a/scripts/_common.sh b/scripts/_common.sh index 944a65e..2f20db9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,10 +4,43 @@ # COMMON VARIABLES #================================================= +nodejs_version=12 + #================================================= # PERSONAL HELPERS #================================================= +_configure_framagames() { + ynh_replace_string --target_file="$install_dir/sources/src/data/main.yml" \ + --match_string="canonical: .*" \ + --replace_string="canonical: https://$domain$path" + + ynh_replace_string --target_file="$install_dir/sources/src/data/main.yml" \ + --match_string="framanav: true" \ + --replace_string="framanav: false" + + # %/ is here to prevent double slash when path is / + ynh_replace_string --target_file="$install_dir/sources/config/env.js" \ + --match_string=" basepath:.*" \ + --replace_string=" basepath: '${path%/}/', wrong_path: false" +} + +_build_install_framagames() { + pushd "$install_dir/sources" + ynh_use_nodejs + ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" "$ynh_npm" run commons + ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" "$ynh_npm" run prod + popd + + ynh_secure_remove --file="$install_dir/www" + mv -f "$install_dir/sources/dist" "$install_dir/www" + cp -r "$install_dir/sources/games/"* "$install_dir/www" + if [[ "$path" != "/" ]]; then + mv -f "$install_dir/www/$path/"* "$install_dir/www" + fi + chown -R "$app:www-data" "$install_dir" +} + #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index be44aee..342aced 100755 --- a/scripts/backup +++ b/scripts/backup @@ -25,12 +25,6 @@ ynh_backup --src_path="$install_dir" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP THE PHP-FPM CONFIGURATION -#================================================= - -ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/change_url b/scripts/change_url index 6dd5830..6348524 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -14,6 +14,20 @@ ynh_script_progression --message="Updating NGINX web server configuration..." ynh_change_url_nginx_config +#================================================= +# CONFIGURE APP +#================================================= +ynh_script_progression --message="Configuring $app..." + +_configure_framagames + +#================================================= +# BUILD APP +#================================================= +ynh_script_progression --message="Building $app..." + +_build_install_framagames + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index 424ae04..6089329 100644 --- a/scripts/install +++ b/scripts/install @@ -7,25 +7,43 @@ source _common.sh source /usr/share/yunohost/helpers +#================================================= +# INSTALL NODEJS +#================================================= +ynh_script_progression --message="Installing NodeJS..." --weight=1 + +ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir" +ynh_setup_source --dest_dir="$install_dir/sources" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= -# PHP-FPM CONFIGURATION +# CONFIGURE APP +#================================================= +ynh_script_progression --message="Configuring $app..." + +_configure_framagames + +#================================================= +# BUILD APP +#================================================= +ynh_script_progression --message="Building $app..." + +_build_install_framagames + +#================================================= +# SYSTEM CONFIGURATION #================================================= ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 -# Create a dedicated PHP-FPM config -ynh_add_fpm_config - # Create a dedicated NGINX config ynh_add_nginx_config diff --git a/scripts/remove b/scripts/remove index 52b7893..1ff8aa3 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,11 +12,9 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 -# Remove the dedicated NGINX config ynh_remove_nginx_config -# Remove the dedicated PHP-FPM config -ynh_remove_fpm_config +ynh_remove_nodejs #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 998f2e0..7016c53 100755 --- a/scripts/restore +++ b/scripts/restore @@ -8,6 +8,13 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers +#================================================= +# INSTALL NODEJS +#================================================= +ynh_script_progression --message="Restoring NodeJS..." --weight=1 + +ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version" + #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -16,15 +23,13 @@ ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= @@ -32,7 +37,6 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." -ynh_systemd_action --service_name="php$phpversion-fpm" --action=reload ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 465b62e..3430951 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,24 +7,42 @@ source _common.sh source /usr/share/yunohost/helpers +#================================================= +# INSTALL NODEJS +#================================================= +ynh_script_progression --message="Updating NodeJS..." --weight=1 + +ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir" --full_replace=1 +ynh_setup_source --dest_dir="$install_dir/sources" --full_replace=1 chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= -# REAPPLY SYSTEM CONFIGURATIONS +# CONFIGURE APP #================================================= -ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 +ynh_script_progression --message="Configuring $app..." -# Create a dedicated PHP-FPM config -ynh_add_fpm_config +_configure_framagames + +#================================================= +# BUILD APP +#================================================= +ynh_script_progression --message="Building $app..." + +_build_install_framagames + +#================================================= +# SYSTEM CONFIGURATION +#================================================= +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config