Added socket.io

This commit is contained in:
2024-07-31 19:01:55 -04:00
parent fc66225cf5
commit 441e372987
23 changed files with 551 additions and 151 deletions
+10 -6
View File
@@ -1,11 +1,12 @@
'use strict';
const Table = require('../utils/redis_model');
const ModelPs = require('../utils/model_pubsub');
const tldExtract = require('tld-extract').parse_host;
const PorkBun = require('../utils/porkbun');
const LetsEncrypt = require('../utils/letsencrypt');
const conf = require('../conf/conf');
const conf = require('../conf');
let porkBun = new PorkBun(conf.porkBun.apiKey, conf.porkBun.secretApiKey);
let letsEncrypt = new LetsEncrypt({
@@ -13,7 +14,6 @@ let letsEncrypt = new LetsEncrypt({
});
class Host extends Table{
static _key = 'host';
static _keyMap = {
@@ -86,7 +86,6 @@ class Host extends Table{
static async add(data, ...args){
try{
let out = await super.add(data, ...args)
await this.buildLookUpObj()
if(out.is_wildcard) await out.createWildcardCert()
@@ -246,8 +245,13 @@ class Host extends Table{
return true;
}
static test(pass){
return `yes ${pass}`
}
}
class Cached extends Table{
static _key = 'host';
static _keyMap = {
@@ -262,7 +266,7 @@ class Cached extends Table{
await Host.buildLookUpObj();
})()
module.exports = {Host};
module.exports = {Host: ModelPs(Host)};
(async function(){
try{
@@ -279,8 +283,8 @@ try{
// })
// console.log('IIFE res:\n', res)
console.log(await Host.listDetail())
// console.log(Host.test(55))
// console.log(await Host.listDetail())
// console.log('IIFE lookup:', Host.lookUp('bld3324sdf.test.holycore.quest'))