Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3748984
D258.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
777 B
Referenced Files
None
Subscribers
None
D258.diff
View Options
diff --git a/files/usr/local/bin/setup-container b/files/usr/local/bin/setup-container
--- a/files/usr/local/bin/setup-container
+++ b/files/usr/local/bin/setup-container
@@ -2,8 +2,32 @@
pushd /var/wwwroot/default
+# Generates a unique application key in .env
+function generate_key {
+ KEY=`php artisan key:generate --show`
+ echo "" >> .env
+ echo "APP_KEY=$KEY" >> .env
+}
+
+# Determines if APP_KEY is missing
+function is_app_key_missing {
+ if [ -v APP_KEY ]; then
+ return 0
+ fi
+
+ if [ ! -f .env ]; then
+ return 1
+ fi
+
+ grep -q 'APP_KEY=' .env
+ return $?
+}
+
if [ -z "$NO_INSTALL" ]; then
- php artisan key:generate
+ is_app_key_missing
+ if [ $? -eq 1 ]; then
+ generate_key
+ fi
php artisan config:cache
chown app:app /var/wwwroot/default
fi
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 11:49 (13 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2246839
Default Alt Text
D258.diff (777 B)
Attached To
Mode
D258: Ensure APP_KEY is defined
Attached
Detach File
Event Timeline
Log In to Comment