mirror of
https://github.com/YunoHost-Apps/framagames_ynh.git
synced 2024-09-03 18:36:28 +02:00
Revamp package install
This commit is contained in:
parent
dfba1a711d
commit
ec94cd403d
5 changed files with 36 additions and 34 deletions
|
@ -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
|
|
@ -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;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json
|
||||
|
||||
packaging_format = 2
|
||||
|
||||
id = "framagames"
|
||||
|
@ -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/5510754d92e9649aa1808ffb1d3255d5da1ebf47/framagames-5510754d92e9649aa1808ffb1d3255d5da1ebf47.tar.bz2"
|
||||
sha256 = "3a58583fd0e7a7b81d4b2db0ff04a588eb0a04c574f0f36d681a2969e6648e9d"
|
||||
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"
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
# COMMON VARIABLES
|
||||
#=================================================
|
||||
|
||||
nodejs_version=12
|
||||
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
#=================================================
|
||||
|
|
|
@ -7,25 +7,45 @@
|
|||
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
|
||||
# BUILD APP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Building $app..."
|
||||
|
||||
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
|
||||
|
||||
mv -f "$install_dir/sources/dist" "$install_dir/www"
|
||||
mv -f "$install_dir/sources/games/"* "$install_dir/www"
|
||||
cp "$install_dir/www/fr/index.html" "$install_dir/www/index.html"
|
||||
# cd public && for f in $(find -type l);do cp --remove-destination $(readlink -f $f) $f;done;
|
||||
|
||||
#=================================================
|
||||
# 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
|
||||
|
||||
|
|
Loading…
Reference in a new issue