- Cloudflare e configurazione dominio DNS (host, host_test, host_ip, ecc...)
This commit is contained in:
@@ -57,12 +57,6 @@ const catalogo = new Schema(
|
||||
);
|
||||
|
||||
const MyElemSchema = new Schema({
|
||||
_id: {
|
||||
type: ObjectId,
|
||||
default: function () {
|
||||
return new ObjectId();
|
||||
},
|
||||
},
|
||||
idapp: {
|
||||
type: String,
|
||||
},
|
||||
|
||||
@@ -37,9 +37,33 @@ const SiteSchema = new Schema({
|
||||
host: {
|
||||
type: String,
|
||||
},
|
||||
host_ip: {
|
||||
type: String,
|
||||
},
|
||||
host_test: {
|
||||
type: String,
|
||||
},
|
||||
host_test_ip: {
|
||||
type: String,
|
||||
},
|
||||
host_api: {
|
||||
type: String,
|
||||
},
|
||||
host_api_ip: {
|
||||
type: String,
|
||||
},
|
||||
host_testapi: {
|
||||
type: String,
|
||||
},
|
||||
host_testapi_ip: {
|
||||
type: String,
|
||||
},
|
||||
cf_token: {
|
||||
type: String,
|
||||
},
|
||||
cf_zoneId: {
|
||||
type: String,
|
||||
},
|
||||
portapp: {
|
||||
type: String,
|
||||
},
|
||||
@@ -135,6 +159,11 @@ const SiteSchema = new Schema({
|
||||
enableAI: { type: Boolean, default: false },
|
||||
enableGroups: { type: Boolean, default: false },
|
||||
enableCircuits: { type: Boolean, default: false },
|
||||
enableGoods: { type: Boolean, default: false },
|
||||
enableServices: { type: Boolean, default: false },
|
||||
enableActivities: { type: Boolean, default: false },
|
||||
enableHosps: { type: Boolean, default: false },
|
||||
enableEvents: { type: Boolean, default: false },
|
||||
enableProj: { type: Boolean, default: false },
|
||||
enableTodos: { type: Boolean, default: false },
|
||||
enableRegByBot: { type: Boolean, default: false },
|
||||
@@ -226,6 +255,17 @@ module.exports.executeQueryTable = async function (idapp, params, userreq) {
|
||||
if (User.isAdmin(userreq.perm)) {
|
||||
const myarr = await Site.find({});
|
||||
|
||||
if (myarr.length === 0) {
|
||||
/* {
|
||||
"_id" : ObjectId("620a71e194438ecd1acfdbca"),
|
||||
"idapp" : "14",
|
||||
"chiave" : "vers",
|
||||
"userId" : "ALL",
|
||||
"valore" : "0.3.21"
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
// return await Site.find({}).lean();
|
||||
return ({ count: myarr.length, rows: myarr })
|
||||
|
||||
@@ -351,7 +391,7 @@ module.exports.createFirstUserAdmin = async function () {
|
||||
const numusers = await User.countDocuments({ idapp: mysite.idapp });
|
||||
if (numusers === 0) {
|
||||
// Non esistono utenti, quindi creo quello di Admin
|
||||
|
||||
|
||||
const utenteadmin = { idapp: '13', username: telegrambot.ADMIN_USER_SERVER };
|
||||
|
||||
const newuser = new User(utenteadmin);
|
||||
|
||||
Reference in New Issue
Block a user