mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-18 16:46:36 +00:00
Compare commits
1 Commits
dev
...
1.16.2-s.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aed86ce4ba |
@@ -286,12 +286,14 @@ export class TraefikConfigManager {
|
|||||||
// Check non-wildcard certs for expiry (within 45 days to match
|
// Check non-wildcard certs for expiry (within 45 days to match
|
||||||
// the server-side renewal window in certificate-service)
|
// the server-side renewal window in certificate-service)
|
||||||
for (const domain of domainsNeedingCerts) {
|
for (const domain of domainsNeedingCerts) {
|
||||||
const localState = this.lastLocalCertificateState.get(domain);
|
const localState =
|
||||||
|
this.lastLocalCertificateState.get(domain);
|
||||||
if (localState?.expiresAt) {
|
if (localState?.expiresAt) {
|
||||||
const nowInSeconds = Math.floor(Date.now() / 1000);
|
const nowInSeconds = Math.floor(Date.now() / 1000);
|
||||||
const secondsUntilExpiry =
|
const secondsUntilExpiry =
|
||||||
localState.expiresAt - nowInSeconds;
|
localState.expiresAt - nowInSeconds;
|
||||||
const daysUntilExpiry = secondsUntilExpiry / (60 * 60 * 24);
|
const daysUntilExpiry =
|
||||||
|
secondsUntilExpiry / (60 * 60 * 24);
|
||||||
if (daysUntilExpiry < 45) {
|
if (daysUntilExpiry < 45) {
|
||||||
logger.info(
|
logger.info(
|
||||||
`Fetching certificates due to upcoming expiry for ${domain} (${Math.round(daysUntilExpiry)} days remaining)`
|
`Fetching certificates due to upcoming expiry for ${domain} (${Math.round(daysUntilExpiry)} days remaining)`
|
||||||
@@ -304,11 +306,18 @@ export class TraefikConfigManager {
|
|||||||
// Also check wildcard certificates for expiry. These are not
|
// Also check wildcard certificates for expiry. These are not
|
||||||
// included in domainsNeedingCerts since their subdomains are
|
// included in domainsNeedingCerts since their subdomains are
|
||||||
// filtered out, so we must check them separately.
|
// filtered out, so we must check them separately.
|
||||||
for (const [certDomain, state] of this.lastLocalCertificateState) {
|
for (const [certDomain, state] of this
|
||||||
if (state.exists && state.wildcard && state.expiresAt) {
|
.lastLocalCertificateState) {
|
||||||
|
if (
|
||||||
|
state.exists &&
|
||||||
|
state.wildcard &&
|
||||||
|
state.expiresAt
|
||||||
|
) {
|
||||||
const nowInSeconds = Math.floor(Date.now() / 1000);
|
const nowInSeconds = Math.floor(Date.now() / 1000);
|
||||||
const secondsUntilExpiry = state.expiresAt - nowInSeconds;
|
const secondsUntilExpiry =
|
||||||
const daysUntilExpiry = secondsUntilExpiry / (60 * 60 * 24);
|
state.expiresAt - nowInSeconds;
|
||||||
|
const daysUntilExpiry =
|
||||||
|
secondsUntilExpiry / (60 * 60 * 24);
|
||||||
if (daysUntilExpiry < 45) {
|
if (daysUntilExpiry < 45) {
|
||||||
logger.info(
|
logger.info(
|
||||||
`Fetching certificates due to upcoming expiry for wildcard cert ${certDomain} (${Math.round(daysUntilExpiry)} days remaining)`
|
`Fetching certificates due to upcoming expiry for wildcard cert ${certDomain} (${Math.round(daysUntilExpiry)} days remaining)`
|
||||||
@@ -396,8 +405,14 @@ export class TraefikConfigManager {
|
|||||||
// their subdomains were filtered out above.
|
// their subdomains were filtered out above.
|
||||||
for (const [certDomain, state] of this
|
for (const [certDomain, state] of this
|
||||||
.lastLocalCertificateState) {
|
.lastLocalCertificateState) {
|
||||||
if (state.exists && state.wildcard && state.expiresAt) {
|
if (
|
||||||
const nowInSeconds = Math.floor(Date.now() / 1000);
|
state.exists &&
|
||||||
|
state.wildcard &&
|
||||||
|
state.expiresAt
|
||||||
|
) {
|
||||||
|
const nowInSeconds = Math.floor(
|
||||||
|
Date.now() / 1000
|
||||||
|
);
|
||||||
const secondsUntilExpiry =
|
const secondsUntilExpiry =
|
||||||
state.expiresAt - nowInSeconds;
|
state.expiresAt - nowInSeconds;
|
||||||
const daysUntilExpiry =
|
const daysUntilExpiry =
|
||||||
@@ -557,18 +572,11 @@ export class TraefikConfigManager {
|
|||||||
config.getRawConfig().server
|
config.getRawConfig().server
|
||||||
.session_cookie_name,
|
.session_cookie_name,
|
||||||
|
|
||||||
|
// deprecated
|
||||||
accessTokenQueryParam:
|
accessTokenQueryParam:
|
||||||
config.getRawConfig().server
|
config.getRawConfig().server
|
||||||
.resource_access_token_param,
|
.resource_access_token_param,
|
||||||
|
|
||||||
accessTokenIdHeader:
|
|
||||||
config.getRawConfig().server
|
|
||||||
.resource_access_token_headers.id,
|
|
||||||
|
|
||||||
accessTokenHeader:
|
|
||||||
config.getRawConfig().server
|
|
||||||
.resource_access_token_headers.token,
|
|
||||||
|
|
||||||
resourceSessionRequestParam:
|
resourceSessionRequestParam:
|
||||||
config.getRawConfig().server
|
config.getRawConfig().server
|
||||||
.resource_session_request_param
|
.resource_session_request_param
|
||||||
|
|||||||
@@ -39,18 +39,11 @@ export async function traefikConfigProvider(
|
|||||||
userSessionCookieName:
|
userSessionCookieName:
|
||||||
config.getRawConfig().server.session_cookie_name,
|
config.getRawConfig().server.session_cookie_name,
|
||||||
|
|
||||||
|
// deprecated
|
||||||
accessTokenQueryParam:
|
accessTokenQueryParam:
|
||||||
config.getRawConfig().server
|
config.getRawConfig().server
|
||||||
.resource_access_token_param,
|
.resource_access_token_param,
|
||||||
|
|
||||||
accessTokenIdHeader:
|
|
||||||
config.getRawConfig().server
|
|
||||||
.resource_access_token_headers.id,
|
|
||||||
|
|
||||||
accessTokenHeader:
|
|
||||||
config.getRawConfig().server
|
|
||||||
.resource_access_token_headers.token,
|
|
||||||
|
|
||||||
resourceSessionRequestParam:
|
resourceSessionRequestParam:
|
||||||
config.getRawConfig().server
|
config.getRawConfig().server
|
||||||
.resource_session_request_param
|
.resource_session_request_param
|
||||||
|
|||||||
Reference in New Issue
Block a user