From 2a250b8823498a691872bd99d39f9c984a67b5cd Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Sat, 16 Aug 2025 13:25:57 +0000 Subject: [PATCH] fix(services): Simplify S3 endpoint handling in ServiceConfiguration to store host only --- changelog.md | 8 ++++++++ ts/00_commitinfo_data.ts | 2 +- ts/mod_services/classes.serviceconfiguration.ts | 14 +++++--------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/changelog.md b/changelog.md index 8eeb5c2..755beac 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,13 @@ # Changelog +## 2025-08-16 - 1.18.3 - fix(services) +Simplify S3 endpoint handling in ServiceConfiguration to store host only + +- S3_ENDPOINT now stores the raw host (e.g. 'localhost') instead of a full URL with protocol and port. +- Default .nogit/env.json creation uses the host-only S3_ENDPOINT. +- Sync/update logic (when syncing with Docker or reconfiguring ports) sets S3_ENDPOINT to the host only. +- Consumers that previously relied on S3_ENDPOINT containing protocol and port should now construct the full endpoint URL using S3_USESSL, S3_HOST and S3_PORT. + ## 2025-08-16 - 1.18.1 - fix(services) Improve services and commit flow: stop AiDoc, use silent docker inspect, sync ports with logging, fix config loading, and bump deps diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index c1c8e9a..08c6331 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.18.1', + version: '1.18.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 06f5551..2c18e5c 100644 --- a/ts/mod_services/classes.serviceconfiguration.ts +++ b/ts/mod_services/classes.serviceconfiguration.ts @@ -126,7 +126,7 @@ export class ServiceConfiguration { S3_ACCESSKEY: 'defaultadmin', S3_SECRETKEY: 'defaultpass', S3_BUCKET: `${projectName}-documents`, - S3_ENDPOINT: `http://${s3Host}:${s3PortStr}`, + S3_ENDPOINT: s3Host, S3_USESSL: false }; @@ -244,8 +244,7 @@ export class ServiceConfiguration { // Always update S3_ENDPOINT based on current settings const oldEndpoint = this.config.S3_ENDPOINT; - const protocol = this.config.S3_USESSL ? 'https' : 'http'; - this.config.S3_ENDPOINT = `${protocol}://${this.config.S3_HOST}:${this.config.S3_PORT}`; + this.config.S3_ENDPOINT = this.config.S3_HOST; if (oldEndpoint !== this.config.S3_ENDPOINT) { fieldsAdded.push('S3_ENDPOINT'); updated = true; @@ -335,8 +334,7 @@ export class ServiceConfiguration { if (updated) { // Update derived fields 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`; - const protocol = this.config.S3_USESSL ? 'https' : 'http'; - this.config.S3_ENDPOINT = `${protocol}://${this.config.S3_HOST}:${this.config.S3_PORT}`; + this.config.S3_ENDPOINT = this.config.S3_HOST; await this.saveConfig(); logger.log('ok', '✅ Configuration synced with Docker containers'); @@ -393,8 +391,7 @@ export class ServiceConfiguration { if (updated) { // Update derived fields 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`; - const protocol = this.config.S3_USESSL ? 'https' : 'http'; - this.config.S3_ENDPOINT = `${protocol}://${this.config.S3_HOST}:${this.config.S3_PORT}`; + this.config.S3_ENDPOINT = this.config.S3_HOST; await this.saveConfig(); } @@ -423,8 +420,7 @@ export class ServiceConfiguration { // Update derived fields 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`; - const protocol = this.config.S3_USESSL ? 'https' : 'http'; - this.config.S3_ENDPOINT = `${protocol}://${this.config.S3_HOST}:${this.config.S3_PORT}`; + this.config.S3_ENDPOINT = this.config.S3_HOST; await this.saveConfig();