[PR #4545] [MERGED] HSB-499 feat: env file sync with infra config #4850

Closed
opened 2026-03-17 02:20:51 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/4545
Author: @mirarifhasan
Created: 11/18/2024
Status: Merged
Merged: 11/26/2024
Merged by: @jamesgeorge007

Base: nextHead: feat/infra-config-sync-env-file


📝 Commits (10+)

  • 446f6f6 feat: env file sync with infra config
  • 78cf69c test: fix type error on infra-config unit test
  • 162e6b3 test: fix timestamp broken unit test of shortcode module
  • c720c89 fix: isEncrypted check added on storing in db
  • 71e4af1 fix: modify env old env data check logic
  • c540179 feat: env file null incoming value support added
  • fc0393d chore: handle edge case if SSO secret and VITE_ALLOWED update together from .env
  • fe5da3d chore: infra-config fix itself in runtime if SSO variables not configured
  • 16ccdb4 fix: edge case resolve if only email auth provider present with custom config false
  • db770c3 chore: error message added if DATA_ENCRYPTION_KEY change from .env file

📊 Changes

8 files changed (+210 additions, -59 deletions)

View changed files

packages/hoppscotch-backend/prisma/migrations/20241118054346_infra_config_sync_with_env_file/migration.sql (+3 -0)
📝 packages/hoppscotch-backend/prisma/schema.prisma (+7 -7)
📝 packages/hoppscotch-backend/src/auth/auth.module.ts (+3 -3)
📝 packages/hoppscotch-backend/src/errors.ts (+6 -0)
📝 packages/hoppscotch-backend/src/infra-config/helper.ts (+155 -36)
📝 packages/hoppscotch-backend/src/infra-config/infra-config.service.spec.ts (+6 -6)
📝 packages/hoppscotch-backend/src/infra-config/infra-config.service.ts (+24 -3)
📝 packages/hoppscotch-backend/src/shortcode/shortcode.service.spec.ts (+6 -4)

📄 Description

Closes HSB-499

What's changed

This PR adds synchronization if .env changes later on.

With these benefits, the end user can change any variables (i.e. SSO Secrets, ClickHouse configs, etc) either from Admin Dashboard or .env file, both will be synced and take the latest updates' value.

Notes to reviewers

Nil

Documentation updates

We can remove this Hard reset Configuration Docs


🔄 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/hoppscotch/hoppscotch/pull/4545 **Author:** [@mirarifhasan](https://github.com/mirarifhasan) **Created:** 11/18/2024 **Status:** ✅ Merged **Merged:** 11/26/2024 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `next` ← **Head:** `feat/infra-config-sync-env-file` --- ### 📝 Commits (10+) - [`446f6f6`](https://github.com/hoppscotch/hoppscotch/commit/446f6f6f97c033cf054633fa93c4bd1dc52cae22) feat: env file sync with infra config - [`78cf69c`](https://github.com/hoppscotch/hoppscotch/commit/78cf69cf2bb2ea23a834b6d8dcabf6b4161ebf2d) test: fix type error on infra-config unit test - [`162e6b3`](https://github.com/hoppscotch/hoppscotch/commit/162e6b383c6cce958456254105be13af6d00200e) test: fix timestamp broken unit test of shortcode module - [`c720c89`](https://github.com/hoppscotch/hoppscotch/commit/c720c898e0c35ccc62d5714e0803ef39fba22542) fix: isEncrypted check added on storing in db - [`71e4af1`](https://github.com/hoppscotch/hoppscotch/commit/71e4af16cbc13d8c4d209fa2c8535b1f88e5111b) fix: modify env old env data check logic - [`c540179`](https://github.com/hoppscotch/hoppscotch/commit/c540179a9deddacd51059832cba0490d150a0918) feat: env file null incoming value support added - [`fc0393d`](https://github.com/hoppscotch/hoppscotch/commit/fc0393dbb87b7b803fbb16b158fabe0e98bea82c) chore: handle edge case if SSO secret and VITE_ALLOWED update together from .env - [`fe5da3d`](https://github.com/hoppscotch/hoppscotch/commit/fe5da3daef4c35b72bca51b690f19653c3b68db8) chore: infra-config fix itself in runtime if SSO variables not configured - [`16ccdb4`](https://github.com/hoppscotch/hoppscotch/commit/16ccdb47f729caa162f1ba345b1e920d53acb008) fix: edge case resolve if only email auth provider present with custom config false - [`db770c3`](https://github.com/hoppscotch/hoppscotch/commit/db770c3e55647e6c689691ba3eaa051aa775d8ee) chore: error message added if DATA_ENCRYPTION_KEY change from .env file ### 📊 Changes **8 files changed** (+210 additions, -59 deletions) <details> <summary>View changed files</summary> ➕ `packages/hoppscotch-backend/prisma/migrations/20241118054346_infra_config_sync_with_env_file/migration.sql` (+3 -0) 📝 `packages/hoppscotch-backend/prisma/schema.prisma` (+7 -7) 📝 `packages/hoppscotch-backend/src/auth/auth.module.ts` (+3 -3) 📝 `packages/hoppscotch-backend/src/errors.ts` (+6 -0) 📝 `packages/hoppscotch-backend/src/infra-config/helper.ts` (+155 -36) 📝 `packages/hoppscotch-backend/src/infra-config/infra-config.service.spec.ts` (+6 -6) 📝 `packages/hoppscotch-backend/src/infra-config/infra-config.service.ts` (+24 -3) 📝 `packages/hoppscotch-backend/src/shortcode/shortcode.service.spec.ts` (+6 -4) </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one. --> <!-- If this pull request closes an issue, please mention the issue number below --> <!-- Issue # here --> Closes HSB-499 <!-- Add an introduction into what this PR tries to solve in a couple of sentences --> ### What's changed <!-- Describe point by point the different things you have changed in this PR --> This PR adds synchronization if `.env` changes later on. With these benefits, the end user can change any variables (i.e. SSO Secrets, ClickHouse configs, etc) either from Admin Dashboard or `.env` file, both will be synced and take the latest updates' value. <!-- You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax - [ ] Not Completed - [x] Completed --> ### Notes to reviewers <!-- Any information you feel the reviewer should know about when reviewing your PR --> Nil ### Documentation updates We can remove this [Hard reset Configuration Docs](https://docs.hoppscotch.io/documentation/self-host/community-edition/admin-dashboard#hard-reset-configurations) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:20:51 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4850
No description provided.