fix(services): Update S3 credentials naming and add S3_ENDPOINT/S3_USESSL support for improved MinIO integration

This commit is contained in:
2025-08-15 12:17:04 +00:00
parent 935ee20e83
commit 968e67330d
4 changed files with 28 additions and 9 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@git.zone/cli',
version: '1.17.4',
version: '1.17.5',
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.'
}

View File

@@ -17,6 +17,7 @@ export interface IServiceConfig {
S3_SECRETKEY: string;
S3_BUCKET: string;
S3_ENDPOINT: string;
S3_USESSL: boolean;
}
export class ServiceConfiguration {
@@ -119,7 +120,8 @@ export class ServiceConfiguration {
S3_ACCESSKEY: 'defaultadmin',
S3_SECRETKEY: 'defaultpass',
S3_BUCKET: `${projectName}-documents`,
S3_ENDPOINT: `http://${s3Host}:${s3PortStr}`
S3_ENDPOINT: `http://${s3Host}:${s3PortStr}`,
S3_USESSL: false
};
await this.saveConfig();
@@ -228,9 +230,16 @@ export class ServiceConfiguration {
updated = true;
}
if (!this.config.S3_USESSL) {
this.config.S3_USESSL = false;
fieldsAdded.push('S3_USESSL');
updated = true;
}
// Always update S3_ENDPOINT based on current settings
const oldEndpoint = this.config.S3_ENDPOINT;
this.config.S3_ENDPOINT = `http://${this.config.S3_HOST}:${this.config.S3_PORT}`;
const protocol = this.config.S3_USESSL ? 'https' : 'http';
this.config.S3_ENDPOINT = `${protocol}://${this.config.S3_HOST}:${this.config.S3_PORT}`;
if (oldEndpoint !== this.config.S3_ENDPOINT) {
fieldsAdded.push('S3_ENDPOINT');
updated = true;

View File

@@ -297,6 +297,7 @@ export class ServiceManager {
logger.log('info', ` Access Key: ${config.S3_ACCESSKEY}`);
logger.log('info', ' Secret Key: ***');
logger.log('info', ` Bucket: ${config.S3_BUCKET}`);
logger.log('info', ` Use SSL: ${config.S3_USESSL}`);
logger.log('info', ` Container: ${this.config.getContainerNames().minio}`);
logger.log('info', ` Data: ${this.config.getDataDirectories().minio}`);
logger.log('info', ` Endpoint: ${config.S3_ENDPOINT}`);