7cc7f95019
Adopt model-redis v1.5.0 and give the on-demand is_cache Host records (and their Cached tracking records) created by Host.addCache a TTL, so they auto-expire instead of accumulating forever. Only the record hash carries the TTL, so OpenResty's direct HGETALL sees a miss once it expires and re-resolves through the lookup path. The lifetime is configurable via conf.cacheTTL (seconds, default 3600; 0 disables expiry). This also mitigates the matchAny=false "wrong host" bug: stale leftover cache entries now expire (and are still busted on parent update), so undefined subdomains stop being served by old caches. Add test/unit/wildcard_matchany.test.js covering the matchAny routing decision (defined vs undefined subdomains, mixed-policy sibling wildcards, and cache-entry behavior) and wire it into the test scripts. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
33 lines
904 B
JavaScript
33 lines
904 B
JavaScript
'use strict';
|
|
// Using https://github.com/simpleworkjs/conf to handle configuration
|
|
|
|
module.exports = {
|
|
userModel: 'redis', // pam, redis, ldap
|
|
ldap: {
|
|
url: 'ldap://192.168.1.55:389',
|
|
bindDN: 'cn=ldapclient service,ou=people,dc=theta42,dc=com',
|
|
bindPassword: '__IN SRECREST FILE__',
|
|
searchBase: 'ou=people,dc=theta42,dc=com',
|
|
userFilter: '(objectClass=inetOrgPerson)',
|
|
userNameAttribute: 'uid'
|
|
},
|
|
socketFile: '/var/run/proxy_lookup.socket',
|
|
redis: {
|
|
prefix: 'proxy_'
|
|
},
|
|
|
|
// Lifetime, in seconds, of on-demand wildcard-subdomain cache entries
|
|
// (the is_cache Host records created by Host.addCache). They expire on
|
|
// their own via redis TTL so they stop accumulating and stale routes
|
|
// self-correct. 0 disables expiry (entries live until bustCache/clearCache).
|
|
cacheTTL: 3600,
|
|
|
|
service:{
|
|
hostScheduler:{
|
|
enabled: true,
|
|
initial: 30000,
|
|
interval: 86400000,
|
|
}
|
|
},
|
|
};
|