Skip to content
Snippets Groups Projects
Commit b4a3c622 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch 'handle-non-sharable-values' into 'master'

Handle non sharable values

See merge request !28
parents b9ac7e98 d7fe074f
No related branches found
No related tags found
1 merge request!28Handle non sharable values
...@@ -31,11 +31,12 @@ ...@@ -31,11 +31,12 @@
# 2024-11-20 v1.24 <axel.hahn@unibe.ch> fix menu with started database less app; apply template permissions on target file; add $WEBURL; remove $frontendurl # 2024-11-20 v1.24 <axel.hahn@unibe.ch> fix menu with started database less app; apply template permissions on target file; add $WEBURL; remove $frontendurl
# 2024-11-20 v1.25 <axel.hahn@unibe.ch> fix menu startup containers # 2024-11-20 v1.25 <axel.hahn@unibe.ch> fix menu startup containers
# 2024-11-21 v1.26 <axel.hahn@unibe.ch> Reset colors in _checkConfig # 2024-11-21 v1.26 <axel.hahn@unibe.ch> Reset colors in _checkConfig
# 2025-05-13 v1.27 <axel.hahn@unibe.ch> handle addition variables config file for non sharable values
# ====================================================================== # ======================================================================
cd "$( dirname "$0" )" || exit 1 cd "$( dirname "$0" )" || exit 1
_version="1.26" _version="1.27"
# init used vars # init used vars
gittarget= gittarget=
...@@ -45,7 +46,7 @@ _self=$( basename "$0" ) ...@@ -45,7 +46,7 @@ _self=$( basename "$0" )
# shellcheck source=/dev/null # shellcheck source=/dev/null
. "${_self}.cfg" || exit 1 . "${_self}.cfg" || exit 1
. "${_self}_not_shared.cfg" 2>/dev/null
# git@git-repo.iml.unibe.ch:iml-open-source/docker-php-starterkit.git # git@git-repo.iml.unibe.ch:iml-open-source/docker-php-starterkit.git
selfgitrepo="docker-php-starterkit.git" selfgitrepo="docker-php-starterkit.git"
...@@ -406,15 +407,18 @@ function _fix_no-db(){ ...@@ -406,15 +407,18 @@ function _fix_no-db(){
# used in _generateFiles # used in _generateFiles
function _getreplaces(){ function _getreplaces(){
# loop over vars to make the replacement # loop over vars to make the replacement
grep "^[a-zA-Z]" "$_self.cfg" | while read -r line for myfile in "${_self}.cfg" "${_self}_not_shared.cfg"
do do
# echo replacement: $line grep "^[a-zA-Z]" "${myfile}" | while read -r line
mykey=$( echo "$line" | cut -f 1 -d '=' ) do
myvalue="$( eval echo \"\$"$mykey"\" )" # echo replacement: $line
mykey=$( echo "$line" | cut -f 1 -d '=' )
myvalue="$( eval echo \"\$"$mykey"\" )"
# TODO: multiline values fail here in replacement with sed # TODO: multiline values fail here in replacement with sed
echo -e "s#{{$mykey}}#${myvalue}#g" echo -e "s#{{$mykey}}#${myvalue}#g"
done
done done
} }
......
# ======================================================================
#
# senstive configuration not to check in into your git repository
#
# ======================================================================
OIDCCryptoPassphrase=0123456789
OIDCClientSecret='YOUR-SECRET-HERE'
OIDCProviderMetadataURL='https://keycloak.example.com/realms/YOUR-REALM/.well-known/openid-configuration'
# ----------------------------------------------------------------------
...@@ -28,6 +28,7 @@ The initial file structure looks like this: ...@@ -28,6 +28,7 @@ The initial file structure looks like this:
├── docker # Docker data ├── docker # Docker data
│ ├── init.sh << shellscript for initialization │ ├── init.sh << shellscript for initialization
│ ├── init.sh.cfg << config file │ ├── init.sh.cfg << config file
│ ├── init.sh_not_shared.cfg.dist << config file template
│ └── templates << folder with templates │ └── templates << folder with templates
│ ├── docker-compose.yml │ ├── docker-compose.yml
│ ├── dot_env │ ├── dot_env
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* All files in the `docker/templates/` directory will be processed. This also means: you can add as many custom files here as you want - and the will processed too. * All files in the `docker/templates/` directory will be processed. This also means: you can add as many custom files here as you want - and the will processed too.
* in the first line must be a line `# TARGET: [name of target file]` to define the target file. If this line does not exist, then the file will be skipped. * in the first line must be a line `# TARGET: [name of target file]` to define the target file. If this line does not exist, then the file will be skipped.
* Placeholdrs have the syntax variable in double brackets, i.e. `{{VARNAME}}` * Placeholdrs have the syntax variable in double brackets, i.e. `{{VARNAME}}`
* variables to be replaced are those in docker/init.sh.cfg and `{{genrator}}` * variables to be replaced are those in docker/init.sh.cfg and `{{generator}}`
# Templates # Templates
...@@ -147,7 +147,10 @@ and php modules. To override default module settings see template with "extra-p ...@@ -147,7 +147,10 @@ and php modules. To override default module settings see template with "extra-p
FROM php:{{APP_PHP_VERSION}}-apache FROM php:{{APP_PHP_VERSION}}-apache
# install packages # install packages
RUN apt-get update && apt-get install -y {{APP_APT_PACKAGES}} RUN rm -rf /var/lib/apt/lists/*
RUN mkdir -p /var/cache/apt/archives/partial
RUN apt-get update
RUN apt-get install -y {{APP_APT_PACKAGES}}
# enable apache modules # enable apache modules
RUN a2enmod {{APP_APACHE_MODULES}} RUN a2enmod {{APP_APACHE_MODULES}}
...@@ -204,7 +207,7 @@ For the security headers in the buttom part the apache module "headers" ist need ...@@ -204,7 +207,7 @@ For the security headers in the buttom part the apache module "headers" ist need
Custom PHP config file for you additional settings. Custom PHP config file for you additional settings.
Showing all warnings and errors is enabled as default. Showing all warnings and errors is enabled as default.
✴️ You **SHOULD** change this to setup Mysql database service for your needs. ✴️ You **SHOULD** change this to correct timezone or define other settings
```ini ```ini
# TARGET: docker/containers/web-server/php/extra-php-config.ini # TARGET: docker/containers/web-server/php/extra-php-config.ini
...@@ -216,6 +219,13 @@ Showing all warnings and errors is enabled as default. ...@@ -216,6 +219,13 @@ Showing all warnings and errors is enabled as default.
error_reporting=E_ALL error_reporting=E_ALL
display_errors=1 display_errors=1
; If you want to catch emails locally in your dev environment
; eg. https://os-docs.iml.unibe.ch/php-emailcatcher/
; sendmail_path = "php {{WEBROOT}}/vendor/emailcatcher/php-sendmail.php"
[Date]
date.timezone = Europe/Zurich
; ---------------------------------------------------------------------- ; ----------------------------------------------------------------------
; XDEBUG STUFF BELOW ; XDEBUG STUFF BELOW
; ---------------------------------------------------------------------- ; ----------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment