mirror of
https://github.com/ledgersmb/ledgersmb-docker.git
synced 2025-04-28 10:27:11 -04:00
Take advantage of the ability to have 'ledgersmb.XXX.yaml' config files
This commit is contained in:
parent
59192ffd20
commit
0f7242d559
41
README.md
41
README.md
@ -202,6 +202,47 @@ The following parameters are now supported to set mail preferences:
|
|||||||
|
|
||||||
# Advanced setup
|
# Advanced setup
|
||||||
|
|
||||||
|
## Changing configuration
|
||||||
|
|
||||||
|
The configuration file is stored in /srv/ledgersmb/local/conf/. By mounting
|
||||||
|
that directory using a bind-mount to a location outside the container,
|
||||||
|
configuration can be changed between container starts:
|
||||||
|
|
||||||
|
```plain
|
||||||
|
$ docker run -d -p 5762:5762 --name myledger \
|
||||||
|
--mount 'type=bind,src=/home/ledgersmb/conf,dst=/srv/ledgersmb/local/conf \
|
||||||
|
-e POSTGRES_HOST=<ip/hostname> ledgersmb/ledgersmb:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
## Overriding or adding configuration
|
||||||
|
|
||||||
|
By pre-creating a configuration file in the mounted configuration directory,
|
||||||
|
the standard configuration generation process in the container can be overruled:
|
||||||
|
|
||||||
|
```plain
|
||||||
|
$ cat <<EOF > /home/ledgersmb/conf/ledgersmb.yaml
|
||||||
|
... YOUR CONFIG HERE ...
|
||||||
|
EOF
|
||||||
|
$ docker run -d -p 5762:5762 --name myledger \
|
||||||
|
--mount 'type=bind,src=/home/ledgersmb/conf,dst=/srv/ledgersmb/local/conf \
|
||||||
|
-e POSTGRES_HOST=<ip/hostname> ledgersmb/ledgersmb:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
If you do not want to completely overrule the configuration generated, but instead
|
||||||
|
supplement the configuration, you can put incremental configuration snippets in
|
||||||
|
files named `ledgersmb.XXX.yaml` in the same folder. E.g.:
|
||||||
|
|
||||||
|
```plain
|
||||||
|
$ cat <<EOF > /home/ledgersmb/conf/ledgersmb.001.yaml
|
||||||
|
logging:
|
||||||
|
file: ledgersmb.logging
|
||||||
|
EOF
|
||||||
|
```
|
||||||
|
|
||||||
|
[Documentation with respect to the available configuration
|
||||||
|
keys](https://github.com/ledgersmb/LedgerSMB/blob/master/doc/conf/ledgersmb.yaml)
|
||||||
|
is available in the LedgerSMB repository.
|
||||||
|
|
||||||
## Docker Compose with reverse proxy
|
## Docker Compose with reverse proxy
|
||||||
|
|
||||||
The `docker-compose-reverseproxy.yml` file shows a docker-compose setup
|
The `docker-compose-reverseproxy.yml` file shows a docker-compose setup
|
||||||
|
@ -32,6 +32,14 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
image: ghcr.io/ledgersmb/ledgersmb:1.10
|
image: ghcr.io/ledgersmb/ledgersmb:1.10
|
||||||
|
volumes:
|
||||||
|
# In order to store the configuration outside the image, allowing it to
|
||||||
|
# be edited between container restarts, uncomment the section below and
|
||||||
|
# change the 'source' to the directory where you want the configuration
|
||||||
|
# to be stored.
|
||||||
|
# - type: bind
|
||||||
|
# - source: /home/ledgersmb/conf
|
||||||
|
# - target: /srv/ledgersmb/local/conf
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
- default
|
- default
|
||||||
|
73
start.sh
73
start.sh
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
cd /srv/ledgersmb
|
cd /srv/ledgersmb
|
||||||
|
mkdir ./local/conf/
|
||||||
if [[ -n "$SSMTP_ROOT" ]]; then
|
if [[ -n "$SSMTP_ROOT" ]]; then
|
||||||
echo "\$SSMTP_ROOT set; parameter is deprecated and will be ignored"
|
echo "\$SSMTP_ROOT set; parameter is deprecated and will be ignored"
|
||||||
LSMB_HAVE_DEPRECATED=1
|
LSMB_HAVE_DEPRECATED=1
|
||||||
@ -68,27 +68,58 @@ if [[ -n "$LSMB_HAVE_DEPRECATED" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [[ ! -f ledgersmb.conf ]]; then
|
if [[ ! -f ./local/conf/ledgersmb.yaml ]]; then
|
||||||
cat <<EOF >/tmp/ledgersmb.conf
|
cat <<EOF >./local/conf/ledgersmb.yaml
|
||||||
[main]
|
paths:
|
||||||
cache_templates = 1
|
$class: Beam::Wire
|
||||||
[database]
|
config:
|
||||||
host = $POSTGRES_HOST
|
UI: ./UI/
|
||||||
port = $POSTGRES_PORT
|
UI_cache: lsmb_templates/
|
||||||
default_db = $DEFAULT_DB
|
|
||||||
[mail]
|
db:
|
||||||
${LSMB_MAIL_SMTPHOST:+smtphost=$LSMB_MAIL_SMTPHOST
|
$class: LedgerSMB::Database::Factory
|
||||||
}${LSMB_MAIL_SMTPPORT:+smtpport=$LSMB_MAIL_SMTPPORT
|
connect_data:
|
||||||
}${LSMB_MAIL_SMTPSENDER_HOSTNAME:+smtpsender_hostname=$LSMB_MAIL_SMTPSENDER_HOSTNAME
|
host: $POSTGRES_HOST
|
||||||
}${LSMB_MAIL_SMTPTLS:+smtptls=$LSMB_MAIL_SMTPTLS
|
port: $POSTGRES_PORT
|
||||||
}${LSMB_MAIL_SMTPUSER:+smtpuser=$LSMB_MAIL_SMTPUSER
|
|
||||||
}${LSMB_MAIL_SMTPPASS:+smtppass=$LSMB_MAIL_SMTPPASS
|
mail:
|
||||||
}${LSMB_MAIL_SMTPAUTHMECH:+smtpauthmech=$LSMB_MAIL_SMTPAUTHMECH
|
transport:
|
||||||
}
|
$class: LedgerSMB::Mailer::TransportSMTP
|
||||||
[proxy]
|
host: $LSMB_MAIL_SMTPHOST
|
||||||
ip=${PROXY_IP:-172.17.0.1/12}
|
port: $LSMB_MAIL_SMTPPORT
|
||||||
|
helo: $LSMB_MAIL_SMTPSENDER_HOSTNAME
|
||||||
|
tls: $LSMB_MAIL_SMTPTLS
|
||||||
|
|
||||||
|
miscellaneous:
|
||||||
|
$class: Beam::Wire
|
||||||
|
config:
|
||||||
|
proxy_ip: ${PROXY_IP:-172.17.0.1/12}
|
||||||
|
|
||||||
|
ui:
|
||||||
|
class: LedgerSMB::Template::UI
|
||||||
|
method: new_UI
|
||||||
|
lifecycle: eager
|
||||||
|
args:
|
||||||
|
cache:
|
||||||
|
$ref: paths/UI_cache
|
||||||
|
root:
|
||||||
|
$ref: paths/UI
|
||||||
EOF
|
EOF
|
||||||
export LSMB_CONFIG_FILE='/tmp/ledgersmb.conf'
|
|
||||||
|
if [[ -n "" ]]
|
||||||
|
then
|
||||||
|
cat <<EOF >./local/conf/ledgersmb.000.yaml
|
||||||
|
mail:
|
||||||
|
transport:
|
||||||
|
sasl_password: ''
|
||||||
|
sasl_username:
|
||||||
|
$class: Authen::SASL
|
||||||
|
mechanism: $LSMB_MAIL_SMTPAUTHMECH
|
||||||
|
callback:
|
||||||
|
user: $LSMB_MAIL_SMTPUSER
|
||||||
|
pass: $LSMB_MAIL_SMTPPASS
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# start ledgersmb
|
# start ledgersmb
|
||||||
|
Loading…
Reference in New Issue
Block a user