From a86fb3bb8e8b98986f5d6cecdafc5d7490521519 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Fri, 15 Aug 2025 10:12:24 +0000 Subject: [PATCH] fix(serviceconfig): Update service configuration to include dynamic MongoDB connection string and add local permissions settings --- changelog.md | 6 +++++ ts/00_commitinfo_data.ts | 2 +- .../classes.serviceconfiguration.ts | 26 +++++++++++++++---- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/changelog.md b/changelog.md index c5fde05..baf6f0d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2025-08-15 - 1.17.3 - fix(serviceconfig) +Update service configuration to include dynamic MongoDB connection string and add local permissions settings + +- Added .claude/settings.local.json for local permissions configuration +- Updated ServiceConfiguration to compute and update MONGODB_URL based on current config values + ## 2025-08-15 - 1.17.2 - fix(ci-test-services) Update CI/CD configurations, test settings, and Docker service for MongoDB. diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index bc1450e..0c5cc8c 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@git.zone/cli', - version: '1.17.2', + version: '1.17.3', description: 'A comprehensive CLI tool for enhancing and managing local development workflows with gitzone utilities, focusing on project setup, version control, code formatting, and template management.' } diff --git a/ts/mod_services/classes.serviceconfiguration.ts b/ts/mod_services/classes.serviceconfiguration.ts index 349db6d..f9afc3d 100644 --- a/ts/mod_services/classes.serviceconfiguration.ts +++ b/ts/mod_services/classes.serviceconfiguration.ts @@ -9,6 +9,7 @@ export interface IServiceConfig { MONGODB_PORT: string; MONGODB_USER: string; MONGODB_PASS: string; + MONGODB_URL: string; S3_HOST: string; S3_PORT: string; S3_CONSOLE_PORT: string; @@ -95,13 +96,20 @@ export class ServiceConfiguration { s3ConsolePort++; } + const mongoUser = 'defaultadmin'; + const mongoPass = 'defaultpass'; + const mongoHost = 'localhost'; + const mongoName = projectName; + const mongoPortStr = mongoPort.toString(); + this.config = { PROJECT_NAME: projectName, - MONGODB_HOST: 'localhost', - MONGODB_NAME: projectName, - MONGODB_PORT: mongoPort.toString(), - MONGODB_USER: 'defaultadmin', - MONGODB_PASS: 'defaultpass', + MONGODB_HOST: mongoHost, + MONGODB_NAME: mongoName, + MONGODB_PORT: mongoPortStr, + MONGODB_USER: mongoUser, + MONGODB_PASS: mongoPass, + MONGODB_URL: `mongodb://${mongoUser}:${mongoPass}@${mongoHost}:${mongoPortStr}/${mongoName}?authSource=admin`, S3_HOST: 'localhost', S3_PORT: s3Port.toString(), S3_CONSOLE_PORT: s3ConsolePort.toString(), @@ -164,6 +172,14 @@ export class ServiceConfiguration { updated = true; } + // Always update MONGODB_URL based on current settings + const oldUrl = this.config.MONGODB_URL; + this.config.MONGODB_URL = `mongodb://${this.config.MONGODB_USER}:${this.config.MONGODB_PASS}@${this.config.MONGODB_HOST}:${this.config.MONGODB_PORT}/${this.config.MONGODB_NAME}?authSource=admin`; + if (oldUrl !== this.config.MONGODB_URL) { + fieldsAdded.push('MONGODB_URL'); + updated = true; + } + if (!this.config.S3_HOST) { this.config.S3_HOST = 'localhost'; fieldsAdded.push('S3_HOST');