diff --git a/Dockerfile b/Dockerfile index 423aa9a..597ea1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ diff --git a/READMETEMPLATE.md b/READMETEMPLATE.md index 4cb7841..78c6d79 100644 --- a/READMETEMPLATE.md +++ b/READMETEMPLATE.md @@ -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 `/install/make-config.php` and enter your database details. More info at [ProjectSend][appurl]. ## Info diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config index efe6f1a..17101fc 100644 --- a/root/etc/cont-init.d/30-config +++ b/root/etc/cont-init.d/30-config @@ -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