summaryrefslogtreecommitdiff
path: root/install/ishtar-prepare-instance
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-01-16 20:09:34 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-01-16 20:09:34 +0100
commit12f422fd95e3b5d6228f220c67ae2a203898007c (patch)
tree75b2bf05b5896ce960165a28b9b23b4f18a593c0 /install/ishtar-prepare-instance
parent696671dea6b284eea36affd473d9f036de4db71f (diff)
downloadIshtar-12f422fd95e3b5d6228f220c67ae2a203898007c.tar.bz2
Ishtar-12f422fd95e3b5d6228f220c67ae2a203898007c.zip
Indication of the maximum file size in help for file fields
Diffstat (limited to 'install/ishtar-prepare-instance')
-rwxr-xr-xinstall/ishtar-prepare-instance27
1 files changed, 27 insertions, 0 deletions
diff --git a/install/ishtar-prepare-instance b/install/ishtar-prepare-instance
index d9467247b..fec08b119 100755
--- a/install/ishtar-prepare-instance
+++ b/install/ishtar-prepare-instance
@@ -134,6 +134,31 @@ EOF
done
fi
+ if [ ! -z '$MAX_UPLOAD_SIZE' ]; then
+ MAX_UPLOAD_SIZE=''
+ cat >&2 <<-'EOF'
+
+-------------------------------------------------------------------------------
+ A maximum size for file upload is set. By default, the limit is set to 100
+ Mo. Consider raising or lowering this value to fit to your needs.
+ Note: to change this value after the installation change client_max_body_size
+ it in the nginx configuration file and MAX_UPLOAD_SIZE in local_settings.
+
+EOF
+ re_number='^[0-9]+$'
+ while ! [[ "$MAX_UPLOAD_SIZE" =~ $re_number ]]
+ do
+ cecho y "* Max upload size in Mo (default: 100)? "
+ read choice
+ MAX_UPLOAD_SIZE=$choice
+ if [ "$MAX_UPLOAD_SIZE" == '' ]; then
+ MAX_UPLOAD_SIZE=100
+ fi
+ done
+ fi
+
+
+
DEST=$ISHTAR_PATH
cat >&2 <<-'EOF'
@@ -242,6 +267,7 @@ EOF
s|#DB_NAME#|$DB_NAME|g;\
s|#DB_PORT#|$DB_PORT|g;\
s|#DB_PASSWORD#|$DB_PASSWORD|g;\
+ s|#MAX_UPLOAD_SIZE#|$MAX_UPLOAD_SIZE|g;\
s|#URL#|$URL|g;\
s|#APP_DIR#|$APP_DIR|g;\
s|#SECRET_KEY#|$SECRET_KEY|g;" \
@@ -272,6 +298,7 @@ EOF
s|#UWSGI_PORT#|$UWSGI_PORT|g;\
s|#NGINX_PORT#|$NGINX_PORT|g;\
s|#INSTALL_PATH#|$INSTALL_PATH|g;\
+ s|#MAX_UPLOAD_SIZE#|$MAX_UPLOAD_SIZE|g;\
s|#URL#|$URL|g;" \
"install/nginx.conf.template" > \
"$INSTANCE/nginx.conf"