Compare commits

...

4 Commits

Author SHA1 Message Date
935ee20e83 1.17.4
Some checks failed
Default (tags) / security (push) Failing after 1s
Default (tags) / test (push) Failing after 1s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-08-15 11:05:50 +00:00
c205180991 fix(services): Update S3 credentials naming and add S3_ENDPOINT support for improved MinIO integration 2025-08-15 11:05:50 +00:00
4a53bc4abc 1.17.3
Some checks failed
Default (tags) / security (push) Failing after 1s
Default (tags) / test (push) Failing after 1s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-08-15 10:12:24 +00:00
a86fb3bb8e fix(serviceconfig): Update service configuration to include dynamic MongoDB connection string and add local permissions settings 2025-08-15 10:12:24 +00:00
5 changed files with 69 additions and 27 deletions

View File

@@ -1,5 +1,19 @@
# 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
- 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.

View File

@@ -1,7 +1,7 @@
{
"name": "@git.zone/cli",
"private": false,
"version": "1.17.2",
"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.",
"main": "dist_ts/index.ts",
"typings": "dist_ts/index.d.ts",

View File

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

View File

@@ -9,12 +9,14 @@ 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;
S3_USER: string;
S3_PASS: string;
S3_ACCESSKEY: string;
S3_SECRETKEY: string;
S3_BUCKET: string;
S3_ENDPOINT: string;
}
export class ServiceConfiguration {
@@ -95,19 +97,29 @@ export class ServiceConfiguration {
s3ConsolePort++;
}
const mongoUser = 'defaultadmin';
const mongoPass = 'defaultpass';
const mongoHost = 'localhost';
const mongoName = projectName;
const mongoPortStr = mongoPort.toString();
const s3Host = 'localhost';
const s3PortStr = s3Port.toString();
this.config = {
PROJECT_NAME: projectName,
MONGODB_HOST: 'localhost',
MONGODB_NAME: projectName,
MONGODB_PORT: mongoPort.toString(),
MONGODB_USER: 'defaultadmin',
MONGODB_PASS: 'defaultpass',
S3_HOST: 'localhost',
S3_PORT: s3Port.toString(),
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: 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();
@@ -164,6 +176,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');
@@ -190,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;
}
@@ -208,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(', ')}`);

View File

@@ -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}`);
}