[PR #1206] [MERGED] Fix/key backup in config script #13402

Closed
opened 2026-08-05 02:08:20 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/1206
Author: @pappz
Created: 10/9/2023
Status: Merged
Merged: 10/11/2023
Merged by: @mlsmaycon

Base: mainHead: fix/key-backup-in-config-script


📝 Commits (8)

  • e11206e Eliminate repeated error messages
  • 2d0606a Fix invalid json generation
  • 3ec0c5e Add DataStoreEncryptionKey for template
  • dbba4c4 Backup config files
  • 2fd177a Fix extra config parameter
  • 0ce1d16 Ignore null encryption key
  • 9f82d7a In case of error exit immediately
  • d7e4b0a Rename bpk files

📊 Changes

3 files changed (+43 additions, -8 deletions)

View changed files

📝 infrastructure_files/configure.sh (+26 -2)
📝 infrastructure_files/management.json.tmpl (+1 -0)
📝 management/server/activity/sqlite/sqlite.go (+16 -6)

📄 Description

Describe your changes

Because we provide the option to regenerate the config files, the encryption key could be lost.

  • The configure.sh read the existing key and write it back during the config generation
  • Backup the previously generated config files before overwrite it
  • Fix invalid json output in the Extras field
  • Reduce the error logs in case if the encryption key is invalid
  • Response in the events API with valid user info in any cases
  • Add extra error handling to the configure.sh. I.e. handle the invalid OpenID urls

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/1206 **Author:** [@pappz](https://github.com/pappz) **Created:** 10/9/2023 **Status:** ✅ Merged **Merged:** 10/11/2023 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `fix/key-backup-in-config-script` --- ### 📝 Commits (8) - [`e11206e`](https://github.com/netbirdio/netbird/commit/e11206e33481c02b3109d56fa0208b2417f929fe) Eliminate repeated error messages - [`2d0606a`](https://github.com/netbirdio/netbird/commit/2d0606a867caf8832624ddccde2a4d0a17859f18) Fix invalid json generation - [`3ec0c5e`](https://github.com/netbirdio/netbird/commit/3ec0c5e79ea4bc430a79e36ac5a44861ae56e0a0) Add DataStoreEncryptionKey for template - [`dbba4c4`](https://github.com/netbirdio/netbird/commit/dbba4c4bf1a906d39128f67bd228b2ddb63b7611) Backup config files - [`2fd177a`](https://github.com/netbirdio/netbird/commit/2fd177ab1dabdd8b099d41ec5a6640679da66990) Fix extra config parameter - [`0ce1d16`](https://github.com/netbirdio/netbird/commit/0ce1d16d9adfc73522187f92120ae875a24fbc31) Ignore null encryption key - [`9f82d7a`](https://github.com/netbirdio/netbird/commit/9f82d7a5a5f585d18d7cb25851ae62ce46cc1a0f) In case of error exit immediately - [`d7e4b0a`](https://github.com/netbirdio/netbird/commit/d7e4b0a3ef72ca3990dff48eb956cbf691e4a834) Rename bpk files ### 📊 Changes **3 files changed** (+43 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `infrastructure_files/configure.sh` (+26 -2) 📝 `infrastructure_files/management.json.tmpl` (+1 -0) 📝 `management/server/activity/sqlite/sqlite.go` (+16 -6) </details> ### 📄 Description ## Describe your changes Because we provide the option to regenerate the config files, the encryption key could be lost. - The configure.sh read the existing key and write it back during the config generation - Backup the previously generated config files before overwrite it - Fix invalid json output in the Extras field - Reduce the error logs in case if the encryption key is invalid - Response in the events API with valid user info in any cases - Add extra error handling to the configure.sh. I.e. handle the invalid OpenID urls ## Issue ticket number and link ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 02:08:20 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#13402