Compare commits

...

314 Commits

Author SHA1 Message Date
Simon Larsen
7bfc0be25d monitor probe service 2024-07-05 11:50:15 +01:00
Simon Larsen
d9ce813689 refactor: Update ingestor replica count based on configuration 2024-07-05 11:26:26 +01:00
Simon Larsen
93f1b97e88 refactor: Improve error handling in Monitor.ts
This commit refactors the Monitor.ts file to improve error handling. It removes commented out code and unused imports, ensuring a cleaner and more efficient codebase. This change enhances the maintainability and readability of the code.
2024-07-05 11:16:29 +01:00
Simon Larsen
c617e49a63 refactor: Update ingestor replica count based on configuration
This commit updates the ingestor replica count in the HelmChart/Public/oneuptime/templates/ingestor.yaml file based on the configuration. If the `$.Values.deployment.ingestor.replicaCount` value is provided, it sets the replicas to that value. Otherwise, it falls back to `$.Values.deployment.replicaCount`. This change ensures that the ingestor replica count is correctly configured, improving the scalability and performance of the application.
2024-07-05 10:51:19 +01:00
Simon Larsen
de7d06e5d7 refactor: Improve error handling in FetchListAndProbe
This commit refactors the FetchListAndProbe class to improve error handling. It adds try-catch blocks around the main logic and logs any errors that occur using the logger. Additionally, it includes a catch block to handle any errors thrown during the fetchListAndProbe function. This change ensures that errors are properly handled and logged, preventing potential issues with the monitoring process.
2024-07-05 10:18:03 +01:00
Simon Larsen
9b862162b6 refactor: Remove Hugging Face model download step from workflows
The Hugging Face model download step has been removed from the release and test workflows due to limited disk space on the runner. This step was causing issues and is no longer necessary for the current functionality of the project.
2024-07-05 10:05:19 +01:00
Simon Larsen
0ecf3fa1e0 refactor: Remove commented out code and unused imports in Monitor.ts 2024-07-05 09:54:34 +01:00
Simon Larsen
b5fa564cb3 refactor: Remove LLM/Models from .dockerignore 2024-07-05 09:29:05 +01:00
Simon Larsen
b771e1486e Update Hugging Face model download command in release and test workflows 2024-07-05 09:27:20 +01:00
Simon Larsen
3f1479d8f5 refactor: Improve error handling in Semaphore.lock()
This commit refactors the Semaphore.lock() function in the MonitorStatusTimelineService and Monitor API files to improve error handling. It adds try-catch blocks around the lock() function calls and logs any errors that occur using the logger. This change ensures that errors during the locking process are properly handled and logged, preventing potential issues with mutex locking.
2024-07-05 09:05:36 +01:00
Simon Larsen
dcdf1e21ae chore: Free up disk space in GitHub Actions runner 2024-07-04 22:40:38 +01:00
Simon Larsen
cc3f003be5 refactor: Improve error handling in FetchListAndProbe
This commit refactors the FetchListAndProbe class to improve error handling. It adds try-catch blocks around the main logic and logs any errors that occur using the logger. Additionally, it includes a catch block to handle any errors thrown during the fetchListAndProbe function. This change ensures that errors are properly handled and logged, preventing potential issues with the monitoring process.
2024-07-04 22:22:37 +01:00
Simon Larsen
0e53e26695 refactor: Update PROBE_MONITOR_FETCH_LIMIT default value to 10
This commit updates the default value of the PROBE_MONITOR_FETCH_LIMIT variable in the Config.ts file from 1 to 10. This change ensures that the monitor fetch limit is set to a more reasonable value, improving the efficiency of the monitoring process.
2024-07-04 21:05:03 +01:00
Simon Larsen
ad1e5fefc6 refactor: Improve error handling in Semaphore.lock()
This commit refactors the Semaphore.lock() function in the MonitorStatusTimelineService and Monitor API files to improve error handling. It adds try-catch blocks around the lock() function calls and logs any errors that occur using the logger. This change ensures that errors during the locking process are properly handled and logged, preventing potential issues with mutex locking.
2024-07-04 20:52:19 +01:00
Simon Larsen
8ea77dc6d1 chore: Update BillingInvoiceAPI to check for userAuthorization.isMasterAdmin when userPermissions is empty 2024-07-04 10:50:40 +01:00
Simon Larsen
2222ca301f feat: Update count property in docker-compose.llm.yml to use 'all'
This commit updates the count property in the docker-compose.llm.yml file to use the value 'all' instead of the previous value of '1'. This change allows for the allocation of all available devices with the 'gpu' capability, improving the utilization of resources.
2024-07-03 17:48:43 +01:00
Simon Larsen
0f66c70205 refactor: Update issue template titles
This commit removes the redundant "Bug:" and "Enhancement:" prefixes from the issue template titles. The prefixes are unnecessary as the labels already indicate the type of issue. This change simplifies the issue creation process and improves the clarity of the issue templates.
2024-07-03 17:37:10 +01:00
Simon Larsen
88dc64f182 feat: Add new migration for SchemaMigrations
This commit adds a new migration file, MigrationName1720024126646, to the SchemaMigrations directory. This migration will be used to make changes to the database schema.
2024-07-03 17:35:24 +01:00
Simon Larsen
94c50b980a feat: Add disableCreate prop to MonitorTable component 2024-07-03 17:26:33 +01:00
Simon Larsen
9866919873 feat: Add new icons for NoSignal and EyeSlash
This commit adds two new icons, NoSignal and EyeSlash, to the IconProp enum. It also includes the necessary code changes in the Icon component to render these icons. These icons will be used in the Monitor SideMenu to represent monitors with all probes disconnected and monitors with all probes disabled, respectively.
2024-07-03 16:55:31 +01:00
Simon Larsen
e025f996e4 feat: Add Monitor Groups and Not Being Monitored sections to Dashboard SideMenu 2024-07-03 16:43:39 +01:00
Simon Larsen
cd4c326f6e refactor: Update PermissionHelper to use access control permissions for probe actions
This commit updates the PermissionHelper class to use access control permissions for probe actions. Previously, the isAccessControlPermission property was set to false for all probe-related permissions. Now, it has been changed to true, aligning with the intention of these permissions. This change improves the clarity and consistency of the codebase.
2024-07-03 14:58:11 +01:00
Simon Larsen
c668731389 chore: Add new monitor notification settings for probe status changes and no probes monitoring the monitor 2024-07-03 14:56:57 +01:00
Simon Larsen
e6a10edca6 chore: Add new monitor notification settings for probe status changes and no probes monitoring the monitor 2024-07-02 19:42:28 +01:00
Simon Larsen
847f7fa5c9 chore: Update MonitorTypeHelper function names to be more descriptive
This commit updates the function names in the MonitorTypeHelper class to be more descriptive and accurately reflect their purpose. The function isProbableMonitors has been renamed to isProbableMonitor, and doesMonitorTypeHaveInterval has been renamed to doesMonitorTypeRequireInterval. This change improves the clarity and maintainability of the codebase.
2024-07-02 18:58:06 +01:00
Simon Larsen
03cb9a67b4 chore: Update server monitor criteria to evaluate over time
This commit updates the ServerMonitorCriteria class to include the option to evaluate criteria over time. It adds a new condition to check if the criteria filter includes the evaluateOverTimeOptions property. If it does, the criteria will be evaluated based on the specified time value in minutes. This change allows for more flexible and customizable monitoring criteria.
2024-07-02 17:14:58 +01:00
Simon Larsen
9791aa1259 chore: Add CPU core count to CPUMetrics
This commit adds the `cores` field to the `CPUMetrics` struct in order to include the number of CPU cores in the collected metrics. This information is useful for understanding the processing power of the server.
2024-07-02 13:54:04 +01:00
Simon Larsen
0df7209723 feat: Add basic infrastructure metrics to server monitor summary view 2024-07-02 13:06:23 +01:00
Simon Larsen
0de8e2d818 chore: Add hostname to server monitor report
This commit adds the hostname field to the server monitor report in order to include the hostname of the server in the collected metrics. This information is useful for identifying and distinguishing between different servers in the monitoring system.
2024-07-02 13:04:02 +01:00
Simon Larsen
5f9a1091de chore: Update Dockerfile paths in release and test-release workflows
This commit updates the paths to the Dockerfile in the release.yml and test-release.yaml workflows. The paths have been changed to ./LLM/Dockerfile to ensure that the correct Dockerfile is used for building and pushing the image. This change is necessary because the base image of the LLM does not support arm64 platforms.
2024-07-02 12:55:52 +01:00
Simon Larsen
6ef17b1720 chore: Update Dockerfile to set stack trace limit to 0
This commit updates the Dockerfile to set the stack trace limit to 0, allowing full stack traces to be shown. This change ensures that developers have access to complete stack trace information when debugging the application.
2024-07-02 12:29:31 +01:00
Simon Larsen
9c41a20ebb chore: Update Dockerfile paths in release and test-release workflows
This commit updates the paths to the Dockerfile in the release.yml and test-release.yaml workflows. The paths have been changed to ./LLM/Dockerfile to ensure that the correct Dockerfile is used for building and pushing the image. This change is necessary because the base image of the LLM does not support arm64 platforms.
2024-07-02 12:23:03 +01:00
Simon Larsen
eddb5a81c9 Merge branch 'master' of github.com:OneUptime/oneuptime 2024-07-02 12:20:47 +01:00
Simon Larsen
3861d09930 Merge branch 'master' of github.com:OneUptime/oneuptime 2024-07-02 11:20:24 +00:00
Simon Larsen
733901a870 refactor: Use array of messages in CopilotActionsBase.ts, RefactorCode.ts, ImproveReadme.ts, ImproveVariableNames.ts, FixGrammarAndSpelling.ts, and WriteUnitTests.ts
This refactor changes the code in CopilotActionsBase.ts, RefactorCode.ts, ImproveReadme.ts, ImproveVariableNames.ts, FixGrammarAndSpelling.ts, and WriteUnitTests.ts to use an array of messages instead of a single prompt. Each message in the array contains the content and role of the prompt, improving flexibility and readability.
2024-07-02 11:19:53 +00:00
Simon Larsen
131c3034d6 chore: Update installation script to add binary to path
The installation script has been updated to add the binary to the user's path. This ensures that the oneuptime-infrastructure-agent command can be accessed from anywhere in the shell.
2024-07-02 12:19:14 +01:00
Simon Larsen
0c9175c728 fix install script for mac 2024-07-02 12:11:21 +01:00
Simon Larsen
e2eff652e3 chore: Update notification method description in NotificationSettings.tsx 2024-07-02 11:25:36 +01:00
Simon Larsen
43e9530fdb chore: Update notification method description in NotificationSettings.tsx
This commit updates the description of the notification methods in the NotificationSettings.tsx file. The previous description mentioned "custom porbe" instead of "custom probe". This change improves the accuracy and clarity of the description, ensuring that it correctly reflects the purpose of the notification methods.
2024-07-02 11:23:24 +01:00
Simon Larsen
0000cbc53e chore: Add migration for new SchemaMigrations
This commit adds a new migration file, MigrationName1719915433542, to the SchemaMigrations directory. The migration is necessary to update the database schema and ensure compatibility with the latest changes in the codebase.
2024-07-02 11:19:31 +01:00
Simon Larsen
8b26cac8f0 ```text
chore: Update ProbeAPI.test.ts to include connectionStatus field in select query

This commit modifies the ProbeAPI.test.ts file to include the connectionStatus field in the select query. The connectionStatus field was missing from the original query, and this change ensures that it is now included, providing complete information about the probe's connection status.
2024-07-02 11:14:42 +01:00
Simon Larsen
e8417b23d9 chore: Update ProbeConnectionStatusChange template to display "Status Since" instead of "Date / Time" 2024-07-01 22:45:10 +01:00
Simon Larsen
1bd5671d17 chore: Update lastAlive field to Status Since in ProbeConnectionStatusChange template
This commit updates the ProbeConnectionStatusChange template to display the last connection status change as "Status Since" instead of "Date / Time". The change improves the clarity and accuracy of the displayed information, providing a better user experience.
2024-07-01 22:22:51 +01:00
Simon Larsen
56d3e7e1f2 chore: Update probeKey type to string in CustomProbeDocumentation and ProbeView components
This commit updates the probeKey prop type from ObjectID to string in the CustomProbeDocumentation and ProbeView components. The probeKey is used to identify the probe and was previously defined as ObjectID, but it should be a string. This change ensures that the probeKey is correctly passed and used throughout the components, improving the accuracy and reliability of the application.
2024-07-01 20:00:16 +01:00
Simon Larsen
34888e9b7f chore: Update CustomProbeDocumentation component title
This commit updates the title of the CustomProbeDocumentation component from "Set up your Server Monitor (Linux/Mac)" to "Set up your Custom Probe". The new title accurately reflects the purpose of the component and improves the clarity of the user interface.
2024-07-01 17:51:28 +01:00
Simon Larsen
7c09423766 chore: Update ProbeStatusElement component to use connectionStatus field 2024-07-01 17:34:04 +01:00
Simon Larsen
9ba8251c58 chore: Update ProbeStatusElement component to use connectionStatus field 2024-07-01 17:19:27 +01:00
Simon Larsen
7a5efd99ca chore: Update ProbeStatusElement component to use connectionStatus field
This commit updates the ProbeStatusElement component to use the new connectionStatus field from the Probe model. The component previously relied on the lastAlive field to determine the probe's connection status, but now it directly checks the connectionStatus field. This change ensures that the component accurately reflects the probe's current connection status, improving the reliability of the application.
2024-07-01 17:12:33 +01:00
Simon Larsen
1e595be586 feat: Add notification settings for probe owner added event
This commit adds notification settings for the "probe owner added" event. It includes updates to the EmailTemplateType enum, NotificationSettingEventType enum, UserNotificationSettingService, and NotificationSettings.tsx. The new settings allow users to receive notifications when they are added as owners to a probe. This enhancement improves the user experience by providing timely notifications for ownership changes.
2024-07-01 17:06:35 +01:00
Simon Larsen
1d63168606 chore: Add connectionStatus field to Probe model and update related components 2024-07-01 16:52:16 +01:00
Simon Larsen
82601a3e8f chore: Disable editing and deleting of probes in ProbePage component
This commit disables the editing and deleting functionality for probes in the ProbePage component. The isEditable and isDeleteable props are set to false, preventing users from modifying or removing probes. This change ensures that probes cannot be accidentally modified or deleted, improving the data integrity of the application.
2024-07-01 14:41:25 +01:00
Simon Larsen
17bf63e83b chore: Add missing commas in Index.ts files
This commit adds missing commas in the Index.ts files of the Model/Models and CommonServer/Infrastructure/Postgres/SchemaMigrations directories. The missing commas were causing syntax errors in the code. This fix ensures that the code is valid and can be executed without errors.
2024-07-01 14:12:06 +01:00
Simon Larsen
885a6ca36e feat: Add ProbeOwnerTeam and ProbeOwnerUser APIs
This commit adds the APIs for ProbeOwnerTeam and ProbeOwnerUser, allowing users to manage ownership of probes within the application. The APIs are implemented in the BaseAPI/Index.ts file and include routes for creating, deleting, editing, and reading probe owner teams and users. This enhancement improves the functionality of the application by providing a way to manage probe ownership.
2024-07-01 14:02:49 +01:00
Simon Larsen
dec35bbc03 chore: Update model-inline-code styles for consistency
This commit updates the model-inline-code styles in the model.ejs and head.ejs files to ensure consistency throughout the application. The model-inline-code class is now defined with rounded corners, smaller text size, and a gray background color. This change improves the visual presentation of code snippets in the application.
2024-07-01 13:52:49 +01:00
Simon Larsen
77dcb16e8b feat: Add permissions for creating, deleting, editing, and reading probe owner teams and users 2024-07-01 13:42:17 +01:00
Simon Larsen
b10a4c7db8 feat: Add permissions for creating, deleting, editing, and reading probe owner teams and users
This commit adds new permissions for creating, deleting, editing, and reading probe owner teams and users. These permissions allow users to manage ownership of probes within the application. The permissions are defined in the Permission enum and are accompanied by titles and descriptions for clarity. This enhancement improves the access control functionality of the application.
2024-07-01 13:39:07 +01:00
Simon Larsen
8d82f1128b chore: Add ProbeConnectionStatusChange email template
This commit adds a new email template, "ProbeConnectionStatusChange.hbs", to the EmailTemplateType enum in the EmailTemplateType.ts file. The template is used for sending emails related to changes in probe connection status. This addition enhances the email functionality of the application.
2024-07-01 13:07:11 +01:00
Simon Larsen
056c069c69 chore: Add migration for new ProbeStatus column
This commit adds a new migration file, "1719827175832-MigrationName", to the SchemaMigrations directory. The migration file includes the necessary changes to add a new column, "connectionStatus", to the Probe model in the Models directory. The column is of type "ShortText" and has access control settings for create and read permissions. This migration enables the storage and retrieval of the connection status of a probe in the database.
2024-07-01 10:47:24 +01:00
Simon Larsen
0466950c2d chore: Update axios and posthog-js dependencies
This commit updates the axios and posthog-js dependencies in the package-lock.json file. The axios dependency is updated from version 1.6.8 to 1.7.2, and the posthog-js dependency is updated from version 1.131.4 to 1.138.0. These updates ensure that the latest stable versions of these libraries are used in the project.
2024-07-01 10:43:11 +01:00
Simon Larsen
4442437ad7 refactor: Improve comments and error handling in Llama.ts and ImproveComments.ts 2024-07-01 10:39:27 +01:00
Simon Larsen
08f39af9ec refactor: Improve comments and handle bad operations in Llama.ts and ImproveComments.ts
This commit refactors the code in Llama.ts and ImproveComments.ts to improve comments and handle bad operations. In Llama.ts, a new import statement for the BadOperationException class is added, and if the result object contains an error string, a BadOperationException is thrown. In ImproveComments.ts, an unused variable declaration is removed. These changes enhance code readability and error handling.
2024-06-28 19:25:53 +01:00
Simon Larsen
7bf58d23bc chore: Update CopilotActionsBase.ts, RefactorCode.ts, ImproveReadme.ts, ImproveVariableNames.ts, FixGrammarAndSpelling.ts, and WriteUnitTests.ts
Refactor CopilotActionsBase.ts, RefactorCode.ts, ImproveReadme.ts, ImproveVariableNames.ts, FixGrammarAndSpelling.ts, and WriteUnitTests.ts to use an array of messages instead of a single prompt. Each message in the array contains the content and role of the prompt. This change improves the flexibility and readability of the code.
2024-06-28 19:15:53 +01:00
Simon Larsen
afb0cbcc2a chore: Update Dockerfile and docker-compose.llm.yml for LLM models 2024-06-28 18:00:27 +00:00
Simon Larsen
7393d9c2bc chore: Update Dockerfile and docker-compose.llm.yml for LLM models
This commit updates the Dockerfile and docker-compose.llm.yml files to include the LLM Models directory. The Dockerfile now uses the `ADD .` command to copy the entire repository into the container at `/app`, and the docker-compose.llm.yml file has been modified to set the context to the `./LLM` directory. These changes ensure that the LLM Models directory is included in the Docker image and that the correct context is used for building the image.
2024-06-28 17:59:43 +00:00
Simon Larsen
7b8efb2785 Update Dockerfile to set stack trace limit to 0 2024-06-28 17:52:57 +01:00
Simon Larsen
efea6f4c11 chore: Add Redis service to docker-compose.llm.yml
The Redis service has been added to the docker-compose.llm.yml file. This service is responsible for caching and cluster state. It extends the configuration from the docker-compose.base.yml file and uses the "redis" service defined there.
2024-06-28 17:42:43 +01:00
Simon Larsen
8dbf724f36 chore: Update Dockerfile in llm-docker-image-deploy workflow to use the correct volume mount path 2024-06-28 17:37:47 +01:00
Simon Larsen
fa4c705023 chore: Update Dockerfile in reliability-copilot.yml to use the correct volume mount path 2024-06-28 15:10:19 +01:00
Simon Larsen
106e41206e Update nav menu styling and product menu layout 2024-06-28 14:55:58 +01:00
Simon Larsen
dc0c71b063 Remove unused GitHub workflow files for Dependabot Automerge and Playwright Tests. These files are no longer needed and can be safely deleted.
Update the Dockerfile in the Copilot directory to use the correct volume mount path. This ensures that the Copilot tool can access the repository files correctly when running in a Docker container.
2024-06-28 14:47:27 +01:00
Simon Larsen
0cadb54117 chore: Update AI Copilot references to "Reliability Copilot" 2024-06-28 14:20:56 +01:00
Simon Larsen
0ba315342c Update product tabs and features table content 2024-06-28 14:08:49 +01:00
Simon Larsen
d87b292691 chore: Update Hugging Face clone URL in test-release.yaml
Fix a typo in the Hugging Face clone URL in the test-release.yaml file, which was causing the cloning process to fail. The "@" symbol was missing in the URL. This commit adds the missing "@" symbol to the URL.
2024-06-28 13:53:26 +01:00
Simon Larsen
ea3abf2ca0 chore: Update Banner component to handle optional link and openInNewTab props
The Banner component has been updated to handle optional link and openInNewTab props. If a link is provided, it will be wrapped in a Link component. If no link is provided, the content will be rendered directly. This change allows for more flexibility in using the Banner component.
2024-06-28 13:16:58 +01:00
Simon Larsen
3e507c0259 chore: Update Hugging Face clone URL in test-release.yaml
Fix a typo in the Hugging Face clone URL in the test-release.yaml file, which was causing the cloning process to fail. The "@" symbol was missing in the URL. This commit adds the missing "@" symbol to the URL.
2024-06-28 13:09:54 +01:00
Simon Larsen
5385c8e65c chore: Update AI Copilot references to "Reliability Copilot" 2024-06-28 13:05:35 +01:00
Simon Larsen
771ad54110 chore: Update reliability feature name to "Reliability Copilot" 2024-06-28 13:03:31 +01:00
Simon Larsen
6743193872 chore: Update LLM Dockerfile and build process 2024-06-28 12:18:01 +01:00
Simon Larsen
b94d862cae chore: Update LLM Dockerfile and build process 2024-06-28 12:14:49 +01:00
Simon Larsen
77d9b2f98f chore: Fix typo in Hugging Face clone URL
The Hugging Face clone URL in the test-release.yaml file had a missing "@" symbol, causing the cloning process to fail. This commit fixes the typo by adding the "@" symbol to the URL.

```
2024-06-28 12:00:10 +01:00
Simon Larsen
2565087dba Merge branch 'master' of github.com:OneUptime/oneuptime 2024-06-28 11:59:16 +01:00
Simon Larsen
5f330b5ea6 chore: Update Dockerfile and build process for LLM deployment
This commit updates the Dockerfile and build process for deploying the LLM (Llama Models) service. The Dockerfile has been generated from the Dockerfile.tpl file, and the build process now includes pulling the model from Hugging Face and setting up QEMU and Docker Buildx. Additionally, the login actions for Docker Hub and GitHub Container Registry have been added, and the build and push steps have been configured to use the updated tags and labels from the metadata action.

```
2024-06-28 11:59:13 +01:00
Simon Larsen
c5f6816d7b chore: Update Llama Models directory name to LLM 2024-06-28 11:53:09 +01:00
Simon Larsen
585b98c83d Merge pull request #1530 from OneUptime/copilot
Copilot
2024-06-28 11:35:03 +01:00
Simon Larsen
40635d5b07 Merge pull request #1531 from OneUptime/snyk-upgrade-7358ffa5d00ca86f76a1a45e96b3c33d
[Snyk] Upgrade posthog-js from 1.136.7 to 1.138.0
2024-06-28 11:34:55 +01:00
Simon Larsen
fd96f7a1ec Merge pull request #1533 from OneUptime/snyk-upgrade-28d9d373998545ed12a47fad19fc0238
[Snyk] Upgrade @opentelemetry/resources from 1.24.1 to 1.25.0
2024-06-28 11:34:47 +01:00
Simon Larsen
f585ffe756 chore: Update npm scripts for LLM deployment
The npm scripts for starting, building, and force-building the LLM (Llama Models) service have been updated in the package.json file. The new scripts use the docker-compose.llm.yml file instead of the docker-compose.ai.yml file. This change ensures that the correct configuration is used for deploying the LLM service.
2024-06-28 11:33:48 +01:00
Simon Larsen
9a86978c9d chore: Update Llama Models directory name to LLM
The directory name for Llama Models has been updated from "Llama/Models" to "LLM/Models". This change ensures consistency and aligns with the updated file paths in the codebase.
2024-06-28 11:32:44 +01:00
Simon Larsen
3bf87cf9eb Merge branch 'master' of github.com:OneUptime/oneuptime 2024-06-28 10:51:48 +01:00
Simon Larsen
b7b5288f9c ```text
chore: Set oneuptimeSecret and encryptionSecret to long random strings

The `oneuptimeSecret` and `encryptionSecret` values in the `values.yaml` file have been updated to be set to long random strings. This change ensures better security for OneUptime in production environments.
2024-06-28 10:51:45 +01:00
snyk-bot
2833dbb474 fix: upgrade @opentelemetry/resources from 1.24.1 to 1.25.0
Snyk has created this PR to upgrade @opentelemetry/resources from 1.24.1 to 1.25.0.

See this package in npm:
@opentelemetry/resources

See this project in Snyk:
https://app.snyk.io/org/oneuptime-RsC2nshvQ2Vnr35jHvMnMP/project/47001ef1-7b3a-49c2-88cd-8025c56346d0?utm_source=github&utm_medium=referral&page=upgrade-pr
2024-06-28 06:07:03 +00:00
snyk-bot
2a6dda5fe2 fix: upgrade posthog-js from 1.136.7 to 1.138.0
Snyk has created this PR to upgrade posthog-js from 1.136.7 to 1.138.0.

See this package in npm:
posthog-js

See this project in Snyk:
https://app.snyk.io/org/oneuptime-RsC2nshvQ2Vnr35jHvMnMP/project/f6446ec8-d441-487e-b58f-38373430e213?utm_source=github&utm_medium=referral&page=upgrade-pr
2024-06-28 05:58:30 +00:00
Simon Larsen
e9e5b5a329 chore: Add error handling for item processing
This commit adds error handling for item processing in the `job` function of `app.py`. When an error occurs while processing an item, the error is stored in the `errors` dictionary. This ensures that errors are captured and can be handled appropriately. The `queue-status` endpoint now includes the `errors` dictionary in the response, providing visibility into any processing errors that occurred.
2024-06-27 20:23:24 +00:00
Simon Larsen
c0e055343e chore: Remove unused import of json in app.py 2024-06-27 20:19:56 +00:00
Simon Larsen
c657397d3b chore: Convert messages from JSON string to list in create_item endpoint 2024-06-27 20:19:44 +00:00
Simon Larsen
91cf4995b1 chore: Convert messages from JSON string to list in create_item endpoint 2024-06-27 20:11:57 +00:00
Simon Larsen
7b7c1e5951 chore: Convert messages from JSON string to list in create_item endpoint 2024-06-27 18:37:02 +00:00
Simon Larsen
b67583f8d3 refactor: Update Llama.ts to fix API route for prompt result 2024-06-27 19:16:49 +01:00
Simon Larsen
460b8459d4 chore: Update Llama Readme with GPU usage instructions 2024-06-27 17:51:46 +00:00
Simon Larsen
8328ece011 chore: Update docker-compose command in test.e2e.yaml 2024-06-27 17:48:41 +00:00
Simon Larsen
6f4045ffe9 refactor: Update SubscriptionPlan method name to getPlanType 2024-06-27 18:00:08 +01:00
Simon Larsen
54ce2c71c0 chore: Update docker-compose command in test.e2e.yaml 2024-06-27 16:27:59 +00:00
Simon Larsen
0a00cd9581 refactor: Update SubscriptionPlan method name to getPlanType 2024-06-27 16:00:21 +01:00
Simon Larsen
162c5d9db9 add queue to process responses 2024-06-27 14:56:22 +00:00
Simon Larsen
8be8c23ed9 refactor: Refactor code into smaller functions/methods 2024-06-27 15:48:52 +01:00
Simon Larsen
f2b6fffb4c chore: Add error handling for item processing
This commit adds error handling for item processing in the `job` function of `app.py`. When an error occurs while processing an item, the error is stored in the `errors` dictionary. This ensures that errors are captured and can be handled appropriately. The `queue-status` endpoint now includes the `errors` dictionary in the response, providing visibility into any processing errors that occurred.
2024-06-27 13:57:05 +00:00
Simon Larsen
626312d495 refactor: Refactor code into smaller functions/methods 2024-06-27 14:33:25 +01:00
Simon Larsen
77287868c4 refactor: Improve variable names in codebase 2024-06-27 14:15:18 +01:00
Simon Larsen
f7d221900a chore: Add error handling to ServerMonitor:CheckOnlineStatus 2024-06-27 13:40:07 +01:00
Simon Larsen
d51a420532 chore: Update docker-compose command in test.e2e.yaml
The `docker-compose` command in the `test.e2e.yaml` file has been updated to use `docker compose` instead. This change ensures compatibility with the latest version of Docker and improves the consistency of command usage across the project.
2024-06-27 13:18:57 +01:00
Simon Larsen
0567f92ddd chore: Update docker-compose command in test.e2e.yaml
The `docker-compose` command in the `test.e2e.yaml` file has been updated to use `docker compose` instead. This change ensures compatibility with the latest version of Docker and improves the consistency of command usage across the project.
2024-06-27 13:10:25 +01:00
Simon Larsen
e88e29f9e5 refactor: Update install.sh to support Windows OS 2024-06-27 11:58:14 +01:00
Simon Larsen
e50f6e14f0 chore: Update Server Monitor documentation for Linux/Mac and Windows
The Server Monitor documentation in the `Documentation.tsx` file has been updated to provide separate instructions for setting up the monitor on Linux/Mac and Windows. The title of the Linux/Mac section has been modified to reflect this change. Additionally, the Windows section has been added with detailed steps for downloading, configuring, starting, and stopping the agent. This update improves the clarity and usability of the Server Monitor documentation.
2024-06-27 11:57:35 +01:00
Simon Larsen
933b3e96a1 chore: Update pricing page with new features and descriptions 2024-06-27 11:36:53 +01:00
Simon Larsen
00b67974ed chore: Update pricing page with new headline
The pricing page has been updated to replace the previous headline with a new one that better highlights the value proposition of OneUptime. The new headline emphasizes that OneUptime is a comprehensive platform that combines 8+ tools into one, providing users with a complete SRE toolchain. This change improves the clarity and effectiveness of the messaging on the pricing page.
2024-06-27 11:18:06 +01:00
Simon Larsen
a05a7d9122 chore: Fix typos in code comments and UI text 2024-06-27 11:17:26 +01:00
Simon Larsen
fdf440f308 chore: Update HomeFeatureSet in Index.ts
The `HomeFeatureSet` object in `Index.ts` has been updated to modify the values for the `Public Status Page` and `Subscribers` features. The `free` plan for `Public Status Page` has been changed from "Unlimited" to "1", and the `free` plan for `Subscribers` has been changed from "Unlimited" to "100". Additionally, a new feature called `Synthetic Monitoring (with Playwright)` has been added to the `HomeFeatureSet` object.
2024-06-27 11:16:40 +01:00
Simon Larsen
34c6a32c48 refactor: Update install.sh to support Windows OS 2024-06-27 10:50:32 +01:00
Simon Larsen
0b078226f3 Merge branch 'master' of github.com:OneUptime/oneuptime 2024-06-27 10:29:38 +01:00
Simon Larsen
e0a5927bd1 refactor: Improve CopilotActionService file handling
This commit refactors the `CopilotActionService` class in the `Index.ts` file to improve file handling. It updates the logic for obtaining the result from the Copilot action and committing the changes to the repository. Additionally, it removes unused code and improves the readability of the file. This refactoring enhances the overall efficiency and maintainability of the `CopilotActionService` class.
2024-06-27 10:29:35 +01:00
Simon Larsen
bed1f0dbb5 Merge pull request #1528 from OneUptime/snyk-upgrade-81e090968d72376d6229e5d49596cc79
[Snyk] Upgrade @opentelemetry/semantic-conventions from 1.24.1 to 1.25.0
2024-06-27 10:29:18 +01:00
Simon Larsen
4fef8ccfb5 Merge pull request #1526 from OneUptime/snyk-upgrade-274375204ccf65ed6f3d939f4cd74fda
[Snyk] Upgrade @opentelemetry/context-zone from 1.24.1 to 1.25.0
2024-06-27 10:29:07 +01:00
Simon Larsen
bb29b4be4b Merge pull request #1524 from OneUptime/snyk-upgrade-579a7cc9445a00c813ed17b2ba523e50
[Snyk] Upgrade posthog-js from 1.136.2 to 1.136.7
2024-06-27 10:29:00 +01:00
snyk-bot
078d89d8ae fix: upgrade @opentelemetry/semantic-conventions from 1.24.1 to 1.25.0
Snyk has created this PR to upgrade @opentelemetry/semantic-conventions from 1.24.1 to 1.25.0.

See this package in npm:
@opentelemetry/semantic-conventions

See this project in Snyk:
https://app.snyk.io/org/oneuptime-RsC2nshvQ2Vnr35jHvMnMP/project/47001ef1-7b3a-49c2-88cd-8025c56346d0?utm_source=github&utm_medium=referral&page=upgrade-pr
2024-06-27 06:01:55 +00:00
snyk-bot
6b4727bc9f fix: upgrade @opentelemetry/context-zone from 1.24.1 to 1.25.0
Snyk has created this PR to upgrade @opentelemetry/context-zone from 1.24.1 to 1.25.0.

See this package in npm:
@opentelemetry/context-zone

See this project in Snyk:
https://app.snyk.io/org/oneuptime-RsC2nshvQ2Vnr35jHvMnMP/project/47001ef1-7b3a-49c2-88cd-8025c56346d0?utm_source=github&utm_medium=referral&page=upgrade-pr
2024-06-27 06:01:45 +00:00
Simon Larsen
95aaa68010 refactor: Update install.sh to support Windows OS 2024-06-26 22:05:09 +01:00
Simon Larsen
976686b5af refactor: Update install.sh to support Windows OS
The `install.sh` script has been updated to support the Windows operating system. This includes changes to the URL construction and the addition of logic to handle downloading and unzipping the binary for Windows. This enhancement improves the installation process for Windows users.
2024-06-26 22:02:12 +01:00
Simon Larsen
f59064108e refactor: Add isActionComplete method to CopilotActionsBase.ts
This commit adds a new method, `isActionComplete`, to the `CopilotActionsBase.ts` file. The method returns a boolean value indicating whether the action is complete. By default, the method returns `true`, but it can be overridden in derived classes to provide custom logic for determining the action's completion status. This enhancement improves the flexibility and extensibility of the `CopilotActionsBase` class.
2024-06-26 21:47:20 +01:00
Simon Larsen
44d8254e7d refactor: Remove unused getNextFilePath method in CopilotActionsBase.ts 2024-06-26 21:43:13 +01:00
Simon Larsen
d284a6ff54 refactor: Remove unused getNextFilePath method in CopilotActionsBase.ts 2024-06-26 21:40:39 +01:00
Simon Larsen
1908f02447 refactor: Extract code from CopilotActionBase to separate functions 2024-06-26 21:40:07 +01:00
Simon Larsen
f50e20d896 refactor: Extract code from CopilotActionBase to separate functions 2024-06-26 20:55:14 +01:00
Simon Larsen
bd8ed04e1b refactor: Extract code from CopilotActionBase to separate functions
This commit extracts code from the `CopilotActionBase.ts` file into separate functions for better code organization and readability. The extracted code includes the logic for ordering SSL certificates, checking the order status, and handling domain removal. This refactoring improves the maintainability and modularity of the codebase.
2024-06-26 19:33:01 +01:00
Simon Larsen
27c54221cb feat: Mark domain as not ordered and update SSL status
This commit updates the `StatusPageDomainService.ts` file to mark a domain as not ordered and update the SSL status when it is removed. The `notifyDomainRemoved` function now includes logic to update the `isSslOrdered` and `isSslProvisioned` properties to `false` for the specified domain. This ensures that the SSL certificate is not ordered or provisioned for the removed domain.
2024-06-26 14:42:17 +01:00
Simon Larsen
cf589ba0c6 refactor: Remove invalid domain and notify removal
The code changes in GreenlockUtil.ts remove the domain if the CNAME is not valid and notify the removal. This ensures that only valid domains are processed for ordering SSL certificates.
2024-06-26 14:38:26 +01:00
Simon Larsen
43eaff3a6d feat: Add logic to order SSL certificate for valid domains
The code changes in `StatusPageDomainService.ts` add logic to order an SSL certificate for valid domains. If the CNAME is valid, the code attempts to order the certificate using the `orderCert` function. This ensures that all valid domains have the necessary SSL protection.
2024-06-26 14:31:08 +01:00
Simon Larsen
30e96de2d9 refactor: Check order status for SSL certificates
This commit adds a new cron job in the `StatusPageCerts.ts` file to check the order status of SSL certificates for domains that have already ordered them. If a certificate does not exist for a domain, the code will attempt to order the certificate again. This ensures that all domains with ordered certificates have the necessary SSL protection.
2024-06-26 14:25:35 +01:00
Simon Larsen
43c4f44f1f refactor: Check order status for SSL certificates
This commit adds a new cron job in the `StatusPageCerts.ts` file to check the order status of SSL certificates for domains that have already ordered them. If a certificate does not exist for a domain, the code will attempt to order the certificate again. This ensures that all domains with ordered certificates have the necessary SSL protection.
2024-06-26 14:24:49 +01:00
Simon Larsen
af6f5af11d Update phone number placeholders in registration and subscription forms 2024-06-26 12:36:27 +01:00
snyk-bot
79603c9bb4 fix: upgrade posthog-js from 1.136.2 to 1.136.7
Snyk has created this PR to upgrade posthog-js from 1.136.2 to 1.136.7.

See this package in npm:
posthog-js

See this project in Snyk:
https://app.snyk.io/org/oneuptime-RsC2nshvQ2Vnr35jHvMnMP/project/f6446ec8-d441-487e-b58f-38373430e213?utm_source=github&utm_medium=referral&page=upgrade-pr
2024-06-26 05:31:20 +00:00
Simon Larsen
e2074b010e refactor: Add notification webhook on user creation
This commit adds a notification webhook on user creation in the UserService. When a new user is created, a Slack message is sent to the specified webhook URL with details about the user's email, name, phone number, and company name. This feature enhances the user onboarding process and allows for better tracking and communication with new users.
2024-06-25 22:48:46 +01:00
Simon Larsen
2187edc158 refactor: Update Select.ts and Project.ts for better code organization and readability 2024-06-25 22:16:08 +01:00
Simon Larsen
a9778cf9d0 refactor: Update Copilot README.md file
This commit adds a blank line at the end of the Copilot README.md file. This change ensures consistency in the file structure and improves readability.
2024-06-25 12:09:25 +01:00
Simon Larsen
c450c3fa1b ```text
refactor: Update server_name in Nginx configuration

This commit updates the server_name directive in the Nginx configuration file to remove the ${HOST}:${ONEUPTIME_HTTP_PORT} variable and use just ${HOST}. This change ensures that the server_name is set correctly for all domains.
2024-06-24 21:43:24 +01:00
Simon Larsen
3aaed9c901 refactor: Update OneUptime port in nginx.yaml
This commit updates the ONEUPTIME_HTTP_PORT value in the nginx.yaml file to use the port specified in the $.Values.port.nginxHttp variable. This change ensures that OneUptime is hosted on the correct port.
2024-06-24 19:59:36 +01:00
Simon Larsen
70a9944f6a refactor: Update Nginx configuration to enable HTTP/2
This commit updates the Nginx configuration file to enable HTTP/2 by removing the `http2` directive from the `listen` directive and adding a separate `http2` directive. This change ensures that the server supports the latest HTTP/2 protocol, improving performance and security.
2024-06-24 19:56:45 +01:00
Simon Larsen
ad48aae0ba ```text
refactor: Update OneUptime port in config.example.env

This commit updates the ONEUPTIME_HTTP_PORT value in the config.example.env file to 80. This change ensures that OneUptime is hosted on the correct port.
2024-06-24 19:47:15 +01:00
Simon Larsen
14f9950c38 Update container port names for status page in nginx.yaml 2024-06-24 19:45:01 +01:00
Simon Larsen
4acedfdd62 Update nginx.yaml and values.yaml for hosting OneUptime and status page on different ports 2024-06-24 19:42:46 +01:00
Simon Larsen
deff7c9464 refactor: Add missing comma in SchemaMigrations/Index.ts 2024-06-24 19:19:52 +01:00
Simon Larsen
b407286ef0 refactor: Add migration for new schema version 2024-06-24 19:18:26 +01:00
Simon Larsen
9348076df0 refactor: Improve error handling in CheckHeartbeat.ts
This commit improves the error handling in the CheckHeartbeat.ts file. It adds a try-catch block around the main logic to catch any errors that occur during the processing of incoming request monitors. Additionally, it logs the error message and the ID of the monitor that caused the error. This change enhances the robustness and reliability of the code by properly handling and logging errors.
2024-06-24 18:50:59 +01:00
Simon Larsen
09a7e155b7 refactor: Update Project.ts to use number type for enterpriseAnnualContractValue column
The code changes in Project.ts modify the type of the enterpriseAnnualContractValue column from ShortText to Number. This change ensures that the column stores numeric values instead of text, improving data integrity and query performance.
2024-06-24 17:45:36 +01:00
Simon Larsen
127cc6b9b1 refactor: Add logging statements for IncomingRequestMonitor
This commit adds logging statements to the IncomingRequestMonitor module to improve debugging and monitoring. The added log messages provide information about the number of incoming request monitors found and whether a monitor should process a request. This change enhances the visibility and understanding of the monitoring process.
2024-06-24 17:31:42 +01:00
Simon Larsen
ea5474527c refactor: Update CompareCriteria message formatting
This commit refactors the CompareCriteria class to update the message formatting for different filter types. The previous implementation included the word "threshold" in the message, which is unnecessary and can be confusing. The updated message now clearly states whether the value is greater than, greater than or equal to, less than, less than or equal to, or not equal to the threshold value. This change improves the clarity and readability of the message generated by the CompareCriteria class.
2024-06-24 14:28:05 +01:00
Simon Larsen
9111b831a7 chore: Update docker-compose.dev.yml command in test.e2e.yaml 2024-06-24 13:29:34 +01:00
Simon Larsen
dcabdd0a55 refactor: Remove unused CopilotEvent table
This commit removes the unused CopilotEvent table from the database schema. The table is no longer needed and has been dropped to improve database performance and reduce clutter.
2024-06-24 12:52:57 +01:00
Simon Larsen
058b585eda refactor: Add migration for new schema version
This commit adds a new migration file for the latest schema version. The migration file is named "1719228104620-MigrationName". This ensures that the database schema is up to date with the latest changes.
2024-06-24 12:23:15 +01:00
Simon Larsen
25da20a968 refactor: Add migration for enterprise annual contract value column 2024-06-24 12:16:01 +01:00
Simon Larsen
4f4d9946ff Merge branch 'master' of github.com:OneUptime/oneuptime 2024-06-23 21:37:38 +01:00
Simon Larsen
0987634e54 refactor: Fix formatting and add comments in ArrayUtil.ts and CopilotActionProcessingException.ts 2024-06-23 21:37:36 +01:00
Simon Larsen
c099f3a3ef refactor: Improve error handling in app.py
The error handling in app.py has been improved to catch and handle exceptions that occur during the processing of items in the queue. This change ensures that errors are properly logged and that the affected items are removed from the pending items list.
2024-06-23 20:31:43 +00:00
Simon Larsen
a3f5e268b5 refactor: Shuffle files in Copilot Init to avoid fixing the same file in each run 2024-06-23 21:29:23 +01:00
Simon Larsen
2599841d37 Merge branch 'master' of github.com:OneUptime/oneuptime 2024-06-23 21:04:49 +01:00
Simon Larsen
6c8a0c8cdc refactor: Improve file extension handling in LocalFile.ts 2024-06-23 21:04:46 +01:00
Simon Larsen
0d24bb6351 Merge pull request #1504 from OneUptime/snyk-upgrade-48794e3e1c0fd38df637134c9642af47
[Snyk] Upgrade posthog-js from 1.136.1 to 1.136.2
2024-06-23 21:01:01 +01:00
Simon Larsen
a4c5354152 refactor: Improve comments in ImproveComments.ts 2024-06-23 20:58:21 +01:00
Simon Larsen
a906713f6e Merge branch 'master' of github.com:OneUptime/oneuptime 2024-06-23 19:41:26 +01:00
Simon Larsen
e85e351797 refactor: Remove unnecessary blank lines in ServiceLanguageUtil class 2024-06-23 19:41:24 +01:00
Simon Larsen
3f9c1fd46e Merge branch 'master' of github.com:OneUptime/oneuptime 2024-06-23 18:40:56 +00:00
Simon Larsen
6c3edbfcb0 ```text
refactor: Update app.py to use asyncio.create_task for job function

The job function in app.py has been updated to use the asyncio.create_task method instead of directly calling the job function. This change improves the efficiency and performance of the code by allowing the job function to run concurrently with other tasks.
2024-06-23 18:40:38 +00:00
Simon Larsen
d3f212c9ec Merge branch 'master' of github.com:OneUptime/oneuptime 2024-06-23 19:35:07 +01:00
Simon Larsen
1964db22f1 refactor: Add support for Markdown file extension in ServiceLanguage enum 2024-06-23 19:35:04 +01:00
Simon Larsen
b6a70bbd6c refactor: Convert job function to async in app.py 2024-06-23 18:23:15 +00:00
Simon Larsen
f36609712b refactor: Add print statements to debug message processing in app.py 2024-06-23 18:13:39 +00:00
Simon Larsen
6737d97f30 refactor: Improve comments in ImproveComments.ts 2024-06-23 18:00:44 +01:00
Simon Larsen
d22b40e91a refactor: Improve comments in ImproveComments.ts 2024-06-23 18:00:16 +01:00
Simon Larsen
e2e4db5073 Merge branch 'master' of github.com:OneUptime/oneuptime 2024-06-22 19:40:21 +01:00
Simon Larsen
2415f97ec6 refactor: Add NotAcceptedFileExtentionForCopilotAction exception handling 2024-06-22 19:40:18 +01:00
Simon Larsen
0910c9f6f6 Merge branch 'ai-copilot-main' 2024-06-22 12:43:42 +00:00
Simon Larsen
1a02f5b73e refactor: Update queue_status endpoint response key name
The key name in the response of the queue_status endpoint has been updated from "prnding" to "pending" to fix a typo. This change ensures consistency and improves the readability of the returned data.
2024-06-22 12:43:04 +00:00
Simon Larsen
b6cabf12d5 refactor: Update CopilotActionsBase to include PR generation message
This commit updates the `CopilotActionsBase.ts` file to include a message about PR generation in the warning section. The message informs users that the PR is generated by OneUptime Copilot and advises them to review the changes before merging. This enhancement improves the clarity and transparency of the generated PRs.
2024-06-22 13:36:52 +01:00
Simon Larsen
27ef73be20 refactor: Execute CopilotAction and update currentFixCount
This commit modifies the `Copilot/Init.ts` file to execute the `CopilotActionService.execute` method for each event that needs fixing. It also updates the `currentFixCount` variable to keep track of the number of fixes performed. This refactor improves the functionality of the Copilot service by ensuring that all necessary actions are executed and the fix count is accurately maintained.
2024-06-22 13:34:54 +01:00
Simon Larsen
00b35c4d9a refactor: Convert job function to async in app.py
The job function in app.py has been converted to an async function to support asynchronous processing. This change improves the performance and responsiveness of the application by allowing other tasks to run concurrently while the job function is processing the queue.
2024-06-22 12:31:53 +00:00
Simon Larsen
369bdfc841 ```text
refactor: Add FixGrammarAndSpelling action to CopilotActionType and CopilotActions

This commit adds the `FixGrammarAndSpelling` action to the `CopilotActionType` enum and the `CopilotActions` dictionary. The action is now available for execution in the Copilot service. This enhancement improves the codebase by providing a new action that can be used to fix grammar and spelling errors in the application.
2024-06-22 12:50:54 +01:00
Simon Larsen
8150f44244 refactor: Improve comments in ImproveComments.ts 2024-06-22 12:42:34 +01:00
Simon Larsen
6a646c06b3 refactor: Remove unused CopilotActionType enum value
This commit removes the unused `CopilotActionType` enum value from the `CopilotActionType.ts` file. The value was commented out and had no impact on the functionality of the application. Removing it helps to improve code clarity and maintainability.
2024-06-22 12:38:27 +01:00
Simon Larsen
422656caf3 refactor: Remove unused PromptsUtil class
This commit removes the unused `PromptsUtil` class from the codebase. The class was no longer being used and had no impact on the functionality of the application. Removing it helps to reduce code complexity and improve maintainability.
2024-06-22 12:35:38 +01:00
Simon Larsen
5223d1bd6d refactor: Improve comments in CopilotActionType and CopilotActionsBase
The code changes in this commit refactor the comments in the `CopilotActionType` and `CopilotActionsBase` files. The comments have been improved to provide clearer instructions and guidelines for code commenting. This enhancement ensures that the codebase is well-documented and easier to understand for future developers.
2024-06-22 12:35:12 +01:00
Simon Larsen
42f0b90291 refactor: Update SendStatusChangeNotification to convert rootCause to HTML
This commit updates the SendStatusChangeNotification module to convert the rootCause property to HTML using the Markdown.convertToHTML function. This ensures that the rootCause is properly formatted for display in email notifications. The conversion is only performed if the rootCause is not empty. This improvement enhances the readability and presentation of the status change notifications.
2024-06-22 12:26:03 +01:00
Simon Larsen
3d4f28fc0f refactor: Simplify CodeRepositoryUtil.pullChanges method signature 2024-06-22 11:33:52 +01:00
snyk-bot
e74c6a7030 fix: upgrade posthog-js from 1.136.1 to 1.136.2
Snyk has created this PR to upgrade posthog-js from 1.136.1 to 1.136.2.

See this package in npm:
posthog-js

See this project in Snyk:
https://app.snyk.io/org/oneuptime-RsC2nshvQ2Vnr35jHvMnMP/project/f6446ec8-d441-487e-b58f-38373430e213?utm_source=github&utm_medium=referral&page=upgrade-pr
2024-06-21 19:17:11 +00:00
Simon Larsen
6be976102c refactor: Remove commented out code and unused imports 2024-06-21 18:53:11 +01:00
Simon Larsen
261072b1fd refactor: Update logging statements in CopilotActionService 2024-06-21 18:35:22 +01:00
Simon Larsen
e7659bdf08 chore: Switch to main branch before executing CopilotAction 2024-06-21 18:06:06 +01:00
Simon Larsen
2a8c45cea0 refactor: Improve page load performance with lazy loading for images 2024-06-21 18:04:09 +01:00
Simon Larsen
b197416247 Update OneUptime installation documentation and Docker Compose file
This commit updates the OneUptime installation documentation and Docker Compose file to provide clearer instructions for setting up and updating OneUptime. It includes steps for accessing OneUptime, setting up TLS/SSL certificates, and updating OneUptime using Git. The changes ensure that users have the necessary information to install and maintain OneUptime effectively.
2024-06-21 17:41:34 +01:00
Simon Larsen
fe0e745640 refactor: Update TLS/SSL certificate setup instructions 2024-06-21 17:39:05 +01:00
Simon Larsen
28ea4d9b83 refactor: Update TLS/SSL certificate setup instructions
This commit updates the installation documentation and example configuration file to provide clear instructions on setting up TLS/SSL certificates for OneUptime. It emphasizes that OneUptime does not support setting up SSL/TLS certificates and provides steps for using a reverse proxy like Nginx or Caddy, along with Let's Encrypt, to provision the certificates. It also includes instructions for updating the necessary settings in the configuration file. This improvement ensures that users have the necessary information to secure their OneUptime installation with SSL/TLS certificates.
2024-06-21 17:38:30 +01:00
Simon Larsen
3d7cb148d0 refactor: Update MonitorTable to use MonitorElement for rendering monitor names
This commit updates the MonitorTable component to use the MonitorElement component for rendering monitor names in the table. The MonitorElement component takes a Monitor object as a prop and renders the monitor name as a link. This change improves the modularity and reusability of the code by separating the rendering logic into a separate component.
2024-06-21 17:21:20 +01:00
Simon Larsen
0d0760e450 refactor: Update ServerMonitorCriteria to handle evaluateOverTime options
This commit updates the ServerMonitorCriteria class to handle the evaluateOverTime options in the criteria filter. If the evaluateOverTime flag is set to true and evaluateOverTimeOptions are provided, the offlineIfNotCheckedInMinutes value is updated accordingly. This enhancement improves the flexibility and customization of the ServerMonitorCriteria class.
2024-06-21 16:42:51 +01:00
Simon Larsen
a6f66a59bf refactor: Update sleep duration to 10 minutes for server startup 2024-06-21 16:11:16 +01:00
Simon Larsen
f09419ef50 refactor: Update failureCause message in PingMonitor.ts 2024-06-21 13:59:45 +01:00
Simon Larsen
4c90dc66a0 refactor: Update SendCreatedResourceNotification to convert rootCause to HTML 2024-06-21 13:56:23 +01:00
Simon Larsen
99c2e34ab5 refactor: Add support for IsOnline check in CriteriaFilterUtil 2024-06-21 13:43:29 +01:00
Simon Larsen
0fb0e9b047 refactor: Update SendCreatedResourceNotification to convert rootCause to HTML
This commit updates the SendCreatedResourceNotification class to convert the rootCause property to HTML using the Markdown.convertToHTML function. This ensures that the rootCause is properly formatted and displayed in the incident notification email. The rootCause is either the incident's rootCause or a default message if no rootCause is identified. This enhancement improves the readability and effectiveness of the incident notifications.
2024-06-21 13:34:00 +01:00
Simon Larsen
7ae6a3c5ea refactor: Update ProbeMonitorResponseService to include criteria details in rootCause
This commit updates the ProbeMonitorResponseService class to include the criteria details in the rootCause property of the ProbeApiIngestResponse. The criteria met ID, criteria name, criteria description, filter conditions met, and failure cause are now included in the rootCause. This enhancement improves the clarity and completeness of the rootCause information.
2024-06-21 13:08:05 +01:00
Simon Larsen
59f0526936 refactor: Update EvaluateOverTime method to handle boolean values for IsOnline metric
The EvaluateOverTime method in the EvaluateOverTime.ts file has been updated to handle boolean values for the IsOnline metric. This change allows the method to correctly evaluate and process the IsOnline metric data, improving the accuracy and reliability of the evaluation process.
2024-06-21 12:57:50 +01:00
Simon Larsen
bfcd5c1753 refactor: Improve clarity of CompareCriteria message generation
The CompareCriteria class has been refactored to improve the clarity of message generation. The code now checks the filter type before appending the values to the message, ensuring that the message is only generated when necessary. This change enhances the readability and maintainability of the code.
2024-06-21 12:31:43 +01:00
Simon Larsen
76df1a5889 refactor: Fix CriteriaFilterUtil to handle IsOnline check correctly
The CriteriaFilterUtil class has been updated to handle the IsOnline check correctly. The getEvaluateOverTimeTypeByCriteriaFilter method now includes the IsOnline check in the returned array of EvaluateOverTimeType values. This fix ensures that the CriteriaFilterUtil class functions properly and provides accurate results for the IsOnline check.
2024-06-21 12:24:06 +01:00
Simon Larsen
422ee6c192 refactor: Add support for IsOnline check in CriteriaFilterUtil
This commit adds support for the IsOnline check in the CriteriaFilterUtil class. The getEvaluateOverTimeTypeByCriteriaFilter method now includes the IsOnline check in the returned array of EvaluateOverTimeType values. This enhancement improves the functionality and flexibility of the CriteriaFilterUtil class.
2024-06-21 11:58:21 +01:00
Simon Larsen
808b3512f3 refactor: Improve clarity of declaredBy field assignment in SendCreatedResourceNotification.ts
This commit refactors the code in SendCreatedResourceNotification.ts to improve the clarity of how the "declaredBy" field is assigned. The code now checks if the incident has a createdByProbe and createdByUser, and assigns the appropriate value to "declaredBy" based on the available information. This change enhances the readability and maintainability of the code.
2024-06-21 11:44:19 +01:00
Simon Larsen
742796fd67 feat: Add declaredBy field to IncidentOwnerResourceCreated template and SendCreatedResourceNotification job
This commit adds the "declaredBy" field to the IncidentOwnerResourceCreated template in the Notification feature set and the SendCreatedResourceNotification job in the Workers feature set. The "declaredBy" field is used to display the name of the user or probe who declared the incident. This enhancement improves the clarity and completeness of the incident notifications sent to incident owners.
2024-06-21 11:39:32 +01:00
Simon Larsen
9027369e10 refactor: Add suffix to ProbeElement in Probe.tsx
This commit adds a new optional prop "suffix" to the ProbeElement component in Probe.tsx. The suffix is appended to the probe name displayed in the UI. This enhancement provides more flexibility in customizing the display of probe names.
2024-06-21 11:24:13 +01:00
Simon Larsen
a87f3ac896 refactor: Fix branch name generation in CopilotActionsBase.ts
The branch name generation in CopilotActionsBase.ts has been fixed to replace double hyphens with a single hyphen. This ensures that the branch name is correctly formatted and avoids any potential issues with branch creation and management.
2024-06-21 10:59:34 +01:00
Simon Larsen
db75cc1a5b Merge pull request #1499 from OneUptime/ai-copilot-main
Ai copilot main
2024-06-21 10:41:28 +01:00
Simon Larsen
2deeb32b78 refactor: Fix branch name generation in CopilotActionsBase.ts
The branch name generation in CopilotActionsBase.ts has been fixed to replace double hyphens with a single hyphen. This ensures that the branch name is correctly formatted and avoids any potential issues with branch creation and management.
2024-06-20 22:31:58 +01:00
Simon Larsen
bc8b8eb982 refactor: Update LlmType import paths in Copilot/Config.ts, Copilot/Service/LLM/Llama.ts, and Copilot/Service/LLM/LLM.ts
This commit updates the import paths for the LlmType module in the following files:
- Copilot/Config.ts
- Copilot/Service/LLM/Llama.ts
- Copilot/Service/LLM/LLM.ts

The import paths are corrected to match the actual file structure, ensuring that the LlmType module is properly imported and used throughout the codebase. This change improves the maintainability and readability of the code.
2024-06-20 21:37:24 +01:00
Simon Larsen
ef3fe66e72 Merge pull request #1498 from jackveney/patch-1
Update endpoint-status.sh to follow redirects
2024-06-20 21:10:32 +01:00
Jack Veney
17a0b65a4b Update endpoint-status.sh
Included the -L option in the curl command, ensuring that it will follow any 301 redirects until the final URL is reached.
2024-06-20 15:24:27 -04:00
Simon Larsen
01a1a0f69e Merge pull request #1496 from OneUptime/snyk-upgrade-99d49c023062d95b651963a884a19da7
[Snyk] Upgrade posthog-js from 1.135.2 to 1.136.1
2024-06-20 17:30:18 +01:00
Simon Larsen
1260e482cf refactor: Improve comments in code and update job function in app.py 2024-06-20 13:14:39 +01:00
Simon Larsen
6e5081a4e3 refactor: Remove unused CopilotEvent and CopilotEventService 2024-06-20 12:30:06 +01:00
Simon Larsen
dd93998296 refactor: Remove unused CopilotEvent and CopilotEventService
This commit removes the unused CopilotEvent enum and CopilotEventService class. These files are no longer needed in the codebase and can be safely deleted. Removing unused code improves the maintainability and reduces the complexity of the project.
2024-06-20 11:41:04 +01:00
Simon Larsen
94956b045a refactor: Improve comments in code and update job function in app.py
This commit refactors the code by improving the comments in the code and updating the job function in app.py. The comments are now focused on code that is hard to understand, and unnecessary comments are removed. The job function is converted to an async function to support asynchronous processing, which improves the performance and responsiveness of the application. These changes enhance the readability and efficiency of the codebase.
2024-06-20 10:00:07 +00:00
Simon Larsen
b2f650a865 refactor: Sanitize file path in CodeRepositoryUtil.getFileContent()
The file path in the CodeRepositoryUtil.getFileContent() method is now sanitized using the LocalFile.sanitizeFilePath() function before executing the command. This change ensures that the file path is properly formatted and prevents any potential security vulnerabilities or errors caused by invalid file paths.
2024-06-20 10:26:16 +01:00
Simon Larsen
4390a37184 fix prompt 2024-06-20 09:22:53 +00:00
Simon Larsen
9b08d1a9e4 refactor: Convert job function to async in app.py
The job function in app.py has been converted to an async function to support asynchronous processing. This change improves the performance and responsiveness of the application by allowing other tasks to run concurrently while the job function is processing the queue.
2024-06-19 21:05:36 +00:00
Simon Larsen
dbef1071e0 refactor: Add GPU support to Llama app in docker-compose.ai.yml 2024-06-19 20:58:08 +00:00
Simon Larsen
98fbbe301e refactor: Update variable types in Copilot/Init.ts and Copilot/Utils/Prompts.ts 2024-06-19 21:03:54 +01:00
snyk-bot
6805083725 fix: upgrade posthog-js from 1.135.2 to 1.136.1
Snyk has created this PR to upgrade posthog-js from 1.135.2 to 1.136.1.

See this package in npm:
posthog-js

See this project in Snyk:
https://app.snyk.io/org/oneuptime-RsC2nshvQ2Vnr35jHvMnMP/project/f6446ec8-d441-487e-b58f-38373430e213?utm_source=github&utm_medium=referral&page=upgrade-pr
2024-06-19 19:07:13 +00:00
Simon Larsen
27213fa235 refactor: Add FixNumberOfCodeEventsInEachRun constant to Config.ts
This commit adds the FixNumberOfCodeEventsInEachRun constant to the Config.ts file. The constant is set to 5 and is used to determine the number of code events to fix in each run. This change improves the flexibility and configurability of the code events handling in the application.
2024-06-19 16:29:25 +01:00
Simon Larsen
baa98e333e refactor: Update LlmType export in Config.ts and LlmType.ts 2024-06-19 15:36:24 +01:00
Simon Larsen
ccdcf2c679 refactor: Update Llama app to use local model path instead of model ID 2024-06-19 15:06:36 +01:00
Simon Larsen
85edd12c2d refactor: Update Dockerfile.tpl to use huggingface/transformers-pytorch-gpu image 2024-06-19 13:20:34 +00:00
Simon Larsen
97cc28b182 refactor: Update Dockerfile.tpl to use huggingface/transformers-pytorch-gpu image
This commit updates the Dockerfile.tpl to use the huggingface/transformers-pytorch-gpu image instead of the continuumio/anaconda3 image. This change allows the Llama app to utilize GPU resources for improved performance in AI processing. Additionally, the unnecessary installation of the transformers and accelerate libraries is removed as they are already included in the huggingface/transformers-pytorch-gpu image.
2024-06-19 13:06:23 +00:00
Simon Larsen
b0041e6993 refactor: Update Dockerfile.tpl to expose port 8547 instead of port 80 2024-06-19 12:18:25 +00:00
Simon Larsen
a66d78743d Merge pull request #1495 from im-alfa/bugfix/add-aero-as-a-valid-tld
fix: add `.aero` as a valid TLD
2024-06-19 12:48:38 +01:00
Simon Larsen
bc78491478 ```text
refactor: Add appname label to probe.yaml

This commit adds the "appname" label to the probe.yaml file in order to provide additional information about the application. This label will help with identifying the specific application when managing and monitoring the Kubernetes resources.
2024-06-19 11:14:33 +01:00
alfa
7751870ccf fix: add .aero as a valid TLD 2024-06-19 05:42:23 +02:00
Simon Larsen
df6ffb15d4 refactor: Add GPU support to Llama app in docker-compose.ai.yml
This commit adds GPU support to the Llama app in the docker-compose.ai.yml file. It includes a new deploy section with reservations for GPU devices, specifying the driver, count, and capabilities. This change enables the Llama app to utilize GPU resources for improved performance in AI processing.
2024-06-18 22:11:53 +01:00
Simon Larsen
df20f343e9 refactor: Update Llama app to log prompt and output to console
This commit updates the Llama app to log the prompt and output to the console for debugging purposes. It adds print statements to log the prompt before processing and the generated output after processing. This change improves the development workflow by providing visibility into the input and output of the AI model.
2024-06-18 22:08:42 +01:00
Simon Larsen
e4ade513ce feat: Add start-ai, build-ai, and force-build-ai scripts for AI services
This commit adds three new scripts, start-ai, build-ai, and force-build-ai, to the package.json file. These scripts are used to start, build, and force-build the AI services respectively. They are configured to export environment variables, run the prerun script, and execute the necessary docker compose commands with the specified configuration file. This addition enhances the development workflow by providing convenient commands for managing the AI services.
2024-06-18 21:49:00 +01:00
Simon Larsen
3c2af1dc38 refactor: Remove unused Llama service from docker-compose.dev.yml 2024-06-18 21:47:40 +01:00
Simon Larsen
af5d714642 refactor: Add generate-build-number job as dependency in infrastructure-agent-deploy workflow 2024-06-18 21:41:57 +01:00
Simon Larsen
3f315be279 refactor: Update Llama app to use local model path instead of model ID
This commit updates the Llama app to use a local model path instead of a model ID. The model path is set to "/app/Models/Meta-Llama-3-8B-Instruct". This change improves the reliability and performance of the app by directly referencing the model file instead of relying on an external model ID.
2024-06-18 21:41:29 +01:00
Simon Larsen
095493cec9 Merge branch 'release' into ai-copilot-main 2024-06-18 19:29:03 +01:00
Simon Larsen
3bdf87f34f refactor: Update github-release workflow to include generate-build-number job
This commit modifies the github-release workflow to include the generate-build-number job as a dependency. Previously, the workflow only depended on the test-e2e-release-saas and test-e2e-release-self-hosted jobs. By adding the generate-build-number job, we ensure that the necessary build number is generated before the github-release job is executed. This change improves the overall release process by providing accurate build information for the release.
2024-06-18 19:02:46 +01:00
Simon Larsen
26bb6f1e74 refactor: Update Dockerfile.tpl to expose port 8547 instead of port 80
This commit modifies the Dockerfile.tpl file to update the EXPOSE directive. The port number is changed from 80 to 8547 to align with the port used by the Llama application. This change ensures that the Llama application is accessible from outside the container on the correct port.
2024-06-18 18:42:11 +01:00
Simon Larsen
20db81a5f6 refactor: Update secrets.yaml to add keys for postgres, redis, and clickhouse
This commit modifies the secrets.yaml file to add keys for postgres, redis, and clickhouse. These keys are used to store sensitive information such as passwords for external services. By including these keys, we ensure that the necessary secrets are available for the application to connect to these services securely.
2024-06-18 13:59:49 +01:00
Simon Larsen
f9b097a112 refactor: Improve page load performance by lazy loading images
This commit updates the Register.spec.ts file to improve the page load performance by implementing lazy loading for images. It ensures that the dashboard page is up before signing up the user and reloads the page if it fails to load. These changes enhance the user experience by optimizing the loading time of the registration page.
2024-06-18 13:45:51 +01:00
Simon Larsen
b70b70e27e Merge remote-tracking branch 'origin/snyk-upgrade-e85a20baed82dca9b23b1e6d43058393' 2024-06-18 13:35:13 +01:00
Simon Larsen
93df459662 Merge pull request #1487 from OneUptime/snyk-upgrade-07f6caf2da548bfa468d50536046a7d4
[Snyk] Upgrade playwright from 1.44.0 to 1.44.1
2024-06-18 13:34:00 +01:00
Simon Larsen
1aceb81c85 Merge pull request #1490 from OneUptime/snyk-upgrade-3e8efba0b61bba9ccdff4fbf1899abe8
[Snyk] Upgrade posthog-js from 1.133.0 to 1.135.2
2024-06-18 13:33:53 +01:00
Simon Larsen
023aea94c2 Merge pull request #1491 from OneUptime/snyk-upgrade-172a12f064e961ffc3354f68f2eb7cb7
[Snyk] Upgrade @babel/runtime from 7.24.5 to 7.24.6
2024-06-18 13:33:46 +01:00
Simon Larsen
d8dff468ab refactor: Update Cookie.ts to accept string as key parameter
This commit modifies the Cookie.ts file to update the setItem method signature. The key parameter now accepts both CookieName and string types, allowing for more flexibility when setting cookies. This change improves the usability and versatility of the Cookie utility class.
2024-06-18 13:33:09 +01:00
Simon Larsen
082d800c34 refactor: Update ProbeMonitorResponseService to include remediation notes
This commit updates the ProbeMonitorResponseService class to include a check for the presence of remediation notes in the criteriaIncident object. If remediation notes are provided, they are assigned to the incident object. This change enhances the functionality of the ProbeMonitorResponseService by allowing the storage and retrieval of remediation notes for incidents.
2024-06-18 13:08:56 +01:00
Simon Larsen
e7f4c962b8 refactor: Update incident form to include remediation notes
This commit updates the incident form to include a field for remediation notes. This allows users to provide specific steps that should be taken to resolve the incident. By adding this feature, we enhance the incident management process and improve collaboration among team members.
2024-06-18 13:07:59 +01:00
Simon Larsen
f6074fe8f4 refactor: Update MonitorCriteriaIncident component to remove unused imports 2024-06-18 13:00:10 +01:00
Simon Larsen
b45678f167 refactor: Update MonitorCriteriaIncidentForm UI with incident description and remediation notes
This commit updates the MonitorCriteriaIncidentForm component to include fields for incident description and remediation notes. The incident description field now supports markdown formatting and has a placeholder text for when no description is entered. Similarly, the remediation notes field also supports markdown formatting and has a placeholder text for when no notes are entered. These changes enhance the user experience by providing a more comprehensive incident form.
2024-06-18 12:59:22 +01:00
Simon Larsen
6d53678135 refactor: Add new migration for SchemaMigrations and update MonitorCriteriaIncidentForm UI 2024-06-18 12:56:12 +01:00
Simon Larsen
7b77dd4a53 refactor: Add new migration for SchemaMigrations and update MonitorCriteriaIncidentForm UI
This commit adds a new migration file for the SchemaMigrations table, introducing a new migration named MigrationName1718711669847. This migration is imported in the Index.ts file of the SchemaMigrations directory. Additionally, the MonitorCriteriaIncidentForm component is updated to change the title of the "Show Advanced Fields" button to "Add Remediation Notes for an engineer to help resolve this incident." The button is also given a left margin of -3 pixels to adjust its positioning. These changes improve the database schema management and enhance the user experience in the incident form.
2024-06-18 12:55:52 +01:00
Simon Larsen
51bb54e771 refactor: Add placeholder text for name and email fields in user profile form 2024-06-18 12:51:17 +01:00
Simon Larsen
48b095f548 refactor: Update import statements for TimezoneUtil in multiple files 2024-06-18 12:44:54 +01:00
Simon Larsen
786ec6ce7a refactor: Update import statements for TimezoneUtil in multiple files 2024-06-18 11:35:04 +01:00
Simon Larsen
401fbb58e3 refactor: Update import statements for TimezoneUtil in multiple files 2024-06-18 10:38:45 +01:00
Simon Larsen
5243ae6b8d Merge branch 'master' of github.com:OneUptime/oneuptime 2024-06-18 10:05:03 +01:00
Simon Larsen
a06a0f1d16 refactor: Update import statements for TimezoneUtil in multiple files 2024-06-17 21:01:44 +01:00
Simon Larsen
e0bc906484 Merge pull request #1489 from hg13bs/patch-1
Remove duplicate "Swift" entry
2024-06-17 19:29:01 +01:00
Simon Larsen
139ff2d638 refactor: Add user timezone support to login and user profile
This commit adds support for user timezones in the login and user profile functionality. It updates the LoginUtil and User classes to include methods for setting and retrieving the user's timezone. Additionally, the UserTimezoneInit component in the Dashboard module is updated to display and allow the user to update their timezone. This change improves the user experience by providing accurate timezone information and allows for better handling of time-related functionality throughout the application.
2024-06-17 17:27:34 +01:00
Simon Larsen
7be603ef08 refactor: Update import statements for TimezoneUtil in multiple files 2024-06-17 17:22:00 +01:00
Simon Larsen
d23548f984 refactor: Update error message in OneUptimeDate class
This commit updates the error message in the `asDateForDatabaseQuery` method of the `OneUptimeDate` class. It now includes the `date.toString()` value to provide more information about the invalid date. This change improves error handling and debugging capabilities.
2024-06-17 17:09:17 +01:00
Simon Larsen
3573e59634 refactor: Update getCurrentTimezoneString method in Date.ts
This commit refactors the getCurrentTimezoneString method in the Date.ts file. It replaces the usage of moment.tz.guess() with this.getCurrentTimezone() to improve code readability and maintainability. Additionally, it adds a check to prepend "GMT" to the zone abbreviation if it starts with a "+" or "-" sign. This change ensures consistent formatting of the timezone string returned by the method.
2024-06-17 16:23:49 +01:00
Simon Larsen
c4e4e7e488 refactor: Update import statements for TimezoneUtil in Monitor.ts
This commit updates the import statements in the Monitor.ts file. It changes the import statement for the TimezoneUtil module to import from "Common/Types/Timezone" instead of the previous import path. This change ensures that the correct module is imported, improving the accuracy and reliability of the code.
2024-06-17 16:14:08 +01:00
Simon Larsen
be3e8447ab refactor: Add data-testid attributes to Toast component
This commit adds data-testid attributes to the Toast component in order to improve testability. The "toast" element, "toast-icon" element, "title" element, "description" element, and "close-button" element now have corresponding data-testid attributes. This change allows for more precise targeting of elements in automated tests, enhancing the reliability and accuracy of the test suite.
2024-06-17 16:07:04 +01:00
Simon Larsen
2615e39c19 refactor: Update import statements for TimezoneUtil in multiple files 2024-06-17 15:58:30 +01:00
Simon Larsen
49b6550581 refactor: Update import statements for TimezoneUtil in UserProfile/Index.tsx 2024-06-17 15:57:32 +01:00
Simon Larsen
e870efc3c4 refactor: Remove unused code and update import statements 2024-06-17 15:33:47 +01:00
Simon Larsen
38862adf5a refactor: Remove unused code and update import statements
This commit removes unused code and updates import statements in multiple files. It removes the unused TimezoneCode enum from the Common/Types/TimezoneCode.ts file and updates the import statements in the affected files to import Timezone from Common/Types/Timezone instead of TimezoneCode. These changes improve the accuracy and reliability of the code.
2024-06-17 13:43:09 +01:00
Simon Larsen
06b92e2745 feat: Add subscriber timezones functionality to SubscriberSettings 2024-06-17 13:18:44 +01:00
Simon Larsen
1a8e0682c7 feat: Add subscriber timezones functionality to SubscriberSettings
This commit adds the functionality to select subscriber timezones in the SubscriberSettings component. It introduces a new field, "Subscriber Timezones", which allows subscribers to choose their preferred timezones for receiving notifications. The selected timezones are displayed when subscribers receive notifications. This feature enhances the user experience by providing localized time information.

Refactor import statements for TimezoneUtil in UserProfile/Index.tsx

This commit updates the import statements in the UserProfile/Index.tsx file to import TimezoneUtil from "Common/Types/Timezone" instead of "CommonUI/src/Utils/Timezone". This change ensures that the correct module is imported, improving the accuracy and reliability of the code.

Refactor import statements for TimezoneUtil in UserProfile/Index.tsx

This commit updates the import statements in the UserProfile/Index.tsx file to import TimezoneUtil from "Common/Types/Timezone" instead of "CommonUI/src/Utils/Timezone". This change ensures that the correct module is imported, improving the accuracy and reliability of the code.

Refactor import statements for TimezoneUtil in UserProfile/Index.tsx

This commit updates the import statements in the UserProfile/Index.tsx file to import TimezoneUtil from "Common/Types/Timezone" instead of "CommonUI/src/Utils/Timezone". This change ensures that the correct module is imported, improving the accuracy and reliability of the code.

Refactor import statements for TimezoneUtil in UserProfile/Index.tsx

This commit updates the import statements in the UserProfile/Index.tsx file to import TimezoneUtil from "Common/Types/Timezone" instead of "CommonUI/src/Utils/Timezone". This change ensures that the correct module is imported, improving the accuracy and reliability of the code.

refactor: Update retries value in playwright.config.ts

This commit updates the retries value in the playwright.config.ts file to a fixed value of 3. This change ensures that the tests are retried up to 3 times, improving the reliability of the test suite.

refactor: Update import statements for jest in test files

This commit updates the import statements for jest in multiple test files to use the correct module name "jest" instead of "globals". This change ensures that the jest module is imported correctly, improving the accuracy and reliability of the test setup.

refactor: Update docker-compose command in test.e2e.yaml

This commit updates the docker-compose command in the test.e2e.yaml file to remove the duplicate `e2e` service name. This change improves the clarity and efficiency of the script.

fix: job dependencies

Merge branch 'release' of github.com:OneUptime/oneuptime into release

refactor: Clear user data and remove cookies on authentication error
2024-06-17 11:03:37 +01:00
Simon Larsen
e0189356d5 refactor: Remove TimezoneCode enum and update import statements
This commit removes the TimezoneCode enum from the Common/Types/TimezoneCode.ts file. The enum is no longer needed and can be safely deleted. Additionally, it updates the import statements in the affected files to import Timezone from Common/Types/Timezone instead of TimezoneCode. This change ensures that the correct module is imported and improves the accuracy and reliability of the code.
2024-06-17 10:56:59 +01:00
Simon Larsen
dad07b9f80 refactor: Update import statements for TimezoneUtil in UserProfile/Index.tsx
This commit updates the import statements in the UserProfile/Index.tsx file. It changes the import statement for TimezoneUtil from "CommonUI/src/Utils/Timezone" to "Common/Types/Timezone". This change ensures that the correct module is imported, improving the accuracy and reliability of the code.
2024-06-17 10:47:23 +01:00
Simon Larsen
8d59710306 refactor: Update import statements for TimezoneUtil in UserProfile/Index.tsx
This commit updates the import statements in the UserProfile/Index.tsx file. It changes the import statement for TimezoneUtil from "CommonUI/src/Utils/Timezone" to "Common/Types/Timezone". This change ensures that the correct module is imported, improving the accuracy and reliability of the code.
2024-06-17 10:42:43 +01:00
Simon Larsen
5e9227eb4f refactor: Add TimezoneUtil to UserProfile/Index.tsx
This commit refactors the import statements in the UserProfile/Index.tsx file. It updates the import statement for TimezoneUtil from "CommonUI/src/Utils/Timezone" to "Common/Types/Timezone". This change ensures that the correct module is imported, improving the accuracy and reliability of the code.
2024-06-17 10:41:04 +01:00
snyk-bot
1e63173564 fix: upgrade @babel/runtime from 7.24.5 to 7.24.6
Snyk has created this PR to upgrade @babel/runtime from 7.24.5 to 7.24.6.

See this package in npm:
@babel/runtime

See this project in Snyk:
https://app.snyk.io/org/oneuptime-RsC2nshvQ2Vnr35jHvMnMP/project/47001ef1-7b3a-49c2-88cd-8025c56346d0?utm_source=github&utm_medium=referral&page=upgrade-pr
2024-06-15 06:14:37 +00:00
snyk-bot
76fded39ee fix: upgrade posthog-js from 1.133.0 to 1.135.2
Snyk has created this PR to upgrade posthog-js from 1.133.0 to 1.135.2.

See this package in npm:
posthog-js

See this project in Snyk:
https://app.snyk.io/org/oneuptime-RsC2nshvQ2Vnr35jHvMnMP/project/f6446ec8-d441-487e-b58f-38373430e213?utm_source=github&utm_medium=referral&page=upgrade-pr
2024-06-15 06:12:15 +00:00
hg13
c82f3c1f71 Remove duplicate "Swift" entry 2024-06-15 02:06:24 +03:00
Simon Larsen
24d9219a62 refactor: Update retries value in playwright.config.ts
This commit updates the retries value in the playwright.config.ts file. The previous value was determined based on the environment variable "CI", but it has been changed to a fixed value of 3. This change ensures that the tests are retried up to 3 times, improving the reliability of the test suite.
2024-06-14 19:38:03 +01:00
Simon Larsen
6ed588d7aa refactor: Update import statements for jest in test files
This commit updates the import statements for jest in multiple test files. The previous import statements used "globals" as the module name, which is incorrect. The correct module name is "jest". This change ensures that the jest module is imported correctly, improving the accuracy and reliability of the test setup.
2024-06-14 18:54:53 +01:00
Simon Larsen
17c1862eac ```text
refactor: Update docker-compose command in test.e2e.yaml

This commit updates the docker-compose command in the test.e2e.yaml file. The previous command included the `e2e` service name twice, which is unnecessary. The updated command removes the duplicate service name, improving the clarity and efficiency of the script.
2024-06-14 18:34:11 +01:00
Simon Larsen
37b1846363 fix job dependencies 2024-06-14 18:21:51 +01:00
Simon Larsen
da3e6bc3af Merge branch 'release' of github.com:OneUptime/oneuptime into release 2024-06-14 18:02:55 +01:00
Simon Larsen
a35ea2ba66 refactor: Clear user data and remove cookies on authentication error 2024-06-14 18:02:36 +01:00
Simon Larsen
b2fa2e40f4 refactor: Clear user data and remove cookies on authentication error
This commit clears the user data and removes cookies when an authentication error occurs. This ensures that the user is logged out and any stored data is removed, preventing unauthorized access. The code change is made in the API.ts file.
2024-06-14 18:01:51 +01:00
Simon Larsen
babecb5170 chore: Update axios and posthog-js dependencies
This commit updates the axios and posthog-js dependencies in the package-lock.json file. The axios dependency is updated from version 1.7.1 to 1.7.2, and the posthog-js dependency is updated from version 1.131.4 to 1.133.0. This update ensures that the latest stable versions of these dependencies are used, improving the functionality and security of the application.
2024-06-14 17:35:33 +01:00
Simon Larsen
6e0e643337 refactor: Update import statements for jest in test files
This commit updates the import statements for jest in multiple test files. The previous import statements used "globals" as the module name, which is incorrect. The correct module name is "jest". This change ensures that the jest module is imported correctly, improving the accuracy and reliability of the test setup.
2024-06-14 17:01:06 +01:00
Simon Larsen
2a59faa6b4 refactor: Update import statements for jest in test files
This commit updates the import statements for jest in multiple test files. The previous import statements used "globals" as the module name, which is incorrect. The correct module name is "jest". This change ensures that the jest module is imported correctly, improving the accuracy and reliability of the test setup.
2024-06-14 16:54:53 +01:00
Simon Larsen
9d7d44afda refactor: Update import statements for jest in test files
This commit updates the import statements for jest in multiple test files. The previous import statements used "globals" as the module name, which is incorrect. The correct module name is "jest". This change ensures that the jest module is imported correctly, improving the accuracy and reliability of the test setup.
2024-06-14 16:42:55 +01:00
Simon Larsen
8f1e67da3a refactor: Remove ignore for all JavaScript files in eslint configuration 2024-06-14 15:44:31 +01:00
Simon Larsen
c09f863d58 refactor: Remove unused imports and update eslint configuration 2024-06-14 15:42:45 +01:00
Simon Larsen
3c8c2a3feb refactor: Update import statements for jest in test files
This commit updates the import statements for jest in multiple test files. The previous import statements used "globals" as the module name, which is incorrect. The correct module name is "jest". This change ensures that the jest module is imported correctly, improving the accuracy and reliability of the test setup.
2024-06-14 15:42:33 +01:00
Simon Larsen
4c4169e245 refactor: Update import statements for jest in test files 2024-06-14 14:24:45 +01:00
Simon Larsen
34c5cb1e94 refactor: Update import statements for jest in test files 2024-06-14 14:20:24 +01:00
Simon Larsen
f5fca46e5b refactor: Update import statements for jest in test files
This commit updates the import statements for jest in multiple test files. The previous import statements used "globals" as the module name, which is incorrect. The correct module name is "jest". This change ensures that the jest module is imported correctly, improving the accuracy and reliability of the test setup.
2024-06-14 14:16:56 +01:00
Simon Larsen
48e3c24c6e refactor: Update import statement for jest in setupTest.js
This commit updates the import statement for jest in the setupTest.js file. The previous import statement used "globals" as the module name, which is incorrect. The correct module name is "jest". This change ensures that the jest module is imported correctly, improving the accuracy and reliability of the test setup.
2024-06-14 14:11:32 +01:00
Simon Larsen
e9c94876c0 refactor: Update import statement for jest in setupTest.js
This commit updates the import statement for jest in the setupTest.js file. The previous import statement used "globals" as the module name, which is incorrect. The correct module name is "jest". This change ensures that the jest module is imported correctly, improving the accuracy and reliability of the test setup.
2024-06-14 14:06:41 +01:00
Simon Larsen
fcd6c8ea7d refactor: Remove unused imports and update eslint configuration 2024-06-14 13:50:52 +01:00
Simon Larsen
81726ce7b2 refactor: Update import statement for jest in setupTest.js 2024-06-14 13:40:33 +01:00
Simon Larsen
6349c60bdb refactor: Update import statement for jest in setupTest.js
This commit updates the import statement for jest in the setupTest.js file. The previous import statement used "globals" as the module name, which is incorrect. The correct module name is "jest". This change ensures that the jest module is imported correctly, improving the accuracy and reliability of the test setup.
2024-06-14 13:01:38 +01:00
Simon Larsen
74cf119444 refactor: Remove unused globals.jquery from eslint configuration 2024-06-14 12:36:11 +01:00
snyk-bot
2efb630640 fix: upgrade playwright from 1.44.0 to 1.44.1
Snyk has created this PR to upgrade playwright from 1.44.0 to 1.44.1.

See this package in npm:
playwright

See this project in Snyk:
https://app.snyk.io/org/oneuptime-RsC2nshvQ2Vnr35jHvMnMP/project/49c81d9c-12c2-4e8e-b9e8-72f98b1b595c?utm_source=github&utm_medium=referral&page=upgrade-pr
2024-06-14 05:19:10 +00:00
Simon Larsen
f66241d12f Merge pull request #1473 from OneUptime/master
Release
2024-06-11 18:36:34 +01:00
snyk-bot
070190dd31 fix: upgrade @nivo/line from 0.86.0 to 0.87.0
Snyk has created this PR to upgrade @nivo/line from 0.86.0 to 0.87.0.

See this package in npm:
@nivo/line

See this project in Snyk:
https://app.snyk.io/org/oneuptime-RsC2nshvQ2Vnr35jHvMnMP/project/47001ef1-7b3a-49c2-88cd-8025c56346d0?utm_source=github&utm_medium=referral&page=upgrade-pr
2024-06-03 04:20:30 +00:00
414 changed files with 37701 additions and 4191 deletions

View File

@@ -56,5 +56,4 @@ settings.json
GoSDK/tester/
Llama/Models/*

View File

@@ -1,7 +1,7 @@
---
name: Bug report
about: Create a report to help us improve
title: 'Bug: <Title of the issue>'
title: '<Title of the issue>'
labels: 'bug'
assignees: ''

View File

@@ -1,7 +1,7 @@
---
name: Feature request
about: Suggest an idea for this project
title: 'Enhancement: <Title of the issue>'
title: '<Title of the issue>'
labels: 'enhancement'
assignees: ''

View File

@@ -179,6 +179,21 @@ jobs:
# build image probe api
- name: build docker image
run: sudo docker build -f ./Ingestor/Dockerfile .
docker-build-telemetry-ingestor:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Preinstall
run: npm run prerun
# build image probe api
- name: build docker image
run: sudo docker build -f ./TelemetryIngestor/Dockerfile .
docker-build-status-page:
runs-on: ubuntu-latest

View File

@@ -214,6 +214,20 @@ jobs:
- run: cd Model && npm install
- run: cd CommonServer && npm install
- run: cd Ingestor && npm install && npm run compile && npm run dep-check
compile-telemetry-ingestor:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18.3.0
- run: cd Common && npm install
- run: cd Model && npm install
- run: cd CommonServer && npm install
- run: cd TelemetryIngestor && npm install && npm run compile && npm run dep-check
compile-status-page:

View File

@@ -1,16 +0,0 @@
name: Misc / Dependabot Automerge
on:
pull_request:
jobs:
merge:
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
- uses: actions/checkout@v2
- uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
target: minor
github-token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,31 +0,0 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
env:
BASE_URL: http://localhost
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: Run Server in Docker
run: npm run dev
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: cd Playwright && npm install && npx playwright install && npx playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30

View File

@@ -18,35 +18,12 @@ jobs:
token: ${{secrets.github_token}}
- run: echo "Build number is ${{ steps.buildnumber.outputs.build_number }}"
github-release:
needs: [generate-build-number]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/release'
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- run: echo "${{needs.generate-build-number.outputs.build_number}}"
- name: "Build Changelog"
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v4.2.0
with:
configuration: "./Scripts/Release/ChangelogConfig.json"
- run: echo "Changelog:"
- run: echo "${{steps.build_changelog.outputs.changelog}}"
- uses: ncipollo/release-action@v1
with:
tag: "7.0.${{needs.generate-build-number.outputs.build_number}}"
artifactErrorsFailBuild: true
body: |
${{steps.build_changelog.outputs.changelog}}
helm-chart-deploy:
runs-on: ubuntu-latest
needs: [generate-build-number, github-release]
needs: [generate-build-number]
env:
CI_COMMIT_AUTHOR: Continuous Integration
steps:
@@ -92,7 +69,7 @@ jobs:
git push origin master
nginx-docker-image-deploy:
needs: [generate-build-number, github-release]
needs: [generate-build-number]
runs-on: ubuntu-latest
steps:
- name: Docker Meta
@@ -152,7 +129,7 @@ jobs:
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
e2e-docker-image-deploy:
needs: [generate-build-number, github-release]
needs: [generate-build-number]
runs-on: ubuntu-latest
steps:
- name: Docker Meta
@@ -212,7 +189,7 @@ jobs:
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
isolated-vm-docker-image-deploy:
needs: [generate-build-number, github-release]
needs: [generate-build-number]
runs-on: ubuntu-latest
steps:
- name: Docker Meta
@@ -272,7 +249,7 @@ jobs:
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
test-server-docker-image-deploy:
needs: [generate-build-number, github-release]
needs: [generate-build-number]
runs-on: ubuntu-latest
steps:
- name: Docker Meta
@@ -332,7 +309,7 @@ jobs:
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
otel-collector-docker-image-deploy:
needs: [generate-build-number, github-release]
needs: [generate-build-number]
runs-on: ubuntu-latest
steps:
- name: Docker Meta
@@ -394,7 +371,7 @@ jobs:
status-page-docker-image-deploy:
needs: [generate-build-number, github-release]
needs: [generate-build-number]
runs-on: ubuntu-latest
steps:
- name: Docker Meta
@@ -454,7 +431,7 @@ jobs:
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
test-docker-image-deploy:
needs: [generate-build-number, github-release]
needs: [generate-build-number]
runs-on: ubuntu-latest
steps:
- name: Docker Meta
@@ -514,7 +491,7 @@ jobs:
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
ingestor-docker-image-deploy:
needs: [generate-build-number, github-release]
needs: [generate-build-number]
runs-on: ubuntu-latest
steps:
- name: Docker Meta
@@ -574,7 +551,7 @@ jobs:
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
probe-docker-image-deploy:
needs: [generate-build-number, github-release]
needs: [generate-build-number]
runs-on: ubuntu-latest
steps:
- name: Docker Meta
@@ -635,7 +612,7 @@ jobs:
haraka-docker-image-deploy:
needs: [generate-build-number, github-release]
needs: [generate-build-number]
runs-on: ubuntu-latest
steps:
- name: Docker Meta
@@ -695,7 +672,7 @@ jobs:
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
admin-dashboard-docker-image-deploy:
needs: [generate-build-number, github-release]
needs: [generate-build-number]
runs-on: ubuntu-latest
steps:
- name: Docker Meta
@@ -756,7 +733,7 @@ jobs:
dashboard-docker-image-deploy:
needs: [generate-build-number, github-release]
needs: [generate-build-number]
runs-on: ubuntu-latest
steps:
- name: Docker Meta
@@ -816,7 +793,7 @@ jobs:
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
app-docker-image-deploy:
needs: [generate-build-number, github-release]
needs: [generate-build-number]
runs-on: ubuntu-latest
steps:
- name: Docker Meta
@@ -877,7 +854,7 @@ jobs:
copilot-docker-image-deploy:
needs: [generate-build-number, github-release]
needs: [generate-build-number]
runs-on: ubuntu-latest
steps:
- name: Docker Meta
@@ -937,7 +914,7 @@ jobs:
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
accounts-docker-image-deploy:
needs: [generate-build-number, github-release]
needs: [generate-build-number]
runs-on: ubuntu-latest
steps:
- name: Docker Meta
@@ -999,7 +976,7 @@ jobs:
publish-npm-packages:
runs-on: ubuntu-latest
needs: [generate-build-number, github-release]
needs: [generate-build-number]
env:
CI_PIPELINE_ID: ${{github.run_number}}
NPM_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
@@ -1011,9 +988,225 @@ jobs:
run: npm run prerun
- name: Publish Infrastructure Agent
run: bash ./Scripts/NPM/PublishAllPackages.sh
llm-docker-image-deploy:
needs: generate-build-number
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
# Docker compose needs a lot of space to build images, so we need to free up some space first in the GitHub Actions runner
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Docker Meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
oneuptime/llm
ghcr.io/oneuptime/llm
tags: |
type=raw,value=release,enable=true
type=semver,value=7.0.${{needs.generate-build-number.outputs.build_number}},pattern={{version}},enable=true
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: actions/setup-node@v2
with:
node-version: 18.3.0
# Cannot do this, no space on the runner
# - name: Download the Model from Hugging Face
# run: mkdir -p ./LLM/Models && cd ./LLM/Models && git clone https://${{ secrets.HUGGING_FACE_USERNAME }}:${{ secrets.HUGGING_FACE_PASSWORD }}@huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Generate Dockerfile from Dockerfile.tpl
run: npm run prerun
# Build and deploy nginx.
- name: Login to Docker Hub
uses: docker/login-action@v2.2.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2.2.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
file: ./LLM/Dockerfile
context: ./LLM
# arm64 is not supported by the base image of the LLM
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
GIT_SHA=${{ github.sha }}
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
test-e2e-release-saas:
runs-on: ubuntu-latest
needs: [copilot-docker-image-deploy, accounts-docker-image-deploy, admin-dashboard-docker-image-deploy, app-docker-image-deploy, dashboard-docker-image-deploy, haraka-docker-image-deploy, ingestor-docker-image-deploy, isolated-vm-docker-image-deploy, otel-collector-docker-image-deploy, probe-docker-image-deploy, status-page-docker-image-deploy, test-docker-image-deploy, test-server-docker-image-deploy, publish-npm-packages, e2e-docker-image-deploy, helm-chart-deploy, generate-build-number, nginx-docker-image-deploy]
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
# Docker compose needs a lot of space to build images, so we need to free up some space first in the GitHub Actions runner
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18.3.0
- run: npm run prerun && bash ./Tests/Scripts/enable-billing-env-var.sh
- name: Start Server with release tag
run: npm run start
- name: Wait for server to start
run: bash ./Tests/Scripts/status-check.sh http://localhost
- name: Run E2E Tests. Run docker container e2e in docker compose file
run: export $(grep -v '^#' config.env | xargs) && docker compose -f docker-compose.dev.yml up --exit-code-from e2e --abort-on-container-exit e2e || (docker compose -f docker-compose.dev.yml logs e2e && exit 1)
- name: Upload test results
uses: actions/upload-artifact@v4
# Run this on failure
if: failure()
with:
# Name of the artifact to upload.
# Optional. Default is 'artifact'
name: test-results
# A file, directory or wildcard pattern that describes what to upload
# Required.
path: |
./E2E
# Duration after which artifact will expire in days. 0 means using default retention.
# Minimum 1 day.
# Maximum 90 days unless changed from the repository settings page.
# Optional. Defaults to repository settings.
retention-days: 7
test-e2e-release-self-hosted:
runs-on: ubuntu-latest
# After all the jobs runs
needs: [copilot-docker-image-deploy, accounts-docker-image-deploy, admin-dashboard-docker-image-deploy, app-docker-image-deploy, dashboard-docker-image-deploy, haraka-docker-image-deploy, ingestor-docker-image-deploy, isolated-vm-docker-image-deploy, otel-collector-docker-image-deploy, probe-docker-image-deploy, status-page-docker-image-deploy, test-docker-image-deploy, test-server-docker-image-deploy, publish-npm-packages, e2e-docker-image-deploy, helm-chart-deploy, generate-build-number, nginx-docker-image-deploy]
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
# Docker compose needs a lot of space to build images, so we need to free up some space first in the GitHub Actions runner
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18.3.0
- run: npm run prerun
- name: Start Server with release tag
run: npm run start
- name: Wait for server to start
run: bash ./Tests/Scripts/status-check.sh http://localhost
- name: Run E2E Tests. Run docker container e2e in docker compose file
run: export $(grep -v '^#' config.env | xargs) && docker compose -f docker-compose.dev.yml up --exit-code-from e2e --abort-on-container-exit e2e || (docker compose -f docker-compose.dev.yml logs e2e && exit 1)
- name: Upload test results
uses: actions/upload-artifact@v4
# Run this on failure
if: failure()
with:
# Name of the artifact to upload.
# Optional. Default is 'artifact'
name: test-results
# A file, directory or wildcard pattern that describes what to upload
# Required.
path: |
./E2E
# Duration after which artifact will expire in days. 0 means using default retention.
# Minimum 1 day.
# Maximum 90 days unless changed from the repository settings page.
# Optional. Defaults to repository settings.
retention-days: 7
github-release:
needs: [test-e2e-release-saas, test-e2e-release-self-hosted, generate-build-number]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/release'
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- run: echo "${{needs.generate-build-number.outputs.build_number}}"
- name: "Build Changelog"
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v4.2.0
with:
configuration: "./Scripts/Release/ChangelogConfig.json"
- run: echo "Changelog:"
- run: echo "${{steps.build_changelog.outputs.changelog}}"
- uses: ncipollo/release-action@v1
with:
tag: "7.0.${{needs.generate-build-number.outputs.build_number}}"
artifactErrorsFailBuild: true
body: |
${{steps.build_changelog.outputs.changelog}}
infrastructure-agent-deploy:
needs: [generate-build-number, github-release]
needs: [github-release, generate-build-number]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -1046,106 +1239,3 @@ jobs:
tag_name: 7.0.${{needs.generate-build-number.outputs.build_number}}
test-e2e-release-saas:
runs-on: ubuntu-latest
needs: [copilot-docker-image-deploy, accounts-docker-image-deploy, admin-dashboard-docker-image-deploy, app-docker-image-deploy, dashboard-docker-image-deploy, haraka-docker-image-deploy, ingestor-docker-image-deploy, isolated-vm-docker-image-deploy, otel-collector-docker-image-deploy, probe-docker-image-deploy, status-page-docker-image-deploy, test-docker-image-deploy, test-server-docker-image-deploy, infrastructure-agent-deploy, publish-npm-packages, e2e-docker-image-deploy, helm-chart-deploy, github-release, generate-build-number, nginx-docker-image-deploy]
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
# Docker compose needs a lot of space to build images, so we need to free up some space first in the GitHub Actions runner
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18.3.0
- run: npm run prerun && bash ./Tests/Scripts/enable-billing-env-var.sh
- name: Start Server with release tag
run: npm run start
- name: Wait for server to start
run: bash ./Tests/Scripts/status-check.sh http://localhost
- name: Run E2E Tests. Run docker container e2e in docker compose file
run: export $(grep -v '^#' config.env | xargs) && docker-compose -f docker-compose.dev.yml up --exit-code-from e2e --abort-on-container-exit e2e || (docker-compose -f docker-compose.dev.yml logs e2e && exit 1)
- name: Upload test results
uses: actions/upload-artifact@v4
# Run this on failure
if: failure()
with:
# Name of the artifact to upload.
# Optional. Default is 'artifact'
name: test-results
# A file, directory or wildcard pattern that describes what to upload
# Required.
path: |
./E2E
# Duration after which artifact will expire in days. 0 means using default retention.
# Minimum 1 day.
# Maximum 90 days unless changed from the repository settings page.
# Optional. Defaults to repository settings.
retention-days: 7
test-e2e-release-self-hosted:
runs-on: ubuntu-latest
# After all the jobs runs
needs: [copilot-docker-image-deploy, accounts-docker-image-deploy, admin-dashboard-docker-image-deploy, app-docker-image-deploy, dashboard-docker-image-deploy, haraka-docker-image-deploy, ingestor-docker-image-deploy, isolated-vm-docker-image-deploy, otel-collector-docker-image-deploy, probe-docker-image-deploy, status-page-docker-image-deploy, test-docker-image-deploy, test-server-docker-image-deploy, infrastructure-agent-deploy, publish-npm-packages, e2e-docker-image-deploy, helm-chart-deploy, github-release, generate-build-number, nginx-docker-image-deploy]
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:
# Docker compose needs a lot of space to build images, so we need to free up some space first in the GitHub Actions runner
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18.3.0
- run: npm run prerun
- name: Start Server with release tag
run: npm run start
- name: Wait for server to start
run: bash ./Tests/Scripts/status-check.sh http://localhost
- name: Run E2E Tests. Run docker container e2e in docker compose file
run: export $(grep -v '^#' config.env | xargs) && docker-compose -f docker-compose.dev.yml up --exit-code-from e2e --abort-on-container-exit e2e || (docker-compose -f docker-compose.dev.yml logs e2e && exit 1)
- name: Upload test results
uses: actions/upload-artifact@v4
# Run this on failure
if: failure()
with:
# Name of the artifact to upload.
# Optional. Default is 'artifact'
name: test-results
# A file, directory or wildcard pattern that describes what to upload
# Required.
path: |
./E2E
# Duration after which artifact will expire in days. 0 means using default retention.
# Minimum 1 day.
# Maximum 90 days unless changed from the repository settings page.
# Optional. Defaults to repository settings.
retention-days: 7

View File

@@ -0,0 +1,40 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
name: "OneUptime Reliability Copilot"
on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
# Run every day at midnight UTC
- cron: '0 0 * * *'
jobs:
analyze:
name: Analyze Code
runs-on: ubuntu-latest
env:
CI_PIPELINE_ID: ${{github.run_number}}
permissions:
actions: read
# We will never commit to the main/master branch. We will always create a PR.
contents: write
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Run Reliability Copilot in Doker Container
- name: Run Copilot
run: |
docker run --rm -v $(pwd):/repository -w /repository oneuptime/copilot:test \
-e ONEUPTIME_URL='https://test.oneuptime.com' \
-e ONEUPTIME_REPOSITORY_SECRET_KEY=${{ secrets.COPILOT_ONEUPTIME_REPOSITORY_SECRET_KEY }} \
-e GITHUB_TOKEN=${{ github.token }} \
-e GITHUB_USERNAME='simlarsen' \
-e ONEUPTIME_LLAMA_SERVER_URL='http://57.128.112.160:8547'

View File

@@ -6,6 +6,7 @@ on:
- "master"
jobs:
generate-build-number:
runs-on: ubuntu-latest
outputs:
@@ -18,6 +19,89 @@ jobs:
token: ${{secrets.github_token}}
- run: echo "Build number is ${{ steps.buildnumber.outputs.build_number }}"
llm-docker-image-deploy:
needs: generate-build-number
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
# Docker compose needs a lot of space to build images, so we need to free up some space first in the GitHub Actions runner
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Docker Meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
oneuptime/llm
ghcr.io/oneuptime/llm
tags: |
type=raw,value=test,enable=true
type=semver,value=7.0.${{needs.generate-build-number.outputs.build_number}}-test,pattern={{version}},enable=true
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: actions/setup-node@v2
with:
node-version: 18.3.0
# Cannot do this, no space on the runner
# - name: Download the Model from Hugging Face
# run: mkdir -p ./LLM/Models && cd ./LLM/Models && git clone https://${{ secrets.HUGGING_FACE_USERNAME }}:${{ secrets.HUGGING_FACE_PASSWORD }}@huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Generate Dockerfile from Dockerfile.tpl
run: npm run prerun
# Build and deploy nginx.
- name: Login to Docker Hub
uses: docker/login-action@v2.2.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2.2.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
file: ./LLM/Dockerfile
context: ./LLM
# arm64 is not supported by the base image of the LLM
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
GIT_SHA=${{ github.sha }}
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
nginx-docker-image-deploy:
needs: generate-build-number
@@ -941,7 +1025,7 @@ jobs:
test-helm-chart:
runs-on: ubuntu-latest
needs: [copilot-docker-image-deploy, isolated-vm-docker-image-deploy, test-server-docker-image-deploy, test-docker-image-deploy, ingestor-docker-image-deploy, probe-docker-image-deploy, haraka-docker-image-deploy, dashboard-docker-image-deploy, admin-dashboard-docker-image-deploy, app-docker-image-deploy, accounts-docker-image-deploy, otel-collector-docker-image-deploy, status-page-docker-image-deploy, nginx-docker-image-deploy, e2e-docker-image-deploy]
needs: [llm-docker-image-deploy, copilot-docker-image-deploy, isolated-vm-docker-image-deploy, test-server-docker-image-deploy, test-docker-image-deploy, ingestor-docker-image-deploy, probe-docker-image-deploy, haraka-docker-image-deploy, dashboard-docker-image-deploy, admin-dashboard-docker-image-deploy, app-docker-image-deploy, accounts-docker-image-deploy, otel-collector-docker-image-deploy, status-page-docker-image-deploy, nginx-docker-image-deploy, e2e-docker-image-deploy]
env:
CI_PIPELINE_ID: ${{github.run_number}}
steps:

View File

@@ -32,12 +32,10 @@ jobs:
node-version: 18.3.0
- run: npm run prerun && bash ./Tests/Scripts/enable-billing-env-var.sh
- run: npm run dev
- name: Sleep for 2 minutes to wait for server to start
run: sleep 120
- name: Wait for server to start
run: bash ./Tests/Scripts/status-check.sh http://localhost
- name: Run E2E Tests. Run docker container e2e in docker compose file
run: export $(grep -v '^#' config.env | xargs) && docker-compose -f docker-compose.dev.yml up --exit-code-from e2e --abort-on-container-exit e2e || (docker-compose -f docker-compose.dev.yml logs e2e && exit 1)
run: export $(grep -v '^#' config.env | xargs) && docker compose -f docker-compose.dev.yml up --exit-code-from e2e --abort-on-container-exit e2e || (docker compose -f docker-compose.dev.yml logs e2e && exit 1)
- name: Upload test results
uses: actions/upload-artifact@v4
# Run this on failure

5
.gitignore vendored
View File

@@ -93,10 +93,9 @@ Haraka/dkim/keys/public_base64.txt
HelmChart/Values/*.values.yaml
Llama/Models/tokenizer*
Llama/Models/llama*
LLM/__pycache__/*
Llama/__pycache__/*
LLM/Models/*
Examples/otel-dotnet/obj/*

View File

@@ -1,5 +1,6 @@
import ForgotPasswordPage from "./Pages/ForgotPassword";
import LoginPage from "./Pages/Login";
import LoginWithSSO from "./Pages/LoginWithSSO";
import NotFound from "./Pages/NotFound";
import RegisterPage from "./Pages/Register";
import ResetPasswordPage from "./Pages/ResetPassword";
@@ -24,6 +25,8 @@ function App(): ReactElement {
<Routes>
<Route path="/accounts" element={<LoginPage />} />
<Route path="/accounts/login" element={<LoginPage />} />
<Route path="/accounts/sso" element={<LoginWithSSO />} />
<Route
path="/accounts/forgot-password"
element={<ForgotPasswordPage />}

View File

@@ -2,7 +2,6 @@ import { LOGIN_API_URL } from "../Utils/ApiPaths";
import Route from "Common/Types/API/Route";
import URL from "Common/Types/API/URL";
import { JSONObject } from "Common/Types/JSON";
import Alert, { AlertType } from "CommonUI/src/Components/Alerts/Alert";
import ModelForm, { FormType } from "CommonUI/src/Components/Forms/ModelForm";
import FormFieldSchemaType from "CommonUI/src/Components/Forms/Types/FormFieldSchemaType";
import Link from "CommonUI/src/Components/Link/Link";
@@ -13,7 +12,7 @@ import LoginUtil from "CommonUI/src/Utils/Login";
import Navigation from "CommonUI/src/Utils/Navigation";
import UserUtil from "CommonUI/src/Utils/User";
import User from "Model/Models/User";
import React, { useState } from "react";
import React from "react";
import useAsyncEffect from "use-async-effect";
const LoginPage: () => JSX.Element = () => {
@@ -23,12 +22,6 @@ const LoginPage: () => JSX.Element = () => {
Navigation.navigate(DASHBOARD_URL);
}
const showSsoMessage: boolean = Boolean(
Navigation.getQueryStringByName("sso"),
);
const [showSsoTip, setShowSSOTip] = useState<boolean>(false);
const [initialValues, setInitialValues] = React.useState<JSONObject>({});
useAsyncEffect(async () => {
@@ -56,16 +49,6 @@ const LoginPage: () => JSX.Element = () => {
</p>
</div>
{showSsoMessage && (
<div className="sm:mx-auto sm:w-full sm:max-w-md mt-8">
{" "}
<Alert
type={AlertType.DANGER}
title="You must be logged into OneUptime account to use single sign-on (SSO) for your project. Logging in to OneUptime account and single sign on (SSO) for your project are two separate steps. Please use the form below to log in to your OneUptime account before you use SSO."
/>{" "}
</div>
)}
<div className="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
<div className="bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10">
<ModelForm<User>
@@ -120,23 +103,11 @@ const LoginPage: () => JSX.Element = () => {
footer={
<div className="actions text-center mt-4 hover:underline fw-semibold">
<div>
{!showSsoTip && (
<div
onClick={() => {
setShowSSOTip(true);
}}
className="text-indigo-500 hover:text-indigo-900 cursor-pointer text-sm"
>
<Link to={new Route("/accounts/sso")}>
<div className="text-indigo-500 hover:text-indigo-900 cursor-pointer text-sm">
Use single sign-on (SSO) instead
</div>
)}
{showSsoTip && (
<div className="text-gray-500 text-sm">
Please sign in with your SSO provider like Okta, Auth0,
Entra ID or any other SAML 2.0 provider.
</div>
)}
</Link>
</div>
</div>
}

View File

@@ -0,0 +1,235 @@
import { SERVICE_PROVIDER_LOGIN_URL } from "../Utils/ApiPaths";
import Route from "Common/Types/API/Route";
import URL from "Common/Types/API/URL";
import { JSONArray, JSONObject } from "Common/Types/JSON";
import FormFieldSchemaType from "CommonUI/src/Components/Forms/Types/FormFieldSchemaType";
import Link from "CommonUI/src/Components/Link/Link";
import { DASHBOARD_URL, IDENTITY_URL } from "CommonUI/src/Config";
import OneUptimeLogo from "CommonUI/src/Images/logos/OneUptimeSVG/3-transparent.svg";
import Navigation from "CommonUI/src/Utils/Navigation";
import UserUtil from "CommonUI/src/Utils/User";
import User from "Model/Models/User";
import React, { ReactElement, useState } from "react";
import ProjectSSO from "Model/Models/ProjectSso";
import PageLoader from "CommonUI/src/Components/Loader/PageLoader";
import API from "CommonUI/src/Utils/API/API";
import BasicForm from "CommonUI/src/Components/Forms/BasicForm";
import Email from "Common/Types/Email";
import HTTPErrorResponse from "Common/Types/API/HTTPErrorResponse";
import HTTPResponse from "Common/Types/API/HTTPResponse";
import StaticModelList from "CommonUI/src/Components/ModelList/StaticModelList";
const LoginPage: () => JSX.Element = () => {
const apiUrl: URL = SERVICE_PROVIDER_LOGIN_URL;
if (UserUtil.isLoggedIn()) {
Navigation.navigate(DASHBOARD_URL);
}
const [error, setError] = useState<string | undefined>(undefined);
const [isLoading, setIsLoading] = useState<boolean>(false);
const [projectSsoConfigList, setProjectSsoConfigList] = useState<
Array<ProjectSSO>
>([]);
type FetchSSOConfigsFunction = (email: Email) => Promise<void>;
const fetchSsoConfigs: FetchSSOConfigsFunction = async (
email: Email,
): Promise<void> => {
if (email) {
setIsLoading(true);
try {
// get sso config by email.
const listResult: HTTPErrorResponse | HTTPResponse<JSONArray> =
await API.get(
URL.fromString(apiUrl.toString()).addQueryParam(
"email",
email.toString(),
),
);
if (listResult instanceof HTTPErrorResponse) {
throw listResult;
}
if (!listResult.data || (listResult.data as JSONArray).length === 0) {
setError(
"No SSO configuration found for the email: " + email.toString(),
);
} else {
setProjectSsoConfigList(
ProjectSSO.fromJSONArray(listResult["data"], ProjectSSO),
);
}
} catch (error) {
setError(API.getFriendlyErrorMessage(error as Error));
}
} else {
setError("Email is required to perform this action");
}
setIsLoading(false);
};
type GetSsoConfigModelListFunction = (
configs: Array<ProjectSSO>,
) => ReactElement;
const getSsoConfigModelList: GetSsoConfigModelListFunction = (
configs: Array<ProjectSSO>,
): ReactElement => {
return (
<StaticModelList<ProjectSSO>
list={configs}
titleField="name"
selectedItems={[]}
descriptionField="description"
onClick={(item: ProjectSSO) => {
setIsLoading(true);
Navigation.navigate(
URL.fromURL(IDENTITY_URL).addRoute(
new Route(
`/sso/${item.projectId?.toString()}/${item.id?.toString()}`,
),
),
);
}}
/>
);
};
if (isLoading) {
return <PageLoader isVisible={true} />;
}
type GetProjectNameFunction = (projectId: string) => string;
const getProjectName: GetProjectNameFunction = (
projectId: string,
): string => {
const projectNames: Array<string | undefined> = projectSsoConfigList
.filter((config: ProjectSSO) => {
return config.projectId?.toString() === projectId.toString();
})
.map((config: ProjectSSO) => {
return config.project?.name;
});
return projectNames[0] || "Project";
};
if (projectSsoConfigList.length > 0 && !error && !isLoading) {
const projectIds: Array<string> = projectSsoConfigList.map(
(config: ProjectSSO) => {
return config.projectId?.toString() as string;
},
);
return (
<div className="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
<div className="flex min-h-full flex-col justify-center py-12 sm:px-6 lg:px-8">
<div className="">
<img
className="mx-auto h-12 w-auto"
src={OneUptimeLogo}
alt="OneUptime"
/>
<h2 className="mt-10 text-center text-xl tracking-tight text-gray-900">
Select Project
</h2>
<p className="mt-2 text-center text-sm text-gray-600">
Select the project you want to login to.
</p>
</div>
{projectIds.map((projectId: string) => {
return (
<div key={projectId}>
<h3 className="mt-6 font-medium tracking-tight">
{getProjectName(projectId)}
</h3>
{getSsoConfigModelList(
projectSsoConfigList.filter((config: ProjectSSO) => {
return (
config.projectId?.toString() === projectId.toString()
);
}),
)}
</div>
);
})}
</div>
</div>
);
}
return (
<div className="flex min-h-full flex-col justify-center py-12 sm:px-6 lg:px-8">
<div className="">
<img
className="mx-auto h-12 w-auto"
src={OneUptimeLogo}
alt="OneUptime"
/>
<h2 className="mt-6 text-center text-2xl tracking-tight text-gray-900">
Login with SSO
</h2>
<p className="mt-2 text-center text-sm text-gray-600">
Login with your SSO provider to access your account.
</p>
</div>
<div className="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
<div className="bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10">
<BasicForm
modelType={User}
id="login-form"
error={error}
name="Login"
fields={[
{
field: {
email: true,
},
fieldType: FormFieldSchemaType.Email,
placeholder: "jeff@example.com",
required: true,
title: "Email",
dataTestId: "email",
},
]}
maxPrimaryButtonWidth={true}
submitButtonText="Login with SSO"
onSubmit={async (data: JSONObject) => {
await fetchSsoConfigs(data["email"] as Email);
}}
footer={
<div className="actions text-center mt-4 hover:underline fw-semibold">
<div>
<Link to={new Route("/accounts/login")}>
<div className="text-indigo-500 hover:text-indigo-900 cursor-pointer text-sm">
Use username and password insead.
</div>
</Link>
</div>
</div>
}
/>
</div>
<div className="mt-10 text-center">
<div className="text-muted mb-0 text-gray-500">
Don&apos;t have an account?{" "}
<Link
to={new Route("/accounts/register")}
className="text-indigo-500 hover:text-indigo-900 cursor-pointer"
>
Register.
</Link>
</div>
</div>
</div>
</div>
);
};
export default LoginPage;

View File

@@ -9,6 +9,10 @@ export const LOGIN_API_URL: URL = URL.fromURL(IDENTITY_URL).addRoute(
new Route("/login"),
);
export const SERVICE_PROVIDER_LOGIN_URL: URL = URL.fromURL(
IDENTITY_URL,
).addRoute(new Route("/service-provider-login"));
export const FORGOT_PASSWORD_API_URL: URL = URL.fromURL(IDENTITY_URL).addRoute(
new Route("/forgot-password"),
);

File diff suppressed because it is too large Load Diff

View File

@@ -16,6 +16,7 @@
applyStylesTo("h3", "mb-5 scroll-mt-24 mt-10 font-bold text-base")
applyStylesTo("p", "mb-5")
applyStylesTo("link", "text-emerald-500 hover:text-emerald-600")
applyStylesTo("model-inline-code", "rounded p-0.5 px-1 text-sm text-gray-50 bg-gray-600 border-2 border-gray-600 shadow")
applyStylesTo("inline-code", "rounded p-0.5 px-1 text-sm text-gray-500 bg-gray-100 border-2 border-gray-200")
}

View File

@@ -3,6 +3,7 @@ import BaseAnalyticsAPI from "CommonServer/API/BaseAnalyticsAPI";
import BillingInvoiceAPI from "CommonServer/API/BillingInvoiceAPI";
import BillingPaymentMethodAPI from "CommonServer/API/BillingPaymentMethodAPI";
import CodeRepositoryAPI from "CommonServer/API/CodeRepositoryAPI";
import CopilotActionAPI from "CommonServer/API/CopilotActionAPI";
import FileAPI from "CommonServer/API/FileAPI";
import GlobalConfigAPI from "CommonServer/API/GlobalConfigAPI";
import MonitorGroupAPI from "CommonServer/API/MonitorGroupAPI";
@@ -30,9 +31,6 @@ import ApiKeyService, {
import CallLogService, {
Service as CallLogServiceType,
} from "CommonServer/Services/CallLogService";
import CopilotEventService, {
Service as CopilotEventServiceType,
} from "CommonServer/Services/CopilotEventService";
import DomainService, {
Service as DomainServiceType,
} from "CommonServer/Services/DomainService";
@@ -288,6 +286,15 @@ import WorkflowService, {
import WorkflowVariableService, {
Service as WorkflowVariableServiceType,
} from "CommonServer/Services/WorkflowVariableService";
import ProbeOwnerTeamService, {
Service as ProbeOwnerTeamServiceType,
} from "CommonServer/Services/ProbeOwnerTeamService";
import ProbeOwnerUserService, {
Service as ProbeOwnerUserServiceType,
} from "CommonServer/Services/ProbeOwnerUserService";
import FeatureSet from "CommonServer/Types/FeatureSet";
import Express, { ExpressApplication } from "CommonServer/Utils/Express";
import Log from "Model/AnalyticsModels/Log";
@@ -297,7 +304,6 @@ import Span from "Model/AnalyticsModels/Span";
import ApiKey from "Model/Models/ApiKey";
import ApiKeyPermission from "Model/Models/ApiKeyPermission";
import CallLog from "Model/Models/CallLog";
import CopilotEvent from "Model/Models/CopilotEvent";
import Domain from "Model/Models/Domain";
import EmailLog from "Model/Models/EmailLog";
import EmailVerificationToken from "Model/Models/EmailVerificationToken";
@@ -380,6 +386,8 @@ import UserOnCallLog from "Model/Models/UserOnCallLog";
import Workflow from "Model/Models/Workflow";
import WorkflowLog from "Model/Models/WorkflowLog";
import WorkflowVariable from "Model/Models/WorkflowVariable";
import ProbeOwnerTeam from "Model/Models/ProbeOwnerTeam";
import ProbeOwnerUser from "Model/Models/ProbeOwnerUser";
const BaseAPIFeatureSet: FeatureSet = {
init: async (): Promise<void> => {
@@ -387,12 +395,6 @@ const BaseAPIFeatureSet: FeatureSet = {
const APP_NAME: string = "api";
//attach api's
app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<User, UserServiceType>(User, UserService).getRouter(),
);
app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAnalyticsAPI<Log, LogServiceType>(Log, LogService).getRouter(),
@@ -457,6 +459,22 @@ const BaseAPIFeatureSet: FeatureSet = {
).getRouter(),
);
app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<ProbeOwnerUser, ProbeOwnerUserServiceType>(
ProbeOwnerUser,
ProbeOwnerUserService,
).getRouter(),
);
app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<ProbeOwnerTeam, ProbeOwnerTeamServiceType>(
ProbeOwnerTeam,
ProbeOwnerTeamService,
).getRouter(),
);
app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<MonitorSecret, MonitorSecretServiceType>(
@@ -510,14 +528,6 @@ const BaseAPIFeatureSet: FeatureSet = {
).getRouter(),
);
app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<CopilotEvent, CopilotEventServiceType>(
CopilotEvent,
CopilotEventService,
).getRouter(),
);
app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<ServiceCatalogOwnerUser, ServiceCatalogOwnerUserServiceType>(
@@ -1029,6 +1039,11 @@ const BaseAPIFeatureSet: FeatureSet = {
new CodeRepositoryAPI().getRouter(),
);
app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new CopilotActionAPI().getRouter(),
);
app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new UserNotificationLogTimelineAPI().getRouter(),
@@ -1211,6 +1226,12 @@ const BaseAPIFeatureSet: FeatureSet = {
);
app.use(`/${APP_NAME.toLocaleLowerCase()}`, NotificationAPI);
//attach api's
app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<User, UserServiceType>(User, UserService).getRouter(),
);
},
};

View File

@@ -56,6 +56,37 @@ If you don't like to use npm or do not have it installed, run this instead:
sudo bash -c "(export $(grep -v '^#' config.env | xargs) && docker compose up --remove-orphans -d)"
```
### Accessing OneUptime
OneUptime should run at: http://localhost. You need to register a new account for your instance to start using it.
### Setting up TLS/SSL Certificates
OneUptime **does not** support setting up SSL/TLS certificates. You need to set up SSL/TLS certificates on your own.
If you need to use SSL/TLS certificates, follow these steps:
1. Use a reverse proxy like Nginx or Caddy.
2. Use Let's Encrypt to provision the certificates.
3. Point the reverse proxy to the OneUptime server.
4. Update the following settings:
- Set `HTTP_PROTOCOL` env var to `https`.
- Change `HOST` env var to the domain name of the server where the reverse proxy is hosted.
## Production Readiness Checklist
Ideally do not deploy OneUptime in production with docker-compose. We highly recommend using Kubernetes. There's a helm chart available for OneUptime [here](https://artifacthub.io/packages/helm/oneuptime/oneuptime).
If you still want to deploy OneUptime in production with docker-compose, please consider the following:
- **SSL/TLS**: Set up SSL/TLS certificates. OneUptime does not support setting up SSL/TLS certificates. You need to set up SSL/TLS certificates on your own. Please see above.
- **Secrets**: Make sure you have random secrets in your `config.env` file. There are some default secrets in that file. Please replace them with random long strings.
- **Backups**: Regularly backup your databases (Clickhouse, Postgres). Redis is used as a cache and is stateless and can be safely ignored.
- **Updates**: Please regularly update OneUptime. We release updates every day. We recommend you to update the software aleast once a week if you're running in production.
### Updating OneUptime
To update:
```
@@ -64,9 +95,6 @@ git pull
npm run update
```
### Things to consider
- In our Docker setup, we employ a local logging driver. OneUptime, particularly within the probe and ingestor containers, generates a substantial amount of logs. To prevent your storage from becoming full, it's crucial to limit the logging storage in Docker. For detailed instructions on how to do this, please refer to the official Docker documentation [here](https://docs.docker.com/config/containers/logging/local/).
OneUptime should run at: http://localhost. You need to register a new account for your instance to start using it. If you would like to use https, please use a reverse proxy like Nginx.
- In our Docker setup, we employ a local logging driver. OneUptime, particularly within the probe and ingestor containers, generates a substantial amount of logs. To prevent your storage from becoming full, it's crucial to limit the logging storage in Docker. For detailed instructions on how to do this, please refer to the official Docker documentation [here](https://docs.docker.com/config/containers/logging/local/).

View File

@@ -43,7 +43,7 @@ Measure and optimize the performance of your online apps and services. Track key
Detect and diagnose errors in your online services. Get detailed error reports with stack traces, context, and user feedback. Replace tools like Sentry.
##### Reliability Autopilot
##### Reliability Copilot
Scan your code and fix performance issues and errors automatically. Get recommendations for improving the reliability of your online services.

View File

@@ -11,7 +11,6 @@ To run a probe, please make sure you have docker installed. You can run custom p
```
docker run --name oneuptime-probe --network host -e PROBE_KEY=<probe-key> -e PROBE_ID=<probe-id> -e ONEUPTIME_URL=https://oneuptime.com -d oneuptime/probe:release
```
If you are self hosting OneUptime, you can change `INGESTOR_URL` to your custom self hosted instance.

View File

@@ -29,7 +29,6 @@ We use OpenTelemetry to collect application logs. OneUptime currently supports l
- [JavaScript / Typescript / NodeJS / Browser](https://opentelemetry.io/docs/instrumentation/js/)
- [Python](https://opentelemetry.io/docs/instrumentation/python/)
- [Ruby](https://opentelemetry.io/docs/instrumentation/ruby/)
- [Swift](https://opentelemetry.io/docs/instrumentation/swift/)
- [PHP](https://opentelemetry.io/docs/instrumentation/php/)
- [Erlang](https://opentelemetry.io/docs/instrumentation/erlang/)
- [Rust](https://opentelemetry.io/docs/instrumentation/rust/)

View File

@@ -8,8 +8,20 @@ usage() {
exit 1
}
# if there's no $HOME env var then set it to /usr
if [ -z "$HOME" ]; then
HOME=/usr
fi
# Default parameters
BINDIR=/usr/bin
BINDIR=$HOME/bin
# Make sure bindir exists
if [ ! -d "$BINDIR" ]; then
mkdir -p "$BINDIR"
fi
DEBUG=0
# Parse command-line options
@@ -41,6 +53,9 @@ case $ARCH in
aarch64)
ARCH=arm64
;;
*arm64*)
ARCH=arm64
;;
*arm*)
ARCH=arm
;;
@@ -65,8 +80,32 @@ echo "Fetching the latest release: $TAG"
# Construct the URL for the binary release
URL="https://github.com/${REPO}/releases/download/${TAG}/oneuptime-infrastructure-agent_${OS}_${ARCH}.tar.gz"
# Check if wget is installed otherwise install it, do it for all os'es
if ! command -v wget > /dev/null; then
if [ "$OS" = "darwin" ]; then
brew install wget
fi
if [ "$OS" = "linux" ]; then
apt-get install wget
fi
if [ "$OS" = "freebsd" ]; then
pkg install wget
fi
if [ "$OS" = "openbsd" ]; then
pkg_add wget
fi
fi
# Download and extract the binary
curl -sL "${URL}" | tar xz -C "${BINDIR}"
wget "${URL}"
# if darwin
tar -xvzf "oneuptime-infrastructure-agent_${OS}_${ARCH}.tar.gz" -C "${BINDIR}"
# delete the downlaoded file
rm "oneuptime-infrastructure-agent_${OS}_${ARCH}.tar.gz"
# Check if the binary is executable
if [ ! -x "${BINDIR}/oneuptime-infrastructure-agent" ]; then
@@ -74,4 +113,49 @@ if [ ! -x "${BINDIR}/oneuptime-infrastructure-agent" ]; then
exit 1
fi
echo "oneuptime-infrastructure-agent installed successfully to ${BINDIR}. Please configure the agent using 'oneuptime-infrastructure-agent configure'."
# Now add binary to path
if [ -f "$HOME/.bashrc" ]; then
echo "export PATH=$PATH:$BINDIR" >> $HOME/.bashrc
source $HOME/.bashrc
fi
if [ -f "$HOME/.bash_profile" ]; then
echo "export PATH=$PATH:$BINDIR" >> $HOME/.bash_profile
source $HOME/.bash_profile
fi
if [ -f "$HOME/.zshrc" ]; then
echo "export PATH=$PATH:$BINDIR" >> $HOME/.zshrc
source $HOME/.zshrc
fi
if [ -f "$HOME/.profile" ]; then
echo "export PATH=$PATH:$BINDIR" >> $HOME/.profile
source $HOME/.profile
fi
if [ -f "$HOME/.bash_login" ]; then
echo "export PATH=$PATH:$BINDIR" >> $HOME/.bash_login
source $HOME/.bash_login
fi
if [ -f "$HOME/.bash_logout" ]; then
echo "export PATH=$PATH:$BINDIR" >> $HOME/.bash_logout
source $HOME/.bash_logout
fi
if [ -f "$HOME/.bash_aliases" ]; then
echo "export PATH=$PATH:$BINDIR" >> $HOME/.bash_aliases
source $HOME/.bash_aliases
fi
if [ -f "$HOME/.bashrc" ]; then
echo "export PATH=$PATH:$BINDIR" >> $HOME/.bashrc
source $HOME/.bashrc
fi
echo "oneuptime-infrastructure-agent has been installed to ${BINDIR}"
echo "oneuptime-infrastructure-agent installed successfully to ${BINDIR}. Please configure the agent using 'oneuptime-infrastructure-agent configure'."
echo "Please reload your shell or open a new shell session to use the oneuptime-infrastructure-agent command."

View File

@@ -58,7 +58,7 @@ const HomeFeatureSet: FeatureSet = {
{
name: "Public Status Page",
plans: {
free: "Unlimited",
free: "1",
growth: "Unlimited",
scale: "Unlimited",
enterprise: "Unlimited",
@@ -67,7 +67,7 @@ const HomeFeatureSet: FeatureSet = {
{
name: "Subscribers",
plans: {
free: "Unlimited",
free: "100",
growth: "Unlimited",
scale: "Unlimited",
enterprise: "Unlimited",
@@ -209,6 +209,15 @@ const HomeFeatureSet: FeatureSet = {
enterprise: true,
},
},
{
name: "Synthetic Monitoring (with Playwright)",
plans: {
free: true,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "IPv4 Monitoring",
@@ -219,6 +228,7 @@ const HomeFeatureSet: FeatureSet = {
enterprise: true,
},
},
{
name: "IPv6 Monitoring",
plans: {
@@ -247,17 +257,16 @@ const HomeFeatureSet: FeatureSet = {
},
},
{
name: "Container Monitoring",
name: "Network Monitoring",
plans: {
free: "Coming Soon",
growth: "Coming Soon",
scale: "Coming Soon",
enterprise: "Coming Soon",
free: true,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Network Monitoring",
name: "Container Monitoring",
plans: {
free: "Coming Soon",
growth: "Coming Soon",
@@ -383,13 +392,330 @@ const HomeFeatureSet: FeatureSet = {
},
],
},
{
name: "Logs Management",
data: [
{
name: "Ingest with OpenTelemetry",
plans: {
free: true,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Ingest with Fluentd",
plans: {
free: true,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Ingest +1000 Sources",
plans: {
free: true,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Application Logs",
plans: {
free: true,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Container Logs",
plans: {
free: true,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Data Rentention",
plans: {
free: "15 days",
growth: "Custom",
scale: "Custom",
enterprise: "Custom",
},
},
{
name: "Workflows",
plans: {
free: false,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Advanced Team Permissions",
plans: {
free: false,
growth: true,
scale: true,
enterprise: true,
},
},
],
},
{
name: "Telemetry / APM",
data: [
{
name: "Metrics",
plans: {
free: true,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Traces",
plans: {
free: true,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Error Tracking",
plans: {
free: true,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Ingest Pricing",
plans: {
free: "$0.10/GB",
growth: "$0.10/GB",
scale: "$0.10/GB",
enterprise: "$0.10/GB",
},
},
{
name: "Data Rentention",
plans: {
free: "15 days",
growth: "Custom",
scale: "Custom",
enterprise: "Custom",
},
},
{
name: "Workflows",
plans: {
free: false,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Advanced Team Permissions",
plans: {
free: false,
growth: true,
scale: true,
enterprise: true,
},
},
],
},
{
name: "Error Tracking",
data: [
{
name: "Track Errors and Exceptions",
plans: {
free: true,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Cross Microservice Issues",
plans: {
free: true,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Distributed Tracing",
plans: {
free: true,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Stack Traces",
plans: {
free: true,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Version Management",
plans: {
free: true,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Data Rentention",
plans: {
free: "15 days",
growth: "Custom",
scale: "Custom",
enterprise: "Custom",
},
},
{
name: "Workflows",
plans: {
free: false,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Advanced Team Permissions",
plans: {
free: false,
growth: true,
scale: true,
enterprise: true,
},
},
],
},
{
name: "Reliability Copilot",
data: [
{
name: "Scan your Codebase",
plans: {
free: false,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Fix Errors Automatically",
plans: {
free: false,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Fix Performance Issues",
plans: {
free: false,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Fix DB Queries Automatically",
plans: {
free: false,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Fix Frontend Issues",
plans: {
free: false,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Integrate with GitHub, GitLab",
plans: {
free: false,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Integrate with CI/CD",
plans: {
free: false,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Integrate with Issue Tracker",
plans: {
free: false,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Integrates with Slack / Team",
plans: {
free: false,
growth: true,
scale: true,
enterprise: true,
},
},
{
name: "Advanced Workflows",
plans: {
free: false,
growth: true,
scale: true,
enterprise: true,
},
},
],
},
{
name: "Support and More",
data: [
{
name: "Support",
plans: {
free: "Community Support",
free: "Email Support",
growth: "Email Support",
scale: "Email and Chat Support",
enterprise: "Email, Chat, Phone Support",
@@ -398,7 +724,7 @@ const HomeFeatureSet: FeatureSet = {
{
name: "Support SLA",
plans: {
free: false,
free: "5 business day",
growth: "1 business day",
scale: "6 hours",
enterprise: "1 hour priority",
@@ -407,7 +733,7 @@ const HomeFeatureSet: FeatureSet = {
{
name: "Service SLA",
plans: {
free: false,
free: "99.00%",
growth: "99.90%",
scale: "99.95%",
enterprise: "99.99%",

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg" width="302" height="135" viewBox="0 0 302 135" fill="none">
<path fill-rule="evenodd" clip-rule="evenodd" d="M225.829 109.243C225.862 105.573 225.426 101.97 223.866 98.6024C221.081 92.5075 215.51 91.2447 211.014 92.8274C208.028 93.8713 206.149 96.1779 204.84 98.9559C202.894 103.098 202.508 107.509 202.894 112.021C203.179 115.203 203.967 118.234 205.662 120.961C206.954 123.032 208.682 124.649 211.031 125.44C216.232 127.208 221.366 124.901 223.782 119.716C225.325 116.399 225.795 112.863 225.795 109.243M202.004 127.932C202.004 129.178 202.021 131.164 202.004 132.41C201.971 133.825 201.619 134.195 200.31 134.212C198.364 134.246 196.417 134.246 194.471 134.212C193.246 134.195 192.961 133.892 192.844 132.68C192.81 132.242 192.827 131.804 192.827 131.367V67.0336C192.827 64.2219 192.861 64.1882 195.595 64.1882C197.323 64.1882 199.052 64.1714 200.78 64.1882C202.474 64.2219 202.726 64.4576 202.726 66.2086C202.726 73.2295 202.726 80.2504 202.726 87.2713V89.056C203.951 88.0121 204.89 87.0524 205.981 86.2948C211.886 82.1698 218.883 82.4392 224.352 85.2677C228.882 87.6922 232.355 92.1876 234.067 97.4238C236.801 105.825 236.768 114.26 233.312 122.477C230.828 128.386 226.701 132.73 220.359 134.313C213.615 135.997 207.608 134.582 202.894 129.127C202.407 128.555 202.155 127.831 202.004 127.915" fill="#a5b4fc"></path>
<path fill-rule="evenodd" clip-rule="evenodd" d="M151.135 109.344C151.252 112.964 151.47 116.601 153.014 119.985C154.071 122.275 155.564 124.211 157.98 125.103C161.084 126.518 165.882 126.265 169.12 123.15C170.261 122.039 171.301 120.709 172.023 119.278C174.539 114.227 174.942 108.873 173.868 103.384C173.315 100.572 172.09 98.0636 170.194 95.858C165.932 90.908 156.587 90.4534 153.165 98.3161C151.621 101.852 151.269 105.539 151.135 109.344ZM174.841 89.2412C174.841 88.231 174.841 87.2208 174.841 86.2274C174.858 84.3922 175.093 84.1397 176.905 84.1228C178.851 84.106 180.797 84.0892 182.744 84.1228C184.153 84.1565 184.421 84.4596 184.438 85.8907C184.472 87.7427 184.438 131.602 184.438 131.602C184.438 134.094 184.321 134.195 181.905 134.212C180.227 134.212 178.549 134.229 176.871 134.212C175.613 134.178 175.345 133.959 175.227 132.697C175.093 131.367 175.076 129.733 174.992 128.386C174.992 128.386 174.422 128.942 174.019 129.363C171.1 132.73 167.409 134.515 163.013 134.885C153.651 135.677 146.923 130.39 143.635 122.359C141.387 116.904 140.967 111.179 141.471 105.371C141.856 100.993 142.947 96.8008 145.128 92.9621C147.93 88.0626 151.873 84.5943 157.493 83.5167C163.6 82.3381 169.087 83.6514 173.516 88.332C173.835 88.6687 174.17 88.9886 174.489 89.3254C174.489 89.3254 174.741 89.6284 174.791 89.6116C174.808 89.6116 174.791 89.2412 174.791 89.2412" fill="#a5b4fc"></path>
<path fill-rule="evenodd" clip-rule="evenodd" d="M74.6115 80.2504L81.8427 87.0692L66.0046 104.209C66.7093 105.438 77.145 123.47 81.8931 131.451C83.0339 133.37 82.5977 134.38 80.2488 134.246C78.1516 134.111 76.0376 134.145 73.9237 134.246C72.6821 134.296 71.9607 133.841 71.3399 132.764C67.6656 126.164 59.1761 111.348 59.1761 111.348C59.1761 111.348 53.5388 117.729 52.2134 119.177C51.5926 119.85 51.3074 120.574 51.3241 121.517C51.3745 124.884 51.3577 132.511 51.3074 132.949C51.2235 133.774 50.7537 134.229 49.9148 134.229C47.5324 134.229 45.1667 134.229 42.7843 134.229C41.9454 134.229 41.4756 133.791 41.4085 132.949V66.7811C41.3918 64.2724 41.4756 64.1882 43.9084 64.1882C45.8043 64.1882 47.7002 64.1545 49.5793 64.1882C50.955 64.2219 51.257 64.5586 51.3241 65.9561C51.3409 66.3938 51.3241 104.781 51.3241 105.354L74.6115 80.2335V80.2504Z" fill="#a5b4fc"></path>
<path fill-rule="evenodd" clip-rule="evenodd" d="M270.675 104.142H292.436C292.218 100.875 291.53 97.8784 289.416 95.4371C286.514 92.0866 282.722 91.6657 278.729 92.6254C274.249 93.7029 270.625 99.0064 270.692 104.142M270.407 112.998C271.011 117.342 272.185 121.197 275.759 123.891C277.789 125.423 280.121 126.012 282.604 125.979C285.977 125.945 289.114 125.036 291.849 122.982C292.067 122.813 292.302 122.679 292.637 122.46C295.003 124.177 297.402 125.911 299.902 127.73C297.302 130.323 294.517 132.293 291.211 133.471C286.178 135.239 281.027 135.525 275.91 134.06C268.813 132.023 264.25 127.124 262.001 120.187C259.334 111.954 259.451 103.653 262.907 95.6391C265.793 88.9718 270.81 84.6616 278.041 83.4494C283.98 82.4392 289.584 83.4157 294.366 87.406C298.426 90.7901 300.506 95.3024 301.462 100.438C302.134 104.041 302.066 107.694 301.848 111.331C301.764 112.661 301.462 112.93 300.187 112.981C299.801 112.981 271.128 112.981 270.424 112.981" fill="#a5b4fc"></path>
<path fill-rule="evenodd" clip-rule="evenodd" d="M33.523 90.4702C33.8754 89.881 33.1371 89.1402 32.9861 89.0055C26.7281 83.9713 19.5976 82.0688 11.6785 83.6851C7.0143 84.6279 3.22255 87.6417 1.36023 91.7667C-0.602759 96.3968 -0.585981 100.976 2.36689 105.253C3.89366 107.458 6.05798 108.957 8.47396 109.95C12.3999 111.482 21.4767 114.648 23.7416 115.759C24.7147 116.18 25.4697 116.904 25.8389 117.931C26.812 120.473 26.5267 124.514 22.2652 125.743C19.866 126.433 17.45 126.316 15.034 125.895C11.3262 125.255 9.12829 124.362 6.25931 121.921C5.90698 121.618 5.25265 121.601 4.93387 121.921C4.56476 122.292 0.135458 127.141 0.135458 127.141C-0.23365 127.915 0.252902 128.37 1.17567 129.195C1.89711 129.834 4.4641 131.602 5.60498 132.141C11.3597 134.852 17.3997 135.609 23.6242 134.498C30.2346 133.32 34.731 129.38 35.6035 122.426C36.1236 118.234 35.5699 114.26 32.6003 110.994C30.8554 109.075 28.6911 107.711 26.3086 106.802C23.2886 105.64 14.7656 102.946 12.3328 101.633C10.5879 100.875 9.69873 99.5284 9.71551 97.5417C9.71551 95.4371 10.5208 93.8207 12.3664 92.8611C13.1717 92.457 14.0945 92.1876 14.9837 92.0697C19.262 91.5478 23.1209 92.6759 26.5771 95.2014C26.812 95.3697 27.0301 95.5381 27.265 95.7233C27.7683 96.1105 28.4729 96.0432 28.9092 95.5886C28.9092 95.5886 33.3217 90.8407 33.523 90.5039" fill="#a5b4fc"></path>
<path fill-rule="evenodd" clip-rule="evenodd" d="M242.975 99.0906V66.7811C242.975 64.3229 243.11 64.1882 245.542 64.1882C247.438 64.1882 249.317 64.1545 251.213 64.1882C252.539 64.2219 252.824 64.5249 252.874 65.8214C252.891 66.1413 252.874 110.001 252.874 131.585C252.874 134.094 252.774 134.195 250.358 134.195C248.462 134.195 246.583 134.212 244.687 134.195C243.412 134.178 243.059 133.808 242.992 132.545C242.959 132.107 242.992 109.816 242.992 99.0906" fill="#a5b4fc"></path>
<path fill-rule="evenodd" clip-rule="evenodd" d="M124.089 134.178H134.005V62.3362H124.089V134.178Z" fill="#a5b4fc"></path>
<path fill-rule="evenodd" clip-rule="evenodd" d="M105.717 134.178H115.616V82.3381H105.717V134.178Z" fill="#a5b4fc"></path>
<path fill-rule="evenodd" clip-rule="evenodd" d="M87.3458 134.178H97.2279V96.9019H87.3458V134.178Z" fill="#a5b4fc"></path>
<path fill-rule="evenodd" clip-rule="evenodd" d="M146.705 0L90.834 63.307L83.1227 56.057L72 68.585L90.748 87L158 11.136L146.705 0Z" fill="#a5b4fc"></path>
</svg>

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@@ -1,6 +1,6 @@
<div class="relative overflow-hidden bg-white pt-32 pb-32">
<div class="max-w-3xl1 px-6">
<p class="text-5xl font-bold tracking-tight text-gray-900 sm:text-center">OneUptime is 7+ tools combined
<p class="text-5xl font-bold tracking-tight text-gray-900 sm:text-center">OneUptime is 8+ tools combined
into one.</p>
<p class="mt-5 text-xl text-gray-500 sm:text-center mb-12">Everything from monitoring, status pages,
incident management, on-call schedules - we've got it and we are just getting started!</p>

View File

@@ -333,7 +333,7 @@
<li class="flex space-x-3">
@@ -524,8 +524,7 @@
<div class="bg-white">
<div class="mx-auto max-w-7xl py-24 pt-10 px-6 lg:px-8">
<div class="sm:align-center sm:flex sm:flex-col">
<h1 class="text-5xl font-bold tracking-tight text-gray-900 sm:text-center">Telemetry: Logs, Traces, Metrics and
more.</h1>
<h1 class="text-5xl font-bold tracking-tight text-gray-900 sm:text-center">Logs, Traces, Metrics, Copilot and more.</h1>
<p class="mt-5 text-xl text-gray-500 sm:text-center">We truly envision to be the best open-source observability
platform out there. All of this to help you build reliable software all of the time. Coming very soon.</p>
@@ -546,7 +545,7 @@
</div>
<div>Logs Management</div>
</div>
<p class="mt-4 text-sm text-gray-500">Ingest logs from any source</p>
<p class="mt-4 text-sm text-gray-500">Ingest logs of from any source and search in seconds.</p>
</div>
<div class="px-6 pt-6 pb-8">
@@ -629,18 +628,20 @@
<span class="text-sm text-gray-500">Integrate with Slack / Teams</span>
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
<%- include('./Partials/tick-icon') %>
<span class="text-sm text-gray-500">Alerting</span>
</li>
</ul>
<h3 class="text-sm font-medium text-gray-900 mt-6">Coming soon</h3>
<ul role="list" class="mt-6 space-y-4">
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
<%- include('./Partials/comingsoon-icon') %>
<span class="text-sm text-gray-500">Alerting</span>
</li>
<li class="flex space-x-3">
@@ -677,7 +678,7 @@
</div>
<div>APM</div>
</div>
<p class="mt-4 text-sm text-gray-500">Monitor performance of your app</p>
<p class="mt-4 text-sm text-gray-500">Monitor performance of any app, any stack, any environment.</p>
</div>
<div class="px-6 pt-6 pb-8">
@@ -757,7 +758,7 @@
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
@@ -805,20 +806,101 @@
</div>
<div>Error Tracking</div>
</div>
<p class="mt-4 text-sm text-gray-500">See issues that really matter</p>
<p class="mt-4 text-sm text-gray-500">Track software errors. See issues that really matter.</p>
</div>
<div class="px-6 pt-6 pb-8">
<h3 class="text-sm font-medium text-gray-900">Coming soon</h3>
<h3 class="text-sm font-medium text-gray-900">What's included</h3>
<ul role="list" class="mt-6 space-y-4">
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
<%- include('./Partials/tick-icon') %>
<span class="text-sm text-gray-500">Track errors in any stack</span>
</li>
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<%- include('./Partials/tick-icon') %>
<span class="text-sm text-gray-500">Custom Queries</span>
</li>
<li class="flex space-x-3">
<%- include('./Partials/tick-icon') %>
<span class="text-sm text-gray-500">Session Replay</span>
</li>
<li class="flex space-x-3">
<%- include('./Partials/tick-icon') %>
<span class="text-sm text-gray-500">Cross Microservice Issues</span>
</li>
<li class="flex space-x-3">
<%- include('./Partials/tick-icon') %>
<span class="text-sm text-gray-500">Distributed Tracing</span>
</li>
<li class="flex space-x-3">
<%- include('./Partials/tick-icon') %>
<span class="text-sm text-gray-500">Stack Traces</span>
</li>
<li class="flex space-x-3">
<%- include('./Partials/tick-icon') %>
<span class="text-sm text-gray-500">Version Management</span>
</li>
<li class="flex space-x-3">
<%- include('./Partials/tick-icon') %>
<span class="text-sm text-gray-500">Issue Owners</span>
</li>
<li class="flex space-x-3">
<%- include('./Partials/tick-icon') %>
<span class="text-sm text-gray-500">Integrate with Slack / Teams</span>
</li>
<li class="flex space-x-3">
<%- include('./Partials/tick-icon') %>
<span class="text-sm text-gray-500">Advanced Workflows</span>
</li>
</ul>
<h3 class="text-sm font-medium text-gray-900 mt-6">Coming soon</h3>
<ul role="list" class="mt-6 space-y-4">
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
@@ -828,86 +910,7 @@
<span class="text-sm text-gray-500">Dashboards and Reports</span>
</li>
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<span class="text-sm text-gray-500">Session Replay</span>
</li>
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<span class="text-sm text-gray-500">Cross Microservice Issues</span>
</li>
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<span class="text-sm text-gray-500">Distributed Tracing</span>
</li>
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<span class="text-sm text-gray-500">Stack Traces</span>
</li>
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<span class="text-sm text-gray-500">Version Management</span>
</li>
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<span class="text-sm text-gray-500">Releases</span>
</li>
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<span class="text-sm text-gray-500">Issue Owners</span>
</li>
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<span class="text-sm text-gray-500">Integrate with Slack / Teams</span>
</li>
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<span class="text-sm text-gray-500">Advanced Workflows</span>
</li>
@@ -924,29 +927,24 @@
<div class="p-6">
<div class="text-lg font-medium leading-6 text-gray-900 flex space-x-2">
<div>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z" />
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z" />
</svg>
</div>
<div>Reliability Autopilot</div>
<div>Reliability Copilot</div>
</div>
<p class="mt-4 text-sm text-gray-500">Automatically fix issues.</p>
<p class="mt-4 text-sm text-gray-500">Fix issues with your code automatically.</p>
</div>
<div class="px-6 pt-6 pb-8">
<h3 class="text-sm font-medium text-gray-900">Coming soon</h3>
<h3 class="text-sm font-medium text-gray-900">What's included</h3>
<ul role="list" class="mt-6 space-y-4">
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<%- include('./Partials/tick-icon') %>
@@ -955,7 +953,8 @@
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<%- include('./Partials/tick-icon') %>
@@ -964,7 +963,8 @@
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<%- include('./Partials/tick-icon') %>
@@ -975,7 +975,8 @@
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<%- include('./Partials/tick-icon') %>
@@ -984,7 +985,8 @@
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<%- include('./Partials/tick-icon') %>
@@ -993,7 +995,8 @@
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<%- include('./Partials/tick-icon') %>
@@ -1003,7 +1006,8 @@
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<%- include('./Partials/tick-icon') %>
@@ -1012,7 +1016,8 @@
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<%- include('./Partials/tick-icon') %>
@@ -1021,7 +1026,8 @@
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<%- include('./Partials/tick-icon') %>
@@ -1029,12 +1035,20 @@
</li>
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>
<%- include('./Partials/tick-icon') %>
<span class="text-sm text-gray-500">Advanced Workflows</span>
</li>
</ul>
<h3 class="text-sm font-medium text-gray-900 mt-6">Coming soon</h3>
<ul role="list" class="mt-6 space-y-4">
<li class="flex space-x-3">
<%- include('./Partials/comingsoon-icon') %>

View File

@@ -11,7 +11,7 @@
<img class="h-6 mt-2" src="/img/viewsonic.svg" alt="ViewSonic">
</div>
<div class="mt-4 ml-8 flex justify-center flex-shrink-0 flex-grow lg:ml-4 lg:flex-grow-0">
<img class="h-9 mt-1" src="/img/Siemens-logo.svg" alt="Siemens">
<img class="h-12 -mt-4" src="/img/skillable-logo.svg" alt="Skillable">
</div>
<div class="mt-4 ml-8 flex justify-center flex-shrink-0 flex-grow lg:ml-4 lg:flex-grow-0">
<img class="h-11 -mt-2" src="/img/sodexo.svg" alt="Sodexo">

View File

@@ -51,10 +51,10 @@
To: "opacity-0 translate-y-1"
-->
<div onmouseenter="showProductMenu()" onmouseover="showProductMenu()" onmouseleave="hideProductMenu()"
class="absolute z-20 -ml-4 mt-3 w-screen max-w-md transform px-2 sm:px-0 lg:left-1/2 lg:ml-0 lg:-translate-x-1/2"
class="absolute z-20 -ml-4 mt-3 w-screen max-w-4xl transform px-2 sm:px-0 lg:left-1/2 lg:ml-0 lg:-translate-x-1/2"
id="product-menu" style="visibility: collapse;">
<div class="overflow-hidden rounded-lg shadow-lg ring-1 ring-black ring-opacity-5">
<div class="relative grid gap-6 bg-white px-5 py-6 sm:gap-8 sm:p-8">
<div class="relative grid grid-cols-2 gap-6 bg-white px-5 py-6 sm:gap-8 sm:p-8">
<a href="/product/status-page" class="-m-3 flex items-start rounded-lg p-3 hover:bg-gray-50">
<!-- Heroicon name: outline/chart-bar -->
<svg class="h-6 w-6 flex-shrink-0 text-indigo-600" xmlns="http://www.w3.org/2000/svg" fill="none"
@@ -165,7 +165,7 @@
</div>
<div class="space-y-6 bg-gray-50 px-5 py-5 sm:flex sm:space-y-0 sm:space-x-10 sm:px-8">
<div class="flow-root">
<div class="flow-root w-1/2">
<a href="/enterprise/demo"
class="-m-3 flex items-center rounded-md p-3 text-base font-medium text-gray-900 hover:bg-gray-100">
<!-- Heroicon name: outline/play -->
@@ -178,7 +178,7 @@
</a>
</div>
<div class="flow-root">
<div class="flow-root w-1/2">
<a href="mailto:sales@oneuptime.com"
class="-m-3 flex items-center rounded-md p-3 text-base font-medium text-gray-900 hover:bg-gray-100">
<!-- Heroicon name: outline/phone -->

View File

@@ -67,7 +67,7 @@
</div>
<div class="mt-6">
<h2 class="text-3xl font-bold tracking-tight text-gray-900">On-call policy for every service.</h2>
<p class="mt-4 text-lg text-gray-500">Build unlimited on-call policies one for each team and for every service. Design custom worklfows to alert right stakeholders at the right time.</p>
<p class="mt-4 text-lg text-gray-500">Build unlimited on-call policies one for each team and for every service. Design custom workflows to alert right stakeholders at the right time.</p>
<div class="mt-6">
<a href="/accounts/register" class="rounded-md bg-indigo-600 px-3.5 py-1.5 text-base font-semibold leading-7 text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 hover:text-white">Get started</a>

View File

@@ -53,7 +53,7 @@
d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
clip-rule="evenodd" />
</svg>
<span class="text-sm text-gray-500">Unlimited Status Pages</span>
<span class="text-sm text-gray-500">1 Status Page</span>
</li>
<li class="flex space-x-3">
@@ -64,22 +64,13 @@
d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
clip-rule="evenodd" />
</svg>
<span class="text-sm text-gray-500">Unlimited Subscribers</span>
<span class="text-sm text-gray-500">100 Subscribers</span>
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
<svg class="h-5 w-5 flex-shrink-0 text-green-500" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd"
d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
clip-rule="evenodd" />
</svg>
<span class="text-sm text-gray-500">Unlimited Status Page Viewers</span>
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
@@ -103,6 +94,52 @@
<span class="text-sm text-gray-500">Active Monitors at $1/month</span>
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
<svg class="h-5 w-5 flex-shrink-0 text-green-500" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd"
d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
clip-rule="evenodd" />
</svg>
<span class="text-sm text-gray-500">Incident Management</span>
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
<svg class="h-5 w-5 flex-shrink-0 text-green-500" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd"
d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
clip-rule="evenodd" />
</svg>
<span class="text-sm text-gray-500">Logs, Traces and Metrics</span>
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
<svg class="h-5 w-5 flex-shrink-0 text-green-500" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd"
d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
clip-rule="evenodd" />
</svg>
<span class="text-sm text-gray-500">5 Business Day Email Support</span>
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
<svg class="h-5 w-5 flex-shrink-0 text-green-500" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd"
d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
clip-rule="evenodd" />
</svg>
<span class="text-sm text-gray-500">99.00% SLA</span>
</li>
</ul>
</div>
</div>
@@ -133,6 +170,39 @@
<span class="text-sm text-gray-500">Everything in Free Plan </span>
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
<svg class="h-5 w-5 flex-shrink-0 text-green-500" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd"
d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
clip-rule="evenodd" />
</svg>
<span class="text-sm text-gray-500">Unlimited Status Pages </span>
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
<svg class="h-5 w-5 flex-shrink-0 text-green-500" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd"
d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
clip-rule="evenodd" />
</svg>
<span class="text-sm text-gray-500">Unlimited Subscribers </span>
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
<svg class="h-5 w-5 flex-shrink-0 text-green-500" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd"
d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
clip-rule="evenodd" />
</svg>
<span class="text-sm text-gray-500">On Call Rotation and Alerts</span>
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
<svg class="h-5 w-5 flex-shrink-0 text-green-500" xmlns="http://www.w3.org/2000/svg"
@@ -155,16 +225,7 @@
<span class="text-sm text-gray-500">API Access</span>
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
<svg class="h-5 w-5 flex-shrink-0 text-green-500" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd"
d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
clip-rule="evenodd" />
</svg>
<span class="text-sm text-gray-500">Advanced Workflows</span>
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
@@ -262,16 +323,7 @@
<span class="text-sm text-gray-500">6 hour Chat or Email Support</span>
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
<svg class="h-5 w-5 flex-shrink-0 text-green-500" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd"
d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
clip-rule="evenodd" />
</svg>
<span class="text-sm text-gray-500">99.99% SLA</span>
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
@@ -283,6 +335,28 @@
</svg>
<span class="text-sm text-gray-500">Dedicated Account Executive</span>
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
<svg class="h-5 w-5 flex-shrink-0 text-green-500" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd"
d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
clip-rule="evenodd" />
</svg>
<span class="text-sm text-gray-500">Dedicated Support Channel</span>
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
<svg class="h-5 w-5 flex-shrink-0 text-green-500" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd"
d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
clip-rule="evenodd" />
</svg>
<span class="text-sm text-gray-500">99.99% SLA</span>
</li>
</ul>
</div>
</div>
@@ -293,7 +367,9 @@
<p class="mt-4 text-sm text-gray-500">Enterprise grade offering. The best of us for your team.</p>
<p class="mt-8">
<span class="text-4xl font-bold tracking-tight text-gray-900">Custom</span>
<span class="text-base font-medium text-gray-500">/yr</span>
<span class="text-base font-medium text-gray-500">
<div class='tooltip'>Please contact sales<span class='tooltiptext'>Please contact sales or request a demo. The best of us for the best companies around. We will quote a cusom price to match your needs.</span></div>
</span>
</p>
<a href="/enterprise/demo"
class="mt-8 block w-full hover:text-white rounded-md border border-gray-800 bg-gray-800 py-2 text-center text-sm font-semibold text-white hover:bg-gray-900">Request
@@ -365,7 +441,7 @@
d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
clip-rule="evenodd" />
</svg>
<span class="text-sm text-gray-500">Dedicated Support Channel</span>
<span class="text-sm text-gray-500">Custom Data Retention</span>
</li>
<li class="flex space-x-3">
@@ -376,8 +452,10 @@
d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
clip-rule="evenodd" />
</svg>
<span class="text-sm text-gray-500">Custom Data Retention</span>
<span class="text-sm text-gray-500">Private Cloud or SaaS</span>
</li>
<li class="flex space-x-3">
<!-- Heroicon name: mini/check -->
<svg class="h-5 w-5 flex-shrink-0 text-green-500" xmlns="http://www.w3.org/2000/svg"
@@ -624,8 +702,7 @@
<div class="bg-white">
<div class="mx-auto max-w-7xl py-24 px-6 sm:py-32 lg:px-8 lg:py-40">
<div class="mx-auto max-w-3xl text-center">
<h2 class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl">All-in-one platform for all your SRE
needs.</h2>
<h2 class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl">OneUptime is 8+ tools combined into one.</h2>
<p class="mx-auto mt-4 max-w-xl text-lg leading-8 text-gray-600">With OneUptime, you get a complete SRE
toolchain out-of-the-box. One interface. One conversation. One permission model. Thousands of features.
You'll be amazed at everything OneUptime can do today. And we're just getting started.</p>
@@ -683,6 +760,56 @@
resources are not operational. Alert right people at the right time.</dd>
</div>
<div class="relative">
<dt>
<!-- Heroicon name: outline/check -->
<svg class="absolute mt-1 h-6 w-6 text-indigo-600" xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5" />
</svg>
<p class="ml-10 text-lg font-semibold leading-8 text-gray-900">Error Tracking</p>
</dt>
<dd class="mt-2 ml-10 text-base leading-7 text-gray-600">Track errors in your applicaton. See issues that really matter. Automatically fix errors (powered by OneUptime Copilot) </dd>
</div>
<div class="relative">
<dt>
<!-- Heroicon name: outline/check -->
<svg class="absolute mt-1 h-6 w-6 text-indigo-600" xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5" />
</svg>
<p class="ml-10 text-lg font-semibold leading-8 text-gray-900">Logs Management</p>
</dt>
<dd class="mt-2 ml-10 text-base leading-7 text-gray-600">Ingest logs from any source and search in seconds. Native OpenTelemetry Support. Ingest TB's and search in seconds.</dd>
</div>
<div class="relative">
<dt>
<!-- Heroicon name: outline/check -->
<svg class="absolute mt-1 h-6 w-6 text-indigo-600" xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5" />
</svg>
<p class="ml-10 text-lg font-semibold leading-8 text-gray-900">APM</p>
</dt>
<dd class="mt-2 ml-10 text-base leading-7 text-gray-600">Monitor performance of any app, any service, any stack.
Improve poorly performing resources. Get alerted by SMS, Email or Call when things go wrong.</dd>
</div>
<div class="relative">
<dt>
<!-- Heroicon name: outline/check -->
<svg class="absolute mt-1 h-6 w-6 text-indigo-600" xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5" />
</svg>
<p class="ml-10 text-lg font-semibold leading-8 text-gray-900">Workflows</p>
</dt>
<dd class="mt-2 ml-10 text-base leading-7 text-gray-600">Integrate with any software or service. Drag and Drop workflows. Supports Webhooks and API's. 5000+ Integrations. Write Custom Code</dd>
</div>
</dl>
</div>
</div>
@@ -1347,10 +1474,6 @@
<script>
function switchToYearlyBilling() {
document.getElementById("yearly-billing-btn").classList = "relative w-1/2 whitespace-nowrap rounded-md border-gray-200 bg-white py-2 text-sm font-medium text-gray-900 shadow-sm focus:z-10 focus:outline-none focus:ring-2 focus:ring-indigo-500 sm:w-auto sm:px-8"
document.getElementById("monthly-billing-btn").classList = "relative ml-0.5 w-1/2 whitespace-nowrap rounded-md border border-transparent py-2 text-sm font-medium text-gray-700 focus:z-10 focus:outline-none focus:ring-2 focus:ring-indigo-500 sm:w-auto sm:px-8"
@@ -1367,7 +1490,6 @@
for (let i = 0; i < document.getElementsByClassName("billing-period").length; i++) {
document.getElementsByClassName("billing-period")[i].innerHTML = "<div class='tooltip'>/mo per user billed yearly<span class='tooltiptext'>Users are people in your team who create and manage OneUptime resources like monitors, incidents, etc. They are NOT Status Page Subscribers or Status Page Private Viewers (these are free).</span></div>"
}
}
function switchToMonthlyBilling() {

View File

@@ -30,7 +30,6 @@ import Express, {
ExpressRouter,
NextFunction,
} from "CommonServer/Utils/Express";
import JSONWebToken from "CommonServer/Utils/JsonWebToken";
import logger from "CommonServer/Utils/Logger";
import Response from "CommonServer/Utils/Response";
import EmailVerificationToken from "Model/Models/EmailVerificationToken";
@@ -89,6 +88,7 @@ router.post(
select: {
_id: true,
password: true,
timezone: true,
},
props: {
isRoot: true,
@@ -121,6 +121,7 @@ router.post(
_id: true,
name: true,
isMasterAdmin: true,
timezone: true,
},
props: {
isRoot: true,
@@ -179,23 +180,10 @@ router.post(
// Refresh Permissions for this user here.
await AccessTokenService.refreshUserAllPermissions(savedUser.id!);
const token: string = JSONWebToken.signUserLoginToken({
tokenData: {
userId: savedUser.id!,
email: savedUser.email!,
name: savedUser.name!,
isMasterAdmin: savedUser.isMasterAdmin!,
isGlobalLogin: true, // This is a general login without SSO. So, we will set this to true. This will give access to all the projects that dont require SSO.
},
expiresInSeconds: OneUptimeDate.getSecondsInDays(
new PositiveNumber(30),
),
});
// Set a cookie with token.
CookieUtil.setCookie(res, CookieUtil.getUserTokenKey(), token, {
maxAge: OneUptimeDate.getMillisecondsInDays(new PositiveNumber(30)),
httpOnly: true,
CookieUtil.setUserCookie({
expressResponse: res,
user: savedUser,
isGlobalLogin: true,
});
logger.info("User signed up: " + savedUser.email?.toString());
@@ -534,6 +522,7 @@ router.post(
isMasterAdmin: true,
isEmailVerified: true,
profilePictureId: true,
timezone: true,
},
props: {
isRoot: true,
@@ -573,23 +562,10 @@ router.post(
) {
logger.info("User logged in: " + alreadySavedUser.email?.toString());
const token: string = JSONWebToken.signUserLoginToken({
tokenData: {
userId: alreadySavedUser.id!,
email: alreadySavedUser.email!,
name: alreadySavedUser.name!,
isMasterAdmin: alreadySavedUser.isMasterAdmin!,
isGlobalLogin: true, // This is a general login without SSO. So, we will set this to true. This will give access to all the projects that dont require SSO.
},
expiresInSeconds: OneUptimeDate.getSecondsInDays(
new PositiveNumber(30),
),
});
// Set a cookie with token.
CookieUtil.setCookie(res, CookieUtil.getUserTokenKey(), token, {
maxAge: OneUptimeDate.getMillisecondsInDays(new PositiveNumber(30)),
httpOnly: true,
CookieUtil.setUserCookie({
expressResponse: res,
user: alreadySavedUser,
isGlobalLogin: true,
});
return Response.sendEntityResponse(req, res, alreadySavedUser, User);

View File

@@ -5,6 +5,7 @@ import Hostname from "Common/Types/API/Hostname";
import Protocol from "Common/Types/API/Protocol";
import Route from "Common/Types/API/Route";
import URL from "Common/Types/API/URL";
import { LIMIT_PER_PROJECT } from "Common/Types/Database/LimitMax";
import OneUptimeDate from "Common/Types/Date";
import Email from "Common/Types/Email";
import BadRequestException from "Common/Types/Exception/BadRequestException";
@@ -19,6 +20,8 @@ import AccessTokenService from "CommonServer/Services/AccessTokenService";
import ProjectSSOService from "CommonServer/Services/ProjectSsoService";
import TeamMemberService from "CommonServer/Services/TeamMemberService";
import UserService from "CommonServer/Services/UserService";
import QueryHelper from "CommonServer/Types/Database/QueryHelper";
import Select from "CommonServer/Types/Database/Select";
import CookieUtil from "CommonServer/Utils/Cookie";
import Express, {
ExpressRequest,
@@ -26,9 +29,9 @@ import Express, {
ExpressRouter,
NextFunction,
} from "CommonServer/Utils/Express";
import JSONWebToken from "CommonServer/Utils/JsonWebToken";
import logger from "CommonServer/Utils/Logger";
import Response from "CommonServer/Utils/Response";
import Project from "Model/Models/Project";
import ProjectSSO from "Model/Models/ProjectSso";
import TeamMember from "Model/Models/TeamMember";
import User from "Model/Models/User";
@@ -36,6 +39,115 @@ import xml2js from "xml2js";
const router: ExpressRouter = Express.getRouter();
// This route is used to get the SSO config for the user.
// when the user logs in from OneUptime and not from the IDP.
router.get(
"/service-provider-login",
async (req: ExpressRequest, res: ExpressResponse): Promise<void> => {
if (!req.query["email"]) {
return Response.sendErrorResponse(
req,
res,
new BadRequestException("Email is required"),
);
}
const email: Email = new Email(req.query["email"] as string);
if (!email) {
return Response.sendErrorResponse(
req,
res,
new BadRequestException("Email is required"),
);
}
// get sso config for this user.
const user: User | null = await UserService.findOneBy({
query: { email: email },
select: {
_id: true,
},
props: {
isRoot: true,
},
});
if (!user) {
return Response.sendErrorResponse(
req,
res,
new BadRequestException("No SSO config found for this user"),
);
}
const userId: ObjectID = user.id!;
if (!userId) {
return Response.sendErrorResponse(
req,
res,
new BadRequestException("No SSO config found for this user"),
);
}
const projectUserBelongsTo: Array<ObjectID> = (
await TeamMemberService.findBy({
query: { userId: userId },
select: {
projectId: true,
},
limit: LIMIT_PER_PROJECT,
skip: 0,
props: {
isRoot: true,
},
})
).map((teamMember: TeamMember) => {
return teamMember.projectId!;
});
if (projectUserBelongsTo.length === 0) {
return Response.sendErrorResponse(
req,
res,
new BadRequestException("No SSO config found for this user"),
);
}
const projectSSOList: Array<ProjectSSO> = await ProjectSSOService.findBy({
query: {
projectId: QueryHelper.any(projectUserBelongsTo),
isEnabled: true,
},
limit: LIMIT_PER_PROJECT,
skip: 0,
select: {
name: true,
description: true,
_id: true,
projectId: true,
project: {
name: true,
} as Select<Project>,
},
props: {
isRoot: true,
},
});
return Response.sendEntityArrayResponse(
req,
res,
projectSSOList,
projectSSOList.length,
ProjectSSO,
);
},
);
router.get(
"/sso/:projectId/:projectSsoId",
async (
@@ -284,6 +396,7 @@ const loginUserWithSso: LoginUserWithSsoFunction = async (
isMasterAdmin: true,
isEmailVerified: true,
profilePictureId: true,
timezone: true,
},
props: {
isRoot: true,
@@ -374,38 +487,18 @@ const loginUserWithSso: LoginUserWithSsoFunction = async (
const projectId: ObjectID = new ObjectID(req.params["projectId"] as string);
const ssoToken: string = JSONWebToken.sign({
data: {
userId: alreadySavedUser.id!,
projectId: projectId,
name: alreadySavedUser.name!,
email: email,
isMasterAdmin: false,
isGeneralLogin: false,
},
expiresInSeconds: OneUptimeDate.getSecondsInDays(new PositiveNumber(30)),
alreadySavedUser.email = email;
CookieUtil.setSSOCookie({
user: alreadySavedUser,
projectId: projectId,
expressResponse: res,
});
const oneUptimeToken: string = JSONWebToken.signUserLoginToken({
tokenData: {
userId: alreadySavedUser.id!,
email: alreadySavedUser.email!,
name: alreadySavedUser.name!,
isMasterAdmin: alreadySavedUser.isMasterAdmin!,
isGlobalLogin: false, // This is a general login without SSO. So, we will set this to false. This will give access to all the projects that dont require SSO.
},
expiresInSeconds: OneUptimeDate.getSecondsInDays(new PositiveNumber(30)),
});
// Set a cookie with token.
CookieUtil.setCookie(res, CookieUtil.getUserTokenKey(), oneUptimeToken, {
maxAge: OneUptimeDate.getMillisecondsInDays(new PositiveNumber(30)),
httpOnly: true,
});
CookieUtil.setCookie(res, CookieUtil.getUserSSOKey(projectId), ssoToken, {
maxAge: OneUptimeDate.getMillisecondsInDays(new PositiveNumber(30)),
httpOnly: true,
CookieUtil.setUserCookie({
expressResponse: res,
user: alreadySavedUser,
isGlobalLogin: false,
});
// Refresh Permissions for this user here.

View File

@@ -273,14 +273,14 @@ export default class MailService {
mail.vars["year"] = OneUptimeDate.getCurrentYear().toString();
}
mail.body = mail.templateType
? await this.compileEmailBody(mail.templateType, mail.vars)
: this.compileText(mail.body || "", mail.vars);
mail.subject = this.compileText(mail.subject, mail.vars);
const emailServerType: EmailServerType = await getEmailServerType();
try {
const emailServerType: EmailServerType = await getEmailServerType();
mail.body = mail.templateType
? await this.compileEmailBody(mail.templateType, mail.vars)
: this.compileText(mail.body || "", mail.vars);
mail.subject = this.compileText(mail.subject, mail.vars);
if (
(!options || !options.emailServer) &&
emailServerType === EmailServerType.Sendgrid

View File

@@ -12,11 +12,18 @@
{{> DetailBoxField title="Incident Title:" text=incidentTitle }}
{{> DetailBoxField title="Current State: " text=currentState }}
{{> DetailBoxField title="Resources Affected: " text=resourcesAffected }}
{{> DetailBoxField title="Incident Declared By: " text=declaredBy }}
{{> DetailBoxField title="Incident Declared At: " text="" }}
{{> DetailBoxField title="" text=declaredAt }}
{{> DetailBoxField title="Severity: " text=incidentSeverity }}
{{> DetailBoxField title="Root Cause: " text="" }}
{{> DetailBoxField title="" text=rootCause }}
{{> DetailBoxField title="Description: " text="" }}
{{> DetailBoxField title="" text=incidentDescription }}
{{#ifNotCond remediationNotes ""}}
{{> DetailBoxField title="Remediation Notes: " text="" }}
{{> DetailBoxField title="" text=remediationNotes }}
{{/ifNotCond}}
{{> DetailBoxEnd this }}

View File

@@ -11,8 +11,10 @@
{{> DetailBoxStart this }}
{{> DetailBoxField title="Monitor Name:" text=monitorName }}
{{> DetailBoxField title="New Status: " text=currentStatus }}
{{#ifNotCond rootCause ""}}
{{> DetailBoxField title="Root Cause: " text="" }}
{{> DetailBoxField title="" text=rootCause }}
{{/ifNotCond}}
{{> DetailBoxField title="Status changed at: " text="" }}
{{> DetailBoxField title="" text=statusChangedAt }}
{{> DetailBoxField title="Description: " text="" }}

View File

@@ -0,0 +1,30 @@
{{> Start this}}
{{> Logo this}}
{{> EmailTitle title=title }}
{{> InfoBlock info="Here are the details: "}}
{{> DetailBoxStart this }}
{{> DetailBoxField title="Monitor Name:" text=monitorName }}
{{> DetailBoxField title="Monitor Description: " text="" }}
{{> DetailBoxField title="" text=monitorDescription }}
{{> DetailBoxField title="Probe Status: " text=currentStatus }}
{{> DetailBoxEnd this }}
{{> InfoBlock info="You can view this monitor by clicking on the button below - "}}
{{> ButtonBlock buttonUrl=monitorViewLink buttonText="View on Dashboard"}}
{{> InfoBlock info="You can also copy and paste this link:"}}
{{> InfoBlock info=monitorViewLink}}
{{> InfoBlock info="You will be notified when the status of the probe changes."}}
{{> OwnerInfo this }}
{{> UnsubscribeOwnerEmail this }}
{{> Footer this }}
{{> End this}}

View File

@@ -1,7 +1,7 @@
{{#if title}}
<p
style="Margin:0;font-size:16px;font-family:'inter','helvetica neue',helvetica,arial,sans-serif;line-height:30px;color:#424761">
<strong>{{{title}}} </strong>{{{text}}} </span></p>
<p style="Margin:0;font-size:16px;font-family:'inter','helvetica neue',helvetica,arial,sans-serif;line-height:30px;color:#424761">
{{#if title}}
<strong>{{{title}}} </strong>{{{text}}} </span>
{{else}}
{{{text}}}
{{/if}}
{{/if}}
</p>

View File

@@ -0,0 +1,33 @@
{{> Start this}}
{{> Logo this}}
{{> EmailTitle title=title}}
{{> InfoBlock info="Here are the details: "}}
{{> DetailBoxStart this }}
{{> DetailBoxField title="Probe Name:" text=probeName }}
{{> DetailBoxField title="Probe Description:" text=probeDescription }}
{{> DetailBoxField title="Probe Status:" text=probeStatus }}
{{> DetailBoxField title="Status Since:" text="" }}
{{> DetailBoxField title="" text=lastAlive }}
{{> DetailBoxField title="Project Name: " text=projectName }}
{{> DetailBoxEnd this }}
{{> InfoBlock info="You can view this probe by going to Project Settings > Probes "}}
{{> ButtonBlock buttonUrl=viewProbesLink buttonText="View Probes"}}
{{> InfoBlock info="You can also copy and paste this link:"}}
{{> InfoBlock info=viewProbesLink}}
{{> InfoBlock info="You will be notified when the status of this probe changes."}}
{{> OwnerInfo this }}
{{> UnsubscribeOwnerEmail this }}
{{> Footer this }}
{{> End this}}

View File

@@ -0,0 +1,28 @@
{{> Start this}}
{{> Logo this}}
{{> EmailTitle title=(concat "Probe: " probeName) }}
{{> InfoBlock info="You have been added as the owner of this probe."}}
{{> InfoBlock info="Here are the details: "}}
{{> DetailBoxStart this }}
{{> DetailBoxField title="Probe Name:" text=probeName }}
{{> DetailBoxField title="Probe Description: " text=probeDescription }}
{{> DetailBoxEnd this }}
{{> InfoBlock info="You can view this probe by clicking on the button below - "}}
{{> ButtonBlock buttonUrl=viewProbeLink buttonText="View on Dashboard"}}
{{> InfoBlock info="You can also copy and paste this link:"}}
{{> InfoBlock info=viewProbeLink}}
{{> InfoBlock info="You will be notified when the status of this probe changes."}}
{{> Footer this }}
{{> End this}}

View File

@@ -61,6 +61,10 @@ import QueueWorker from "CommonServer/Infrastructure/QueueWorker";
import FeatureSet from "CommonServer/Types/FeatureSet";
import logger from "CommonServer/Utils/Logger";
// Probes
import "./Jobs/Probe/SendOwnerAddedNotification";
import "./Jobs/Probe/UpdateConnectionStatus";
const WorkersFeatureSet: FeatureSet = {
init: async (): Promise<void> => {
try {

View File

@@ -3,7 +3,7 @@ import { FileRoute } from "Common/ServiceRoute";
import Hostname from "Common/Types/API/Hostname";
import Protocol from "Common/Types/API/Protocol";
import URL from "Common/Types/API/URL";
import LIMIT_MAX, { LIMIT_PER_PROJECT } from "Common/Types/Database/LimitMax";
import LIMIT_MAX from "Common/Types/Database/LimitMax";
import OneUptimeDate from "Common/Types/Date";
import EmailTemplateType from "Common/Types/Email/EmailTemplateType";
import SMS from "Common/Types/SMS/SMS";
@@ -49,6 +49,7 @@ RunCron(
statusPages: {
_id: true,
},
showAnnouncementAt: true,
},
});
@@ -62,45 +63,12 @@ RunCron(
continue;
}
const statusPages: Array<StatusPage> = await StatusPageService.findBy({
query: {
_id: QueryHelper.any(
announcement.statusPages.map((sp: StatusPage) => {
return sp.id!;
}),
),
},
props: {
isRoot: true,
ignoreHooks: true,
},
skip: 0,
limit: LIMIT_PER_PROJECT,
select: {
_id: true,
name: true,
pageTitle: true,
projectId: true,
isPublicStatusPage: true,
logoFileId: true,
smtpConfig: {
_id: true,
hostname: true,
port: true,
username: true,
password: true,
fromEmail: true,
fromName: true,
secure: true,
},
callSmsConfig: {
_id: true,
twilioAccountSID: true,
twilioAuthToken: true,
twilioPhoneNumber: true,
},
},
});
const statusPages: Array<StatusPage> =
await StatusPageSubscriberService.getStatusPagesToSendNotification(
announcement.statusPages.map((sp: StatusPage) => {
return sp.id!;
}),
);
await StatusPageAnnouncementService.updateOneById({
id: announcement.id!,
@@ -114,41 +82,42 @@ RunCron(
});
for (const statuspage of statusPages) {
if (!statuspage.id) {
continue;
}
const subscribers: Array<StatusPageSubscriber> =
await StatusPageSubscriberService.getSubscribersByStatusPage(
statuspage.id!,
{
isRoot: true,
ignoreHooks: true,
},
);
const statusPageURL: string = await StatusPageService.getStatusPageURL(
statuspage.id,
);
const statusPageName: string =
statuspage.pageTitle || statuspage.name || "Status Page";
// Send email to Email subscribers.
for (const subscriber of subscribers) {
if (!subscriber._id) {
try {
if (!statuspage.id) {
continue;
}
const unsubscribeUrl: string =
StatusPageSubscriberService.getUnsubscribeLink(
URL.fromString(statusPageURL),
subscriber.id!,
).toString();
const subscribers: Array<StatusPageSubscriber> =
await StatusPageSubscriberService.getSubscribersByStatusPage(
statuspage.id!,
{
isRoot: true,
ignoreHooks: true,
},
);
if (subscriber.subscriberPhone) {
const sms: SMS = {
message: `
const statusPageURL: string =
await StatusPageService.getStatusPageURL(statuspage.id);
const statusPageName: string =
statuspage.pageTitle || statuspage.name || "Status Page";
// Send email to Email subscribers.
for (const subscriber of subscribers) {
try {
if (!subscriber._id) {
continue;
}
const unsubscribeUrl: string =
StatusPageSubscriberService.getUnsubscribeLink(
URL.fromString(statusPageURL),
subscriber.id!,
).toString();
if (subscriber.subscriberPhone) {
const sms: SMS = {
message: `
Announcement - ${statusPageName}
${announcement.title || ""}
@@ -157,58 +126,66 @@ RunCron(
To update notification preferences or unsubscribe, visit ${unsubscribeUrl}
`,
to: subscriber.subscriberPhone,
};
to: subscriber.subscriberPhone,
};
// send sms here.
SmsService.sendSms(sms, {
projectId: statuspage.projectId,
customTwilioConfig: ProjectCallSMSConfigService.toTwilioConfig(
statuspage.callSmsConfig,
),
}).catch((err: Error) => {
// send sms here.
SmsService.sendSms(sms, {
projectId: statuspage.projectId,
customTwilioConfig:
ProjectCallSMSConfigService.toTwilioConfig(
statuspage.callSmsConfig,
),
}).catch((err: Error) => {
logger.error(err);
});
}
if (subscriber.subscriberEmail) {
// send email here.
MailService.sendMail(
{
toEmail: subscriber.subscriberEmail,
templateType:
EmailTemplateType.SubscriberAnnouncementCreated,
vars: {
statusPageName: statusPageName,
statusPageUrl: statusPageURL,
logoUrl: statuspage.logoFileId
? new URL(httpProtocol, host)
.addRoute(FileRoute)
.addRoute("/image/" + statuspage.logoFileId)
.toString()
: "",
isPublicStatusPage: statuspage.isPublicStatusPage
? "true"
: "false",
announcementTitle: announcement.title || "",
announcementDescription: await Markdown.convertToHTML(
announcement.description || "",
MarkdownContentType.Email,
),
unsubscribeUrl: unsubscribeUrl,
},
subject: "[Announcement] " + statusPageName,
},
{
mailServer: ProjectSMTPConfigService.toEmailServer(
statuspage.smtpConfig,
),
projectId: statuspage.projectId,
},
).catch((err: Error) => {
logger.error(err);
});
}
} catch (err) {
logger.error(err);
});
}
if (subscriber.subscriberEmail) {
// send email here.
MailService.sendMail(
{
toEmail: subscriber.subscriberEmail,
templateType: EmailTemplateType.SubscriberAnnouncementCreated,
vars: {
statusPageName: statusPageName,
statusPageUrl: statusPageURL,
logoUrl: statuspage.logoFileId
? new URL(httpProtocol, host)
.addRoute(FileRoute)
.addRoute("/image/" + statuspage.logoFileId)
.toString()
: "",
isPublicStatusPage: statuspage.isPublicStatusPage
? "true"
: "false",
announcementTitle: announcement.title || "",
announcementDescription: await Markdown.convertToHTML(
announcement.description || "",
MarkdownContentType.Email,
),
unsubscribeUrl: unsubscribeUrl,
},
subject: "[Announcement] " + statusPageName,
},
{
mailServer: ProjectSMTPConfigService.toEmailServer(
statuspage.smtpConfig,
),
projectId: statuspage.projectId,
},
).catch((err: Error) => {
logger.error(err);
});
}
}
} catch (err) {
logger.error(err);
}
}
}

View File

@@ -128,100 +128,103 @@ RunCron(
);
for (const statuspage of statusPages) {
if (!statuspage.id) {
continue;
}
const subscribers: Array<StatusPageSubscriber> =
await StatusPageSubscriberService.getSubscribersByStatusPage(
statuspage.id!,
{
isRoot: true,
ignoreHooks: true,
},
);
const statusPageURL: string = await StatusPageService.getStatusPageURL(
statuspage.id,
);
const statusPageName: string =
statuspage.pageTitle || statuspage.name || "Status Page";
// Send email to Email subscribers.
const resourcesAffectedString: string =
statusPageToResources[statuspage._id!]
?.map((r: StatusPageResource) => {
return r.displayName;
})
.join(", ") || "None";
for (const subscriber of subscribers) {
if (!subscriber._id) {
try {
if (!statuspage.id) {
continue;
}
const shouldNotifySubscriber: boolean =
StatusPageSubscriberService.shouldSendNotification({
subscriber: subscriber,
statusPageResources: statusPageToResources[statuspage._id!] || [],
statusPage: statuspage,
});
if (!shouldNotifySubscriber) {
continue;
}
const unsubscribeUrl: string =
StatusPageSubscriberService.getUnsubscribeLink(
URL.fromString(statusPageURL),
subscriber.id!,
).toString();
if (subscriber.subscriberEmail) {
// send email here.
MailService.sendMail(
const subscribers: Array<StatusPageSubscriber> =
await StatusPageSubscriberService.getSubscribersByStatusPage(
statuspage.id!,
{
toEmail: subscriber.subscriberEmail,
templateType: EmailTemplateType.SubscriberIncidentCreated,
vars: {
statusPageName: statusPageName,
statusPageUrl: statusPageURL,
logoUrl: statuspage.logoFileId
? new URL(httpProtocol, host)
.addRoute(FileRoute)
.addRoute("/image/" + statuspage.logoFileId)
.toString()
: "",
isPublicStatusPage: statuspage.isPublicStatusPage
? "true"
: "false",
resourcesAffected: resourcesAffectedString,
incidentSeverity: incident.incidentSeverity?.name || " - ",
incidentTitle: incident.title || "",
incidentDescription: await Markdown.convertToHTML(
incident.description || "",
MarkdownContentType.Email,
),
unsubscribeUrl: unsubscribeUrl,
},
subject: "[Incident] " + statusPageName,
isRoot: true,
ignoreHooks: true,
},
{
mailServer: ProjectSMTPConfigService.toEmailServer(
statuspage.smtpConfig,
),
projectId: statuspage.projectId,
},
).catch((err: Error) => {
logger.error(err);
});
}
);
if (subscriber.subscriberPhone) {
const sms: SMS = {
message: `
const statusPageURL: string =
await StatusPageService.getStatusPageURL(statuspage.id);
const statusPageName: string =
statuspage.pageTitle || statuspage.name || "Status Page";
// Send email to Email subscribers.
const resourcesAffectedString: string =
statusPageToResources[statuspage._id!]
?.map((r: StatusPageResource) => {
return r.displayName;
})
.join(", ") || "None";
for (const subscriber of subscribers) {
try {
if (!subscriber._id) {
continue;
}
const shouldNotifySubscriber: boolean =
StatusPageSubscriberService.shouldSendNotification({
subscriber: subscriber,
statusPageResources:
statusPageToResources[statuspage._id!] || [],
statusPage: statuspage,
});
if (!shouldNotifySubscriber) {
continue;
}
const unsubscribeUrl: string =
StatusPageSubscriberService.getUnsubscribeLink(
URL.fromString(statusPageURL),
subscriber.id!,
).toString();
if (subscriber.subscriberEmail) {
// send email here.
MailService.sendMail(
{
toEmail: subscriber.subscriberEmail,
templateType: EmailTemplateType.SubscriberIncidentCreated,
vars: {
statusPageName: statusPageName,
statusPageUrl: statusPageURL,
logoUrl: statuspage.logoFileId
? new URL(httpProtocol, host)
.addRoute(FileRoute)
.addRoute("/image/" + statuspage.logoFileId)
.toString()
: "",
isPublicStatusPage: statuspage.isPublicStatusPage
? "true"
: "false",
resourcesAffected: resourcesAffectedString,
incidentSeverity:
incident.incidentSeverity?.name || " - ",
incidentTitle: incident.title || "",
incidentDescription: await Markdown.convertToHTML(
incident.description || "",
MarkdownContentType.Email,
),
unsubscribeUrl: unsubscribeUrl,
},
subject: "[Incident] " + statusPageName,
},
{
mailServer: ProjectSMTPConfigService.toEmailServer(
statuspage.smtpConfig,
),
projectId: statuspage.projectId,
},
).catch((err: Error) => {
logger.error(err);
});
}
if (subscriber.subscriberPhone) {
const sms: SMS = {
message: `
Incident - ${statusPageName}
Title: ${incident.title || ""}
@@ -236,19 +239,26 @@ RunCron(
To update notification preferences or unsubscribe, visit ${unsubscribeUrl}
`,
to: subscriber.subscriberPhone,
};
to: subscriber.subscriberPhone,
};
// send sms here.
SmsService.sendSms(sms, {
projectId: statuspage.projectId,
customTwilioConfig: ProjectCallSMSConfigService.toTwilioConfig(
statuspage.callSmsConfig,
),
}).catch((err: Error) => {
// send sms here.
SmsService.sendSms(sms, {
projectId: statuspage.projectId,
customTwilioConfig:
ProjectCallSMSConfigService.toTwilioConfig(
statuspage.callSmsConfig,
),
}).catch((err: Error) => {
logger.error(err);
});
}
} catch (err) {
logger.error(err);
});
}
}
} catch (err) {
logger.error(err);
}
}
}

View File

@@ -1,6 +1,7 @@
import RunCron from "../../Utils/Cron";
import { CallRequestMessage } from "Common/Types/Call/CallRequest";
import LIMIT_MAX from "Common/Types/Database/LimitMax";
import OneUptimeDate from "Common/Types/Date";
import Dictionary from "Common/Types/Dictionary";
import { EmailEnvelope } from "Common/Types/Email/EmailMessage";
import EmailTemplateType from "Common/Types/Email/EmailTemplateType";
@@ -10,9 +11,13 @@ import { EVERY_MINUTE } from "Common/Utils/CronTime";
import IncidentService from "CommonServer/Services/IncidentService";
import ProjectService from "CommonServer/Services/ProjectService";
import UserNotificationSettingService from "CommonServer/Services/UserNotificationSettingService";
import Select from "CommonServer/Types/Database/Select";
import Markdown, { MarkdownContentType } from "CommonServer/Types/Markdown";
import logger from "CommonServer/Utils/Logger";
import Incident from "Model/Models/Incident";
import IncidentState from "Model/Models/IncidentState";
import Monitor from "Model/Models/Monitor";
import Project from "Model/Models/Project";
import User from "Model/Models/User";
RunCron(
@@ -36,10 +41,11 @@ RunCron(
projectId: true,
project: {
name: true,
},
} as Select<Project>,
remediationNotes: true,
currentIncidentState: {
name: true,
},
} as Select<IncidentState>,
incidentSeverity: {
name: true,
},
@@ -47,10 +53,20 @@ RunCron(
monitors: {
name: true,
},
createdByProbe: {
name: true,
},
createdByUser: {
name: true,
email: true,
},
},
});
for (const incident of incidents) {
const incidentIdentifiedDate: Date =
await IncidentService.getIncidentIdentifiedDate(incident.id!);
await IncidentService.updateOneById({
id: incident.id!,
data: {
@@ -78,63 +94,100 @@ RunCron(
continue;
}
const vars: Dictionary<string> = {
incidentTitle: incident.title!,
projectName: incident.project!.name!,
currentState: incident.currentIncidentState!.name!,
incidentDescription: await Markdown.convertToHTML(
incident.description! || "",
MarkdownContentType.Email,
),
resourcesAffected:
incident
.monitors!.map((monitor: Monitor) => {
return monitor.name!;
})
.join(", ") || "None",
incidentSeverity: incident.incidentSeverity!.name!,
rootCause:
incident.rootCause || "No root cause identified for this incident",
incidentViewLink: (
await IncidentService.getIncidentLinkInDashboard(
incident.projectId!,
incident.id!,
)
).toString(),
};
let declaredBy: string = "OneUptime";
if (doesResourceHasOwners === true) {
vars["isOwner"] = "true";
if (incident.createdByProbe && incident.createdByProbe.name) {
declaredBy = incident.createdByProbe.name;
}
if (
incident.createdByUser &&
incident.createdByUser.name &&
incident.createdByUser.email
) {
declaredBy = `${incident.createdByUser.name.toString()} (${incident.createdByUser.email.toString()})`;
}
for (const user of owners) {
const emailMessage: EmailEnvelope = {
templateType: EmailTemplateType.IncidentOwnerResourceCreated,
vars: vars,
subject: "[Incident] " + incident.title!,
};
try {
const vars: Dictionary<string> = {
incidentTitle: incident.title!,
projectName: incident.project!.name!,
currentState: incident.currentIncidentState!.name!,
incidentDescription: await Markdown.convertToHTML(
incident.description! || "",
MarkdownContentType.Email,
),
resourcesAffected:
incident
.monitors!.map((monitor: Monitor) => {
return monitor.name!;
})
.join(", ") || "None",
incidentSeverity: incident.incidentSeverity!.name!,
declaredAt: OneUptimeDate.getDateAsFormattedHTMLInMultipleTimezones(
{
date: incidentIdentifiedDate,
timezones: user.timezone ? [user.timezone] : [],
},
),
declaredBy: declaredBy,
remediationNotes:
(await Markdown.convertToHTML(
incident.remediationNotes! || "",
MarkdownContentType.Email,
)) || "",
rootCause:
(await Markdown.convertToHTML(
incident.rootCause ||
"No root cause identified for this incident",
MarkdownContentType.Email,
)) || "",
incidentViewLink: (
await IncidentService.getIncidentLinkInDashboard(
incident.projectId!,
incident.id!,
)
).toString(),
};
const sms: SMSMessage = {
message: `This is a message from OneUptime. New incident created: ${incident.title}. To unsubscribe from this notification go to User Settings in OneUptime Dashboard.`,
};
if (doesResourceHasOwners === true) {
vars["isOwner"] = "true";
}
const callMessage: CallRequestMessage = {
data: [
{
sayMessage: `This is a message from OneUptime. New incident created: ${incident.title}. To unsubscribe from this notification go to User Settings in OneUptime Dashboard. Good bye.`,
},
],
};
const emailMessage: EmailEnvelope = {
templateType: EmailTemplateType.IncidentOwnerResourceCreated,
vars: vars,
subject: "[New Incident] " + incident.title!,
};
await UserNotificationSettingService.sendUserNotification({
userId: user.id!,
projectId: incident.projectId!,
emailEnvelope: emailMessage,
smsMessage: sms,
callRequestMessage: callMessage,
eventType:
NotificationSettingEventType.SEND_INCIDENT_CREATED_OWNER_NOTIFICATION,
});
const sms: SMSMessage = {
message: `This is a message from OneUptime. New incident created: ${incident.title}. To unsubscribe from this notification go to User Settings in OneUptime Dashboard.`,
};
const callMessage: CallRequestMessage = {
data: [
{
sayMessage: `This is a message from OneUptime. New incident created: ${incident.title}. To unsubscribe from this notification go to User Settings in OneUptime Dashboard. Good bye.`,
},
],
};
await UserNotificationSettingService.sendUserNotification({
userId: user.id!,
projectId: incident.projectId!,
emailEnvelope: emailMessage,
smsMessage: sms,
callRequestMessage: callMessage,
eventType:
NotificationSettingEventType.SEND_INCIDENT_CREATED_OWNER_NOTIFICATION,
});
} catch (e) {
logger.error(
"Error in sending incident created resource notification",
);
logger.error(e);
}
}
}
},

View File

@@ -129,37 +129,39 @@ RunCron(
continue;
}
const vars: Dictionary<string> = {
incidentTitle: incident.title!,
projectName: incidentStateTimeline.project!.name!,
currentState: incidentState!.name!,
incidentDescription: await Markdown.convertToHTML(
incident.description! || "",
MarkdownContentType.Email,
),
resourcesAffected:
incident
.monitors!.map((monitor: Monitor) => {
return monitor.name!;
})
.join(", ") || "None",
stateChangedAt: OneUptimeDate.getDateAsFormattedHTMLInMultipleTimezones(
incidentStateTimeline.createdAt!,
),
incidentSeverity: incidentWithSeverity.incidentSeverity!.name!,
incidentViewLink: (
await IncidentService.getIncidentLinkInDashboard(
incidentStateTimeline.projectId!,
incident.id!,
)
).toString(),
};
if (doesResourceHasOwners === true) {
vars["isOwner"] = "true";
}
for (const user of owners) {
const vars: Dictionary<string> = {
incidentTitle: incident.title!,
projectName: incidentStateTimeline.project!.name!,
currentState: incidentState!.name!,
incidentDescription: await Markdown.convertToHTML(
incident.description! || "",
MarkdownContentType.Email,
),
resourcesAffected:
incident
.monitors!.map((monitor: Monitor) => {
return monitor.name!;
})
.join(", ") || "None",
stateChangedAt:
OneUptimeDate.getDateAsFormattedHTMLInMultipleTimezones({
date: incidentStateTimeline.createdAt!,
timezones: user.timezone ? [user.timezone] : [],
}),
incidentSeverity: incidentWithSeverity.incidentSeverity!.name!,
incidentViewLink: (
await IncidentService.getIncidentLinkInDashboard(
incidentStateTimeline.projectId!,
incident.id!,
)
).toString(),
};
if (doesResourceHasOwners === true) {
vars["isOwner"] = "true";
}
const emailMessage: EmailEnvelope = {
templateType: EmailTemplateType.IncidentOwnerStateChanged,
vars: vars,

View File

@@ -5,6 +5,7 @@ import IncomingMonitorRequest from "Common/Types/Monitor/IncomingMonitor/Incomin
import MonitorType from "Common/Types/Monitor/MonitorType";
import { EVERY_MINUTE } from "Common/Utils/CronTime";
import MonitorService from "CommonServer/Services/MonitorService";
import logger from "CommonServer/Utils/Logger";
import ProbeMonitorResponseService from "CommonServer/Utils/Probe/ProbeMonitorResponse";
import Monitor from "Model/Models/Monitor";
@@ -12,6 +13,8 @@ RunCron(
"IncomingRequestMonitor:CheckHeartbeat",
{ schedule: EVERY_MINUTE, runOnStartup: false },
async () => {
logger.debug("Checking IncomingRequestMonitor:CheckHeartbeat");
const incomingRequestMonitors: Array<Monitor> = await MonitorService.findBy(
{
query: {
@@ -31,28 +34,46 @@ RunCron(
},
);
logger.debug(
`Found ${incomingRequestMonitors.length} incoming request monitors`,
);
logger.debug(incomingRequestMonitors);
for (const monitor of incomingRequestMonitors) {
if (!monitor.monitorSteps) {
continue;
try {
if (!monitor.monitorSteps) {
logger.debug("Monitor has no steps. Skipping...");
continue;
}
const processRequest: boolean = shouldProcessRequest(monitor);
logger.debug(
`Monitor: ${monitor.id} should process request: ${processRequest}`,
);
if (!processRequest) {
continue;
}
const incomingRequest: IncomingMonitorRequest = {
monitorId: monitor.id!,
requestHeaders: undefined,
requestBody: undefined,
requestMethod: undefined,
incomingRequestReceivedAt:
monitor.incomingRequestReceivedAt || monitor.createdAt!,
onlyCheckForIncomingRequestReceivedAt: true,
};
await ProbeMonitorResponseService.processProbeResponse(incomingRequest);
} catch (error) {
logger.error(
`Error while processing incoming request monitor: ${monitor.id?.toString()}`,
);
logger.error(error);
}
const processRequest: boolean = shouldProcessRequest(monitor);
if (!processRequest) {
continue;
}
const incomingRequest: IncomingMonitorRequest = {
monitorId: monitor.id!,
requestHeaders: undefined,
requestBody: undefined,
requestMethod: undefined,
incomingRequestReceivedAt:
monitor.incomingRequestReceivedAt || monitor.createdAt!,
onlyCheckForIncomingRequestReceivedAt: true,
};
await ProbeMonitorResponseService.processProbeResponse(incomingRequest);
}
},
);

View File

@@ -1,3 +1,4 @@
import { PlanType } from "Common/Types/Billing/SubscriptionPlan";
import RunCron from "../../Utils/Cron";
import LIMIT_MAX from "Common/Types/Database/LimitMax";
import Sleep from "Common/Types/Sleep";
@@ -45,6 +46,16 @@ RunCron(
for (const project of projects) {
try {
if (project.id) {
const plan: {
plan: PlanType | null;
isSubscriptionUnpaid: boolean;
} = await ProjectService.getCurrentPlan(project.id);
if (plan.isSubscriptionUnpaid) {
// ignore and report when subscription is active.
continue;
}
await LogDataIngestMeteredPlan.reportQuantityToBillingProvider(
project.id,
);

View File

@@ -86,33 +86,37 @@ RunCron(
continue;
}
const vars: Dictionary<string> = {
monitorName: monitor.name!,
projectName: monitorStatusTimeline.project!.name!,
currentStatus: monitorStatus!.name!,
monitorDescription: await Markdown.convertToHTML(
monitor.description! || "",
MarkdownContentType.Email,
),
statusChangedAt:
OneUptimeDate.getDateAsFormattedHTMLInMultipleTimezones(
monitorStatusTimeline.createdAt!,
),
monitorViewLink: (
await MonitorService.getMonitorLinkInDashboard(
monitorStatusTimeline.projectId!,
monitor.id!,
)
).toString(),
rootCause:
monitorStatusTimeline.rootCause || "No root cause identified.",
};
if (doesResourceHasOwners === true) {
vars["isOwner"] = "true";
}
for (const user of owners) {
const vars: Dictionary<string> = {
monitorName: monitor.name!,
projectName: monitorStatusTimeline.project!.name!,
currentStatus: monitorStatus!.name!,
monitorDescription: await Markdown.convertToHTML(
monitor.description! || "",
MarkdownContentType.Email,
),
statusChangedAt:
OneUptimeDate.getDateAsFormattedHTMLInMultipleTimezones({
date: monitorStatusTimeline.createdAt!,
timezones: user.timezone ? [user.timezone] : [],
}),
monitorViewLink: (
await MonitorService.getMonitorLinkInDashboard(
monitorStatusTimeline.projectId!,
monitor.id!,
)
).toString(),
rootCause:
(await Markdown.convertToHTML(
monitorStatusTimeline.rootCause || "",
MarkdownContentType.Email,
)) || "",
};
if (doesResourceHasOwners === true) {
vars["isOwner"] = "true";
}
const emailMessage: EmailEnvelope = {
templateType: EmailTemplateType.MonitorOwnerStatusChanged,
vars: vars,

View File

@@ -1,6 +1,6 @@
import RunCron from "../../Utils/Cron";
import SubscriptionPlan, {
PlanSelect,
PlanType,
} from "Common/Types/Billing/SubscriptionPlan";
import LIMIT_MAX from "Common/Types/Database/LimitMax";
import { EVERY_WEEK } from "Common/Utils/CronTime";
@@ -39,7 +39,7 @@ RunCron(
try {
if (project.paymentProviderPlanId) {
// get subscription detail.
const planName: PlanSelect = SubscriptionPlan.getPlanSelect(
const planName: PlanType = SubscriptionPlan.getPlanType(
project.paymentProviderPlanId as string,
);

View File

@@ -0,0 +1,190 @@
import RunCron from "../../Utils/Cron";
import { CallRequestMessage } from "Common/Types/Call/CallRequest";
import LIMIT_MAX from "Common/Types/Database/LimitMax";
import Dictionary from "Common/Types/Dictionary";
import { EmailEnvelope } from "Common/Types/Email/EmailMessage";
import EmailTemplateType from "Common/Types/Email/EmailTemplateType";
import NotificationSettingEventType from "Common/Types/NotificationSetting/NotificationSettingEventType";
import ObjectID from "Common/Types/ObjectID";
import { SMSMessage } from "Common/Types/SMS/SMS";
import { EVERY_MINUTE } from "Common/Utils/CronTime";
import ProbeOwnerTeamService from "CommonServer/Services/ProbeOwnerTeamService";
import ProbeOwnerUserService from "CommonServer/Services/ProbeOwnerUserService";
import TeamMemberService from "CommonServer/Services/TeamMemberService";
import UserNotificationSettingService from "CommonServer/Services/UserNotificationSettingService";
import ProbeOwnerTeam from "Model/Models/ProbeOwnerTeam";
import ProbeOwnerUser from "Model/Models/ProbeOwnerUser";
import User from "Model/Models/User";
import Probe from "Model/Models/Probe";
import ProbeService from "CommonServer/Services/ProbeService";
RunCron(
"ProbeOwner:SendOwnerAddedEmail",
{ schedule: EVERY_MINUTE, runOnStartup: false },
async () => {
const probeOwnerTeams: Array<ProbeOwnerTeam> =
await ProbeOwnerTeamService.findBy({
query: {
isOwnerNotified: false,
},
props: {
isRoot: true,
},
limit: LIMIT_MAX,
skip: 0,
select: {
_id: true,
probeId: true,
teamId: true,
},
});
const probeOwnersMap: Dictionary<Array<User>> = {};
for (const probeOwnerTeam of probeOwnerTeams) {
const probeId: ObjectID = probeOwnerTeam.probeId!;
const teamId: ObjectID = probeOwnerTeam.teamId!;
const users: Array<User> = await TeamMemberService.getUsersInTeams([
teamId,
]);
if (probeOwnersMap[probeId.toString()] === undefined) {
probeOwnersMap[probeId.toString()] = [];
}
for (const user of users) {
(probeOwnersMap[probeId.toString()] as Array<User>).push(user);
}
// mark this as notified.
await ProbeOwnerTeamService.updateOneById({
id: probeOwnerTeam.id!,
data: {
isOwnerNotified: true,
},
props: {
isRoot: true,
},
});
}
const probeOwnerUsers: Array<ProbeOwnerUser> =
await ProbeOwnerUserService.findBy({
query: {
isOwnerNotified: false,
},
props: {
isRoot: true,
},
limit: LIMIT_MAX,
skip: 0,
select: {
_id: true,
probeId: true,
userId: true,
user: {
email: true,
name: true,
},
},
});
for (const probeOwnerUser of probeOwnerUsers) {
const probeId: ObjectID = probeOwnerUser.probeId!;
const user: User = probeOwnerUser.user!;
if (probeOwnersMap[probeId.toString()] === undefined) {
probeOwnersMap[probeId.toString()] = [];
}
(probeOwnersMap[probeId.toString()] as Array<User>).push(user);
// mark this as notified.
await ProbeOwnerUserService.updateOneById({
id: probeOwnerUser.id!,
data: {
isOwnerNotified: true,
},
props: {
isRoot: true,
},
});
}
// send email to all of these users.
for (const probeId in probeOwnersMap) {
if (!probeOwnersMap[probeId]) {
continue;
}
if ((probeOwnersMap[probeId] as Array<User>).length === 0) {
continue;
}
const users: Array<User> = probeOwnersMap[probeId] as Array<User>;
// get all scheduled events of all the projects.
const probe: Probe | null = await ProbeService.findOneById({
id: new ObjectID(probeId),
props: {
isRoot: true,
},
select: {
_id: true,
name: true,
description: true,
projectId: true,
project: {
name: true,
},
},
});
if (!probe) {
continue;
}
const vars: Dictionary<string> = {
probeName: probe.name!,
probeDescription: probe.description || "No description provided",
projectName: probe.project!.name!,
viewProbeLink: (
await ProbeService.getLinkInDashboard(probe.projectId!, probe.id!)
).toString(),
};
for (const user of users) {
const emailMessage: EmailEnvelope = {
templateType: EmailTemplateType.ProbeOwnerAdded,
vars: vars,
subject: "[Probe] Owner of " + probe.name,
};
const sms: SMSMessage = {
message: `This is a message from OneUptime. You have been added as the owner of the probe: ${probe.name!}. To unsubscribe from this notification go to User Settings in OneUptime Dashboard.`,
};
const callMessage: CallRequestMessage = {
data: [
{
sayMessage: `This is a message from OneUptime. You have been added as the owner of the probe: ${probe.name!}. To unsubscribe from this notification go to User Settings in OneUptime Dashboard. Good bye.`,
},
],
};
await UserNotificationSettingService.sendUserNotification({
userId: user.id!,
projectId: probe.projectId!,
emailEnvelope: emailMessage,
smsMessage: sms,
callRequestMessage: callMessage,
eventType:
NotificationSettingEventType.SEND_PROBE_OWNER_ADDED_NOTIFICATION,
});
}
}
},
);

View File

@@ -0,0 +1,94 @@
import OneUptimeDate from "Common/Types/Date";
import RunCron from "../../Utils/Cron";
import LIMIT_MAX from "Common/Types/Database/LimitMax";
import { EVERY_MINUTE } from "Common/Utils/CronTime";
import ProbeService from "CommonServer/Services/ProbeService";
import logger from "CommonServer/Utils/Logger";
import Probe, { ProbeConnectionStatus } from "Model/Models/Probe";
RunCron(
"Probe:UpdateConnectionStatus",
{ schedule: EVERY_MINUTE, runOnStartup: false },
async () => {
logger.debug("Checking Probe:UpdateConnectionStatus");
const probes: Array<Probe> = await ProbeService.findBy({
query: {},
props: {
isRoot: true,
},
select: {
_id: true,
lastAlive: true,
connectionStatus: true,
projectId: true,
},
limit: LIMIT_MAX,
skip: 0,
});
logger.debug(`Found ${probes.length} incoming request monitors`);
logger.debug(probes);
for (const probe of probes) {
try {
// if the lastAlive is more than 2 minutes old, then set the connection status to false
if (!probe.id) {
continue;
}
let connectionStatus: ProbeConnectionStatus =
ProbeConnectionStatus.Connected;
if (!probe.lastAlive) {
connectionStatus = ProbeConnectionStatus.Disconnected;
}
if (
probe.lastAlive &&
OneUptimeDate.getDifferenceInMinutes(
OneUptimeDate.getCurrentDate(),
probe.lastAlive,
) > 2
) {
connectionStatus = ProbeConnectionStatus.Disconnected;
} else {
connectionStatus = ProbeConnectionStatus.Connected;
}
if (!probe.lastAlive) {
connectionStatus = ProbeConnectionStatus.Disconnected;
}
let shouldUpdateConnectionStatus: boolean = false;
if (probe.connectionStatus !== connectionStatus) {
shouldUpdateConnectionStatus = true;
}
if (!shouldUpdateConnectionStatus) {
continue; // no need to update the connection status.
}
// now update the connection status
probe.connectionStatus = connectionStatus;
if (shouldUpdateConnectionStatus) {
await ProbeService.updateOneById({
id: probe.id!,
data: {
connectionStatus: connectionStatus,
},
props: {
isRoot: true,
},
});
}
} catch (error) {
logger.error(error);
}
}
},
);

View File

@@ -235,9 +235,10 @@ RunCron(
: "false",
resourcesAffected: resourcesAffected,
scheduledAt:
OneUptimeDate.getDateAsFormattedHTMLInMultipleTimezones(
event.startsAt!,
),
OneUptimeDate.getDateAsFormattedHTMLInMultipleTimezones({
date: event.startsAt!,
timezones: statuspage.subscriberTimezones || [],
}),
eventTitle: event.title || "",
eventDescription: await Markdown.convertToHTML(
event.description || "",

View File

@@ -38,6 +38,7 @@ RunCron(
select: {
_id: true,
createdAt: true,
startsAt: true,
projectId: true,
project: {
name: true,
@@ -90,30 +91,32 @@ RunCron(
continue;
}
const vars: Dictionary<string> = {
scheduledMaintenanceTitle: scheduledMaintenance.title!,
projectName: scheduledMaintenanceStateTimeline.project!.name!,
currentState: scheduledMaintenanceState!.name!,
scheduledMaintenanceDescription: await Markdown.convertToHTML(
scheduledMaintenance.description! || "",
MarkdownContentType.Email,
),
stateChangedAt: OneUptimeDate.getDateAsFormattedHTMLInMultipleTimezones(
scheduledMaintenanceStateTimeline.createdAt!,
),
scheduledMaintenanceViewLink: (
await ScheduledMaintenanceService.getScheduledMaintenanceLinkInDashboard(
scheduledMaintenanceStateTimeline.projectId!,
scheduledMaintenance.id!,
)
).toString(),
};
if (doesResourceHasOwners === true) {
vars["isOwner"] = "true";
}
for (const user of owners) {
const vars: Dictionary<string> = {
scheduledMaintenanceTitle: scheduledMaintenance.title!,
projectName: scheduledMaintenanceStateTimeline.project!.name!,
currentState: scheduledMaintenanceState!.name!,
scheduledMaintenanceDescription: await Markdown.convertToHTML(
scheduledMaintenance.description! || "",
MarkdownContentType.Email,
),
stateChangedAt:
OneUptimeDate.getDateAsFormattedHTMLInMultipleTimezones({
date: scheduledMaintenanceStateTimeline.startsAt!,
timezones: user.timezone ? [user.timezone] : [],
}),
scheduledMaintenanceViewLink: (
await ScheduledMaintenanceService.getScheduledMaintenanceLinkInDashboard(
scheduledMaintenanceStateTimeline.projectId!,
scheduledMaintenance.id!,
)
).toString(),
};
if (doesResourceHasOwners === true) {
vars["isOwner"] = "true";
}
const emailMessage: EmailEnvelope = {
templateType: EmailTemplateType.ScheduledMaintenanceOwnerStateChanged,
vars: vars,

View File

@@ -7,6 +7,7 @@ import ServerMonitorResponse from "Common/Types/Monitor/ServerMonitor/ServerMoni
import { EVERY_MINUTE } from "Common/Utils/CronTime";
import MonitorService from "CommonServer/Services/MonitorService";
import QueryHelper from "CommonServer/Types/Database/QueryHelper";
import logger from "CommonServer/Utils/Logger";
import ProbeMonitorResponseService from "CommonServer/Utils/Probe/ProbeMonitorResponse";
import Monitor from "Model/Models/Monitor";
@@ -36,26 +37,34 @@ RunCron(
});
for (const monitor of serverMonitors) {
if (!monitor.monitorSteps) {
continue;
try {
if (!monitor.monitorSteps) {
continue;
}
const processRequest: boolean = shouldProcessRequest(monitor);
if (!processRequest) {
continue;
}
const serverMonitorResponse: ServerMonitorResponse = {
monitorId: monitor.id!,
onlyCheckRequestReceivedAt: true,
requestReceivedAt:
monitor.serverMonitorRequestReceivedAt || monitor.createdAt!,
hostname: "",
};
await ProbeMonitorResponseService.processProbeResponse(
serverMonitorResponse,
);
} catch (error) {
logger.error(
`Error in ServerMonitor:CheckOnlineStatus for monitorId: ${monitor.id}`,
);
logger.error(error);
}
const processRequest: boolean = shouldProcessRequest(monitor);
if (!processRequest) {
continue;
}
const serverMonitorResponse: ServerMonitorResponse = {
monitorId: monitor.id!,
onlyCheckRequestReceivedAt: true,
requestReceivedAt:
monitor.serverMonitorRequestReceivedAt || monitor.createdAt!,
};
await ProbeMonitorResponseService.processProbeResponse(
serverMonitorResponse,
);
}
},
);

View File

@@ -49,3 +49,15 @@ RunCron(
await StatusPageDomainService.verifyCnameWhoseCnameisNotVerified();
},
);
RunCron(
"StatusPageCerts:CheckOrderStatus",
{
schedule: IsDevelopment ? EVERY_FIFTEEN_MINUTE : EVERY_FIFTEEN_MINUTE,
runOnStartup: true,
},
async () => {
// checks if the certificate exists for the domains that have ordered certificates, otherwise orders again,
await StatusPageDomainService.checkOrderStatus();
},
);

View File

@@ -1,4 +1,4 @@
import { PlanSelect } from "Common/Types/Billing/SubscriptionPlan";
import { PlanType } from "Common/Types/Billing/SubscriptionPlan";
import OneUptimeDate from "Common/Types/Date";
import BadDataException from "Common/Types/Exception/BadDataException";
import ObjectID from "Common/Types/ObjectID";
@@ -88,7 +88,7 @@ export default class QueueWorkflow {
//check project and plan
const projectPlan: {
plan: PlanSelect | null;
plan: PlanType | null;
isSubscriptionUnpaid: boolean;
} = await ProjectService.getCurrentPlan(workflow.projectId);

View File

@@ -10,7 +10,7 @@ import ColumnBillingAccessControl from "../Types/BaseDatabase/ColumnBillingAcces
import EnableWorkflowOn from "../Types/BaseDatabase/EnableWorkflowOn";
import ModelPermission from "../Types/BaseDatabase/ModelPermission";
import TableBillingAccessControl from "../Types/BaseDatabase/TableBillingAccessControl";
import { PlanSelect } from "../Types/Billing/SubscriptionPlan";
import { PlanType } from "../Types/Billing/SubscriptionPlan";
import Dictionary from "../Types/Dictionary";
import BadDataException from "../Types/Exception/BadDataException";
import { JSONValue } from "../Types/JSON";
@@ -358,19 +358,19 @@ export default class AnalyticsBaseModel extends CommonModel {
return this.accessControl?.delete || [];
}
public getReadBillingPlan(): PlanSelect | null {
public getReadBillingPlan(): PlanType | null {
return this.tableBillingAccessControl?.read || null;
}
public getCreateBillingPlan(): PlanSelect | null {
public getCreateBillingPlan(): PlanType | null {
return this.tableBillingAccessControl?.create || null;
}
public getUpdateBillingPlan(): PlanSelect | null {
public getUpdateBillingPlan(): PlanType | null {
return this.tableBillingAccessControl?.update || null;
}
public getDeleteBillingPlan(): PlanSelect | null {
public getDeleteBillingPlan(): PlanType | null {
return this.tableBillingAccessControl?.delete || null;
}

View File

@@ -3,7 +3,7 @@ import { ColumnAccessControl } from "../Types/BaseDatabase/AccessControl";
import ColumnBillingAccessControl from "../Types/BaseDatabase/ColumnBillingAccessControl";
import EnableWorkflowOn from "../Types/BaseDatabase/EnableWorkflowOn";
import ModelPermission from "../Types/BaseDatabase/ModelPermission";
import { PlanSelect } from "../Types/Billing/SubscriptionPlan";
import { PlanType } from "../Types/Billing/SubscriptionPlan";
import { getColumnAccessControlForAllColumns } from "../Types/Database/AccessControl/ColumnAccessControl";
import { getColumnBillingAccessControlForAllColumns } from "../Types/Database/AccessControl/ColumnBillingAccessControl";
import Columns from "../Types/Database/Columns";
@@ -96,10 +96,10 @@ export default class BaseModel extends BaseEntity {
public updateRecordPermissions!: Array<Permission>;
// Billing Plans.
public createBillingPlan!: PlanSelect | null;
public readBillingPlan!: PlanSelect | null;
public updateBillingPlan!: PlanSelect | null;
public deleteBillingPlan!: PlanSelect | null;
public createBillingPlan!: PlanType | null;
public readBillingPlan!: PlanType | null;
public updateBillingPlan!: PlanType | null;
public deleteBillingPlan!: PlanType | null;
public allowAccessIfSubscriptionIsUnpaid!: boolean;
@@ -465,19 +465,19 @@ export default class BaseModel extends BaseEntity {
return this.readRecordPermissions;
}
public getReadBillingPlan(): PlanSelect | null {
public getReadBillingPlan(): PlanType | null {
return this.readBillingPlan;
}
public getCreateBillingPlan(): PlanSelect | null {
public getCreateBillingPlan(): PlanType | null {
return this.createBillingPlan;
}
public getUpdateBillingPlan(): PlanSelect | null {
public getUpdateBillingPlan(): PlanType | null {
return this.updateBillingPlan;
}
public getDeleteBillingPlan(): PlanSelect | null {
public getDeleteBillingPlan(): PlanType | null {
return this.deleteBillingPlan;
}

9
Common/Tests/MockType.ts Normal file
View File

@@ -0,0 +1,9 @@
export type MockFunction = jest.Mock<any, any>;
type GetJestMockFunction = () => MockFunction;
const getJestMockFunction: GetJestMockFunction = (): MockFunction => {
return jest.fn() as MockFunction;
};
export default getJestMockFunction;

11
Common/Tests/Spy.ts Normal file
View File

@@ -0,0 +1,11 @@
type GetJestSpyOnFunction = (
obj: any,
method: string,
) => jest.SpyInstance<any, any>;
export const getJestSpyOn: GetJestSpyOnFunction = (
obj: any,
method: string,
): jest.SpyInstance<any, any> => {
return jest.spyOn(obj, method) as jest.SpyInstance<any, any>;
};

View File

@@ -1,5 +1,5 @@
import SubscriptionPlan, {
PlanSelect,
PlanType,
} from "../../../Types/Billing/SubscriptionPlan";
import BadDataException from "../../../Types/Exception/BadDataException";
import { JSONObject } from "../../../Types/JSON";
@@ -118,29 +118,26 @@ describe("SubscriptionPlan", () => {
expect(isValidPlanId).toBe(true);
});
});
describe("getPlanSelect", () => {
describe("getPlanType", () => {
it("should return the plan name if valid planId is passed", () => {
new SubscriptionPlan(
monthlyPlanId,
"yearly_plan_id",
PlanSelect.Free,
PlanType.Free,
0,
0,
2,
30,
);
const result: PlanSelect = SubscriptionPlan.getPlanSelect(
monthlyPlanId,
env,
);
expect(result).toBe(PlanSelect.Free);
const result: PlanType = SubscriptionPlan.getPlanType(monthlyPlanId, env);
expect(result).toBe(PlanType.Free);
});
it("should throw an error if invalid PlanId is passed", () => {
SubscriptionPlan.getSubscriptionPlanById = jest
.fn()
.mockReturnValue(undefined);
expect(() => {
SubscriptionPlan.getPlanSelect("invalid-plan-id", env);
SubscriptionPlan.getPlanType("invalid-plan-id", env);
}).toThrow(BadDataException);
});
});
@@ -170,7 +167,7 @@ describe("SubscriptionPlan", () => {
const featureSubscriptionPlan: SubscriptionPlan = new SubscriptionPlan(
"growth_monthly_plan_id",
"growth_yearly_plan_id",
PlanSelect.Growth,
PlanType.Growth,
9,
99,
2,
@@ -179,15 +176,15 @@ describe("SubscriptionPlan", () => {
const currentSubscriptionPlan: SubscriptionPlan = new SubscriptionPlan(
"monthly_plan_id",
"yearly_plan_id",
PlanSelect.Free,
PlanType.Free,
0,
0,
1,
7,
);
const result: boolean = SubscriptionPlan.isFeatureAccessibleOnCurrentPlan(
PlanSelect.Growth,
PlanSelect.Free,
PlanType.Growth,
PlanType.Free,
env,
);
expect(featureSubscriptionPlan.getPlanOrder()).toBeGreaterThan(
@@ -204,7 +201,7 @@ describe("SubscriptionPlan", () => {
const featureSubscriptionPlan: SubscriptionPlan = new SubscriptionPlan(
"growth_monthly_plan_id",
"growth_yearly_plan_id",
PlanSelect.Growth,
PlanType.Growth,
9,
99,
2,
@@ -213,15 +210,15 @@ describe("SubscriptionPlan", () => {
const currentSubscriptionPlan: SubscriptionPlan = new SubscriptionPlan(
monthlyPlanId,
"yearly_plan_id",
PlanSelect.Free,
PlanType.Free,
0,
0,
3,
7,
);
const result: boolean = SubscriptionPlan.isFeatureAccessibleOnCurrentPlan(
PlanSelect.Growth,
PlanSelect.Free,
PlanType.Growth,
PlanType.Free,
env,
);
expect(featureSubscriptionPlan.getPlanOrder()).toBeLessThan(
@@ -234,14 +231,14 @@ describe("SubscriptionPlan", () => {
it("should return the correct SubscriptionPlan when a valid planSelect is provided", () => {
const plan: SubscriptionPlan =
SubscriptionPlan.getSubscriptionPlanFromPlanSelect(
PlanSelect.Growth,
PlanType.Growth,
env,
);
expect(plan).toEqual(plan);
expect(plan.getName()).toEqual(PlanSelect.Growth);
expect(plan.getName()).toEqual(PlanType.Growth);
});
it("should throw a BadDataException when an invalid planSelect is provided", () => {
const planSelect: PlanSelect = PlanSelect.Scale;
const planSelect: PlanType = PlanType.Scale;
SubscriptionPlan.getSubscriptionPlans = jest.fn().mockReturnValue([]);
expect(() => {
SubscriptionPlan.getSubscriptionPlanFromPlanSelect(planSelect, env);

View File

@@ -7,6 +7,27 @@ export default class ArrayUtil {
});
}
public static shuffle<T>(array: Array<T>): Array<T> {
const shuffledArray: Array<T> = [...array];
for (let i: number = shuffledArray.length - 1; i > 0; i--) {
const j: number = Math.floor(Math.random() * (i + 1));
if (!shuffledArray[i]) {
continue;
}
if (!shuffledArray[j]) {
continue;
}
[shuffledArray[i] as any, shuffledArray[j] as any] = [
shuffledArray[j],
shuffledArray[i],
];
}
return shuffledArray;
}
public static removeDuplicatesFromObjectIDArray(
array: Array<ObjectID>,
): Array<ObjectID> {

View File

@@ -1,7 +1,7 @@
import { PlanSelect } from "../Billing/SubscriptionPlan";
import { PlanType } from "../Billing/SubscriptionPlan";
export default interface ColumnBillingAccessControl {
create: PlanSelect;
read: PlanSelect;
update: PlanSelect;
create: PlanType;
read: PlanType;
update: PlanType;
}

View File

@@ -1,4 +1,4 @@
import { PlanSelect } from "../Billing/SubscriptionPlan";
import { PlanType } from "../Billing/SubscriptionPlan";
import Dictionary from "../Dictionary";
import ObjectID from "../ObjectID";
import {
@@ -18,7 +18,7 @@ export default interface DatabaseCommonInteractionProps {
isRoot?: boolean | undefined;
isMultiTenantRequest?: boolean | undefined;
ignoreHooks?: boolean | undefined;
currentPlan?: PlanSelect | undefined;
currentPlan?: PlanType | undefined;
isSubscriptionUnpaid?: boolean | undefined;
isMasterAdmin?: boolean | undefined;
}

View File

@@ -1,8 +1,8 @@
import { PlanSelect } from "../Billing/SubscriptionPlan";
import { PlanType } from "../Billing/SubscriptionPlan";
export default interface TableBillingAccessControl {
create: PlanSelect;
read: PlanSelect;
update: PlanSelect;
delete: PlanSelect;
create: PlanType;
read: PlanType;
update: PlanType;
delete: PlanType;
}

View File

@@ -1,7 +1,7 @@
import BadDataException from "../Exception/BadDataException";
import { JSONObject } from "../JSON";
export enum PlanSelect {
export enum PlanType {
Free = "Free",
Growth = "Growth",
Enterprise = "Enterprise",
@@ -157,10 +157,10 @@ export default class SubscriptionPlan {
return Boolean(this.getSubscriptionPlanById(planId, env));
}
public static getPlanSelect(
public static getPlanType(
planId: string,
env?: JSONObject | undefined,
): PlanSelect {
): PlanType {
const plan: SubscriptionPlan | undefined = this.getSubscriptionPlanById(
planId,
env,
@@ -169,11 +169,11 @@ export default class SubscriptionPlan {
throw new BadDataException("Plan ID is invalid");
}
return plan.getName() as PlanSelect;
return plan.getName() as PlanType;
}
public static getSubscriptionPlanFromPlanSelect(
planSelect: PlanSelect,
planSelect: PlanType,
env?: JSONObject | undefined,
): SubscriptionPlan {
const plan: SubscriptionPlan | undefined = this.getSubscriptionPlans(
@@ -190,8 +190,8 @@ export default class SubscriptionPlan {
}
public static isFeatureAccessibleOnCurrentPlan(
featurePlan: PlanSelect,
currentPlan: PlanSelect,
featurePlan: PlanType,
currentPlan: PlanType,
env?: JSONObject | undefined,
): boolean {
const featureSubscriptionPlan: SubscriptionPlan | undefined =

View File

@@ -0,0 +1,11 @@
enum CookieName {
UserID = "user-id",
Email = "user-email",
Token = "user-token",
Name = "user-name",
Timezone = "user-timezone",
IsMasterAdmin = "user-is-master-admin",
ProfilePicID = "user-profile-pic-id",
}
export default CookieName;

View File

@@ -1,6 +1,6 @@
enum CopilotEventStatus {
enum CopilotActionStatus {
PR_CREATED = "Pull Request Created", // PR created and waiting for review
NO_ACTION_REQUIRED = "No Action Required", // No PR needed. All is good.
}
export default CopilotEventStatus;
export default CopilotActionStatus;

View File

@@ -0,0 +1,10 @@
enum CopilotActionType {
IMPROVE_COMMENTS = "Improve Comments",
IMRPOVE_README = "Improve Readme",
FIX_GRAMMAR_AND_SPELLING = "Fix Grammar and Spelling",
IMPROVE_VARIABLE_NAMES = "Improve Variable Names",
REFACTOR_CODE = "Refactor Code",
WRITE_UNIT_TESTS = "Write Unit Tests",
}
export default CopilotActionType;

View File

@@ -1,6 +0,0 @@
enum CopilotEventType {
IMPROVE_COMMENTS = "IMPROVE_COMMENTS",
FIX_GRAMMAR_AND_SPELLING = "FIX_GRAMMAR_AND_SPELLING",
}
export default CopilotEventType;

View File

@@ -4,6 +4,7 @@ import BadDataException from "./Exception/BadDataException";
import { JSONObject, ObjectType } from "./JSON";
import PositiveNumber from "./PositiveNumber";
import moment from "moment-timezone";
import Timezone from "./Timezone";
export const Moment: typeof moment = moment;
@@ -868,10 +869,48 @@ export default class OneUptimeDate {
return formattedString;
}
public static getDateAsFormattedArrayInMultipleTimezones(
date: string | Date,
onlyShowDate?: boolean,
): Array<string> {
public static getGmtOffsetByTimezone(timezone: Timezone): number {
return moment.tz(timezone).utcOffset();
}
public static getGmtOffsetFriendlyStringByTimezone(
timezone: Timezone,
): string {
const offset: number = this.getGmtOffsetByTimezone(timezone);
return this.getGmtOffsetFriendlyString(offset) + " " + timezone;
}
public static getGmtOffsetFriendlyString(offset: number): string {
const hours: number = Math.abs(offset) / 60;
const minutes: number = Math.abs(offset) % 60;
let formattedString: string = "GMT";
if (offset < 0) {
formattedString += "-";
} else {
formattedString += "+";
}
// remove decimals from hours
formattedString += Math.floor(hours);
if (minutes > 0) {
formattedString += ":" + minutes;
}
return formattedString;
}
public static getDateAsFormattedArrayInMultipleTimezones(data: {
date: string | Date;
onlyShowDate?: boolean | undefined;
timezones?: Array<Timezone> | undefined;
}): Array<string> {
let date: string | Date = data.date;
const onlyShowDate: boolean | undefined = data.onlyShowDate;
let timezones: Array<Timezone> | undefined = data.timezones;
date = this.fromString(date);
let formatstring: string = "MMM DD YYYY, HH:mm";
@@ -883,53 +922,61 @@ export default class OneUptimeDate {
// convert this date into GMT, EST, PST, IST, ACT with moment
const timezoneDates: Array<string> = [];
timezoneDates.push(
moment(date).tz("UTC").format(formatstring) +
" " +
(onlyShowDate ? "" : "GMT"),
);
timezoneDates.push(
moment(date).tz("America/New_York").format(formatstring) +
" " +
(onlyShowDate ? "" : "EST"),
);
timezoneDates.push(
moment(date).tz("America/Los_Angeles").format(formatstring) +
" " +
(onlyShowDate ? "" : "PST"),
);
timezoneDates.push(
moment(date).tz("Asia/Kolkata").format(formatstring) +
" " +
(onlyShowDate ? "" : "IST"),
);
timezoneDates.push(
moment(date).tz("Australia/Sydney").format(formatstring) +
" " +
(onlyShowDate ? "" : "AEST"),
);
if (!timezones || timezones.length === 0) {
timezones = [
Timezone.UTC,
Timezone.EST,
Timezone.AmericaLos_Angeles,
Timezone.AsiaKolkata,
Timezone.AustraliaSydney,
]; // default timezones.
}
for (let i: number = 0; i < timezones.length; i++) {
timezoneDates.push(
moment(date)
.tz(timezones[i] as string)
.format(formatstring) +
" " +
(onlyShowDate
? ""
: this.getZoneAbbrByTimezone(timezones[i] as Timezone)),
);
}
return timezoneDates;
}
public static getDateAsFormattedHTMLInMultipleTimezones(
date: string | Date,
onlyShowDate?: boolean,
): string {
return this.getDateAsFormattedArrayInMultipleTimezones(
public static getDateAsFormattedHTMLInMultipleTimezones(data: {
date: string | Date;
onlyShowDate?: boolean;
timezones?: Array<Timezone> | undefined; // if this is skipped, then it will show the default timezones in the order of UTC, EST, PST, IST, ACT
}): string {
const date: string | Date = data.date;
const onlyShowDate: boolean | undefined = data.onlyShowDate;
const timezones: Array<Timezone> | undefined = data.timezones;
return this.getDateAsFormattedArrayInMultipleTimezones({
date,
onlyShowDate,
).join("<br/>");
timezones,
}).join("<br/>");
}
public static getDateAsFormattedStringInMultipleTimezones(
date: string | Date,
onlyShowDate?: boolean,
): string {
return this.getDateAsFormattedArrayInMultipleTimezones(
public static getDateAsFormattedStringInMultipleTimezones(data: {
date: string | Date;
onlyShowDate?: boolean | undefined;
timezones?: Array<Timezone> | undefined; // if this is skipped, then it will show the default timezones in the order of UTC, EST, PST, IST, ACT
}): string {
const date: string | Date = data.date;
const onlyShowDate: boolean | undefined = data.onlyShowDate;
const timezones: Array<Timezone> | undefined = data.timezones;
return this.getDateAsFormattedArrayInMultipleTimezones({
date,
onlyShowDate,
).join("\n");
timezones,
}).join("\n");
}
public static getDateAsLocalFormattedString(
@@ -961,7 +1008,21 @@ export default class OneUptimeDate {
}
public static getCurrentTimezoneString(): string {
return moment.tz(moment.tz.guess()).zoneAbbr();
return this.getZoneAbbrByTimezone(this.getCurrentTimezone());
}
public static getZoneAbbrByTimezone(timezone: Timezone): string {
let zoneAbbr: string = moment.tz(timezone).zoneAbbr();
if (zoneAbbr.startsWith("+") || zoneAbbr.startsWith("-")) {
zoneAbbr = "GMT" + zoneAbbr;
}
return zoneAbbr;
}
public static getCurrentTimezone(): Timezone {
return moment.tz.guess() as Timezone;
}
public static getDateString(date: Date): string {
@@ -998,7 +1059,7 @@ export default class OneUptimeDate {
return moment(date["value"]).toDate();
}
throw new BadDataException("Invalid date");
throw new BadDataException("Invalid date: " + date.toString());
}
public static asDateForDatabaseQuery(date: string | Date): string {

View File

@@ -26,7 +26,7 @@ export default class Domain extends DatabaseProperty {
"|",
);
const secondTLDs: Array<string> =
"ac|academy|accountant|accountants|actor|adult|ag|agency|ai|airforce|am|amsterdam|apartments|app|archi|army|art|asia|associates|at|attorney|au|auction|auto|autos|baby|band|bar|barcelona|bargains|basketball|bayern|be|beauty|beer|berlin|best|bet|bid|bike|bingo|bio|biz|biz.pl|black|blog|blue|boats|boston|boutique|broker|build|builders|business|buzz|bz|ca|cab|cafe|camera|camp|capital|car|cards|care|careers|cars|casa|cash|casino|catering|cc|center|ceo|ch|charity|chat|cheap|church|city|cl|claims|cleaning|clinic|clothing|cloud|club|cn|co|co.in|co.jp|co.kr|co.nz|co.uk|co.za|coach|codes|coffee|college|com|com.ag|com.au|com.br|com.bz|com.cn|com.co|com.es|com.ky|com.mx|com.pe|com.ph|com.pl|com.ru|com.tw|community|company|computer|condos|construction|consulting|contact|contractors|cooking|cool|country|coupons|courses|credit|creditcard|cricket|cruises|cymru|cz|dance|date|dating|de|deals|degree|delivery|democrat|dental|dentist|design|dev|diamonds|digital|direct|directory|discount|dk|doctor|dog|domains|download|earth|education|email|energy|engineer|engineering|enterprises|equipment|es|estate|eu|events|exchange|expert|exposed|express|fail|faith|family|fan|fans|farm|fashion|film|finance|financial|firm.in|fish|fishing|fit|fitness|flights|florist|fm|football|forsale|foundation|fr|fun|fund|furniture|futbol|fyi|gallery|games|garden|gay|gen.in|gg|gifts|gives|giving|glass|global|gmbh|gold|golf|graphics|gratis|green|gripe|group|gs|guide|guru|hair|haus|health|healthcare|hockey|holdings|holiday|homes|horse|hospital|host|house|idv.tw|immo|immobilien|in|inc|ind.in|industries|info|info.pl|ink|institute|insure|international|investments|io|irish|ist|istanbul|it|jetzt|jewelry|jobs|jp|kaufen|kids|kim|kitchen|kiwi|kr|ky|la|land|lat|law|lawyer|lease|legal|lgbt|life|lighting|limited|limo|live|llc|llp|loan|loans|london|love|ltd|ltda|luxury|maison|makeup|management|market|marketing|mba|me|me.uk|media|melbourne|memorial|men|menu|miami|mobi|moda|moe|money|monster|mortgage|motorcycles|movie|ms|music|mx|nagoya|name|navy|ne.kr|net|net.ag|net.au|net.br|net.bz|net.cn|net.co|net.in|net.ky|net.nz|net.pe|net.ph|net.pl|net.ru|network|news|ninja|nl|no|nom.co|nom.es|nom.pe|nrw|nyc|okinawa|one|onl|online|org|org.ag|org.au|org.cn|org.es|org.in|org.ky|org.nz|org.pe|org.ph|org.pl|org.ru|org.uk|organic|page|paris|partners|parts|party|pe|pet|ph|photography|photos|pictures|pink|pizza|pl|place|plumbing|plus|poker|porn|press|pro|productions|promo|properties|protection|pub|pw|quebec|quest|racing|re.kr|realestate|recipes|red|rehab|reise|reisen|rent|rentals|repair|report|republican|rest|restaurant|review|reviews|rich|rip|rocks|rodeo|rugby|run|ryukyu|sale|salon|sarl|school|schule|science|se|security|services|sex|sg|sh|shiksha|shoes|shop|shopping|show|singles|site|ski|skin|soccer|social|software|solar|solutions|space|storage|store|stream|studio|study|style|supplies|supply|support|surf|surgery|sydney|systems|tax|taxi|team|tech|technology|tel|tennis|theater|theatre|tickets|tienda|tips|tires|today|tokyo|tools|tours|town|toys|trade|trading|training|travel|tube|tv|tw|uk|university|uno|us|vacations|vc|vegas|ventures|vet|viajes|video|villas|vin|vip|vision|vodka|vote|voto|voyage|wales|watch|web|webcam|website|wedding|wiki|win|wine|work|works|world|ws|wtf|xxx|xyz|yachts|yoga|yokohama|zone|移动|dev|com|edu|gov|net|mil|org|nom|sch|sbs|caa|res|off|gob|int|tur|ip6|uri|urn|asn|act|nsw|qld|tas|vic|pro|biz|adm|adv|agr|arq|art|ato|bio|bmd|cim|cng|cnt|ecn|eco|emp|eng|esp|etc|eti|far|fnd|fot|fst|g12|ggf|imb|ind|inf|jor|jus|leg|lel|mat|med|mus|not|ntr|odo|ppg|psc|psi|qsl|rec|slg|srv|teo|tmp|trd|vet|zlg|web|ltd|sld|pol|fin|k12|lib|pri|aip|fie|eun|sci|prd|cci|pvt|mod|idv|rel|sex|gen|nic|abr|bas|cal|cam|emr|fvg|laz|lig|lom|mar|mol|pmn|pug|sar|sic|taa|tos|umb|vao|vda|ven|mie|北海道|和歌山|神奈川|鹿児島|ass|rep|tra|per|ngo|soc|grp|plc|its|air|and|bus|can|ddr|jfk|mad|nrw|nyc|ski|spy|tcm|ulm|usa|war|fhs|vgs|dep|eid|fet|fla|flå|gol|hof|hol|sel|vik|cri|iwi|ing|abo|fam|gok|gon|gop|gos|aid|atm|gsm|sos|elk|waw|est|aca|bar|cpa|jur|law|sec|plo|www|bir|cbg|jar|khv|msk|nov|nsk|ptz|rnd|spb|stv|tom|tsk|udm|vrn|cmw|kms|nkz|snz|pub|fhv|red|ens|nat|rns|rnu|bbs|tel|bel|kep|nhs|dni|fed|isa|nsn|gub|e12|tec|орг|обр|упр|alt|nis|jpn|mex|ath|iki|nid|gda|inc|za|ovh".split(
"ac|academy|accountant|accountants|actor|adult|aero|ag|agency|ai|airforce|am|amsterdam|apartments|app|archi|army|art|asia|associates|at|attorney|au|auction|auto|autos|baby|band|bar|barcelona|bargains|basketball|bayern|be|beauty|beer|berlin|best|bet|bid|bike|bingo|bio|biz|biz.pl|black|blog|blue|boats|boston|boutique|broker|build|builders|business|buzz|bz|ca|cab|cafe|camera|camp|capital|car|cards|care|careers|cars|casa|cash|casino|catering|cc|center|ceo|ch|charity|chat|cheap|church|city|cl|claims|cleaning|clinic|clothing|cloud|club|cn|co|co.in|co.jp|co.kr|co.nz|co.uk|co.za|coach|codes|coffee|college|com|com.ag|com.au|com.br|com.bz|com.cn|com.co|com.es|com.ky|com.mx|com.pe|com.ph|com.pl|com.ru|com.tw|community|company|computer|condos|construction|consulting|contact|contractors|cooking|cool|country|coupons|courses|credit|creditcard|cricket|cruises|cymru|cz|dance|date|dating|de|deals|degree|delivery|democrat|dental|dentist|design|dev|diamonds|digital|direct|directory|discount|dk|doctor|dog|domains|download|earth|education|email|energy|engineer|engineering|enterprises|equipment|es|estate|eu|events|exchange|expert|exposed|express|fail|faith|family|fan|fans|farm|fashion|film|finance|financial|firm.in|fish|fishing|fit|fitness|flights|florist|fm|football|forsale|foundation|fr|fun|fund|furniture|futbol|fyi|gallery|games|garden|gay|gen.in|gg|gifts|gives|giving|glass|global|gmbh|gold|golf|graphics|gratis|green|gripe|group|gs|guide|guru|hair|haus|health|healthcare|hockey|holdings|holiday|homes|horse|hospital|host|house|idv.tw|immo|immobilien|in|inc|ind.in|industries|info|info.pl|ink|institute|insure|international|investments|io|irish|ist|istanbul|it|jetzt|jewelry|jobs|jp|kaufen|kids|kim|kitchen|kiwi|kr|ky|la|land|lat|law|lawyer|lease|legal|lgbt|life|lighting|limited|limo|live|llc|llp|loan|loans|london|love|ltd|ltda|luxury|maison|makeup|management|market|marketing|mba|me|me.uk|media|melbourne|memorial|men|menu|miami|mobi|moda|moe|money|monster|mortgage|motorcycles|movie|ms|music|mx|nagoya|name|navy|ne.kr|net|net.ag|net.au|net.br|net.bz|net.cn|net.co|net.in|net.ky|net.nz|net.pe|net.ph|net.pl|net.ru|network|news|ninja|nl|no|nom.co|nom.es|nom.pe|nrw|nyc|okinawa|one|onl|online|org|org.ag|org.au|org.cn|org.es|org.in|org.ky|org.nz|org.pe|org.ph|org.pl|org.ru|org.uk|organic|page|paris|partners|parts|party|pe|pet|ph|photography|photos|pictures|pink|pizza|pl|place|plumbing|plus|poker|porn|press|pro|productions|promo|properties|protection|pub|pw|quebec|quest|racing|re.kr|realestate|recipes|red|rehab|reise|reisen|rent|rentals|repair|report|republican|rest|restaurant|review|reviews|rich|rip|rocks|rodeo|rugby|run|ryukyu|sale|salon|sarl|school|schule|science|se|security|services|sex|sg|sh|shiksha|shoes|shop|shopping|show|singles|site|ski|skin|soccer|social|software|solar|solutions|space|storage|store|stream|studio|study|style|supplies|supply|support|surf|surgery|sydney|systems|tax|taxi|team|tech|technology|tel|tennis|theater|theatre|tickets|tienda|tips|tires|today|tokyo|tools|tours|town|toys|trade|trading|training|travel|tube|tv|tw|uk|university|uno|us|vacations|vc|vegas|ventures|vet|viajes|video|villas|vin|vip|vision|vodka|vote|voto|voyage|wales|watch|web|webcam|website|wedding|wiki|win|wine|work|works|world|ws|wtf|xxx|xyz|yachts|yoga|yokohama|zone|移动|dev|com|edu|gov|net|mil|org|nom|sch|sbs|caa|res|off|gob|int|tur|ip6|uri|urn|asn|act|nsw|qld|tas|vic|pro|biz|adm|adv|agr|arq|art|ato|bio|bmd|cim|cng|cnt|ecn|eco|emp|eng|esp|etc|eti|far|fnd|fot|fst|g12|ggf|imb|ind|inf|jor|jus|leg|lel|mat|med|mus|not|ntr|odo|ppg|psc|psi|qsl|rec|slg|srv|teo|tmp|trd|vet|zlg|web|ltd|sld|pol|fin|k12|lib|pri|aip|fie|eun|sci|prd|cci|pvt|mod|idv|rel|sex|gen|nic|abr|bas|cal|cam|emr|fvg|laz|lig|lom|mar|mol|pmn|pug|sar|sic|taa|tos|umb|vao|vda|ven|mie|北海道|和歌山|神奈川|鹿児島|ass|rep|tra|per|ngo|soc|grp|plc|its|air|and|bus|can|ddr|jfk|mad|nrw|nyc|ski|spy|tcm|ulm|usa|war|fhs|vgs|dep|eid|fet|fla|flå|gol|hof|hol|sel|vik|cri|iwi|ing|abo|fam|gok|gon|gop|gos|aid|atm|gsm|sos|elk|waw|est|aca|bar|cpa|jur|law|sec|plo|www|bir|cbg|jar|khv|msk|nov|nsk|ptz|rnd|spb|stv|tom|tsk|udm|vrn|cmw|kms|nkz|snz|pub|fhv|red|ens|nat|rns|rnu|bbs|tel|bel|kep|nhs|dni|fed|isa|nsn|gub|e12|tec|орг|обр|упр|alt|nis|jpn|mex|ath|iki|nid|gda|inc|za|ovh".split(
"|",
);

View File

@@ -2,8 +2,10 @@ enum EmailTemplateType {
ForgotPassword = "ForgotPassword.hbs",
ProbeOffline = "ProbeOffline.hbs",
SignupWelcomeEmail = "SignupWelcomeEmail.hbs",
ProbeConnectionStatusChange = "ProbeConnectionStatusChange.hbs",
EmailVerified = "EmailVerified.hbs",
PasswordChanged = "PasswordChanged.hbs",
ProbeOwnerAdded = "ProbeOwnerAdded.hbs",
InviteMember = "InviteMember.hbs",
EmailChanged = "EmailChanged.hbs",
SubscribedToStatusPage = "SubscribedToStatusPage.hbs",
@@ -20,6 +22,7 @@ enum EmailTemplateType {
SMTPTest = "SMTPTest.hbs",
MonitorOwnerAdded = "MonitorOwnerAdded.hbs",
MonitorOwnerResourceCreated = "MonitorOwnerResourceCreated.hbs",
MonitorProbesStatus = "MonitorProbesStatus.hbs",
MonitorOwnerStatusChanged = "MonitorOwnerStatusChanged.hbs",
IncidentOwnerAdded = "IncidentOwnerAdded.hbs",
IncidentOwnerStateChanged = "IncidentOwnerStateChanged.hbs",

View File

@@ -2,7 +2,18 @@ import Exception from "./Exception";
import ExceptionCode from "./ExceptionCode";
export default class APIException extends Exception {
public constructor(message: string) {
private _error: Error | null = null;
public get error(): Error | null {
return this._error || null;
}
public set error(v: Error | null) {
this._error = v;
}
public constructor(message: string, error?: Error) {
super(ExceptionCode.APIException, message);
if (error) {
this.error = error;
}
}
}

View File

@@ -121,6 +121,8 @@ enum IconProp {
Minus = "Minus",
MinusSmall = "MinusSmall",
Template = "Template",
NoSignal = "NoSignal",
EyeSlash = "EyeSlash",
}
export default IconProp;

View File

@@ -8,6 +8,7 @@ export interface MemoryMetrics {
export interface CPUMetrics {
percentUsed: number;
cores: number;
}
export interface BasicDiskMetrics {

View File

@@ -103,13 +103,35 @@ export enum FilterCondition {
}
export class CriteriaFilterUtil {
public static getEvaluateOverTimeTypeByCriteriaFilter(
criteriaFilter: CriteriaFilter | undefined,
): Array<EvaluateOverTimeType> {
if (!criteriaFilter) {
return [];
}
if (criteriaFilter.checkOn === CheckOn.IsOnline) {
return [EvaluateOverTimeType.AllValues, EvaluateOverTimeType.AnyValue];
}
return [
EvaluateOverTimeType.Average,
EvaluateOverTimeType.Sum,
EvaluateOverTimeType.MaximumValue,
EvaluateOverTimeType.MunimumValue,
EvaluateOverTimeType.AllValues,
EvaluateOverTimeType.AnyValue,
];
}
public static isEvaluateOverTimeFilter(checkOn: CheckOn): boolean {
return (
checkOn === CheckOn.ResponseStatusCode ||
checkOn === CheckOn.ResponseTime ||
checkOn === CheckOn.DiskUsagePercent ||
checkOn === CheckOn.CPUUsagePercent ||
checkOn === CheckOn.MemoryUsagePercent
checkOn === CheckOn.MemoryUsagePercent ||
checkOn === CheckOn.IsOnline
);
}
@@ -120,15 +142,20 @@ export class CriteriaFilterUtil {
monitorType === MonitorType.API ||
monitorType === MonitorType.Website
) {
return [CheckOn.ResponseStatusCode, CheckOn.ResponseTime];
return [
CheckOn.IsOnline,
CheckOn.ResponseStatusCode,
CheckOn.ResponseTime,
];
} else if (
monitorType === MonitorType.Ping ||
monitorType === MonitorType.IP ||
monitorType === MonitorType.Port
) {
return [CheckOn.ResponseTime];
return [CheckOn.IsOnline, CheckOn.ResponseTime];
} else if (monitorType === MonitorType.Server) {
return [
CheckOn.IsOnline,
CheckOn.DiskUsagePercent,
CheckOn.CPUUsagePercent,
CheckOn.MemoryUsagePercent,

View File

@@ -5,6 +5,7 @@ export interface CriteriaIncident {
description: string;
incidentSeverityId?: ObjectID | undefined;
autoResolveIncident?: boolean | undefined;
remediationNotes?: string | undefined;
id: string;
onCallPolicyIds?: Array<ObjectID> | undefined;
}

View File

@@ -134,7 +134,7 @@ export class MonitorTypeHelper {
return monitorTypeProps[0].title;
}
public static isProbableMonitors(monitorType: MonitorType): boolean {
public static isProbableMonitor(monitorType: MonitorType): boolean {
const isProbeableMonitor: boolean =
monitorType === MonitorType.API ||
monitorType === MonitorType.Website ||
@@ -172,7 +172,7 @@ export class MonitorTypeHelper {
}
public static doesMonitorTypeHaveInterval(monitorType: MonitorType): boolean {
return this.isProbableMonitors(monitorType);
return this.isProbableMonitor(monitorType);
}
public static doesMonitorTypeHaveCriteria(monitorType: MonitorType): boolean {

View File

@@ -9,8 +9,10 @@ export interface ServerProcess {
export default interface ServerMonitorResponse {
monitorId: ObjectID;
hostname: string; // Hostname of the server
basicInfrastructureMetrics?: BasicInfrastructureMetrics | undefined;
requestReceivedAt: Date;
onlyCheckRequestReceivedAt: boolean;
processes?: ServerProcess[] | undefined;
failureCause?: string | undefined;
}

View File

@@ -9,6 +9,8 @@ enum NotificationSettingEventType {
SEND_MONITOR_OWNER_ADDED_NOTIFICATION = "Send notification when I am added as a owner to the monitor",
SEND_MONITOR_CREATED_OWNER_NOTIFICATION = "Send monitor created notification when I am the owner of the monitor",
SEND_MONITOR_STATUS_CHANGED_OWNER_NOTIFICATION = "Send monitor status changed notification when I am the owner of the monitor",
SEND_MONITOR_NOTIFICATION_WHEN_PORBE_STATUS_CHANGES = "Send monitor notification when probe status changes",
SEND_MONITOR_NOTIFICATION_WHEN_NO_PROBES_ARE_MONITORING_THE_MONITOR = "Send monitor notification when no probes are monitoring the monitor",
// Scheduled Maintenance
SEND_SCHEDULED_MAINTENANCE_CREATED_OWNER_NOTIFICATION = "Send event created notification when I am the owner of the event",
@@ -20,6 +22,10 @@ enum NotificationSettingEventType {
SEND_STATUS_PAGE_ANNOUNCEMENT_CREATED_OWNER_NOTIFICATION = "Send status page announcement created notification when I am the owner of the status page",
SEND_STATUS_PAGE_CREATED_OWNER_NOTIFICATION = "Send status page created notification when I am the owner of the status page",
SEND_STATUS_PAGE_OWNER_ADDED_NOTIFICATION = "Send notification when I am added as a owner to the status page",
// Probe Status change Notification
SEND_PROBE_STATUS_CHANGED_OWNER_NOTIFICATION = "Send probe status changed notification when I am the owner of the probe",
SEND_PROBE_OWNER_ADDED_NOTIFICATION = "Send notification when I am added as a owner to the probe",
}
export default NotificationSettingEventType;

View File

@@ -465,7 +465,17 @@ enum Permission {
EditCodeRepository = "EditCodeRepository",
ReadCodeRepository = "ReadCodeRepository",
ReadCopilotEvent = "ReadCopilotEvent",
ReadCopilotAction = "ReadCopilotAction",
CreateProbeOwnerTeam = "CreateProbeOwnerTeam",
DeleteProbeOwnerTeam = "DeleteProbeOwnerTeam",
EditProbeOwnerTeam = "EditProbeOwnerTeam",
ReadProbeOwnerTeam = "ReadProbeOwnerTeam",
CreateProbeOwnerUser = "CreateProbeOwnerUser",
DeleteProbeOwnerUser = "DeleteProbeOwnerUser",
EditProbeOwnerUser = "EditProbeOwnerUser",
ReadProbeOwnerUser = "ReadProbeOwnerUser",
CreateServiceRepository = "CreateServiceRepository",
DeleteServiceRepository = "DeleteServiceRepository",
@@ -1978,28 +1988,28 @@ export class PermissionHelper {
title: "Create Probe",
description: "This permission can create probe this project.",
isAssignableToTenant: true,
isAccessControlPermission: false,
isAccessControlPermission: true,
},
{
permission: Permission.DeleteProjectProbe,
title: "Delete Probe",
description: "This permission can delete probe of this project.",
isAssignableToTenant: true,
isAccessControlPermission: false,
isAccessControlPermission: true,
},
{
permission: Permission.EditProjectProbe,
title: "Edit Probe",
description: "This permission can edit probe of this project.",
isAssignableToTenant: true,
isAccessControlPermission: false,
isAccessControlPermission: true,
},
{
permission: Permission.ReadProjectProbe,
title: "Read Probe",
description: "This permission can read probe of this project.",
isAssignableToTenant: true,
isAccessControlPermission: false,
isAccessControlPermission: true,
},
{
@@ -2439,13 +2449,71 @@ export class PermissionHelper {
},
{
permission: Permission.ReadCopilotEvent,
permission: Permission.ReadCopilotAction,
title: "Read Copilot Event",
description: "This permission can read Copilot Event of this project.",
isAssignableToTenant: true,
isAccessControlPermission: false,
},
{
permission: Permission.CreateProbeOwnerTeam,
title: "Create Probe Owner Team",
description: "This permission can create owners for probes.",
isAssignableToTenant: true,
isAccessControlPermission: false,
},
{
permission: Permission.DeleteProbeOwnerTeam,
title: "Delete Probe Owner Team",
description: "This permission can delete owners for probes",
isAssignableToTenant: true,
isAccessControlPermission: false,
},
{
permission: Permission.EditProbeOwnerTeam,
title: "Edit Probe Owner Team",
description: "This permission can edit owners for probes",
isAssignableToTenant: true,
isAccessControlPermission: false,
},
{
permission: Permission.ReadProbeOwnerTeam,
title: "Read Probe Owner Team",
description: "This permission can read owners for probes",
isAssignableToTenant: true,
isAccessControlPermission: false,
},
{
permission: Permission.CreateProbeOwnerUser,
title: "Create Probe Owner User",
description: "This permission can create owners for probes.",
isAssignableToTenant: true,
isAccessControlPermission: false,
},
{
permission: Permission.DeleteProbeOwnerUser,
title: "Delete Probe Owner User",
description: "This permission can delete owners for probes",
isAssignableToTenant: true,
isAccessControlPermission: false,
},
{
permission: Permission.EditProbeOwnerUser,
title: "Edit Probe Owner User",
description: "This permission can edit owners for probes",
isAssignableToTenant: true,
isAccessControlPermission: false,
},
{
permission: Permission.ReadProbeOwnerUser,
title: "Read Probe Owner User",
description: "This permission can read owners for probes",
isAssignableToTenant: true,
isAccessControlPermission: false,
},
{
permission: Permission.CreateServiceCatalog,
title: "Create Service Catalog",

View File

@@ -14,6 +14,7 @@ export enum ServiceLanguage {
TypeScript = "TypeScript",
JavaScript = "JavaScript",
Shell = "Shell",
Markdown = "Markdown",
Other = "Other",
}

View File

@@ -1,63 +0,0 @@
enum TimezoneCode {
UTC = "UTC",
GMT = "GMT",
EST = "EST",
EDT = "EDT",
CST = "CST",
CDT = "CDT",
MST = "MST",
MDT = "MDT",
PST = "PST",
PDT = "PDT",
AKST = "AKST",
AKDT = "AKDT",
HST = "HST",
HDT = "HDT",
AEST = "AEST",
AEDT = "AEDT",
ACST = "ACST",
ACDT = "ACDT",
AWST = "AWST",
AWDT = "AWDT",
NZST = "NZST",
NZDT = "NZDT",
NFT = "NFT",
IDLW = "IDLW",
NT = "NT",
CAT = "CAT",
EAT = "EAT",
IST = "IST",
MSK = "MSK",
EET = "EET",
CET = "CET",
WAT = "WAT",
GMT1 = "GMT+1",
GMT2 = "GMT+2",
GMT3 = "GMT+3",
GMT4 = "GMT+4",
GMT5 = "GMT+5",
GMT6 = "GMT+6",
GMT7 = "GMT+7",
GMT8 = "GMT+8",
GMT9 = "GMT+9",
GMT10 = "GMT+10",
GMT11 = "GMT+11",
GMT12 = "GMT+12",
GMT13 = "GMT+13",
GMT14 = "GMT+14",
GMT_1 = "GMT-1",
GMT_2 = "GMT-2",
GMT_3 = "GMT-3",
GMT_4 = "GMT-4",
GMT_5 = "GMT-5",
GMT_6 = "GMT-6",
GMT_7 = "GMT-7",
GMT_8 = "GMT-8",
GMT_9 = "GMT-9",
GMT_10 = "GMT-10",
GMT_11 = "GMT-11",
GMT_12 = "GMT-12",
GMT_13 = "GMT-13",
}
export default TimezoneCode;

View File

@@ -322,7 +322,10 @@ export default class API {
// get url from error
const url: string = error?.config?.url || "";
throw new APIException(`URL ${url ? url + " " : ""}is not available.`);
throw new APIException(
`Error occurred while making request to ${url}.`,
error,
);
}
public static getFriendlyErrorMessage(error: AxiosError | Error): string {

9
Common/Utils/Memory.ts Normal file
View File

@@ -0,0 +1,9 @@
import NumberUtil from "./Number";
export default class MemoryUtil {
public static convertToGb(memoryInBytes: number): number {
const gb: number = memoryInBytes / 1024 / 1024 / 1024;
//return two decimal places
return NumberUtil.convertToTwoDecimalPlaces(gb);
}
}

5
Common/Utils/Number.ts Normal file
View File

@@ -0,0 +1,5 @@
export default class NumberUtil {
public static convertToTwoDecimalPlaces(value: number): number {
return Math.round(value * 100) / 100;
}
}

View File

@@ -0,0 +1,40 @@
import ServiceLanguage from "../Types/ServiceCatalog/ServiceLanguage";
export default class ServiceLanguageUtil {
public static getLanguageByFileExtension(data: {
fileExtension: string;
}): ServiceLanguage {
const { fileExtension } = data;
switch (fileExtension) {
case "js":
return ServiceLanguage.JavaScript;
case "ts":
return ServiceLanguage.TypeScript;
case "py":
return ServiceLanguage.Python;
case "rb":
return ServiceLanguage.Ruby;
case "java":
return ServiceLanguage.Java;
case "php":
return ServiceLanguage.PHP;
case "cs":
return ServiceLanguage.CSharp;
case "cpp":
return ServiceLanguage.CPlusPlus;
case "rs":
return ServiceLanguage.Rust;
case "swift":
return ServiceLanguage.Swift;
case "kt":
return ServiceLanguage.Kotlin;
case "go":
return ServiceLanguage.Go;
case "sh":
return ServiceLanguage.Shell;
default:
return ServiceLanguage.Other;
}
}
}

View File

@@ -16,7 +16,7 @@
"json5": "^2.2.3",
"moment": "^2.30.1",
"moment-timezone": "^0.5.45",
"posthog-js": "^1.133.0",
"posthog-js": "^1.138.0",
"reflect-metadata": "^0.2.2",
"slugify": "^1.6.5",
"typeorm": "^0.3.20",
@@ -3846,9 +3846,9 @@
}
},
"node_modules/posthog-js": {
"version": "1.133.0",
"resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.133.0.tgz",
"integrity": "sha512-d+TfOqWTPRGoFuxaxRaGhh/XCg1tR5TyjdxCIW1Qp1XQE22zqite2/vg5l+mE6VdZfjMqeBStx0wjmxOj3uUDA==",
"version": "1.138.0",
"resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.138.0.tgz",
"integrity": "sha512-Pmvt5KmYPT3Je0auBq3Q3YSvHkPHUiW8Iy1UwS8mN/bQS19u8ls1UoMe6yiGijvnvHYmORjkMu6RYbmlTiKFZg==",
"license": "MIT",
"dependencies": {
"fflate": "^0.4.8",

View File

@@ -27,7 +27,7 @@
"json5": "^2.2.3",
"moment": "^2.30.1",
"moment-timezone": "^0.5.45",
"posthog-js": "^1.133.0",
"posthog-js": "^1.138.0",
"reflect-metadata": "^0.2.2",
"slugify": "^1.6.5",
"typeorm": "^0.3.20",

View File

@@ -9,6 +9,7 @@ import {
ExpressRequest,
ExpressResponse,
NextFunction,
OneUptimeRequest,
} from "../Utils/Express";
import Response from "../Utils/Response";
import BaseAPI from "./BaseAPI";
@@ -53,7 +54,10 @@ export default class UserAPI extends BaseAPI<
);
});
if (userPermissions.length === 0) {
if (
userPermissions.length === 0 &&
!(req as OneUptimeRequest).userAuthorization?.isMasterAdmin
) {
throw new BadDataException(
`You need ${Permission.ProjectOwner} or ${Permission.EditInvoices} permission to pay invoices.`,
);

View File

@@ -1,8 +1,7 @@
import UserMiddleware from "../Middleware/UserAuthorization";
import CodeRepositoryAuthorization from "../Middleware/CodeRepositoryAuthorization";
import CodeRepositoryService, {
Service as CodeRepositoryServiceType,
} from "../Services/CodeRepositoryService";
import CopilotEventService from "../Services/CopilotEventService";
import ServiceRepositoryService from "../Services/ServiceRepositoryService";
import {
ExpressRequest,
@@ -15,7 +14,6 @@ import { LIMIT_PER_PROJECT } from "Common/Types/Database/LimitMax";
import BadDataException from "Common/Types/Exception/BadDataException";
import ObjectID from "Common/Types/ObjectID";
import CodeRepository from "Model/Models/CodeRepository";
import CopilotEvent from "Model/Models/CopilotEvent";
import ServiceRepository from "Model/Models/ServiceRepository";
export default class CodeRepositoryAPI extends BaseAPI<
@@ -25,11 +23,25 @@ export default class CodeRepositoryAPI extends BaseAPI<
public constructor() {
super(CodeRepository, CodeRepositoryService);
this.router.get(
`${new this.entityType()
.getCrudApiPath()
?.toString()}/is-valid/:secretkey`,
CodeRepositoryAuthorization.isAuthorizedRepository,
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
try {
return Response.sendEmptySuccessResponse(req, res);
} catch (err) {
next(err);
}
},
);
this.router.get(
`${new this.entityType()
.getCrudApiPath()
?.toString()}/get-code-repository/:secretkey`,
UserMiddleware.getUserMiddleware,
CodeRepositoryAuthorization.isAuthorizedRepository,
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
try {
const secretkey: string = req.params["secretkey"]!;
@@ -98,84 +110,5 @@ export default class CodeRepositoryAPI extends BaseAPI<
}
},
);
this.router.get(
`${new this.entityType()
.getCrudApiPath()
?.toString()}/get-copilot-events-by-file/:secretkey`,
UserMiddleware.getUserMiddleware,
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
try {
const secretkey: string = req.params["secretkey"]!;
if (!secretkey) {
throw new BadDataException("Secret key is required");
}
const filePath: string = req.body["filePath"]!;
if (!filePath) {
throw new BadDataException("File path is required");
}
const serviceCatalogId: string = req.body["serviceCatalogId"]!;
if (!serviceCatalogId) {
throw new BadDataException("Service catalog id is required");
}
const codeRepository: CodeRepository | null =
await CodeRepositoryService.findOneBy({
query: {
secretToken: new ObjectID(secretkey),
},
select: {
_id: true,
},
props: {
isRoot: true,
},
});
if (!codeRepository) {
throw new BadDataException(
"Code repository not found. Secret key is invalid.",
);
}
const copilotEvents: Array<CopilotEvent> =
await CopilotEventService.findBy({
query: {
codeRepositoryId: codeRepository.id!,
filePath: filePath,
serviceCatalogId: new ObjectID(serviceCatalogId),
},
select: {
_id: true,
codeRepositoryId: true,
serviceCatalogId: true,
filePath: true,
copilotEventStatus: true,
copilotEventType: true,
createdAt: true,
},
skip: 0,
limit: LIMIT_PER_PROJECT,
props: {
isRoot: true,
},
});
return Response.sendJsonObjectResponse(req, res, {
copilotEvents: CopilotEvent.toJSONArray(
copilotEvents,
CopilotEvent,
),
});
} catch (err) {
next(err);
}
},
);
}
}

View File

@@ -2,7 +2,7 @@ import { IsBillingEnabled } from "../EnvironmentConfig";
import ProjectService from "../Services/ProjectService";
import { ExpressRequest, OneUptimeRequest } from "../Utils/Express";
import DatabaseCommonInteractionProps from "Common/Types/BaseDatabase/DatabaseCommonInteractionProps";
import { PlanSelect } from "Common/Types/Billing/SubscriptionPlan";
import { PlanType } from "Common/Types/Billing/SubscriptionPlan";
import UserType from "Common/Types/UserType";
export default class CommonAPI {
@@ -47,7 +47,7 @@ export default class CommonAPI {
if (IsBillingEnabled && props.tenantId) {
const plan: {
plan: PlanSelect | null;
plan: PlanType | null;
isSubscriptionUnpaid: boolean;
} = await ProjectService.getCurrentPlan(props.tenantId!);
props.currentPlan = plan.plan || undefined;

View File

@@ -0,0 +1,160 @@
import CodeRepository from "Model/Models/CodeRepository";
import CopilotActionService, {
Service as CopilotActionServiceType,
} from "../Services/CopilotActionService";
import {
ExpressRequest,
ExpressResponse,
NextFunction,
} from "../Utils/Express";
import Response from "../Utils/Response";
import BaseAPI from "./BaseAPI";
import { LIMIT_PER_PROJECT } from "Common/Types/Database/LimitMax";
import BadDataException from "Common/Types/Exception/BadDataException";
import ObjectID from "Common/Types/ObjectID";
import CopilotAction from "Model/Models/CopilotAction";
import CodeRepositoryService from "../Services/CodeRepositoryService";
import CodeRepositoryAuthorization from "../Middleware/CodeRepositoryAuthorization";
export default class CopilotActionAPI extends BaseAPI<
CopilotAction,
CopilotActionServiceType
> {
public constructor() {
super(CopilotAction, CopilotActionService);
this.router.get(
`${new this.entityType()
.getCrudApiPath()
?.toString()}/copilot-actions-by-file/:secretkey`,
CodeRepositoryAuthorization.isAuthorizedRepository,
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
try {
const secretkey: string = req.params["secretkey"]!;
if (!secretkey) {
throw new BadDataException("Secret key is required");
}
const filePath: string = req.body["filePath"]!;
if (!filePath) {
throw new BadDataException("File path is required");
}
const serviceCatalogId: string = req.body["serviceCatalogId"]!;
if (!serviceCatalogId) {
throw new BadDataException("Service catalog id is required");
}
const codeRepository: CodeRepository | null =
await CodeRepositoryService.findOneBy({
query: {
secretToken: new ObjectID(secretkey),
},
select: {
_id: true,
},
props: {
isRoot: true,
},
});
if (!codeRepository) {
throw new BadDataException(
"Code repository not found. Secret key is invalid.",
);
}
const copilotActions: Array<CopilotAction> =
await CopilotActionService.findBy({
query: {
codeRepositoryId: codeRepository.id!,
filePath: filePath,
serviceCatalogId: new ObjectID(serviceCatalogId),
},
select: {
_id: true,
codeRepositoryId: true,
serviceCatalogId: true,
filePath: true,
copilotActionStatus: true,
copilotActionType: true,
createdAt: true,
},
skip: 0,
limit: LIMIT_PER_PROJECT,
props: {
isRoot: true,
},
});
return Response.sendJsonObjectResponse(req, res, {
copilotActions: CopilotAction.toJSONArray(
copilotActions,
CopilotAction,
),
});
} catch (err) {
next(err);
}
},
);
this.router.post(
`${new this.entityType()
.getCrudApiPath()
?.toString()}/add-copilot-action/:secretkey`,
CodeRepositoryAuthorization.isAuthorizedRepository,
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
try {
const secretkey: string = req.params["secretkey"]!;
if (!secretkey) {
throw new BadDataException("Secret key is required");
}
const codeRepository: CodeRepository | null =
await CodeRepositoryService.findOneBy({
query: {
secretToken: new ObjectID(secretkey),
},
select: {
_id: true,
projectId: true,
},
props: {
isRoot: true,
},
});
if (!codeRepository) {
throw new BadDataException(
"Code repository not found. Secret key is invalid.",
);
}
const copilotAction: CopilotAction = CopilotAction.fromJSON(
req.body["copilotAction"],
CopilotAction,
) as CopilotAction;
copilotAction.codeRepositoryId = codeRepository.id!;
copilotAction.projectId = codeRepository.projectId!;
await CopilotActionService.create({
data: copilotAction,
props: {
isRoot: true,
},
});
return Response.sendEmptySuccessResponse(req, res);
} catch (err) {
next(err);
}
},
);
}
}

View File

@@ -31,6 +31,7 @@ export default class Ingestor extends BaseAPI<Probe, ProbeServiceType> {
description: true,
lastAlive: true,
iconFileId: true,
connectionStatus: true,
},
props: {
isRoot: true,

View File

@@ -1,9 +1,11 @@
import { IsBillingEnabled } from "../EnvironmentConfig";
import UserMiddleware from "../Middleware/UserAuthorization";
import ProjectService, {
Service as ProjectServiceType,
} from "../Services/ProjectService";
import ResellerService from "../Services/ResellerService";
import TeamMemberService from "../Services/TeamMemberService";
import Select from "../Types/Database/Select";
import {
ExpressRequest,
ExpressResponse,
@@ -38,6 +40,17 @@ export default class ProjectAPI extends BaseAPI<Project, ProjectServiceType> {
);
}
const projectSelect: Select<Project> = {
_id: true,
name: true,
trialEndsAt: true,
paymentProviderPlanId: true,
resellerId: true,
isFeatureFlagMonitorGroupsEnabled: true,
paymentProviderMeteredSubscriptionStatus: true,
paymentProviderSubscriptionStatus: true,
};
const teamMembers: Array<TeamMember> = await TeamMemberService.findBy(
{
query: {
@@ -45,16 +58,7 @@ export default class ProjectAPI extends BaseAPI<Project, ProjectServiceType> {
hasAcceptedInvitation: true,
},
select: {
project: {
_id: true,
name: true,
trialEndsAt: true,
paymentProviderPlanId: true,
resellerId: true,
isFeatureFlagMonitorGroupsEnabled: true,
paymentProviderMeteredSubscriptionStatus: true,
paymentProviderSubscriptionStatus: true,
},
project: projectSelect,
},
limit: LIMIT_PER_PROJECT,
skip: 0,
@@ -66,6 +70,47 @@ export default class ProjectAPI extends BaseAPI<Project, ProjectServiceType> {
const projects: Array<Project> = [];
// if billing enabled and is master admin then get all the projects with customer support enabled.
if (
IsBillingEnabled &&
(req as OneUptimeRequest).userAuthorization?.isMasterAdmin
) {
const customerSupportProjects: Array<Project> =
await ProjectService.findBy({
query: {
letCustomerSupportAccessProject: true,
},
select: projectSelect,
limit: LIMIT_PER_PROJECT,
skip: 0,
props: {
isRoot: true,
},
});
for (const customerSupportProject of customerSupportProjects) {
if (!customerSupportProject) {
continue;
}
if (!customerSupportProject._id) {
continue;
}
if (
projects.findIndex((project: Project) => {
return (
project._id?.toString() ===
customerSupportProject!._id?.toString()
);
}) === -1
) {
projects.push(customerSupportProject);
}
}
}
for (const teamMember of teamMembers) {
if (!teamMember.project) {
continue;

View File

@@ -15,7 +15,7 @@ import Response from "../Utils/Response";
import BaseAPI from "./BaseAPI";
import StatusCode from "Common/Types/API/StatusCode";
import URL from "Common/Types/API/URL";
import { PlanSelect } from "Common/Types/Billing/SubscriptionPlan";
import { PlanType } from "Common/Types/Billing/SubscriptionPlan";
import Email from "Common/Types/Email";
import BadDataException from "Common/Types/Exception/BadDataException";
import ObjectID from "Common/Types/ObjectID";
@@ -126,7 +126,7 @@ export default class ResellerPlanAPI extends BaseAPI<
promoCode.resellerId = resellerPlan?.reseller.id as ObjectID;
promoCode.resellerPlanId = resellerPlan?.id as ObjectID;
promoCode.userEmail = userEmail;
promoCode.planType = resellerPlan?.planType as PlanSelect;
promoCode.planType = resellerPlan?.planType as PlanType;
promoCode.resellerLicenseId = licenseKey || "";
await PromoCodeService.create({

View File

@@ -1,11 +0,0 @@
import UserService, {
Service as UserServiceType,
} from "../Services/UserService";
import BaseAPI from "./BaseAPI";
import User from "Model/Models/User";
export default class UserAPI extends BaseAPI<User, UserServiceType> {
public constructor() {
super(User, UserService);
}
}

View File

@@ -210,3 +210,18 @@ export const AllowedActiveMonitorCountInFreePlan: number = process.env[
process.env["ALLOWED_ACTIVE_MONITOR_COUNT_IN_FREE_PLAN"].toString(),
)
: 10;
export const AllowedStatusPageCountInFreePlan: number = process.env[
"ALLOWED_STATUS_PAGE_COUNT_IN_FREE_PLAN"
]
? parseInt(process.env["ALLOWED_STATUS_PAGE_COUNT_IN_FREE_PLAN"].toString())
: 1;
export const AllowedSubscribersCountInFreePlan: number = process.env[
"ALLOWED_SUBSCRIBERS_COUNT_IN_FREE_PLAN"
]
? parseInt(process.env["ALLOWED_SUBSCRIBERS_COUNT_IN_FREE_PLAN"].toString())
: 100;
export const NotificationWebhookOnCreateUser: string =
process.env["NOTIFICATION_WEBHOOK_ON_CREATED_USER"] || "";

Some files were not shown because too many files have changed in this diff Show More