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:
43
package.json
43
package.json
@@ -13,7 +13,7 @@
|
||||
"author": "Task Venture Capital GmbH",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "(tstest test/)",
|
||||
"test": "(tstest test/ --verbose --logfile --timeout 120)",
|
||||
"build": "tsbuild tsfolders --web --allowimplicitany && tsbundle website --production",
|
||||
"start": "node cli.js",
|
||||
"startTs": "node cli.ts.js",
|
||||
@@ -22,45 +22,44 @@
|
||||
"docs": "tsdoc aidoc"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@git.zone/tsbuild": "^2.3.2",
|
||||
"@git.zone/tsbundle": "^2.2.5",
|
||||
"@git.zone/tsdoc": "^1.4.4",
|
||||
"@git.zone/tspublish": "^1.9.1",
|
||||
"@git.zone/tstest": "^1.0.96",
|
||||
"@git.zone/tswatch": "^2.1.0",
|
||||
"@push.rocks/tapbundle": "^5.6.3",
|
||||
"@types/node": "^22.15.2"
|
||||
"@git.zone/tsbuild": "^2.6.7",
|
||||
"@git.zone/tsbundle": "^2.5.1",
|
||||
"@git.zone/tsdoc": "^1.5.1",
|
||||
"@git.zone/tspublish": "^1.10.3",
|
||||
"@git.zone/tstest": "^2.3.5",
|
||||
"@git.zone/tswatch": "^2.2.1",
|
||||
"@types/node": "^24.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@api.global/typedrequest": "3.1.10",
|
||||
"@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",
|
||||
"@apiclient.xyz/cloudflare": "^6.0.1",
|
||||
"@apiclient.xyz/cloudflare": "^6.4.1",
|
||||
"@apiclient.xyz/docker": "^1.3.0",
|
||||
"@apiclient.xyz/hetznercloud": "^1.2.0",
|
||||
"@apiclient.xyz/slack": "^3.0.9",
|
||||
"@design.estate/dees-catalog": "^1.8.0",
|
||||
"@design.estate/dees-domtools": "^2.3.2",
|
||||
"@design.estate/dees-element": "^2.0.42",
|
||||
"@design.estate/dees-catalog": "^1.10.10",
|
||||
"@design.estate/dees-domtools": "^2.3.3",
|
||||
"@design.estate/dees-element": "^2.1.2",
|
||||
"@git.zone/tsrun": "^1.3.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/qenv": "^6.1.0",
|
||||
"@push.rocks/qenv": "^6.1.3",
|
||||
"@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/smartclickhouse": "^2.0.17",
|
||||
"@push.rocks/smartdata": "^5.15.1",
|
||||
"@push.rocks/smartdata": "^5.16.1",
|
||||
"@push.rocks/smartdelay": "^3.0.5",
|
||||
"@push.rocks/smartexit": "^1.0.23",
|
||||
"@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/smartjson": "^5.0.19",
|
||||
"@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-interfaces": "^3.0.2",
|
||||
"@push.rocks/smartpath": "^5.0.18",
|
||||
@@ -68,13 +67,13 @@
|
||||
"@push.rocks/smartrequest": "^2.1.0",
|
||||
"@push.rocks/smartrx": "^3.0.10",
|
||||
"@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/smartstring": "^4.0.15",
|
||||
"@push.rocks/smartunique": "^3.0.9",
|
||||
"@push.rocks/taskbuffer": "^3.0.2",
|
||||
"@push.rocks/webjwt": "^1.0.9",
|
||||
"@tsclass/tsclass": "^9.0.0"
|
||||
"@tsclass/tsclass": "^9.2.0"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
|
7182
pnpm-lock.yaml
generated
7182
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -8,4 +8,12 @@
|
||||
`code.foss.global/serve.zone/cloudly:latest`
|
||||
|
||||
- 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
|
@@ -5,13 +5,13 @@ import * as cloudly from '../../ts/index.js';
|
||||
|
||||
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();
|
||||
stopFunctions.push(async () => {
|
||||
await smartmongo.stopAndDumpToDir('./.nogit/mongodump');
|
||||
});
|
||||
const smarts3 = await tapToolsNodeMod.tapNodeTools.createSmarts3();
|
||||
await smarts3.createBucket('cloudly-test');
|
||||
await smarts3.createBucket('cloudly_test_bucket');
|
||||
stopFunctions.push(async () => {
|
||||
await smarts3.stop();
|
||||
});
|
||||
@@ -23,7 +23,9 @@ export const testCloudlyConfig: cloudly.ICloudlyConfig = {
|
||||
publicUrl: '127.0.0.1',
|
||||
publicPort: '8080',
|
||||
mongoDescriptor: await smartmongo.getMongoDescriptor(),
|
||||
s3Descriptor: await smarts3.getS3Descriptor(),
|
||||
s3Descriptor: await smarts3.getS3Descriptor({
|
||||
bucketName: 'cloudly_test_bucket'
|
||||
}),
|
||||
sslMode: 'none',
|
||||
...(() => {
|
||||
if (process.env.NPMCI_SECRET01) {
|
||||
|
@@ -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 cloudly from '../ts/index.js';
|
||||
|
@@ -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 cloudly from '../ts/index.js';
|
||||
|
@@ -29,16 +29,17 @@ export class CloudlyConfig {
|
||||
publicPort: 'SERVEZONE_PORT',
|
||||
mongoDescriptor: {
|
||||
mongoDbUrl: 'MONGODB_URL',
|
||||
mongoDbName: 'MONGODB_DATABASE',
|
||||
mongoDbName: 'MONGODB_NAME',
|
||||
mongoDbUser: 'MONGODB_USER',
|
||||
mongoDbPass: 'MONGODB_PASSWORD',
|
||||
mongoDbPass: 'MONGODB_PASS',
|
||||
},
|
||||
s3Descriptor: {
|
||||
endpoint: 'S3_ENDPOINT',
|
||||
accessKey: 'S3_ACCESSKEY',
|
||||
accessSecret: 'S3_SECRETKEY',
|
||||
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:
|
||||
'SERVEZONE_SSLMODE' as plugins.servezoneInterfaces.data.ICloudlyConfig['sslMode'],
|
||||
|
@@ -156,7 +156,7 @@ export class ImageManager {
|
||||
this.smartbucketInstance = new plugins.smartbucket.SmartBucket(
|
||||
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' });
|
||||
|
||||
this.imageDir = await bucket.getDirectoryFromPath({
|
||||
|
Reference in New Issue
Block a user