修bug,完善功能
This commit is contained in:
1 parent
30364b1c4b
commit
6996e19694
125 files changed
+15343
-3746
No files matched your search
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
# 通过既有引导程序初始化目录,随后以当前非特权用户启动单个服务。
|
||||
case "${1:-server}" in
|
||||
server)
|
||||
if [ "$#" -gt 0 ]; then shift; fi
|
||||
config=${CHUSQL_CONFIG:-/etc/chusql/server.toml}
|
||||
password_file=${CHUSQL_ADMIN_PASSWORD_FILE:-/run/secrets/admin_password}
|
||||
if [ ! -r "$password_file" ]; then
|
||||
echo "Cannot read administrator password file: $password_file" >&2
|
||||
exit 1
|
||||
fi
|
||||
password=$(head -n 1 "$password_file")
|
||||
case "$password" in
|
||||
*[![:space:]]*) ;;
|
||||
*)
|
||||
echo "Administrator password file must start with a non-blank password." >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
printf '%s\n' "$password" | csql-bootstrap --config "$config" \
|
||||
--user "${CHUSQL_ADMIN_USER:-root}" --password-stdin
|
||||
unset password
|
||||
exec chusql-server --config "$config" --user "${CHUSQL_ADMIN_USER:-root}" "$@"
|
||||
;;
|
||||
web)
|
||||
shift
|
||||
exec chusql-web --config "${CHUSQL_CONFIG:-/etc/chusql/web.toml}" \
|
||||
--user "${CHUSQL_ADMIN_USER:-root}" "$@"
|
||||
;;
|
||||
*)
|
||||
exec "$@"
|
||||
;;
|
||||
esac
|
||||
Reference in new issue
Block a user