Compare commits

..

24 Commits

Author SHA1 Message Date
26490e8ddd 4.3.8
Some checks failed
Docker (tags) / security (push) Successful in 53s
Docker (tags) / test (push) Failing after 2m10s
Docker (tags) / release (push) Has been skipped
Docker (tags) / metadata (push) Has been skipped
2024-11-06 16:59:18 +01:00
38d2120c35 fix(api client): Fixed localhost URL issue in test.client.ts 2024-11-06 16:59:17 +01:00
f80b8decbc 4.3.7
Some checks failed
Docker (tags) / security (push) Successful in 59s
Docker (tags) / test (push) Failing after 2m4s
Docker (tags) / release (push) Has been skipped
Docker (tags) / metadata (push) Has been skipped
2024-11-06 16:53:22 +01:00
28cd6d1b49 fix(tests): Refactored test setup for consistency and isolated config initialization. 2024-11-06 16:53:21 +01:00
899e5b0a7d 4.3.6
Some checks failed
Docker (tags) / security (push) Successful in 55s
Docker (tags) / test (push) Failing after 2m8s
Docker (tags) / release (push) Has been skipped
Docker (tags) / metadata (push) Has been skipped
2024-11-06 16:22:38 +01:00
0eff7c7510 fix(test): Enhance test helpers with dynamic Hetzner token retrieval. 2024-11-06 16:22:38 +01:00
7789348f4e 4.3.5
Some checks failed
Docker (tags) / security (push) Successful in 1m2s
Docker (tags) / test (push) Failing after 2m8s
Docker (tags) / release (push) Has been skipped
Docker (tags) / metadata (push) Has been skipped
2024-11-06 16:13:55 +01:00
66a23a515b fix(helpers): Add missing sslMode configuration to Cloudly config. 2024-11-06 16:13:54 +01:00
7c1082f5a9 4.3.4
Some checks failed
Docker (tags) / security (push) Successful in 1m0s
Docker (tags) / test (push) Failing after 2m5s
Docker (tags) / release (push) Has been skipped
Docker (tags) / metadata (push) Has been skipped
2024-11-06 03:56:46 +01:00
15ea5adec6 fix(testing): Fixed Cloudly testing setup and dependencies 2024-11-06 03:56:46 +01:00
da0dddcceb 4.3.3
Some checks failed
Docker (tags) / security (push) Successful in 1m0s
Docker (tags) / test (push) Failing after 1m37s
Docker (tags) / release (push) Has been skipped
Docker (tags) / metadata (push) Has been skipped
2024-11-05 21:31:16 +01:00
b5433e412f fix(core): Fix configuration initialization by accepting a config argument 2024-11-05 21:31:15 +01:00
7eb6bf794c 4.3.2
Some checks failed
Docker (tags) / security (push) Successful in 42s
Docker (tags) / test (push) Failing after 1m46s
Docker (tags) / release (push) Has been skipped
Docker (tags) / metadata (push) Has been skipped
2024-11-05 02:45:04 +01:00
b244518fcb fix(npmextra): Updated npm registry URL in npmextra.json 2024-11-05 02:45:04 +01:00
95d0396abb 4.3.1
Some checks failed
Docker (tags) / security (push) Successful in 58s
Docker (tags) / test (push) Failing after 3m59s
Docker (tags) / release (push) Has been skipped
Docker (tags) / metadata (push) Has been skipped
2024-11-05 02:21:06 +01:00
a830299cc9 fix(package): Update dependency version for @git.zone/tspublish 2024-11-05 02:21:06 +01:00
10fc1d7fba 4.3.0
Some checks failed
Docker (tags) / security (push) Failing after 23s
Docker (tags) / test (push) Has been skipped
Docker (tags) / release (push) Has been skipped
Docker (tags) / metadata (push) Has been skipped
2024-11-05 02:06:44 +01:00
614ed78928 feat(dependencies): Upgrade dependencies and include publish orders 2024-11-05 02:06:44 +01:00
ea7f6a6477 4.2.1
Some checks failed
Docker (tags) / security (push) Failing after 27s
Docker (tags) / test (push) Has been skipped
Docker (tags) / release (push) Has been skipped
Docker (tags) / metadata (push) Has been skipped
2024-11-04 19:24:47 +01:00
2d746a9d1c fix(config): Fix Docker image URL in Gitea workflow. 2024-11-04 19:24:47 +01:00
a9fab24961 4.2.0
Some checks failed
Docker (tags) / security (push) Failing after 1s
Docker (tags) / test (push) Has been skipped
Docker (tags) / release (push) Has been skipped
Docker (tags) / metadata (push) Has been skipped
2024-11-04 19:23:45 +01:00
5548d5a72d feat(cloudron): Add Dockerfile for Cloudron deployment 2024-11-04 19:23:45 +01:00
6b52e05a86 4.1.3
Some checks failed
Docker (tags) / security (push) Failing after 0s
Docker (tags) / test (push) Has been skipped
Docker (tags) / release (push) Has been skipped
Docker (tags) / metadata (push) Has been skipped
2024-10-28 21:54:55 +01:00
87e273c30e fix(dependency): Updated dependency @git.zone/tspublish to version ^1.6.0 2024-10-28 21:54:55 +01:00
17 changed files with 983 additions and 299 deletions

View File

@ -6,13 +6,14 @@ on:
- '*' - '*'
env: env:
IMAGE: code.foss.global/hosttoday/ht-docker-node:npmci IMAGE: code.foss.global/host.today/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}} NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}} NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}} NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_LOGIN_DOCKER_GITEA: ${{ github.server_url }}|${{ gitea.repository_owner }}|${{ secrets.GITEA_TOKEN }} NPMCI_LOGIN_DOCKER_GITEA: ${{ github.server_url }}|${{ gitea.repository_owner }}|${{ secrets.GITEA_TOKEN }}
NPMCI_LOGIN_DOCKER_DOCKERREGISTRY: ${{ secrets.NPMCI_LOGIN_DOCKER_DOCKERREGISTRY }} NPMCI_LOGIN_DOCKER_DOCKERREGISTRY: ${{ secrets.NPMCI_LOGIN_DOCKER_DOCKERREGISTRY }}
NPMCI_SECRET01: ${{ secrets.NPMCI_SECRET01 }}
jobs: jobs:
security: security:

View File

@ -0,0 +1 @@
FROM serve.zone/cloudly:latest

View File

@ -1,5 +1,75 @@
# Changelog # Changelog
## 2024-11-06 - 4.3.8 - fix(api client)
Fixed localhost URL issue in test.client.ts
- Changed the cloudlyUrl in test.client.ts from 'localhost' to '127.0.0.1' to ensure consistency in network requests.
## 2024-11-06 - 4.3.7 - fix(tests)
Refactored test setup for consistency and isolated config initialization.
- test/helpers/cloudlyfactory.ts: Test configuration setup was refactored to ensure consistent initialization of cloudly configuration across tests.
- test/test.apiclient.ts: Updated cloudlyApiClient test setup to use testCloudlyConfig for dynamic port allocation.
## 2024-11-06 - 4.3.6 - fix(test)
Enhance test helpers with dynamic Hetzner token retrieval.
- Updated test/helpers/cloudlyfactory.ts to retrieve Hetzner token from environment variables.
- Expanded docker_tags workflow to securely handle and pass new environment secrets.
## 2024-11-06 - 4.3.5 - fix(helpers)
Add missing sslMode configuration to Cloudly config.
- Added the sslMode key with a value of 'none' to the Cloudly configuration object in test/helpers/cloudlyfactory.ts.
## 2024-11-06 - 4.3.4 - fix(testing)
Fixed Cloudly testing setup and dependencies
- Updated devDependency @push.rocks/tapbundle version from ^5.3.0 to ^5.4.3 in package.json.
- Updated devDependency @push.rocks/npmextra version from ^5.1.1 to ^5.1.2 in package.json.
- Improved the Cloudly test suite setup to ensure proper initialization of MongoDB and S3 services.
- Ensured asynchronous stopping and cleanup of MongoDB and S3 services post-test execution.
## 2024-11-05 - 4.3.3 - fix(core)
Fix configuration initialization by accepting a config argument
- Configuration initialization now accepts an optional config argument
- Updated test cloudly factory to use default public URL and port
- Updated dependencies versions
## 2024-11-05 - 4.3.2 - fix(npmextra)
Updated npm registry URL in npmextra.json
## 2024-11-05 - 4.3.1 - fix(package)
Update dependency version for @git.zone/tspublish
- Bump @git.zone/tspublish from version ^1.7.6 to ^1.7.7 in package.json
## 2024-11-05 - 4.3.0 - feat(dependencies)
Upgrade dependencies and include publish orders
- Upgraded @git.zone/tsbuild to version ^2.2.0
- Upgraded @git.zone/tspublish to version ^1.7.6
- Upgraded @types/node to version ^22.8.7
- Added publish order to ts_apiclient/tspublish.json and ts_interfaces/tspublish.json
## 2024-11-04 - 4.2.1 - fix(config)
Fix Docker image URL in Gitea workflow.
- Corrected the IMAGE URL from 'hosttoday' to 'host.today'.
## 2024-11-04 - 4.2.0 - feat(cloudron)
Add Dockerfile for Cloudron deployment
- Introduced a new Dockerfile for Cloudron deployment.
- The Dockerfile uses the latest version of cloudly as a base image.
## 2024-10-28 - 4.1.3 - fix(dependency)
Updated dependency @git.zone/tspublish to version ^1.6.0
- Bumped @git.zone/tspublish version from ^1.5.5 to ^1.6.0 in package.json
## 2024-10-28 - 4.1.2 - fix(core) ## 2024-10-28 - 4.1.2 - fix(core)
Corrected description and devDependencies Corrected description and devDependencies

19
license Normal file
View File

@ -0,0 +1,19 @@
Copyright (c) 2014 Task Venture Capital GmbH (hello@task.vc)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -2,9 +2,9 @@
"npmci": { "npmci": {
"npmGlobalTools": [], "npmGlobalTools": [],
"npmAccessLevel": "public", "npmAccessLevel": "public",
"npmRegistryUrl": "verdaccio.lossless.one", "npmRegistryUrl": "verdaccio.lossless.digital",
"dockerRegistryRepoMap": { "dockerRegistryRepoMap": {
"registry.gitlab.com": "losslessone/services/servezone/cloudly" "code.foss.global": "serve.zone/cloudly"
}, },
"dockerBuildargEnvMap": { "dockerBuildargEnvMap": {
"NPMCI_TOKEN_NPM2": "NPMCI_TOKEN_NPM2" "NPMCI_TOKEN_NPM2": "NPMCI_TOKEN_NPM2"

View File

@ -1,6 +1,6 @@
{ {
"name": "@serve.zone/cloudly", "name": "@serve.zone/cloudly",
"version": "4.1.2", "version": "4.3.8",
"private": false, "private": false,
"description": "A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.", "description": "A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.",
"type": "module", "type": "module",
@ -22,14 +22,14 @@
"docs": "tsdoc aidoc" "docs": "tsdoc aidoc"
}, },
"devDependencies": { "devDependencies": {
"@git.zone/tsbuild": "^2.1.85", "@git.zone/tsbuild": "^2.2.0",
"@git.zone/tsbundle": "^2.1.0", "@git.zone/tsbundle": "^2.1.0",
"@git.zone/tsdoc": "^1.4.2", "@git.zone/tsdoc": "^1.4.2",
"@git.zone/tspublish": "^1.5.5", "@git.zone/tspublish": "^1.7.7",
"@git.zone/tstest": "^1.0.90", "@git.zone/tstest": "^1.0.90",
"@git.zone/tswatch": "^2.0.25", "@git.zone/tswatch": "^2.0.25",
"@push.rocks/tapbundle": "^5.3.0", "@push.rocks/tapbundle": "^5.4.3",
"@types/node": "^22.8.2" "@types/node": "^22.9.0"
}, },
"dependencies": { "dependencies": {
"@api.global/typedrequest": "3.1.10", "@api.global/typedrequest": "3.1.10",
@ -45,7 +45,7 @@
"@design.estate/dees-element": "^2.0.39", "@design.estate/dees-element": "^2.0.39",
"@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.0.23", "@push.rocks/npmextra": "^5.1.2",
"@push.rocks/projectinfo": "^5.0.1", "@push.rocks/projectinfo": "^5.0.1",
"@push.rocks/qenv": "^6.0.5", "@push.rocks/qenv": "^6.0.5",
"@push.rocks/smartacme": "^5.0.0", "@push.rocks/smartacme": "^5.0.0",

1090
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -3,25 +3,46 @@ const testQenv = new Qenv('./', './.nogit/');
import * as cloudly from '../../ts/index.js'; import * as cloudly from '../../ts/index.js';
export const createCloudly = async () => { const stopFunctions: Array<() => Promise<void>> = [];
const cloudlyConfig: cloudly.ICloudlyConfig = {
const tapToolsNodeMod = await import('@push.rocks/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');
stopFunctions.push(async () => {
await smarts3.stop();
});
export const testCloudlyConfig: cloudly.ICloudlyConfig = {
cfToken: await testQenv.getEnvVarOnDemand('CF_TOKEN'), cfToken: await testQenv.getEnvVarOnDemand('CF_TOKEN'),
environment: 'integration', environment: 'integration',
letsEncryptEmail: await testQenv.getEnvVarOnDemand('LETSENCRYPT_EMAIL'), letsEncryptEmail: 'test@serve.zone',
publicUrl: await testQenv.getEnvVarOnDemand('SERVEZONE_URL'), publicUrl: '127.0.0.1',
publicPort: await testQenv.getEnvVarOnDemand('SERVEZONE_PORT'), publicPort: '8080',
mongoDescriptor: { mongoDescriptor: await smartmongo.getMongoDescriptor(),
mongoDbName: await testQenv.getEnvVarOnDemand('MONGODB_DATABASE'), s3Descriptor: await smarts3.getS3Descriptor(),
mongoDbUser: await testQenv.getEnvVarOnDemand('MONGODB_USER'), sslMode: 'none',
mongoDbPass: await testQenv.getEnvVarOnDemand('MONGODB_PASSWORD'), ...(() => {
mongoDbUrl: await testQenv.getEnvVarOnDemand('MONGODB_URL'), if (process.env.NPMCI_SECRET01) {
}, return {
hetznerToken: process.env.NPMCI_SECRET01,
}; };
const cloudlyInstance = new cloudly.Cloudly(); }
})(),
};
export const createCloudly = async () => {
const cloudlyInstance = new cloudly.Cloudly(testCloudlyConfig);
return cloudlyInstance; return cloudlyInstance;
} };
export const stopCloudly = async () => {
await Promise.all(stopFunctions.map((stopFunction) => stopFunction()));
};
export const getEnvVarOnDemand = async (envVarName: string) => { export const getEnvVarOnDemand = async (envVarName: string) => {
return testQenv.getEnvVarOnDemand(envVarName); return testQenv.getEnvVarOnDemand(envVarName);
} };

View File

@ -33,7 +33,7 @@ tap.preTask('should create a new machine user for testing', async () => {
tap.test('should create a new cloudlyApiClient', async () => { tap.test('should create a new cloudlyApiClient', async () => {
testClient = new cloudlyApiClient.CloudlyApiClient({ testClient = new cloudlyApiClient.CloudlyApiClient({
registerAs: 'api', registerAs: 'api',
cloudlyUrl: `http://localhost:${await helpers.getEnvVarOnDemand('SERVEZONE_PORT')}`, cloudlyUrl: `http://127.0.0.1:${helpers.testCloudlyConfig.publicPort}`,
}); });
await testClient.start(); await testClient.start();
expect(testClient).toBeTruthy(); expect(testClient).toBeTruthy();
@ -73,6 +73,7 @@ tap.test('should upload an image version', async () => {
tap.test('should stop the apiclient', async (toolsArg) => { tap.test('should stop the apiclient', async (toolsArg) => {
await toolsArg.delayFor(10000); await toolsArg.delayFor(10000);
await helpers.stopCloudly();
await testClient.stop(); await testClient.stop();
await testCloudly.stop(); await testCloudly.stop();
}) })

View File

@ -14,8 +14,10 @@ tap.test('should init cloudly', async () => {
}); });
tap.test('should end the service', async (tools) => { tap.test('should end the service', async (tools) => {
await tools.delayFor(5000);
await helpers.stopCloudly();
await testCloudly.stop(); await testCloudly.stop();
tools.delayFor(1000).then(() => process.exit()) tools.delayFor(1000).then(() => process.exit());
}); });
tap.start(); tap.start();

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@serve.zone/cloudly', name: '@serve.zone/cloudly',
version: '4.1.2', version: '4.3.8',
description: 'A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.' description: 'A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.'
} }

View File

@ -60,7 +60,9 @@ export class Cloudly {
private readyDeferred = new plugins.smartpromise.Deferred(); private readyDeferred = new plugins.smartpromise.Deferred();
constructor() { private configOptions: plugins.servezoneInterfaces.data.ICloudlyConfig;
constructor(configArg?: plugins.servezoneInterfaces.data.ICloudlyConfig) {
this.configOptions = configArg;
this.cloudlyInfo = new CloudlyInfo(this); this.cloudlyInfo = new CloudlyInfo(this);
this.config = new CloudlyConfig(this); this.config = new CloudlyConfig(this);
@ -90,7 +92,7 @@ export class Cloudly {
*/ */
public async start() { public async start() {
// config // config
await this.config.init(); await this.config.init(this.configOptions);
// manageers // manageers
await this.authManager.start(); await this.authManager.start();

View File

@ -15,7 +15,7 @@ export class CloudlyConfig {
this.cloudlyRef = cloudlyRefArg; this.cloudlyRef = cloudlyRefArg;
} }
public async init() { public async init(configArg?: plugins.servezoneInterfaces.data.ICloudlyConfig) {
this.appData = this.appData =
await plugins.npmextra.AppData.createAndInit<plugins.servezoneInterfaces.data.ICloudlyConfig>( await plugins.npmextra.AppData.createAndInit<plugins.servezoneInterfaces.data.ICloudlyConfig>(
{ {
@ -54,6 +54,7 @@ export class CloudlyConfig {
'environment', 'environment',
'mongoDescriptor', 'mongoDescriptor',
], ],
overwriteObject: configArg,
}, },
); );

View File

@ -1,4 +1,5 @@
{ {
"order": 1,
"name": "@serve.zone/api", "name": "@serve.zone/api",
"dependencies": [ "dependencies": [
"@serve.zone/interfaces", "@serve.zone/interfaces",

View File

@ -1,4 +1,5 @@
{ {
"order": 0,
"name": "@serve.zone/interfaces", "name": "@serve.zone/interfaces",
"dependencies": [ "dependencies": [
"@api.global/typedrequest-interfaces", "@api.global/typedrequest-interfaces",

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@serve.zone/cloudly', name: '@serve.zone/cloudly',
version: '4.1.2', version: '4.3.8',
description: 'A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.' description: 'A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.'
} }

View File

@ -10,13 +10,13 @@
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"@serve.zone/api": [ "@serve.zone/api": [
"./ts_apiclient/index.ts" "./ts_apiclient/index.js"
], ],
"@serve.zone/cli": [ "@serve.zone/cli": [
"./ts_cliclient/index.ts" "./ts_cliclient/index.js"
], ],
"@serve.zone/interfaces": [ "@serve.zone/interfaces": [
"./ts_interfaces/index.ts" "./ts_interfaces/index.js"
] ]
} }
}, },