|
@@ -1,5 +1,22 @@
|
|
|
-set -ex
|
|
|
+set -e
|
|
|
|
|
|
+# WORKAROUND for koel:init crashing with
|
|
|
+# > In EncryptionServiceProvider.php line 42:
|
|
|
+# > No application encryption key has been specified.
|
|
|
+# 'php artisan key:generate' crashes the same way.
|
|
|
+APP_KEY_PATH=/etc/koel-app-key
|
|
|
+if [ ! -f $APP_KEY_PATH ]; then
|
|
|
+ tr -dc '0-9a-zA-Z' </dev/urandom \
|
|
|
+ | head -c32 >$APP_KEY_PATH
|
|
|
+ chmod u=rw,g=,o= $APP_KEY_PATH
|
|
|
+ echo generated random APP_KEY
|
|
|
+fi
|
|
|
+export APP_KEY="$(cat $APP_KEY_PATH)"
|
|
|
+
|
|
|
+set -x
|
|
|
+
|
|
|
+# TODO run non-interactively
|
|
|
+# TODO do not run yarn install (part of build)
|
|
|
php artisan koel:init
|
|
|
|
|
|
# TODO use apache or nginx https://koel.phanan.net/docs/#/?id=manually
|