From 68174b3f32c3b31940da0e84ad447adbc12c7dc1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 29 Jan 2021 12:04:15 +0100 Subject: [PATCH 1/5] Fix --- conf/nginx.conf | 11 +++++------ manifest.json | 4 ++-- scripts/install | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index b346212..1ca4c76 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -10,10 +10,9 @@ location __PATH__/ { } index index.php; - #try_files $uri $uri/ @bookstack; - - try_files $uri $uri/ /index.php?$query_string; + try_files $uri $uri/ @bookstack; + #try_files $uri $uri/ index.php; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; @@ -28,6 +27,6 @@ location __PATH__/ { include conf.d/yunohost_panel.conf.inc; } -#location @bookstack { -# rewrite ^__PATH__/(.*)$ __PATH__/index.php?/$1 last; -#} +location @bookstack { + rewrite ^__PATH__/(.*)$ __PATH__/index.php?/$1 last; +} diff --git a/manifest.json b/manifest.json index 6d1ea0f..e53fc31 100644 --- a/manifest.json +++ b/manifest.json @@ -39,8 +39,8 @@ "en": "Choose a path for BookStack", "fr": "Choisissez un chemin pour BookStack" }, - "example": "/", - "default": "/" + "example": "/bookstack", + "default": "/bookstack" }, { "name": "language", diff --git a/scripts/install b/scripts/install index 834e304..2e12774 100644 --- a/scripts/install +++ b/scripts/install @@ -21,7 +21,7 @@ ynh_abort_if_errors # Retrieve arguments domain=$YNH_APP_ARG_DOMAIN -path_url="/" +path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE From 974f33b8b4a015c256f5536632231c6a67bac75a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 29 Jan 2021 12:05:02 +0100 Subject: [PATCH 2/5] Update .env.example --- conf/.env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/.env.example b/conf/.env.example index 1a6fcd9..98e8f24 100644 --- a/conf/.env.example +++ b/conf/.env.example @@ -18,7 +18,7 @@ APP_KEY=SomeRandomString # If you change this in the future you may need to run a command # to update stored URLs in the database. Command example: # php artisan bookstack:update-url https://old.example.com https://new.example.com -#APP_URL=https://__DOMAIN____PATH__ +APP_URL=https://__DOMAIN____PATH__ # Application default language # The default language choice to show. From 94afc89301333994ada52f87fc806f2d1b1ea841 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 29 Jan 2021 12:23:18 +0100 Subject: [PATCH 3/5] Fix --- check_process | 2 +- scripts/upgrade | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/check_process b/check_process index 4f8440e..a75cdc3 100644 --- a/check_process +++ b/check_process @@ -6,7 +6,7 @@ ;; Test complet ; Manifest domain="domain.tld" (DOMAIN) - path="/" (PATH) + path="/path" (PATH) language="fr" is_public=1 (PUBLIC|public=1|private=0) ; Checks diff --git a/scripts/upgrade b/scripts/upgrade index 364bb79..5fc46a6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -95,6 +95,24 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config --package="$extra_php_dependencies" +#================================================= +# INSTALL AND INITIALIZE COMPOSER +#================================================= +ynh_script_progression --message="Installing Composer..." --weight=10 + +# Install Composer +ynh_install_composer --phpversion=$phpversion --workdir=$final_path --install_args="--no-dev" + +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_script_progression --message="Upgrading source files..." --weight=4 + pushd $final_path + php$phpversion artisan migrate + php$phpversion artisan cache:clear + php$phpversion artisan view:clear + popd +fi + #================================================= # GENERIC FINALIZATION #================================================= From c425ee9bf532243b66ba77bc5eb9374ef5360292 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 29 Jan 2021 12:52:54 +0100 Subject: [PATCH 4/5] Fix --- conf/.env.example | 4 ++-- conf/nginx.conf | 3 +++ manifest.json | 2 +- scripts/install | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/conf/.env.example b/conf/.env.example index 98e8f24..56fff24 100644 --- a/conf/.env.example +++ b/conf/.env.example @@ -49,7 +49,7 @@ MAIL_PASSWORD=null MAIL_ENCRYPTION=null # General auth -AUTH_METHOD=ldap +AUTH_METHOD=standard # The LDAP host, Adding a port is optional LDAP_SERVER=ldap://127.0.0.1:389 @@ -68,7 +68,7 @@ LDAP_PASS=false # The user-provided user-name used to replace any occurrences of '${user}' # If you're setting this option via other means, such as within a docker-compose.yml, # you may need escape the $, often using $$ or \$ instead. -LDAP_USER_FILTER=(&(uid=${user})) +LDAP_USER_FILTER=(&(|(objectclass=posixAccount))(uid={{username}})(permission=cn=__APP__.main,ou=permission,dc=yunohost,dc=org)) # Set the LDAP version to use when connecting to the server LDAP_VERSION=false diff --git a/conf/nginx.conf b/conf/nginx.conf index 1ca4c76..62b5830 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -9,6 +9,9 @@ location __PATH__/ { rewrite ^ https://$server_name$request_uri? permanent; } + client_max_body_size 100m; + client_body_timeout 120s; # Default is 60, May need to be increased for very large uploads + index index.php; try_files $uri $uri/ @bookstack; diff --git a/manifest.json b/manifest.json index e53fc31..e7a08f8 100644 --- a/manifest.json +++ b/manifest.json @@ -49,7 +49,7 @@ "en": "Choose the application language", "fr": "Choisissez la langue de l'application" }, - "choices": ["de", "en", "es", "fr", "it", "pt"], + "choices": ["de", "en", "es", "fr", "it", "nl"], "default": "en" }, { diff --git a/scripts/install b/scripts/install index 2e12774..4513d53 100644 --- a/scripts/install +++ b/scripts/install @@ -109,6 +109,7 @@ ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --targ ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/.env" ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$final_path/.env" ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/.env" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/.env" ynh_store_file_checksum $final_path/.env From 8f458f46ef9ca188b3b99e3821739bdad2b0bae9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 29 Jan 2021 13:01:31 +0100 Subject: [PATCH 5/5] Update php-fpm.conf --- conf/php-fpm.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index ab1a471..085132b 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -419,12 +419,12 @@ chdir = __FINALPATH__ ;php_admin_value[memory_limit] = 32M ; Common values to change to increase file upload limit -; php_admin_value[upload_max_filesize] = 50M -; php_admin_value[post_max_size] = 50M +php_admin_value[upload_max_filesize] = 50M +php_admin_value[post_max_size] = 50M ; php_admin_flag[mail.add_x_header] = Off ; Other common parameters ; php_admin_value[max_execution_time] = 600 ; php_admin_value[max_input_time] = 300 -; php_admin_value[memory_limit] = 256M +php_admin_value[memory_limit] = 256M ; php_admin_flag[short_open_tag] = On