interfaces/ts/data/cluster.ts

58 lines
1.1 KiB
TypeScript
Raw Normal View History

2024-02-02 11:46:59 +00:00
import { type IDockerRegistryInfo, type IServiceRessources } from '../data/docker.js';
import type { IServerConfig } from './server.js';
2024-01-23 22:38:10 +00:00
export interface IClusterIdentifier {
clusterName: string;
secretKey: string;
}
2024-02-02 11:46:59 +00:00
2024-02-06 09:12:59 +00:00
export interface ICluster {
2024-02-02 11:46:59 +00:00
id: string;
data: {
name: string;
secretKey: string;
jumpCode: string;
2024-02-06 09:12:59 +00:00
/**
* when was the jump code used
* avoid replay attacks
*/
2024-02-02 11:46:59 +00:00
jumpCodeUsedAt: number;
2024-02-06 09:12:59 +00:00
2024-02-02 11:46:59 +00:00
/**
* how can the cluster reach cloudly
*/
cloudlyUrl: string;
/**
* what servers are expected to be part of the cluster
*/
servers: IServerConfig[];
/**
2024-02-06 09:12:59 +00:00
* ACME info. This is used to get SSL certificates.
2024-02-02 11:46:59 +00:00
*/
acmeInfo: {
serverAddress: string;
serverSecret: string;
};
2024-02-06 09:12:59 +00:00
/**
* Where to get the images from
*/
2024-02-02 11:46:59 +00:00
registryInfo: IDockerRegistryInfo;
};
}
2024-02-06 09:16:44 +00:00
export interface IService {
2024-02-02 11:46:59 +00:00
name: string;
image: string;
ports: {
web: number;
custom?: { [domain: string]: string };
};
resources?: IServiceRessources;
domains: string[];
secrets: { [key: string]: string };
}