From ce65657e01e48baef66239fffd235eacd3413189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 29 Jan 2023 15:32:43 +0100 Subject: [PATCH 01/12] Create .env --- conf/.env | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 conf/.env diff --git a/conf/.env b/conf/.env new file mode 100644 index 0000000..102473d --- /dev/null +++ b/conf/.env @@ -0,0 +1,3 @@ +APP_ENV=prod +APP_SECRET=__KEY__ +DEFAULT_REPOSITORY_DIR=__DATADIR__ \ No newline at end of file From cbb883497ce99e6cb7bf8526117b0c66067c4529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 29 Jan 2023 15:35:34 +0100 Subject: [PATCH 02/12] Update install --- scripts/install | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index df18f41..abef65c 100755 --- a/scripts/install +++ b/scripts/install @@ -27,6 +27,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC +key=$(ynh_string_random --length=32) app=$YNH_APP_INSTANCE_NAME @@ -120,10 +121,10 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="../conf/config.yml" --destination="$final_path/config/config.yml" +ynh_add_config --template="../conf/.env" --destination="$final_path/.env" -chmod 400 "$final_path/config/config.yml" -chown $app:$app "$final_path/config/config.yml" +chmod 400 "$final_path/.env" +chown $app:$app "$final_path/.env" #================================================= # SETUP SSOWAT From 4aace345043e7385a883ade7b6aa075d9ae2480a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 29 Jan 2023 15:37:17 +0100 Subject: [PATCH 03/12] Update .env --- conf/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/.env b/conf/.env index 102473d..5e401ea 100644 --- a/conf/.env +++ b/conf/.env @@ -1,3 +1,3 @@ -APP_ENV=prod +APP_ENV=production APP_SECRET=__KEY__ DEFAULT_REPOSITORY_DIR=__DATADIR__ \ No newline at end of file From 15dbdc80f39b06ae4faf8c23264c63692b693a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 29 Jan 2023 15:37:49 +0100 Subject: [PATCH 04/12] Update .env --- conf/.env | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/.env b/conf/.env index 5e401ea..194250a 100644 --- a/conf/.env +++ b/conf/.env @@ -1,3 +1,2 @@ -APP_ENV=production APP_SECRET=__KEY__ DEFAULT_REPOSITORY_DIR=__DATADIR__ \ No newline at end of file From 77d274ca28f77b3dee30770f736ea2506575e19a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 29 Jan 2023 15:50:55 +0100 Subject: [PATCH 05/12] Fix --- conf/.env | 1 - conf/config.yml | 2 +- scripts/install | 5 ++++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/conf/.env b/conf/.env index 194250a..3f10289 100644 --- a/conf/.env +++ b/conf/.env @@ -1,2 +1 @@ APP_SECRET=__KEY__ -DEFAULT_REPOSITORY_DIR=__DATADIR__ \ No newline at end of file diff --git a/conf/config.yml b/conf/config.yml index 60e30e4..e977403 100644 --- a/conf/config.yml +++ b/conf/config.yml @@ -1,7 +1,7 @@ # GitList configuration parameters: # Web application title - title: GitList + title: YunoHost # Locale configuration locale: en diff --git a/scripts/install b/scripts/install index abef65c..9cb5f43 100755 --- a/scripts/install +++ b/scripts/install @@ -121,10 +121,13 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_add_config --template="../conf/config.yml" --destination="$final_path/config/config.yml" ynh_add_config --template="../conf/.env" --destination="$final_path/.env" -chmod 400 "$final_path/.env" +chmod 650 "$final_path/.env" chown $app:$app "$final_path/.env" +chmod 650 "$final_path/config/config.yml" +chown $app:$app "$final_path/config/config.yml" #================================================= # SETUP SSOWAT From 2d731bf8cc793f2f89fe5cf0d26e7fb13b8a9714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 29 Jan 2023 15:59:27 +0100 Subject: [PATCH 06/12] Update install --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 9cb5f43..790d938 100755 --- a/scripts/install +++ b/scripts/install @@ -122,10 +122,10 @@ ynh_add_nginx_config ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template="../conf/config.yml" --destination="$final_path/config/config.yml" -ynh_add_config --template="../conf/.env" --destination="$final_path/.env" +ynh_add_config --template="../conf/.env" --destination="$final_path/public/.env" -chmod 650 "$final_path/.env" -chown $app:$app "$final_path/.env" +chmod 650 "$final_path/public/.env.env" +chown $app:$app "$final_path/public/.env.env" chmod 650 "$final_path/config/config.yml" chown $app:$app "$final_path/config/config.yml" From c84973d9493477bed4adeb95cb7d9b8859332859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 29 Jan 2023 16:01:16 +0100 Subject: [PATCH 07/12] Update install --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 790d938..b516cc1 100755 --- a/scripts/install +++ b/scripts/install @@ -124,8 +124,8 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template="../conf/config.yml" --destination="$final_path/config/config.yml" ynh_add_config --template="../conf/.env" --destination="$final_path/public/.env" -chmod 650 "$final_path/public/.env.env" -chown $app:$app "$final_path/public/.env.env" +chmod 650 "$final_path/public/.env" +chown $app:$app "$final_path/public/.env" chmod 650 "$final_path/config/config.yml" chown $app:$app "$final_path/config/config.yml" From 02493e8051056865bb52896e8c776819c2701c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 29 Jan 2023 17:18:54 +0100 Subject: [PATCH 08/12] Fix --- conf/nginx.conf | 8 +++++++- scripts/install | 5 +---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index e8d8e6d..53e4bf2 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -9,7 +9,7 @@ location __PATH__/ { # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file client_max_body_size 256M; - try_files $uri $uri/ __PATH__/index.php; + try_files $uri __PATH__/index.php$is_args$args; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; @@ -22,6 +22,12 @@ location __PATH__/ { fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^[^(\.php)]+\.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js)$ { + access_log off; + expires 1h; + add_header Cache-Control public; + } + # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } diff --git a/scripts/install b/scripts/install index b516cc1..b96bd1d 100755 --- a/scripts/install +++ b/scripts/install @@ -27,7 +27,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC -key=$(ynh_string_random --length=32) +#key=$(ynh_string_random --length=32) app=$YNH_APP_INSTANCE_NAME @@ -122,10 +122,7 @@ ynh_add_nginx_config ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template="../conf/config.yml" --destination="$final_path/config/config.yml" -ynh_add_config --template="../conf/.env" --destination="$final_path/public/.env" -chmod 650 "$final_path/public/.env" -chown $app:$app "$final_path/public/.env" chmod 650 "$final_path/config/config.yml" chown $app:$app "$final_path/config/config.yml" From 981fca34a4296ff2fce474e37bfdf73e6e091e9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 29 Jan 2023 17:20:54 +0100 Subject: [PATCH 09/12] Update nginx.conf --- conf/nginx.conf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 53e4bf2..9b35a60 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -11,7 +11,7 @@ location __PATH__/ { try_files $uri __PATH__/index.php$is_args$args; - location ~ [^/]\.php(/|$) { + location ~ ^/index\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; @@ -19,7 +19,8 @@ location __PATH__/ { include fastcgi_params; fastcgi_param REMOTE_USER $remote_user; fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param SCRIPT_FILENAME $request_filename; + fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; + fastcgi_param DOCUMENT_ROOT $realpath_root; } location ~* ^[^(\.php)]+\.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js)$ { From f6b4eb12adeb5efab10465878cfdec79b84efcc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 30 Jan 2023 12:11:49 +0100 Subject: [PATCH 10/12] Fix linter --- manifest.json | 4 ++-- scripts/restore | 4 ++-- scripts/upgrade | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/manifest.json b/manifest.json index c7971e2..a554084 100644 --- a/manifest.json +++ b/manifest.json @@ -9,12 +9,12 @@ "version": "2.0.0~ynh1", "url": "https://gitlist.org/", "upstream": { - "license": "BSD 3-Clause", + "license": "BSD-3-Clause", "website": "https://gitlist.org/", "admindoc": "https://github.com/klaussilveira/gitlist/wiki", "code": "https://github.com/klaussilveira/gitlist" }, - "license": "BSD 3-Clause", + "license": "BSD-3-Clause", "maintainer": { "name": "eric_G", "email": "" diff --git a/scripts/restore b/scripts/restore index 96ba913..572a4ea 100755 --- a/scripts/restore +++ b/scripts/restore @@ -92,7 +92,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." --time --weight=1 +ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" @@ -102,7 +102,7 @@ ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$p #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" diff --git a/scripts/upgrade b/scripts/upgrade index f7ba3d8..515c1c4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -117,7 +117,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config From cc6dff98c4012b977e544edf5b631ad6a78c60f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 30 Jan 2023 12:14:25 +0100 Subject: [PATCH 11/12] Update nginx.conf --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 9b35a60..c9f262c 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -26,7 +26,7 @@ location __PATH__/ { location ~* ^[^(\.php)]+\.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js)$ { access_log off; expires 1h; - add_header Cache-Control public; + more_set_headers "Cache-Control: public"; } # Include SSOWAT user panel. From 7930de662dd97c15c1a76625ae5a98d4f5a4552c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 30 Jan 2023 12:16:28 +0100 Subject: [PATCH 12/12] Update config.yml --- conf/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/config.yml b/conf/config.yml index e977403..60e30e4 100644 --- a/conf/config.yml +++ b/conf/config.yml @@ -1,7 +1,7 @@ # GitList configuration parameters: # Web application title - title: YunoHost + title: GitList # Locale configuration locale: en