From b23730e4c2bb792880f0f99773ae4bbb9868e3bc Mon Sep 17 00:00:00 2001 From: Erik Huelsmann Date: Thu, 5 Oct 2023 23:26:02 +0200 Subject: [PATCH] Remove version number from cookies Without the version number, we don't need to rename the cookie on each release, removing a major maintenance nuisance. --- .github/ISSUE_TEMPLATE/new-release.md | 3 +-- bin/ledgersmb-server.psgi | 2 +- doc/conf/ledgersmb.yaml | 5 ++++- lib/LedgerSMB/Routes/ERP/API.pm | 7 ++++++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/new-release.md b/.github/ISSUE_TEMPLATE/new-release.md index d54c93da3c..9294df5381 100644 --- a/.github/ISSUE_TEMPLATE/new-release.md +++ b/.github/ISSUE_TEMPLATE/new-release.md @@ -18,12 +18,11 @@ about: Tracking the progress on preparing a new release branch * [ ] package.json * [ ] In setup.pm, add support to create databases of the version that 'master' becomes * [ ] In LedgerSMB.pm, increase the $VERSION variable - * [ ] In bin/ledgersmb-server.psgi adjust the version-check regex and the cookie name in the `__DATA__` section + * [ ] In bin/ledgersmb-server.psgi adjust the version-check regex * [ ] In locale/LedgerSMB.pot, adjust the Project-Id * [ ] In t/data/Is_LSMB_running.html, increase the version text * [ ] Update README.md reference to `docker-compose` file (both on the branch and on master) * [ ] Create a new docker-compose branch - * [ ] Update the cookie's version number in the default config files `doc/conf/ledgersmb.yaml.*` * [ ] Add the new version to renovate.json baseBranches ## General preparation diff --git a/bin/ledgersmb-server.psgi b/bin/ledgersmb-server.psgi index fc2883d756..fbfbaddf4a 100755 --- a/bin/ledgersmb-server.psgi +++ b/bin/ledgersmb-server.psgi @@ -178,7 +178,7 @@ $builder->to_app( __DATA__ cookie: - name: LedgerSMB-1.12 + name: LedgerSMB db: $class: LedgerSMB::Database::Factory connect_data: diff --git a/doc/conf/ledgersmb.yaml b/doc/conf/ledgersmb.yaml index 889d5de138..3f5e9ed7f5 100644 --- a/doc/conf/ledgersmb.yaml +++ b/doc/conf/ledgersmb.yaml @@ -1,6 +1,9 @@ cookie: - name: LedgerSMB-1.12 + # To run multiple LedgerSMB versions in parallel on the same domain, + # set the value of the cookie to 'LedgerSMB-'; e.g. for version + # 1.1, that would become 'LedgerSMB-1.1' + name: LedgerSMB # Leaving the secret empty causes a secret to be dynamically generated # secret: diff --git a/lib/LedgerSMB/Routes/ERP/API.pm b/lib/LedgerSMB/Routes/ERP/API.pm index ff421ce3cd..75a5f5793d 100644 --- a/lib/LedgerSMB/Routes/ERP/API.pm +++ b/lib/LedgerSMB/Routes/ERP/API.pm @@ -117,7 +117,7 @@ components: cookieAuth: type: apiKey in: cookie - name: LedgerSMB-1.10 + name: LedgerSMB description: | The authenticating cookie can be obtained by sending a `POST` request to `login.pl?__action=authenticate&company=