add back first run info to be able to set MAX_UPLOAD in config

This commit is contained in:
sparklyballs 2017-05-02 16:23:06 +01:00
parent 7528fe4a94
commit 73a3e30b01
3 changed files with 21 additions and 10 deletions

View File

@ -62,6 +62,7 @@ RUN \
/tmp/ProjectSend.tar.gz --strip-components=1 -C /var/www/localhost/htdocs/ && \
mv /var/www/localhost/htdocs/upload /defaults/ && \
mv /var/www/localhost/htdocs/img/custom /defaults/ && \
mv /var/www/localhost/htdocs/includes/sys.config.sample.php /defaults/sys.config.php && \
# cleanup
rm -rf \

View File

@ -64,6 +64,7 @@ In this instance `PUID=1001` and `PGID=1001`. To find yours use `id user` as bel
## Setting up the application
Requires a user and database in either mssql, mysql or mariadb.
On first run go to `<your-ip>/install/make-config.php` and enter your database details.
More info at [ProjectSend][appurl].
## Info

View File

@ -1,24 +1,33 @@
#!/usr/bin/with-contenv bash
# set default values for variables
PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT:-512M}
MAX_UPLOAD=${MAX_UPLOAD:-250M}
MAX_UPLOAD=${MAX_UPLOAD:-5120000}
PHP_MAX_FILE_UPLOAD=${PHP_MAX_FILE_UPLOAD:-200}
# configure php
sed -i \
-e "s|;*memory_limit =.*|memory_limit = ${PHP_MEMORY_LIMIT}|i" \
-e "s|;*upload_max_filesize =.*|upload_max_filesize = ${MAX_UPLOAD}|i" \
-e "s|;*max_file_uploads =.*|max_file_uploads = ${PHP_MAX_FILE_UPLOAD}|i" \
-e "s|;*post_max_size =.*|post_max_size = ${MAX_UPLOAD}|i" \
-e "s|;*cgi.fix_pathinfo=.*|cgi.fix_pathinfo= 0|i" \
/etc/php5/php.ini
# create our folders
mkdir -p \
/config/projectsend/images \
/data/projectsend \
/var/run/apache2
# configure php
sed -i \
-e "s#;*memory_limit =.*#memory_limit = ${PHP_MEMORY_LIMIT}#i" \
-e "s#;*upload_max_filesize =.*#upload_max_filesize = ${MAX_UPLOAD}#i" \
-e "s#;*max_file_uploads =.*#max_file_uploads = ${PHP_MAX_FILE_UPLOAD}#i" \
-e "s#;*post_max_size =.*#post_max_size = ${MAX_UPLOAD}#i" \
-e "s#;*cgi.fix_pathinfo=.*#cgi.fix_pathinfo= 0#i" \
/etc/php5/php.ini
# configure projectsend
[[ ! -e /config/projectsend/sys.config.php ]] && \
cp /defaults/sys.config.php /config/projectsend/sys.config.php
sed -i \
"s#define('MAX_FILESIZE',.*);#define('MAX_FILESIZE',$MAX_UPLOAD);#g" \
/config/projectsend/sys.config.php
# copy config
PREV_DIR=$(pwd)
cd /defaults/upload || exit