Skip to content

Commit

Permalink
Merge pull request #4 from guimard/dont-override-globalStorageOptions
Browse files Browse the repository at this point in the history
Don't override the whole globalStorageOptions when using Redis variables
  • Loading branch information
guimard authored Jul 1, 2024
2 parents 7d22fdd + cface27 commit 2e63386
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build and Publish Docker Images

env:
VERSION: 2.19.0
PGVERSION: 15
DEBIANRELEASE: bookworm
DOCKERREVISION: 9

on:
push:
branches-ignore: [master]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: build_and_test
run: ./build-all
env:
VERSION: ${{ env.VERSION }}-${{ env.DOCKERREVISION }}
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changes

* 2024-06-27: don't override other globalStorageOptions keys
* 2024-06-22: drop default Nginx website
* 2024-06-20: add yadd/lemonldap-ng-cron-task (v2.19.0-8)
* 2024-06-19: custom cron string
Expand Down
5 changes: 4 additions & 1 deletion base/install/etc/cont-init.d/update-llng-conf
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,12 @@ fi
# If Redis server is given, let's use it for sessions
if test "$REDIS_SERVER" != ""; then
echo "Change configuration to use Redis for sessions"
TMP=`/usr/share/docker-llng/updateConf get globalStorageOptions Index`
REDIS_INDEXES=${REDIS_INDEXES:-$TMP}
REDIS_INDEXES=${REDIS_INDEXES:-uid mail}
/usr/share/docker-llng/updateConf set globalStorage 'Apache::Session::Browseable::Redis'
/usr/share/docker-llng/updateConf set globalStorageOptions '{"server":"'"$REDIS_SERVER"'","Index":"'"$REDIS_INDEXES"'"}'
/usr/share/docker-llng/updateConf set globalStorageOptions server "$REDIS_SERVER"
/usr/share/docker-llng/updateConf set globalStorageOptions Index "$REDIS_INDEXES"
/usr/share/docker-llng/updateConf set forceGlobalStorageIssuerOTT 1
/usr/share/docker-llng/updateConf set tokenUseGlobalStorage 1
/usr/share/docker-llng/updateConf set forceGlobalStorageUpgradeOTT 1
Expand Down
5 changes: 4 additions & 1 deletion base/install/usr/share/docker-llng/updateConf
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ sub follow {
my $offset = '';
while ( @keys > 1 ) {
my $key = shift @keys;
die "Unable to find $offset$key" unless exists $conf->{$key};
unless (exists $conf->{$key}) {
warn "Unable to find $offset$key, creating";
$conf->{$key} = {};
}
$offset .= "$key/";
$conf = $conf->{$key};
}
Expand Down
1 change: 1 addition & 0 deletions base/test
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -e
docker-compose run base cat /etc/lemonldap-ng/lemonldap-ng.ini | grep 'dbiChain=DBI:Pg:database=lemonldapng;host=db'
docker-compose run base /usr/share/docker-llng/updateConf get persistentStorage | grep Apache::Session::Browseable::PgJSON
docker-compose run base /usr/share/docker-llng/updateConf get globalStorage | grep Apache::Session::Browseable::Redis
docker-compose run base /usr/share/docker-llng/updateConf get globalStorageOptions Index | grep _whatToTrace
docker-compose run base /usr/share/docker-llng/updateConf get domain | grep debian.org
docker-compose run base /usr/share/docker-llng/updateConf get authChoiceModules | grep 1_LDAP
docker-compose run base /usr/share/docker-llng/updateConf get applicationList 1sample catname | grep "Some applications"
Expand Down

0 comments on commit 2e63386

Please sign in to comment.