Skip to content

Commit

Permalink
Purposal for fix on issue 6251 - max upload filesize (#7930)
Browse files Browse the repository at this point in the history
* Added a check and sed to startup.sh for managing max upload size inside the docker container. Issue encountered in 6251

* Changed startup.sh to bash instead of sh to have better variable control. Changed single ticks to double ticks for the sed so that the variable PHP_UPLOAD_LIMIT is expanded
  • Loading branch information
joshi-redbridge committed Apr 1, 2020
1 parent 6066c24 commit b14f37d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docker/startup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

# fix key if needed
if [ -z "$APP_KEY" ]
Expand Down Expand Up @@ -41,6 +41,14 @@ chown -R docker:root /var/lib/snipeit/data/*
chown -R docker:root /var/lib/snipeit/dumps
chown -R docker:root /var/lib/snipeit/keys

# Fix php settings
if [ -v "PHP_UPLOAD_LIMIT" ]
then
echo "Changing upload limit to ${PHP_UPLOAD_LIMIT}"
sed -i "s/^upload_max_filesize.*/upload_max_filesize = ${PHP_UPLOAD_LIMIT}M/" /etc/php/*/apache2/php.ini
fi


# If the Oauth DB files are not present copy the vendor files over to the db migrations
if [ ! -f "/var/www/html/database/migrations/*create_oauth*" ]
then
Expand Down

0 comments on commit b14f37d

Please sign in to comment.