fix(services): Update S3 credentials naming and add S3_ENDPOINT support for improved MinIO integration
This commit is contained in:
		| @@ -1,5 +1,13 @@ | ||||
| # Changelog | ||||
|  | ||||
| ## 2025-08-15 - 1.17.4 - fix(services) | ||||
| Update S3 credentials naming and add S3_ENDPOINT support for improved MinIO integration | ||||
|  | ||||
| - Replaced S3_USER/S3_PASS with S3_ACCESSKEY/S3_SECRETKEY in ServiceConfiguration. | ||||
| - Added S3_ENDPOINT field with default endpoint in ServiceConfiguration. | ||||
| - Updated ServiceManager to use new credential names in container setup and logging. | ||||
| - Introduced .claude/settings.local.json for permission settings. | ||||
|  | ||||
| ## 2025-08-15 - 1.17.3 - fix(serviceconfig) | ||||
| Update service configuration to include dynamic MongoDB connection string and add local permissions settings | ||||
|  | ||||
|   | ||||
| @@ -3,6 +3,6 @@ | ||||
|  */ | ||||
| export const commitinfo = { | ||||
|   name: '@git.zone/cli', | ||||
|   version: '1.17.3', | ||||
|   version: '1.17.4', | ||||
|   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.' | ||||
| } | ||||
|   | ||||
| @@ -13,9 +13,10 @@ export interface IServiceConfig { | ||||
|   S3_HOST: string; | ||||
|   S3_PORT: string; | ||||
|   S3_CONSOLE_PORT: string; | ||||
|   S3_USER: string; | ||||
|   S3_PASS: string; | ||||
|   S3_ACCESSKEY: string; | ||||
|   S3_SECRETKEY: string; | ||||
|   S3_BUCKET: string; | ||||
|   S3_ENDPOINT: string; | ||||
| } | ||||
|  | ||||
| export class ServiceConfiguration { | ||||
| @@ -101,6 +102,8 @@ export class ServiceConfiguration { | ||||
|     const mongoHost = 'localhost'; | ||||
|     const mongoName = projectName; | ||||
|     const mongoPortStr = mongoPort.toString(); | ||||
|     const s3Host = 'localhost'; | ||||
|     const s3PortStr = s3Port.toString(); | ||||
|      | ||||
|     this.config = { | ||||
|       PROJECT_NAME: projectName, | ||||
| @@ -110,12 +113,13 @@ export class ServiceConfiguration { | ||||
|       MONGODB_USER: mongoUser, | ||||
|       MONGODB_PASS: mongoPass, | ||||
|       MONGODB_URL: `mongodb://${mongoUser}:${mongoPass}@${mongoHost}:${mongoPortStr}/${mongoName}?authSource=admin`, | ||||
|       S3_HOST: 'localhost', | ||||
|       S3_PORT: s3Port.toString(), | ||||
|       S3_HOST: s3Host, | ||||
|       S3_PORT: s3PortStr, | ||||
|       S3_CONSOLE_PORT: s3ConsolePort.toString(), | ||||
|       S3_USER: 'defaultadmin', | ||||
|       S3_PASS: 'defaultpass', | ||||
|       S3_BUCKET: `${projectName}-documents` | ||||
|       S3_ACCESSKEY: 'defaultadmin', | ||||
|       S3_SECRETKEY: 'defaultpass', | ||||
|       S3_BUCKET: `${projectName}-documents`, | ||||
|       S3_ENDPOINT: `http://${s3Host}:${s3PortStr}` | ||||
|     }; | ||||
|      | ||||
|     await this.saveConfig(); | ||||
| @@ -206,15 +210,15 @@ export class ServiceConfiguration { | ||||
|       updated = true; | ||||
|     } | ||||
|      | ||||
|     if (!this.config.S3_USER) { | ||||
|       this.config.S3_USER = 'defaultadmin'; | ||||
|       fieldsAdded.push('S3_USER'); | ||||
|     if (!this.config.S3_ACCESSKEY) { | ||||
|       this.config.S3_ACCESSKEY = 'defaultadmin'; | ||||
|       fieldsAdded.push('S3_ACCESSKEY'); | ||||
|       updated = true; | ||||
|     } | ||||
|      | ||||
|     if (!this.config.S3_PASS) { | ||||
|       this.config.S3_PASS = 'defaultpass'; | ||||
|       fieldsAdded.push('S3_PASS'); | ||||
|     if (!this.config.S3_SECRETKEY) { | ||||
|       this.config.S3_SECRETKEY = 'defaultpass'; | ||||
|       fieldsAdded.push('S3_SECRETKEY'); | ||||
|       updated = true; | ||||
|     } | ||||
|      | ||||
| @@ -224,6 +228,14 @@ export class ServiceConfiguration { | ||||
|       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}`; | ||||
|     if (oldEndpoint !== this.config.S3_ENDPOINT) { | ||||
|       fieldsAdded.push('S3_ENDPOINT'); | ||||
|       updated = true; | ||||
|     } | ||||
|      | ||||
|     if (updated) { | ||||
|       await this.saveConfig(); | ||||
|       logger.log('ok', `✅ Added missing fields: ${fieldsAdded.join(', ')}`); | ||||
|   | ||||
| @@ -137,8 +137,8 @@ export class ServiceManager { | ||||
|             [directories.minio]: '/data' | ||||
|           }, | ||||
|           environment: { | ||||
|             MINIO_ROOT_USER: config.S3_USER, | ||||
|             MINIO_ROOT_PASSWORD: config.S3_PASS | ||||
|             MINIO_ROOT_USER: config.S3_ACCESSKEY, | ||||
|             MINIO_ROOT_PASSWORD: config.S3_SECRETKEY | ||||
|           }, | ||||
|           restart: 'unless-stopped', | ||||
|           command: 'server /data --console-address ":9001"' | ||||
| @@ -153,7 +153,7 @@ export class ServiceManager { | ||||
|           // Create default bucket | ||||
|           await this.docker.exec( | ||||
|             containers.minio, | ||||
|             `mc alias set local http://localhost:9000 ${config.S3_USER} ${config.S3_PASS}` | ||||
|             `mc alias set local http://localhost:9000 ${config.S3_ACCESSKEY} ${config.S3_SECRETKEY}` | ||||
|           ); | ||||
|            | ||||
|           await this.docker.exec( | ||||
| @@ -172,7 +172,7 @@ export class ServiceManager { | ||||
|     logger.log('info', `  Port: ${config.S3_PORT}`); | ||||
|     logger.log('info', `  Bucket: ${config.S3_BUCKET}`); | ||||
|     logger.log('info', `  API: http://${config.S3_HOST}:${config.S3_PORT}`); | ||||
|     logger.log('info', `  Console: http://${config.S3_HOST}:${config.S3_CONSOLE_PORT} (login: ${config.S3_USER}/***)`); | ||||
|     logger.log('info', `  Console: http://${config.S3_HOST}:${config.S3_CONSOLE_PORT} (login: ${config.S3_ACCESSKEY}/***)`); | ||||
|   } | ||||
|    | ||||
|   /** | ||||
| @@ -294,12 +294,12 @@ export class ServiceManager { | ||||
|     logger.log('info', `  Host: ${config.S3_HOST}`); | ||||
|     logger.log('info', `  API Port: ${config.S3_PORT}`); | ||||
|     logger.log('info', `  Console Port: ${config.S3_CONSOLE_PORT}`); | ||||
|     logger.log('info', `  User: ${config.S3_USER}`); | ||||
|     logger.log('info', '  Password: ***'); | ||||
|     logger.log('info', `  Access Key: ${config.S3_ACCESSKEY}`); | ||||
|     logger.log('info', '  Secret Key: ***'); | ||||
|     logger.log('info', `  Bucket: ${config.S3_BUCKET}`); | ||||
|     logger.log('info', `  Container: ${this.config.getContainerNames().minio}`); | ||||
|     logger.log('info', `  Data: ${this.config.getDataDirectories().minio}`); | ||||
|     logger.log('info', `  API URL: http://${config.S3_HOST}:${config.S3_PORT}`); | ||||
|     logger.log('info', `  Endpoint: ${config.S3_ENDPOINT}`); | ||||
|     logger.log('info', `  Console URL: http://${config.S3_HOST}:${config.S3_CONSOLE_PORT}`); | ||||
|   } | ||||
|    | ||||
|   | ||||
		Reference in New Issue
	
	Block a user