9100e92549
- Plain hosts can now be renamed after creation (wildcard/child/cache hosts stay locked, since other records reference them by name). Migrates the cert cache key on rename. - Along the way, found and fixed a real bug in the vendored model-redis library: its rename path leaves a stray, incomplete hash behind under the old key when an `always`-type field (updated_on) is defined earlier in the schema than the primary key -- silently blocking that hostname from ever being reused. Worked around at the Host model level (can't patch node_modules). - Host list now shows who created each host, and when. - Host modal's tabs now scroll horizontally on narrow screens instead of overflowing awkwardly. - Added missing inline help text (Target SSL, wildcard matching behavior). Bumps to v1.1.9. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KDEx8ghuZR61pqPXc6da9C
35 lines
630 B
JavaScript
35 lines
630 B
JavaScript
'use strict';
|
|
|
|
const {createClient} = require('redis');
|
|
const client = createClient({});
|
|
|
|
client.connect();
|
|
|
|
async function getCert(host){
|
|
try{
|
|
console.log('looking for', host);
|
|
return JSON.parse(await client.GET(`${host}:latest`));
|
|
}catch(error){
|
|
return {}
|
|
}
|
|
}
|
|
|
|
async function setCert(host, cert){
|
|
try{
|
|
return await client.SET(`${host}:latest`, JSON.stringify(cert));
|
|
}catch(error){
|
|
return {}
|
|
}
|
|
}
|
|
|
|
async function deleteCert(host){
|
|
try{
|
|
console.log('looking for', host);
|
|
return JSON.parse(await client.DEL(`${host}:latest`));
|
|
}catch(error){
|
|
return {}
|
|
}
|
|
}
|
|
|
|
module.exports = {getCert, setCert, deleteCert};
|