Rename hybrid to managed

This commit is contained in:
Owen
2025-08-21 14:17:38 -07:00
parent 5ff5660db3
commit 60d8831399
17 changed files with 39 additions and 39 deletions

View File

@@ -96,8 +96,8 @@ export class Config {
if (!this.rawConfig) {
throw new Error("Config not loaded. Call load() first.");
}
if (this.rawConfig.hybrid) {
// LETS NOT WORRY ABOUT THE SERVER SECRET WHEN HYBRID
if (this.rawConfig.managed) {
// LETS NOT WORRY ABOUT THE SERVER SECRET WHEN MANAGED
return;
}
license.setServerSecret(this.rawConfig.server.secret!);
@@ -149,8 +149,8 @@ export class Config {
return false;
}
public isHybridMode() {
return typeof this.rawConfig?.hybrid === "object";
public isManagedMode() {
return typeof this.rawConfig?.managed === "object";
}
public async checkSupporterKey() {

View File

@@ -39,7 +39,7 @@ export const configSchema = z
anonymous_usage: true
}
}),
hybrid: z
managed: z
.object({
name: z.string().optional(),
id: z.string().optional(),
@@ -306,7 +306,7 @@ export const configSchema = z
return true;
}
// If hybrid is defined, domains are not required
if (data.hybrid) {
if (data.managed) {
return true;
}
if (keys.length === 0) {
@@ -321,7 +321,7 @@ export const configSchema = z
.refine(
(data) => {
// If hybrid is defined, server secret is not required
if (data.hybrid) {
if (data.managed) {
return true;
}
// If hybrid is not defined, server secret must be defined
@@ -334,7 +334,7 @@ export const configSchema = z
.refine(
(data) => {
// If hybrid is defined, dashboard_url is not required
if (data.hybrid) {
if (data.managed) {
return true;
}
// If hybrid is not defined, dashboard_url must be defined

View File

@@ -24,7 +24,7 @@ export async function getValidCertificatesForDomainsHybrid(domains: Set<string>)
try {
const response = await axios.get(
`${config.getRawConfig().hybrid?.endpoint}/api/v1/hybrid/certificates/domains`,
`${config.getRawConfig().managed?.endpoint}/api/v1/hybrid/certificates/domains`,
{
params: {
domains: domainArray

View File

@@ -18,7 +18,7 @@ export const proxyToRemote = async (
endpoint: string
): Promise<any> => {
try {
const remoteUrl = `${config.getRawConfig().hybrid?.endpoint?.replace(/\/$/, '')}/api/v1/${endpoint}`;
const remoteUrl = `${config.getRawConfig().managed?.endpoint?.replace(/\/$/, '')}/api/v1/${endpoint}`;
logger.debug(`Proxying request to remote server: ${remoteUrl}`);

View File

@@ -174,7 +174,7 @@ export class TokenManager {
this.isRefreshing = true;
try {
const hybridConfig = config.getRawConfig().hybrid;
const hybridConfig = config.getRawConfig().managed;
if (
!hybridConfig?.id ||

View File

@@ -281,7 +281,7 @@ export class TraefikConfigManager {
if (this.shouldFetchCertificates(domains)) {
// Get valid certificates for active domains
if (config.isHybridMode()) {
if (config.isManagedMode()) {
validCertificates =
await getValidCertificatesForDomainsHybrid(domains);
} else {
@@ -383,9 +383,9 @@ export class TraefikConfigManager {
} | null> {
let traefikConfig;
try {
if (config.isHybridMode()) {
if (config.isManagedMode()) {
const resp = await axios.get(
`${config.getRawConfig().hybrid?.endpoint}/api/v1/hybrid/traefik-config`,
`${config.getRawConfig().managed?.endpoint}/api/v1/hybrid/traefik-config`,
await tokenManager.getAuthHeader()
);