Enhance Cloudly Configuration and Testing Setup

- Updated README to include architecture overview and details on components.
- Changed import paths in test helpers and test files to use the new Git zone packages.
- Modified S3 bucket name in test setup for consistency.
- Updated CloudlyConfig class to use more descriptive environment variable names for MongoDB and S3 configuration.
- Adjusted ImageManager to retrieve the S3 bucket name from the configuration instead of hardcoding it.
This commit is contained in:
2025-08-18 03:07:12 +00:00
parent bc7a2ca5f1
commit 907f3e8320
8 changed files with 3909 additions and 3347 deletions

View File

@@ -13,7 +13,7 @@
"author": "Task Venture Capital GmbH", "author": "Task Venture Capital GmbH",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"test": "(tstest test/)", "test": "(tstest test/ --verbose --logfile --timeout 120)",
"build": "tsbuild tsfolders --web --allowimplicitany && tsbundle website --production", "build": "tsbuild tsfolders --web --allowimplicitany && tsbundle website --production",
"start": "node cli.js", "start": "node cli.js",
"startTs": "node cli.ts.js", "startTs": "node cli.ts.js",
@@ -22,45 +22,44 @@
"docs": "tsdoc aidoc" "docs": "tsdoc aidoc"
}, },
"devDependencies": { "devDependencies": {
"@git.zone/tsbuild": "^2.3.2", "@git.zone/tsbuild": "^2.6.7",
"@git.zone/tsbundle": "^2.2.5", "@git.zone/tsbundle": "^2.5.1",
"@git.zone/tsdoc": "^1.4.4", "@git.zone/tsdoc": "^1.5.1",
"@git.zone/tspublish": "^1.9.1", "@git.zone/tspublish": "^1.10.3",
"@git.zone/tstest": "^1.0.96", "@git.zone/tstest": "^2.3.5",
"@git.zone/tswatch": "^2.1.0", "@git.zone/tswatch": "^2.2.1",
"@push.rocks/tapbundle": "^5.6.3", "@types/node": "^24.3.0"
"@types/node": "^22.15.2"
}, },
"dependencies": { "dependencies": {
"@api.global/typedrequest": "3.1.10", "@api.global/typedrequest": "3.1.10",
"@api.global/typedrequest-interfaces": "^3.0.19", "@api.global/typedrequest-interfaces": "^3.0.19",
"@api.global/typedserver": "^3.0.74", "@api.global/typedserver": "^3.0.77",
"@api.global/typedsocket": "^3.0.1", "@api.global/typedsocket": "^3.0.1",
"@apiclient.xyz/cloudflare": "^6.0.1", "@apiclient.xyz/cloudflare": "^6.4.1",
"@apiclient.xyz/docker": "^1.3.0", "@apiclient.xyz/docker": "^1.3.0",
"@apiclient.xyz/hetznercloud": "^1.2.0", "@apiclient.xyz/hetznercloud": "^1.2.0",
"@apiclient.xyz/slack": "^3.0.9", "@apiclient.xyz/slack": "^3.0.9",
"@design.estate/dees-catalog": "^1.8.0", "@design.estate/dees-catalog": "^1.10.10",
"@design.estate/dees-domtools": "^2.3.2", "@design.estate/dees-domtools": "^2.3.3",
"@design.estate/dees-element": "^2.0.42", "@design.estate/dees-element": "^2.1.2",
"@git.zone/tsrun": "^1.3.3", "@git.zone/tsrun": "^1.3.3",
"@push.rocks/early": "^4.0.3", "@push.rocks/early": "^4.0.3",
"@push.rocks/npmextra": "^5.1.2", "@push.rocks/npmextra": "^5.3.3",
"@push.rocks/projectinfo": "^5.0.1", "@push.rocks/projectinfo": "^5.0.1",
"@push.rocks/qenv": "^6.1.0", "@push.rocks/qenv": "^6.1.3",
"@push.rocks/smartacme": "^5.0.0", "@push.rocks/smartacme": "^5.0.0",
"@push.rocks/smartbucket": "^3.3.7", "@push.rocks/smartbucket": "^3.3.10",
"@push.rocks/smartcli": "^4.0.11", "@push.rocks/smartcli": "^4.0.11",
"@push.rocks/smartclickhouse": "^2.0.17", "@push.rocks/smartclickhouse": "^2.0.17",
"@push.rocks/smartdata": "^5.15.1", "@push.rocks/smartdata": "^5.16.1",
"@push.rocks/smartdelay": "^3.0.5", "@push.rocks/smartdelay": "^3.0.5",
"@push.rocks/smartexit": "^1.0.23", "@push.rocks/smartexit": "^1.0.23",
"@push.rocks/smartexpect": "^1.6.1", "@push.rocks/smartexpect": "^1.6.1",
"@push.rocks/smartfile": "^11.2.0", "@push.rocks/smartfile": "^11.2.7",
"@push.rocks/smartguard": "^3.1.0", "@push.rocks/smartguard": "^3.1.0",
"@push.rocks/smartjson": "^5.0.19", "@push.rocks/smartjson": "^5.0.19",
"@push.rocks/smartjwt": "^2.2.1", "@push.rocks/smartjwt": "^2.2.1",
"@push.rocks/smartlog": "^3.0.7", "@push.rocks/smartlog": "^3.1.8",
"@push.rocks/smartlog-destination-clickhouse": "^1.0.13", "@push.rocks/smartlog-destination-clickhouse": "^1.0.13",
"@push.rocks/smartlog-interfaces": "^3.0.2", "@push.rocks/smartlog-interfaces": "^3.0.2",
"@push.rocks/smartpath": "^5.0.18", "@push.rocks/smartpath": "^5.0.18",
@@ -68,13 +67,13 @@
"@push.rocks/smartrequest": "^2.1.0", "@push.rocks/smartrequest": "^2.1.0",
"@push.rocks/smartrx": "^3.0.10", "@push.rocks/smartrx": "^3.0.10",
"@push.rocks/smartssh": "^2.0.1", "@push.rocks/smartssh": "^2.0.1",
"@push.rocks/smartstate": "^2.0.19", "@push.rocks/smartstate": "^2.0.26",
"@push.rocks/smartstream": "^3.2.5", "@push.rocks/smartstream": "^3.2.5",
"@push.rocks/smartstring": "^4.0.15", "@push.rocks/smartstring": "^4.0.15",
"@push.rocks/smartunique": "^3.0.9", "@push.rocks/smartunique": "^3.0.9",
"@push.rocks/taskbuffer": "^3.0.2", "@push.rocks/taskbuffer": "^3.0.2",
"@push.rocks/webjwt": "^1.0.9", "@push.rocks/webjwt": "^1.0.9",
"@tsclass/tsclass": "^9.0.0" "@tsclass/tsclass": "^9.2.0"
}, },
"files": [ "files": [
"ts/**/*", "ts/**/*",

7182
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -9,3 +9,11 @@
- Note: the exports are defined in the package.json. - Note: the exports are defined in the package.json.
- For now, cloud wise only the setup with cloudron and hetzner cloud is supported. - For now, cloud wise only the setup with cloudron and hetzner cloud is supported.
## Architecture Overview
- serve.zone is a monorepo containing multiple packages that work together to provide a complete container orchestration platform
- Uses Docker Swarm as the underlying container orchestration technology
- cloudly acts as the control plane providing API, web UI, and CLI interfaces
- coreflow runs inside Docker Swarm clusters to manage containers
- coretraffic runs on each node to handle traffic routing and SSL
- spark manages individual servers at the OS level

View File

@@ -5,13 +5,13 @@ import * as cloudly from '../../ts/index.js';
const stopFunctions: Array<() => Promise<void>> = []; const stopFunctions: Array<() => Promise<void>> = [];
const tapToolsNodeMod = await import('@push.rocks/tapbundle/node'); const tapToolsNodeMod = await import('@git.zone/tstest/tapbundle_node');
const smartmongo = await tapToolsNodeMod.tapNodeTools.createSmartmongo(); const smartmongo = await tapToolsNodeMod.tapNodeTools.createSmartmongo();
stopFunctions.push(async () => { stopFunctions.push(async () => {
await smartmongo.stopAndDumpToDir('./.nogit/mongodump'); await smartmongo.stopAndDumpToDir('./.nogit/mongodump');
}); });
const smarts3 = await tapToolsNodeMod.tapNodeTools.createSmarts3(); const smarts3 = await tapToolsNodeMod.tapNodeTools.createSmarts3();
await smarts3.createBucket('cloudly-test'); await smarts3.createBucket('cloudly_test_bucket');
stopFunctions.push(async () => { stopFunctions.push(async () => {
await smarts3.stop(); await smarts3.stop();
}); });
@@ -23,7 +23,9 @@ export const testCloudlyConfig: cloudly.ICloudlyConfig = {
publicUrl: '127.0.0.1', publicUrl: '127.0.0.1',
publicPort: '8080', publicPort: '8080',
mongoDescriptor: await smartmongo.getMongoDescriptor(), mongoDescriptor: await smartmongo.getMongoDescriptor(),
s3Descriptor: await smarts3.getS3Descriptor(), s3Descriptor: await smarts3.getS3Descriptor({
bucketName: 'cloudly_test_bucket'
}),
sslMode: 'none', sslMode: 'none',
...(() => { ...(() => {
if (process.env.NPMCI_SECRET01) { if (process.env.NPMCI_SECRET01) {

View File

@@ -1,4 +1,4 @@
import { tap, expect } from '@push.rocks/tapbundle'; import { tap, expect } from '@git.zone/tstest/tapbundle';
import * as helpers from './helpers/index.js'; import * as helpers from './helpers/index.js';
import * as cloudly from '../ts/index.js'; import * as cloudly from '../ts/index.js';

View File

@@ -1,4 +1,4 @@
import { expect, tap } from '@push.rocks/tapbundle'; import { expect, tap } from '@git.zone/tstest/tapbundle';
import * as helpers from './helpers/index.js'; import * as helpers from './helpers/index.js';
import * as cloudly from '../ts/index.js'; import * as cloudly from '../ts/index.js';

View File

@@ -29,16 +29,17 @@ export class CloudlyConfig {
publicPort: 'SERVEZONE_PORT', publicPort: 'SERVEZONE_PORT',
mongoDescriptor: { mongoDescriptor: {
mongoDbUrl: 'MONGODB_URL', mongoDbUrl: 'MONGODB_URL',
mongoDbName: 'MONGODB_DATABASE', mongoDbName: 'MONGODB_NAME',
mongoDbUser: 'MONGODB_USER', mongoDbUser: 'MONGODB_USER',
mongoDbPass: 'MONGODB_PASSWORD', mongoDbPass: 'MONGODB_PASS',
}, },
s3Descriptor: { s3Descriptor: {
endpoint: 'S3_ENDPOINT', endpoint: 'S3_ENDPOINT',
accessKey: 'S3_ACCESSKEY', accessKey: 'S3_ACCESSKEY',
accessSecret: 'S3_SECRETKEY', accessSecret: 'S3_SECRETKEY',
port: 'S3_PORT', // Note: This will remain as a string. Ensure to parse it to an integer where it's used. port: 'S3_PORT', // Note: This will remain as a string. Ensure to parse it to an integer where it's used.
useSsl: true, useSsl: 'boolean:S3_USESSL' as any as boolean,
bucketName: 'S3_BUCKET'
}, },
sslMode: sslMode:
'SERVEZONE_SSLMODE' as plugins.servezoneInterfaces.data.ICloudlyConfig['sslMode'], 'SERVEZONE_SSLMODE' as plugins.servezoneInterfaces.data.ICloudlyConfig['sslMode'],

View File

@@ -156,7 +156,7 @@ export class ImageManager {
this.smartbucketInstance = new plugins.smartbucket.SmartBucket( this.smartbucketInstance = new plugins.smartbucket.SmartBucket(
this.cloudlyRef.config.data.s3Descriptor, this.cloudlyRef.config.data.s3Descriptor,
); );
const bucket = await this.smartbucketInstance.getBucketByName('cloudly-test'); const bucket = await this.smartbucketInstance.getBucketByName(s3Descriptor.bucketName);
await bucket.fastPut({ path: 'images/00init', contents: 'init' }); await bucket.fastPut({ path: 'images/00init', contents: 'init' });
this.imageDir = await bucket.getDirectoryFromPath({ this.imageDir = await bucket.getDirectoryFromPath({