mirror of
https://github.com/linuxserver/docker-lychee.git
synced 2026-02-05 02:49:08 +08:00
Require DB_CONNECTION to be set
This commit is contained in:
parent
17c1b1dccd
commit
3caa48cda3
@ -25,6 +25,6 @@ repo_vars:
|
||||
- CI_PORT='80'
|
||||
- CI_SSL='false'
|
||||
- CI_DELAY='120'
|
||||
- CI_DOCKERENV='TZ=US/Pacific'
|
||||
- CI_DOCKERENV='TZ=Europe/London|DB_CONNECTION=sqlite'
|
||||
- CI_AUTH='user:password'
|
||||
- CI_WEBPATH=''
|
||||
|
||||
@ -26,7 +26,7 @@ param_ports:
|
||||
- { external_port: "80", internal_port: "80", port_desc: "http gui" }
|
||||
param_usage_include_env: true
|
||||
param_env_vars:
|
||||
- { env_var: "DB_CONNECTION", env_value: "sqlite", desc: "DB type, from `sqlite`, `mysql`, `pqsql`." }
|
||||
- { env_var: "DB_CONNECTION", env_value: "", desc: "DB type, from `sqlite`, `mysql`, `pqsql`." }
|
||||
- { env_var: "DB_HOST", env_value: "", desc: "DB server hostname. For `mysql` and `pgsql` only." }
|
||||
- { env_var: "DB_PORT", env_value: "", desc: "DB server port. For `mysql` and `pgsql` only." }
|
||||
- { env_var: "DB_USERNAME", env_value: "", desc: "DB user. For `mysql` and `pgsql` only." }
|
||||
|
||||
@ -34,7 +34,10 @@ ln -s /config/user.ini /etc/php82/conf.d/99-user.ini
|
||||
|
||||
cd /app/www || exit 1
|
||||
|
||||
if [[ "${DB_CONNECTION}" = "sqlite" ]] || [[ -z "${DB_CONNECTION}" ]]; then
|
||||
if [[ -z "${DB_CONNECTION}" ]]; then
|
||||
echo "**** No DB_CONNECTION configured, halting init ****"
|
||||
sleep infinity
|
||||
elif [[ "${DB_CONNECTION}" = "sqlite" ]]; then
|
||||
if [[ -n "${DB_DATABASE}" ]]; then
|
||||
if [[ ! -e "${DB_DATABASE}" ]]; then
|
||||
touch "${DB_DATABASE}"
|
||||
@ -43,6 +46,7 @@ if [[ "${DB_CONNECTION}" = "sqlite" ]] || [[ -z "${DB_CONNECTION}" ]]; then
|
||||
lsiown abc:abc "${DB_DATABASE}"
|
||||
else
|
||||
DB_DATABASE="/config/database.sqlite"
|
||||
export DB_DATABASE
|
||||
printf "/config/database.sqlite" > /var/run/s6/container_environment/DB_DATABASE
|
||||
fi
|
||||
elif [[ "${DB_CONNECTION}" = "mysql" ]]; then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user