From 2eb6bddbac47c68d0d337ec053a6c409aba528a8 Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Thu, 21 Dec 2023 11:13:04 +0100 Subject: [PATCH] [Elao - App -Docker] Allow to configure default gitconfig & add defaults for safe dirs --- elao.app.docker/.manala.yaml | 4 ++++ elao.app.docker/.manala.yaml.tmpl | 6 ++++++ elao.app.docker/.manala/docker/entrypoint.sh | 5 +++++ elao.app.docker/.manala/etc/gitconfig.tmpl | 5 +++++ 4 files changed, 20 insertions(+) create mode 100644 elao.app.docker/.manala/etc/gitconfig.tmpl diff --git a/elao.app.docker/.manala.yaml b/elao.app.docker/.manala.yaml index 5900fea5..921db8f8 100644 --- a/elao.app.docker/.manala.yaml +++ b/elao.app.docker/.manala.yaml @@ -6,6 +6,7 @@ manala: - .manala/certificates/ca.crt - .manala/certificates/ca.key - .manala/docker + - .manala/etc - .manala/github - .manala/make - .manala/.dockerignore @@ -144,6 +145,9 @@ system: users: [] # @schema {"items": {"type": "object"}} privileges: [] + git: + # @schema {"type": ["null", "string"]} + config: ~ ssh: client: # @schema {"type": ["null", "string"]} diff --git a/elao.app.docker/.manala.yaml.tmpl b/elao.app.docker/.manala.yaml.tmpl index 66b24938..fd414e6d 100644 --- a/elao.app.docker/.manala.yaml.tmpl +++ b/elao.app.docker/.manala.yaml.tmpl @@ -99,6 +99,12 @@ system: version: {{ .influxdb.version | toYaml }} {{- end }} + git: + config: | + # Silence false positive dubious ownership errors + #[safe] + #directory = * + # ssh: # client: # config: | diff --git a/elao.app.docker/.manala/docker/entrypoint.sh b/elao.app.docker/.manala/docker/entrypoint.sh index 85b4ab21..611cc880 100755 --- a/elao.app.docker/.manala/docker/entrypoint.sh +++ b/elao.app.docker/.manala/docker/entrypoint.sh @@ -26,4 +26,9 @@ if [ -n "${DOCKER_HOST}" ]; then " & fi +# Templates +if [ -d ".manala/etc" ]; then + GOMPLATE_LOG_FORMAT=simple gomplate --input-dir=.manala/etc --output-dir=/etc 2>/dev/null +fi + exec "$@" diff --git a/elao.app.docker/.manala/etc/gitconfig.tmpl b/elao.app.docker/.manala/etc/gitconfig.tmpl new file mode 100644 index 00000000..3f479ad5 --- /dev/null +++ b/elao.app.docker/.manala/etc/gitconfig.tmpl @@ -0,0 +1,5 @@ +# Git config template +# Don't edit this file directly. Instead, set config in project .manala.yaml, and run `manala up`. +{{ if .Vars.system.git.config }} +{{ .Vars.system.git.config }} +{{- end -}}