Merge pull request #1093 from bluewave-labs/revert-1092-fix/devops/docker-compose
Revert "Fix/devops/docker compose"
This commit is contained in:
4 files changed
+109
-72
No files matched your search
@@ -2,7 +2,7 @@ services:
|
|||||||
client:
|
client:
|
||||||
image: uptime_client:latest
|
image: uptime_client:latest
|
||||||
environment:
|
environment:
|
||||||
UPTIME_APP_API_BASE_URL: "https://uptime-demo.bluewavelabs.ca/api/v1"
|
UPTIME_APP_API_BASE_URL: "http://localhost:5000/api/v1"
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
- "443:443"
|
- "443:443"
|
||||||
|
|||||||
+66
-61
@@ -1,63 +1,6 @@
|
|||||||
import mongoose from "mongoose";
|
import mongoose from "mongoose";
|
||||||
|
import EmailService from "../../service/emailService.js";
|
||||||
const BaseCheckSchema = mongoose.Schema({
|
import Notification from "./Notification.js";
|
||||||
/**
|
|
||||||
* Reference to the associated Monitor document.
|
|
||||||
*
|
|
||||||
* @type {mongoose.Schema.Types.ObjectId}
|
|
||||||
*/
|
|
||||||
monitorId: {
|
|
||||||
type: mongoose.Schema.Types.ObjectId,
|
|
||||||
ref: "Monitor",
|
|
||||||
immutable: true,
|
|
||||||
index: true,
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Status of the check (true for up, false for down).
|
|
||||||
*
|
|
||||||
* @type {Boolean}
|
|
||||||
*/
|
|
||||||
status: {
|
|
||||||
type: Boolean,
|
|
||||||
index: true,
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Response time of the check in milliseconds.
|
|
||||||
*
|
|
||||||
* @type {Number}
|
|
||||||
*/
|
|
||||||
responseTime: {
|
|
||||||
type: Number,
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* HTTP status code received during the check.
|
|
||||||
*
|
|
||||||
* @type {Number}
|
|
||||||
*/
|
|
||||||
statusCode: {
|
|
||||||
type: Number,
|
|
||||||
index: true,
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Message or description of the check result.
|
|
||||||
*
|
|
||||||
* @type {String}
|
|
||||||
*/
|
|
||||||
message: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Expiry date of the check, auto-calculated to expire after 30 days.
|
|
||||||
*
|
|
||||||
* @type {Date}
|
|
||||||
*/
|
|
||||||
|
|
||||||
expiry: {
|
|
||||||
type: Date,
|
|
||||||
default: Date.now,
|
|
||||||
expires: 60 * 60 * 24 * 30, // 30 days
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check Schema for MongoDB collection.
|
* Check Schema for MongoDB collection.
|
||||||
@@ -65,7 +8,69 @@ const BaseCheckSchema = mongoose.Schema({
|
|||||||
* Represents a check associated with a monitor, storing information
|
* Represents a check associated with a monitor, storing information
|
||||||
* about the status and response of a particular check event.
|
* about the status and response of a particular check event.
|
||||||
*/
|
*/
|
||||||
const CheckSchema = mongoose.Schema({ ...BaseCheckSchema.obj }, { timestamps: true });
|
const CheckSchema = mongoose.Schema(
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Reference to the associated Monitor document.
|
||||||
|
*
|
||||||
|
* @type {mongoose.Schema.Types.ObjectId}
|
||||||
|
*/
|
||||||
|
monitorId: {
|
||||||
|
type: mongoose.Schema.Types.ObjectId,
|
||||||
|
ref: "Monitor",
|
||||||
|
immutable: true,
|
||||||
|
index: true,
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Status of the check (true for up, false for down).
|
||||||
|
*
|
||||||
|
* @type {Boolean}
|
||||||
|
*/
|
||||||
|
status: {
|
||||||
|
type: Boolean,
|
||||||
|
index: true,
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Response time of the check in milliseconds.
|
||||||
|
*
|
||||||
|
* @type {Number}
|
||||||
|
*/
|
||||||
|
responseTime: {
|
||||||
|
type: Number,
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* HTTP status code received during the check.
|
||||||
|
*
|
||||||
|
* @type {Number}
|
||||||
|
*/
|
||||||
|
statusCode: {
|
||||||
|
type: Number,
|
||||||
|
index: true,
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Message or description of the check result.
|
||||||
|
*
|
||||||
|
* @type {String}
|
||||||
|
*/
|
||||||
|
message: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Expiry date of the check, auto-calculated to expire after 30 days.
|
||||||
|
*
|
||||||
|
* @type {Date}
|
||||||
|
*/
|
||||||
|
|
||||||
|
expiry: {
|
||||||
|
type: Date,
|
||||||
|
default: Date.now,
|
||||||
|
expires: 60 * 60 * 24 * 30, // 30 days
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
timestamps: true, // Adds createdAt and updatedAt timestamps
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
CheckSchema.index({ createdAt: 1 });
|
CheckSchema.index({ createdAt: 1 });
|
||||||
export default mongoose.model("Check", CheckSchema);
|
export default mongoose.model("Check", CheckSchema);
|
||||||
export { BaseCheckSchema };
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import mongoose from "mongoose";
|
import mongoose from "mongoose";
|
||||||
import { BaseCheckSchema } from "./Check.js";
|
|
||||||
const cpuSchema = mongoose.Schema({
|
const cpuSchema = mongoose.Schema({
|
||||||
physical_core: { type: Number, default: 0 },
|
physical_core: { type: Number, default: 0 },
|
||||||
logical_core: { type: Number, default: 0 },
|
logical_core: { type: Number, default: 0 },
|
||||||
@@ -32,7 +32,35 @@ const hostSchema = mongoose.Schema({
|
|||||||
|
|
||||||
const HardwareCheckSchema = mongoose.Schema(
|
const HardwareCheckSchema = mongoose.Schema(
|
||||||
{
|
{
|
||||||
...BaseCheckSchema.obj,
|
monitorId: {
|
||||||
|
type: mongoose.Schema.Types.ObjectId,
|
||||||
|
ref: "Monitor",
|
||||||
|
immutable: true,
|
||||||
|
index: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
status: {
|
||||||
|
type: Boolean,
|
||||||
|
index: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
responseTime: {
|
||||||
|
type: Number,
|
||||||
|
},
|
||||||
|
|
||||||
|
statusCode: {
|
||||||
|
type: Number,
|
||||||
|
index: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
message: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
expiry: {
|
||||||
|
type: Date,
|
||||||
|
default: Date.now,
|
||||||
|
expires: 60 * 60 * 24 * 30, // 30 days
|
||||||
|
},
|
||||||
cpu: {
|
cpu: {
|
||||||
type: cpuSchema,
|
type: cpuSchema,
|
||||||
default: () => ({}),
|
default: () => ({}),
|
||||||
@@ -53,6 +81,4 @@ const HardwareCheckSchema = mongoose.Schema(
|
|||||||
{ timestamps: true }
|
{ timestamps: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
HardwareCheckSchema.index({ createdAt: 1 });
|
|
||||||
|
|
||||||
export default mongoose.model("HardwareCheck", HardwareCheckSchema);
|
export default mongoose.model("HardwareCheck", HardwareCheckSchema);
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
import mongoose from "mongoose";
|
import mongoose from "mongoose";
|
||||||
import { BaseCheckSchema } from "./Check.js";
|
|
||||||
import logger from "../../utils/logger.js";
|
import logger from "../../utils/logger.js";
|
||||||
import { time } from "console";
|
|
||||||
const AuditSchema = mongoose.Schema({
|
const AuditSchema = mongoose.Schema({
|
||||||
id: { type: String, required: true },
|
id: { type: String, required: true },
|
||||||
title: { type: String, required: true },
|
title: { type: String, required: true },
|
||||||
@@ -48,7 +46,15 @@ const AuditsSchema = mongoose.Schema({
|
|||||||
|
|
||||||
const PageSpeedCheck = mongoose.Schema(
|
const PageSpeedCheck = mongoose.Schema(
|
||||||
{
|
{
|
||||||
...BaseCheckSchema.obj,
|
monitorId: {
|
||||||
|
type: mongoose.Schema.Types.ObjectId,
|
||||||
|
ref: "Monitor",
|
||||||
|
immutable: true,
|
||||||
|
},
|
||||||
|
status: {
|
||||||
|
type: Boolean,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
accessibility: {
|
accessibility: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true,
|
required: true,
|
||||||
@@ -70,7 +76,9 @@ const PageSpeedCheck = mongoose.Schema(
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ timestamps: true }
|
{
|
||||||
|
timestamps: true,
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -104,6 +112,4 @@ PageSpeedCheck.pre("save", async function (next) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
PageSpeedCheck.index({ createdAt: 1 });
|
|
||||||
|
|
||||||
export default mongoose.model("PageSpeedCheck", PageSpeedCheck);
|
export default mongoose.model("PageSpeedCheck", PageSpeedCheck);
|
||||||
Reference in new issue
Block a user