Simplify EzServer menu and serve original Web Console
This commit is contained in:
1 parent
ee7e18490f
commit
d748f7cc69
16 files changed
+290
-245
No files matched your search
@@ -54,6 +54,32 @@ foreach (["intl", "mbstring", "session", "pdo_sqlite"] as $extension) {
|
||||
}
|
||||
}
|
||||
'
|
||||
if [[ -n "${EZSERVER_SQLITE:-}" ]]; then
|
||||
if [[ "$EZSERVER_SQLITE" != /* || "${EZSERVER_JWT_KEY_FILE:-}" != /* ||
|
||||
! -f "$EZSERVER_JWT_KEY_FILE" || ! -r "$EZSERVER_JWT_KEY_FILE" ]]; then
|
||||
printf '%s\n' 'Set EZSERVER_SQLITE and EZSERVER_JWT_KEY_FILE to absolute paths.' >&2
|
||||
exit 1
|
||||
fi
|
||||
cp "$EZSERVER_JWT_KEY_FILE" "$stage/jwt-key"
|
||||
chmod 600 "$stage/jwt-key"
|
||||
export EZSERVER_JWT_KEY_FILE="$stage/jwt-key"
|
||||
"$php" -r '
|
||||
if (strlen(trim(file_get_contents($argv[1]))) < 32) {
|
||||
fwrite(STDERR, "The JWT signing key must contain at least 32 bytes." . PHP_EOL);
|
||||
exit(1);
|
||||
}
|
||||
' "$EZSERVER_JWT_KEY_FILE"
|
||||
"$php" "$server_dir/init-sqlite.php" "$EZSERVER_SQLITE"
|
||||
cp -R "$EZSERVER_RUNTIME" "$stage/runtime"
|
||||
export EZSERVER_RUNTIME="$stage/runtime"
|
||||
config="$EZSERVER_RUNTIME/www/ezwebserver/src/application/config/production"
|
||||
mkdir -p "$config"
|
||||
cp "$server_dir/sqlite-database.php" "$config/database.php"
|
||||
cp "$server_dir/sqlite-rest.php" "$config/rest.php"
|
||||
fi
|
||||
if [[ -f "$EZSERVER_RUNTIME/webconsole/index.html" ]]; then
|
||||
ln -s "$EZSERVER_RUNTIME/webconsole" "$stage/webconsole"
|
||||
fi
|
||||
"$nginx" -e stderr -p "$stage/" -c nginx.conf -t
|
||||
"$fpm" -F -y "$stage/php-fpm.conf" &
|
||||
fpm_pid=$!
|
||||
|
||||
Reference in new issue
Block a user