Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
f80b8decbc | |||
28cd6d1b49 | |||
899e5b0a7d | |||
0eff7c7510 | |||
7789348f4e | |||
66a23a515b | |||
7c1082f5a9 | |||
15ea5adec6 | |||
da0dddcceb | |||
b5433e412f | |||
7eb6bf794c | |||
b244518fcb | |||
95d0396abb | |||
a830299cc9 | |||
10fc1d7fba | |||
614ed78928 | |||
ea7f6a6477 | |||
2d746a9d1c | |||
a9fab24961 | |||
5548d5a72d | |||
6b52e05a86 | |||
87e273c30e |
@ -6,13 +6,14 @@ on:
|
||||
- '*'
|
||||
|
||||
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_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
||||
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
||||
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
|
||||
NPMCI_LOGIN_DOCKER_GITEA: ${{ github.server_url }}|${{ gitea.repository_owner }}|${{ secrets.GITEA_TOKEN }}
|
||||
NPMCI_LOGIN_DOCKER_DOCKERREGISTRY: ${{ secrets.NPMCI_LOGIN_DOCKER_DOCKERREGISTRY }}
|
||||
NPMCI_SECRET01: ${{ secrets.NPMCI_SECRET01 }}
|
||||
|
||||
jobs:
|
||||
security:
|
||||
|
@ -0,0 +1 @@
|
||||
FROM serve.zone/cloudly:latest
|
||||
|
65
changelog.md
65
changelog.md
@ -1,5 +1,70 @@
|
||||
# Changelog
|
||||
|
||||
## 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)
|
||||
Corrected description and devDependencies
|
||||
|
||||
|
19
license
Normal file
19
license
Normal 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.
|
@ -2,9 +2,9 @@
|
||||
"npmci": {
|
||||
"npmGlobalTools": [],
|
||||
"npmAccessLevel": "public",
|
||||
"npmRegistryUrl": "verdaccio.lossless.one",
|
||||
"npmRegistryUrl": "verdaccio.lossless.digital",
|
||||
"dockerRegistryRepoMap": {
|
||||
"registry.gitlab.com": "losslessone/services/servezone/cloudly"
|
||||
"code.foss.global": "serve.zone/cloudly"
|
||||
},
|
||||
"dockerBuildargEnvMap": {
|
||||
"NPMCI_TOKEN_NPM2": "NPMCI_TOKEN_NPM2"
|
||||
|
12
package.json
12
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@serve.zone/cloudly",
|
||||
"version": "4.1.2",
|
||||
"version": "4.3.7",
|
||||
"private": false,
|
||||
"description": "A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.",
|
||||
"type": "module",
|
||||
@ -22,14 +22,14 @@
|
||||
"docs": "tsdoc aidoc"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@git.zone/tsbuild": "^2.1.85",
|
||||
"@git.zone/tsbuild": "^2.2.0",
|
||||
"@git.zone/tsbundle": "^2.1.0",
|
||||
"@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/tswatch": "^2.0.25",
|
||||
"@push.rocks/tapbundle": "^5.3.0",
|
||||
"@types/node": "^22.8.2"
|
||||
"@push.rocks/tapbundle": "^5.4.3",
|
||||
"@types/node": "^22.9.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@api.global/typedrequest": "3.1.10",
|
||||
@ -45,7 +45,7 @@
|
||||
"@design.estate/dees-element": "^2.0.39",
|
||||
"@git.zone/tsrun": "^1.3.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/qenv": "^6.0.5",
|
||||
"@push.rocks/smartacme": "^5.0.0",
|
||||
|
1090
pnpm-lock.yaml
generated
1090
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -3,25 +3,46 @@ const testQenv = new Qenv('./', './.nogit/');
|
||||
|
||||
import * as cloudly from '../../ts/index.js';
|
||||
|
||||
const stopFunctions: Array<() => Promise<void>> = [];
|
||||
|
||||
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'),
|
||||
environment: 'integration',
|
||||
letsEncryptEmail: 'test@serve.zone',
|
||||
publicUrl: '127.0.0.1',
|
||||
publicPort: '8080',
|
||||
mongoDescriptor: await smartmongo.getMongoDescriptor(),
|
||||
s3Descriptor: await smarts3.getS3Descriptor(),
|
||||
sslMode: 'none',
|
||||
...(() => {
|
||||
if (process.env.NPMCI_SECRET01) {
|
||||
return {
|
||||
hetznerToken: process.env.NPMCI_SECRET01,
|
||||
};
|
||||
}
|
||||
})(),
|
||||
};
|
||||
|
||||
export const createCloudly = async () => {
|
||||
const cloudlyConfig: cloudly.ICloudlyConfig = {
|
||||
cfToken: await testQenv.getEnvVarOnDemand('CF_TOKEN'),
|
||||
environment: 'integration',
|
||||
letsEncryptEmail: await testQenv.getEnvVarOnDemand('LETSENCRYPT_EMAIL'),
|
||||
publicUrl: await testQenv.getEnvVarOnDemand('SERVEZONE_URL'),
|
||||
publicPort: await testQenv.getEnvVarOnDemand('SERVEZONE_PORT'),
|
||||
mongoDescriptor: {
|
||||
mongoDbName: await testQenv.getEnvVarOnDemand('MONGODB_DATABASE'),
|
||||
mongoDbUser: await testQenv.getEnvVarOnDemand('MONGODB_USER'),
|
||||
mongoDbPass: await testQenv.getEnvVarOnDemand('MONGODB_PASSWORD'),
|
||||
mongoDbUrl: await testQenv.getEnvVarOnDemand('MONGODB_URL'),
|
||||
},
|
||||
};
|
||||
const cloudlyInstance = new cloudly.Cloudly();
|
||||
const cloudlyInstance = new cloudly.Cloudly(testCloudlyConfig);
|
||||
return cloudlyInstance;
|
||||
}
|
||||
};
|
||||
|
||||
export const stopCloudly = async () => {
|
||||
await Promise.all(stopFunctions.map((stopFunction) => stopFunction()));
|
||||
};
|
||||
|
||||
export const getEnvVarOnDemand = async (envVarName: string) => {
|
||||
return testQenv.getEnvVarOnDemand(envVarName);
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -33,7 +33,7 @@ tap.preTask('should create a new machine user for testing', async () => {
|
||||
tap.test('should create a new cloudlyApiClient', async () => {
|
||||
testClient = new cloudlyApiClient.CloudlyApiClient({
|
||||
registerAs: 'api',
|
||||
cloudlyUrl: `http://localhost:${await helpers.getEnvVarOnDemand('SERVEZONE_PORT')}`,
|
||||
cloudlyUrl: `http://localhost:${helpers.testCloudlyConfig.publicPort}`,
|
||||
});
|
||||
await testClient.start();
|
||||
expect(testClient).toBeTruthy();
|
||||
@ -73,6 +73,7 @@ tap.test('should upload an image version', async () => {
|
||||
|
||||
tap.test('should stop the apiclient', async (toolsArg) => {
|
||||
await toolsArg.delayFor(10000);
|
||||
await helpers.stopCloudly();
|
||||
await testClient.stop();
|
||||
await testCloudly.stop();
|
||||
})
|
||||
|
@ -14,8 +14,10 @@ tap.test('should init cloudly', async () => {
|
||||
});
|
||||
|
||||
tap.test('should end the service', async (tools) => {
|
||||
await tools.delayFor(5000);
|
||||
await helpers.stopCloudly();
|
||||
await testCloudly.stop();
|
||||
tools.delayFor(1000).then(() => process.exit())
|
||||
tools.delayFor(1000).then(() => process.exit());
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@serve.zone/cloudly',
|
||||
version: '4.1.2',
|
||||
version: '4.3.7',
|
||||
description: 'A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.'
|
||||
}
|
||||
|
@ -60,7 +60,9 @@ export class Cloudly {
|
||||
|
||||
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.config = new CloudlyConfig(this);
|
||||
|
||||
@ -90,7 +92,7 @@ export class Cloudly {
|
||||
*/
|
||||
public async start() {
|
||||
// config
|
||||
await this.config.init();
|
||||
await this.config.init(this.configOptions);
|
||||
|
||||
// manageers
|
||||
await this.authManager.start();
|
||||
|
@ -15,7 +15,7 @@ export class CloudlyConfig {
|
||||
this.cloudlyRef = cloudlyRefArg;
|
||||
}
|
||||
|
||||
public async init() {
|
||||
public async init(configArg?: plugins.servezoneInterfaces.data.ICloudlyConfig) {
|
||||
this.appData =
|
||||
await plugins.npmextra.AppData.createAndInit<plugins.servezoneInterfaces.data.ICloudlyConfig>(
|
||||
{
|
||||
@ -54,6 +54,7 @@ export class CloudlyConfig {
|
||||
'environment',
|
||||
'mongoDescriptor',
|
||||
],
|
||||
overwriteObject: configArg,
|
||||
},
|
||||
);
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"order": 1,
|
||||
"name": "@serve.zone/api",
|
||||
"dependencies": [
|
||||
"@serve.zone/interfaces",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"order": 0,
|
||||
"name": "@serve.zone/interfaces",
|
||||
"dependencies": [
|
||||
"@api.global/typedrequest-interfaces",
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@serve.zone/cloudly',
|
||||
version: '4.1.2',
|
||||
version: '4.3.7',
|
||||
description: 'A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.'
|
||||
}
|
||||
|
@ -10,13 +10,13 @@
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@serve.zone/api": [
|
||||
"./ts_apiclient/index.ts"
|
||||
"./ts_apiclient/index.js"
|
||||
],
|
||||
"@serve.zone/cli": [
|
||||
"./ts_cliclient/index.ts"
|
||||
"./ts_cliclient/index.js"
|
||||
],
|
||||
"@serve.zone/interfaces": [
|
||||
"./ts_interfaces/index.ts"
|
||||
"./ts_interfaces/index.js"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user