Compare commits

..

27 Commits

Author SHA1 Message Date
Erik Huelsmann
3fec7b91b1 * Automatic Dockerfile update by release process 2023-12-31 07:26:22 -05:00
Erik Huelsmann
6d6ca05eb1 * Automatic Dockerfile update by release process 2023-12-15 16:33:18 -05:00
Erik Huelsmann
b39d64964c * Automatic Dockerfile update by release process 2023-12-09 06:12:21 -05:00
Erik Huelsmann
f697bb6b50 Merge pull request #35 from brush/patch-1
Improve clarity of comments re: security of port mapping
2023-12-06 22:36:01 +01:00
brush
dc4c2cf97a Improve clarity of comments re: security of port mapping 2023-12-06 11:52:07 -08:00
Erik Huelsmann
83fb7a4fde * Automatic Dockerfile update by release process 2023-11-29 15:19:21 -05:00
Erik Huelsmann
0dc6e65c51 Fix further optionl parameter setting in the configuration file 2023-11-28 20:05:58 +01:00
Erik Huelsmann
51d1d1da0f Fix e-mail when HELO isn't explicitly set 2023-11-27 23:07:49 +01:00
Erik Huelsmann
9f7a4d1f8d * Automatic Dockerfile update by release process 2023-11-11 17:35:48 -05:00
Erik Huelsmann
7f3a3467f8 * Automatic Dockerfile update by release process 2023-10-22 16:14:02 -04:00
Erik Huelsmann
91a985bc31 Update Dockerfile
Use MetaCPAN for the metadata.
2023-10-22 21:32:46 +02:00
Erik Huelsmann
413a63161c * Automatic Dockerfile update by release process 2023-10-10 16:06:27 -04:00
Erik Huelsmann
7f7aa41a27 * Automatic Dockerfile update by release process 2023-10-03 17:07:07 -04:00
Erik Huelsmann
6f4d5cba73 Update README.md 2023-10-03 22:58:11 +02:00
Erik Huelsmann
3f3ca9dd7f Fix example volume in comment section 2023-09-30 23:07:26 +02:00
Erik Huelsmann
5d1823f88a Fix reference to 1.11 image 2023-09-30 23:07:00 +02:00
Erik Huelsmann
81a38b3040 Allow start.sh to generate local config 2023-09-30 22:57:09 +02:00
Erik Huelsmann
93c7b4c77e Fix bad interaction between IPv6, Bookworm, Starman and Docker 2023-09-30 22:56:40 +02:00
Erik Huelsmann
096350ad7b Fix ledgersmb-server.psgi not finding configuration
Fixes #34
2023-09-30 22:55:43 +02:00
Erik Huelsmann
9cc752a0ff Fix unescaped $-signs 2023-09-30 22:53:49 +02:00
Erik Huelsmann
7a17a8630f Fix docker-compose.yml syntax 2023-09-30 21:55:26 +02:00
Erik Huelsmann
ee863b6f3d Update latest 1.9 release 2023-09-29 15:29:12 +02:00
Erik Huelsmann
eba882d12a * Automatic Dockerfile update by release process 2023-08-29 17:39:01 -04:00
Erik Huelsmann
016deec433 Create no-response.yml 2023-08-25 20:47:13 +02:00
Erik Huelsmann
0f7242d559 Take advantage of the ability to have 'ledgersmb.XXX.yaml' config files 2023-08-25 20:37:45 +02:00
Erik Huelsmann
59192ffd20 * Automatic Dockerfile update by release process 2023-07-21 11:51:49 -04:00
Erik Huelsmann
4ff785d101 Create 1.11 release branch 2023-07-21 12:51:06 +02:00
4 changed files with 141 additions and 35 deletions

View File

@@ -1,11 +1,11 @@
# Build time variables # Build time variables
ARG SRCIMAGE=debian:bullseye-slim ARG SRCIMAGE=debian:bookworm-slim
FROM $SRCIMAGE AS builder FROM $SRCIMAGE AS builder
ARG LSMB_VERSION="1.10.29" ARG LSMB_VERSION="1.11.7"
ARG LSMB_DL_DIR="Releases" ARG LSMB_DL_DIR="Releases"
ARG ARTIFACT_LOCATION="https://download.ledgersmb.org/f/$LSMB_DL_DIR/$LSMB_VERSION/ledgersmb-$LSMB_VERSION.tar.gz" ARG ARTIFACT_LOCATION="https://download.ledgersmb.org/f/$LSMB_DL_DIR/$LSMB_VERSION/ledgersmb-$LSMB_VERSION.tar.gz"
@@ -51,7 +51,7 @@ LABEL org.opencontainers.image.description="LedgerSMB is a full featured double-
the LedgerSMB project is to bring high quality ERP and accounting capabilities\ the LedgerSMB project is to bring high quality ERP and accounting capabilities\
to Small and Midsize Businesses." to Small and Midsize Businesses."
ARG LSMB_VERSION="1.10.29" ARG LSMB_VERSION="1.11.7"
ARG LSMB_DL_DIR="Releases" ARG LSMB_DL_DIR="Releases"
ARG ARTIFACT_LOCATION="https://download.ledgersmb.org/f/$LSMB_DL_DIR/$LSMB_VERSION/ledgersmb-$LSMB_VERSION.tar.gz" ARG ARTIFACT_LOCATION="https://download.ledgersmb.org/f/$LSMB_DL_DIR/$LSMB_VERSION/ledgersmb-$LSMB_VERSION.tar.gz"
@@ -61,8 +61,6 @@ ARG ARTIFACT_LOCATION="https://download.ledgersmb.org/f/$LSMB_DL_DIR/$LSMB_VERSI
# Installing psql client directly from instructions at https://wiki.postgresql.org/wiki/Apt # Installing psql client directly from instructions at https://wiki.postgresql.org/wiki/Apt
# That mitigates issues where the PG instance is running a newer version than this container # That mitigates issues where the PG instance is running a newer version than this container
# Install Locale::Codes Locale::Country Locale::Language from CPAN to suppress
# deprecation-as-core-module warning
COPY --from=builder /srv/derived-deps /tmp/derived-deps COPY --from=builder /srv/derived-deps /tmp/derived-deps
@@ -128,7 +126,9 @@ ENV DEFAULT_DB lsmb
COPY start.sh /usr/local/bin/start.sh COPY start.sh /usr/local/bin/start.sh
RUN chmod +x /usr/local/bin/start.sh && \ RUN chmod +x /usr/local/bin/start.sh && \
mkdir -p /var/www mkdir -p /var/www && \
mkdir -p /srv/ledgersmb/local/conf && \
chown -R www-data /srv/ledgersmb/local
# Work around an aufs bug related to directory permissions: # Work around an aufs bug related to directory permissions:
RUN mkdir -p /tmp && chmod 1777 /tmp RUN mkdir -p /tmp && chmod 1777 /tmp

View File

@@ -203,6 +203,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

View File

@@ -16,7 +16,7 @@ services:
# because that allows us to use the default hostname ("postgres") # because that allows us to use the default hostname ("postgres")
# from the LedgerSMB configuration # from the LedgerSMB configuration
postgres: postgres:
image: postgres:12-alpine image: postgres:15-alpine
environment: environment:
# Replace the password below for a secure setup # Replace the password below for a secure setup
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-abc} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-abc}
@@ -31,16 +31,24 @@ services:
lsmb: lsmb:
depends_on: depends_on:
- postgres - postgres
image: ghcr.io/ledgersmb/ledgersmb:1.10 image: ghcr.io/ledgersmb/ledgersmb:1.11
# 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.
# volumes:
# - type: bind
# source: /home/ledgersmb/conf
# target: /srv/ledgersmb/local/conf
networks: networks:
- internal - internal
- default - default
# Comment the 'ports' section to disable mapping the LedgerSMB container port (5762) # Comment the 'ports' section to disable mapping the LedgerSMB container port (5762)
# to the host's port of the same number, thus making LedgerSMB # to the host's port of the same number. Mapping "5762:5762" makes LedgerSMB
# available on http://<host-dns-or-ip>:5762/ # available on http://<host-dns-or-ip>:5762/
# SECURITY NOTE: Do this for evaluation purposes only! # SECURITY NOTE: Leave this uncommented for evaluation purposes only!
# In production, be sure to use SSL/TLS to protect user's passwords # In production, be sure to use SSL/TLS (such as by reverse proxying) to protect
# and other sensitive data # user's passwords and other sensitive data
ports: ports:
- "5762:5762" - "5762:5762"
environment: environment:

103
start.sh
View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
cd /srv/ledgersmb cd /srv/ledgersmb
[[ -d ./local/conf/ ]] || 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,82 @@ 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:-postgres}
}${LSMB_MAIL_SMTPTLS:+smtptls=$LSMB_MAIL_SMTPTLS port: ${POSTGRES_PORT:-5432}
}${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] tls: $LSMB_MAIL_SMTPTLS
ip=${PROXY_IP:-172.17.0.1/12}
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 "$LSMB_MAIL_SMTPHOST" ]]
then
cat <<EOF >./local/conf/ledgersmb.000.yaml
mail:
transport:
host: $LSMB_MAIL_SMTPHOST
EOF
fi
if [[ -n "$LSMB_MAIL_SMTPPORT" ]]
then
cat <<EOF >./local/conf/ledgersmb.001.yaml
mail:
transport:
port: $LSMB_MAIL_SMTPPORT
EOF
fi
if [[ -n "$LSMB_MAIL_SMTPSENDER_HOSTNAME" ]]
then
cat <<EOF >./local/conf/ledgersmb.002.yaml
mail:
transport:
helo: $LSMB_MAIL_SMTPSENDER_HOSTNAME
EOF
fi
if [[ -n "$LSMB_MAIL_SMTPUSER" ]]
then
cat <<EOF >./local/conf/ledgersmb.003.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
@@ -96,12 +151,14 @@ fi
# starman instance (instead of just the worker, which will immediately # starman instance (instead of just the worker, which will immediately
# get restarted) on error; it also has a positive effect on memory use # get restarted) on error; it also has a positive effect on memory use
LSMB_CONFIG_FILE=${LSMB_CONFIG_FILE:-./local/conf/ledgersmb.yaml}
export LSMB_CONFIG_FILE
echo '--------- LEDGERSMB CONFIGURATION: ledgersmb.conf' echo '--------- LEDGERSMB CONFIGURATION: ledgersmb.conf'
cat ${LSMB_CONFIG_FILE:-ledgersmb.conf} cat ${LSMB_CONFIG_FILE}
echo '--------- LEDGERSMB CONFIGURATION --- END' echo '--------- LEDGERSMB CONFIGURATION --- END'
# ':5762:' suppresses an uninitialized variable warning in starman # ':5762:' suppresses an uninitialized variable warning in starman
# the last colon means "don't connect using tls"; without it, there's a warning # the last colon means "don't connect using tls"; without it, there's a warning
exec starman --listen :5762: --workers ${LSMB_WORKERS:-5} \ exec starman --listen 0.0.0.0:5762 --workers ${LSMB_WORKERS:-5} \
-I lib -I old/lib \ -I lib -I old/lib \
--preload-app bin/ledgersmb-server.psgi --preload-app bin/ledgersmb-server.psgi