Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions server/lib/traefik/TraefikConfigManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,11 @@ export function isDomainCoveredByWildcard(
): boolean {
for (const [certDomain, state] of lastLocalCertificateState) {
if (state.exists && state.wildcard) {
// If it's an exact match
if (domain === certDomain) {
return true;
}

// If stored as example.com but is wildcard, check subdomains
if (domain.endsWith("." + certDomain)) {
// Check that it's only one level deep (wildcard only covers one level)
Expand Down
26 changes: 11 additions & 15 deletions server/lib/traefik/getTraefikConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,19 +469,17 @@ export async function getTraefikConfig(
};
}

// Check if any sites are online
// THIS IS SO THAT THERE IS SOME IMMEDIATE FEEDBACK
// EVEN IF THE SITES HAVE NOT UPDATED YET FROM THE
// RECEIVE BANDWIDTH ENDPOINT.

// TODO: HOW TO HANDLE ^^^^^^ BETTER
const anySitesOnline = targets.some((target) => target.site.online);

config_output.http.services![serviceName] = {
loadBalancer: {
servers: (() => {
// Check if any sites are online
// THIS IS SO THAT THERE IS SOME IMMEDIATE FEEDBACK
// EVEN IF THE SITES HAVE NOT UPDATED YET FROM THE
// RECEIVE BANDWIDTH ENDPOINT.

// TODO: HOW TO HANDLE ^^^^^^ BETTER
const anySitesOnline = targets.some(
(target) => target.site.online
);

return (
targets
.filter((target) => {
Expand Down Expand Up @@ -602,14 +600,12 @@ export async function getTraefikConfig(

const ppPrefix = config.getRawConfig().traefik.pp_transport_prefix;

// Check if any sites are online
const anySitesOnline = targets.some((target) => target.site.online);

config_output[protocol].services[serviceName] = {
loadBalancer: {
servers: (() => {
// Check if any sites are online
const anySitesOnline = targets.some(
(target) => target.site.online
);

return targets
.filter((target) => {
if (!target.enabled) {
Expand Down
Loading