Compare commits

..

608 Commits

Author SHA1 Message Date
Raj Nandan Sharma 65f039b7bd refactor(docker): enhance build process and organize template files fixes #429 2025-08-05 22:36:31 +05:30
Raj Nandan Sharma 5c7b62e9f7 Merge pull request #451 from moaazbhnas228/fix/heartbeat-grace-period
Fix: Heartbeat monitor respects cron-based grace periods
2025-08-05 22:21:37 +05:30
Raj Nandan Sharma 5e6e891ea6 Merge pull request #473 from rajnandan1/fix/441
Fix/441
2025-08-05 22:00:06 +05:30
Raj Nandan Sharma 82c904608b refactor(subscriptions): simplify condition for subscription trigger ID check 2025-08-05 21:59:22 +05:30
Raj Nandan Sharma f5260ceb86 chore(package): update version to 3.2.19 2025-08-05 21:18:32 +05:30
Raj Nandan Sharma abb32fdd6f fix(subscriptions): improve status toggle handling
Refactors the subscription status toggle to use a dedicated handler, ensuring correct behavior when toggling status for both new and existing triggers. Enhances user experience by automatically saving and reloading data when needed.
2025-08-05 21:17:09 +05:30
Raj Nandan Sharma 97aef5c5f5 Merge pull request #461 from antonio-sessa/fix/issue_456
fix: enhance monitor rearrangement with scrollable container
2025-08-05 11:06:47 +05:30
Raj Nandan Sharma c3eb8ae7f4 Merge pull request #467 from Baw-Appie/patch-1
Update Korean translations for clarity and consistency
2025-08-05 11:06:15 +05:30
Raj Nandan Sharma 72f74f9164 Merge pull request #469 from faridvatani/feature/persian-support
feat(i18n): add Persian language support
2025-08-05 11:05:50 +05:30
Farid Vatani 958676e5a7 feat(i18n): add Persian language support 2025-07-21 14:27:42 +03:30
JiHun Oh 51134670e5 Update Korean translations for clarity and consistency 2025-07-19 11:02:39 +00:00
JiHun Oh ecea2b220d Update ko.json 2025-07-19 19:51:27 +09:00
antonio-sessa 212f4d5e7a fix: enhance monitor rearrangement with scrollable container 2025-07-14 09:30:41 +02:00
Raj Nandan Sharma 2edb09bd13 Merge pull request #455 from xgenos/fix-issue-332
fixed the issue#332 with more optimized ORIGIN env calls
2025-07-11 10:10:07 +05:30
Biswa Kalyan Bhuyan 6b9f073cb7 fix: fixed the issue#332 with more optimized ORIGIN env calls 2025-07-02 19:15:52 +05:30
Moaaz Bhnas 9f933a0f1c Fixed returned status/type on heartbeat error 2025-07-02 09:21:58 +03:00
Moaaz Bhnas 8a6f721bb4 previousRun() 2025-07-01 09:03:50 +03:00
Moaaz Bhnas eeadcca6ed Used croner instead of cron-parser 2025-07-01 08:59:04 +03:00
Moaaz Bhnas 8e89c10906 Small change 2025-07-01 08:53:46 +03:00
Moaaz Bhnas 833d16351c FIX: heartbeat latency 2025-07-01 08:49:32 +03:00
Raj Nandan Sharma 0c10552fa7 Merge pull request #448 from federico-it/main
feat(i18n): add Italian language support
2025-06-30 21:30:05 +05:30
Raj Nandan Sharma 443afe2f6e Merge pull request #447 from sendmiche/patch-1
The translation has been made more suitable for the Russian language.
2025-06-30 21:29:33 +05:30
Federico db48d98da7 feat(i18n): add Italian language support 2025-06-20 17:44:28 +02:00
sendmiche bf3150434a The translation has been made more suitable for the Russian language. 2025-06-20 12:30:59 +03:00
github-actions 71c4bd26d2 Auto-generate README.md with release versions 2025-06-12 04:47:55 +00:00
Raj Nandan Sharma ca4f7040e8 refactor(themeInfo): remove maintenance status migration and update default value handling 2025-06-12 09:54:03 +05:30
Raj Nandan Sharma 1cfa861d7e Merge pull request #431 from rajnandan1/release/18
Release/18
2025-06-12 09:21:40 +05:30
Raj Nandan Sharma 007baefe80 Merge pull request #426 from ToxykAuBleu/feat/scheduled-downtime
Add maintenance visibility to monitor' status
2025-06-02 09:31:36 +05:30
Raj Nandan Sharma 7d77f4d996 chore: update version to 3.2.18 2025-05-28 10:01:15 +05:30
Raj Nandan Sharma 3d5a62c085 feat(subscription): add status toggle and restrict config editing #418
Adds support for toggling the subscription trigger's active/inactive status from the UI and updates backend/controller logic to allow dynamic status changes. Restricts editing of subscription event configuration and user subscriptions to when the trigger is active, improving admin control and preventing unintended changes when subscriptions are inactive.
2025-05-28 10:00:32 +05:30
Raj Nandan Sharma 24ffef997b feat(docker): copy server templates to build output #429 2025-05-28 08:52:37 +05:30
ToxykAuBleu 7d5275152c Fixing responsiveness of "Availability per Component", above monitors. 2025-05-26 12:08:03 +00:00
ToxykAuBleu 93167c2358 Reverting commit about recurring maintenance (forgotten). 2025-05-26 11:22:30 +00:00
ToxykAuBleu 734d3ad280 Adding translations for all translations. 2025-05-26 09:57:59 +00:00
ToxykAuBleu 753668dfa5 Adding documentation related to new maintenance status. 2025-05-26 06:58:03 +00:00
ToxykAuBleu 351817338d Reverting commits about recurring maintenance (moved to new branch). 2025-05-26 06:47:17 +00:00
ToxykAuBleu 7c12218489 Changing default color of maintenance' status. 2025-05-22 06:50:24 +00:00
ToxykAuBleu 7c71298227 Adding maintenance calculation & message to system data. 2025-05-22 06:41:10 +00:00
ToxykAuBleu 167db6d7e6 Adding visibility of this new status to Home page.
Adding MAINTENANCE to affected monitors (Events page).
2025-05-21 07:08:35 +00:00
Raj Nandan Sharma 74834f3559 Merge pull request #417 from chunchet-ng/main
fix: remove VOLUME declarations to prevent unintended anonymous volumes
2025-05-21 09:24:23 +05:30
ToxykAuBleu e13ca5c639 Adding visibility of this new type of maintenance into Events page. 2025-05-15 12:08:29 +00:00
Chun Chet a51806d62b fix: remove VOLUME declarations to prevent unintended anonymous volumes 2025-05-15 11:18:23 +08:00
ToxykAuBleu 57238dfb72 Adding input validation for maintenance duration.
Fixing some labels + flex layout.
2025-05-13 07:02:42 +00:00
ToxykAuBleu a2be642af0 Updating controller to accept new input data from Incident creation page.
Updating last migration to create new columns.
2025-05-13 07:01:14 +00:00
Raj Nandan Sharma aec2d23c2f Merge pull request #416 from OzkrOssa/feature/spanish-support
feat(i18n): add Spanish language support
2025-05-13 09:56:31 +05:30
Oscar Ossa 11a11162da feat(i18n): add Spanish language support 2025-05-12 09:48:06 -05:00
ToxykAuBleu 12a7be497e Editing incident creation page to include maintenance strategy option.
Removing unused properties inside newIncident.
2025-05-12 08:25:26 +00:00
github-actions 9b69da66a5 Auto-generate README.md with release versions 2025-05-06 17:27:39 +00:00
Raj Nandan Sharma ee831f96bb Merge pull request #413 from rajnandan1/css-fix-1
chore: update version to 3.2.17 and adjust layout properties in monit…
2025-05-06 22:40:06 +05:30
Raj Nandan Sharma 5542790145 chore: update version to 3.2.17 and adjust layout properties in monitor component 2025-05-06 22:39:09 +05:30
github-actions 3b1091a34f Auto-generate README.md with release versions 2025-05-06 01:54:32 +00:00
Raj Nandan Sharma eebe6541c3 Merge pull request #408 from ToxykAuBleu/fix/gamedig-call
Fixing missing call of any gamedig monitors.
2025-05-06 07:05:59 +05:30
Raj Nandan Sharma e308089cfa refactor(triggerInfo): remove timeout for test loaders and improve image tag formatting 2025-05-06 07:05:04 +05:30
Raj Nandan Sharma 5132d6894e Merge pull request #407 from ToxykAuBleu/fix/compiler-warnings
Fixing compiler warnings.
2025-05-06 07:02:19 +05:30
Raj Nandan Sharma 006d1e1fa0 Merge pull request #411 from rajnandan1/fix/ui-cycle
fix(notifications): improve error handling and UI feedback
2025-05-06 07:01:05 +05:30
Raj Nandan Sharma 4c6dc24355 fix(notifications): improve error handling and UI feedback
Returns structured error messages from notification providers, updates API logic to surface errors to users, and enhances UI to display error or success states during trigger tests. Also adjusts monitor API request payload and corrects data range calculation.

Relates to improved reliability and user experience.
2025-05-06 06:57:12 +05:30
ToxykAuBleu acf227a947 Fixing missing call of any gamedig monitors. 2025-05-05 09:57:39 +00:00
ToxykAuBleu 3b05ca73e5 Adding validation to this new status.
Adding migration + seed for this new status.
2025-05-05 09:05:16 +00:00
ToxykAuBleu 236d7ea585 Adding new maintenance status to theme page. 2025-05-05 09:04:37 +00:00
ToxykAuBleu 87408d22c4 Merge branch 'main' into fix/compiler-warnings 2025-05-05 06:54:14 +00:00
Raj Nandan Sharma ea6754775d feat: update localization files with new duration options for multiple languages 2025-05-05 11:16:38 +05:30
Raj Nandan Sharma 3210f4d406 Merge pull request #406 from rajnandan1/cycle-changer
feat: add configurable home data range per device
2025-05-05 10:50:15 +05:30
Raj Nandan Sharma 16ac97a9c9 feat: document hidden categories and configurable data range in changelogs 2025-05-05 10:48:08 +05:30
Raj Nandan Sharma 8857a51dde chore: update version to 3.2.16 in package.json 2025-05-05 10:44:23 +05:30
Raj Nandan Sharma fc2abe7f16 refactor: remove commented code and clean up dropdown labels in homePage and monitor components 2025-05-05 10:31:15 +05:30
Raj Nandan Sharma f04a930e13 feat: add configurable home data range per device
Introduces per-device configuration for maximum data range and selectable days on the homepage, allowing separate settings for desktop and mobile. Updates UI, server logic, and data model to support these options, and uses user agent detection to apply the correct configuration. Improves flexibility for data display across devices.

Relates to #105
2025-05-05 10:28:02 +05:30
Raj Nandan Sharma 1de1e2d6ba Merge pull request #405 from rajnandan1/hide-cate
refactor: rename visibility property to isHidden and update related l…
2025-05-04 12:47:32 +05:30
Raj Nandan Sharma 0208e4baf9 refactor: rename visibility property to isHidden and update related logic #321 2025-05-04 12:46:11 +05:30
Raj Nandan Sharma 21af2a6d02 Merge pull request #399 from rohith1222004/feature/monitorVisibility
feat: implement visibility control for monitors
2025-05-04 12:11:37 +05:30
github-actions 2fbe301a51 Auto-generate README.md with release versions 2025-04-30 17:53:33 +00:00
Raj Nandan Sharma 6d5382982c Merge pull request #402 from rajnandan1/fix0embed
feat(embed): add timezone support to embed parameters
2025-04-30 23:03:05 +05:30
Raj Nandan Sharma a20b4ee570 feat(embed): add timezone support to embed parameters
Introduces a 'tz' parameter for specifying timezone in embed scripts and iframe URLs, improving localization for embedded monitors.
Updates documentation and refactors parameter handling to prioritize explicit timezone over browser-detected values.

Relates to improved internationalization and user experience.
2025-04-30 23:02:10 +05:30
Raj Nandan Sharma 909ff9e070 Merge pull request #330 from Aj7ay7/main
docker/fix-compose-configuration
2025-04-30 19:58:05 +05:30
github-actions 7d3e265ece Auto-generate README.md with release versions 2025-04-30 14:18:34 +00:00
Raj Nandan Sharma 78d8f311c0 Merge pull request #400 from ToxykAuBleu/fix/398-docker-not-starting 2025-04-30 17:50:14 +05:30
ToxykAuBleu c52ba95fd0 Removing bad import of "@sveltejs/kit" in gamedigCall.js. 2025-04-30 11:37:43 +00:00
Rohith Kumar 9462a0331a feat: implement visibility control for monitors
- Private monitors are visible only to logged-in users
- Public monitors are accessible to all
2025-04-30 15:46:08 +05:30
ToxykAuBleu 4e3d1838c0 Fixing compiler warnings. 2025-04-30 06:43:21 +00:00
Raj Nandan Sharma aad7b5c6ea chore: update Dockerfile to use latest package versions for alpine build 2025-04-30 07:37:47 +05:30
Raj Nandan Sharma abec24d65b Merge pull request #397 from ToxykAuBleu/fix/396-gamedig-install
Updating Gamedig to 5.3.0 + fix build app.
2025-04-30 07:32:50 +05:30
Raj Nandan Sharma e0c3d1864c chore: remove specific version for iputils in Dockerfile 2025-04-30 07:14:54 +05:30
ToxykAuBleu bd25c6fe05 Updating Gamedig to 5.3.0.
Moving Gamedig to dependencies (not devDependencies).
2025-04-29 20:34:13 +00:00
Raj Nandan Sharma 4ec5e14431 chore: update changelog for version 3.2.14 with new features and bug fixes 2025-04-29 22:58:09 +05:30
Raj Nandan Sharma c9b8c5bec3 chore: update changelogs for version 3.2.14 with new features and bug fixes 2025-04-29 22:50:28 +05:30
Raj Nandan Sharma 223883adf7 Merge pull request #385 from rajnandan1/event-subscription
Event subscription
2025-04-29 22:21:22 +05:30
Raj Nandan Sharma 83c2d7ff79 fix: improve subscription UX and email code handling
Enhances subscription menu by showing a default icon when no image is available.
Replaces hardcoded verification code in email template with a variable.
Prevents background scrolling when subscription menu is open.
Removes redundant new subscriber response in API.
Removes unused documentation button from subscriptions page.
Adjusts checkbox styling for better UI consistency.
2025-04-29 22:07:39 +05:30
Raj Nandan Sharma cf33f5a2f6 refactor: improve downtime duration calculation in closure comment #387 2025-04-29 21:20:04 +05:30
Raj Nandan Sharma 92b4596924 refactor: centralize monitoring data insertion logic
Introduces a unified function for monitoring data insertion,
adds support for group monitor status updates, and ensures
consistency by routing all monitoring data writes through the
new logic. Removes duplicated validation and streamlines
group monitor handling for improved reliability.

Relates to #123
2025-04-29 20:45:14 +05:30
Raj Nandan Sharma ce9b748570 style: adjust height of checkbox and refine status color banner with hover effects 2025-04-28 22:57:51 +05:30
Raj Nandan Sharma 87a9069ab4 feat: add configurable site status banner with i18n
Introduces an option to enable a site status banner summarizing the operational state of monitored systems. Calculates and displays aggregated status with a progress bar. Localizes banner messages in all supported languages.

Helps users quickly assess overall system health from the homepage.
2025-04-28 22:18:15 +05:30
Raj Nandan Sharma 3e6a76c8c3 Refactor monitoring data update logic to include type parameter and optimize database insertion with batching 2025-04-28 10:48:33 +05:30
Raj Nandan Sharma 3509955374 Implement date input for monitoring data modification and enhance validation logic 2025-04-28 10:08:58 +05:30
Raj Nandan Sharma 225711f95d Merge branch 'main' into event-subscription 2025-04-27 16:10:35 +05:30
Raj Nandan Sharma 5436647cd3 Merge pull request #380 from mcorbin/feature/allow-modifying-monitors-data
Allow users to modify monitors data
2025-04-27 16:10:22 +05:30
Raj Nandan Sharma fbd9da3b33 Merge branch 'main' into feature/allow-modifying-monitors-data 2025-04-27 16:07:31 +05:30
Raj Nandan Sharma edb6705ac8 Merge branch 'main' into event-subscription 2025-04-27 15:18:47 +05:30
Raj Nandan Sharma 382a2a5bcc Merge pull request #384 from jensvandenreyt/feature/extend-monitor-api
feat: add CRUD api for monitors
2025-04-27 15:18:29 +05:30
Raj Nandan Sharma b5967607d2 Refactor game data handling and improve metadata for event pages
- Updated monitorSheet.svelte to use raw JSON data for AllGamesList, replacing the previous import method.
- Refactored game retrieval logic in monitorSheet.svelte to utilize GetGameFromId function with the new AllGamesList structure.
- Modified monitorsAdd.svelte to parse AllGamesList from raw JSON, ensuring consistent data usage across components.
- Enhanced event pages (+page.svelte) with appropriate meta tags for better SEO, including titles and descriptions.
- Added a new all-games-list.json file containing comprehensive game data for improved functionality and maintainability.
- Updated subscriptions page to clarify SMTP setup instructions for users.
2025-04-27 15:05:35 +05:30
Raj Nandan Sharma 03bbb6c3b6 Merge branch 'main' into event-subscription 2025-04-27 12:57:17 +05:30
Raj Nandan Sharma 6054be0ff1 feat: enhance subscription table with index for optimized queries 2025-04-27 12:56:31 +05:30
Raj Nandan Sharma ff7355bcc2 Merge pull request #389 from ToxykAuBleu/feat/gamedig
Adding Gamedig monitor functionality and related documentation
2025-04-27 12:55:52 +05:30
Raj Nandan Sharma 23a9124e03 feat(i18n): localizes subscription and maintenance UI
Integrates translation function into subscription and maintenance components,
localizing all user-facing strings. Expands translation resources for multiple languages
to cover newly localized phrases, improving accessibility and user experience for non-English users.
2025-04-27 12:12:10 +05:30
Raj Nandan Sharma ac41807cdd Merge pull request #392 from myned/fix-smtp-secure
Fix SMTP_SECURE environment variable always being truthy when set
2025-04-27 11:08:36 +05:30
Raj Nandan Sharma d95bb13e6e refactor: unify incident URL paths and add incident pagination
Unifies URLs for incident events by switching from singular to plural path segments and removes obsolete routes to streamline navigation. Introduces paginated incident fetching with filtering and sorting to improve performance and scalability. Updates UI components to reflect new paths and behaviors.

Relates to improved incident management and navigation.
2025-04-27 10:13:00 +05:30
Raj Nandan Sharma b9d58ba3c1 remove debug console log from +page.svelte 2025-04-26 14:01:06 +05:30
Raj Nandan Sharma a648b29f31 feat: add incident link copy button and chevron hide option
Introduces a copy-to-clipboard button for incident links with animated feedback. Adds ability to hide accordion chevrons and refactors chevron and copy button styles. Updates incident URL generation and allows querying monitors by tag.

Relates to improved UX for incident management.
2025-04-26 14:00:23 +05:30
Myned e702feb04f fix: coerce SMTP_SECURE to Number before boolean 2025-04-26 00:18:51 -05:00
Raj Nandan Sharma ce83355e58 feat: add incident event email notifications via queue
Introduces a queue-based system to send email notifications for incident events, including creation, updates, monitor changes, and comments. Fetches eligible subscribers dynamically and uses configurable templates for email delivery. Also updates the UI to improve the Preview button styling for better user experience.
2025-04-25 20:38:59 +05:30
ToxykAuBleu 683beed3b7 Refactoring port validation into a function: IsValidPort(port). 2025-04-24 07:01:37 +00:00
ToxykAuBleu c9095036eb Fixing auto formatting done in #e63992a. 2025-04-24 06:36:36 +00:00
Jens Vandenreyt 29ec935d67 feat: update json OpenAPI spec
Also improve 400 and 404 error messages
2025-04-23 16:17:53 +02:00
ToxykAuBleu 339015a093 Adding documentation related to Gamedig monitor. 2025-04-23 11:49:48 +00:00
Jens Vandenreyt b8b5b4170f Merge branch 'rajnandan1:main' into feature/extend-monitor-api 2025-04-23 11:59:21 +02:00
ToxykAuBleu 8a104e4480 Adding timeout feature for Gamedig monitor. 2025-04-23 06:31:41 +00:00
Raj Nandan Sharma 89e1a5e88a Merge branch 'main' into event-subscription 2025-04-23 11:31:58 +05:30
Raj Nandan Sharma 8e5746d068 style: Update logout button design and improve subscription info display 2025-04-23 11:31:40 +05:30
Raj Nandan Sharma 1df7c6560a Merge pull request #386 from lolen/main
feat: Polish translation
2025-04-23 11:24:38 +05:30
Piotr Lasota 0ff4546379 feat: Polish translation 2025-04-22 22:56:13 +02:00
Raj Nandan Sharma ab036c968d Refactor subscription trigger configuration and update database schema for subscription management 2025-04-22 22:58:45 +05:30
Raj Nandan Sharma 625ece2e7b feat: Add token generation with expiry and enhance subscription management
- Implemented GenerateTokenWithExpiry function for JWT token generation with a specified expiry time.
- Added GetSubscriberByID function to retrieve subscriber details by ID.
- Updated CreateNewSubscription to accept subscriber ID directly.
- Introduced GetSubscribersPaginated for paginated retrieval of subscribers.
- Enhanced subscription trigger management with CreateSubscriptionTrigger and GetSubscriptionTriggerByEmail functions.
- Updated email_code.html to change expiration notice from 1 day to 5 minutes.
- Modified layout.server.js to include canSendEmail check for conditional rendering.
- Updated subscription page to display subscribers with pagination and subscription status management.
- Refactored subscription-related API endpoints for improved clarity and functionality.
- Added server-side logic for managing subscription triggers and email settings.
2025-04-22 21:30:17 +05:30
Jens Vandenreyt 41842cc1b9 feat: add CRUD api for monitors
Added API endpoints for search, get, create, update and delete of monitors
2025-04-22 16:07:54 +02:00
ToxykAuBleu e63992a7a5 Adding eval feature for Gamedig monitor.
Sorting by default games by name.
2025-04-22 11:54:07 +00:00
ToxykAuBleu 7ae5d8f1b1 Adding Gamedig monitor functionality. 2025-04-19 19:13:40 +00:00
Raj Nandan Sharma 0a34f2138a feat: Implement subscriptions page and update navigation 2025-04-19 13:56:31 +05:30
Raj Nandan Sharma 38b326fe72 feat: Implement subscription management features
- Added functionality to create, update, and delete subscribers and their subscriptions in the controller and database implementation.
- Introduced new API endpoints for subscribing and unsubscribing users, including email verification and management of subscription preferences.
- Created a new Svelte component for managing subscriptions, allowing users to subscribe to updates and manage their preferences.
- Added email template for sending verification codes to subscribers.
- Implemented utility functions for generating random numbers and validating email addresses.
2025-04-19 13:09:51 +05:30
Mathieu Corbin 8785c609a9 Allow users to modify monitors data
Sometimes, it's useful to modify data in the monitoring_data table, for example, in case of a false positive.

I'm adding a new button in the monitor list that opens a popup
allowing users to change the status of monitor data for a given time
range.
2025-04-17 15:13:44 +02:00
github-actions 1a67560137 Auto-generate README.md with release versions 2025-04-08 05:33:49 +00:00
Raj Nandan Sharma 6c7534b9b6 Merge pull request #374 from rajnandan1/release/3.2.13
Release/3.2.13
2025-04-08 10:46:07 +05:30
Raj Nandan Sharma ae6c2c985f feat: enhance incident details formatting and add active status filter for triggers #370 2025-04-08 10:44:17 +05:30
Raj Nandan Sharma 940331b87f feat: update package description and enhance incident date formatting #371 2025-04-08 09:23:12 +05:30
Raj Nandan Sharma e6b5600a47 feat: add Umami analytics support and enhance capture functionality 2025-04-02 21:16:34 +05:30
Raj Nandan Sharma ce2a6ab756 feat: update version to 3.2.13 and refactor monitoring data calculations 2025-04-01 22:51:55 +05:30
Raj Nandan Sharma 6af91af639 chore: bump version to 3.2.12 in package.json 2025-04-01 21:22:43 +05:30
github-actions e1ff156b91 Auto-generate README.md with release versions 2025-03-31 12:16:53 +00:00
Raj Nandan Sharma b56d20ac35 Merge pull request #367 from rajnandan1/release/3.2.12
feat: add kenerTheme support and enhance footer HTML structure
2025-03-31 17:17:30 +05:30
Raj Nandan Sharma 9ee7a7b861 feat: add kenerTheme support and enhance footer HTML structure 2025-03-31 17:12:40 +05:30
Raj Nandan Sharma f73ffce3f0 feat: enhance documentation and styling for custom JS/CSS guide and incident comments 2025-03-30 12:58:19 +05:30
Raj Nandan Sharma 0997967787 docs: update environment variables documentation for CORS and reverse proxy setup
feat: modify analytics event naming convention for consistency

fix: adjust delete monitor confirmation form layout for better UX

style: refine positioning of monitor action buttons for improved alignment

refactor: streamline password validation imports in setup and forgot password routes

fix: remove unnecessary line breaks in layout server file
2025-03-29 22:33:17 +05:30
github-actions 3476ec2b29 Auto-generate README.md with release versions 2025-03-28 16:39:18 +00:00
Raj Nandan Sharma e0cf568aa9 feat: implement custom handle function to modify response headers 2025-03-28 21:50:07 +05:30
Raj Nandan Sharma c12d7f8345 feat: add null check for document before dispatching analytics event 2025-03-28 21:18:26 +05:30
Raj Nandan Sharma 9ba115d5ab Merge pull request #366 from rajnandan1/release/3.2.11
release 3.2.11
2025-03-28 20:56:59 +05:30
Raj Nandan Sharma 3756bbfd06 chore: bump version to 3.2.11 in package.json 2025-03-28 20:54:50 +05:30
Raj Nandan Sharma 9096bcc641 feat: import analytics event module for enhanced tracking in incident page 2025-03-28 20:53:44 +05:30
Raj Nandan Sharma c4d04854e5 feat: enhance monitor deletion confirmation UI and add analytics event for incident back button click 2025-03-28 20:52:59 +05:30
Raj Nandan Sharma d95fc0005b feat: indicate Markdown support in incident summary and comment sections 2025-03-28 20:40:24 +05:30
Raj Nandan Sharma 2b9093184a feat: add support for Markdown language in events and enhance SEO documentation as requested in #359 2025-03-28 20:34:19 +05:30
Raj Nandan Sharma 831376054b feat: add analytics capture snippets and enhance event tracking also added plausible and ms clarity #355 2025-03-28 15:07:45 +05:30
Raj Nandan Sharma 885ee0b6d6 feat: implement monitor deletion functionality with confirmation 2025-03-26 11:47:53 +05:30
Raj Nandan Sharma 511d0f26dd feat: add email validation in CreateUpdateTrigger function 2025-03-26 10:16:36 +05:30
github-actions 5263698625 Auto-generate README.md with release versions 2025-03-25 17:45:05 +00:00
Raj Nandan Sharma 7859f9564e fix: bump version to 3.2.10 in package.json 2025-03-25 22:58:04 +05:30
github-actions 149456682d Auto-generate README.md with release versions 2025-03-25 17:20:55 +00:00
Raj Nandan Sharma 8c040997da fix: refactor monitorTriggers initialization into a separate function 2025-03-25 22:47:05 +05:30
Raj Nandan Sharma 868fed0176 fix: update tzdata version in Dockerfile to use latest available 2025-03-25 22:38:13 +05:30
Raj Nandan Sharma c7f44a48da fix: bump version to 3.2.9 in package.json 2025-03-25 22:31:57 +05:30
Raj Nandan Sharma 6300bff4e7 Merge pull request #363 from rajnandan1/fix/357
fix: update RBAC documentation and improve monitor data retrieval log…
2025-03-25 22:27:04 +05:30
Raj Nandan Sharma 3e6b1ffdbb fix: streamline query execution in DbImpl by removing redundant return statement 2025-03-25 22:24:10 +05:30
Raj Nandan Sharma 408fd5318b fix: update RBAC documentation and improve monitor data retrieval logic, fixes #357 and #361 2025-03-25 22:20:45 +05:30
Raj Nandan Sharma cfe419f6df Merge pull request #362 from rajnandan1/fix/360
Fix/360
2025-03-25 20:39:07 +05:30
Raj Nandan Sharma 5403726099 fix: replace parseInt with Number for timeout conversion in monitorSheet.svelte and ping.js 2025-03-25 20:38:23 +05:30
Raj Nandan Sharma 057c14909f fix #360 2025-03-25 20:29:30 +05:30
Raj Nandan Sharma 37b18c06bb fix: validate timeout input and ensure it's a number in monitorSheet.svelte 2025-03-25 20:28:39 +05:30
github-actions 3ad1eb9a03 Auto-generate README.md with release versions 2025-03-24 15:18:34 +00:00
Raj Nandan Sharma a1064771f8 fix: increment package version from 3.2.7 to 3.2.8 in package.json 2025-03-24 20:34:24 +05:30
Raj Nandan Sharma 463ee286bf fix: increment package version from 3.2.6 to 3.2.7 in package.json 2025-03-24 20:30:05 +05:30
Raj Nandan Sharma a7ae6e72ef fix: downgrade package version from 3.2.8 to 3.2.6 in package.json 2025-03-24 20:28:01 +05:30
github-actions 36c67f60dd Auto-generate README.md with release versions 2025-03-24 14:56:20 +00:00
Raj Nandan Sharma bb718b04a6 fix: update Dockerfile to use ARG variables for Node.js version tags 2025-03-24 20:10:13 +05:30
Raj Nandan Sharma b6ea060054 fix: update publish-images workflow and increment package version to 3.2.8 2025-03-24 20:01:53 +05:30
Raj Nandan Sharma 5dba54c048 fix: update publish-images workflow to set GH_TOKEN environment variable correctly 2025-03-24 19:53:29 +05:30
Raj Nandan Sharma 415276163f Merge pull request #356 from rajnandan1/release/3.2.8-x
fix: update Node.js version to 23 and increment package version to 3.2.7
2025-03-24 19:45:44 +05:30
Raj Nandan Sharma 017b9e2e84 fix: update Node.js version to 23 and increment package version to 3.2.7 2025-03-24 19:45:15 +05:30
Raj Nandan Sharma 5740991ee1 fix: update GitHub Actions workflow to use GH_PAT instead of GITHUB_TOKEN for authentication 2025-03-24 15:12:40 +05:30
Raj Nandan Sharma 06008bd719 fix: streamline Dockerfile by removing unnecessary paths and using variable references for base images 2025-03-24 12:11:03 +05:30
Raj Nandan Sharma b53cd485e5 Merge pull request #263 from kaffolder7/feature/dependabot-version-updates
feat: automate dependency updates 🤖
2025-03-24 11:59:41 +05:30
Raj Nandan Sharma 7c1fd39158 Merge branch 'main' into feature/dependabot-version-updates 2025-03-24 11:58:58 +05:30
Raj Nandan Sharma f7888f1ba4 fix: update package versions in Dockerfile for consistency and stability 2025-03-24 11:32:05 +05:30
Raj Nandan Sharma ece5ac37ad feat: update embed monitor URLs to use siteURL and base variables for improved flexibility 2025-03-24 11:19:51 +05:30
Raj Nandan Sharma a51183fb23 Merge pull request #348 from rajnandan1/rbac
Features role-based access control and user management
2025-03-24 10:45:39 +05:30
Raj Nandan Sharma 7875192fb0 feat: update package dependencies and improve invitation expiry date formatting 2025-03-24 10:17:21 +05:30
Raj Nandan Sharma eb128ad431 feat: add "View in detail" button for group monitors and update localization files 2025-03-23 22:44:11 +05:30
Raj Nandan Sharma ba61ed87ab feat: enhance incident month handling with improved date calculations and formatting, fixing #349 2025-03-23 21:51:51 +05:30
Raj Nandan Sharma 8b5348081d docs: update changelogs to include improvements in build time and component migration 2025-03-23 14:29:15 +05:30
Raj Nandan Sharma bb7e69ace5 fix: update icon imports to use specific paths from lucide-svelte 2025-03-23 14:28:04 +05:30
Raj Nandan Sharma 3b8bb60423 fix: update print width in configuration files and improve documentation links 2025-03-23 13:36:22 +05:30
Raj Nandan Sharma 93339ce9df feat: add support for self-signed certificates and update changelog, fixes #351 2025-03-23 12:32:36 +05:30
Raj Nandan Sharma d30d99d8c2 docs: update changelogs to include resolved GitHub issues and improve formatting 2025-03-22 22:57:26 +05:30
Raj Nandan Sharma 3468df16e1 fix: improve error handling and code structure in Minuter function #345 2025-03-22 22:50:17 +05:30
Raj Nandan Sharma ccdeff98dc feat: implement dynamic versioning in headers and documentation as reported in #346 2025-03-22 21:54:24 +05:30
Raj Nandan Sharma 7e182b1df2 fix: replace showModal with closeModal for better modal handling #350 2025-03-22 21:06:37 +05:30
Raj Nandan Sharma ff652ad435 fix: #238 #210 #309 #334 2025-03-22 16:42:21 +05:30
Raj Nandan Sharma 1fdafa7966 Adds badges and embed features
Implements badges for monitors, including status, uptime, and liveness, along with a dedicated management page.

Adds embed options for various platforms with customizable styles.
2025-03-22 16:36:19 +05:30
Raj Nandan Sharma 1f5e683af5 feat: integrate CodeMirror editor for enhanced JavaScript and JSON editing experience 2025-03-20 23:23:54 +05:30
Raj Nandan Sharma db8c881571 refactor: remove performance logging and clean up code in various files 2025-03-19 19:45:12 +05:30
Raj Nandan Sharma 14f49c5b3b Features role-based access control and user management
Implements role-based access control with admin, editor, and member roles.

Introduces a user management system with profiles, activation/deactivation, and password reset.

Adds an email authentication system with verification and password reset via email.

Includes an invitation system with token-based invitations and admin controls.

Improves performance, security, UI, and developer experience.

Updates package version to 3.2.5 and adds vite-plugin-package-version.

Removes libcap related code from Dockerfile.
2025-03-18 23:08:51 +05:30
Raj Nandan Sharma 52286f26a5 fix: update version to 3.2.5 and reflect changes in User-Agent and documentation 2025-03-13 09:55:04 +05:30
github-actions 45e7567cb6 Auto-generate README.md with release versions 2025-03-12 17:48:41 +00:00
Raj Nandan Sharma c0edb59884 chore: update version to 3.2.4 and reflect changes in User-Agent and documentation 2025-03-12 23:16:48 +05:30
Raj Nandan Sharma 1e86c429ca fix: install libcap tools for setting capabilities in Dockerfile 2025-03-12 23:00:18 +05:30
Raj Nandan Sharma fbaebdcbcf Merge pull request #344 from rajnandan1/fix-ping-non-root
refactor: clean up Dockerfile and improve security practices
2025-03-12 22:49:47 +05:30
Raj Nandan Sharma 3f9716b0a4 fix: update donation links from GitHub Sponsors to Buy Me a Coffee 2025-03-12 22:48:53 +05:30
Raj Nandan Sharma 57d32197cf chore: update version to 3.2.3 and reflect changes in documentation and headers 2025-03-12 22:05:25 +05:30
Raj Nandan Sharma 9e6a3f26c2 refactor: clean up Dockerfile and improve security practices 2025-03-12 21:30:06 +05:30
github-actions 23314beb15 Auto-generate README.md with release versions 2025-03-08 18:58:59 +00:00
Raj Nandan Sharma 64b94da585 Merge pull request #340 from rajnandan1/release/3.2.2
Release/3.2.2
2025-03-08 22:57:28 +05:30
Raj Nandan Sharma 1609b4fc50 refactor: remove unnecessary future and ongoing incident checks from IncidentNew component 2025-03-08 22:56:57 +05:30
Raj Nandan Sharma dfffffb101 fix: remove database directory writable check from entrypoint script 2025-03-08 22:26:14 +05:30
Raj Nandan Sharma 81250a117a chore: update version to 3.2.2 in package.json and documentation 2025-03-08 22:18:53 +05:30
Raj Nandan Sharma 72bd0241e9 fix: streamline incident creation logic for database compatibility , fixes #325 2025-03-08 22:17:48 +05:30
Raj Nandan Sharma 63c24f147f fix: remove redundant startup command in entrypoint script #338 2025-03-08 21:19:46 +05:30
Raj Nandan Sharma 88fb7df3f5 Enhances incident display with time status
Improves the incident display by adding time status information
such as "Starts in", "Started", and "Will last for".
Also fixes database directory write permissions on startup.

Also fixes #337
2025-03-08 21:17:34 +05:30
Raj Nandan Sharma 320b1a0cc5 Improves webhook and notification handling
- Makes the monitor tags wrap on smaller screens.
- Validates webhook body.
- Adds user agent to webhook.
- Fixes Discord logo URL construction.

Issue #336
2025-03-07 20:09:35 +05:30
Raj Nandan Sharma 08b168ee6e Merge pull request #331 from rajnandan1/feature/hb1
Adds heartbeat monitor and improvements
2025-03-01 21:56:21 +05:30
Raj Nandan Sharma d6a87ac81a docs: update heartbeat monitors description for clarity
refactor: remove unused RandomString import from monitorSheet component

chore: clean up commented-out code in FetchData function
2025-03-01 21:55:37 +05:30
Raj Nandan Sharma 615dba42b8 fix: change default monitor type from HEARTBEAT to NONE 2025-03-01 21:02:12 +05:30
Raj Nandan Sharma 3ffec4f1fe Adds heartbeat monitor and improvements
Implements push-based monitoring via heartbeats.

Fixes data interpolation issues.

Enhances UI and documentation.
2025-03-01 21:00:05 +05:30
Aj7ay7 1288b463f1 Aj7ay7/fix/docker-compose-config
hotfix: updated container_name in compose
2025-02-28 23:21:02 +05:30
Aj7ay7 1aed6d0703 hotfix: updated container_name in compose 2025-02-28 23:20:38 +05:30
Aj7ay7 69f1e69140 Merge pull request #2 from Aj7ay7/revert-1-fix/docker-compose-config-validation
Revert "hotfix: Docker Compose Configuration Issues"
2025-02-28 23:17:52 +05:30
Aj7ay7 ab4ecd29c6 Revert "hotfix: Docker Compose Configuration Issues" 2025-02-28 23:17:40 +05:30
Aj7ay7 1d76c8a3d3 fix: docker-compose-config-validation
hotfix: Docker Compose Configuration Issues
2025-02-28 23:13:49 +05:30
Aj7ay7 b1c2cedbac hotfix: Docker Compose Configuration Issues 2025-02-28 23:11:13 +05:30
Raj Nandan Sharma 60b4b6f207 Merge pull request #327 from rajnandan1/feature/hb
feat: enhance documentation and add donation banner for Kener
2025-02-28 10:00:37 +05:30
Raj Nandan Sharma b9f5eb56c5 feat: enhance documentation and add donation banner for Kener 2025-02-28 09:59:39 +05:30
github-actions 7b9ae73044 Auto-generate README.md with release versions 2025-02-27 05:47:27 +00:00
Raj Nandan Sharma 87f2c33eba Merge pull request #323 from rajnandan1/feature/optimize-1
feat: upgrade to version 3.2.0 with improved monitor evaluation funct…
2025-02-27 10:54:40 +05:30
Raj Nandan Sharma 0a73a8b10a fix: update eval function to use responseRaw instead of responseData 2025-02-27 10:53:23 +05:30
Raj Nandan Sharma af65404fd3 feat: upgrade to version 3.2.0 with improved monitor evaluation functions and enhanced API support 2025-02-27 10:46:59 +05:30
github-actions 398f891dac Auto-generate README.md with release versions 2025-02-27 01:19:17 +00:00
Raj Nandan Sharma 6a2375a774 Merge pull request #322 from rajnandan1/fix/optimize
fix: eval not working for api
2025-02-27 06:30:30 +05:30
Raj Nandan Sharma 43bbcf4015 fix: eval not working for api 2025-02-27 06:29:39 +05:30
github-actions fadb563337 Auto-generate README.md with release versions 2025-02-26 07:02:13 +00:00
Raj Nandan Sharma 1ae54b3906 Improve formatting and add video tutorial section in quick start documentation 2025-02-26 12:20:17 +05:30
Raj Nandan Sharma 1c069e2ee2 Bump version to 3.1.9 and update documentation layout 2025-02-26 12:12:17 +05:30
Raj Nandan Sharma ed1099ac11 Merge pull request #319 from rajnandan1/feature/sql-monitor
Adds SQL monitor functionality as asked in #244
2025-02-26 12:09:39 +05:30
Raj Nandan Sharma 99d3a7e046 Adds SQL monitor functionality as asked in #244
Implements the SQL monitor feature, allowing users to monitor database connections and queries.

Adds UI elements for configuring SQL monitor parameters, including connection string, query, and timeout.

Validates user inputs for SQL monitor configuration.
2025-02-26 12:06:05 +05:30
Raj Nandan Sharma 2144acf34d Merge pull request #318 from rajnandan1/feature/ssl
Add SSL monitor functionality and related documentation #317
2025-02-26 09:15:46 +05:30
Raj Nandan Sharma 7a8ad8e833 Enhance port validation logic in SSL configuration for improved error handling 2025-02-26 09:14:04 +05:30
Raj Nandan Sharma 3b45f33692 Remove unnecessary assignment of type_data in monitorSheet component 2025-02-26 09:11:26 +05:30
Raj Nandan Sharma b4a2340ec7 Add SSL monitor functionality and related documentation #317 2025-02-26 09:09:20 +05:30
Raj Nandan Sharma 5910e3b930 Merge pull request #315 from rajnandan1/feature/css-cls
Refactor section classes for improved styling and organization in the…
2025-02-24 22:05:54 +05:30
Raj Nandan Sharma fd58beaa69 Refactor section classes for improved clarity and organization in incident page layout 2025-02-24 22:05:16 +05:30
Raj Nandan Sharma 5449e422a5 Refactor section classes for improved styling and organization in the hero and event sections 2025-02-24 22:02:53 +05:30
Raj Nandan Sharma dfb1784b6f Merge pull request #312 from rajnandan1/feature/cheerio
Add cheerio dependency and enhance API call examples with HTML parsing
2025-02-24 07:01:24 +05:30
Raj Nandan Sharma d956c60b48 Add cheerio dependency and enhance API call examples with HTML parsing 2025-02-24 06:56:09 +05:30
github-actions 69e1f2af6e Auto-generate README.md with release versions 2025-02-23 12:41:00 +00:00
Raj Nandan Sharma 7cc2f5ed4b Refactor i18n documentation for improved clarity and consistency in localization instructions 2025-02-23 17:46:54 +05:30
Raj Nandan Sharma ce2b17a5c9 Merge pull request #311 from rajnandan1/fix/double-trigger
Refactors incident handling and cron scheduling
2025-02-23 17:45:35 +05:30
Raj Nandan Sharma 0fcc60bf65 Bump version to 3.1.8 and update changelog with new features, improvements, and fixes 2025-02-23 17:39:26 +05:30
Raj Nandan Sharma 45ac25055b Enhances internationalization support by adding localized timezone messages and updating UI text for language consistency 2025-02-23 16:55:44 +05:30
Raj Nandan Sharma d3e201f2e4 Adds timezone support and UI toggle
Improves date formatting by adding timezone support using `date-fns-tz`.

Allows users to switch between different timezones via a new UI toggle in the settings.
Updates dependencies and integrates timezone functionality into date formatting functions.
2025-02-23 16:35:41 +05:30
Raj Nandan Sharma 693735dc2e Improves monitor component and incident handling
Refactors the monitor component for better data display and user interaction, including improved uptime calculations and a dropdown for selecting time ranges.

Enhances incident creation and handling by adding incident sources and refining incident filtering.

Addresses UI responsiveness on smaller screens.
2025-02-22 23:00:33 +05:30
Raj Nandan Sharma a4fa85dd79 Refactors incident handling and cron scheduling
Improves incident management by filtering out existing auto incidents when creating manual incidents.

Enhances cron job scheduling by removing and adding jobs dynamically based on active monitors and prevents duplicated incidents.
Also, ensures jobs get triggered in the correct order.
2025-02-22 11:48:39 +05:30
github-actions 29f70860ef Auto-generate README.md with release versions 2025-02-20 03:17:31 +00:00
Kyle ae882f6afc Merge pull request #305 from kaffolder7/fix/docker-image-tagging
fix: docker gha build
2025-02-19 19:19:57 -05:00
Kyle 57941f67ce Merge branch 'rajnandan1:main' into fix/docker-image-tagging 2025-02-19 19:19:10 -05:00
Kyle Affolder ab356d516b fix(docker): gha build
Pulled version number from release rather than via tag (since this workflow is triggered by release).
2025-02-19 19:17:56 -05:00
Kyle Affolder d11b3f1a99 fix(docker): gha build 2025-02-19 19:15:14 -05:00
Kyle 83ba08dd6b Merge pull request #304 from kaffolder7/fix/docker-image-tagging
fix(docker): clean up Docker tagging
2025-02-19 18:41:08 -05:00
Kyle Affolder 34cc00a1f6 fix(docker): clean up Docker tagging
Simplified Docker tagging - in turn fixes broken `alpine` tag to correctly point to latest stable Alpine release. Changes include:

- No more type=ref,event=branch – because this workflow is only for releases & manual triggers on `main` branch.
- Ensures `alpine` tag is always created for Alpine variant builds.
- Ensures `latest` tag is always created for Debian builds.
- Ensures all semver-based tags work correctly for both variants.
2025-02-19 18:39:34 -05:00
github-actions 7b86429056 Auto-generate README.md with release versions 2025-02-19 22:50:32 +00:00
Kyle e67c1b1539 Merge pull request #303 from kaffolder7/fix/docker-image-tagging
debug(docker): tagging issue
2025-02-19 17:36:20 -05:00
Kyle Affolder e501f8e05d debug(docker): tagging issue
Debugging `alpine` tag as it does not seem to be pointing to the most recent stable release.
2025-02-19 17:35:46 -05:00
github-actions 9e40d89317 Auto-generate README.md with release versions 2025-02-19 04:58:24 +00:00
Raj Nandan Sharma 5d475ab23f Merge pull request #302 from rajnandan1/fix/incidents-1
Fix/incidents 1
2025-02-19 10:12:08 +05:30
Raj Nandan Sharma 01cb39e18e Bump version to 3.1.7 and update favicon type label; improve incident description formatting 2025-02-19 10:10:31 +05:30
Raj Nandan Sharma 0d0ef25970 Improve documentation for SMTP configuration and add external link button in monitors management 2025-02-19 09:52:09 +05:30
Raj Nandan Sharma 6c766e2001 Enhances incident management and SMTP configuration
Improves incident display and management by introducing configurable incident group views and enhancing comment rendering to support HTML content.

Solves the bug raised in #295 where server crashes when an incident is created from an alert

Refines SMTP email settings by adding TLS configuration and allowing username/password to be optional. #300 and #298

Also, fixes a bug where only home page was being filtered. Now all pages are filtered. #297
2025-02-19 07:05:24 +05:30
Raj Nandan Sharma 1c73166120 Merge pull request #292 from kaffolder7/feature/embed-webfont
feat: embed project webfont
2025-02-18 07:46:56 +05:30
github-actions fc5dbc85dc Auto-generate README.md with release versions 2025-02-18 02:06:31 +00:00
Raj Nandan Sharma 622327cdf6 Merge pull request #294 from rajnandan1/fix/293-and-287
Bump version to 3.1.6 and update affected status handling in database…
2025-02-18 07:22:13 +05:30
Raj Nandan Sharma b0a4cd5c42 Bump version to 3.1.6 and update affected status handling in database queries for pg db reported in #293 and #287 2025-02-18 07:20:08 +05:30
Kyle Affolder 8c95c94472 update: combine to avoid multiple processes
Combined to reduce spawning multiple `rm` processes.
2025-02-17 13:29:34 -05:00
Kyle Affolder 7dafb2eddc add: GHA job to confirm if Dependabot PRs exist
Adds job to check if any Dependabot PRs are open and if so, fail the Docker build (since we need to ensure OS packages exist and are in their correct versions when using pinned versions for security purposes).
2025-02-17 13:24:22 -05:00
Kyle Affolder 7c9f3eb87f add: add back pinned tzdata version
Necessary for Dependabot to track
2025-02-17 13:22:15 -05:00
Kyle ab34dd81f8 Merge branch 'rajnandan1:main' into feature/dependabot-version-updates 2025-02-17 13:04:23 -05:00
Kyle Affolder 4e5fb26be1 add: CSS rule in EditorConfig 2025-02-17 12:53:29 -05:00
Kyle Affolder 6fc80bc0fc change: ensure full Lato font is kept from build
Ensures that the full variant of the Lato font-family is kept/removed from Docker image build. (Keeps the size small!)
2025-02-17 12:27:32 -05:00
Kyle Affolder 292667ac29 add: Lato webfont
Noticed multiple individuals commenting about insecure/privacy-unfriendly Lato webfont library being served via Google Fonts. I had formerly suggested replacing this with BunnyFonts and was happy to see that added as a placeholder, however, I also understand someone’s comment about this being loaded from an external resource.

This brings that webfont local. Size of webfont files should minimally grow Docker image sizes and I think we should prioritize UI and privacy by including it locally. The font’s licensing is OFL, so we are allowed to package it for distribution with this project.

I’m including both the full font family (for archival purposes) and Latin subset of this font. The Latin variant is used in the Docker image build (since this will apply to the majority of users and keep the Docker image smaller). If users need to extend this with their own subsets, they can always load those as a custom font. :)
2025-02-17 12:26:15 -05:00
Kyle Affolder 8c03058f8d update: combine to avoid multiple processes
Combined to reduce spawning multiple `rm` processes.
2025-02-17 12:21:57 -05:00
github-actions 25e73d097c Auto-generate README.md with release versions 2025-02-17 05:36:58 +00:00
Raj Nandan Sharma 1970cd8891 Merge pull request #291 from rajnandan1/fix/288-interpolation
Fix/288 interpolation
2025-02-17 10:51:34 +05:30
Raj Nandan Sharma 8ae9b2dec1 Bump version to 3.1.5 and update documentation layout 2025-02-17 10:48:22 +05:30
Raj Nandan Sharma 1662608984 Improves monitor status and data handling
Adds a NO_DATA status to handle cases where monitor data is unavailable.
Refactors data interpolation and aggregation logic for better accuracy and clarity.
Updates documentation links.

fixes #288
2025-02-17 10:47:47 +05:30
github-actions 42693983f1 Auto-generate README.md with release versions 2025-02-17 01:51:55 +00:00
Raj Nandan Sharma f43048d783 fix: update documentation version to 3.1.4 2025-02-17 07:06:35 +05:30
Raj Nandan Sharma b5ec332b4a Updates version to 3.1.3 and fixes group query
Updates the Kener version from 3.1.2 to 3.1.3.

Refactors the group query to use `havingRaw` for better compatibility across different database systems.

Adds database information to the bug report template.
2025-02-17 07:05:31 +05:30
github-actions dab1c44b18 Auto-generate README.md with release versions 2025-02-16 14:48:25 +00:00
Raj Nandan Sharma d9c0bff780 fix: update Dockerfile to remove specific tzdata version for compatibility 2025-02-16 19:56:15 +05:30
Raj Nandan Sharma beceace2c2 fix: update Dockerfile to correct documentation directory removal path 2025-02-16 19:23:45 +05:30
Raj Nandan Sharma 5373636704 Merge pull request #289 from rajnandan1/feature/category-status
Feature/category status
2025-02-16 19:09:22 +05:30
Raj Nandan Sharma e8d04eccf6 chore: bump version to 3.1.2 in package.json and update documentation layout 2025-02-16 19:08:01 +05:30
Raj Nandan Sharma d978c82263 Updates documentation and Dockerfile configuration
Updates documentation to reflect the new directory structure.
The documentation now correctly references images in the `/documentation` directory.
Removes the `src/static/documentation` directory in the Dockerfile.
2025-02-16 18:31:18 +05:30
Raj Nandan Sharma 883a458ed3 feat: add GroupCall service and integrate into monitoring logic #249 and #221 2025-02-16 12:23:58 +05:30
Raj Nandan Sharma 9009d9df99 refactor: streamline modal close logic and clear URL hash 2025-02-14 15:33:56 +05:30
Raj Nandan Sharma 81c0fa1243 fix: clear URL hash when modals are closed 2025-02-13 23:11:58 +05:30
github-actions 01221616ae Auto-generate README.md with release versions 2025-02-13 04:51:19 +00:00
Raj Nandan Sharma be75a0f5e9 Merge pull request #286 from rajnandan1/fix/seed-data-no-trackers
fix: update site metadata and image references for clarity
2025-02-13 10:05:46 +05:30
Raj Nandan Sharma 1b40839490 fix: update site metadata and image references for clarity 2025-02-13 10:02:18 +05:30
Raj Nandan Sharma 80f5780602 Merge pull request #284 from rajnandan1/feature/url-images
feat: Updates CSS and Svelte components
2025-02-12 22:23:16 +05:30
Raj Nandan Sharma dcf1817cd6 fix: add rel attribute to external link in monitor component 2025-02-12 22:21:41 +05:30
Raj Nandan Sharma ae251803ad refactor: remove unused sitemap generation code and update site metadata for clarity 2025-02-12 22:15:42 +05:30
Raj Nandan Sharma f6d9627ceb fix: update site title for clarity and conciseness 2025-02-12 22:07:58 +05:30
Raj Nandan Sharma 0cbc6b7b56 Update hero title for clearer branding
Updates hero title text to emphasize quick status page creation
and improves consistency in site configuration.
2025-02-12 22:05:51 +05:30
Raj Nandan Sharma f0af2d14e4 feat: Updates CSS and Svelte components
Enhances incident display with improved component structure.
2025-02-12 22:00:12 +05:30
github-actions b797039144 Auto-generate README.md with release versions 2025-02-12 02:49:23 +00:00
Kyle 86e29e5065 Merge pull request #283 from kaffolder7/fix/generate-readme-gha
fix(gha): generate-readme
2025-02-11 21:48:24 -05:00
Kyle Affolder fddef22e8e fix(gha): generate-readme
Was missing fallbacks in case repo variable was not set.
2025-02-11 21:47:52 -05:00
github-actions ad7551b7af Auto-generate README.md with release versions 2025-02-12 02:38:53 +00:00
Kyle Affolder a8be878a87 update: commented out node.js deps. monitoring
Not sure if we are wanting Dependabot to track Node.js packages, so for the time being, commenting this block out, but leaving for now w/ “TODO” to come back to at a later point.
2025-02-11 17:54:37 -05:00
Kyle Affolder 2b1849f1a3 update: grammar updates 2025-02-11 17:47:45 -05:00
Kyle Affolder 25a6590324 Merge branch 'feature/dependabot-version-updates' of https://github.com/kaffolder7/kener into feature/dependabot-version-updates 2025-02-11 17:31:48 -05:00
Kyle Affolder fa251dc07f update: README generation workflow 2025-02-11 17:31:33 -05:00
Kyle 4de93e7e95 Merge branch 'main' into feature/dependabot-version-updates 2025-02-11 17:25:28 -05:00
Kyle Affolder a5e5f33dc8 Merge branch 'main' into feature/dependabot-version-updates
# Conflicts:
#	.github/workflows/publish-images.yml
#	Dockerfile
2025-02-11 17:17:45 -05:00
Kyle f09eb18bcc Merge pull request #279 from kaffolder7/fix/readme-generation
fix: protect-readme workflow
2025-02-11 15:48:00 -05:00
Kyle 5c65e35f24 Merge branch 'rajnandan1:main' into fix/readme-generation 2025-02-11 15:46:45 -05:00
Kyle Affolder 8cbe859971 fix: protect-readme workflow 2025-02-11 15:46:05 -05:00
Kyle 67f38db847 Merge pull request #278 from kaffolder7/fix/readme-generation
fix: README generation
2025-02-11 15:41:12 -05:00
Kyle Affolder 28a72a3592 fix: README generation
Changed from trying to use artifacts and the GHA workflow failing to now using a simple `BUILD_VERSION` repository variable and automatically updating that when the `build-and-push-to-registries` workflow succeeds.

Other changes include:

* Added `workflow_run` trigger to `generate-readme.yml` so when that workflow recognizes the “Publish Docker Image to Registries” workflow runs and succeeds, it will automatically run the `generate-readme.yml` workflow (since a new Docker release will require Docker image variants table in README.md to have versioning updated)
* Generate major and major-minor versions from the `BUILD_VERSION` repository variable (more efficient than storing three separate variables from the `build-and-push-to-registries` workflow job)
2025-02-11 15:39:42 -05:00
Kyle dae334694d Merge pull request #274 from kaffolder7/feature/multi-arch-docker-build
manual readme update
2025-02-10 23:48:37 -05:00
Kyle e57fe3a046 Merge branch 'rajnandan1:main' into feature/multi-arch-docker-build 2025-02-10 23:48:04 -05:00
Kyle Affolder 54670c7845 fix: broken Docker latest ver. badge
Setting up to also pull latest ver. value from Mustache template
2025-02-10 23:47:28 -05:00
Kyle 3dbcef1500 Merge pull request #273 from kaffolder7/feature/multi-arch-docker-build
manual readme update
2025-02-10 23:36:18 -05:00
Kyle 24bbad05cb Merge branch 'rajnandan1:main' into feature/multi-arch-docker-build 2025-02-10 23:34:41 -05:00
Kyle Affolder cacbda3164 manual update
until I can get CI/CD pipeline debugged and fixed
2025-02-10 23:34:23 -05:00
Kyle da9b1a3a64 Merge pull request #272 from kaffolder7/feature/multi-arch-docker-build
fix: missing versions artifact
2025-02-10 23:25:38 -05:00
Kyle Affolder 394b911eca Merge branch 'feature/multi-arch-docker-build' of https://github.com/kaffolder7/kener into feature/multi-arch-docker-build 2025-02-10 23:25:03 -05:00
Kyle Affolder 220778e84f fix: missing versions artifact 2025-02-10 23:24:24 -05:00
Kyle c6e343da5d Merge pull request #271 from kaffolder7/feature/multi-arch-docker-build
fix: README build
2025-02-10 23:17:49 -05:00
Kyle 268e5b7478 Merge branch 'rajnandan1:main' into feature/multi-arch-docker-build 2025-02-10 23:17:13 -05:00
Kyle Affolder b9ccd16a02 fix: delete existing version artifact
* Delete existing version artifact if it exists
* Upload `versions.txt` only on first successful job
2025-02-10 23:16:20 -05:00
Kyle 302ad0e8a6 Merge pull request #270 from kaffolder7/feature/multi-arch-docker-build
fix: CI/CD README generation pipeline
2025-02-10 23:00:39 -05:00
Kyle Affolder e052f435db fix(README): docker versions table
Attempting to fix CI/CD pipeline so that README generation succeeds and versions are properly injected.
2025-02-10 22:58:55 -05:00
Kyle Affolder caa1330f39 remove: unnecessary attribute 2025-02-10 22:56:54 -05:00
Raj Nandan Sharma 870d19f566 docs: updated deployment docs 2025-02-11 08:39:09 +05:30
github-actions a28f787833 Auto-generate README.md with release versions 2025-02-11 01:55:21 +00:00
Raj Nandan Sharma 335a51b589 Merge pull request #265 from rajnandan1/release/3.0.13
feat: test monitors in manage monitor dashboard
2025-02-11 07:08:50 +05:30
Raj Nandan Sharma 72f9471486 chore: merged main with new release/3.1.0 2025-02-11 07:06:45 +05:30
Raj Nandan Sharma f0cd101af5 Merge branch 'main' into release/3.0.13 2025-02-11 07:04:12 +05:30
Raj Nandan Sharma 52876bd77e fix: fix #266 2025-02-11 07:01:17 +05:30
Raj Nandan Sharma aabe1926bd Merge pull request #268 from kaffolder7/feature/multi-arch-docker-build
fix: README generation
2025-02-11 06:55:28 +05:30
Kyle Affolder e785227064 Merge branch 'feature/multi-arch-docker-build' of https://github.com/kaffolder7/kener into feature/multi-arch-docker-build 2025-02-10 17:22:47 -05:00
Kyle Affolder 0cb88eec3b update: cleanup 2025-02-10 17:22:28 -05:00
Kyle 8cd2914f73 Merge branch 'rajnandan1:main' into feature/multi-arch-docker-build 2025-02-10 17:19:11 -05:00
Kyle Affolder f70e2ee8eb update: CI/CD pipeline
Changes include:

* Moving README generation to separate workflow (so that it can be trigger to run when any changes to `README.template.md` are pushed to `main` branch or a PR is opened with changes to template file
* GitHub Actions do not have privileges via `GITHUB_TOKEN` to commit to protected branches, thus, we need to take another approach and utilize a personal access token (which you’ll need to generate @rajnandan1) and add to the repository secrets (to avoid exposing that credential).
* Changes `publish-images` workflow to run now only when a new GitHub Release is created. (This will help prevent excessive workflow runs on merges into `main`)…in other words, @rajnandan1, you can merge freely into `main` now without excessive GitHub Actions usage.
2025-02-10 17:18:06 -05:00
Kyle c60a21ef32 Merge pull request #267 from kaffolder7/feature/multi-arch-docker-build
fix: multi-arch docker build
2025-02-10 16:19:01 -05:00
Kyle Affolder 77a57ee609 fix(docker): build issues
The following changes have been made:

* Ensured `package-lock.json` is up-to-date with latest dependencies from `package.json` - moved check to new workflow job and set as dependency for ‘build-and-push-to-registries’ job
* Updated branch-tagging for non-main branches (used when building Docker images)
* Restored pinned OS package versions in Dockerfile (for best-security)
* Restored “TODO” comments to Dockerfile (for tracking purposes and because I will revisit those items later this week)
* Added `—no-fund` tag to suppress npm package funding messages (helpful for CI/CD)
* Changed from `wget` to `curl` to resolve Debian package versioning issue between differing architectures (was one of the reasons causing the build to fail)
* As a part of the last comment, needed to then conditionalize container healthcheck logic
* Checked in newest `package-lock.json` file
* Fixed broken Docker badges in `README.template.md`
2025-02-10 16:15:08 -05:00
Kyle fc15f0e083 Merge branch 'rajnandan1:main' into feature/multi-arch-docker-build 2025-02-10 12:54:09 -05:00
Raj Nandan Sharma 6115beece3 fix: docker fix 2025-02-10 23:05:06 +05:30
Kyle Affolder 54434fbe78 fix: update package-lock.json
Hopefully will fix “npm error Missing: mustache@4.2.0 from lock file” error in broken GitHub Action docker build
2025-02-10 12:32:51 -05:00
Raj Nandan Sharma 83755bdd25 fix: docker fix 2025-02-10 22:59:07 +05:30
Raj Nandan Sharma 08f901c5f0 fix: docker fix 2025-02-10 22:53:30 +05:30
Raj Nandan Sharma 06910fbd4d fix: docker fix 2025-02-10 22:46:33 +05:30
Raj Nandan Sharma 154e7dd185 fix: docker fix 2025-02-10 22:41:18 +05:30
Raj Nandan Sharma 8bde3226bf Merge pull request #258 from kaffolder7/feature/multi-arch-docker-build
refactor(docker): multi-arch docker 🐳 build overhaul 🏗️
2025-02-10 22:04:28 +05:30
Kyle Affolder e5565145b5 fix(docker): action version number 2025-02-10 11:24:07 -05:00
Kyle Affolder 37a667daff fix(docker): dynamic README generation
🔄 Automate README Generation via Mustache Templating

- Use Mustache to dynamically generate `README.md` from `README.template.md`.
- Populate README with environment variables (e.g., `KENER_BUILD_FULL_VERSION`).
- Prevent direct edits to `README.md` by enforcing updates via the template.
- Enhance GitHub Actions workflow to auto-generate and commit the README.
- Add GitHub Action workflow (`protect-readme.yml`) to prevent others from direct updates to `README.md` via PR.
2025-02-10 11:21:22 -05:00
Kyle Affolder eda98bacfc update(docker): temporarily remove README updating
I caught an issue where the README will only auto-update listed Docker versions the first time. Commenting out for now (in case this PR gets merged before I have time to fix this). Will revisit this and fix this week.
2025-02-10 09:27:11 -05:00
Raj Nandan Sharma ee1ee52e13 feat: test monitors in manage monitor dashboard 2025-02-10 11:06:36 +05:30
Kyle Affolder 4060094404 add(dependabot): to automate dependency updates
Integrating Dependabot into the workflow ensures automatic dependency updates, improving security, reducing technical debt, and keeping packages up to date with minimal manual effort. This helps prevent vulnerabilities and maintain code stability over time.

Dependabot will automatically monitor the project’s dependencies and open pull requests (PRs) to update them when new versions are released. Here’s how it works:

1. Scans for Outdated Dependencies – It checks project dependency files (e.g., package.json, Dockerfile, .env.build, etc.) for outdated versions.
2. Fetches Latest Versions – When a newer version of a dependency is available, Dependabot retrieves it and updates the dependency files accordingly.
3. Opens a Pull Request – It then creates a PR with the updated dependency, detailing the changes and linking to release notes, changelogs, or security advisories.
4. Runs CI/CD Tests – If we end up setting up continuous integration (CI) tests, the PR will trigger the tests to check for breaking changes.
5. Security Updates – Dependabot also detects vulnerable dependencies and creates PRs to update them to a secure version.
6. Auto-Merging (Optional) – We might consider this at a later point, but if configured, it can automatically merge PRs when updates pass all tests and meet the requirements.
2025-02-09 22:08:06 -05:00
Kyle d03bf41ad1 Merge branch 'rajnandan1:main' into feature/multi-arch-docker-build 2025-02-09 21:56:54 -05:00
Raj Nandan Sharma ba2fe24629 Merge pull request #262 from rajnandan1/release/3.0.12
feat: adding hash params for modals in manage
2025-02-09 22:13:33 +05:30
Raj Nandan Sharma 547116090a feat: adding hash params for modals in manage 2025-02-09 22:11:07 +05:30
Raj Nandan Sharma 974826f42d Merge pull request #261 from rajnandan1/release/3.0.11
fix: handle ping migration
2025-02-09 19:49:46 +05:30
Raj Nandan Sharma 4914b029f9 fix: handle ping migration 2025-02-09 19:38:16 +05:30
Kyle Affolder ff864fbaab fix(README): restore accidentally removed tag
Noticed when doing some cleanup, that you had two awesome tags, but they both point to different URLs/repos. I added back in the one I had inadvertently removed.
2025-02-09 01:04:53 -05:00
Kyle Affolder f583ba4938 update(docker): README badge direct links
add direct links to filtered image(s) on Docker Hub, based on whether Debian or Alpine Linux variant badges are clicked
2025-02-09 00:44:28 -05:00
Kyle Affolder d552f541ac fix(docker): remove unnecessary files from build 2025-02-09 00:35:59 -05:00
Kyle d46d02e37a Merge branch 'main' into feature/multi-arch-docker-build 2025-02-09 00:26:21 -05:00
Raj Nandan Sharma 4e0c6e85da style: added more readme badges 2025-02-09 09:31:01 +05:30
Raj Nandan Sharma 1147808366 Merge pull request #256 from kaffolder7/feature/small-improvements
feat: small improvements
2025-02-09 09:04:13 +05:30
Kyle a7c27a60e0 Merge branch 'rajnandan1:main' into feature/multi-arch-docker-build 2025-02-08 15:32:48 -05:00
Kyle Affolder 974976bd90 update(docker): expanded on existing examples 2025-02-08 15:31:32 -05:00
Kyle Affolder 9bbe665984 update(docker): add TODO comments for future work 2025-02-08 14:22:16 -05:00
Kyle Affolder d0ea8551b6 update(docker): add TODO comments for future work 2025-02-08 13:56:11 -05:00
Kyle Affolder 089ee9bc07 update(formatting): made consistent
Aligned `.prettierrc` and `.editorconfig` files to same, best-practice & most-widely-adopted standards.
2025-02-08 13:39:41 -05:00
Raj Nandan Sharma 786c4f8207 fix: fixed cookie getting set in different paths from client side when language was changed^C 2025-02-08 21:37:18 +05:30
Raj Nandan Sharma 13879aefdd Merge pull request #253 from VincentDatrier/main
Add Norwegian (Bokmål) as an available locale
2025-02-08 17:01:07 +05:30
Kyle Affolder d03a8fd7a4 update(README): fix typo 2025-02-08 04:52:17 -05:00
Kyle Affolder c00aae5566 update(README): adjusted emoji spacing 2025-02-08 04:50:06 -05:00
Kyle Affolder e923f4d650 update(README): proofread and polished ☺️ 2025-02-08 04:48:30 -05:00
Kyle Affolder 654c07a364 fix(README): table subheading alignment 2025-02-08 04:19:34 -05:00
Kyle Affolder 820eeb0aac fix(README): table subheading alignment 2025-02-08 04:18:27 -05:00
Kyle Affolder 2a338baa26 fix(README): remove broken icons that were added 2025-02-08 04:17:16 -05:00
Kyle Affolder ec7351272f add(docker): missing entrypoint.sh file 2025-02-08 04:13:47 -05:00
Kyle Affolder 13dec43ef3 update(docker): expanded docker readme section
* Expanded upon existing Docker README section.
* Created table which will contains version placeholder variables that will be replaced by new GitHub workflow job: “update_readme”. Job automatically runs after new images have been built & pushed to container registries.
2025-02-08 04:12:50 -05:00
Kyle Affolder 43673e3349 add(workflow): allow admin to manually build 2025-02-08 04:08:45 -05:00
Kyle Affolder 1e77253a63 update(docker): healthcheck port & path + cleanup 2025-02-08 02:12:31 -05:00
Kyle Affolder 798af326a2 fix: update docs link to online documentation
Default documentation link in main nav won’t work because /docs are not included in built Docker images (to keep image smaller). Instead, changing seed data to point to the docs homepage. :)
2025-02-08 00:13:49 -05:00
Kyle Affolder d349a7591e update(docker): ver. pinning, healthcheck, etc.
* add: version pinning (better stability)
* remove: unnecessary KENER_BASE_PATH env. variable
* update: reduce permissions of /uploads and /database directories
* add: `entrypoint.sh` file
* add: properly map container timezone and localtime
* add: container healthcheck
* change: restrict to non-root “node” user
2025-02-08 00:04:19 -05:00
Kyle Affolder 8370145f6c update: change fonts API
Switching from Google Fonts to Bunny Fonts CDN. Bunny Fonts is an open-source, privacy-first web font platform. It is fully GDPR compliant (Google is not) and can act as a drop-in replacement for Google Fonts.
2025-02-07 20:14:45 -05:00
Kyle 304945acea Merge branch 'rajnandan1:main' into feature/small-improvements 2025-02-07 19:51:50 -05:00
Kyle Affolder 1dd05fee50 update: tweaked ordering of env variables 2025-02-07 14:58:33 -05:00
Kyle 374eda4103 Merge branch 'rajnandan1:main' into feature/multi-arch-docker-build 2025-02-07 14:55:05 -05:00
Kyle Affolder 52a8cca3e8 fix(docker): broken build & run as non-root user 2025-02-07 13:06:17 -05:00
Vincent Datrier 22ef4d75b6 Trigger GitHub Actions 2025-02-07 14:11:39 +01:00
Vincent Datrier 534e6a0ad3 Updated nb-NO locale with new strings 2025-02-07 13:46:32 +01:00
Vincent Datrier 80ed4fc5fa Merge branch 'main' of github.com:VincentDatrier/kener 2025-02-07 13:42:06 +01:00
Raj Nandan Sharma 445eb02386 chore: optimized seo 2025-02-07 10:24:06 +05:30
Raj Nandan Sharma 53ae0b89b0 chore: optimized seo 2025-02-07 10:16:49 +05:30
Raj Nandan Sharma c7376b4d8f Merge pull request #250 from rajnandan1/release/3.0.10
Release/3.0.10
2025-02-07 09:13:20 +05:30
Raj Nandan Sharma e3e59b7e24 feat: adding tcp monitor, reinstating ping as reported in #243 2025-02-07 09:12:15 +05:30
Raj Nandan Sharma 07f59ac581 feat: adding tcp monitor, reinstating ping as reported in #243 2025-02-07 09:02:28 +05:30
Kyle Affolder 7176c3d4f4 refactor(gha): update gh publish image workflow
Streamlined the GitHub `publishImage.yml` workflow with the following functionality:

* Handle both Alpine and Debian variants through matrix strategy
* Push to both Docker Hub and GitHub Container Registry
* Add comprehensive tagging strategy, handling both branches (aka release version, e.g. 1.0.0), semantic versions (major.minor and major), and latest versions (`latest` and `alpine`)
* Add security aspects (cosign signing, proper permissions)
* Add better caching and multi-platform build settings

With this revised workflow, the following Docker image variants will be built for every successful release. As an example, if the release version is “3.0.9”, then the following Docker image variants will be built:

Debian variants (default):
- `kener:3.0.9` (Semver of current release)
- `kener:latest` (Latest Debian release, ’latest’ label points to 3.0.9)
- `kener:3.0` (major.minor version, major.minor ‘3.0’ label points to 3.0.9)
- `kener:3` (major version, major ‘3’ label points to 3.0.9)

Alpine variants (smallest filesize):
- `kener:3.0.9-alpine` (Semver of current release)
- `kener:alpine` (Latest Alpine release, ‘alpine’ label points to 3.0.9)
- `kener:3.0-alpine` (major.minor version, major.minor ‘3.0-alpine’ label points to 3.0.9)
- `kener:3-alpine` (major version, major ‘3-alpine’ label points to 3.0.9)
2025-02-05 22:24:09 -05:00
Kyle Affolder 13366284c6 add(docker): docker-specific README badges 2025-02-05 21:03:18 -05:00
Kyle Affolder 0f0b447137 remove: forks badge from README 2025-02-05 20:47:51 -05:00
Kyle Affolder f7cc28c896 add: badges to README 2025-02-05 20:45:10 -05:00
Kyle Affolder fd790003d1 add: editorconfig to enforce consistent styles 2025-02-05 18:40:10 -05:00
Kyle Affolder fdad329148 update(docker): simplified variable name 2025-02-05 18:37:10 -05:00
Kyle Affolder 73bf5f3fbe refactor(docker): improve build w/ multistage
* Switch to multi-stage build pattern for smaller image size
* Add support for both Alpine and Debian variants via build args
* Change default image base to `node:23-slim` instead of using `node:23` (no need for full Debian base present in `node:23` since now prioritization is given to production-ready builds)
* Improve caching with --mount for npm dependencies
* Separate build and runtime dependencies
* Remove unnecessary Node.js packages in final stage
* Fix permissions on uploads/database directories
* Add proper scoping for build arguments
* Set NODE_ENV=production for better performance

This change reduces the final image size and improves build caching while adding flexibility to choose between Alpine and Debian base images.

Original: ~1.2GB
New Alpine: ~350MB
New Debian: ~450MB
2025-02-05 14:03:46 -05:00
Raj Nandan Sharma 103d64a659 fix: fix bug where incident status is not getting updated when adding comment #245 2025-02-05 22:43:33 +05:30
Raj Nandan Sharma 92c4d35992 fix: fix bug where incident status is not getting updated #246 2025-02-05 22:42:29 +05:30
Raj Nandan Sharma 3b1d95b71b Merge pull request #241 from kaffolder7/feature/suppress-warnings-production-build
Update: Suppress warnings in production build
2025-02-05 09:46:20 +05:30
Raj Nandan Sharma 4fd9bf2bb6 Merge pull request #234 from rajnandan1/release/3.0.9
feat: support SMTP for email trigger
2025-02-05 09:17:39 +05:30
Raj Nandan Sharma ce96b6f55d docs: update i18n 2025-02-05 09:17:11 +05:30
Raj Nandan Sharma 54bbc1dd00 chore: update i18n 2025-02-05 08:59:07 +05:30
Raj Nandan Sharma ffa31bcacc docs: updated roadmap doc 2025-02-05 08:09:49 +05:30
Kyle Affolder 559f5bd257 Update: Suppress warnings in production build
When building for production, various warnings are output which slows down production build.

The following changes were made:
- Suppress unused export properties (unused-export-let).
- Suppress conflicting Svelte resolve warnings (conflicting-svelte-resolve).
- Suppress empty chunk warnings (empty-chunk).
- Suppress unused module imports (module-unused-import).
- Keep other important warnings visible, so we’re still aware of potential issues.

Now, production build should be cleaner and faster! 🚀
2025-02-04 16:03:10 -05:00
Raj Nandan Sharma 977e49e1ce feat: seo fixes 2025-02-04 23:18:04 +05:30
Raj Nandan Sharma 30cb707436 feat: added category filter for view monitor #239 2025-02-04 21:37:00 +05:30
Raj Nandan Sharma ae439633b9 feat: added category filter for view monitor #239 2025-02-04 21:34:47 +05:30
Vincent Datrier 7f33f6ddfd Add Norwegian (Bokmål) as an available locale 2025-02-04 14:48:25 +01:00
Raj Nandan Sharma 8404415a93 feat: eval in ping #236 and port number in ping #211 2025-02-04 10:34:00 +05:30
Raj Nandan Sharma 5ddddf8b5d fix: bugs and documentation update as mentioned in #237 2025-02-03 21:33:07 +05:30
Raj Nandan Sharma 927db19cc6 feat: smtp autofill and docs update 2025-02-03 11:46:25 +05:30
Raj Nandan Sharma eccff16c5f feat: introducing event type maintenance as asked in #224 2025-02-02 23:03:58 +05:30
Raj Nandan Sharma 7be9c62c7c fix: allow longer TLD as reported in #235 2025-02-01 20:48:42 +05:30
Raj Nandan Sharma 76ce14e8b1 feat: support SMTP for email trigger 2025-02-01 16:11:27 +05:30
Raj Nandan Sharma fd0074c0b0 Merge pull request #233 from rajnandan1/release/3.0.8
fix: discord trigger fix #232
2025-01-31 20:22:43 +05:30
Raj Nandan Sharma ad01cdb5ac fix: discord trigger fix #232 2025-01-31 20:19:27 +05:30
Raj Nandan Sharma 1b4ca67cf0 Merge pull request #231 from rajnandan1/release/3.0.7
feat(triggers): support custom webhook body as requested in #230
2025-01-31 09:10:18 +05:30
Raj Nandan Sharma 53936e19d4 feat(triggers): support custom webhook body as requested in #230 2025-01-31 09:08:26 +05:30
Raj Nandan Sharma b58d00c5a6 feat(triggers): support custom webhook body as requested in #230 2025-01-31 09:03:57 +05:30
Raj Nandan Sharma 41db0c45cd Merge pull request #229 from YunusEmreAlps/feature/locales-tr
feat: add Turkish locale support and update locale files
2025-01-30 19:43:55 +05:30
Yunus Emre Alpu 5361b551eb feat: add Turkish locale support and update locale files 2025-01-30 13:05:08 +03:00
Raj Nandan Sharma eb87647466 Merge pull request #228 from rajnandan1/release/3.0.6
feat: support of promises in eval
2025-01-29 10:09:35 +05:30
Raj Nandan Sharma d9b900f28d feat: support of promises in eval 2025-01-28 23:37:26 +05:30
Raj Nandan Sharma 198bd6c723 Merge pull request #227 from matribeiro15/main
Update pt-BR.json
2025-01-28 22:44:26 +05:30
Mateus Ribeiro 1831e6309f Update pt-BR.json 2025-01-28 12:32:22 -03:00
Raj Nandan Sharma 007f5149d2 Update README.md 2025-01-27 23:07:06 +05:30
Raj Nandan Sharma 1a094e3511 Merge pull request #226 from rajnandan1/release/3.0.5
fix: locale for no incidents as reported in #225
2025-01-27 22:39:19 +05:30
Raj Nandan Sharma db1ddc1292 fix: locale for no incidents as reported in #225 2025-01-27 22:37:54 +05:30
Raj Nandan Sharma 535e3bb36a fix: hi.json fixed 2025-01-26 16:12:08 +05:30
Raj Nandan Sharma 785237e55e Merge pull request #223 from cosmic-jellyfish/feature/Further-Locale-Fixes
fix: localisation strings for further clarity
2025-01-26 16:08:04 +05:30
Raj Nandan Sharma e6bf47a859 docs: deployment docs 2025-01-26 15:13:46 +05:30
Raj Nandan Sharma 93ae1711f1 docs: deployment docs 2025-01-26 15:04:57 +05:30
Raj Nandan Sharma af97812beb docs: railway deploy button added 2025-01-26 13:12:38 +05:30
Cake 78cf22ade9 fix: correct spacing 2025-01-26 08:09:48 +11:00
Cake b4a461d93a fix: localisation strings for further clarity 2025-01-26 08:04:37 +11:00
Raj Nandan Sharma 5f33c02064 Merge pull request #222 from rajnandan1/release/3.0.4
Release/3.0.4
2025-01-25 21:43:05 +05:30
Raj Nandan Sharma 46c1a392b8 refactor: remove docs from docker build 2025-01-25 21:41:11 +05:30
Raj Nandan Sharma c6880c5df6 feat: sitemap and bug fixes 2025-01-25 21:18:42 +05:30
Raj Nandan Sharma 646da94ef9 feat: sitemap and bug fixes 2025-01-25 21:16:17 +05:30
Raj Nandan Sharma 36ede93dce feat: sitemap and bug fixes 2025-01-25 21:12:41 +05:30
Raj Nandan Sharma 9ed35589f7 Merge pull request #220 from rajnandan1/release/3.0.3
fix: load time #219
2025-01-24 21:45:33 +05:30
Raj Nandan Sharma e946dd18e0 fix: load time #219 2025-01-24 21:44:36 +05:30
Raj Nandan Sharma 51cad598c1 fix: load time #219 2025-01-24 21:42:57 +05:30
Raj Nandan Sharma 0595f23c18 Merge pull request #218 from cosmic-jellyfish/feature/ENG-Locale-Fix
English Locale tweaks
2025-01-24 13:04:58 +05:30
Raj Nandan Sharma b88816706b fix: retry await decrease from 4000 to 500ms 2025-01-24 11:42:06 +05:30
Cake 80edaae023 fix: update localisation strings across the board 2025-01-24 17:08:09 +11:00
Raj Nandan Sharma 883c46b064 Merge pull request #214 from rajnandan1/release/3.0.2
release of 3.0.2
2025-01-24 10:48:15 +05:30
Raj Nandan Sharma 4248cc31f2 chore: updated package.json version 2025-01-24 10:47:56 +05:30
Raj Nandan Sharma 5f81c6d61a fix: daily data local date format 2025-01-24 10:45:50 +05:30
Raj Nandan Sharma 00d82cc817 fix: daily data local date format 2025-01-24 10:44:48 +05:30
Raj Nandan Sharma a9edfde162 fix: bug fix for no data 2025-01-24 10:35:22 +05:30
Cake 468d7f445d fix: update localisation strings further 2025-01-24 15:15:13 +11:00
Cake 4cc74deece fix: update localisation strings 2025-01-24 15:11:50 +11:00
Raj Nandan Sharma f9831490af fix: base path for docker build 2025-01-24 09:08:13 +05:30
Raj Nandan Sharma a055a616eb fix: fix logo url as reported in #213 2025-01-23 23:37:39 +05:30
Raj Nandan Sharma 8009a2cbc4 feat: monitor re-arrange as requested in #215 2025-01-23 22:39:13 +05:30
Raj Nandan Sharma 693cc149cf feat: added retry for api timeouts as requested in #208 2025-01-23 10:33:15 +05:30
Raj Nandan Sharma d126fe0bce fix: fix for #212, data interpolation introduced 2025-01-23 09:36:37 +05:30
Raj Nandan Sharma 4cc49cce9e fix: default locale fix as reported in #209 2025-01-22 09:25:56 +05:30
Raj Nandan Sharma f7cb4cd805 fix: cron validation updated as reported in #206 2025-01-21 22:02:39 +05:30
Raj Nandan Sharma a2bd9883d1 chore: remove old docs.md 2025-01-21 09:18:21 +05:30
Raj Nandan Sharma 10a079c304 fix: fixing #193 base path login was having double slash in cookie 2025-01-21 09:12:10 +05:30
Raj Nandan Sharma 65f12f1082 docs: added contributing file 2025-01-21 08:44:58 +05:30
Raj Nandan Sharma c15f855c72 docs: added contributing file 2025-01-21 08:42:41 +05:30
Raj Nandan Sharma 3d38483022 Merge pull request #205 from matribeiro15/main
Add Brazilian Portuguese
2025-01-21 08:31:33 +05:30
Mateus Ribeiro 57dc1e7175 modified: src/lib/i18n/client.js
modified:   src/lib/locales/locales.json
	new file:   src/lib/locales/pt-BR.json
2025-01-21 01:22:01 +00:00
Raj Nandan Sharma ead68c929f docs: embed docs 2025-01-18 23:19:38 +05:30
Raj Nandan Sharma d54b346259 Merge pull request #204 from rajnandan1/date-fns
feat: i18n for dates
2025-01-18 23:14:13 +05:30
Raj Nandan Sharma a05de8269c docs: updated feature list 2025-01-18 23:13:13 +05:30
Raj Nandan Sharma 130b70c6af feat: i18n for dates 2025-01-18 23:10:07 +05:30
Raj Nandan Sharma 7247a54c08 feat: i18n for dates 2025-01-18 22:46:15 +05:30
Raj Nandan Sharma 28de7ebff8 feat: i18n for dates 2025-01-18 22:07:54 +05:30
Raj Nandan Sharma e2c9d4dc2d feat: i18n for dates 2025-01-18 21:44:46 +05:30
Raj Nandan Sharma 4866382180 feat: i18n for dates 2025-01-18 21:36:51 +05:30
Raj Nandan Sharma 1b1507db1a Merge pull request #202 from rajnandan1/heroku-dep
fix: fixes #198
2025-01-18 12:40:12 +05:30
Raj Nandan Sharma 0ea7d687a7 fix: fixes #198 2025-01-18 12:39:05 +05:30
Raj Nandan Sharma 502e1539ca Merge pull request #201 from sandyi5/main
korean translation update for v 3.0
2025-01-18 10:31:24 +05:30
김세영 f3910fea1b Update ko.json 2025-01-18 12:44:33 +09:00
김세영 ee9b48fb79 Create ko.json 2025-01-18 12:43:39 +09:00
김세영 142686ef92 Update locales.json 2025-01-18 12:24:57 +09:00
Raj Nandan Sharma 2aa187984e fix: cookie secure fix 2025-01-17 21:26:55 +05:30
Raj Nandan Sharma c20d4d71c3 fix: cookie secure fix 2025-01-17 20:37:02 +05:30
Raj Nandan Sharma 4f4d1e1b39 fix: login redirection to setup if not done 2025-01-17 09:51:07 +05:30
Raj Nandan Sharma f38b590f70 fix: handle file uplaod for docker container 2025-01-17 08:48:21 +05:30
Raj Nandan Sharma c2caf42fd3 Merge pull request #195 from rajnandan1/fix/day0
Fix/day0
2025-01-17 08:44:52 +05:30
Raj Nandan Sharma 8c279c8c10 fix: fixed bugs reported in reddit around analytics and css 2025-01-17 08:43:35 +05:30
Raj Nandan Sharma 3480c78360 fix: fixed bugs reported in reddit around analytics and css 2025-01-17 08:39:29 +05:30
Raj Nandan Sharma 79ce708f60 fixes reported on reddit 2025-01-16 23:13:47 +05:30
Raj Nandan Sharma a4526eb4b5 fix: nav list in home manage 2025-01-15 22:25:23 +05:30
Raj Nandan Sharma 866a133917 Merge pull request #194 from jghaanstra/main 2025-01-15 22:16:30 +05:30
Jelger Haanstra adce978244 Add Dutch Translation 2025-01-15 17:42:37 +01:00
Raj Nandan Sharma dd3c26b29a fix: fixing #193 and #191 2025-01-15 22:02:15 +05:30
Raj Nandan Sharma 25ad42ba9b Merge pull request #190 from otherwiseGG/danish-customer-language
Danish Translation
2025-01-15 21:29:56 +05:30
Benjamin Thiele 3285b7e472 Merge branch 'main' into danish-customer-language 2025-01-15 16:43:28 +01:00
Raj Nandan Sharma c7da55480a docs(docker): updated roadmap 2025-01-15 09:35:14 +05:30
Raj Nandan Sharma 35e81b5782 fix(docker): fixing #188 and #189
CHANGE: startup script started running before migrations of database, moved it to after migration
2025-01-15 09:24:05 +05:30
Raj Nandan Sharma 769a9526e7 Merge pull request #187 from kutovoys/main
Add Russian translations and update locales.json
2025-01-15 08:59:43 +05:30
Benjamin Thiele 5470153f4f Merge branch 'main' into danish-customer-language 2025-01-15 00:15:52 +01:00
Benjamin Thiele 9d6ad87275 Create dk.json 2025-01-15 00:13:55 +01:00
Benjamin Thiele ac6261d9ac Update locales.json 2025-01-15 00:12:18 +01:00
Sergey Kutovoy 48effe077e Add Russian translations and update locales.json
- Added Russian language support by creating ru.json with translations for various terms and phrases.
- Updated locales.json to include Russian in the list of available languages.
2025-01-15 00:48:57 +05:00
Raj Nandan Sharma c656bf8612 Merge pull request #186 from otherwiseGG/patch-1 2025-01-14 23:43:42 +05:30
Benjamin Thiele 9daf7c7156 Update locales.json 2025-01-14 18:53:27 +01:00
Benjamin Thiele 4bd3bfae9d Create de.json
German Translation File
2025-01-14 18:51:38 +01:00
Raj Nandan Sharma 727964949c docs: updated i18n docs 2025-01-14 23:10:24 +05:30
Raj Nandan Sharma 21e1fc1aca fix: fix seo meta tags 2025-01-14 22:49:00 +05:30
Raj Nandan Sharma eeba2ef2d4 docs: updated readme file 2025-01-14 22:37:06 +05:30
Raj Nandan Sharma b3e738ce03 fix: upload for base path aslo fixed 2025-01-14 22:01:30 +05:30
Raj Nandan Sharma 46848c7b19 fix: file upload issue 404 2025-01-14 21:49:56 +05:30
Raj Nandan Sharma 5f3d48597f fix: sitemap fixed.removed for now 2025-01-14 21:25:33 +05:30
Raj Nandan Sharma 0efc3e5999 Merge pull request #178 from rajnandan1/release/2.0.1
Release/3.0.0
2025-01-14 21:12:51 +05:30
Raj Nandan Sharma 0c0ce89317 docs: changelogs 2025-01-14 21:11:58 +05:30
Raj Nandan Sharma 4a47061f76 fix: deployment 2025-01-14 21:09:50 +05:30
Raj Nandan Sharma 9b3ff9b362 fix: deployment 2025-01-14 21:08:29 +05:30
Raj Nandan Sharma 8315fede7d docs: updated docs for release 2025-01-14 20:22:14 +05:30
Raj Nandan Sharma d6d0568f67 docs: updated docs for release 2025-01-14 17:57:42 +05:30
Raj Nandan Sharma ff0119db9b fix: fix embed and sub path 2025-01-14 14:07:53 +05:30
Raj Nandan Sharma 37d776c315 refactor: move accounts pages under manage and forgot password 2025-01-14 07:46:13 +05:30
Raj Nandan Sharma f53d4abd8b fix: responsiveness 2025-01-13 11:31:10 +05:30
Raj Nandan Sharma f827bd4aeb feat: i18n added french #179, removed github dependency, clean up old code, simpler i18n file 2025-01-13 10:57:12 +05:30
Raj Nandan Sharma f28c4e96c5 feat: db clean up 2025-01-12 16:22:39 +05:30
Raj Nandan Sharma cf81b11c0b feat: support for postgres using knex 2025-01-12 14:07:37 +05:30
Raj Nandan Sharma 17dc752902 feat: support for postgres using knex 2025-01-12 13:41:17 +05:30
Raj Nandan Sharma bc9faf9456 feat: alerting with new incidents 2025-01-10 08:59:11 +05:30
Raj Nandan Sharma e5b615267c feat: incidents api 2025-01-09 12:03:54 +05:30
Raj Nandan Sharma 70e9086646 feat: incidents from github to sqlite 2025-01-08 23:14:59 +05:30
Raj Nandan Sharma 0cc30bc67e feat: incidents from github to sqlite 2025-01-07 11:57:40 +05:30
Raj Nandan Sharma 73792e7ce6 feat: incidents from github to sqlite 2025-01-07 11:39:38 +05:30
Raj Nandan Sharma 32f873d9c2 feat: incidents from github to sqlite 2025-01-06 09:56:34 +05:30
Raj Nandan Sharma 6566bc5f8f build: docker file update 2025-01-03 11:48:18 +05:30
Raj Nandan Sharma cc93114eab docs: adding docs for 3.0.0 2025-01-02 11:20:28 +05:30
Raj Nandan Sharma 6d5d949f5c docs: adding docs for 3.0.0 2024-12-29 23:16:11 +05:30
Raj Nandan Sharma f1be4a4db0 feat: pre release 3.0.0 2024-12-28 19:21:23 +05:30
Raj Nandan Sharma 8b9f576b30 feat: pre release 3.0.0 2024-12-27 16:58:51 +05:30
Raj Nandan Sharma 0735f959ef feat: pre release 3.0.0 2024-12-27 09:16:30 +05:30
Raj Nandan Sharma f91d65b7a4 docs: fix docs for npm deploy 2024-12-05 09:54:35 +05:30
Raj Nandan Sharma c8d4920cd3 docs: fix docs for npm deploy 2024-12-05 08:55:37 +05:30
Raj Nandan Sharma 27625bc31a docs: fix docs for npm deploy 2024-12-05 08:47:32 +05:30
Raj Nandan Sharma 67e22e4339 docs: fix docs for npm deploy 2024-12-04 23:49:18 +05:30
Raj Nandan Sharma b4ed5cffd6 docs: fix docs for npm deploy 2024-12-04 23:48:27 +05:30
Raj Nandan Sharma 6209ff12bb fix: fix the build 2024-12-04 23:38:45 +05:30
Raj Nandan Sharma 392a0e85be Merge pull request #176 from rajnandan1/release/2.0.0
Release/2.0.0 retry
2024-12-04 23:02:51 +05:30
Raj Nandan Sharma a7abf37781 fix: fix build 2024-12-04 22:58:46 +05:30
Raj Nandan Sharma c09f87daa7 fix: fix build 2024-12-04 22:53:16 +05:30
Raj Nandan Sharma 43072d2777 fix: fix build 2024-12-04 22:48:33 +05:30
Raj Nandan Sharma ed52f28743 Merge pull request #175 from rajnandan1/release/2.0.0
Release/2.0.0
2024-12-04 18:32:36 +05:30
Raj Nandan Sharma fe953b6b36 fix: fixed docs 2024-12-04 18:30:50 +05:30
Raj Nandan Sharma d931f3ec6d fix: fixed docs 2024-12-04 17:52:14 +05:30
Raj Nandan Sharma 2fbf404bf3 docs: monitor example alerting 2024-12-04 16:19:10 +05:30
Raj Nandan Sharma 49064e4e25 fix: fix embeds 2024-12-04 16:10:01 +05:30
Raj Nandan Sharma 2c4004d91f fix: as reported in #103 changing timezone to UTC 2024-12-04 15:33:01 +05:30
Raj Nandan Sharma 37706b87c4 docs: updated docs and docker file 2024-12-04 15:21:13 +05:30
Raj Nandan Sharma c8a98a745d docs: added docs for pull request #112 2024-12-04 12:39:52 +05:30
Raj Nandan Sharma abae472545 docs: added postgres database also 2024-12-04 12:33:00 +05:30
Raj Nandan Sharma 749593f1af refactor: remove dependency on github addresses #94 2024-11-29 10:57:31 +05:30
Raj Nandan Sharma a824a5dcf2 docs: added docs for alerting to address #49 2024-11-29 09:57:28 +05:30
Raj Nandan Sharma 8b2fe90eb7 docs: added a feature to address #53 2024-11-28 23:07:42 +05:30
Raj Nandan Sharma e6370fab66 feat: added daily view for each day on click 2024-11-28 22:54:21 +05:30
Raj Nandan Sharma 92ea4b64f9 feat: first commit for the release of version 2.0.0 2024-11-27 11:41:00 +05:30
Raj Nandan Sharma 9f6d071f25 Update README.md 2024-11-24 16:30:35 +05:30
Raj Nandan Sharma 274536eafa Update README.md 2024-11-23 22:53:21 +05:30
Raj Nandan Sharma 5b0ad39526 Update README.md 2024-11-23 22:52:28 +05:30
Raj Nandan Sharma 01d54f504b Update README.md 2024-11-23 21:57:31 +05:30
Raj Nandan Sharma e413fb7ecd Update README.md 2024-11-23 21:51:10 +05:30
Raj Nandan Sharma dc665ec581 Merge pull request #124 from rajnandan1/fix-issue-123
fix: fixed theme settings as reported in issue #123
2024-11-20 09:49:10 +05:30
Raj Nandan Sharma f7fa0452cd fix: fixed theme settings as reported in issue #123 2024-11-20 09:47:32 +05:30
Raj Nandan Sharma 47253cc54b Update README.md 2024-11-19 19:03:53 +05:30
Raj Nandan Sharma 71b56db909 docs: added api reference 2024-11-19 11:11:58 +05:30
Raj Nandan Sharma ad41edc972 Update FUNDING.yml 2024-11-16 12:47:42 +05:30
Raj Nandan Sharma 9076561644 Update FUNDING.yml 2024-11-16 12:46:29 +05:30
Raj Nandan Sharma ff5601aad2 Create FUNDING.yml 2024-11-16 12:45:24 +05:30
Raj Nandan Sharma 21629b7bed Update README.md 2024-11-16 12:33:05 +05:30
Raj Nandan Sharma 052e38a292 fix: fixed responsiveness for language selector 2024-11-16 12:19:04 +05:30
Raj Nandan Sharma 38c44396b0 Merge pull request #120 from rajnandan1/release-candidate/0.0.16
Release candidate/0.0.16
2024-11-16 11:02:00 +05:30
Raj Nandan Sharma f80e19e18a docs: added docs for pm2 deployment 2024-11-16 11:00:57 +05:30
Raj Nandan Sharma ebdda050f8 docs: added docs for pm2 deployment 2024-11-16 10:59:20 +05:30
Raj Nandan Sharma 110fb1c180 docs: added docs for pm2 deployment 2024-11-16 10:57:53 +05:30
Raj Nandan Sharma fd361f9482 feat: added sitemap again, fixed #59 also 2024-11-15 22:56:31 +05:30
Raj Nandan Sharma 1b8e05ad1f feat: added sitemap again, fixed #59 also 2024-11-15 22:52:36 +05:30
Raj Nandan Sharma 28184d2a52 refactor: deployment refactor 2024-11-15 21:54:43 +05:30
Raj Nandan Sharma 9a14a81956 refactor: deployment refactor 2024-11-15 21:46:29 +05:30
Raj Nandan Sharma 3312bbe8e4 refactor: deployment refactor 2024-11-15 21:28:03 +05:30
Raj Nandan Sharma a9602f5576 fix: respnsiveness 2024-11-15 12:13:41 +05:30
Raj Nandan Sharma 0f5dd0fd31 feat: added analytics 2024-11-14 23:58:22 +05:30
Raj Nandan Sharma e45b016cca docs: updated docs 2024-11-14 09:23:28 +05:30
Raj Nandan Sharma e1fe07cf26 build: new docker build 2024-11-13 21:44:57 +05:30
Raj Nandan Sharma 18e851a205 build: new docker build 2024-11-13 21:28:46 +05:30
Raj Nandan Sharma c992ec22ca fixed docker file 2024-11-13 10:33:29 +05:30
Raj Nandan Sharma c57f75d1ea push 0.0.16 to git 2024-11-12 21:32:29 +05:30
Raj Nandan Sharma 5abfafe2fa new doc site 2024-11-11 08:40:44 +05:30
Raj Nandan Sharma bd87aded67 changes gitignore 2024-11-08 23:10:25 +05:30
Raj Nandan Sharma c0332fe035 revamp kener 2.0 2024-11-08 22:56:35 +05:30
457 changed files with 47500 additions and 11054 deletions
+9
View File
@@ -0,0 +1,9 @@
node_modules
.git
.github
.vscode
dist
build
.env
.DS_Store
*.log
+58
View File
@@ -0,0 +1,58 @@
# EditorConfig helps maintain consistent coding styles between editors
root = true
# Default settings for all files (e.g. most common, best-practice standard across all filetypes)
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2
# Svelte files
[*.svelte]
indent_style = space
indent_size = 2
trim_trailing_whitespace = false
# JavaScript and TypeScript
[*.{js,ts,tsx,cjs,mjs}]
indent_style = space
indent_size = 2
# JSON files (package.json, config files, etc.) - per JSON (RFC 8259) specification
[*.json,.prettierrc]
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = false
# YAML files (e.g., GitHub Actions, Lint configs) - per YAML 1.2 (2009) specification
[*.{yaml,yml}]
indent_style = space
indent_size = 2
# CSS & PostCSS files
[*.{css,postcss}]
indent_style = space
indent_size = 2
# Markdown files
[*.md]
indent_style = space
indent_size = 4
trim_trailing_whitespace = false
print_width = 180
# Dockerfile
[Dockerfile*]
indent_style = tab
indent_size = 4
insert_final_newline = false
# Ignore binary files
[*.{png,jpg,jpeg,gif,ico,svg,woff,woff2,eot,ttf,otf}]
charset = unset
trim_trailing_whitespace = false
insert_final_newline = false
+26
View File
@@ -0,0 +1,26 @@
TZ=Etc/UTC
KENER_SECRET_KEY=please_change_me_to_something_secure
# For SQLite database...
DATABASE_URL=sqlite://./database/kener.sqlite.db
# For PostgreSQL database...
# DATABASE_URL=postgresql://db_user:db_password@localhost:5432/kener_db
# POSTGRES_PASSWORD=some_super_random_secure_password
# For MySQL database...
# DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/kener_db
# MYSQL_PASSWORD=some_super_random_secure_password
KENER_BASE_PATH=""
ORIGIN=http://localhost:3000
RESEND_API_KEY=""
RESEND_SENDER_EMAIL=Accounts <accounts@resend.dev>
# Likely no need to change...
# NODE_ENV=production # already defined in container
# PORT=3000 # default port Kener service is exposed upon
# Add the below variable if you would like to white-label the product (aka. remove some of the attributions scattered throughout the app)
# WHITE_LABEL=true
+48
View File
@@ -0,0 +1,48 @@
# Contributing to Kener
Thank you for considering contributing to our project! Here are some guidelines to help you get started.
---
## How to Contribute
1. Fork the repository and clone it locally.
2. Create a new branch for your feature or bug fix:
```bash
git checkout -b feature/your-feature-name
```
3. Make your changes and commit them:
```bash
git commit -m 'Describe your changes'
```
4. Push your changes to your fork:
```bash
git push origin feature/your-feature-name
```
5. Create a pull request to the `main` branch.
## Development
1. Install dependencies:
```bash
npm install
```
2. Create a `.env` file in the root of the project and add the following:
```bash
cp .env.example .env
```
2. Start the development server:
```bash
npm run dev
```
3. Open [http://localhost:3000](http://localhost:3000) in your browser.
## Documentation
The documentation is available in the `docs` folder. You can view it by going to [http://localhost:3000/docs/home](http://localhost:3000/docs/home) in your browser.
## Where to Start
1. Check out the [roadmap items](https://kener.ing/docs/roadmap/)
2. Add language support by following the [i18n guide](https://kener.ing/docs/i18n/)
+2
View File
@@ -0,0 +1,2 @@
github: rajnandan1
buy_me_a_coffee: rajnandan1
+9 -11
View File
@@ -17,22 +17,20 @@ Steps to reproduce the behavior:
3. Scroll down to '....'
4. See error
**Version**
Which version of kener you are using.
**Environment**
Which environment you are using or where is it deployed. `docker`, `kubernetes`, `bare-metal`, `development`, `pm2` etc
**Database**
Which database you are using. `sqlite`, `mysql`, `postgres`
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
@@ -1,13 +0,0 @@
---
name: Create Incident Template
about: Create Incident Template
title: Title of Incident
labels: incident
assignees: ''
---
Your Incident Description goes here. Markdown Supported
[start_datetime:utcSeconds]
[end_datetime:utcSeconds]
+47
View File
@@ -0,0 +1,47 @@
version: 2
updates:
# Track base image versions via .env.build
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
file-patterns:
- ".env.build"
- "node:*" # Ensures Node.js images are correctly detected
# Monitor OS package versions in Dockerfile (Debian/Alpine)
- package-ecosystem: "gitsubmodule" # Alternative method to track OS packages in Dockerfile
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
- "os-packages"
commit-message:
prefix: "os"
include: "scope"
# Monitor Node.js dependencies from package.json
# TODO: Uncomment below if we want to begin letting Dependabot monitor & open PRs for Node.js project dependencies
# - package-ecosystem: "npm"
# directory: "/"
# schedule:
# interval: "weekly"
# labels:
# - "dependencies"
# - "npm"
# commit-message:
# prefix: "npm"
# include: "scope"
# Monitor GitHub Actions dependencies
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
- "github-actions"
commit-message:
prefix: "actions"
include: "scope"
+83
View File
@@ -0,0 +1,83 @@
name: Generate README
on:
push:
branches:
- main
paths:
- 'README.template.md'
pull_request:
branches:
- main
paths:
- 'README.template.md'
workflow_dispatch: # Allows for manual execution
workflow_run: # Triggers this workflow to run when it recognizes 'publish-images' workflow has ran and successfully completed
workflows: ["Publish Docker Image to Registries"]
types:
- completed
permissions:
contents: write # Explicitly allow pushing changes
jobs:
generate-readme:
name: Generate README from template
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0 # Fetch full history, including tags
persist-credentials: false # We'll manually authenticate
- name: Configure Git
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
- name: Setup Node.js
uses: actions/setup-node@v4.2.0
with:
node-version: "20"
- name: Install Dependencies
run: npm install mustache dotenv
- name: Extract Major and Major-Minor Versions
run: |
VERSION="${{ vars.BUILD_VERSION }}"
# Check if VERSION is empty and set a fallback value
if [ -z "$VERSION" ]; then
# Fetch the latest release using Git
VERSION=$(git tag -l --sort=-v:refname | grep -E '^v?[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1 || echo "3.1.0")
fi
MAJOR=$(echo "$VERSION" | cut -d. -f1)
MAJOR_MINOR=$(echo "$VERSION" | cut -d. -f1,2)
echo "Full version: $VERSION"
echo "Major version: $MAJOR"
echo "Major-Minor version: $MAJOR_MINOR"
# Export all as environment variables
echo "LATEST_VERSION=$VERSION" >> $GITHUB_ENV
echo "LATEST_MAJOR_VERSION=$MAJOR" >> $GITHUB_ENV
echo "LATEST_MAJOR_MINOR_VERSION=$MAJOR_MINOR" >> $GITHUB_ENV
- name: Generate README.md
env:
BUILD_FULL_VERSION: ${{ env.LATEST_VERSION }} # e.g., 1.2.3
BUILD_MAJOR_VERSION: ${{ env.LATEST_MAJOR_VERSION}} # e.g., 1
BUILD_MAJOR_MINOR_VERSION: ${{ env.LATEST_MAJOR_MINOR_VERSION }} # e.g., 1.2
run: node scripts/generate-readme.js
- name: Commit and Push Changes
env:
GH_PAT: ${{ secrets.GH_PAT }}
run: |
git add README.md
git commit -m "Auto-generate README.md with release versions" || echo "No changes to commit"
git push https://x-access-token:${{ secrets.GH_PAT }}@github.com/${{ github.repository }}.git HEAD:main
+21
View File
@@ -0,0 +1,21 @@
name: Prevent Direct README Changes
on:
pull_request:
paths:
- "README.md"
jobs:
check-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.2.2
- name: Detect direct README changes
run: |
if git diff --name-only origin/main | grep -q "README.md"; then
echo "❌ Direct modifications to README.md are not allowed!"
echo "Please update README.template.md instead."
exit 1
fi
+156
View File
@@ -0,0 +1,156 @@
name: Publish Docker Image to Registries
on:
release:
types:
- published # Runs only when a GitHub Release is published
workflow_dispatch: # Allows for manual execution
env:
ALPINE_VERSION: "23-alpine"
DEBIAN_VERSION: "23-slim"
# Registry URLs
DOCKERHUB_REGISTRY: docker.io
GITHUB_REGISTRY: ghcr.io
# Docker Hub image name (using Docker Hub username)
DOCKERHUB_IMAGE_NAME: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}
# GitHub image name (formatted as `account/repo`)
GITHUB_IMAGE_NAME: ${{ github.repository }}
jobs:
check-lockfile:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '23' # Adjust as needed
- name: Install dependencies
run: npm ci
- name: Check for lock-file changes
run: |
git diff --exit-code package-lock.json || (
echo "🫥 package-lock.json is outdated or missing. Please run 'npm install' and commit the updated lockfile."
exit 1
)
build-and-push-to-registries:
needs: check-lockfile # Runs only after `check-lockfile` completes successfully
name: Push Docker images to Docker Hub and GitHub Container Registry
strategy:
matrix:
variant: [alpine, debian]
runs-on: ubuntu-latest
permissions:
actions: write
contents: write
packages: write
# This is used to complete the identity challenge with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v4.2.2
# Install the cosign tool (except on PR)
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@v3.8.0
with:
cosign-release: 'v2.2.4'
# Set up BuildKit Docker container builder to be able to build multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.8.0
# Log in to Docker Hub (except on PR)
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Log in to GitHub Container Registry (except on PR)
- name: Log in to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3.3.0
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# Combined metadata extraction for both registries
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5.6.1
with:
images: |
${{ env.DOCKERHUB_IMAGE_NAME }}
${{ env.GITHUB_REGISTRY }}/${{ env.GITHUB_IMAGE_NAME }}
tags: |
# Debian Variant Tags
type=semver,pattern={{version}},enable=${{ matrix.variant == 'debian' }}
type=semver,pattern={{major}}.{{minor}},enable=${{ matrix.variant == 'debian' }}
type=semver,pattern={{major}},enable=${{ matrix.variant == 'debian' }}
type=raw,value=latest,enable=${{ matrix.variant == 'debian' }}
# Alpine Variant Tags
type=semver,pattern={{version}},suffix=-alpine,enable=${{ matrix.variant == 'alpine' }}
type=semver,pattern={{major}}.{{minor}},suffix=-alpine,enable=${{ matrix.variant == 'alpine' }}
type=semver,pattern={{major}},suffix=-alpine,enable=${{ matrix.variant == 'alpine' }}
type=raw,value=alpine,enable=${{ matrix.variant == 'alpine' }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.3.0
# Build and push Docker image with Buildx to both registries (don't push on PR)
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6.13.0
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VARIANT=${{ matrix.variant }}
ALPINE_VERSION=${{ env.ALPINE_VERSION }}
DEBIAN_VERSION=${{ env.DEBIAN_VERSION }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
# Sign the resulting Docker image digests
- name: Sign the published Docker images
if: ${{ github.event_name != 'pull_request' }}
env:
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
run: |
echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
# For use in other workflows (e.g. 'generate-readme', etc.)
- name: Save Build Version to Repository Variable
if: matrix.variant == 'debian' && github.run_attempt == 1
run: |
# VERSION="${{ steps.meta.outputs.version }}"
VERSION=$(gh release view --json tagName -q .tagName 2>/dev/null || echo "")
# Check if VERSION is empty and set a fallback value
if [ -z "$VERSION" ]; then
VERSION=$(git tag -l --sort=-version:refname | grep -E '^(v)?[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1 || echo "3.1.0")
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Setting BUILD_VERSION to $VERSION"
gh variable set BUILD_VERSION --body "$VERSION"
env:
GH_TOKEN: ${{ secrets.GH_PAT }} # Needs to be PAT w/ Read access to metadata and secrets & Read and Write access to actions, actions variables, and code
-74
View File
@@ -1,74 +0,0 @@
name: Publish Docker image to Dockerhub and GHCR
on:
push:
branches:
- 'main'
# add additional branches that should build to images here
# they will be tagged based on the branch name IE kener:test
#- 'test'
tags:
- '*.*.*'
# don't trigger if just updating docs
paths-ignore:
- 'docs.md'
- 'README.md'
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
# only run if we've specified image tag to push to
if: ${{ vars.DOCKERHUB_IMAGE_NAME != '' || vars.GHCR_IMAGE_NAME != '' }}
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Log in to Docker Hub
if: ${{ github.event_name != 'pull_request' && vars.DOCKERHUB_IMAGE_NAME != '' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
if: ${{ github.event_name != 'pull_request' && vars.GHCR_IMAGE_NAME != '' }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: |
${{ vars.DOCKERHUB_IMAGE_NAME }}
${{ vars.GHCR_IMAGE_NAME }}
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value=latest,enable=${{ endsWith(github.ref, 'main') }}
type=ref,event=branch,enable=${{ !endsWith(github.ref, 'main') }}
type=semver,pattern={{version}}
flavor: |
latest=false
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' && !env.ACT}}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
+14 -1
View File
@@ -4,10 +4,12 @@ static/kener
build
config/monitors.yaml
config/site.yaml
config/server.yaml
/.svelte-kit
/src/lib/.kener
/package
.env
.vscode
.env.*
!.env.example
vite.config.js.timestamp-*
@@ -15,4 +17,15 @@ vite.config.ts.timestamp-*
nodemon.json
.okgit/
config/static/*
!config/static/.kener
!config/static/.kener
db/*
!db/.kener
database/*
!database/.kener
uploads/*
!uploads/upload.dir
static/uploads/*
!static/uploads/upload.dir
temp.txt
temp.js
+69 -7
View File
@@ -1,9 +1,71 @@
{
"useTabs": true,
"semi": true,
"tabWidth": 4,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
"useTabs": false,
"semi": true,
"tabWidth": 2,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte",
"useTabs": false,
"semi": true,
"tabWidth": 2,
"trailingComma": "none",
"printWidth": 120
}
},
{
"files": ["*.js", "*.ts", "*.tsx", "*.cjs", "*.mjs"],
"options": {
"useTabs": false,
"semi": true,
"tabWidth": 2,
"trailingComma": "all",
"printWidth": 120
}
},
{
"files": ["*.json", ".prettierrc"],
"options": {
"useTabs": false,
"semi": false,
"tabWidth": 2,
"trailingComma": "none",
"printWidth": 120
}
},
{
"files": ["*.yaml", "*.yml"],
"options": {
"useTabs": false,
"semi": false,
"tabWidth": 2,
"trailingComma": "none",
"printWidth": 80
}
},
{
"files": "*.md",
"options": {
"useTabs": false,
"semi": false,
"tabWidth": 4,
"trailingComma": "none",
"printWidth": 180
}
},
{
"files": "Dockerfile",
"options": {
"useTabs": true,
"tabWidth": 4,
"semi": false,
"trailingComma": "none",
"printWidth": 120
}
}
]
}
+130 -56
View File
@@ -1,74 +1,148 @@
FROM lsiobase/alpine:3.18 as base
# syntax=docker/dockerfile:1
ENV TZ=Etc/GMT
# Global build arguments (defined default values in case `.env.build` isn't loaded)
ARG ALPINE_VERSION_TAG=23.7.0-alpine3.21
ARG DEBIAN_VERSION_TAG=23.7.0-bookworm-slim
ARG VARIANT=debian
RUN \
echo "**** install build packages ****" && \
apk add --no-cache \
nodejs \
npm && \
echo "**** cleanup ****" && \
rm -rf \
/root/.cache \
/tmp/*
#==========================================================#
# STAGE 1: BUILD STAGE #
#==========================================================#
# set OS timezone specified by docker ENV
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
FROM node:${DEBIAN_VERSION_TAG} AS builder-debian
RUN apt-get update && apt-get install -y \
build-essential=12.9 \
python3=3.11.2-1+b1 \
sqlite3=3.40.1-2+deb12u1 \
libsqlite3-dev=3.40.1-2+deb12u1 \
make=4.3-4.1 \
node-gyp=9.3.0-2 \
g++=4:12.2.0-3 \
tzdata \
iputils-ping=3:20221126-1+deb12u1 && \
rm -rf /var/lib/apt/lists/*
ARG data_dir=/config
VOLUME $data_dir
ENV CONFIG_DIR=$data_dir
FROM node:${ALPINE_VERSION_TAG} AS builder-alpine
RUN apk add --no-cache --update \
build-base=0.5-r3 \
python3 \
py3-pip \
make=4.4.1-r2 \
g++=14.2.0-r4 \
sqlite \
sqlite-dev \
tzdata \
iputils
COPY docker/root/ /
FROM builder-${VARIANT} AS builder
# Dir ENVs need to be set before building or else build throws errors
ENV PUBLIC_KENER_FOLDER=/config/static \
MONITOR_YAML_PATH=/config/monitors.yaml \
SITE_YAML_PATH=/config/site.yaml
# build requires devDependencies which are not used by production deploy
# so build in a stage so we can copy results to clean "deploy" stage later
FROM base as build
# Set environment variables
ENV NPM_CONFIG_LOGLEVEL=error \
VITE_BUILD_ENV=production
# Set the working directory
WORKDIR /app
COPY --chown=abc:abc . /app
# Copy package files for dependency installation
COPY package*.json ./
# build requires PUBLIC_KENER_FOLDER dir exists so create temporarily
# -- it is non-existent in final stage to allow proper startup and chown'ing/example population
RUN mkdir -p "${CONFIG_DIR}"/static \
&& npm install \
&& chown -R root:root node_modules \
&& npm run kener:build
# Install all dependencies, including `devDependencies` (cache enabled for faster builds)
# TODO: Possibly add `--no-audit` flag to `npm ci` to prevent `npm` from running a security audit on installed packages. (By default, `npm install` performs an audit to check for vulnerabilities in dependencies, which can slow down installation. Adding this flag would skip the audit, thus making `npm install` significantly faster for the CI/CD pipeline.)
RUN --mount=type=cache,target=/root/.npm \
npm ci --no-fund && \
npm cache clean --force
FROM base as app
# Copy application source code
COPY . .
# copy package, required libs (npm,nodejs) results of build, prod entrypoint, and examples to be used to populate config dir
# to clean, new stage
COPY --chown=abc:abc package*.json ./
COPY --from=base /usr/local/bin /usr/local/bin
COPY --from=base /usr/local/lib /usr/local/lib
COPY --chown=abc:abc scripts /app/scripts
COPY --chown=abc:abc static /app/static
COPY --chown=abc:abc locales /app/locales
COPY --chown=abc:abc config /app/config
COPY --chown=abc:abc src/lib/helpers.js /app/src/lib/helpers.js
COPY --from=build --chown=abc:abc /app/build /app/build
COPY --from=build --chown=abc:abc /app/prod.js /app/prod.js
# TODO: Reevaluate permissions (possibly reduce?)...
# Remove docs directory and ensure required directories exist
RUN rm -rf src/routes/\(docs\) \
static/documentation \
static/fonts/lato/full && \
mkdir -p uploads database && \
chmod -R 750 uploads database
# Build the application and copy templates to build directory
RUN npm run build && \
mkdir -p build/server/templates && \
cp -r src/lib/server/templates/* build/server/templates/ && \
npm prune --omit=dev
ENV NODE_ENV=production
#==========================================================#
# STAGE 2: PRODUCTION/FINAL STAGE #
#==========================================================#
# install prod depdendencies and clean cache
RUN npm install --omit=dev \
&& npm cache clean --force \
&& chown -R abc:abc node_modules
FROM node:${DEBIAN_VERSION_TAG} AS final-debian
# TODO: Consider adding `--no-install-recommends`, but will need testing (may further help reduce final build size)
RUN apt-get update && apt-get install -y \
iputils-ping=3:20221126-1+deb12u1 \
sqlite3=3.40.1-2+deb12u1 \
tzdata \
# TODO: Is it ok to change to `curl` here so that we don't have to maintain `wget` version mismatch between Debian architectures? (`curl` is only used for the container healthcheck and because there is an Alpine variant (best!) we probably don't care if the Debian image ends up building bigger due to `curl`.)
curl && \
rm -rf /var/lib/apt/lists/*
ARG webPort=3000
ENV PORT=$webPort
FROM node:${ALPINE_VERSION_TAG} AS final-alpine
RUN apk add --no-cache --update \
iputils \
sqlite \
tzdata
FROM final-${VARIANT} AS final
ARG PORT=3000 \
USERNAME=node
# Set environment variables
ENV HEALTHCHECK_PORT=$PORT \
HEALTHCHECK_PATH= \
NODE_ENV=production \
NPM_CONFIG_LOGLEVEL=error \
PORT=$PORT \
TZ=Etc/UTC
# Set the working directory
WORKDIR /app
# Copy package files build artifacts, and necessary files from builder stage
COPY --chown=node:node --from=builder /app/src/lib/ ./src/lib/
COPY --chown=node:node --from=builder /app/build ./build
COPY --chown=node:node --from=builder /app/uploads ./uploads
COPY --chown=node:node --from=builder /app/database ./database
COPY --chown=node:node --from=builder /app/src/lib/server/templates ./build/server/templates
# TODO: Consider changing from copying `node_modules` to instead letting `npm ci --omit=dev` handle production dependencies. Right now, copying `node_modules` is leading to a smaller image, whereas letting `npm ci` handle the install in final image is slightly faster, but leads to larger image size. IMO, having a slightly longer build time (e.g. ~10 sec.) is better in the end to have a smaller image.
COPY --chown=node:node --from=builder /app/node_modules ./node_modules
COPY --chown=node:node --from=builder /app/migrations ./migrations
COPY --chown=node:node --from=builder /app/seeds ./seeds
COPY --chown=node:node --from=builder /app/static ./static
COPY --chown=node:node --from=builder /app/entrypoint.sh ./entrypoint.sh
COPY --chown=node:node --from=builder /app/knexfile.js ./knexfile.js
COPY --chown=node:node --from=builder /app/main.js ./main.js
COPY --chown=node:node --from=builder /app/openapi.json ./openapi.json
COPY --chown=node:node --from=builder /app/openapi.yaml ./openapi.yaml
COPY --chown=node:node --from=builder /app/package.json ./package.json
# Set container timezone and make entrypoint script executable
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
chmod +x ./entrypoint.sh
# TODO: To improve security, consider dropping unnecessary capabilities instead of granting image all network capabilities of host. (Maybe `setcap cap_net_raw+p /usr/bin/ping`, etc.) Could also drop all and then grant only the capabilities that are explicitly needed. Some examples are commented out below...
# setcap cap_net_bind_service=+ep /usr/local/bin/node
# setcap cap_net_bind_service=+ep /usr/bin/ping
# setcap cap_net_bind_service=+ep /usr/bin/ping6
# setcap cap_net_bind_service=+ep /usr/bin/tracepath
# setcap cap_net_bind_service=+ep /usr/bin/clockdiff
# Expose the application port
EXPOSE $PORT
# leave entrypoint blank!
# uses LSIO s6-init entrypoint with scripts
# that populate CONFIG_DIR with static dir, monitor/site.yaml when dir is empty
# and chown's all files so they are owned by proper user based on PUID/GUID env
# Add a healthcheck to the container; `wget` vs. `curl` depending on base image. Using this approach because `wget` does not actually maintain versioning across architectures, so we cannot pin a `wget` version (in above `final-debian` base, `apt-get install`) between differing architectures (e.g. arm64, amd64)
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD sh -c 'if [ -f "/etc/alpine-release" ]; then wget --quiet --spider http://localhost:$HEALTHCHECK_PORT$HEALTHCHECK_PATH || exit 1; else curl --silent --head --fail http://localhost:$HEALTHCHECK_PORT$HEALTHCHECK_PATH || exit 1; fi'
# TODO: Revisit letting user define $PUID & $PGID overrides (e.g. `addgroup -g $PGID newgroup && adduser -D -G newgroup -u $PUID node`) as well as potentially ensure no root user exists. (Make sure no processes are running as root, first!)
# Use a non-root user (recommended for security)
USER $USERNAME
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["node", "main"]
+186 -61
View File
@@ -1,92 +1,217 @@
# Kener - Stunning Status Pages
<p align="center">
<img src="https://kener.ing/ss.png" width="100%" height="auto" alt="kener example illustration">
<img src="https://kener.ing/newbg.png?v=1" width="100%" height="auto" class="rounded-lg shadow-lg" alt="kener example illustration">
</p>
<p align="center">
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/rajnandan1/kener?label=Star%20Repo&style=social">
<a href="https://github.com/ivbeg/awesome-status-pages"><img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome status page" /></a>
<a href="https://hub.docker.com/r/rajnandan1/kener"><img src="https://img.shields.io/docker/pulls/rajnandan1/kener" alt="Docker Kener" /></a>
<a href="https://awesome-selfhosted.net/tags/status--uptime-pages.html#kener"><img src="https://awesome.re/mentioned-badge.svg" alt="Awesome self hosted" /></a>
</p>
#### 👉 Visit a live server [here](https://kener.ing)
<p align="center">
<a href="https://hub.docker.com/r/rajnandan1/kener"><img src="https://img.shields.io/docker/pulls/rajnandan1/kener" alt="Docker Kener" /></a>
<a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=latest"><img alt="Docker Image Size" src="https://img.shields.io/docker/image-size/rajnandan1/kener/latest?logo=docker&logoColor=white&label=debian" /></a>
<a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=alpine"><img alt="Docker Image Size" src="https://img.shields.io/docker/image-size/rajnandan1/kener/alpine?logo=docker&logoColor=white&label=alpine" /></a>
</p>
#### 👉 Read the documentation [here](https://kener.ing/kener-docs)
<p align="center">
<a href="https://github.com/rajnandan1/kener/actions/workflows/publish-images.yml"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/rajnandan1/kener/publish-images.yml" /></a>
<a href="https://github.com/rajnandan1/kener/commit/HEAD"><img src="https://img.shields.io/github/last-commit/rajnandan1/kener/main" alt="" /></a>
<a href="https://github.com/rajnandan1/kener/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues/rajnandan1/kener.svg" /></a>
</p>
# Kener - Status Page System
<p align="center">
<a href="https://www.producthunt.com/posts/kener-2" target="_blank">
<img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=kener-2&theme=light" alt="Kener on Product Hunt">
</a>
</p>
Kener: Open-source Node.js status page tool, designed to make service monitoring and incident handling a breeze. It offers a sleek and user-friendly interface that simplifies tracking service outages and improves how we communicate during incidents. And the best part? Kener integrates seamlessly with GitHub, making incident management a team effort—making it easier for us to track and fix issues together in a collaborative and friendly environment.
<p align="center">
<picture>
<source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/1f514/512.webp" type="image/webp">
<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f514/512.gif" alt="🔔" width="32" height="32">
</picture>
<picture>
<source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/512.webp" type="image/webp">
<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/512.gif" alt="🚀" width="32" height="32">
</picture>
<picture>
<source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/1f6a7/512.webp" type="image/webp">
<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f6a7/512.gif" alt="🚧" width="32" height="32">
</picture>
</p>
It uses files to store the data. Other adapters are coming soon
| [🌍 Live Server](https://kener.ing) | [🎉 Quick Start](https://kener.ing/docs/quick-start) | [🗄 Documentation](https://kener.ing/docs/home) |
| ----------------------------------- | ---------------------------------------------------- | ----------------------------------------------- |
## What is Kener?
**Kener** is a sleek and lightweight status page system built with **SvelteKit** and **NodeJS**. Its not here to replace heavyweights like Datadog or Atlassian but rather to offer a simple, modern, and hassle-free way to set up a great-looking status page with minimal effort.
Designed with **ease of use** and **customization in mind**, Kener provides all the essential features youd expect from a status page—without unnecessary complexity.
### Why Kener?
✅ &nbsp;Minimal overhead &ndash; Set up quickly with a clean, modern UI<br>
✅ &nbsp;Customizable &ndash; Easily tailor it to match your brand<br>
✅ &nbsp;Open-source & free &ndash; Because great tools should be accessible to everyone
### What's in a Name?
“Kener” is inspired by the Assamese word _“Kene”_, meaning _“hows it going?”_. The _.ing_ was added because, well… that domain was available. 😄
## Installation
### Manual
```shell
# Clone the repository
git clone https://github.com/rajnandan1/kener.git
cd kener
npm install
cp .env.example .env
npm run dev
```
### Docker
Official Docker images for **Kener** are available on [Docker Hub](https://hub.docker.com/r/rajnandan1/kener). Multiple versions are maintained to support different use cases.
<a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3.2.18"><img src="https://img.shields.io/badge/Latest_Stable_Release-3.2.18-blue" alt="Kener latest stable version: 3.2.18" /></a>
#### Available Tags
<table>
<tr>
<th>Image Tag</th>
<th>Description</th>
</tr>
<tr>
<td align="left" colspan="2" style="color:#A81D33;text-align:left;">Debian 12 <small>(Bookwork Slim)</small> w/ Node.js v23.7.0 &nbsp;<strong><em>(default)</em></strong></td>
</tr>
<tr>
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=latest" target="_blank"><code>latest</code></td>
<td>Latest stable release (aka 3.2.18)</td>
</tr>
<tr>
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3.2.18" target="_blank"><code>3.2.18</code></a></td>
<td>Specific release version</td>
</tr>
<tr>
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3.2" target="_blank"><code>3.2</code></a></td>
<td>Major-minor version tag pointing to the latest patch (3.2.18) release within that minor version (3.2.x)</td>
</tr>
<tr>
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3" target="_blank"><code>3</code></a></td>
<td>Major version tag pointing to the latest stable (3.2.18) release within that major version (3.x.x)</td>
</tr>
<tr>
<td align="left" colspan="2" style="color:#0D597F;text-align:left;">Alpine Linux 3.21 w/ Node.js v23.7.0 &nbsp;<strong><em>(smallest image size)</em></strong></td>
</tr>
<tr>
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=alpine" target="_blank"><code>alpine</code></td>
<td>Latest stable release (aka 3.2.18)</td>
</tr>
<tr>
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3.2.18-alpine" target="_blank"><code>3.2.18-alpine</code></a></td>
<td>Specific release version</td>
</tr>
<tr>
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3.2-alpine" target="_blank"><code>3.2-alpine</code></a></td>
<td>Major-minor version tag pointing to the latest patch (3.2.18) release within that minor version (3.2.x)</td>
</tr>
<tr>
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3-alpine" target="_blank"><code>3-alpine</code></a></td>
<td>Major version tag pointing to the latest stable (3.2.18) release within that major version (3.x.x)</td>
</tr>
</table>
#### Usage
Pull the latest stable version:
```sh
docker pull rajnandan1/kener:latest
```
Or use the smaller, Alpine-based variant:
```sh
docker pull rajnandan1/kener:alpine
```
For a production setup, refer to the sample [docker-compose.yml](https://github.com/rajnandan1/kener/blob/main/docker-compose.yml).
This keeps things clean, structured, and easy to read while preserving all the details.
### One Click
[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/template/spSvic?referralCode=1Pn7vs)
## Features
**Monitoring and Tracking:**
Here are some of the features that you get out of the box. Please read the documentation to know how to use them.
- Real-time monitoring
- Polls HTTP endpoint or Push data to monitor using Rest APIs
- Handles Timezones for visitors
- Categorize Monitors into different Sections
- Cron-based scheduling for monitors. Minimum per minute
- Flexible monitor configuration using YAML. Define your own parsing for monitor being UP/DOWN/DEGRADED
- Construct complex API Polls - Chain, Secrets etc
- Supports a Default Status for Monitors. Example defaultStatus=DOWN if you dont hit API per minute with Status UP
- Supports base path for hosting in k8s
- Pre-built docker image for easy deployment
### 📊 &nbsp;Monitoring and Tracking
**Customization and Branding:**
- Advanced **application performance monitoring** tools
- **Real-time network monitoring** capabilities
- Supports **polling HTTP endpoints** or **pushing data** via REST APIs
- **Timezone auto-adjustment** for visitors
- Organize monitors into **custom sections**
- **Cron-based scheduling** (minimum: **every minute**)
- **Create complex API polls** (chaining, secrets, etc.)
- Set a **default status** for monitors
- Supports **base path hosting in Kubernetes (k8s)**
- **Pre-built Docker images** for easy deployment
- Customizable status page using yaml or code
- Badge generation for status and uptime of Monitors
- Support for custom domains
- Embed Monitor as an iframe or widget
- Light + Dark Theme
- Internationalization support
### 🎨 &nbsp;Customization and Branding
**Incident Management:**
- Fully **customizable status page**
- **Badge generation** for status and uptime tracking
- Support for **custom domains**
- Embed monitors as **iframes or widgets**
- **Light & Dark Mode**
- **Internationalization (i18n) support**
- **Sleek, beautifully crafted UI**
- Create Incidents using Github Issues - Rich Text
- Or use APIs to create Incidents
### 🚨 &nbsp;Incident Management
**User Experience and Design:**
- **Incident tracking & communication** tools
- **Comprehensive APIs** for incident management
- 100% Accessibility Score
- Easy installation and setup
- User-friendly interface
- Responsive design for various devices
- Auto SEO and Social Media ready
### 🧑‍💻 &nbsp;User Experience and Design
## Technologies used
- **Accessible & user-friendly interface**
- **Quick & easy installation**
- **Responsive design** for all devices
- **Auto SEO & Social Media ready**
- **Server-Side Rendering (SSR) for better performance**
<div align="left">
<img alt="Visitor Stats" src="https://widgetbite.com/stats/rajnandan"/>
</div>
## Technologies Used
- [SvelteKit](https://kit.svelte.dev/)
- [shadcn-svelte](https://www.shadcn-svelte.com/)
## Inspired from
- [Upptime](https://upptime.js.org/)
## Roadmap
- [x] Add api to create incident
- [x] Add docker file
- [ ] Add notification
- [ ] Add Mysql adapter
## Screenshots
![image](static/marken_90.png)
![image](static/marken_api.png)
![image](static/marken_badge.png)
![image](static/marken_embed.png)
![image](static/marken_inci.png)
![image](static/marken_share.png)
![image](static/marken_td.png)
![image](static/marken_tl.png)
![image](static/marken_theme.png)
## Support Me
[Sponsor Me](https://github.com/sponsors/rajnandan1)
If youre enjoying Kener and want to support its development, consider sponsoring me on GitHub or treating me to a coffee. Your support helps keep the project growing! 🚀
<a href="https://www.buymeacoffee.com/rajnandan1"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=rajnandan1&button_colour=5F7FFF&font_colour=ffffff&font_family=Poppins&outline_colour=000000&coffee_colour=FFDD00" /></a>
[Sponsor Me Using Github](https://github.com/sponsors/rajnandan1)
<a href="https://www.paypal.com/paypalme/rajnandan1"><img style="height:90px;margin-left:-15px" src="static/paypal.png" /></a>
☕ &nbsp;[Buy Me a Coffee](https://www.buymeacoffee.com/rajnandan1)
![image](https://badges.pufler.dev/visits/rajnandan1/kener)
## Contributing
If you want to contribute to Kener, please read the [Contribution Guide](https://github.com/rajnandan1/kener/blob/main/.github/CONTRIBUTING.md).
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=rajnandan1/kener&type=Date)](https://star-history.com/#rajnandan1/kener&Date)
+217
View File
@@ -0,0 +1,217 @@
# Kener - Stunning Status Pages
<p align="center">
<img src="https://kener.ing/newbg.png?v=1" width="100%" height="auto" class="rounded-lg shadow-lg" alt="kener example illustration">
</p>
<p align="center">
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/rajnandan1/kener?label=Star%20Repo&style=social">
<a href="https://github.com/ivbeg/awesome-status-pages"><img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome status page" /></a>
<a href="https://awesome-selfhosted.net/tags/status--uptime-pages.html#kener"><img src="https://awesome.re/mentioned-badge.svg" alt="Awesome self hosted" /></a>
</p>
<p align="center">
<a href="https://hub.docker.com/r/rajnandan1/kener"><img src="https://img.shields.io/docker/pulls/rajnandan1/kener" alt="Docker Kener" /></a>
<a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=latest"><img alt="Docker Image Size" src="https://img.shields.io/docker/image-size/rajnandan1/kener/latest?logo=docker&logoColor=white&label=debian" /></a>
<a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=alpine"><img alt="Docker Image Size" src="https://img.shields.io/docker/image-size/rajnandan1/kener/alpine?logo=docker&logoColor=white&label=alpine" /></a>
</p>
<p align="center">
<a href="https://github.com/rajnandan1/kener/actions/workflows/publish-images.yml"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/rajnandan1/kener/publish-images.yml" /></a>
<a href="https://github.com/rajnandan1/kener/commit/HEAD"><img src="https://img.shields.io/github/last-commit/rajnandan1/kener/main" alt="" /></a>
<a href="https://github.com/rajnandan1/kener/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues/rajnandan1/kener.svg" /></a>
</p>
<p align="center">
<a href="https://www.producthunt.com/posts/kener-2" target="_blank">
<img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=kener-2&theme=light" alt="Kener on Product Hunt">
</a>
</p>
<p align="center">
<picture>
<source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/1f514/512.webp" type="image/webp">
<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f514/512.gif" alt="🔔" width="32" height="32">
</picture>
<picture>
<source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/512.webp" type="image/webp">
<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/512.gif" alt="🚀" width="32" height="32">
</picture>
<picture>
<source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/1f6a7/512.webp" type="image/webp">
<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f6a7/512.gif" alt="🚧" width="32" height="32">
</picture>
</p>
| [🌍 Live Server](https://kener.ing) | [🎉 Quick Start](https://kener.ing/docs/quick-start) | [🗄 Documentation](https://kener.ing/docs/home) |
| ----------------------------------- | ---------------------------------------------------- | ----------------------------------------------- |
## What is Kener?
**Kener** is a sleek and lightweight status page system built with **SvelteKit** and **NodeJS**. Its not here to replace heavyweights like Datadog or Atlassian but rather to offer a simple, modern, and hassle-free way to set up a great-looking status page with minimal effort.
Designed with **ease of use** and **customization in mind**, Kener provides all the essential features youd expect from a status page—without unnecessary complexity.
### Why Kener?
✅ &nbsp;Minimal overhead &ndash; Set up quickly with a clean, modern UI<br>
✅ &nbsp;Customizable &ndash; Easily tailor it to match your brand<br>
✅ &nbsp;Open-source & free &ndash; Because great tools should be accessible to everyone
### What's in a Name?
“Kener” is inspired by the Assamese word _“Kene”_, meaning _“hows it going?”_. The _.ing_ was added because, well… that domain was available. 😄
## Installation
### Manual
```shell
# Clone the repository
git clone https://github.com/rajnandan1/kener.git
cd kener
npm install
cp .env.example .env
npm run dev
```
### Docker
Official Docker images for **Kener** are available on [Docker Hub](https://hub.docker.com/r/rajnandan1/kener). Multiple versions are maintained to support different use cases.
<a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name={{kener_full_version}}"><img src="https://img.shields.io/badge/Latest_Stable_Release-{{kener_full_version}}-blue" alt="Kener latest stable version: {{kener_full_version}}" /></a>
#### Available Tags
<table>
<tr>
<th>Image Tag</th>
<th>Description</th>
</tr>
<tr>
<td align="left" colspan="2" style="color:#A81D33;text-align:left;">Debian 12 <small>(Bookwork Slim)</small> w/ Node.js v23.7.0 &nbsp;<strong><em>(default)</em></strong></td>
</tr>
<tr>
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=latest" target="_blank"><code>latest</code></td>
<td>Latest stable release (aka {{kener_full_version}})</td>
</tr>
<tr>
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name={{kener_full_version}}" target="_blank"><code>{{kener_full_version}}</code></a></td>
<td>Specific release version</td>
</tr>
<tr>
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name={{kener_major_minor_version}}" target="_blank"><code>{{kener_major_minor_version}}</code></a></td>
<td>Major-minor version tag pointing to the latest patch ({{kener_full_version}}) release within that minor version ({{kener_major_minor_version}}.x)</td>
</tr>
<tr>
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name={{kener_major_version}}" target="_blank"><code>{{kener_major_version}}</code></a></td>
<td>Major version tag pointing to the latest stable ({{kener_full_version}}) release within that major version ({{kener_major_version}}.x.x)</td>
</tr>
<tr>
<td align="left" colspan="2" style="color:#0D597F;text-align:left;">Alpine Linux 3.21 w/ Node.js v23.7.0 &nbsp;<strong><em>(smallest image size)</em></strong></td>
</tr>
<tr>
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=alpine" target="_blank"><code>alpine</code></td>
<td>Latest stable release (aka {{kener_full_version}})</td>
</tr>
<tr>
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name={{kener_full_version}}-alpine" target="_blank"><code>{{kener_full_version}}-alpine</code></a></td>
<td>Specific release version</td>
</tr>
<tr>
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name={{kener_major_minor_version}}-alpine" target="_blank"><code>{{kener_major_minor_version}}-alpine</code></a></td>
<td>Major-minor version tag pointing to the latest patch ({{kener_full_version}}) release within that minor version ({{kener_major_minor_version}}.x)</td>
</tr>
<tr>
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name={{kener_major_version}}-alpine" target="_blank"><code>{{kener_major_version}}-alpine</code></a></td>
<td>Major version tag pointing to the latest stable ({{kener_full_version}}) release within that major version ({{kener_major_version}}.x.x)</td>
</tr>
</table>
#### Usage
Pull the latest stable version:
```sh
docker pull rajnandan1/kener:latest
```
Or use the smaller, Alpine-based variant:
```sh
docker pull rajnandan1/kener:alpine
```
For a production setup, refer to the sample [docker-compose.yml](https://github.com/rajnandan1/kener/blob/main/docker-compose.yml).
This keeps things clean, structured, and easy to read while preserving all the details.
### One Click
[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/template/spSvic?referralCode=1Pn7vs)
## Features
Here are some of the features that you get out of the box. Please read the documentation to know how to use them.
### 📊 &nbsp;Monitoring and Tracking
- Advanced **application performance monitoring** tools
- **Real-time network monitoring** capabilities
- Supports **polling HTTP endpoints** or **pushing data** via REST APIs
- **Timezone auto-adjustment** for visitors
- Organize monitors into **custom sections**
- **Cron-based scheduling** (minimum: **every minute**)
- **Create complex API polls** (chaining, secrets, etc.)
- Set a **default status** for monitors
- Supports **base path hosting in Kubernetes (k8s)**
- **Pre-built Docker images** for easy deployment
### 🎨 &nbsp;Customization and Branding
- Fully **customizable status page**
- **Badge generation** for status and uptime tracking
- Support for **custom domains**
- Embed monitors as **iframes or widgets**
- **Light & Dark Mode**
- **Internationalization (i18n) support**
- **Sleek, beautifully crafted UI**
### 🚨 &nbsp;Incident Management
- **Incident tracking & communication** tools
- **Comprehensive APIs** for incident management
### 🧑‍💻 &nbsp;User Experience and Design
- **Accessible & user-friendly interface**
- **Quick & easy installation**
- **Responsive design** for all devices
- **Auto SEO & Social Media ready**
- **Server-Side Rendering (SSR) for better performance**
<div align="left">
<img alt="Visitor Stats" src="https://widgetbite.com/stats/rajnandan"/>
</div>
## Technologies Used
- [SvelteKit](https://kit.svelte.dev/)
- [shadcn-svelte](https://www.shadcn-svelte.com/)
## Support Me
If youre enjoying Kener and want to support its development, consider sponsoring me on GitHub or treating me to a coffee. Your support helps keep the project growing! 🚀
[Sponsor Me Using Github](https://github.com/sponsors/rajnandan1)
☕ &nbsp;[Buy Me a Coffee](https://www.buymeacoffee.com/rajnandan1)
![image](https://badges.pufler.dev/visits/rajnandan1/kener)
## Contributing
If you want to contribute to Kener, please read the [Contribution Guide](https://github.com/rajnandan1/kener/blob/main/.github/CONTRIBUTING.md).
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=rajnandan1/kener&type=Date)](https://star-history.com/#rajnandan1/kener&Date)
-26
View File
@@ -1,26 +0,0 @@
- name: Google Search
description: Search the world's information, including webpages, images, videos and more.
tag: "google-search"
image: "/google.png"
api:
method: GET
url: https://www.google.com/webhp
- name: Svelte Website
description: Cybernetically enhanced web apps
tag: "svelte-website"
api:
method: GET
url: https://svelte.dev/
image: "/svelte.svg"
- name: Earth
description: Our blue planet
tag: "earth"
defaultStatus: "UP"
image: "/earth.png"
- name: Frogment
description: A free openAPI spec editor and linter that breaks down your spec into fragments to make editing easier and more intuitive. Visit https://www.frogment.com
tag: "frogment"
image: "/frogment.png"
api:
method: GET
url: https://www.frogment.com
-44
View File
@@ -1,44 +0,0 @@
title: "Kener"
home: "/"
logo: "/logo.png"
github:
owner: "rajnandan1"
repo: "kener"
incidentSince: 48
metaTags:
description: "Kener: Open-source modern looking Node.js status page tool, designed to make service monitoring and incident handling a breeze. It offers a sleek and user-friendly interface that simplifies tracking service outages and improves how we communicate during incidents. And the best part? Kener integrates seamlessly with GitHub, making incident management a team effort—making it easier for us to track and fix issues together in a collaborative and friendly environment."
keywords: "Node.js status page, Incident management tool, Service monitoring, Service outage tracking, Real-time status updates, GitHub integration for incidents, Open-source status page, Node.js monitoring application, Service reliability, User-friendly incident management, Collaborative incident resolution, Seamless outage communication, Service disruption tracker, Real-time incident alerts, Node.js status reporting"
og:description: "Kener: Open-source Node.js status page tool, designed to make service monitoring and incident handling a breeze. It offers a sleek and user-friendly interface that simplifies tracking service outages and improves how we communicate during incidents. And the best part? Kener integrates seamlessly with GitHub, making incident management a team effort—making it easier for us to track and fix issues together in a collaborative and friendly environment."
og:image: "https://kener.ing/ss.png"
og:title: "Kener - Open-Source and Modern looking Node.js Status Page for Effortless Incident Management"
og:type: "website"
og:site_name: "Kener"
twitter:card: "summary_large_image"
twitter:site: "@_rajnandan_"
twitter:creator: "@_rajnandan_"
twitter:image: "https://kener.ing/ss.png"
twitter:title: "Kener: Open-Source and Modern looking Node.js Status Page for Effortless Incident Management"
twitter:description: "Kener: Open-source Node.js status page tool, designed to make service monitoring and incident handling a breeze. It offers a sleek and user-friendly interface that simplifies tracking service outages and improves how we communicate during incidents. And the best part? Kener integrates seamlessly with GitHub, making incident management a team effort—making it easier for us to track and fix issues together in a collaborative and friendly environment."
nav:
- name: "Documentation"
url: "/docs"
- name: "Github"
url: "https://github.com/rajnandan1/kener"
hero:
title: Kener is a Open-Source Status Page System
subtitle: Let your users know what's going on.
footerHTML: |
Made using
<a href="https://github.com/rajnandan1/kener" target="_blank" rel="noreferrer" class="font-medium underline underline-offset-4">
Kener
</a>
an open source status page system built with Svelte and TailwindCSS.
i18n:
defaultLocale: "en"
locales:
en: "English"
hi: "हिन्दी"
zh-CN: "中文"
ja: "日本語"
vi: "Tiếng Việt"
theme: dark
-1
View File
@@ -1 +0,0 @@
I am Empty File
+1
View File
@@ -0,0 +1 @@
database folder
-2
View File
@@ -1,2 +0,0 @@
import { Startup } from "./scripts/startup.js";
Startup();
+52 -22
View File
@@ -1,31 +1,61 @@
version: '3.7'
# Docker Compose Configuration
# Description: This file sets up a multi-container environment for Kener (https://github.com/rajnandan1/kener).
# Last Updated: 2025-02-08
# Docker Compose Version: 3.8
# Notes: Ensure that you specify a random value for the `KENER_SECRET_KEY` environment variable before running `docker-compose up -d`.
version: '3.8'
services:
kener:
image: rajnandan1/kener:latest # assuming this is final namespace/image
image: rajnandan1/kener:latest # Change to 'rajnandan1/kener:alpine' for an even smaller image! 😁🚀
container_name: kener
# env_file: custom.env # Uncomment this if you are needing to export environment variables from a custom environment file. By default, Docker will import any variables that exist in `.env`
environment:
- TZ=Etc/GMT
#- GH_TOKEN=
#- API_TOKEN=
#- API_IP
TZ: Etc/UTC
KENER_SECRET_KEY: replace_me_with_a_random_string # Keep private!! - best to define in `.env` file or through Docker Secret
# DATABASE_URL: custom_db_url # By default, a SQLite database is used - you may override the database url/type here
# RESEND_API_KEY:
# RESEND_SENDER_EMAIL:
# If running on a LINUX HOST and not podman rootless these MUST BE SET
# run "id $user" from command line and replace numbers below with output from command
#- PUID=1000 # gid
#- PGID=1000 # uid
### Most likely DO NOT need to change anything below this ###
#- PORT=3000 Port app listens on IN CONTAINER
### If any of the below are changed make sure the bound volume is correct as well ###
#- CONFIG_DIR=/config
#- PUBLIC_KENER_FOLDER=/config/static
#- MONITOR_YAML_PATH=/config/monitors.yaml
#- SITE_YAML_PATH=/config/site.yaml
#- KENER_BASE_PATH=/status
### You most likely will NOT need to change anything below this line. Be sure you know what you're doing!! (https://kener.ing/docs/deployment/#docker-environment-variables)
# PORT: 3000 # Port that app listens on in the container
# KENER_BASE_PATH: # By default, Kener runs at `/`. You may change this to be, e.g. `/status`, etc. Do NOT add a trailing slash!! (more info here: https://kener.ing/docs/deployment/#docker-environment-variables)
# ORIGIN: http://localhost:3000
# NODE_ENV: production # This is already set to "production" by default within the container
ports:
- '3000:3000/tcp'
volumes:
- '/host/path/to/config:/config:rw'
- data:/app/database # We suggest using a Docker named volume, which is more performant for databases
- $(pwd)/uploads:/app/uploads
# read_only: true # Uncommenting this fortifies security by marking the container's filesystem as read-only (aka no data can be written to the container's filesystem except for explicitly defined writable volumes and bind mounts, an exception has already been defined for `/database` and `/uploads`)
restart: unless-stopped
# depends_on: # <-- Uncomment if you would like to use PostgreSQL or MySQL
# - postgres # ...instead of SQLite
# - mysql #
# Only use below section if you would like to utilize PostgreSQL instead of Kener's default SQLite database. (Don't forget to set `DATABASE_URL` in `kener` service to be: `DATABASE_URL=postgresql://db_user:db_password@localhost:5432/kener_db`)
postgres:
image: postgres:alpine
container_name: postgres
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: some_super_random_secure_password # Best to define this in `.env` or via Docker Secret!!
POSTGRES_DB: kener_db
restart: unless-stopped
# Only use below section if you would like to utilize MySQL instead of Kener's default SQLite database. (Don't forget to set `DATABASE_URL` in `kener` service to be: `DATABASE_URL=mysql://db_user:db_password@localhost:3306/kener_db`)
mysql:
image: mariadb:11
container_name: mysql
environment:
MYSQL_USER: user
MYSQL_PASSWORD: some_super_random_secure_password # Best to define this in `.env` or via Docker Secret!!
MYSQL_DATABASE: kener_db
MYSQL_RANDOM_ROOT_PASSWORD: true
restart: unless-stopped
volumes:
data:
name: kener_db
@@ -25,8 +25,8 @@ if [ "$POPULATE_EXAMPLES" = true ]; then
echo "Directory is empty, adding defaults..."
mkdir -p "${CONFIG_DIR}"/static
cp -r /app/static/. "${CONFIG_DIR}"/static
mv /app/config/monitors.example.yaml "${CONFIG_DIR}"/monitors.yaml
mv /app/config/site.example.yaml "${CONFIG_DIR}"/site.yaml
cp /app/config/monitors.example.yaml "${CONFIG_DIR}"/monitors.yaml
cp /app/config/site.example.yaml "${CONFIG_DIR}"/site.yaml
fi
# permissions
@@ -3,5 +3,7 @@
echo -e "\nApp is starting!"
export NODE_ENV=production
cd /app || exit
# Run build first
exec \
s6-setuidgid abc /usr/bin/node $NODE_ARGS /app/prod.js
s6-setuidgid abc /usr/bin/node $NODE_ARGS /app/main.js
-1255
View File
File diff suppressed because it is too large Load Diff
+160
View File
@@ -0,0 +1,160 @@
---
title: Alert Config | Server.yaml | Kener
description: Alerts are the heart of Kener. This is where you define the alerts you want to show on your site.
---
# Add Alert Config
Use the `config/server.yaml` file to configure the alert settings.
## Alert Triggers
Kener supports multiple alerting mechanisms.
Currently, Kener supports the following alerting mechanisms:
- Webhook
- Discord
- Slack
We are adding more alerting mechanisms in the future.
### Configure Alerts
In the `server.yaml` file, you can add the alerting mechanisms under the `triggers` key. It accepts an array of objects.
```yaml
triggers:
- name: Awesome Webhook
type: "webhook"
url: "https://kener.requestcatcher.com/test"
method: "POST"
headers:
Authorization: Bearer $SOME_TOKEN_FROM_ENV
- name: My Discord Channel
type: "discord"
url: "https://discord.com/api/webhooks/your-webhook-url"
- name: Some Slack Channel
type: slack
url: https://hooks.slack.com/services/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
```
| Key | Description |
| ---- | ----------------------------------------------------------------------- |
| name | Name of the alerting mechanism. This will be used in the monitor config |
| type | Type of the alerting mechanism. Can be `webhook`, `discord`, `slack` |
| url | URL of the webhook or discord or slack channel |
There may be additional keys based on the type of alerting mechanism.
In webhook alerting, you can also add headers and method to the request.
```yaml
- name: Awesome Webhook
type: "webhook"
url: "https://kener.requestcatcher.com/test"
method: "POST"
headers:
Authorization: Bearer $SOME_TOKEN_FROM_ENV
```
### Webhook
Body of the webhook will be sent as below:
```json
{
"id": "mockoon-9",
"alert_name": "Mockoon DOWN",
"severity": "critical",
"status": "TRIGGERED",
"source": "Kener",
"timestamp": "2024-11-27T04:55:00.369Z",
"description": "🚨 **Service Alert**: Check the details below",
"details": {
"metric": "Mockoon",
"current_value": 1,
"threshold": 1
},
"actions": [
{
"text": "View Monitor",
"url": "https://kener.ing/monitor-mockoon"
}
]
}
```
| Key | Description |
| --------------------- | ----------------------------------------------------------- |
| id | Unique ID of the alert |
| alert_name | Name of the alert |
| severity | Severity of the alert. Can be `critical`, `warn` |
| status | Status of the alert. Can be `TRIGGERED`, `RESOLVED` |
| source | Source of the alert. Can be `Kener` |
| timestamp | Timestamp of the alert |
| description | Description of the alert. This you can customize. See below |
| details | Details of the alert. |
| details.metric | Name of the monitor |
| details.current_value | Current value of the monitor |
| details.threshold | Alert trigger hreshold of the monitor |
| actions | Actions to be taken. Link to view the monitor. |
### Discord
The discord message when alert is `TRIGGERED` will look like this
![Discord](/discord.png)
The discord message when alert is `RESOLVED` will look like this
![Discord](/documentation/discord_resolved.png)
### Slack
The slack message when alert is `TRIGGERED` will look like this
![Slack](/slack.png)
The slack message when alert is `RESOLVED` will look like this
![Slack](/documentation/slack_resolved.png)
### Add Alerts to Monitors
Once you have set up the triggers, you can add them to your monitors in the `config/monitors.yaml` file.
```yaml
- name: OkBookmarks
tag: "okbookmarks"
image: "https://okbookmarks.com/assets/img/extension_icon128.png"
api:
method: GET
url: https://okbookmarks.com
alerts:
DOWN:
failureThreshold: 1
successThreshold: 1
createIncident: true
description: "🚨 **Service Alert**. This is a custom message"
triggers:
- Awesome Webhook
- My Discord Channel
- Some Slack Channel
```
The `alerting` object lets you define the alerting mechanism for the monitor. It can do alerting for `DOWN` or `DEGRADED` status. You can add both or one of them.
- `failureThreshold`: Number of consecutive failures before alerting
- `successThreshold`: Number of consecutive successes before resolving the alert
- `createIncident`: If set to `true`, Kener will create an incident that will be shown on the status page
- `description`: Custom message for the alert
- `triggers`: Array of alerting triggers to send the alert to. The name should match the name in the `server.yaml` file.
<div class="rounded border px-4 py-0 ">
<p class="text-sm font-medium">
It will send alerts to the webhook, discord, and slack channels.
The alert will be set when the monitor goes down for 1 health check.
There will be one more alert when the monitor is up again after, 1 health check is successful.
</p>
</div>
+36
View File
@@ -0,0 +1,36 @@
---
title: View Alerts | Kener
description: Learn how to view alerts in kener.
---
# View Alerts
Alerts are used to notify you when a monitor goes down or up. You can view alerts in the Kener dashboard.
## ID
The unique ID of the alert.
## Type
The type of status that the alert is for. Example DOWN, DEGRADED
## Monitor
The monitor for which the alert is triggered.
## Status
The status of the alert. TRIGGERED, RESOLVED
## Checks
The number of checks that have been done.
## Incident
The incident that the alert is part of.
## Created At
The time when the alert was created.
+16
View File
@@ -0,0 +1,16 @@
---
title: API Keys | Kener
description: Learn how to set up and work with API keys in kener.
---
# API Keys
API keys can be used to call the [APIs of kener](/docs/kener-apis). You can create multiple API keys and use them to call the APIs.
API keys once generated cannot be viewed again so please keep them safe and secure.
## Create API Key
1. To create an API key click on the `Create API Key` button in the API Keys page.
2. Add a name for the key so that it is easy for you to remember
3. Click on Create.
+45
View File
@@ -0,0 +1,45 @@
---
title: Categorize Monitors Guide | Kener
description: Categorize Monitors in Kener
---
# Categorize Monitors
Let us add a category to our monitors.
## Sample monitors.yaml
```yaml
- name: OkBookmarks
description: A free bookmark manager that lets you save and search your bookmarks in the cloud.
tag: "okbookmarks"
image: "https://okbookmarks.com/assets/img/extension_icon128.png"
api:
method: GET
url: https://okbookmarks.com
- name: Earth
description: Our blue planet
tag: "earth"
default_status: "UP"
image: "/earth.png"
category: "Hello"
- name: Frogment
description: A free openAPI spec editor and linter that breaks down your spec into fragments to make editing easier and more intuitive. Visit https://www.frogment.com
tag: "frogment"
image: "/frogment.png"
api:
method: GET
url: https://www.frogment.com
```
## Sample site.yaml
```yaml
#...
categories:
- name: Hello
description: Say Hello to the world
#...
```
The above will have OkBookmarks and Frogment under home. Earth will be under Hello category.
+116
View File
@@ -0,0 +1,116 @@
---
title: Changelogs | Kener
description: Changelogs for Kener
---
# Changelogs
Here are the changelogs for Kener. Changelogs are only published when there are new features or breaking changes.
## v3.2.16
### ✨ Features
- **Hidden Categories:** You can now create hidden categories that will not show up for users that are not logged in. All the monitors will also not show up. Some one however can directly get to see them if they visit the monitor link directly
- **Configure data rage:** Now you can configure the data range in home page between 1 and 180 days. You can set different ranges for mobile and desktop devices.
## v3.2.14
### ✨ Features
- **Gamedig Monitor Functionality:** Introduced a new monitor type using Gamedig to monitor over 320+ games and services. Includes options for host, port, timeout, game/service selection, and documentation updates. ([#389](https://github.com/rajnandan1/kener/pull/389) by ToxykAuBleu)
- **Event Subscription:** Added functionality for event subscriptions, involving new database tables (`subscribers`, `subscriptions`, `subscription_triggers`), UI enhancements, a comprehensive game list, and package version update (3.2.13 to 3.2.14). ([#385](https://github.com/rajnandan1/kener/pull/385) by rajnandan1)
- **CRUD API for Monitors:** Implemented API endpoints for creating, reading, updating, and deleting monitors (`GET /api/monitor`, `POST /api/monitor`, `GET /api/monitor/[monitor_id]`, `PUT /api/monitor/[monitor_id]`, `DELETE /api/monitor/[monitor_id]`). Includes OpenAPI spec updates. ([#384](https://github.com/rajnandan1/kener/pull/384) by jensvandenreyt)
- **Modify Monitor Data:** Added the ability for users to modify historical monitoring data via a new UI option and backend API, useful for correcting past statuses (e.g., false positives). ([#380](https://github.com/rajnandan1/kener/pull/380) by mcorbin)
- **Site Status Banner:** Now you can choose to show a site status banner in the main home page. The setting has to be turned on in the Home section of the kener portal.
- **Upcoming Maintenance**: Dedicated Page for upcoming maintenance events.
- **Event Page**: Dedicated page for each event (incident/maintenance)
- **Admin Portal UI Update**: Revamped kener management portal for better accessibility.
### 🐛 Bug Fixes
- **SMTP Secure Variable Fix:** Corrected the evaluation of the `SMTP_SECURE` environment variable to properly handle values like '0' or empty strings, preventing SSL errors with STARTTLS. ([#392](https://github.com/rajnandan1/kener/pull/392) by myned)
- **Group Monitor Fix:** Fix group monitor using queues
### 🌍 Internationalization
- **Polish Translation:** Added Polish language support (`pl.json`) and integrated it into the application's localization framework. ([#386](https://github.com/rajnandan1/kener/pull/386) by lolen)
## v3.2.5
<picture>
<source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/512.webp" type="image/webp">
<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/512.gif" alt="🚀" width="32" height="32">
</picture>
### Features
- Added code editing for all JavaScript and JSON fields for trigger custom body and monitor `evals`.
- Syntax highlighting and error checking for monitor evaluation functions
- Added support for custom Discord and Slack body templates in triggers
- Improved variable templating for all notification types
- Added comprehensive user management with 3 roles: admin, editor, and member. Read more [here](/docs/rbac)
- Self-service profile management for all users
- User activation/deactivation controls for admins
- Added dedicated Badges management page in the admin dashboard
- Site-wide status badges to show overall service health
- Version information automatically pulled from package.json
### Improvements
- Improved build time by migrating lucid-svelte to individual components
### Github Issues Resolved
- Feature: Enhancement of Webhook Custom Body Functionality [#238](https://github.com/rajnandan1/kener/issues/238)
- Feature: Add LDAP for authentication [#210](https://github.com/rajnandan1/kener/issues/210)
- the event created by tigger can't update affects. [#309](https://github.com/rajnandan1/kener/issues/309)
- Multiple account or RBAC [#334](https://github.com/rajnandan1/kener/issues/334)
- The event that has been edited isn't clickable after you save it [#350](https://github.com/rajnandan1/kener/issues/350)
- /app/package.json ERROR on fresh install [#346](https://github.com/rajnandan1/kener/issues/346)
- Site stops when monitor processing throws an error [#345](https://github.com/rajnandan1/kener/issues/345)
- Support for Self Signed Certificates [#351](https://github.com/rajnandan1/kener/issues/351)
- Wrong month is showing up after clicking on the 'Browse Events' link [#349](https://github.com/rajnandan1/kener/issues/349)
### Migration Notes
This update is fully backward compatible with existing installations. User accounts created before this update will retain admin privileges by default.
## v3.2.1
<picture>
<source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/512.webp" type="image/webp">
<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/512.gif" alt="🚀" width="32" height="32">
</picture>
### Features
- **New Heartbeat Monitors**
- Added support for push-based monitoring via heartbeats
- Monitors systems that send periodic signals to confirm they're running
- Configurable thresholds for degraded and down states
- Secured with secret token authentication
- Accessible via simple HTTP API endpoints
- **Data Interpolation Improvements**
- Fixed data interpolation issues for more accurate uptime calculations
- Improved handling of timestamp boundaries
### Fixes & Improvements
- **UI Enhancements**
- Better mobile responsiveness for theme toggles and controls
- Fixed layout issues with bottom navigation buttons
- Improved timezone selector display
- **Data Processing**
- Fixed edge case issues with uptime calculations
- Improved handling of "No Data" status in summaries
- More accurate time range display across timezones
- **Documentation**
- Added comprehensive documentation for Heartbeat Monitors
- Updated API documentation with new endpoints
+116
View File
@@ -0,0 +1,116 @@
---
title: Concepts | Kener
description: Concepts for Kener
---
# Concepts
Here are the different concepts that Kener uses to make your life easier.
## Monitors
Monitors are the heart of Kener. They are the ones that keep an eye on your services and let you know when something goes wrong. Monitors can be of different types like HTTP, DNS, Ping etc. They can be configured to check your services at different intervals and alert you when something goes wrong.
### HTTP Monitor
HTTP Monitor is used to check the status of a website or any http api. It can be configured to check the status of the website at different intervals.
It can also be configured to check for a specific status code or a specific response.
You can also add secrets to the HTTP request using environment variables.
### DNS Monitor
DNS Monitor is used to check the status of a DNS server. It can be configured to check the status of the DNS server at different intervals.
### Ping Monitor
Ping Monitor is used to check the status of a server. It can be configured to check the status of the server at different intervals.
### Data Interpolation
Kener interpolates the data for missing intervals. For example, suppose if you have a cron monitor of 5 minutes and it has run twice at 10AM and 10:05AM and the monitor is `DOWN` at 10AM. Kener will interpolate the data for 10:01AM, 10:02AM, 10:03AM and 10:04AM as `DOWN`. Similarly, if the monitor is UP at 10:05AM, Kener will interpolate the data for 10:06AM, 10:07AM, 10:08AM and 10:09AM as UP. Similarly for missing data points it will consider the previous data point. If there is no previous data point, it will consider it as `UP`.
---
## Triggers
Triggers are the ones that are responsible for sending alerts when something goes wrong. They can be configured to send alerts to different channels like Email, Slack, Discord, Webhook etc.
You can set multiple triggers of the same type.
### Email
Email Trigger is used to send an email when something goes wrong. It can be configured to send an email to different email addresses.
Kener uses [resend.com](https://resend.com) to send emails. Please make sure to sign up in [resend.com](https://resend.com) and get the API key. You will need to set the API key in the environment variable `RESEND_API_KEY`. Learn more about environment variables [here](/docs/environment-vars).
### Slack
Slack Trigger is used to send a message to a slack channel when something goes wrong. It can be configured to send a message to different slack channels. Needs slack URL
### Discord
Discord Trigger is used to send a message to a discord channel when something goes wrong. It can be configured to send a message to different discord channels. Needs discord URL
### Webhook
Webhook Trigger is used to send a message to a webhook when something goes wrong. It can be configured to send a message to different webhooks. Needs webhook URL. Method will be POST.
Body of the webhook will be sent as below:
```json
{
"id": "mockoon-9",
"alert_name": "Mockoon DOWN",
"severity": "critical",
"status": "TRIGGERED",
"source": "Kener",
"timestamp": "2024-11-27T04:55:00.369Z",
"description": "🚨 **Service Alert**: Check the details below",
"details": {
"metric": "Mockoon",
"current_value": 1,
"threshold": 1
},
"actions": [
{
"text": "View Monitor",
"url": "https://kener.ing/monitor-mockoon"
}
]
}
```
| Key | Description |
| --------------------- | ----------------------------------------------------------- |
| id | Unique ID of the alert |
| alert_name | Name of the alert |
| severity | Severity of the alert. Can be `critical`, `warn` |
| status | Status of the alert. Can be `TRIGGERED`, `RESOLVED` |
| source | Source of the alert. Can be `Kener` |
| timestamp | Timestamp of the alert |
| description | Description of the alert. This you can customize. See below |
| details | Details of the alert. |
| details.metric | Name of the monitor |
| details.current_value | Current value of the monitor |
| details.threshold | Alert trigger hreshold of the monitor |
| actions | Actions to be taken. Link to view the monitor. |
---
## Incidents
Incidents are the ones that are created when something goes wrong. They can be created using Manage portal or using APIs.
There can be two types of incidents - `DOWN` and `DEGRADED`. Incident can have a title, description, severity and status. Status can be `INVESTIGATING`, `IDENTIFIED`, `MONITORING` and `RESOLVED`.
To learn more about incidents, click [here](/docs/incident-management).
### Incident Updates
Incident updates are done using comment. Each comment has a status and a timestamp. The status of the latest added comment becomes the current status of the incident.
### Incident Monitors
Monitors can be added as affected components for an incident. Depending on the severity of the incident the status of the monitor also changes.
+27
View File
@@ -0,0 +1,27 @@
---
title: How to Add Custom Fonts | Kener
description: Kener allows you to add custom fonts to your site. This guide will help you add custom fonts to your Kener site.
---
# Add Custom Fonts
1. Login to your Kener dashboard.
2. Go to the `Theme` page.
3. Scroll down to the `Fonts` section.
4. Remove `Font URL` and `Font Name`
5. In Custom CSS add your font
```css
@font-face {
font-family: "CustomFont";
src:
url("/path-to-font/CustomFont.woff2") format("woff2"),
url("/path-to-font/CustomFont.woff") format("woff"),
url("/path-to-font/CustomFont.ttf") format("truetype");
font-weight: normal;
font-style: normal;
}
* {
font-family: "CustomFont", sans-serif;
}
```
+85
View File
@@ -0,0 +1,85 @@
---
title: Custom JS and CSS Guide | Kener
description: Custom JS and CSS Guide for Kener
---
Here is a guide to add custom JS and CSS to your Kener instance.
## Adding Custom JS
Add your custom JS to `static/` file. And in the `src/app.html` file, add the following line:
```html
<script src="/your-custom-js-file.js"></script>
```
## Adding Custom CSS
Three are two ways you can add custom CSS to your Kener instance.
### CSS file
Add your custom CSS to `static/` file. And in the `src/app.html` file, add the following line:
```html
<link rel="stylesheet" href="/your-custom-css-file.css" />
```
Do not forget to add the base path if you are using a subpath. For example, if you are using a subpath `/kener`, then the path should be `/kener/your-custom-js-file.js`.
### Inline CSS
To add inline css go to Manage kener -> Theme -> Custom CSS and add your CSS there.
```css
.my-class {
color: red;
}
```
<div class="note danger">
Do not include &#x3C;style&#x3E; tags.
</div>
## Grid Layout
To change from a column layout to a grid layout in your Kener instance, you can use the following CSS:
```css
@media (min-width: 1330px) {
.section-monitors,
.section-categories,
.section-hero,
.section-back,
.section-events,
.section-legend,
.section-categories,
.section-browser-events {
width: 1330px !important;
max-width: 1330px !important;
}
.section-monitors .monitor-root {
background-color: transparent;
border: none !important;
box-shadow: none;
}
.section-monitors .monitor-root .monitors-card {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0.5rem;
}
.section-monitors .monitor-root .monitors-card .monitor {
grid-column: span 1;
border-radius: 0.375rem;
background-color: hsl(var(--card) / var(--tw-bg-opacity, 1));
border-width: 1px;
}
.section-monitors .monitor-root .monitors-card .monitor:last-child {
border-bottom: inherit;
border-bottom-width: 1px !important;
}
}
```
+391
View File
@@ -0,0 +1,391 @@
---
title: Customize Site - Site.yaml - Kener
description: Customize your Kener site using site.yaml
---
# Customize Site
There is a folder called `./config`. Inside which there is a `site.yaml` file. You can modify this file to have your own branding and do few other things.
## Sample site.yaml
```yaml
title: "Kener"
siteName: "Kener.ing"
logo: "/logo.svg"
favicon: "/logo96.png"
home: "/"
theme: dark
themeToggle: true
github:
owner: "rajnandan1"
repo: "kener"
incidentSince: 72
metaTags:
description: "Your description"
keywords: "keyword1, keyword2"
nav:
- name: "Documentation"
url: "/docs"
- name: "Github"
iconURL: "/github.svg"
url: "https://github.com/rajnandan1/kener"
siteURL: https://kener.ing
hero:
title: Kener is a Open-Source Status Page System
subtitle: Let your users know what's going on.
footerHTML: |
Made using
<a href="https://github.com/rajnandan1/kener" target="_blank" rel="noreferrer" class="font-medium underline underline-offset-4">
Kener
</a>
an open source status page system built with Svelte and TailwindCSS.
i18n:
defaultLocale: "en"
locales:
en: "English"
hi: "हिन्दी"
zh-CN: "中文"
ja: "日本語"
vi: "Tiếng Việt"
pattern: "squares"
font:
cssSrc: "https://fonts.bunny.net/css?family=lato:100,100i,300,300i,400,400i,700,700i,900,900i&display=swap"
family: '"Lato", sans-serif'
analytics:
- id: "G-QsFT"
type: "GA"
- id: "deasf0d350"
type: "AMPLITUDE"
- id: "FKOdsKener"
type: "MIXPANEL"
```
---
## title
This translates to
```html
<title>Your Title</title>
```
---
## siteName
This is the name that will be shown in the nav bar, top left corner of the page
## logo
URL of the logo that will be shown in the nav bar. You can also add your logo in the `static` folder. Use the path `/logo.svg` to refer to it if you have added `logo.svg` in the `static` folder. Otherwise, you can use any URL.
## favicon
URL of the favicon that will be shown in the browser tab. You can also add your favicon in the `static` folder. Use the path `/logo96.png` to refer to it if you have added `logo96.png` in the `static` folder. Otherwise, you can use any URL.
## home
This is the location where someone will be taken when they click on the site name in the nav bar
## theme
This is the default theme of the site that will be used when a user lands for the first time. It can be `light` or `dark` or `system` or `none`. Defaults to `system`. The user still gets the option to change the theme.
- setting it to `light` will always set the theme to light when page loads
- setting it to `dark` will always set the theme to dark when page loads
- setting it to `system` will set the theme based on the system preference
- setting it to `none` will set the theme to last selected theme by the user
## themeToggle
This is the option to show the theme toggle. It can be `true` or `false`. Defaults to `true`.
As of now there is no option to change the colors of the theme using `site.yaml`. If you still want to change the colors you can do so by modifying the `src/app.postcss` file.
## favicon
It can be set by modifying the `<head>` tag in `src/app.html` file.
Example add a png called `logo.png` file in `static/` and then
```html
...
<link rel="icon" href="/logo.png" />
...
```
---
## github
For incident kener uses github issues. Create an empty [github](https://github.com) repo and add them to `site.yaml`
```yaml
github:
apiURL: "https://api.github.com"
owner: "username"
repo: "repository"
incidentSince: 720
```
### apiURL
API URL of the github. Default is `https://api.github.com`. If you are using github enterprise then you can change it to your github enterprise api url.
### owner
Owner of the github repository. If the repository is `https://github.com/rajnandan1/kener` then the owner is `rajnandan1`
### repo
Repository name of the github repository. If the repository is `https://github.com/rajnandan1/kener` then the repo is `kener`
### incidentSince
`incidentSince` is in hours. It means if an issue is created before X hours then kener would not honor it. What it means is that kener would not show it active incident pages nor it will update the uptime. Default is 30\*24 hours = 720 hours.
To read how to set up github for kener [click here](/docs/gh-setup)
To see how to create an issue [click here](/docs/incident-management)
---
## metaTags
Meta tags are nothing but html `<meta>`. You can use them for SEO purposes
```yaml
metaTags:
description: "Your description"
keywords: "keyword1, keyword2"
og:image: "https://example.com/og.png"
```
will become
```html
<head>
<meta name="description" content="Your description" />
<meta name="keywords" content="keyword1, keyword2" />
<meta name="og:image" content="https://example.com/og.png" />
</head>
```
---
## siteURL
You can set this to generate SiteMaps
```yaml
siteURL: https://kener.ing
```
Sitemaps urls will be `https://kener.ing/sitemap.xml`
---
## hero
Use hero to add a banner to your kener page
```yaml
hero:
title: Kener is a Open-Source Status Page System
subtitle: Let your users know what's going on.
```
### title
Title of the hero section
### subtitle
Subtitle of the hero section
---
## nav
You can add more links to your navbar.
```yaml
nav:
- name: "Home"
url: "/home"
```
### name
Name of the link
### url
URL of the link
### iconURL
Icon of the link. You can add an icon in the `static` folder and refer to it using the path `/github.svg`
---
## categories
You can define categories for your monitors. Each category can have a description. The monitors can be grouped by categories.
`name=home` will be shown in the home page. Categories are shown in the order they are defined in the yaml file. A dropdown will appear in the nav bar to select the category.
```yaml
categories:
- name: API
description: "Kener provides a simple API for you to use to update your status page."
- name: home
description: "loroem ipsum lorem ipsum"
```
### name
Name of the category
### description
Description of the category
---
## footerHTML
You can add HTML to the footer. You can add links to your social media or anything else.
```yaml
footerHTML: |
Made using <a href="https://kener.ing" target="_blank" rel="noreferrer" class="font-medium underline underline-offset-4">Kener</a> an open source status page system built with Svelte and TailwindCSS.
```
---
## i18n
You can add translations to your site. By default it is set to `en`. Available translations are present in `locales/` folders in the root directory. You can add more translations by adding a new file in the `locales` folder.
### Enable
Once you have added a new translation file in the `locales` folder, you can enable it by adding the locale code in the `site.yaml` file.
Let us say you have added a `hi.json` file in the `locales` folder. You can enable it by adding the following to the `site.yaml` file.
```yaml
i18n:
defaultLocale: en
locales:
en: English
hi: हिन्दी
```
### defaultLocale
**_defaultLocale_**: The default locale to be used for a user when he or she visits for the first time. It is important to note that the default locale json file should be present in the locales folder.
### locales
**_locales_**: A list of locales that you want to enable. The key is the locale code and the value is the name of the language. The locale code should be the same as the json file name in the locales folder. `en` means `en.json` should be present in the locales folder.
Adding more than one locales will enable a dropdown in the navbar to select the language.
Selected languages are stored in cookies and will be used when the user visits the site again.
There is no auto detection of the language. The user has to manually select the language.
### Variables
There are few variables that you you should not change,
- %hours : This will be replaced by the hours
- %minutes : This will be replaced by the minutes
- %minute : This will be replaced by the minute
- %status : This will be replaced by the status
---
## pattern
You can set the background pattern of the site. It can be `squares`, `dots`, `none`
---
## font
You can set the font of the site. You can use google fonts, [bunny fonts](https://fonts.bunny.net/) (which is a fully GDPR-compliant, zero-tracking/no-logging CDN font service), or any other font.
```yaml
font:
cssSrc: "https://fonts.bunny.net/css?family=lato:100,100i,300,300i,400,400i,700,700i,900,900i&display=swap"
family: '"Lato", sans-serif'
```
### cssSrc
URL of the font css
### family
Font family
---
## analytics
You can add analytics to your site. You can add multiple analytics. Supported analytics are `GA`, `AMPLITUDE`, `MIXPANEL`
```yaml
analytics:
- id: "G-QsFT"
type: "GA"
- id: "deasf0d350"
type: "AMPLITUDE"
- id: "FKOdsKener"
type: "MIXPANEL"
```
## barStyle
Kener shows a bar for a day. By default if any downtime or degradation is there the bar will be red or yellow respectively.
If you want to only show a part of the bar as red or yellow then you can set the `barStyle` to `PARTIAL`. Default is `FULL`
```yaml
barStyle: PARTIAL
```
---
## barRoundness
You can set the roundness of the bar. It can be `SHARP` or `ROUNDED`. Default is `ROUNDED`
```yaml
barRoundness: ROUNDED
```
---
## summaryStyle
The summary of the monitor today is shown in the monitor page. By default it shows the the whole day summary. If you want to show the current status then you can set the `summaryStyle` to `CURRENT`. Default is `DAY`.
```yaml
summaryStyle: CURRENT
```
---
## colors
You can set the colors of UP, DOWN, DEGRADED
```yaml
colors:
UP: "#4ead94"
DOWN: "#ca3038"
DEGRADED: "#e6ca61"
```
+58
View File
@@ -0,0 +1,58 @@
---
title: Database Config - Server.yaml - Kener
description: Add database configuration to your kener server.yaml
---
# Databases
Kener uses relational database to store its data.
## Supported Database
- Sqlite (default)
- Postgres
- Mysql
We will be adding more database support in the future.
## Sqlite
Sqlite is the default database for Kener. You don't need to do anything to use it. The database file will be created in the `database` folder which is present in the root of the project.
The name of the default database file is `kener.db`. The path will be `database/kener.sqlite.db`.
You can change the database file name by changing the environment variable `DATABASE_URL`. Prefix the connection string with `sqlite://` and add the path to the database file.
```bash
export DATABASE_URL=sqlite://./database/awesomeKener.db
```
In this case, the database file will be created in the `database` folder with the name `awesomeKener.db`.
Make sure the `database` folder is writable by the Kener process.
## Postgres
To use Postgres, you need to update the connection string details in the `DATABASE_URL` environment variable. The connection string has to with `postgresql`
```bash
export DATABASE_URL=postgresql://myuser:mypassword@your.host:5432/kenerdb
```
## Mysql
To use Mysql, you need to update the connection string details in the `DATABASE_URL` environment variable. The connection string has to with `mysql`
```bash
export DATABASE_URL=mysql://root:password@your.host:3306/kenerdb
```
## Migrations
To run migrations to latest, run
```bash
npm run migrate
```
When kener runs it will always migrate up to the latest version
+162
View File
@@ -0,0 +1,162 @@
---
title: Kener Deployment - From Source or Docker
description: Kener can be deployed in multiple ways. You can use the pre-built docker image or build from source.
---
# Deployment
Kener can be deployed in multiple ways. You can use the pre-built docker image or build from source.
## Prerequisites
Make sure you have the following installed:
- [Node.js 20 or above](https://nodejs.org/en/download/)
- [npm](https://www.npmjs.com/get-npm)
- [Sqlite3](https://www.sqlite.org/download.html)
- Make sure `./database` directory is present in the root directory
- [Set up Environment Variables](/docs/environment-vars). You can use a `.env` file or pass them as arguments. Be sure to add `NODE_ENV=production` for production deployment
## NPM
```bash
npm i
npm run build #build the frontend
npm run start
```
## PM2
```bash
npm i
npm run build #build the frontend
pm2 start main.js
```
## Docker
[Dockerhub](https://hub.docker.com/r/rajnandan1/kener)
```bash
docker.io/rajnandan1/kener:latest
```
[Github Packages](https://github.com/rajnandan1/kener/pkgs/container/kener)
```bash
ghcr.io/rajnandan1/kener:latest
```
### Volumes
- `$(pwd)/uploads` You should mount one host directories to persist your image uploads.
- `$(pwd)/database` If you are using sqlite, you should mount one host directory to persist your database.
### Environment Variables
[Environment variables](/docs/environment-vars) can be passed with `-e` An example `docker run` command:
Make sure `./database` and `./uploads` directories are present in the root directory.
### Examples
This example is for sqlite. You can also use postgres. Read more about it [here](/docs/environment-vars#database-url)
#### sqlite
```bash
mkdir database uploads
```
```bash
docker run \
-v $(pwd)/database:/app/database \
-v $(pwd)/uploads:/app/uploads \
-p 3000:3000 \
-e "KENER_SECRET_KEY=somesecretkey" \
-e "ORIGIN=http://localhost:3000" \
rajnandan1/kener
```
#### .env
You can also use a .env file
```bash
mkdir database uploads
```
```bash
docker run \
-v $(pwd)/database:/app/database \
-v $(pwd)/uploads:/app/uploads \
--env-file .env \
-p 3000:3000 \
rajnandan1/kener
```
Or use **Docker Compose** with the example [docker-compose.yaml](https://raw.githubusercontent.com/rajnandan1/kener/main/docker-compose.yml)
#### Postgres
```bash
mkdir uploads
```
Database folder is not required for postgres.
```bash
docker run \
-p 3000:3000 \
-v $(pwd)/uploads:/app/uploads \
-e "KENER_SECRET_KEY=somesecretkey" \
-e "DATABASE_URL=postgresql://myuser:mypassword@localhost:5432/mydatabase" \
-e "ORIGIN=http://localhost:3000" \
rajnandan1/kener
```
#### MySQL
```bash
mkdir uploads
```
Database folder is not required for mysql.
```bash
docker run \
-p 3000:3000 \
-v $(pwd)/uploads:/app/uploads \
-e "KENER_SECRET_KEY=somesecretkey" \
-e "DATABASE_URL=mysql://root:password@mysql-container-2.orb.local:3306/kener-2" \
-e "ORIGIN=http://localhost:3000" \
rajnandan1/kener
```
#### Base path
By default kener runs on `/` but you can change it to `/status` or any other path. Read more about it [here](/docs/environment-vars/#kener-base-path).
<div class="note info">
- Important: The base path should _**NOT**_ have a trailing slash and should start with `/`
- Important: This env variable should be present during both build and run time
- Important: You will have to build the frontend with the same base path
</div>
Let us say you are running kener on a subpath `/status`. You can set the base path like this:
```bash
docker build --build-arg KENER_BASE_PATH=/status -t kener .
```
```bash
docker run -p 3000:3000 --env-file .env -v $(pwd)/database:/app/uploads -v $(pwd)/database:/app/database kener
```
## Railway
You can deploy Kener on [Railway](https://railway.app) with a single click.
[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/template/spSvic?referralCode=1Pn7vs)
+70
View File
@@ -0,0 +1,70 @@
---
title: Embed Monitor | Kener
description: Embed your monitor in your website
---
# Embed Monitor
There are two ways to embed your monitor in your website
## Javascript
You can embed your monitor in your website using javascript. We recommend using this method as it takes care of the height of the embedded monitor.
```html
<script async src="http://[hostname]/embed/monitor-[tag]/js?theme=light&monitor=http://[hostname]/embed/monitor-[tag]"></script>
```
Here is an example
```html
<script async src="https://kener.ing/embed/monitor-earth/js?theme=light&monitor=https://kener.ing/embed/monitor-earth"></script>
```
### Parameters
You can pass the following parameters to the embed code
- `theme`: You can pass `light` or `dark` theme
- `monitor`: The monitor url
- `bgc`: Background color of the monitor. Only supports hex color codes. DO NOT include the `#` symbol. Example: `ff0000`
- `locale`: The locale of the monitor. You can pass the code of the locale you have enabled in your kener settings. Example: `en`, `fr` etc
- `tz`: Timezone. Example `Asia/Calcutta`, `Asia/Tokyo`
Replace `[hostname]` with your kener hostname and `[tag]` with your monitor tag.
### Demo
<div class="border mx-auto rounded-sm w-585px">
<script async src="/embed/monitor-earth/js?theme=dark&monitor=/embed/monitor-earth"></script>
</div>
## Iframe
This is the simplest way to embed your monitor in your website. You can use the following code to embed your monitor in your website.
```html
<iframe src="http://[hostname]/embed/monitor-[tag]?theme=light" width="100%" height="200" allowfullscreen="allowfullscreen" allowpaymentrequest frameborder="0"></iframe>
```
Here is an example
```html
<iframe src="https://kener.ing/embed/monitor-earth?theme=light" width="100%" height="100" allowfullscreen="allowfullscreen" allowpaymentrequest frameborder="0"></iframe>
```
Replace `[hostname]` with your kener hostname and `[tag]` with your monitor tag.
### Parameters
You can pass the following parameters to the embed code
- `theme`: You can pass `light` or `dark` theme
- `bgc`: Background color of the monitor. Only supports hex color codes. DO NOT include the `#` symbol. Example: `ff0000`
- `locale`: The locale of the monitor. You can pass the code of the locale you have enabled in your kener settings. Example: `en`, `fr` etc
### Demo
<div class="border mx-auto rounded-sm w-585px">
<iframe src="/embed/monitor-earth?theme=dark" width="100%" height="100" allowfullscreen="allowfullscreen" allowpaymentrequest frameborder="0"></iframe>
</div>
+146
View File
@@ -0,0 +1,146 @@
---
title: Environment Variables | Kener
description: Kener needs some environment variables to be set to run properly. Here are the list of environment variables that you need to set.
---
# Environment Variables
Kener needs some environment variables to be set to run properly. Here are the list of environment variables that you need to set.
All of these are optional but are required for specific features.
## KENER_SECRET_KEY [Required]
Please set a strong secret key for Kener to use for encrypting the data. This is required to run Kener.
```bash
export KENER_SECRET_KEY=a-strong-secret-key
```
## ORIGIN [Required]
Set this to the origin of your website(protocl + hostname + port if there). This is required for CORS.
```bash
export ORIGIN=http://localhost:3000
```
If your host is at let us say `https://example.com`, then set the ORIGIN to `https://example.com`. This is required for CORS.
If you are using a reverse proxy like nginx, make sure to set the `ORIGIN` to the domain name of your website.
```bash
export ORIGIN=https://example.com
```
## PORT
Defaults to 3000 if not specified
```bash
export PORT=4242
```
## KENER_BASE_PATH
By default kener runs on `/` but you can change it to `/status` or any other path.
- Important: The base path should _**NOT**_ have a trailing slash and should start with `/`
- Important: This env variable should be present during both build and run time
```bash
export KENER_BASE_PATH=/status
```
## RESEND_API_KEY
Kener uses [resend.com](https://resend.com) to send emails. Please make sure to sign up in [resend.com](https://resend.com) and get the API key. You will need to set the API key in the environment variable `RESEND_API_KEY`.
```bash
export RESEND_API_KEY=re_sometoken
```
## RESEND_SENDER_EMAIL
Set the sender email for the emails that are sent by Kener. This is required for sending emails. If you have not added a domain in resend, you can se something like `Some Name <onboarding@resend.dev>`. We recommend adding a domain in resend and using that email domain.
```bash
export RESEND_SENDER_EMAIL=Some Name <email@domain.com>
```
<div class=" note danger ">
Please note that the RESEND_API_KEY is required for sending emails. If you do not set this, Kener will not be able to send emails. RESEND_SENDER_EMAIL is a must if you forget your password. If you do not want to use resend, you can set SMTP variables.
</div>
## DATABASE_URL
Kener uses a database to store its data. By default, Kener uses sqlite. You can change the database by setting the `DATABASE_URL` environment variable. The connection string has to start with `sqlite`, `postgresql`, or `mysql`. Read more about [database configuration](/docs/database).
```bash
export DATABASE_URL=sqlite://./database/awesomeKener.db
```
## TZ
Set the timezone for the server. Set it to UTC.
```bash
export TZ=UTC
```
## SMTP
Kener can also use SMTP to send emails. You can set the SMTP server details in the environment variables.
```bash
export SMTP_HOST=smtp.example.com
export SMTP_PORT=587
export SMTP_USER=username
export SMTP_PASS=password
export SMTP_SECURE=0
export SMTP_FROM_EMAIL=Some Name <user@example.com>
```
<div class=" note info ">
Generally, port 465 expects implicit SSL (SMTP_SECURE: 1), while port 587 and port 25 usually use STARTTLS (SMTP_SECURE: 0).
So, if you are using SMTP on port 465, set SMTP_SECURE: 1; otherwise, for ports 25 or 587, set SMTP_SECURE: 0.
</div>
<div class=" note danger ">
If you set SMTP variables, Kener will use SMTP to send emails. If you set RESEND_API_KEY, Kener will use resend to send emails. If you do both Kener will use SMTP.
</div>
<div class=" note info ">
If your SMTP provider does require username and password, you can set `SMTP_USER` and `SMTP_PASS` to `-`.
</div>
## Using .env
You can also use a `.env` file to set these variables. Create a `.env` file in the root of the project and add the variables like below
```bash
KENER_SECRET_KEY=please_change_me
PORT=4242
GH_TOKEN=your-github-token
RESEND_API_KEY=re_sometoken
KENER_BASE_PATH=/status
ORIGIN=http://localhost:3000
```
## Secrets
Kener supports secrets in monitors. Let us say you have a monitor that is API based and you want to keep the API key secret.
Example: `https://api.example.com/users` with a header `Authorization: Bearer $CLIENT_SECRET`
You should set the `CLIENT_SECRET` in the your environment variables.
```bash
export CLIENT_SECRET=your-api-key
```
Remember to set the `CLIENT_SECRET` in your `.env` file if you are using one.
+62
View File
@@ -0,0 +1,62 @@
---
title: Github Setup | Kener
description: Kener uses github for incident management. Issues created in github using certain tags go to kener as incidents.
---
# Github Setup
Kener uses github for incident management. Issues created in github using certain tags go to kener as incidents.
## Step 1: Create Github Repository
Create a [Github Repository](https://github.com/new). It can be either public or private.
## Step 2: Create Github Token
You can create either a classic token or personal access token
### Creating Classic Token
- Go to [Tokens](https://github.com/settings/tokens/new)
- Note: kener
- Expiration: No Expiration
- Scopes: write:packages
- Click on generate Token
### Creating Personal Access Token
- Go to [Personal Access Token](https://github.com/settings/personal-access-tokens/new)
- Token Name: kener
- Expiration: Use custom to select a calendar date
- Description: My Kener
- Repository access: Check Only Selected Repositories. Select your github repository
- Repository Permission: Select Issues Read Write
- Click on generate token
## Step 3: Set environment
```bash
export GH_TOKEN=github_pat_11AD3ZA3Y0
```
## Step 4: Add to Kener
Add your repository details to kener.
![Monitors API](/gh_s.png)
### Github API URL
If you are on github enterprise you can set the github api url. For most users, it will be `https://api.github.com`
### Github Repo
The repository name you created in step 1
### Github Username
Your github username
### Incident History
It is in hours. It means if an issue is created before X hours then kener would not honor it. What it means, is that kener would not show it under active incidents nor it will update the uptime. Default is 30\*24 hours = 720 hours.
+74
View File
@@ -0,0 +1,74 @@
---
title: Home Page Setup | Kener
description: Learn how to set up and work with the home page in kener.
---
# Home Page
Home page is the first page that the user sees when they visit your status page. You can customize the home page to show the information that you want to show.
---
## Hero Section
### Title
A big text that will be shown on the hero section.
### Subtitle
A small text that will be shown below the title.
<div class="border rounded-md">
![Hero Section](/documentation/home_1.png)
</div>
---
## Navigation
You can navigation links to other urls. You can add as many as you want.
![Nav Section](/documentation/home_2.png)
### Icon
A small image to be shown along with the link. Icon is optional
### Title
The title of the link.
### URL
The URL to redirect to when the link is clicked.
![Nav Section](/documentation/home_3.png)
---
## Internationalization
Add multiple languages to your status page. You can add a new language and add translations for all the text that is shown on the status page by following the steps [here](/docs/i18n).
- Adding more than one locales will enable a dropdown in the navbar to select the language.
- Selected languages are stored in cookies and will be used when the user visits the site again.
- There is no auto detection of the language. The user has to manually select the language.
### Default Language
The default language of the status page.
---
## Site Categories
Use this to group monitors. Byh default a readonly home category is created. You can add more categories and move monitors to those categories.
---
## Site Footer
Add footer text or html to the status page. You can add any text that you want to show in the footer. Make sure if you are adding html it is safe and valid.
+76
View File
@@ -0,0 +1,76 @@
---
title: Kener Documentation | Open Source Status Page
description: Kener is a feature-rich and modern status page system built with SvelteKit and NodeJS. It is open-source and free to use.
---
# Kener - A Feature Rich & Modern Status Page
<p align="center">
<img src="/newbg.png" width="100%" height="auto" class="rounded-lg shadow-lg" alt="kener example illustration">
</p>
<p class="flex space-x-2 justify-center">
<a href="https://github.com/rajnandan1/kener/stargazers" >
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/rajnandan1/kener?label=Star%20Repo&
style=social">
</a>
<a href="https://github.com/ivbeg/awesome-status-pages" >
<img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome status page" />
</a>
<a href="https://hub.docker.com/r/rajnandan1/kener" >
<img src="https://img.shields.io/docker/pulls/rajnandan1/kener" alt="Docker Kener" />
</a>
</p>
<div class="flex gap-4 justify-center">
<picture>
<source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/1f38a/512.webp" type="image/webp">
<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f38a/512.gif" alt="🎊" width="32" height="32">
</picture>
<picture>
<source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/1f514/512.webp" type="image/webp">
<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f514/512.gif" alt="🔔" width="32" height="32">
</picture>
<picture>
<source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/2049_fe0f/512.webp" type="image/webp">
<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/2049_fe0f/512.gif" alt="⁉" width="32" height="32">
</picture>
</div>
<div class="flex gap-2 kener-home-links">
<a href="https://kener.ing" class="flex-1 border rounded-md py-4 px-2 text-center">
Live Demo
</a>
<a href="https://kener.ing/docs/quick-start" class="flex-1 border rounded-md py-4 px-2 text-center">
Quick Start
</a>
<a href="https://github.com/rajnandan1/kener" class="flex-1 border rounded-md py-4 px-2 text-center">
Clone
</a>
<a href="https://kener.ing/docs/deployment" class="flex-1 border rounded-md py-4 px-2 text-center">
Deploy
</a>
<a href="https://kener.ing/docs/kener-apis" class="flex-1 border rounded-md py-4 px-2 text-center">
APIs
</a>
</div>
## Forget Boring Status Pages. Hello Kener!
**Kener** isn't just another status page it's a beautifully crafted, lightning-fast monitoring system that makes your services look good even when they're down. Built with modern tech (**SvelteKit** + **NodeJS**), it delivers enterprise-grade reliability monitoring without the enterprise price tag (it's completely free!).
### Why Teams Are Switching to Kener
- **📈 Up and running in minutes**, not days from Docker to deployment in less time than it takes to make coffee
- **🎭 Dark mode that actually looks good** because your 3 AM incident responses shouldn't burn your retinas
- **🧩 Ridiculously customizable** make it match your brand or go wild with a unique design
- **⚡ Blazing fast performance** server-rendered for speed that both users and search engines love
- **🌐 Works everywhere** auto-adjusts to visitors' time zones and looks great on any device
- **🔄 Real-time data** with gorgeous visualizations that make your uptime metrics pop
- **🛠️ Modern tooling** without the bloat everything you need, nothing you don't
### Used by Companies That Value Simplicity and Power
From indie developers to growing startups, teams are choosing Kener when they need reliability monitoring that doesn't require a dedicated DevOps team to maintain.
"_My team set up Kener in less than an hour, and our customers love the transparency it provides. The embedded widgets on our pricing page increased conversions by showing our reliability upfront._" A happy user
## Ready to Transform Your Status Page?
+38
View File
@@ -0,0 +1,38 @@
---
title: How it works | Kener
description: Folder structure and how Kener works
---
# How it works
Kener has two parts.
- Sveltekit application which is server rendered and is the frontend. It is running on Svelte 4.
- Hooks into the backend to get the data for your monitors
## Folder structure
```bash
├── src (svelte frontend files)
├── static (things put here can be referenced directly example static/logo.png -> /logo.png)
├── src
├──── routes
├────── (docs) (You can delete this, this has routes for documentation)
├──── lib
├────── server
├──────── config (Location for you site.yaml and monitos.yaml)
├──────── data (This is the location where server computate data is stored. Do not touch this)
├── docs (Documentation, you can delete this folder)
```
## Site.yaml
This is the configuration file for your site. This is where you define the name of your site, the look and feel of your site etc. Read more about it [here](/docs/customize-site)
## Monitors.yaml
This is the configuration file for your monitors. This is where you define the monitors you want to show on your site. Read more about it [here](/docs/monitors)
## Data
Kener stores its data in a folder which is `./database`. This is where all the data is stored. You can delete this folder if you want to start fresh.
+197
View File
@@ -0,0 +1,197 @@
---
title: i18n | Kener
description: Kener supports multiple languages. You can add translations to your site.
---
# i18n
You can add translations to your site. By default it is set to `en`. Available translations are present in `src/lib/locales/` folders in the root directory. You can add more translations by adding a new file in the `src/lib/locales` folder.
## How to enable a translation
Kener has made it simple to add new translations.
### Step 1
Copy and update the translation file in the `locales` folder. The translation file should be a json file with the locale code as the name of the file. For example, `en.json`, `fr.json`, `de.json`.
<label for="exp2" class="accm">
<input type="checkbox" class="absolute opacity-0" id="exp2" />
<p class=" font-medium p-1 accmt rounded-md showaccm">
<span>↓ Show File</span>
<span>↑ Hide File</span>
</p>
<div class="border rounded-md p-1">
```json
{
"%status for %duration": "%status for %duration",
"120 Days": "120 Days",
"14 Days": "14 Days",
"150 Days": "150 Days",
"180 Days": "180 Days",
"30 Days": "30 Days",
"60 Days": "60 Days",
"7 Days": "7 Days",
"90 Days": "90 Days",
"Availability per Component": "Availability per Component",
"All Systems are Degraded": "All Systems are Degraded",
"All Systems are Down": "All Systems are Down",
"All Systems are Operational": "All Systems are Operational",
"All Systems are in Maintenance": "All Systems are in Maintenance",
"Back": "Back",
"Badge Copied": "Badge Copied",
"Badge": "Badge",
"Browse Events": "Browse Events",
"Change Email": "Change Email",
"Code Copied": "Code Copied",
"Confirm Login": "Confirm Login",
"Copy Code": "Copy Code",
"Copy Link": "Copy Link",
"DEGRADED": "DEGRADED",
"DOWN": "DOWN",
"Dark": "Dark",
"Days": "Days",
"Embed this monitor using &#x3C;script&#x3E; or &#x3C;iframe&#x3E; in your app.": "Embed this monitor using <script> or <iframe> in your app.",
"Embed": "Embed",
"Enter the code": "Enter the code",
"Enter your email": "Enter your email",
"Enter your email to log in. If you are not subscribed, you will be prompted to subscribe.": "Enter your email to log in. If you are not subscribed, you will be prompted to subscribe.",
"Get SVG badge for this monitor": "Get SVG badge for this monitor",
"Get a LIVE Status for this monitor": "Get a LIVE Status for this monitor",
"IDENTIFIED": "IDENTIFIED",
"INVESTIGATING": "INVESTIGATING",
"Incident Updates": "Incident Updates",
"LIVE Status": "LIVE Status",
"Lasted for about %lastedFor": "Lasted for about %lastedFor",
"Light": "Light",
"Link Copied": "Link Copied",
"Login": "Login",
"MAINTENANCE": "MAINTENANCE",
"MONITORING": "MONITORING",
"Maintenance Completed": "Maintenance Completed",
"Maintenance in Progress": "Maintenance in Progress",
"Manage Subscription": "Manage Subscription",
"Mode": "Mode",
"No Data": "No Data",
"No Incident in %date": "No Incident in %date",
"No Incidents": "No Incidents",
"No Monitor Found": "No Monitor Found",
"No Updates Yet": "No Updates Yet",
"Ongoing Incidents": "Ongoing Incidents",
"Pinging": "Pinging",
"Please select specific monitors to receive updates from.": "Please select specific monitors to receive updates from.",
"RESOLVED": "RESOLVED",
"Recent Incidents": "Recent Incidents",
"Recent Maintenances": "Recent Maintenances",
"Share this monitor using a link with others": "Share this monitor using a link with others",
"Share": "Share",
"Some Systems are not working as expected": "Some Systems are not working as expected",
"Some Systems Degraded": "Some Systems Degraded",
"Some Systems Down": "Some Systems Down",
"Some Systems in Maintenance": "Some Systems in Maintenance",
"Standard": "Standard",
"Started %startedAt, lasted for %lastedFor": "Started %startedAt, lasted for %lastedFor",
"Started %startedAt, still ongoing": "Started %startedAt, still ongoing",
"Started %startedAt, will last for %lastedFor more": "Started %startedAt, will last for %lastedFor more",
"Starts %startedAt, will last for %lastedFor": "Starts %startedAt, will last for %lastedFor",
"Starts %startedAt": "Starts %startedAt",
"Status OK": "Status OK",
"Status": "Status",
"Subscribe": "Subscribe",
"Subscribe to Updates": "Subscribe to Updates",
"Subscribe to all monitors": "Subscribe to all monitors",
"Switch to your timezone": "Switch to your timezone",
"Theme": "Theme",
"There are no upcoming maintenances": "There are no upcoming maintenances",
"Timezone set to %tz": "Timezone set to %tz",
"Today": "Today",
"UP": "UP",
"Update Subscription": "Update Subscription",
"Upcoming Maintenance": "Upcoming Maintenance",
"Upcoming Maintenances": "Upcoming Maintenances",
"Updates": "Updates",
"Uptime": "Uptime",
"View in detail": "View in detail",
"We have sent a code to your email. Please enter it below to confirm your login": "We have sent a code to your email. Please enter it below to confirm your login",
"You are logged in as %email": "You are logged in as %email"
}
```
</div>
</label>
### Step 2
Open `src/lib/locales/locales.json` and add the locale code and the name of the language.
```json
[
{
"code": "en",
"name": "English"
},
{
"code": "hi",
"name": "हिन्दी"
},
{
"code": "zh-CN",
"name": "中文"
},
{
"code": "ja",
"name": "日本語"
},
{
"code": "vi",
"name": "Tiếng Việt"
},
{
"code": "fr",
"name": "Français"
}
]
```
### Step 3
Open `src/lib/i18n/client.js` and add the locale code to the `locales` array.
```js
import { ru, enUS, hi, de, zhCN, vi, ja, nl, da, fr, ko } from "date-fns/locale"
```
This should be valid for the date-fns library. You can find the list of locales [here](https://github.com/date-fns/date-fns/blob/9bb51691f201c3ec05ab832acbc5d478f2e5c47a/docs/i18nLocales.md).
Next add a mapping in the `locales` object.
```js
const locales = { ru, en: enUS, hi, dk: de, "zh-CN": zhCN, vi, ja, nl, dk: da, fr, ko }
```
### Step 4
Restart the server and you will see a dropdown in the navbar to select the language.
<div class="note info">
DO NOT forget to raise a PR with the new translation file so that others can use it too.
</div>
## Variables
There are few variables that you you should not change,
- %status : This will be replaced by the status
- %lastedFor : This will be replaced by the duration the incident lasted
- %startedAt : This will be replaced by the time the incident started
- %date : This will be replaced by the date
- %duration : This will be replaced by the duration
## Dates
The localization for dates are still not there. We are working on it and will be available soon.
+80
View File
@@ -0,0 +1,80 @@
---
title: Incident Management | Kener
description: Kener uses Github to power incident management using labels
---
# Incident Management
Kener lets you manage incidents using its dashboard or APIs.
## Create Incident
### Incident Title
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The title of the incident. This is used to identify the incident in the dashboard.
### Incident Summary
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
A brief summary of the incident. This is used to give a brief overview of the incident.
### Incident Start Date Time
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The start date and time of the incident.
<div class="note info">
Each incident once created will be in INVESTIGATING status. You can update the status of the incident by adding updates as discussed below
</div>
---
## Update Incident
Add comments to the incident to update the status of the incident.
### Time Stamp
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
### Message
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The message to be added to the incident.
### Status
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The status of the incident. This can be `INVESTIGATING`, `IDENTIFIED`, `MONITORING`, `RESOLVED`.
### Close Incident
To close an incident, you need to add a message and set the status to `RESOLVED`.
---
## Add Monitors
To add monitors to the incident, you need to add the monitor tag to the incident. This will automatically add the monitor to the incident. You will also get the status of the monitor in the incident. For any event type, this can be `DEGRADED` or `DOWN`. For maintenance event type, this can also be `MAINTENANCE`.
## Maintenance
You can also create a maintenance incident. This is similar to an incident but is used to notify users about maintenance activities. Both start and end date and time are required for maintenance incidents.
+29
View File
@@ -0,0 +1,29 @@
---
title: Kener APIs
description: Kener gives APIs to push data and create incident.
---
# Kener APIs
Kener also gives APIs to push data and create incident. Before you use kener apis you will have to generate the API keys using the dashboard.
1. Go to manage kener dashboard
2. Go to api keys
3. Click on Create New API Key
4. Enter a name for the API key
5. Click on Create
You can use the generated API key to authenticate the APIs. It will be not be shown again, so make sure to save it.
## API Reference
The current version is 3.0.0. We maintain just one version
[API Reference](/api-reference)
You can download the openapi spec
- [JSON](https://raw.githubusercontent.com/rajnandan1/kener/main/openapi.json)
- [YAML](https://raw.githubusercontent.com/rajnandan1/kener/main/openapi.yaml)
---
View File
+240
View File
@@ -0,0 +1,240 @@
---
title: Monitor Examples | Kener
description: Here are some exhaustive examples for monitors
---
# Monitor Examples
Here are some exhaustive examples for monitors
## Simple GET Monitor
Below example will call https://www.google.com/webhp. If the status code is 200 then it will be UP else DOWN.
```yaml
- name: Google Search
tag: "google-search"
api:
method: GET
url: https://www.google.com/webhp
```
## Simple GET Monitor Without Hyperlink
Below example will call https://www.google.com/webhp. If the status code is 200 then it will be UP else DOWN. It will not show the GET hyperlink in the monitor description.
```yaml
- name: Google Search
tag: "google-search"
api:
method: GET
url: https://www.google.com/webhp
hideURLForGet: true
```
## Monitor with HTML description
Below example will call https://www.google.com/webhp. If the status code is 200 then it will be UP else DOWN. It will show the description in HTML format.
```yaml
- name: Google Search
tag: "google-search"
description: "Hello <b>world</b>"
api:
method: GET
url: https://www.google.com/webhp
```
## Monitor with image
google.png is in the static folder
```yaml
- name: Google Search
tag: "google-search"
image: "/google.png"
api:
method: GET
url: https://www.google.com/webhp
```
## Get Monitor 15 Minute
Below example will call https://www.google.com/webhp every 15 minutes. If the status code is 200 then it will be UP else DOWN.
```yaml
- name: Google Search
description: Search the world's information, including webpages, images, videos and more.
tag: "google-search"
cron: "*/15 * * * *"
api:
method: GET
url: https://www.google.com/webhp
```
## POST Monitor With Body
Below example will call https://www.google.com/webhp with body. If the status code is 200 then it will be UP else DOWN.
```yaml
- name: Google Search
description: Google Search
tag: "google-search-post"
api:
method: POST
url: https://www.google.com/webhp
headers:
Content-Type: application/json
body: '{"order_amount":22222.1,"order_currency":"INR"}'
```
## Secrets in Header
You can set ENV variables in your machine and use them in your monitors. Example below has `GH_TOKEN` as an environment variable. It uses process.env.GH_TOKEN.
```
export GH_TOKEN=some.token.for.github
```
> **_NOTE:_** DO NOT forget the `$` sign in your monitor secret, otherwise it will not be picked up.
```yaml
- name: Github Issues
description: Github Issues Fetch
tag: "gh-search-issue"
api:
method: GET
url: https://api.github.com/repos/rajnandan1/kener/issues
headers:
Authorization: Bearer $GH_TOKEN
```
## Secrets in Body
Assuming `ORDER_ID` is present in env
```yaml
- name: Github Issues
description: Github Issues Fetch
tag: "gh-search-issue"
api:
method: POST
url: https://api.github.com/repos/rajnandan1/kener/issues
headers:
Content-Type: application/json
body: '{"order_amount":22222.1,"order_currency":"INR", "order_id": "$ORDER_ID"}'
```
## Eval Body
Read more about [eval](https://kener.ing/docs/monitors#eval)
Below example will call https://api.github.com/repos/rajnandan1/kener/issues. If the status code is 200 then it will be UP else DOWN. It will also check if the response time is greater than 2000ms then it will be DEGRADED.
```yaml
- name: Github Issues
description: Github Issues Fetch
tag: "gh-search-issue"
api:
method: GET
url: https://api.github.com/repos/rajnandan1/kener/issues
eval: |
(function(statusCode, responseTime, responseDataBase64){
const resp = JSON.parse(atob(responseDataBase64));
let status = 'DOWN'
if(statusCode == 200) status = 'UP';
if(Object.keys(resp).length == 0) status = 'DOWN';
if(statusCode == 200 && responseTime > 2000) status = 'DEGRADED';
return {
status: status,
latency: responseTime,
}
})
```
## With default_status UP
Each minute it will set the status as UP
```yaml
- name: Earth
description: Our Planet
tag: "earth"
default_status: UP
```
## With Category
Add this monitor to the API category instead of the default home category
```yaml
- name: Earth
description: Our Planent
tag: "earth"
category: API
```
## Ping Monitor
This will ping the hosts. It will be up if the ping is successful for all the hosts present in the list of ip4 and ip6.
```yaml
- name: Earth
description: Our Planent
tag: "earth"
ping:
hostsV4:
- www.frogment.com
- 52.84.205.24
hostsV6:
- ipv6.google.com
```
If both ping and api monitors are present then API data will overwrite ping data
## Custom Thresholds
The below monitor will show DEGRADED if 3 or more degraded status in a day and DOWN if 2 or more down status in a day. It will also include degraded in downtime calculation.
```yaml
- name: Earth
description: Our blue planet
tag: "earth"
default_status: "UP"
day_degraded_minimum_count: 3
day_down_minimum_count: 2
include_degraded_in_downtime: true
```
## Monitor with Alerts
Make sure you have set up triggers in `server.yaml`. Read more about [alerts](/docs/alerting).
The below example will trigger an alert if the monitor is DOWN for 10 consecutive times. It will also create an incident in Github and send alerts to Webhook, Discord and Slack. It will also trigger an alert if the monitor is DEGRADED for 5 consecutive times. It will not create an incident in Github and send alerts to Webhook, Discord and Slack.
```yaml
- name: Earth
description: Our blue planet
tag: "earth"
default_status: "UP"
include_degraded_in_downtime: true
alerts:
DOWN:
failureThreshold: 10
successThreshold: 5
createIncident: true
description: "🚨 So much panic in the world and kener tells you about it"
triggers:
- Webhook MyWebhook
- Discord Test
- Slack Test
DEGRADED:
failureThreshold: 5
successThreshold: 2
createIncident: false
description: "⚠️ To degrade is human, to alert is kener"
triggers:
- Webhook MyWebhook
- Discord Test
- Slack Test
```
+257
View File
@@ -0,0 +1,257 @@
---
title: API Monitors | Kener
description: Learn how to set up and work with API monitors in kener.
---
# API Monitors
API monitors are used to monitor APIs. You can use API monitors to monitor the uptime of your Website or APIs and get notified when they are down.
<div class="border rounded-md">
![Monitors API](/documentation/m_api.png)
</div>
## Timeout
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The timeout is used to define the time in milliseconds after which the monitor should timeout. If the monitor does not respond within the timeout period, the monitor will be marked as down. For example, `5000` will set the timeout to 5 seconds. It is required and has to be a number greater than 0.
## URL
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The URL is used to define the URL of the API that you want to monitor. It is required and has to be a valid URL.
## Method
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The method is used to define the HTTP method that should be used to make the request. It is required and has to be one of the following: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`.
## Headers
The headers are used to define the headers that should be sent with the request. It is optional and has to be a valid JSON object.
## Eval
The eval is used to define the JavaScript code that should be used to evaluate the response. It is optional and has be a valid JavaScript code.
This is an anonymous JS function, it should return a **Promise**, that resolves or rejects to `{status, latency}`, by default it looks like this.
> **_NOTE:_** The eval function should always return a json object. The json object can have only status(UP/DOWN/DEGRADED) and latency(number)
> `{status:"DEGRADED", latency: 200}`.
```javascript
(async function (statusCode, responseTime, responseRaw, modules) {
let statusCodeShort = Math.floor(statusCode/100);
let status = 'DOWN'
if(statusCodeShort >=2 && statusCodeShort <= 3) {
status = 'UP',
}
return {
status: 'DOWN',
latency: responseTime,
}
})
```
- `statusCode` **REQUIRED** is a number. It is the HTTP status code
- `responseTime` **REQUIRED**is a number. It is the latency in milliseconds
- `responseRaw` **REQUIRED** is the raw response of the API
- `modules` is an object that has [`cheerio`](https://www.npmjs.com/package/cheerio) that you can use to parse HTML. `const $ = modules.cheerio.load(responseRaw)`
### Example 1
The following example shows how to use the eval function to evaluate the response. The function checks if the status code is 2XX then the status is UP, if the status code is 5XX then the status is DOWN. If the response contains the word `Unknown Error` then the status is DOWN. If the response time is greater than 2000 then the status is DEGRADED.
```javascript
(async function (statusCode, responseTime, responseRaw, modules) {
let status = "DOWN"
//if the status code is 2XX then the status is UP
if (/^[2]\d{2}$/.test(statusCode)) {
status = "UP"
if (responseTime > 2000) {
status = "DEGRADED"
}
}
//if the status code is 5XX then the status is DOWN
if (/^[5]\d{2}$/.test(statusCode)) status = "DOWN"
if (responseRaw.includes("Unknown Error")) {
status = "DOWN"
}
return {
status: status,
latency: responseTime
}
})
```
### Example 2
This next example shows how to call another API withing eval. It is scrapping the second last script tag from the response and checking if the heading is "No recent issues" then the status is UP else it is DOWN.
```js
(async function (statusCode, responseTime, responseRaw, modules) {
let htmlString = responseRaw;
const scriptTags = htmlString.match(/<script[^>]*src="([^"]+)"[^>]*>/g)
if (scriptTags && scriptTags.length >= 2) {
// Extract the second last script tag's src attribute
const secondLastScript = scriptTags[scriptTags.length - 2]
const srcMatch = secondLastScript.match(/src="([^"]+)"/)
const secondLastScriptSrc = srcMatch ? srcMatch[1] : null
let jsResp = await fetch(secondLastScriptSrc) //api call
let jsRespText = await jsResp.text()
//check if heading":"No recent issues" exists
let noRecentIssues = jsRespText.indexOf('heading":"No recent issues"')
if (noRecentIssues != -1) {
return {
status: "UP",
latency: responseTime
}
}
}
return {
status: "DOWN",
latency: responseTime
}
})
```
### Example 3
The next example shows how to use cheerio to parse bitbucket status page and check if all the components are operational. If all the components are operational then the status is UP else it is DOWN.
```js
(async function (statusCode, responseTime, responseDataBase64, modules) {
let html = atob(responseDataBase64)
const $ = modules.cheerio.load(html)
const components = $(".components-section .components-container .component-container")
let status = true
components.each((index, element) => {
const name = $(element).find(".component-name").text().trim()
const statusText = $(element).find(".component-status").text().trim()
if (statusText !== "Operational") {
status = false
}
})
return {
status: status ? "UP" : "DOWN",
latency: responseTime
}
})
```
## Examples
### Website Monitor
This is an example to monitor google every 5 minute.
<label for="websiteMonitor" class="accm">
<input type="checkbox" class="absolute opacity-0" id="websiteMonitor" />
<p class="font-medium p-1 accmt rounded-md showaccm">
<span>↓ Show Example</span>
<span>↑ Hide Example</span>
</p>
<div class="border rounded-md">
![Monitors API](/documentation/m_ex_website.png)
</div>
</label>
### Get Request
Example to monitor a GET Request with an Authorization header set to `$SOME_TOKEN`.
`$SOME_TOKEN` is set in environment variables as `SOME_TOKEN`
```bash
export SOME_TOKEN=some-token-example
```
<label for="exp2" class="accm">
<input type="checkbox" class="absolute opacity-0" id="exp2" />
<p class=" font-medium p-1 accmt rounded-md showaccm">
<span>↓ Show Example</span>
<span>↑ Hide Example</span>
</p>
<div class="border rounded-md p-1">
![Monitors API](/documentation/m_ex_2.png)
</div>
</label>
### POST Request
Example showing setting up a POST request every minute with a timeout of 2 seconds.
<label for="exp3" class="accm">
<input type="checkbox" class="absolute opacity-0" id="exp3" />
<p class=" font-medium p-1 accmt rounded-md showaccm">
<span>↓ Show Example</span>
<span>↑ Hide Example</span>
</p>
<div class="border rounded-md p-1">
![Monitors API](/documentation/m_ex_3.png)
</div>
</label>
### Custom Response Eval
Example showing how to use a custom response eval function. It also shows how to set secrets in body for POST Request.
The secrets have to be present in environment variables.
```bash
export SERVICE_TOKEN=secret1_tone
export SERVICE_SECRET=secret2_secret
```
<label for="exp4" class="accm">
<input type="checkbox" class="absolute opacity-0" id="exp4" />
<p class=" font-medium p-1 accmt rounded-md showaccm">
<span>↓ Show Example</span>
<span>↑ Hide Example</span>
</p>
<div class="border rounded-md p-1">
![Monitors API](/documentation/m_ex_4.png)
</div>
</label>
+59
View File
@@ -0,0 +1,59 @@
---
title: DNS Monitors | Kener
description: Learn how to set up and work with DNS monitors in kener.
---
# DNS Monitors
DNS monitors are used to monitor DNS servers. Verify DNS queries for your server and match values with the expected values to get notified when they are different.
<div class="border rounded-md">
![Monitors Ping](/documentation/m_dns.png)
</div>
## Host
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The host is used to define the host of the DNS server that you want to monitor. It is required and has to be a valid host.
## Lookup Record
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The query is used to define the query that you want to monitor. It is required and has to be a valid query. Example: `A`, `MX`, `TXT`, `CNAME`.
## Name Server
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The name server is the DNS server that you want to query. It is required and has to be a valid DNS server.
Few examples:
- 8.8.8.8 (Google)
- 1.1.1.1 (Cloudflare)
## Match Type
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
Match type for DNS response. Can be ANY or ALL. If ANY is selected, the monitor will be marked as UP if any of the expected values match the response. If ALL is selected, all the expected values should match the response.
## Expected Values
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The expected values are the values that you expect the DNS server to return. You can add multiple values. Atleast one is required.
+68
View File
@@ -0,0 +1,68 @@
---
title: Gamedig Monitors | Kener
description: Monitor games and services
---
# Gamedig Monitors
Gamedig monitors are used to monitor games and services. Currently, 320+ games and some services are available. You can view the entire list [here](https://github.com/gamedig/node-gamedig/blob/HEAD/GAMES_LIST.md). More than just the state of the game/service, it provides information about your game/service, such as players list, world name, connection method, and so on.
<div class="border rounded-md">
![Monitors Gamedig](/documentation/m_gamedig.png)
</div>
## Host
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The host is the domain name, IPv4 or IPv6 of the game/service you want to monitor. The host should be valid.
## Port
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The port is the query port of the game/service you want to monitor. Some games use a port, different from the one to connect, to accept queries, such as Minecraft with `query-port`.
If you do not know the query port, you can let the monitor guess the port by checking the option `Guess port`.
## Timeout
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The timeout is used to define the time in milliseconds after which the monitor should timeout. If the monitor does not respond within the timeout period, the monitor will be marked as down. For example, 10000 will set the timeout to 10 seconds. It is required and has to be a number greater than 2000 (or 2 seconds).
## Request additional rules
Valve games can provide additional 'rules' to Gamedig monitors. If checked, they will be available in `reponseRaw.raw` (see [Eval](#eval)), beware that it may increase query time.
## Eval
The eval is used to define the JavaScript code that should be used to evaluate the response. It is optional and has be a valid JavaScript code.
This is an anonymous JS function, it should return a **Promise**, that resolves or rejects to `{status, latency}`, by default it looks like this.
> **_NOTE:_** The eval function should always return a json object. The json object can have only status(UP/DOWN/DEGRADED) and latency(number)
> `{status: "DEGRADED", latency: 200}`.
```javascript
(async function (responseTime, responseRaw) {
return {
status: "UP",
latency: responseTime
}
})
```
- `responseTime` **REQUIRED** is a number. It is the latency in milliseconds
- `responseRaw` **REQUIRED** is the raw response of the game/service. It varies from game by game, we recommend first printing responseRaw with a simple `console.log`.
## Additional notes
Some games/services need more configuration on their part to accept correctly any query of the monitor. You can consult these notes [here](https://github.com/gamedig/node-gamedig/blob/HEAD/GAMES_LIST.md#games-with-additional-notes).
+40
View File
@@ -0,0 +1,40 @@
---
title: Group Monitors | Kener
description: Learn how to set up and work with Group monitors in kener.
---
# Group Monitors
Group monitors are used to monitor multiple monitors at once. You can use Group monitors to monitor multiple monitors at once and get notified when they are down.
<div class="border rounded-md">
![Monitors Group](/documentation/m_group.png)
</div>
## Timeout
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The timeout is used to define the time in milliseconds after which the group monitor should timeout.
Let us say the group monitor runs every minute, it will expect in the same minute all the other monitors to finish. It will wait till the timeout for them to complete. If not completed within that timeout, it will be marked as down.
## Monitors
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
You can add as many monitors as you want to monitor. The minimum number of monitors required is 2. The monitor can be any type of monitor.
## Hide
You can hide the monitors that are part of the group monitor. If you hide the monitors, the monitors inside the group will not be shown in the home page.
<div class="note">
The group status will be the worst status of the monitors in the group.
</div>
+112
View File
@@ -0,0 +1,112 @@
---
title: Heartbeat Monitors | Kener
description: Heartbeat monitors allow you to monitor systems using a "push" based approach
---
# Heartbeat Monitors
Heartbeat monitors allow you to monitor systems using a "push" based approach, where your services send signals (or "heartbeats") to Kener on a regular basis. If Kener doesn't receive a heartbeat within the configured time period, it will mark the system as degraded or down.
This is useful for monitoring services that:
- Run on a schedule
- Cannot be directly accessed for pull-based monitoring
- Need to report their own health status
## How It Works
1. You configure a heartbeat monitor in Kener
2. Kener provides a unique URL endpoint for your service to ping
3. Your service sends HTTP requests to this endpoint at regular intervals
4. If Kener doesn't receive a ping within the configured time window, it will mark the service as degraded or down
## Setting Up a Heartbeat Monitor
To create a heartbeat monitor:
1. Navigate to the Monitors page in the dashboard
2. Click "Add Monitor"
3. Select "Heartbeat" as the monitor type
4. Configure the following settings:
<div class="border rounded-md">
![Heartbeat Monitor Configuration](/documentation/m_hb.png)
</div>
### Configuration Options
| Option | Description |
| ------------------------ | -------------------------------------------------------------------------------------------- |
| Secret String | A unique secret that authenticates your heartbeat requests |
| Degraded After (Minutes) | Number of minutes after which the service is considered degraded if no heartbeat is received |
| Down After (Minutes) | Number of minutes after which the service is considered down if no heartbeat is received |
## Sending Heartbeats
Your service needs to send HTTP requests to the Kener heartbeat URL. Both GET and POST requests are supported.
### Endpoint Format
```
https://<your-kener-instance>/api/heartbeat/<tag>:<secretString>
```
Where:
- `<tag>` is the tag you configured for your monitor
- `<secretString>` is the secret you configured during setup
### Example
If your monitor has:
- Tag: `nightly-backup`
- Secret String: `super-secret-key`
Your service should send requests to:
```
https://<your-kener-instance>/api/heartbeat/nightly-backup:super-secret-key
```
You can use any HTTP client to send these requests, such as curl:
```bash
curl https://<your-kener-instance>/api/heartbeat/nightly-backup:super-secret-key
```
Or in a scheduled script:
```bash
#!/bin/bash
# Run your task here
./perform-backup.sh
# Send heartbeat to Kener
curl https://<your-kener-instance>/api/heartbeat/nightly-backup:super-secret-key
```
## Monitoring State
The monitor status works as follows:
- **UP**: Heartbeats are being received within the configured time windows
- **DEGRADED**: No heartbeat has been received for longer than the "Degraded After" time period
- **DOWN**: No heartbeat has been received for longer than the "Down After" time period
## Security Considerations
- Keep your secret string confidential, as anyone with knowledge of it can send heartbeats
- Consider using HTTPS for your Kener instance to encrypt heartbeat communications
- Rotate the secret string periodically by updating the monitor configuration
## Best Practices
- Set the "Degraded After" time slightly longer than your expected interval between heartbeats
- Set the "Down After" time based on your SLA requirements
- For critical systems, consider sending heartbeats more frequently than required
- Add logging in your service to track successful and failed heartbeat attempts
Heartbeat monitors provide a simple but effective way to ensure your scheduled tasks and services are running properly, without requiring external polling.
+131
View File
@@ -0,0 +1,131 @@
---
title: Ping Monitors | Kener
description: Learn how to set up and work with Ping monitors in kener.
---
# Ping Monitors
Ping monitors are used to monitor livenees of your servers. You can use Ping monitors to monitor the uptime of your servers and get notified when they are down.
<div class="border rounded-md">
![Monitors Ping](/documentation/m_ping.png)
</div>
## Hosts
You can add as many hosts as you want to monitor. The host can be an IP(IP4 and IP6) address or a domain name.
- Type: Choose the type of host you want to monitor. It can be either `IP4` or `IP6` or `DOMAIN`.
- Host: Enter the IP address or domain name of the host you want to monitor.
- Timeout: Enter the timeout in milliseconds for each ping request of each host. For IP6 timeout is not supported.
- Count: The number of pings you want to do for each host. The average latency of all the pings will be used to evaluate the response.
## Eval
The eval is used to define the JavaScript code that should be used to evaluate the response. It is optional and has be a valid JavaScript code.
This is an anonymous JS function, it should return a **Promise**, that resolves or rejects to `{status, latency}`, by default it looks like this.
> **_NOTE:_** The eval function should always return a json object. The json object can have only status(UP/DOWN/DEGRADED) and latency(number)
> `{status:"DEGRADED", latency: 200}`.
```javascript
(async function (arrayOfPings) {
let latencyTotal = arrayOfPings.reduce((acc, ping) => {
return acc + ping.latency
}, 0)
let alive = arrayOfPings.reduce((acc, ping) => {
return acc && ping.alive
}, true)
return {
status: alive ? "UP" : "DOWN",
latency: latencyTotal / arrayOfPings.length
}
})
```
- `arrayOfPings` **REQUIRED** is an array of Ping Response Objects as shown below.
```json
/*
[
{
alive: true,
min: '145.121',
max: '149.740',
avg: '147.430',
latencies: [ 145.121, 149.74 ],
latency: 145.121,
host: '45.91.169.49',
type: 'IP4'
},
{
alive: true,
min: '145.348',
max: '149.143',
avg: '147.245',
latencies: [ 145.348, 149.143 ],
latency: 145.348,
host: 'kener.ing',
type: 'DOMAIN'
},
{
alive: true,
min: '57.696',
max: '58.330',
avg: '58.013',
latencies: [ 57.696, 58.33 ],
latency: 57.696,
host: '2404:6800:4003:c1c::66',
type: 'IP6'
}
]
*/
```
### Understanding the Input
Each object in the array represents the ping response of a host.
- `alive` is a boolean. It is true if the host is alive and false if the host is down.
- `min` is a string. It is the minimum latency of the pings.
- `max` is a string. It is the maximum latency of the pings.
- `avg` is a string. It is the average latency of the pings.
- `latencies` is an array of numbers. It is the latency of each ping.
- `latency` is a number. It is the average latency of the pings.
- `host` is a string. It is the host that was pinged.
- `type` is a string. It is the type of the host. It can be either `IP4` or `IP6` or `DOMAIN`.
### Example
The following example shows how to use the eval function to evaluate the response. The function checks if the combined latency is more 10ms then returns `DEGRADED`.
```javascript
(async function (arrayOfPings) {
let latencyTotal = arrayOfPings.reduce((acc, ping) => {
return acc + ping.latency
}, 0)
let areAllOpen = arrayOfPings.reduce((acc, ping) => {
return acc && ping.alive
}, true)
let avgLatency = latencyTotal / arrayOfPings.length
if (areAllOpen && avgLatency > 10) {
return {
status: "DEGRADED",
latency: avgLatency
}
}
return {
status: areAllOpen ? "UP" : "DOWN",
latency: avgLatency
}
})
```
+63
View File
@@ -0,0 +1,63 @@
---
title: SQL Monitors | Kener
description: Monitor a SQL database
---
# SQL Monitors
SQL monitors are used to monitor a SQL database. You can monitor a SQL database by adding the database connection details to the monitor. The SQL monitor will check the database connection and notify you if the database connection is down.
<div class="border rounded-md">
![Monitors SQL](/documentation/m_sql.png)
</div>
## Database Type
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The database type is the type of the database you want to monitor. The database type should be one of the following values:
- mysql
- postgres
Instead of giving the connection string as plain text you can add environment variables to the connection string. The environment variables should be in the format of `$`. The environment variables should be defined in the `.env` file.
Example: `mysql://$MYSQL_USER:$MYSQL_PASSWORD@$MYSQL_HOST:$MYSQL_PORT/$MYSQL_DATABASE`
Make sure to define the environment variables in the `.env` file as shown below
```env
MYSQL_USER=root
MYSQL_PASSWORD=password
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_DATABASE=database
```
## Timeout
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The timeout is the time in milliseconds to wait for the database connection to respond.
## Connection String
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The connection string is the connection string of the database you want to monitor. The connection string should be a valid connection string for the database type you have selected.
## SQL Query
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The SQL query is the query you want to run on the database. The SQL query should be a valid SQL query for the database type you have selected.
+52
View File
@@ -0,0 +1,52 @@
---
title: SSL Monitors | Kener
description: Monitor the SSL certificate of a domain
---
# SSL Monitors
SSL monitors are used to monitor the SSL certificate of a domain. You can monitor the SSL certificate of a domain by adding the domain name to the monitor. The SSL monitor will check the SSL certificate of the domain and notify you if the SSL certificate is about to expire.
<div class="border rounded-md">
![Monitors SSL](/documentation/m_ssl.png)
</div>
## Host
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The host is the domain name of the website you want to monitor. The host should be a valid domain name.
## Port
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The port is the ssl port of the website you want to monitor. The default ssl port is 443.
## Degraded If
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
Set this to the number of hours that still remains for the certificate to expire. If the certificate is about to expire in the given number of hours, the monitor status will be set to degraded. Example if you send the value to be 24, the monitor status will be set to degraded if the certificate is about to expire in 24 hours.
## Down If
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
Set this to the number of hours that still remains for the certificate to expire. If the certificate is about to expire in the given number of hours, the monitor status will be set to down. Example if you send the value to be 12, the monitor status will be set to down if the certificate is about to expire in 12 hours.
<div class="note">
`Degraded If` should be more than `Down If`.
</div>
+130
View File
@@ -0,0 +1,130 @@
---
title: TCP Monitors | Kener
description: Learn how to set up and work with TCP monitors in kener.
---
# TCP Monitors
TCP monitors are used to monitor the liveness of your servers. You can use TCP monitors to monitor the uptime of your servers and get notified when they are down.
<div class="border rounded-md">
![Monitors TCP](/documentation/m_tcp.png)
</div>
## Hosts
You can add as many hosts as you want to monitor. The host can be an IP(IP4 and IP6) address or a domain name.
- Type: Choose the type of host you want to monitor. It can be either `IP4` or `IP6` or `DOMAIN`.
- Host: Enter the IP address or domain name of the host you want to monitor.
- Port: Enter the port number of the host you want to monitor.
- Timeout: Enter the timeout in milliseconds for each ping request of each host
## Eval
The eval is used to define the JavaScript code that should be used to evaluate the response. It is optional and has be a valid JavaScript code.
This is an anonymous JS function, it should return a **Promise**, that resolves or rejects to `{status, latency}`, by default it looks like this.
> **_NOTE:_** The eval function should always return a json object. The json object can have only status(UP/DOWN/DEGRADED) and latency(number)
> `{status:"DEGRADED", latency: 200}`.
```javascript
(async function (arrayOfPings) {
let latencyTotal = arrayOfPings.reduce((acc, ping) => {
return acc + ping.latency
}, 0)
let alive = arrayOfPings.reduce((acc, ping) => {
if (ping.status === "open") {
return acc && true
} else {
return false
}
}, true)
return {
status: alive ? "UP" : "DOWN",
latency: latencyTotal / arrayOfPings.length
}
})
```
- `arrayOfPings` **REQUIRED** is an array of TCP Response Objects as shown below.
```json
/*
[
{
status: 'open',
latency: 31.93,
host: '66.51.120.219',
port: 465,
type: 'IP4'
},
{
status: 'open',
latency: 47.041417,
host: '2404:6800:4003:c1c::66',
port: 80,
type: 'IP6'
},
{
status: 'open',
latency: 82.1865,
host: 'rajnandan.com',
port: 80,
type: 'DOMAIN'
}
]
*/
```
### Understanding the Input
Each object in the array represents the tcp response of a host.
- `host`: The host that was pinged.
- `port`: The port that was pinged. Defaults to 80 if not provided.
- `type`: The type of IP address. Can be `IP4` or `IP6`.
- `status`: The status of the ping. Can be `open` , `error` or `timeout`.
- `open`: The host is reachable.
- `error`: There was an error while pinging the host.
- `timeout`: The host did not respond in time.
- `latency`: The time taken to ping the host. This is in milliseconds.
### Example
The following example shows how to use the eval function to evaluate the response. The function checks if the combined latency is more 10ms then returns `DEGRADED`.
```javascript
(async function (arrayOfPings) {
let latencyTotal = arrayOfPings.reduce((acc, ping) => {
return acc + ping.latency
}, 0)
let areAllOpen = arrayOfPings.reduce((acc, ping) => {
if (ping.status === "open") {
return acc && true
} else {
return false
}
}, true)
let avgLatency = latencyTotal / arrayOfPings.length
if (areAllOpen && avgLatency > 10) {
return {
status: "DEGRADED",
latency: avgLatency
}
}
return {
status: areAllOpen ? "UP" : "DOWN",
latency: avgLatency
}
})
```
+155
View File
@@ -0,0 +1,155 @@
---
title: Monitors | Kener
description: Monitors are the heart of Kener. This is where you define the monitors you want to show on your site.
---
# Monitors
Monitors are the heart of Kener. This is where you define the monitors you want to show on your site.
## Add Monitors
Click on the to add a monitor.
<div class="border rounded-md">
![Monitors Main](/documentation/m_main.png)
</div>
## Tag
<span class="text-red-500 text-xs font-semibold">
UNIQUE
</span>
&
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The tag is unique to each monitor and is used to identify the monitor in the code. It is also used to generate the URL for the monitor.
## Name
<span class="text-red-500 text-xs font-semibold">
UNIQUE
</span>
&
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
Name is also unique to each monitor and is used to identify the monitor in the admin panel or in the status page.
## Image
The image is used to display a logo or an image for the monitor. It is displayed on the status page and in the admin panel. It is optional.
## Description
The description is used to describe the monitor. It is displayed on the status page and in the admin panel. It is optional. You can also write html in the description and can use tailwind classes.
## Cron
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The cron is used to define the interval at which the monitor should run. It is a cron expression. For example, `* * * * *` will run the monitor every minute.
## Default Status
Using default status you can set a predefined status for the monitor. The predefined status can be `UP`, `DOWN`, or `DEGRADED`. If the monitor does not have api/dns/ping or if the monitor status is not updated using webbhook, manual incident this will the status of the monitor.
## Category Name
The category name is used to group monitors. It is displayed on the status page and in the admin panel. It is optional. By a home category is already present. Adding monitor to the home category will show the monitor on the home page.
## Day Degraded Min Count
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The day degraded minimum count is used to define the minimum number of degraded incidents in a day to mark the monitor as degraded for the day. A degraded day means if you are using Monitor Style as FULL under Theme, the whole bar will be shown as Degraded (yellow color) . It is optional. It has to be more than equal to 1
## Day Down Min Count
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The day down minimum count is used to define the minimum number of down incidents in a day to mark the monitor as down for the day. A down day means if you are using Monitor Style as FULL under Theme, the whole bar will be shown as Down (red color) . It is optional. It has to be more than equal to 1
## Include Degraded
The include degraded is used to include the degraded checks in the total bad checks count. It is optional. By default uptime percentage is calculated as (UP+DEGRADED/UP+DEGRADED+DOWN). Setting it as `YES` will change the calculation to (UP/UP+DEGRADED+DOWN)
## Monitor Type
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
### API
To monitor an API, you need to provide the URL of the API and the expected status code. If the status code is not received, the monitor will be marked as down. You can read more about API monitoring [here](/docs/monitors-api).
### DNS
To monitor the DNS records, you need to provide the domain name and the record type. If the record is not found, the monitor will be marked as down. You can read more about DNS monitoring [here](/docs/monitors-dns).
### PING
To monitor the ping, you need to provide the IP address or the domain name. If the ping is not successful, the monitor will be marked as down. You can read more about PING monitoring [here](/docs/monitors-ping).
### GAMEDIG
To monitor game/service, you need to provide the game or service to monitor, the IP address or the domain name and the port. If the query is not successful, the monitor will be marked as down. You can read more about GAMEDIG monitoring [here](/docs/monitors-gamedig).
---
## Triggers
To add a trigger to a monitor make sure you have created a trigger. You can read more about triggers [here](/docs/triggers).
- Click on the 🔔 icon on the top right corner of the monitor.
- Add details for either DOWN or DEGRADED.
- Failure Threshold(Required): The number of consecutive failures before the trigger is activated.
- Success Threshold(Required): The number of consecutive successes before the trigger is deactivated.
- Create Incident: Chose whether to create an incident or not when the trigger is activated. The incident will be created in Github. So make sure you have set up the Github token in the environment variables. The incident will be closed when the monitor is back to UP.
- Severity (Required): The severity of the incident. It can be `Critcal` or `Warning`.
- Custom Message (Required): Add your owner alert message.
- Choose Triggers: Choose the triggers you want to activate the trigger. You can choose multiple triggers.
- It will take upto 1 minute for the trigger to be activated.
---
## Edit Monitors
Click on the ⚙️ to edit the monitor.
### Deactivate Monitor
You can deactivate the monitor by switching the toggle to off. Deactivation a monitor will stop the monitor from running. It will take one minute to deactivate.
### Activate Monitor
You can activate the monitor by switching the toggle to on. Activation a monitor will start the monitor. It will take one minute to activate.
<div class="note info">
Any changes in the a live monitor will take 2 minutes to reflect.
</div>
## Supported Monitors
- [API Monitors](/docs/monitors-api)
- [DNS Monitors](/docs/monitors-dns)
- [PING Monitors](/docs/monitors-ping)
- [TCP Monitors](/docs/monitors-tcp)
- [SQL Monitors](/docs/monitors-sql)
- [SSL Monitors](/docs/monitors-ssl)
- [HEARTBEAT Monitors](/docs/monitors-heartbeat)
- [GROUP Monitors](/docs/monitors-group)
+82
View File
@@ -0,0 +1,82 @@
---
title: Get started | Kener
description: Get started with Kener
---
# Get Started
Here is a demonstration of how to get started with Kener in seconds
## Requirements
- Node.js Minimum version required is `v18`.
- Git
- sqlite3
## Clone the repository
```bash
git clone https://github.com/rajnandan1/kener.git
cd kener
```
## Install Dependencies
```bash
npm install
```
## Set up Environment Variables
Kener needs some environment variables to be set to run properly. [Here](/docs/environment-vars) are the list of environment variables that you need to set.
```bash
cp .env.example .env
```
## Start Kener
```bash
npm run dev
```
Kener Development Server would be running at PORT 3000. Go to [http://localhost:3000](http://localhost:3000) to see the Kener in action.
<div class="note info">
Status page will be at [http://localhost:3000](http://localhost:3000)
Status Page Manage Portal will be at [http://localhost:3000/manage/app/site](http://localhost:3000/manage/app/site)
</div>
## Create a new User
If this is the first time your are launching kener then you would be redirected to the [set up page](/manage/setup). Fill in the details and click on `Let's Go` button.
- **Name**: Your Name
- **Email**: Your Email
- **Password**: Your Password
Please note that the email should be a valid email address and password should be atleast 8 characters long with uppercase lowercase and numbers.
## Login
Once you have created the user, you can login with the credentials you have provided by going to the [login page](/manage/signin)
## Video Tutorial
You can watch the video tutorial on how to get started with Kener
[![Kener Video Tutorial](https://img.youtube.com/vi/4L9PnWPqMPw/0.jpg)](https://www.youtube.com/watch?v=4L9PnWPqMPw)
## Next Steps
Learn how to configure kener by going through one of the topics
- [Monitors](/docs/monitors): Learn how to set up and work with monitors in kener.
- [Triggers](/docs/triggers): Learn how to set up and work with triggers in kener.
- [Environment Variables](/docs/environment-vars): Learn how to set up and work with environment variables in kener.
- [API](/docs/kener-apis): Learn how to use the API in kener.
- [Databases](/docs/database): Learn how to set up and work with databases in kener.
- [Theme](/docs/theme): Learn how to set up and work with theme in kener.
+134
View File
@@ -0,0 +1,134 @@
---
title: Kener Role Based Access Control (RBAC)
description: Role-Based Access Control (RBAC) in Kener
---
# Role-Based Access Control (RBAC) in Kener
Kener includes a comprehensive role-based access control system that allows you to manage user permissions and access to various features. This document explains the available roles, their permissions, and how to manage users effectively.
## Available Roles
Kener offers three different roles with varying levels of permissions:
| Role | Description |
| ------ | ------------------------------------------------------------------------------ |
| Admin | Full access to all features including user management and system configuration |
| Editor | Can create and edit monitors, triggers, incidents, and other operational data |
| Member | Read-only access with limited interaction capabilities |
## Role Permissions
### Admin
Admins have unrestricted access to the entire system:
- **User Management**:
- Create, update, and deactivate users
- Change user roles
- Reset passwords for other users
- Send verification emails
- **System Configuration**:
- Configure all site settings
- Manage API keys
- Set up triggers and integrations
- **Operational Access**:
- Full access to create and manage monitors
- Create and update incidents
- Run tests on monitors and triggers
- Configure all notification channels
### Editor
Editors can manage most operational aspects but cannot administer users:
- **Content Management**:
- Create and edit monitors
- Configure monitor settings
- Create and manage triggers
- Create and update incidents
- Add incident updates and comments
- **Limited Access**:
- Cannot manage users
- Cannot change role assignments
- Cannot access certain system-level configurations
### Member
Members have read-only access with minimal interaction capabilities:
- **View Access**:
- View all monitors and their status
- View incidents and their history
- See system configuration (but cannot modify)
- **Limited Interactions**:
- Can test existing triggers but cannot create or edit them
- Cannot create or update incidents
- Cannot modify any system configuration
## Managing Users
### Adding New Users
Only Admins and Editors can add new users to the system:
1. Navigate to the **Users** page in the management dashboard
2. Click the **Add New User** button
3. Fill in the required information:
- Name
- Email
- Password
- Role (Member or Editor)
4. Click **Add User** to create the account
When a new user is added, a verification email can be sent to confirm their email address if email sending is configured.
### User Settings
Admins can manage user accounts through the user settings page:
- **Email Verification**: Send verification emails to users
- **Password Reset**: Reset a user's password
- **Role Management**: Change a user's role between Member and Editor
- **Account Status**: Activate or deactivate user accounts
### Best Practices
1. **Follow the Principle of Least Privilege**:
- Assign the minimum necessary permissions for users to perform their job
- Start users with the Member role and elevate as needed
2. **Regular Access Reviews**:
- Periodically review user access and roles
- Remove access for users who no longer need it
3. **Admin Accounts**:
- Limit the number of Admin accounts
- Use strong passwords for Admin accounts
- Consider using email verification for all users
## Role Limitations
- The Admin role can only be assigned during initial setup
- Members cannot create or modify content
- Users cannot modify their own role (only an Admin can change roles)
## Email Verification
When email sending is configured, users can verify their email addresses:
1. Admins can send verification emails from the user management interface
2. Users receive an email with a verification link
3. After clicking the link, the user's email is marked as verified
Email verification improves security and ensures that users have provided valid email addresses for notifications.
+43
View File
@@ -0,0 +1,43 @@
---
title: Roadmap | Kener
description: Roadmap for Kener
---
# Roadmap
<picture>
<source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/1f331/512.webp" type="image/webp">
<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f331/512.gif" alt="🌱" width="32" height="32">
</picture>
~~Move from file system to sqlite3~~
~~Add support for webhooks~~
~~Support DNS probe~~
~~Color Customization~~
~~Support for github enterprise~~
☐ Add Rate limiting to APIs
☐ Add support for custom themes
~~Handle uploaded images for docker containers~~
~~Introduce sitemap.xml~~
~~Migrate from moment to date-fns for status page~~ (moment remains in dashboard. Will remove later)
~~Create Admin UI~~ Released in (3.0.0)
~~Webhook customization~~
☐ Monitor Update Screen
☐ i18n for admin dashboard
---
Request a feature or start a discussion [here](https://github.com/rajnandan1/kener/discussions/new/choose)
+48
View File
@@ -0,0 +1,48 @@
---
title: SEO Setup | Kener
description: Learn how to set up and work with SEO in kener.
---
# SEO
SEO is important for your status page to be found on the internet. Kener provides you with the ability to set up SEO for your status page.
## Analytics
You can add Google Analytics, Amplitude, Mixpanel. Basic events and page tracking are supported.
### Google Analytics
ADD ID. It is the measurement ID that you get from Google Analytics. You can find it in the admin section of your Google Analytics account.
### Amplitude
Add API key of your Amplitude account
### Mixpanel
Add project token of your Mixpanel account.
### Plausible
- Add domain of your Plausible account. Example: `example.com`
- Add API key of your Plausible account. Default is `https://plausible.io/api/event`
- Add Script Source of your Plausible account. Default is `https://plausible.io/js/script.pageview-props.tagged-events.js`
### Microsoft Clarity
Add Project ID of your Microsoft Clarity account.
## Search Engine Optimization
You can add meta tags for SEO. You can add any `meta` that you want to add to the head of the page. Example: `og:image`, `og:title`, `og:description`, `twitter:image`, `twitter:title`, `twitter:description`.
Once added it will become
```html
<meta property="og:image" content="https://example.com/image.png" />
```
## Sitemap
Kener auto generates a sitemap for your status page. You can view it at `/sitemap.xml`
+22
View File
@@ -0,0 +1,22 @@
# Kener Showcase
This page is a showcase of how kener is getting used in the wild. If you want to add your site here, please raise a PR and modify this [file](https://github.com/rajnandan1/kener-docs/blob/main/docs/md/docs/showcase.md)
#### [Kener](https://kener.ing)
#### [Cashfree Payments India](https://statuspage.cashfree.com/)
#### [status.orhun.dev](https://status.orhun.dev/)
#### [status.ordinalsbot.com](https://status.ordinalsbot.com/)
#### [status.britsov.com](https://status.britsov.net/)
#### [status.gosu.bar](https://status.gosu.bar/)
#### [stat.imsun.org](https://stat.imsun.org/)
#### [Goomer](https://status.goomer.com.br/)
#### [kennek.io](https://status.kennek.io/)
#### [evelan.io](https://status.evelan.io/)
#### [evelan.io](https://status.evelan.io/)
#### [sveir.xyz](https://status.sveir.xyz/)
#### [cellcast.com](https://status.cellcast.com/)
#### [flytbase.com](https://status.flytbase.com/)
#### [scriptor-artis.fr](https://status.scriptor-artis.fr/)
#### [jiance.f.ozizio.com](http://jiance.f.ozizio.com/)
#### [sshaw.cn](https://s.sshaw.cn/)
#### [donotes.app](https://status.donotes.app)
+54
View File
@@ -0,0 +1,54 @@
---
title: Site Analytics | Kener
description: Add Google Analytics, Amplitude, Mixpanel etc to your Kener site
---
# Site Analytics
You can add Google Analytics, Amplitude, Mixpanel etc to your Kener site. In order to do this, you need to add the following configuration to your `site.yaml` file.
```yaml
analytics:
- id: "G-QsFT"
type: "GA"
- id: "deasf0d350"
type: "AMPLITUDE"
- id: "FKOdsKener"
type: "MIXPANEL"
```
## Google Analytics
To add Google Analytics to your site, you need to add the following configuration to your `site.yaml` file.
```yaml
analytics:
- id: "G-QsFT"
type: "GA"
```
`id` is the tracking ID of your Google Analytics account. You can find this in your Google Analytics account.
## Amplitude
To add Amplitude to your site, you need to add the following configuration to your `site.yaml` file.
```yaml
analytics:
- id: "deasf0d350"
type: "AMPLITUDE"
```
`id` is the API key of your Amplitude account. You can find this in your Amplitude account.
## Mixpanel
To add Mixpanel to your site, you need to add the following configuration to your `site.yaml` file.
```yaml
analytics:
- id: "FKOdsKener"
type: "MIXPANEL"
```
`id` is the token of your Mixpanel account. You can find this in your Mixpanel account.
+52
View File
@@ -0,0 +1,52 @@
---
title: Site Info Setup | Kener
description: Learn how to set up and work with site info in kener.
---
# Site
Site info is used to define the site information that will be shown on the status page.
## Site Title
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The site title is used to define the title of the site. It is required and has to be a string. It what will be shown on the browser tab. This will become
Example: `Kener - Open-Source and Modern looking Node.js Status Page for Effortless Incident Management`
```html
<title>
Kener - Open-Source and Modern looking Node.js Status Page for Effortless Incident Management
</title>
```
![Site Title](/documentation/ms_1.png)
## Site Name
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
This will be shown as a brand name on the status page on the nav bar top left.
![Site Name](/documentation/s_2.png)
## Home Location
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
Link to redirect to when Site Name or logo is clicked. Can be your main website. or it can be `/` to be current page. If you are using a base path it should be `/base-path` to keep the the user on the same page.
## Logo
Same as Site Name, it is placed left of Site Name as shown in image above
## Favicon
Favicon to be shown in browser tab.
+206
View File
@@ -0,0 +1,206 @@
---
title: Status Badges | Kener
description: Status badges for your monitors
---
# Status Badges
There are three types of badges
Syntax
```md
http://[hostname]/badge/[tag]/status
http://[hostname]/badge/[tag]/dot
http://[hostname]/badge/[tag]/uptime
```
---
## Status
Shows the last health check was UP/DOWN/DEGRADED
![Earth Status](https://kener.ing/badge/earth/status)
Example in HTML
```html
<img src="https://kener.ing/badge/earth/status" />
```
Example in MarkDown
```md
![Status Badge](https://kener.ing/badge/[monitor.tag]/status)
```
### Custom Label
You can set custom label for the status badge. If you do not set a label it will default to the monitor name.
![Earth Status](https://kener.ing/badge/earth/status?label=Gotcha)
```md
![Earth Status](https://kener.ing/badge/earth/status?label=Gotcha)
```
---
## Live
Shows the last health check was UP/DOWN/DEGRADED as SVG dot
```bash
http://[hostname]/badge/[tag]/dot
#or
http://[hostname]/badge/[tag]/dot?animate=ping
```
### Standard
![Earth Status](/badge/earth/dot)
```html
<img src="https://kener.ing/badge/earth/dot" />
```
### Animated
![Earth Status](/badge/earth/dot?animate=ping)
```html
<img src="https://kener.ing/badge/earth/dot?animate=ping" />
```
---
## Uptime
Shows the 90 Day uptime by default. You can `sinceLast` as query param to get uptime since last x seconds.
![Earth Uptime](https://kener.ing/badge/earth/uptime)
### 90 Day Uptime
Example in HTML
```html
<img src="https://kener.ing/badge/earth/uptime" />
```
Example in MarkDown
```md
![Uptime Badge](https://kener.ing/badge/[monitor.tag]/uptime)
```
### 15 Minute Uptime
Set `sinceLast` as query param to get uptime since last x seconds.
Example in HTML
```html
<img src="https://kener.ing/badge/earth/uptime?sinceLast=900" />
```
Example in MarkDown
```md
![Uptime Badge](https://kener.ing/badge/[monitor.tag]/uptime?sinceLast=900)
```
### Custom Label
You can set custom label for the uptime badge. If you do not set a label it will default to the **monitor name**.
![Earth Uptime](https://kener.ing/badge/earth/uptime?label=Gotcha)
```md
![Earth Uptime](https://kener.ing/badge/earth/uptime?label=Gotcha)
```
### Hide Duration
You can hide the duration by setting `hideDuration=true`
![Earth Uptime](https://kener.ing/badge/earth/uptime?hideDuration=true)
```md
![Earth Uptime](https://kener.ing/badge/earth/uptime?hideDuration=true)
```
---
## Customize Badges
You can set different colors for badges and style. It only works for `status` and `uptime` badges.
### With Custom Label Color
![Earth Status](https://kener.ing/badge/earth/status?labelColor=F2BED1)
```md
![Earth Status](https://kener.ing/badge/earth/status?labelColor=F2BED1)
```
### With Custom Value Color
![Earth Status](https://kener.ing/badge/earth/status?color=FFC0D9)
```md
![Earth Status](https://kener.ing/badge/earth/status?color=FFC0D9)
```
### With Both Different Colors
![Earth Status](https://kener.ing/badge/earth/uptime?color=D0BFFF&labelColor=FFF3DA)
```md
![Earth Status](https://kener.ing/badge/earth/uptime?color=D0BFFF&labelColor=FFF3DA)
```
### Style Of the Badge
You can change the style of the badge. Supported Styles are `plastic`, `flat`, `flat-square`, `for-the-badge` or `social`. Default is `flat`
#### plastic
![Earth Uptime](https://kener.ing/badge/earth/uptime?style=plastic)
```md
![Earth Uptime](https://kener.ing/badge/earth/uptime?style=plastic)
```
#### flat
![Earth Uptime](https://kener.ing/badge/earth/uptime?style=flat)
```md
![Earth Uptime](https://kener.ing/badge/earth/uptime?style=flat)
```
#### flat-square
![Earth Uptime](https://kener.ing/badge/earth/uptime?style=flat-square)
```md
![Earth Uptime](https://kener.ing/badge/earth/uptime?style=flat-square)
```
#### for-the-badge
![Earth Uptime](https://kener.ing/badge/earth/uptime?style=for-the-badge)
```md
![Earth Uptime](https://kener.ing/badge/earth/uptime?style=for-the-badge)
```
#### social
![Earth Uptime](https://kener.ing/badge/earth/uptime?style=social)
```md
![Earth Uptime](https://kener.ing/badge/earth/uptime?style=social)
```
+197
View File
@@ -0,0 +1,197 @@
{
"sidebar": [
{
"sectionTitle": "Getting Started",
"children": [
{
"title": "Introduction",
"link": "/docs/home",
"file": "/home.md"
},
{
"title": "Get Started",
"link": "/docs/quick-start",
"file": "/quick-start.md"
},
{
"title": "Concepts",
"link": "/docs/concepts",
"file": "/concepts.md"
},
{
"title": "Deployment",
"link": "/docs/deployment",
"file": "/deployment.md"
},
{
"title": "Databases",
"link": "/docs/database",
"file": "/database.md"
},
{
"title": "Access Control",
"link": "/docs/rbac",
"file": "/rbac.md"
}
]
},
{
"sectionTitle": "Guides",
"children": [
{
"title": "Setup Environment",
"link": "/docs/environment-vars",
"file": "/environment-vars.md"
},
{
"title": "Use Badges",
"link": "/docs/status-badges",
"file": "/status-badges.md"
},
{
"title": "Setup Monitors",
"link": "/docs/monitors",
"file": "/monitors.md"
},
{
"title": "Setup Triggers",
"link": "/docs/triggers",
"file": "/triggers.md"
},
{
"title": "Setup Site",
"link": "/docs/site",
"file": "/site.md"
},
{
"title": "Setup SEO",
"link": "/docs/seo",
"file": "/seo.md"
},
{
"title": "Setup Home",
"link": "/docs/home-page",
"file": "/home-page.md"
},
{
"title": "Setup Theme",
"link": "/docs/theme",
"file": "/theme.md"
},
{
"title": "View Alerts",
"link": "/docs/alerts",
"file": "/alerts.md"
},
{
"title": "API Keys",
"link": "/docs/apikeys",
"file": "/apikeys.md"
},
{
"title": "Incident Management",
"link": "/docs/incident-management",
"file": "/incident-management.md"
},
{
"title": "Embed",
"link": "/docs/embed",
"file": "/embed.md"
},
{
"title": "Custom JS/CSS",
"link": "/docs/custom-js-css-guide",
"file": "/custom-js-css-guide.md"
},
{
"title": "Internationalization",
"link": "/docs/i18n",
"file": "/i18n.md"
}
]
},
{
"sectionTitle": "Monitors",
"children": [
{
"title": "API/Website Monitor",
"link": "/docs/monitors-api",
"file": "/monitors-api.md"
},
{
"title": "Ping Monitor",
"link": "/docs/monitors-ping",
"file": "/monitors-ping.md"
},
{
"title": "TCP Monitor",
"link": "/docs/monitors-tcp",
"file": "/monitors-tcp.md"
},
{
"title": "DNS Monitor",
"link": "/docs/monitors-dns",
"file": "/monitors-dns.md"
},
{
"title": "Group Monitor",
"link": "/docs/monitors-group",
"file": "/monitors-group.md"
},
{
"title": "SSL Monitor",
"link": "/docs/monitors-ssl",
"file": "/monitors-ssl.md"
},
{
"title": "SQL Monitor",
"link": "/docs/monitors-sql",
"file": "/monitors-sql.md"
},
{
"title": "Heartbeat Monitor",
"link": "/docs/monitors-heartbeat",
"file": "/monitors-heartbeat.md"
},
{
"title": "Gamedig Monitor",
"link": "/docs/monitors-gamedig",
"file": "/monitors-gamedig.md"
}
]
},
{
"sectionTitle": "API Reference",
"children": [
{
"title": "Kener APIs",
"link": "/docs/kener-apis",
"file": "/kener-apis.md"
}
]
},
{
"sectionTitle": "Help",
"children": [
{
"title": "Fonts",
"link": "/docs/custom-fonts",
"file": "/custom-fonts.md"
},
{
"title": "Changelogs",
"link": "/docs/changelogs",
"file": "/changelogs.md"
},
{
"title": "Roadmap",
"link": "/docs/roadmap",
"file": "/roadmap.md"
}
]
}
]
}
+106
View File
@@ -0,0 +1,106 @@
---
title: Theme Customization | Kener
description: Learn how to customize the theme of your status page in kener.
---
# Theme Customization
Kener provides you with the ability to customize the theme of your status page. You can change the colors, fonts, and other styles of the status page.
---
## Home Page Pattern
Kener can show a subtle pattern in all your pages. It is either square or dots. Right now you cannot modify the color of the pattern. However, you can disable it by choosing none
---
## Default Theme
Kener comes with both dark and light theme. You can set a default theme that will be used every time the user visits.
Setting it to light or dark will make the theme light or dark respectively. Setting it to none will make the theme change based on the user's system preference. Setting it to system will make the theme change based on the user's system preference.
If you want to force a theme to be light or dark you can set it to light or dark and uncheck `Let Users toggle theme between light and dark`
---
## Monitor Style
You can change how the bars and summary of a monitor looks like.
### Status Bar
#### Partial
The status bar will be a gradient from green to red/yellow based on the status of the monitor.
![Trigger API](/documentation/x1.png)
#### Full
The status bar will be a solid color based on the status of the monitor.
![Trigger API](/documentation/x2.png)
---
### Roundness
Adjust the roundness of the status bar.
#### SHARP
![Trigger API](/documentation/x4.png)
#### ROUNDED
![Trigger API](/documentation/x3.png)
---
### Summary Type
Control how the summary of the monitor looks like.
#### Current
Shows the current live value of the monitor. Example: If it is DOWN currently it will say `DOWN for x minutes`, if it is UP it will say `Status Ok`
#### DAY
Shows the day's impact. Example: If it was down at 10:00 AM and it is 11:00 AM, it will say `DOWN for 1 hour`. If there was no DOWN or DEGRADED state it will say `Status Ok`
---
## Colors
You can change the colors of UP/DEGRADED/DOWN/MAINTENANCE states of the monitor. By default, it shows a shade of green, yellow, red and blue respectively.
---
## Font
You can change the font of the status page. You can choose from a list of google, or [bunny fonts](https://fonts.bunny.net/) (which is a fully GDPR-compliant, zero-tracking/no-logging CDN font service).
### Font URL
Add font url
### Font Family
Add font family name
### Custom CSS
You can add custom CSS to your status page. This will be added to the head of the page. You can add custom CSS to your status page. This will be added to the head of the page.
```css
.my-class {
color: red;
}
```
<div class="note danger">
Do not include &#x3C;style&#x3E; tags.
</div>
+471
View File
@@ -0,0 +1,471 @@
---
title: Triggers | Kener
description: Learn how to set up and work with triggers in kener.
---
## Triggers
Triggers are used to trigger actions based on the status of your monitors. You can use triggers to send notifications, or call webhooks when a monitor goes down or up.
<div class="border rounded-md">
![Trigger API](/documentation/trig_1.png)
</div>
### Name
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The name is used to define the name of the webhook. It is required and has to be a string.
### Description
The description is used to define the description of the webhook. It is optional and has to be a string.
Kener supports the following triggers:
- [Webhook](#webhook)
- [Discord](#discord)
- [Slack](#slack)
- [Email](#email)
### Trigger Variables
You can use the following variables in the triggers using mustache syntax.
| Key | Description | Mustache Variable |
| ------------- | ------------------------------------------------------------ | ----------------- |
| site_name | [string] Name of your site | {{site_name}} |
| logo_url | [string] Logo of your site | {{logo_url}} |
| site_url | [string] Url of your site | {{site_url}} |
| alert_name | [string] Name of the alert | {{alert_name}} |
| status | [string] Status of the alert. Can be `TRIGGERED`, `RESOLVED` | {{status}} |
| is_resolved | [bool] True if alert is `RESOLVED` | {{is_resolved}} |
| is_triggered | [bool] True if alert is `TRIGGERED` | {{is_triggered}} |
| description | [string] Description of the alert. | {{description}} |
| action_text | [string] CTA for next action on the alert | {{action_text}} |
| action_url | [string] URL for next action on the alert | {{action_url}} |
| metric | [string] Name of the monitor | {{metric}} |
| severity | [string] Severity of the alert. Can be `critical`, `warn` | {{severity}} |
| id | [string] Id of the alert | {{id}} |
| current_value | [number] Current count of failures | {{current_value}} |
| threshold | [number] Threshold Failue | {{threshold}} |
| source | [string] Source of the alert | {{source}} |
| timestamp | [string] Timestamp **ISO 8601** formatted | {{timestamp}} |
---
## Webhook
Webhook triggers are used to send a HTTP POST request to a URL when a monitor goes down or up.
<div class="border rounded-md">
![Trigger API](/documentation/trig_web.png)
</div>
### URL
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The URL is used to define the URL of the webhook. It is required and has to be a valid URL.
You can also pass secrets that are set in the environment variables.
Example: `https://example.com/webhook?secret=$SECRET_X`. Make sure `$SECRET_X` is set in the environment variables.
### Method
Method will always be `POST`
### Headers
The headers are used to define the headers that should be sent with the request. It is optional and has to be a valid JSON object. You can add secrets that are set in the environment variables.
Example: `Authorization: Bearer $SECRET_Y`. Make sure `$SECRET_Y` is set in the environment variables.
While sending webhook kener will add two more headers: `Content-Type: application/json` and `User-Agent: Kener/3.0.0`.
### Body
Body of the webhook will be sent as below:
```json
{
"id": "mockoon-9",
"alert_name": "Mockoon DOWN",
"severity": "critical",
"status": "TRIGGERED",
"source": "Kener",
"timestamp": "2024-11-27T04:55:00.369Z",
"description": "🚨 **Service Alert**: Check the details below",
"details": {
"metric": "Mockoon",
"current_value": 1,
"threshold": 1
},
"actions": [
{
"text": "View Monitor",
"url": "https://kener.ing/monitor-mockoon"
}
]
}
```
### Custom Body
Using [mustache variables](#triggers-trigger-variables) you can customize the body of the webhook. If you are not using a json body then please make sure you are using the right content-type by setting custom headers.
### Examples
#### 1. Telegram
You can use the webhook trigger to send a message to a telegram channel. Enable `Use a custom webhook body`.
Set the URL to `https://api.telegram.org/bot[BOT_TOKEN]/sendMessage`. Replace [BOT_TOKEN] with your bot token.
```json
{
"chat_id": "[CHAT_ID]", // Replace [CHAT_ID] with your chat id
"text": "<b>{{alert_name}}</b>\n\n<b>Severity:</b> <code>{{severity}}</code>\n<b>Status:</b> {{status}}\n<b>Source:</b> Kener\n<b>Time:</b> {{timestamp}}\n\n📌 <b>Details:</b>\n- <b>Metric:</b>{{metric}}\n- <b>Current Value:</b> <code>{{current_value}}</code>\n- <b>Threshold:</b> <code>{{threshold}}</code>\n\n🔍 <a href=\"{{action_url}}\">{{action_text}}</a>",
"parse_mode": "HTML"
}
```
If you want to send a message to a group, then replace `[CHAT_ID]` with the group id.
You can also use environment variables to store the bot token and chat id. In that case the URL will be `https://api.telegram.org/bot$BOT_TOKEN/sendMessage`. In the body you can use `"chat_id": "$CHAT_ID"`. Make sure you have set the `BOT_TOKEN` and `CHAT_ID` in the <a href="/docs/environment-vars#secrets">environment variables</a>.
#### 2. Conditional Webhook
You can use `is_triggered` and `is_resolved` to create conditional webhooks.
```json
{
"title": "Monitor Alert for {{metric}} has been {{#is_triggered}}🔴 Triggered{{/is_triggered}}{{#is_resolved}}🟢 Resolved{{/is_resolved}}. Current value is {{current_value}} and threshold set is {{threshold}}"
}
```
The output will be
```json
{
"title": "Monitor Alert for Mockoon has been 🔴 Triggered. Current value is 1 and threshold set is 1"
}
```
```json
{
"title": "Monitor Alert for Mockoon has been 🟢 Resolved. Current value is 0 and threshold set is 1"
}
```
#### 3. Combing mustache with env variables
Combine the above example with `NODE_ENV` environment variable.
```json
{
"title": "Monitor Alert for {{metric}} in environment $NODE_ENV has been {{#is_triggered}}🔴 Triggered{{/is_triggered}}{{#is_resolved}}🟢 Resolved{{/is_resolved}}. Current value is {{current_value}} and threshold set is {{threshold}}."
}
```
---
## Discord
Discord triggers are used to send a message to a discord channel when a monitor goes down or up.
<div class="border rounded-md">
![Trigger API](/documentation/trig_2.png)
</div>
### Discord URL
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The Discord URL is used to define the URL of the discord webhook. It is required and has to be a valid URL.
#### How to get the Discord URL?
1. Go to your discord server
2. Right-click on the channel you want to send the messages
3. Click on `Edit Channel`
4. Go to `Integrations`
5. Click on `Create Webhook`
6. Copy the URL
#### Discord Message
The discord message when alert is `TRIGGERED` will look like this
![Discord](/discord.png)
The discord message when alert is `RESOLVED` will look like this
![Discord](/documentation/discord_resolved.png)
### Modify Discord Message
You can modify the discord message by using [mustache variables](#triggers-trigger-variables).
```json
{
"username": "{{site_name}}",
"avatar_url": "{{{logo_url}}}",
"content": "## {{alert_name}}\n{{#is_triggered}}🔴 Triggered{{/is_triggered}}{{#is_resolved}}🟢 Resolved{{/is_resolved}}\n{{description}}\nClick [MY CTA]({{{action_url}}}) for more.",
"embeds": [
{
"title": "❌{{alert_name}}❌",
"description": "{{description}}",
"url": "{{{action_url}}}",
"color": "{{#is_triggered}}13250616{{/is_triggered}}{{#is_resolved}}5156244{{/is_resolved}}",
"fields": [
{
"name": "Monitor",
"value": "{{metric}}",
"inline": false
},
{
"name": "Severity",
"value": "{{severity}}",
"inline": false
},
{
"name": "Alert ID",
"value": "{{id}}",
"inline": false
},
{
"name": "Current Value",
"value": "{{current_value}}",
"inline": true
},
{
"name": "Threshold",
"value": "{{threshold}}",
"inline": true
}
],
"footer": {
"text": "{{source}}",
"icon_url": "{{{logo_url}}}"
},
"timestamp": "{{timestamp}}"
}
]
}
```
---
## Slack
Slack triggers are used to send a message to a slack channel when a monitor goes down or up.
<div class="border rounded-md">
![Trigger API](/documentation/trig_3.png)
</div>
### Slack URL
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The Slack URL is used to define the URL of the slack webhook. It is required and has to be a valid URL.
#### How to get the Slack URL?
1. Go to your slack workspace
2. Click on `Apps` on the left sidebar
3. Search for `Incoming Webhooks`
4. Click on `Add to Slack`
5. Select the channel you want to send the messages
6. Click on `Add Incoming Webhook Integration`
7. Copy the URL
#### Slack Message
The slack message when alert is `TRIGGERED` will look like this
![Slack](/slack.png)
The slack message when alert is `RESOLVED` will look like this
![Slack](/documentation/slack_resolved.png)
### Modify Slack Message
You can modify the slack message by using [mustache variables](#triggers-trigger-variables).
```json
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "Hello Alert {{alert_name}}",
"emoji": true
}
},
{
"type": "header",
"text": {
"type": "plain_text",
"text": "{{#is_triggered}}🔴 Triggered{{/is_triggered}}{{#is_resolved}}🟢 Resolved{{/is_resolved}}",
"emoji": true
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "{{description}}\n*Source:* {{source}}\n*Severity:* {{severity}}\n*Status:* {{status}}"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Metric:*\n{{metric}}"
},
{
"type": "mrkdwn",
"text": "*Current Value:*\n{{current_value}}"
},
{
"type": "mrkdwn",
"text": "*Threshold:*\n{{threshold}}"
},
{
"type": "mrkdwn",
"text": "*Environment:*\n$_NODE_ENV"
},
{
"type": "mrkdwn",
"text": "*Timestamp:*\n<!date^{{timestamp_unix}}^{date} at {time}|{{timestamp}}>"
}
]
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "{{action_text}}"
},
"url": "{{{action_url}}}",
"style": "primary"
}
]
}
]
}
```
---
## Email
Email triggers are used to send an email when a monitor goes down or up. Kener supports sending emails via [resend](https://resend.com) or over SMTP.
<div class="border rounded-md">
![Trigger API](/documentation/trig_4.png)
</div>
### Resend
To send emails using Resend you just need to set `RESEND_API_KEY` in the environment variables.
### SMTP
To send emails using SMTP, please enter
- Host: SMTP server host
- Port: SMTP server port
- User: SMTP server username
- Password: SMTP server password
<div class="note danger">
Since the password will be stored as plain text we encourage to use environment variables for the password. Let us say if you have an environment variable `SMTP_PASSWORD` then you can use it as `$SMTP_PASSWORD`.
</div>
<div class=" note info ">
If your SMTP provider does require username and password, you can set `SMTP_USER` and `SMTP_PASS` to `-`.
</div>
### To
<span class="text-red-500 text-xs font-semibold">
REQUIRED
</span>
The email addresses to which the email should be sent. It is required and has to be a valid email addresses. You can pass multiple email addresses separated by a comma.
### Sender
The email address from which the email should be sent.
It should be in the format `Name <email@address.com>`
If you have not connected your domain with resend, then use `Some Name <onboarding@resend.dev>`
### Subject
Subject of the email when `TRIGGERED`
```text
[TRIGGERED] Mockoon DOWN at 2024-12-27T04:42:01.430Z
```
Subject of the email when `RESOLVED`
```text
[RESOLVED] Mockoon DOWN at 2024-12-27T04:42:01.430Z
```
### Body
The emaik message when alert is `TRIGGERED` will look like this
![Slack](/documentation/em_t.png)
The emaik message when alert is `RESOLVED` will look like this
![Slack](/documentation/em_r.png)
---
## Edit Triggers
Click on the ⚙️ to edit the trigger.
### Deactivate Trigger
You can deactivate the trigger by switching the toggle to off. You cannot send message to a deactivated trigger. Any monitor with this trigger will not send any notifications.
---
+19
View File
@@ -0,0 +1,19 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
body {
background-color: #111;
}
</style>
</head>
<body>
<script
async
src="http://localhost:3000/embed/monitor-earth/js?theme=light&monitor=http://localhost:3000/embed/monitor-earth&locale=fr&tz=Asia/Tokyo"
></script>
</body>
</html>
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
set -e
# Automatically set PUBLIC_WHITE_LABEL based on WHITE_LABEL
export PUBLIC_WHITE_LABEL="${WHITE_LABEL}"
# Replace shell with the given command (from CMD or runtime args)
exec "$@"
+2 -1
View File
@@ -9,7 +9,8 @@
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"moduleResolution": "bundler"
"moduleResolution": "bundler",
"noImplicitAny": false
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias and https://kit.svelte.dev/docs/configuration#files
//
+37
View File
@@ -0,0 +1,37 @@
// @ts-nocheck
import dotenv from "dotenv";
dotenv.config();
const databaseURL = process.env.DATABASE_URL || "sqlite://./database/kener.sqlite.db";
const databaseURLParts = databaseURL.split("://");
const databaseType = databaseURLParts[0];
const databasePath = databaseURLParts[1];
const knexOb = {
migrations: {
directory: "./migrations",
},
seeds: {
directory: "./seeds",
},
databaseType,
};
if (databaseType === "sqlite") {
knexOb.client = "better-sqlite3";
knexOb.connection = {
filename: databasePath,
};
knexOb.useNullAsDefault = true;
} else if (databaseType === "postgresql") {
knexOb.client = "pg";
knexOb.connection = databaseURL;
} else if (databaseType === "mysql") {
knexOb.client = "mysql2";
knexOb.connection = databaseURL;
} else {
console.error("Invalid database type");
process.exit(1);
}
export default knexOb;
-57
View File
@@ -1,57 +0,0 @@
{
"root": {
"ongoing_incidents": "Ongoing Incidents",
"availability_per_component": "Availability per Component",
"other_monitors": "Other Monitors",
"no_monitors": "No monitors found",
"read_doc_monitor": "Read the documentation to add your first monitor",
"here": "here",
"category": "Category",
"incident": "Incident",
"incidents": "Incidents",
"no_recent_incident": "No recent incident",
"recent_incidents": "Recent Incidents",
"active_incidents": "Active Incidents",
"no_active_incident": "No Active Incident",
"last_x_hours": "Last %hours hours"
},
"statuses": {
"UP": "UP",
"DOWN": "DOWN",
"DEGRADED": "DEGRADED"
},
"incident": {
"identified": "Identified",
"resolved": "Resolved",
"maintenance": "Maintenance"
},
"monitor": {
"share": "Share",
"badge": "Badge",
"embed": "Embed",
"mode": "Mode",
"status": "Status",
"copied": "Copied",
"uptime": "Uptime",
"theme": "Theme",
"theme_light": "Light",
"theme_dark": "Dark",
"today": "Today",
"90_day": "90 Day",
"share_desc": "Share this monitor using a link with others",
"badge_desc": "Get SVG badge for this monitor",
"embed_desc": "Embed this monitor using <script> or <iframe> in your app.",
"cp_link": "Copy Link",
"cpd_link": "Link Copied",
"cp_code": "Copy Code",
"cpd_code": "Code Copied",
"status_x_minute": "%status for %minute minute",
"status_x_minutes": "%status for %minutes minutes",
"status_x_hour_y_minute": "%status for %hours h and %minutes m",
"status_no_data": "No Data",
"status_ok": "Status OK",
"am": "am",
"pm": "pm"
},
"numbers": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
}
-57
View File
@@ -1,57 +0,0 @@
{
"incident": {
"identified": "डेंटिफ़िएड",
"maintenance": "मेंटेनेंस",
"resolved": "रेसोल्वेड"
},
"monitor": {
"90_day": "९० दिन",
"am": "ऍम",
"badge": "बैज",
"badge_desc": "इस मॉनिटर के लिए SVG बैज प्राप्त करें",
"copied": "कोपीएड",
"cp_code": "कॉपी कोड",
"cp_link": "लिंक कॉपी करें",
"cpd_code": "कोड कॉपी किया गया",
"cpd_link": "लिंक कॉपी किया गया",
"embed": "एम्बेड",
"embed_desc": "इस मॉनीटर को एम्बेड करें<script> या<iframe> अपने ऐप में.",
"mode": "मोड",
"pm": "पं",
"share": "शेयर",
"share_desc": "लिंक का उपयोग करके इस मॉनिटर को अन्य लोगों के साथ शेयर करें",
"status": "स्टेटस",
"status_no_data": "कोई डेटा नहीं",
"status_ok": "स्थिति ठीक है",
"status_x_hour_y_minute": "%hours घंटा %minutes मिनट के लिए %status",
"status_x_minute": "%minute मिनट के लिए %status",
"status_x_minutes": "%minutes मिनट के लिए %status",
"theme": "थीम",
"theme_dark": "डार्क",
"theme_light": "लाइट",
"today": "आज",
"uptime": "अपटाइम"
},
"numbers": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
"root": {
"active_incidents": "सक्रिय घटनाएं",
"availability_per_component": "प्रति कॉम्पोनेन्ट उपलब्धता",
"category": "श्रेणी",
"here": "यहाँ",
"incident": "हादसा",
"incidents": "घटनाएं",
"last_x_hours": "अंतिम %hours घंटे",
"no_active_incident": "कोई सक्रिय घटना नहीं",
"no_monitors": "कोई मॉनिटर नहीं मिला",
"no_recent_incident": "कोई हालिया घटना नहीं",
"ongoing_incidents": "चल रही घटनाएँ",
"other_monitors": "अन्य मॉनिटर",
"read_doc_monitor": "अपना पहला मॉनिटर जोड़ने के लिए डॉक्यूमेंटेशन पढ़ें",
"recent_incidents": "हाल की घटनाएँ"
},
"statuses": {
"DEGRADED": "डेग्रेडेड",
"DOWN": "डाउन",
"UP": "उप"
}
}
-57
View File
@@ -1,57 +0,0 @@
{
"root": {
"ongoing_incidents": "進行中のインシデント",
"availability_per_component": "コンポーネントごとの可用性",
"other_monitors": "その他のモニター",
"no_monitors": "モニターはありません",
"read_doc_monitor": "最初のモニターを追加するには、ドキュメントをお読みください",
"here": "ここ",
"category": "カテゴリー",
"incident": "インシデント",
"incidents": "インシデント",
"no_recent_incident": "最近のインシデントはありません",
"recent_incidents": "最近のインシデント",
"active_incidents": "現在のインシデント",
"no_active_incident": "現在のインシデントはありません",
"last_x_hours": "最近%hours時間"
},
"statuses": {
"UP": "正常",
"DOWN": "ダウン",
"DEGRADED": "縮退"
},
"incident": {
"identified": "確認済み",
"resolved": "解決済み",
"maintenance": "メンテナンス"
},
"monitor": {
"share": "シェア",
"badge": "バッジ",
"embed": "埋め込み",
"mode": "モード",
"status": "ステータス",
"copied": "コピーしました",
"uptime": "稼働時間",
"theme": "テーマ",
"theme_light": "ライト",
"theme_dark": "ダーク",
"today": "今日",
"90_day": "90日間",
"share_desc": "このモニターをリンクで他の人にシェア",
"badge_desc": "このモニターのSVGバッジを取得",
"embed_desc": "このモニターを <script> や <iframe> で埋め込む",
"cp_link": "リンクをコピー",
"cpd_link": "リンクをコピーしました",
"cp_code": "コードをコピー",
"cpd_code": "コードをコピーしました",
"status_x_minute": "%minute分間の%status",
"status_x_minutes": "%minutes分間の%status",
"status_x_hour_y_minute": "%hours時間%minutes分間の%status",
"status_no_data": "データはありません",
"status_ok": "正常",
"am": "午前",
"pm": "午後"
},
"numbers": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
}
-57
View File
@@ -1,57 +0,0 @@
{
"root": {
"ongoing_incidents": "Sự Cố Đang Xảy Ra",
"availability_per_component": "Độ Sẵn Sàng Của Từng Thành Phần",
"other_monitors": "Các Giám Sát Khác",
"no_monitors": "Không tìm thấy giám sát nào",
"read_doc_monitor": "Đọc tài liệu để thêm giám sát đầu tiên của bạn",
"here": "tại đây",
"category": "Danh Mục",
"incident": "Sự Cố",
"incidents": "Các Sự Cố",
"no_recent_incident": "Không có sự cố gần đây",
"recent_incidents": "Các Sự Cố Gần Đây",
"active_incidents": "Các Sự Cố Đang Hoạt Động",
"no_active_incident": "Không Có Sự Cố Đang Hoạt Động",
"last_x_hours": "Trong %hours giờ qua"
},
"statuses": {
"UP": "HOẠT ĐỘNG",
"DOWN": "NGỪNG HOẠT ĐỘNG",
"DEGRADED": "SUY GIẢM"
},
"incident": {
"identified": "Đã Xác Định",
"resolved": "Đã Giải Quyết",
"maintenance": "Bảo Trì"
},
"monitor": {
"share": "Chia Sẻ",
"badge": "Huy Hiệu",
"embed": "Nhúng",
"mode": "Chế Độ",
"status": "Trạng Thái",
"copied": "Đã Sao Chép",
"uptime": "Thời Gian Hoạt Động",
"theme": "Chủ Đề",
"theme_light": "Sáng",
"theme_dark": "Tối",
"today": "Hôm Nay",
"90_day": "90 Ngày",
"share_desc": "Chia sẻ giám sát này bằng một liên kết với người khác",
"badge_desc": "Nhận huy hiệu SVG cho giám sát này",
"embed_desc": "Nhúng giám sát này bằng <script> hoặc <iframe> vào ứng dụng của bạn.",
"cp_link": "Sao Chép Liên Kết",
"cpd_link": "Liên Kết Đã Được Sao Chép",
"cp_code": "Sao Chép Mã",
"cpd_code": "Mã Đã Được Sao Chép",
"status_x_minute": "%status trong %minute phút",
"status_x_minutes": "%status trong %minutes phút",
"status_x_hour_y_minute": "%status trong %hours giờ và %minutes phút",
"status_no_data": "Không Có Dữ Liệu",
"status_ok": "Trạng Thái OK",
"am": "sáng",
"pm": "chiều"
},
"numbers": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
}
-57
View File
@@ -1,57 +0,0 @@
{
"root": {
"ongoing_incidents": "正在进行的事件",
"availability_per_component": "每个服务的可用性",
"other_monitors": "其他显示器",
"no_monitors": "未找到显示器",
"read_doc_monitor": "阅读文档以添加您的第一个显示器",
"here": "这里",
"category": "类别",
"incident": "事件",
"incidents": "事件",
"no_recent_incident": "最近没有发生事件",
"recent_incidents": "最近发生的事件",
"active_incidents": "活跃事件",
"no_active_incident": "没有活跃事件",
"last_x_hours": "最近%hours个小时"
},
"statuses": {
"UP": "正常",
"DOWN": "故障",
"DEGRADED": "异常"
},
"incident": {
"identified": "确认",
"resolved": "解决",
"maintenance": "维护"
},
"monitor": {
"share": "分享",
"badge": "徽章",
"embed": "嵌入",
"mode": "模式",
"status": "状态",
"copied": "已复制",
"uptime": "正常运行时间",
"theme": "主题",
"theme_light": "Light",
"theme_dark": "Dark",
"today": "今天",
"90_day": "90 天",
"share_desc": "使用链接与其他人共享此显示器",
"badge_desc": "获取此显示器的 SVG 徽章",
"embed_desc": "在您的应用程序中使用 <script> 或 <iframe> 嵌入此监视器。",
"cp_link": "复制链接",
"cpd_link": "链接已复制",
"cp_code": "复制代码",
"cpd_code": "代码已复制",
"status_x_minute": "%minute分钟的%status",
"status_x_minutes": "%minutes分钟的%status",
"status_x_hour_y_minute": "%hours小时%minutes分钟的%status",
"status_no_data": "没有数据",
"status_ok": "状态正常",
"am": "上午",
"pm": "下午"
},
"numbers": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
}
+103
View File
@@ -0,0 +1,103 @@
import { handler } from "./build/handler.js";
import { apiReference } from "@scalar/express-api-reference";
import dotenv from "dotenv";
dotenv.config();
import express from "express";
import Startup from "./src/lib/server/startup.js";
import { GetSiteMap } from "./src/lib/server/controllers/controller.js";
import fs from "fs-extra";
import knex from "knex";
import knexOb from "./knexfile.js";
const PORT = process.env.PORT || 3000;
const base = process.env.KENER_BASE_PATH || "";
const app = express();
const db = knex(knexOb);
if (process.env.ORIGIN) {
process.env.SVELTEKIT_ORIGIN = process.env.ORIGIN;
}
app.use((req, res, next) => {
if (req.path.startsWith("/embed")) {
res.setHeader("Content-Security-Policy", "frame-ancestors *");
}
res.setHeader("X-Powered-By", "Kener");
next();
});
app.get(base + "/healthcheck", (req, res) => {
res.end("ok");
});
app.get(base + "/sitemap.xml", async (req, res) => {
res.header("Content-Type", "application/xml");
res.send(await GetSiteMap());
});
//part /uploads server static files from static/uploads
//set env variable for upload path
process.env.UPLOAD_PATH = "./uploads";
app.use(base + "/uploads", express.static("uploads"));
try {
const openapiJSON = fs.readFileSync("./openapi.json", "utf-8");
app.use(
"/api-reference",
apiReference({
spec: {
content: openapiJSON
},
theme: "alternate",
hideModels: true,
hideTestRequestButton: true,
darkMode: true,
metaData: {
title: "Kener API Reference",
description: "Kener free open source status page API Reference",
ogDescription: "Kener free open source status page API Reference",
ogTitle: "Kener API Reference",
ogImage: "https://kener.ing/newbg.png",
twitterCard: "summary_large_image",
twitterTitle: "Kener API Reference",
twitterDescription: "Kener free open source status page API Reference",
twitterImage: "https://kener.ing/newbg.png"
},
favicon: "https://kener.ing/logo96.png"
})
);
} catch (e) {
console.warn("Error loading openapi.json, but that is okay.");
}
app.use(handler);
//migrations
async function runMigrations() {
try {
console.log("Running migrations...");
await db.migrate.latest(); // Runs migrations to the latest state
console.log("Migrations completed successfully!");
} catch (err) {
console.error("Error running migrations:", err);
}
}
//seed
async function runSeed() {
try {
console.log("Running seed...");
await db.seed.run(); // Runs seed to the latest state
console.log("Seed completed successfully!");
} catch (err) {
console.error("Error running seed:", err);
}
}
app.listen(PORT, async () => {
await runMigrations();
await runSeed();
await db.destroy();
Startup();
console.log("Kener is running on port " + PORT + "!");
});
+135
View File
@@ -0,0 +1,135 @@
// migrations/YYYYMMDDHHMMSS_create_monitoring_tables.js
export function up(knex) {
return (
knex.schema
// Create monitoring_data table
.createTable("monitoring_data", (table) => {
table.string("monitor_tag", 255).notNullable();
table.integer("timestamp").notNullable();
table.text("status");
table.float("latency", 8, 2);
table.text("type");
table.primary(["monitor_tag", "timestamp"]);
})
// Create monitor_alerts table
.createTable("monitor_alerts", (table) => {
table.increments("id").primary();
table.string("monitor_tag", 255).notNullable();
table.string("monitor_status", 255).notNullable();
table.string("alert_status", 255).notNullable();
table.integer("health_checks").notNullable();
table.integer("incident_number").defaultTo(0);
table.timestamp("created_at").defaultTo(knex.fn.now());
table.timestamp("updated_at").defaultTo(knex.fn.now());
})
// Add index to monitor_alerts table
.raw(
"CREATE INDEX idx_monitor_tag_created_at ON monitor_alerts (monitor_tag, created_at)"
)
.createTable("site_data", (table) => {
table.increments("id").primary();
table.string("key", 255).notNullable().unique();
table.text("value").notNullable();
table.string("data_type", 255).notNullable();
table.timestamp("created_at").defaultTo(knex.fn.now());
table.timestamp("updated_at").defaultTo(knex.fn.now());
})
.createTable("monitors", (table) => {
table.increments("id").primary();
table.string("tag", 255).notNullable().unique();
table.string("name", 255).notNullable().unique();
table.text("description");
table.text("image");
table.string("cron", 255);
table.string("default_status", 255);
table.string("status", 255);
table.string("category_name", 255);
table.string("monitor_type", 255);
table.string("down_trigger", 255);
table.string("degraded_trigger", 255);
table.text("type_data");
table.integer("day_degraded_minimum_count");
table.integer("day_down_minimum_count");
table.string("include_degraded_in_downtime", 255).defaultTo("NO");
table.timestamp("created_at").defaultTo(knex.fn.now());
table.timestamp("updated_at").defaultTo(knex.fn.now());
})
.createTable("triggers", (table) => {
table.increments("id").primary();
table.string("name", 255).notNullable().unique();
table.string("trigger_type", 255);
table.text("trigger_desc");
table.string("trigger_status", 255);
table.text("trigger_meta");
table.timestamp("created_at").defaultTo(knex.fn.now());
table.timestamp("updated_at").defaultTo(knex.fn.now());
})
.createTable("users", (table) => {
table.increments("id").primary();
table.string("email", 255).notNullable().unique();
table.string("name", 255).notNullable();
table.string("password_hash", 255).notNullable();
table.integer("is_active").defaultTo(1);
table.integer("is_verified").defaultTo(0);
table.string("role", 255).defaultTo("user");
table.timestamp("created_at").defaultTo(knex.fn.now());
table.timestamp("updated_at").defaultTo(knex.fn.now());
})
.createTable("api_keys", (table) => {
table.increments("id").primary();
table.string("name", 255).notNullable().unique();
table.string("hashed_key", 255).notNullable().unique();
table.string("masked_key", 255).notNullable();
table.string("status", 255).defaultTo("ACTIVE");
table.timestamp("created_at").defaultTo(knex.fn.now());
table.timestamp("updated_at").defaultTo(knex.fn.now());
})
.createTable("incidents", (table) => {
table.increments("id").primary();
table.string("title", 255).notNullable();
table.integer("start_date_time").notNullable();
table.integer("end_date_time");
table.timestamp("created_at").defaultTo(knex.fn.now());
table.timestamp("updated_at").defaultTo(knex.fn.now());
table.string("status", 255).defaultTo("ACTIVE");
table.string("state", 255).defaultTo("INVESTIGATING");
})
.createTable("incident_monitors", (table) => {
table.increments("id").primary();
table.string("monitor_tag", 255).notNullable();
table.string("monitor_impact", 255);
table.timestamp("created_at").defaultTo(knex.fn.now());
table.timestamp("updated_at").defaultTo(knex.fn.now());
table.integer("incident_id").notNullable();
table.unique(["monitor_tag", "incident_id"]);
})
.createTable("incident_comments", (table) => {
table.increments("id").primary();
table.text("comment").notNullable();
table.integer("incident_id").notNullable();
table.integer("commented_at").notNullable();
table.timestamp("created_at").defaultTo(knex.fn.now());
table.timestamp("updated_at").defaultTo(knex.fn.now());
table.string("status", 255).defaultTo("ACTIVE");
table.string("state", 255).defaultTo("INVESTIGATING");
})
);
}
export function down(knex) {
return (
knex.schema
// Drop tables in reverse order
.dropTableIfExists("monitor_alerts")
.dropTableIfExists("monitoring_data")
.dropTableIfExists("site_data")
.dropTableIfExists("monitors")
.dropTableIfExists("triggers")
.dropTableIfExists("users")
.dropTableIfExists("api_keys")
.dropTableIfExists("incidents")
.dropTableIfExists("incident_monitors")
.dropTableIfExists("incident_comments")
);
}
@@ -0,0 +1,11 @@
export function up(knex) {
return knex.schema.alterTable("incidents", function (table) {
table.text("incident_type").defaultTo("INCIDENT");
});
}
export function down(knex) {
return knex.schema.alterTable("incidents", function (table) {
table.dropColumn("incident_type");
});
}
@@ -0,0 +1,11 @@
export function up(knex) {
return knex.schema.alterTable("incidents", function (table) {
table.text("incident_source").defaultTo("DASHBOARD");
});
}
export function down(knex) {
return knex.schema.alterTable("incidents", function (table) {
table.dropColumn("incident_source");
});
}
@@ -0,0 +1,38 @@
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
export function up(knex) {
return knex.schema.createTable("invitations", (table) => {
// Primary key
table.increments("id").primary();
// Core invitation fields
table.string("invitation_token").unique().notNullable();
table.string("invitation_type").notNullable();
table.integer("invited_user_id").nullable();
table.integer("invited_by_user_id").notNullable();
// Additional data fields
table.text("invitation_meta").nullable(); // For storing JSON or other metadata
table.timestamp("invitation_expiry").notNullable();
table.string("invitation_status").notNullable().defaultTo("PENDING");
// Timestamps
table.timestamp("created_at").defaultTo(knex.fn.now());
table.timestamp("updated_at").defaultTo(knex.fn.now());
// Indexes
table.index("invitation_status");
table.index("invitation_expiry");
table.index(["invited_by_user_id", "invitation_status"]);
});
}
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
export function down(knex) {
return knex.schema.dropTableIfExists("invitations");
}
@@ -0,0 +1,49 @@
export function up(knex) {
return knex.schema
.createTable("subscribers", (table) => {
table.increments("id").primary();
table.string("subscriber_send").notNullable();
table.text("subscriber_meta").nullable();
table.string("subscriber_type").notNullable();
table.string("subscriber_status").notNullable();
table.datetime("created_at").defaultTo(knex.fn.now());
table.datetime("updated_at").defaultTo(knex.fn.now());
// Add unique constraint on subscriber_send and subscriber_type
table.unique(["subscriber_send", "subscriber_type"]);
// Add index on subscriber_send for better query performance
table.index(["subscriber_send"]);
})
.createTable("subscriptions", (table) => {
table.increments("id").primary();
table.integer("subscriber_id").unsigned().notNullable();
table.string("subscriptions_status").notNullable();
table.string("subscriptions_monitors").notNullable();
table.text("subscriptions_meta").nullable();
table.datetime("created_at").defaultTo(knex.fn.now());
table.datetime("updated_at").defaultTo(knex.fn.now());
// Add unique constraint on subscriber_id and subscriptions_monitors
// This constraint also creates an index that will be used for queries
table.unique(["subscriber_id", "subscriptions_monitors"]);
// Add index to optimize queries filtering by status and monitors
table.index(["subscriptions_status", "subscriptions_monitors"]);
})
.createTable("subscription_triggers", (table) => {
table.increments("id").primary();
table.string("subscription_trigger_type").notNullable().unique();
table.string("subscription_trigger_status").notNullable();
table.text("config").nullable();
table.datetime("created_at").defaultTo(knex.fn.now());
table.datetime("updated_at").defaultTo(knex.fn.now());
});
}
export function down(knex) {
return knex.schema
.dropTableIfExists("subscription_triggers")
.dropTableIfExists("subscriptions")
.dropTableIfExists("subscribers");
}
+2000
View File
File diff suppressed because it is too large Load Diff
+804
View File
@@ -0,0 +1,804 @@
---
info:
title: Kener API
version: 3.0.0
description: |
# Kener Selfhost node js status page
![Kener](https://kener.ing/newbg.png "kener")
API specification for Kener status page and incident management system. This API spec was created using [Frogment](https://www.frogment.app)
contact:
name: Raj Nandan Sharma
email: rajnandan1@gmail.com
url: https://github.com/rajnandan1/kener/issues
license:
name: MIT
url: https://opensource.org/licenses/MIT
openapi: 3.0.0
servers:
- url: https://{host}
description: Kener host URL
tags:
- name: Monitors
description: APIs to interact with monitors
- name: Incidents
description: APIs to integrate incidents
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: enter your api key here
schemas:
MonitorStatus:
type: object
description: Monitor Status
required:
- status
- latency
- tag
properties:
status:
type: string
example: UP
enum:
- UP
- DOWN
- DEGRADED
latency:
type: number
description: In seconds
example: 100
timestampInSeconds:
type: integer
description: UTC timestamp in seconds
example: 1731251760
tag:
type: string
example: earth
description: Tag of a monitor
example:
status: UP
timestampInSeconds: 1731251760
latency: 100
tag: earth
StatusResponse:
type: object
description: Status of a monitor given a tag
properties:
status:
type: string
example: UP
enum:
- UP
- DOWN
- DEGRADED
uptime:
type: string
example: '100'
last_updated_at:
type: integer
example: 1731251760
example:
status: UP
last_updated_at: 1731251760
uptime: '100'
Incident:
type: object
description: body of an incident
properties:
start_date_time:
type: integer
description: UTC timestamp in seconds
example: 1731901920
end_date_time:
type: integer
description: UTC timestamp in seconds
nullable: true
example: 1704123938
title:
type: string
example: Outage in mumbai
description: title of the incident
created_at:
type: string
example: '2025-01-09 04:12:01'
description: created at time
updated_at:
type: string
example: '2025-01-09 06:10:00'
description: updated at time
status:
type: string
example: OPEN
description: delete or not deleted incident
enum:
- OPEN
- CLOSED
state:
type: string
description: the current status of the incident
example: INVESTIGATING
enum:
- INVESTIGATING
- IDENTIFIED
- MONITORING
- RESOLVED
example:
start_date_time: 1731901920
end_date_time: 1704123938
title: title of the incident
created_at: '2025-01-09 04:12:01'
updated_at: '2025-01-09 04:12:01'
state: INVESTIGATING
status: OPEN
id: 4
IncidentResponse:
description: Incident response schema
allOf:
- "$ref": "#/components/schemas/Incident"
Comment:
type: object
description: Comment of an incident
properties:
comment:
type: string
example: comment 1
commented_at:
type: integer
example: 1736398336
state:
type: string
example: IDENTIFIED
example:
body: comment 2
commented_at: 1736398336
state: IDENTIFIED
CommentResponse:
type: object
description: Comment Response
properties:
id:
type: integer
description: ID of the comment
example: 60
comment:
type: string
description: The content of the comment
example: Sometimes, you want all the goodness of moment#from but you don't
want to have to create two moments, you just want to display a length
of time.
incident_id:
type: integer
description: ID of the associated incident
example: 24
commented_at:
type: integer
description: Timestamp when the comment was added
example: 1736398336
created_at:
type: string
format: date-time
description: Timestamp when the comment was created in ISO 8601 format
example: '2025-01-09 04:52:16'
updated_at:
type: string
format: date-time
description: Timestamp when the comment was last updated in ISO 8601 format
example: '2025-01-09 04:52:16'
status:
type: string
description: Current status of the comment
example: ACTIVE
state:
type: string
description: the current status of the incident
example: INVESTIGATING
enum:
- INVESTIGATING
- IDENTIFIED
- MONITORING
- RESOLVED
example:
id: 60
comment: Sometimes, you want all the goodness of moment
incident_id: 24
commented_at: 1736398336
created_at: '2025-01-09 04:52:16'
updated_at: '2025-01-09 04:52:16'
status: ACTIVE
state: MONITORING
IncidentStatus:
type: object
description: Status of the incident
properties:
isIdentified:
type: boolean
description: Has the incident been indetified
example: true
isResolved:
type: boolean
description: has the incident been resolved
example: true
endDatetime:
type: integer
description: Incident end time
example: 1731901920
example:
isIdentified: true
isResolved: true
endDatetime: 1731901920
IncidentCreateRequest:
title: Incident Create Request Body
type: object
description: body of an incident
required:
- title
- start_date_time
properties:
start_date_time:
type: integer
description: UTC timestamp in seconds
example: 1731901920
title:
type: string
example: Outage in mumbai
description: title of the incident
example:
start_date_time: 1731901920
title: title of the incident
responses:
Response401:
description: Bad API keys response
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: Invalid token response
example: invalid token
example:
error: invalid token
Response400:
description: bad request
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: bad request while calling kener apis
example: unknown tags
example:
error: unknown tags
examples:
GetMonitorStatusExample200:
summary: response of get status of a monitor
description: Some Description
value:
status: UP
uptime: '100'
lastUpdatedAt: 1731901920
DegradedRequestBody:
summary: update to degraded
description: Some Description
value:
status: DEGRADED
timestampInSeconds: 1731251760
latency: 100
tag: earth
CreateIncidentResponse:
summary: create incident response
description: create incident response
value:
start_date_time: 1731901920
end_date_time: 1731901920
id: 4
created_at: '2025-01-09 04:12:01'
updated_at: '2025-01-10 04:12:01'
title: title of the incident
status: OPEN
state: INVESTIGATING
CreateIncidentRequest:
summary: create incident request body
description: create incident request body
value:
start_date_time: 1731901920
title: title of the incident
SearchIncidentsResponse:
summary: array of incidents
description: Some Description
value:
- id: 2
title: future wala
start_date_time: 1736774486
end_date_time: 1737033787
created_at: '2025-01-12 13:21:32'
updated_at: '2025-01-12 13:23:15'
status: OPEN
state: RESOLVED
- id: 1
title: internatiinal asda
start_date_time: 1736684329
end_date_time:
created_at: '2025-01-12 12:18:53'
updated_at: '2025-01-12 13:21:32'
status: OPEN
state: INVESTIGATING
CommentsResponse:
summary: list of comments
description: Some Description
value:
- id: 58
comment: idensad
incident_id: 24
commented_at: 1736398295
created_at: '2025-01-09 04:51:37'
updated_at: '2025-01-09 04:51:37'
status: ACTIVE
state: IDENTIFIED
- id: 57
comment: Sometimes, you want all the goodness of moment#from but you don't
want to have to create two moments, you just want to display a length of
time.
incident_id: 24
commented_at: 1736398279
created_at: '2025-01-09 04:51:19'
updated_at: '2025-01-09 04:51:19'
status: ACTIVE
state: INVESTIGATING
CommentRequestBody:
summary: request body for a update
description: request body for a update to add in an incident
value:
comment: This is a comment
commented_at: 1736398336
state: IDENTIFIED
CreateCommentResponse:
summary: create update response body sample
description: create update response body sample
value:
id: 60
comment: Sometimes, you want all the goodness of moment
incident_id: 24
commented_at: 1736398336
created_at: '2025-01-09 04:52:16'
updated_at: '2025-01-09 04:52:16'
status: ACTIVE
state: MONITORING
paths:
"/api/status":
post:
operationId: updateMonitorStatus
summary: Update status of a monitor
description: Update status of a monitor at a given timestamp UTC
tags:
- Monitors
security:
- bearerAuth: []
requestBody:
required: true
description: request body to update status of a monitor
content:
application/json:
schema:
"$ref": "#/components/schemas/MonitorStatus"
examples:
degraded:
"$ref": "#/components/examples/DegradedRequestBody"
responses:
'200':
description: Status updated successfully
content:
application/json:
schema:
type: object
properties:
status:
type: integer
example: 200
message:
type: string
example: success at 1731251760
example:
status: 200
message: success at 1731251760
'400':
"$ref": "#/components/responses/Response400"
'401':
"$ref": "#/components/responses/Response401"
get:
operationId: getMonitorStatus
summary: Get status of a monitor
description: get status of a monitor at timestamp
tags:
- Monitors
security:
- bearerAuth: []
parameters:
- name: tag
in: query
required: true
description: monitor tag to get status of it
schema:
type: string
example: earth
responses:
'200':
description: Monitor status retrieved successfully
content:
application/json:
schema:
"$ref": "#/components/schemas/StatusResponse"
examples:
successExample:
"$ref": "#/components/examples/GetMonitorStatusExample200"
'400':
"$ref": "#/components/responses/Response400"
'401':
"$ref": "#/components/responses/Response401"
"/api/incident":
post:
operationId: createIncident
summary: Create a new incident
description: API to create incidents
tags:
- Incidents
security:
- bearerAuth: []
requestBody:
required: true
description: request body to manually create an incident
content:
application/json:
schema:
"$ref": "#/components/schemas/IncidentCreateRequest"
examples:
sample:
"$ref": "#/components/examples/CreateIncidentRequest"
responses:
'200':
description: Incident created successfully
content:
application/json:
schema:
"$ref": "#/components/schemas/IncidentResponse"
examples:
success:
"$ref": "#/components/examples/CreateIncidentResponse"
'400':
"$ref": "#/components/responses/Response400"
'401':
"$ref": "#/components/responses/Response401"
get:
operationId: searchIncidents
summary: Search for incidents
description: API to get incidents
tags:
- Incidents
security:
- bearerAuth: []
parameters:
- name: status
in: query
description: status of the incident. Can be open or close. close means deleted
schema:
type: string
description: status of the incident. Can be open or close. close means deleted
enum:
- OPEN
- CLOSED
default: OPEN
example: OPEN
- name: state
in: query
description: state of the incident. Can be open or close
schema:
type: string
description: state of the incident. Can be open or close
enum:
- INVESTIGATING
- IDENTIFIED
- MONITORING
- RESOLVED
default: INVESTIGATING
example: IDENTIFIED
- name: page
in: query
description: page number
schema:
type: integer
description: page number
default: 1
minimum: 1
example: 1
- name: limit
in: query
description: how many per page
schema:
type: integer
default: 10
description: how many per page
maximum: 100
example: 10
- name: start_date_time
description: start time
in: query
schema:
type: integer
description: start time
example: 1731866475
- name: end_date_time
description: end time
in: query
schema:
type: integer
description: end time
example: 1731866475
responses:
'200':
description: Search results retrieved successfully
content:
application/json:
schema:
type: array
items:
"$ref": "#/components/schemas/IncidentResponse"
examples:
success:
"$ref": "#/components/examples/SearchIncidentsResponse"
'400':
"$ref": "#/components/responses/Response400"
'401':
"$ref": "#/components/responses/Response401"
"/api/incident/{incident_id}":
parameters:
- name: incident_id
in: path
required: true
description: incident id as an integer to get incident by id
schema:
type: integer
example: 4
get:
operationId: getIncident
summary: Get an incident by id
description: API to get an incident by incident id
tags:
- Incidents
security:
- bearerAuth: []
responses:
'200':
description: Incident retrieved successfully
content:
application/json:
schema:
"$ref": "#/components/schemas/IncidentResponse"
examples:
success:
"$ref": "#/components/examples/CreateIncidentResponse"
'400':
"$ref": "#/components/responses/Response400"
'401':
"$ref": "#/components/responses/Response401"
patch:
operationId: updateIncident
summary: Update an incident
description: API to update an incident by incident id
tags:
- Incidents
security:
- bearerAuth: []
requestBody:
required: true
description: search for an incident
content:
application/json:
schema:
"$ref": "#/components/schemas/Incident"
examples:
sample:
"$ref": "#/components/examples/CreateIncidentRequest"
responses:
'200':
description: Incident updated successfully
content:
application/json:
schema:
"$ref": "#/components/schemas/IncidentResponse"
examples:
success:
"$ref": "#/components/examples/CreateIncidentResponse"
'400':
"$ref": "#/components/responses/Response400"
'401':
"$ref": "#/components/responses/Response401"
"/api/incident/{incident_id}/updates":
parameters:
- name: incident_id
in: path
required: true
description: incident id to fetch comment for
schema:
type: integer
example: 4
post:
operationId: addIncidentComment
summary: Add an update to an incident
description: API to create update for an incident
tags:
- Incidents
security:
- bearerAuth: []
requestBody:
required: true
description: body to add an update
content:
application/json:
schema:
"$ref": "#/components/schemas/Comment"
examples:
sample:
"$ref": "#/components/examples/CommentRequestBody"
responses:
'200':
description: Comment added successfully
content:
application/json:
schema:
"$ref": "#/components/schemas/CommentResponse"
examples:
sample:
"$ref": "#/components/examples/CreateCommentResponse"
'400':
"$ref": "#/components/responses/Response400"
'401':
"$ref": "#/components/responses/Response401"
get:
operationId: getIncidentComments
summary: Get updates for an incident
description: API to get updates for an incident
tags:
- Incidents
security:
- bearerAuth: []
responses:
'200':
description: updates retrieved successfully
content:
application/json:
schema:
type: array
items:
"$ref": "#/components/schemas/CommentResponse"
examples:
success:
"$ref": "#/components/examples/CommentsResponse"
'400':
"$ref": "#/components/responses/Response400"
'401':
"$ref": "#/components/responses/Response401"
"/api/incident/{incident_id}/monitors":
parameters:
- name: incident_id
in: path
required: true
description: incident id to fetch comment for
schema:
type: integer
example: 4
get:
summary: Get monitors for an incident
operationId: getIncidentMonitors
tags:
- Incidents
parameters:
- name: incident_id
in: path
required: true
schema:
type: integer
description: The ID of the incident
responses:
'200':
description: List of monitors for the incident
content:
application/json:
schema:
type: array
items:
type: object
properties:
monitor_tag:
type: string
description: The tag of the monitor
example: earth
monitor_impact:
type: string
description: The impact status of the monitor
example: DOWN
security:
- bearerAuth: []
post:
summary: Add a monitor to an incident
operationId: addIncidentMonitor
tags:
- Incidents
parameters:
- name: incident_id
in: path
required: true
schema:
type: integer
description: The ID of the incident
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
tag:
type: string
description: The tag for the monitor
example: okbookmarks
impact:
type: string
description: The impact status of the monitor
example: DEGRADED
responses:
'200':
description: Monitor added successfully
content:
application/json:
schema:
type: array
items:
type: object
properties:
monitor_tag:
type: string
description: The tag of the monitor
example: okbookmarks
monitor_impact:
type: string
description: The impact status of the monitor
example: DEGRADED
security:
- bearerAuth: []
delete:
summary: Delete a monitor from an incident
operationId: deleteIncidentMonitor
tags:
- Incidents
parameters:
- name: incident_id
in: path
required: true
schema:
type: integer
description: The ID of the incident
- name: tag
in: query
required: true
schema:
type: string
description: The tag of the monitor to delete
responses:
'200':
description: Monitor deleted successfully
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Confirmation message
example: Monitor deleted successfully
security:
- bearerAuth: []
+9529 -4236
View File
File diff suppressed because it is too large Load Diff
+124 -77
View File
@@ -1,79 +1,126 @@
{
"name": "kener",
"version": "0.0.15",
"private": false,
"license": "MIT",
"description": "Kener: An open-source Node.js status page application for real-time service monitoring, incident management, and customizable reporting. Simplify service outage tracking, enhance incident communication, and ensure a seamless user experience.",
"author": "Raj Nandan Sharma <rajnandan1@gmail.com>",
"keywords": [
"Node.js application",
"Open-source status page",
"Service monitoring tool",
"Real-time incident management",
"Customizable reporting",
"Service outage tracker",
"User-friendly dashboard",
"Incident communication platform",
"Scalable monitoring solution",
"Community-driven software",
"Website status tracker",
"Incident response tool",
"System status monitoring",
"Service reliability management",
"Incident alert system"
],
"repository": {
"type": "git",
"url": "https://github.com/rajnandan1/kener.git"
},
"scripts": {
"build": "node scripts/check.js && vite build",
"serve": "node prod.js",
"kener:dev": "cross-env NODE_ENV=development PUBLIC_KENER_FOLDER=./static/kener node scripts/check.js && concurrently \"cross-env NODE_ENV=development PUBLIC_KENER_FOLDER=./static/kener node dev.js\" \"cross-env NODE_ENV=development PUBLIC_KENER_FOLDER=./static/kener vite dev\"",
"kener:dev-monitor": "cross-env NODE_ENV=development PUBLIC_KENER_FOLDER=./static/kener node dev.js",
"kener:build": "cross-env NODE_ENV=production node scripts/check.js && cross-env NODE_ENV=production vite build",
"kener": "cross-env NODE_ENV=production node prod.js",
"prettify": "prettier --write ."
},
"devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/adapter-node": "^1.3.1",
"@sveltejs/kit": "^1.27.4",
"@tailwindcss/typography": "^0.5.10",
"autoprefixer": "^10.4.14",
"concurrently": "^8.2.2",
"cross-env": "^7.0.3",
"postcss": "^8.4.24",
"postcss-load-config": "^4.0.1",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.3",
"prettier-plugin-tailwindcss": "^0.5.14",
"svelte": "^4.0.5",
"svelte-check": "^3.6.0",
"tailwindcss": "^3.3.2",
"typescript": "^5.0.0",
"vite": "^4.4.2"
},
"type": "module",
"dependencies": {
"axios": "^1.6.2",
"badge-maker": "^3.3.1",
"bits-ui": "^0.9.9",
"clsx": "^2.0.0",
"croner": "^7.0.5",
"dotenv": "^16.4.5",
"express": "^4.18.2",
"fs-extra": "^11.1.1",
"js-yaml": "^4.1.0",
"lucide-svelte": "^0.292.0",
"marked": "^11.1.1",
"moment": "^2.29.4",
"moment-timezone": "^0.5.43",
"node-cache": "^5.1.2",
"ping": "^0.4.4",
"queue": "^7.0.0",
"randomstring": "^1.3.0",
"tailwind-merge": "^2.0.0",
"tailwind-variants": "^0.1.18"
}
"name": "kener",
"version": "3.2.19",
"private": false,
"license": "MIT",
"description": "Kener is a modern, open-source status page application built with Node.js. It provides real-time monitoring, uptime tracking, incident management, and beautiful dashboards. Perfect for DevOps teams, SaaS providers, and businesses needing reliable service status communication with minimal setup.",
"author": "Raj Nandan Sharma <rajnandan1@gmail.com>",
"keywords": [
"status page",
"uptime monitoring",
"incident management",
"DevOps tools",
"service reliability",
"open source",
"Node.js",
"dashboard",
"system monitoring",
"status alerts",
"outage communication",
"API monitoring",
"SaaS status",
"performance metrics",
"status reporting"
],
"repository": {
"type": "git",
"url": "https://github.com/rajnandan1/kener.git"
},
"scripts": {
"build": "vite build",
"preview": "vite preview",
"configure": "node build.js",
"migrate": "npx knex migrate:latest",
"preseed": "npx knex migrate:latest",
"seed": "npx knex seed:run",
"predev": "npm run seed",
"devschedule": "node src/lib/server/startup.js",
"schedule": "node src/lib/server/startup.js",
"development": "vite dev",
"generate-readme": "node scripts/generate-readme.js",
"dev": "npm-run-all --parallel devschedule development",
"prettify": "prettier --write .",
"start": "node main.js"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/adapter-node": "^1.3.1",
"@sveltejs/kit": "^1.27.4",
"@tailwindcss/typography": "^0.5.10",
"@zerodevx/svelte-toast": "^0.9.6",
"autoprefixer": "^10.4.14",
"concurrently": "^8.2.2",
"cross-env": "^7.0.3",
"date-picker-svelte": "^2.15.1",
"postcss": "^8.4.24",
"postcss-load-config": "^4.0.1",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.3",
"prettier-plugin-tailwindcss": "^0.5.14",
"svelte": "^4.0.5",
"svelte-awesome-color-picker": "^3.1.4",
"svelte-check": "^3.6.0",
"svelte-dnd-action": "^0.9.55",
"tailwindcss": "^3.3.2",
"typescript": "^5.0.0",
"vite": "^4.4.2"
},
"type": "module",
"dependencies": {
"@babel/runtime": "^7.26.10",
"@codemirror/lang-css": "^6.3.1",
"@codemirror/lang-html": "^6.4.9",
"@codemirror/lang-javascript": "^6.2.3",
"@codemirror/lang-json": "^6.0.1",
"@codemirror/lang-markdown": "^6.3.2",
"@formkit/auto-animate": "^0.8.2",
"@number-flow/svelte": "^0.2.1",
"@scalar/express-api-reference": "^0.4.167",
"@uiw/codemirror-theme-github": "^4.23.10",
"analytics": "^0.8.14",
"axios": "^1.6.2",
"badge-maker": "^3.3.1",
"bcrypt": "^5.1.1",
"better-sqlite3": "^11.5.0",
"bits-ui": "^0.9.9",
"cheerio": "^1.0.0",
"clsx": "^2.0.0",
"croner": "^7.0.5",
"date-fns": "^4.1.0",
"date-fns-tz": "^3.2.0",
"dns2": "^2.1.0",
"dotenv": "^16.4.5",
"express": "^4.18.2",
"figlet": "^1.8.0",
"fs-extra": "^11.1.1",
"gamedig": "^5.3.0",
"js-yaml": "^4.1.0",
"jsonwebtoken": "^9.0.2",
"knex": "^3.1.0",
"lucide-svelte": "^0.483.0",
"marked": "^11.1.1",
"mobile-detect": "^1.4.5",
"mode-watcher": "^0.4.1",
"moment": "^2.29.4",
"moment-timezone": "^0.5.43",
"mustache": "^4.2.0",
"mysql2": "^3.12.0",
"node-cache": "^5.1.2",
"nodemailer": "^6.10.0",
"npm-run-all": "^4.1.5",
"pg": "^8.13.1",
"pg-pool": "^3.7.0",
"ping": "^0.4.4",
"queue": "^7.0.0",
"randomstring": "^1.3.0",
"resend": "^4.0.1",
"svelte-codemirror-editor": "^1.4.1",
"svelte-legos": "^0.2.5",
"tailwind-merge": "^2.0.0",
"tailwind-variants": "^0.1.18",
"vite-plugin-package-version": "^1.1.0"
},
"engines": {
"node": ">=20.0.0"
}
}
-30
View File
@@ -1,30 +0,0 @@
import { handler } from "./build/handler.js";
import express from "express";
import { STATUS_OK } from "./scripts/check.js";
import { Startup } from "./scripts/startup.js";
import sitemap from "./scripts/sitemap.js";
const PORT = process.env.PORT || 3000;
console.log("STATUS_OK", STATUS_OK);
Startup();
const app = express();
app.use((req, res, next) => {
if (req.path.startsWith("/embed")) {
res.setHeader("X-Frame-Options", "None");
}
next();
});
app.get("/healthcheck", (req, res) => {
res.end("ok");
});
app.get("/sitemap.xml", (req, res) => {
res.setHeader("Content-Type", "application/xml");
res.end(sitemap);
});
app.use(handler);
app.listen(PORT, () => {
console.log("Kener is running on port " + PORT + "!");
});
-15
View File
@@ -1,15 +0,0 @@
// Define your constants
import dotenv from "dotenv";
dotenv.config();
const FOLDER = process.env.PUBLIC_KENER_FOLDER;
const ENV = process.env.NODE_ENV;
const MONITOR = "./config/monitors.yaml";
const SITE = "./config/site.yaml";
const FOLDER_MONITOR = FOLDER + "/monitors.json";
const FOLDER_SITE = FOLDER + "/site.json";
const UP = "UP";
const DOWN = "DOWN";
const DEGRADED = "DEGRADED";
const API_TIMEOUT = 10 * 1000; // 10 seconds
// Export the constants
export { FOLDER, FOLDER_MONITOR, FOLDER_SITE, MONITOR, UP, DOWN, SITE, DEGRADED, API_TIMEOUT, ENV };
-387
View File
@@ -1,387 +0,0 @@
import axios from "axios";
import ping from "ping";
import fs from "fs-extra";
import { UP, DOWN, DEGRADED } from "./constants.js";
import {
GetNowTimestampUTC,
GetMinuteStartNowTimestampUTC,
GetMinuteStartTimestampUTC
} from "./tool.js";
import { GetIncidents, GetEndTimeFromBody, GetStartTimeFromBody, CloseIssue } from "./github.js";
import Randomstring from "randomstring";
import Queue from "queue";
import dotenv from "dotenv";
dotenv.config();
const Kener_folder = process.env.PUBLIC_KENER_FOLDER;
const apiQueue = new Queue({
concurrency: 10, // Number of tasks that can run concurrently
timeout: 10000, // Timeout in ms after which a task will be considered as failed (optional)
autostart: true // Automatically start the queue (optional)
});
async function manualIncident(monitor, githubConfig) {
let incidentsResp = await GetIncidents(monitor.tag, githubConfig, "open");
let manualData = {};
if (incidentsResp.length == 0) {
return manualData;
}
let timeDownStart = +Infinity;
let timeDownEnd = 0;
let timeDegradedStart = +Infinity;
let timeDegradedEnd = 0;
for (let i = 0; i < incidentsResp.length; i++) {
const incident = incidentsResp[i];
const incidentNumber = incident.number;
let start_time = GetStartTimeFromBody(incident.body);
let allLabels = incident.labels.map((label) => label.name);
if (
allLabels.indexOf("incident-degraded") == -1 &&
allLabels.indexOf("incident-down") == -1
) {
continue;
}
if (start_time === null) {
continue;
}
let newIncident = {
start_time: start_time
};
let end_time = GetEndTimeFromBody(incident.body);
if (end_time !== null) {
newIncident.end_time = end_time;
if (end_time <= GetNowTimestampUTC() && incident.state === "open") {
//close the issue after 30 secs
setTimeout(async () => {
await CloseIssue(githubConfig, incidentNumber);
}, 30000);
}
} else {
newIncident.end_time = GetNowTimestampUTC();
}
//check if labels has incident-degraded
if (allLabels.indexOf("incident-degraded") !== -1) {
timeDegradedStart = Math.min(timeDegradedStart, newIncident.start_time);
timeDegradedEnd = Math.max(timeDegradedEnd, newIncident.end_time);
}
if (allLabels.indexOf("incident-down") !== -1) {
timeDownStart = Math.min(timeDownStart, newIncident.start_time);
timeDownEnd = Math.max(timeDownEnd, newIncident.end_time);
}
}
//start from start of minute if unix timeDownStart to timeDownEnd, step each minute
let start = GetMinuteStartTimestampUTC(timeDegradedStart);
let end = GetMinuteStartTimestampUTC(timeDegradedEnd);
for (let i = start; i <= end; i += 60) {
manualData[i] = {
status: DEGRADED,
latency: 0,
type: "manual"
};
}
start = GetMinuteStartTimestampUTC(timeDownStart);
end = GetMinuteStartTimestampUTC(timeDownEnd);
for (let i = start; i <= end; i += 60) {
manualData[i] = {
status: DOWN,
latency: 0,
type: "manual"
};
}
return manualData;
}
function replaceAllOccurrences(originalString, searchString, replacement) {
const regex = new RegExp(`\\${searchString}`, "g");
const replacedString = originalString.replace(regex, replacement);
return replacedString;
}
const pingCall = async (hostsV4, hostsV6) => {
let alive = true;
let latencyTotal = 0;
let countHosts = hostsV4.length + hostsV6.length;
for (let i = 0; i < hostsV4.length; i++) {
const host = hostsV4[i].trim();
try {
let res = await ping.promise.probe(host);
alive = alive && res.alive;
latencyTotal += res.time;
} catch (error) {
alive = alive && false;
latencyTotal += 30;
}
}
for (let i = 0; i < hostsV6.length; i++) {
const host = hostsV6[i].trim();
try {
let res = await ping.promise.probe(host, {
v6: true,
timeout: false
});
alive = alive && res.alive;
latencyTotal += res.time;
} catch (error) {
alive = alive && false;
latencyTotal += 30;
}
}
return {
status: alive ? UP : DOWN,
latency: parseInt(latencyTotal / countHosts),
type: "realtime"
};
};
const apiCall = async (envSecrets, url, method, headers, body, timeout, monitorEval) => {
let axiosHeaders = {};
axiosHeaders["User-Agent"] = "Kener/0.0.1";
axiosHeaders["Accept"] = "*/*";
const start = Date.now();
//replace all secrets
for (let i = 0; i < envSecrets.length; i++) {
const secret = envSecrets[i];
if (!!body) {
body = replaceAllOccurrences(body, secret.find, secret.replace);
}
if (!!url) {
url = replaceAllOccurrences(url, secret.find, secret.replace);
}
if (!!headers) {
headers = replaceAllOccurrences(headers, secret.find, secret.replace);
}
}
if (!!headers) {
headers = JSON.parse(headers);
axiosHeaders = { ...axiosHeaders, ...headers };
}
const options = {
method: method,
headers: headers,
timeout: timeout,
transformResponse: (r) => r
};
if (!!headers) {
options.headers = headers;
}
if (!!body) {
options.data = body;
}
let statusCode = 500;
let latency = 0;
let resp = "";
let timeoutError = false;
try {
let data = await axios(url, options);
statusCode = data.status;
resp = data.data;
} catch (err) {
if (err.message.startsWith("timeout of") && err.message.endsWith("exceeded")) {
timeoutError = true;
}
if (err.response !== undefined && err.response.status !== undefined) {
statusCode = err.response.status;
}
if (err.response !== undefined && err.response.data !== undefined) {
resp = err.response.data;
}
} finally {
const end = Date.now();
latency = end - start;
}
resp = Buffer.from(resp).toString("base64");
let evalResp = eval(monitorEval + `(${statusCode}, ${latency}, "${resp}")`);
if (evalResp === undefined || evalResp === null) {
evalResp = {
status: DOWN,
latency: latency,
type: "error"
};
} else if (
evalResp.status === undefined ||
evalResp.status === null ||
[UP, DOWN, DEGRADED].indexOf(evalResp.status) === -1
) {
evalResp = {
status: DOWN,
latency: latency,
type: "error"
};
} else {
evalResp.type = "realtime";
}
let toWrite = {
status: DOWN,
latency: latency,
type: "error"
};
if (evalResp.status !== undefined && evalResp.status !== null) {
toWrite.status = evalResp.status;
}
if (evalResp.latency !== undefined && evalResp.latency !== null) {
toWrite.latency = evalResp.latency;
}
if (evalResp.type !== undefined && evalResp.type !== null) {
toWrite.type = evalResp.type;
}
if (timeoutError) {
toWrite.type = "timeout";
}
return toWrite;
};
const getWebhookData = async (monitor) => {
let originalData = {};
let files = fs.readdirSync(Kener_folder);
files = files.filter((file) => file.startsWith(monitor.folderName + ".webhook"));
for (let i = 0; i < files.length; i++) {
const file = files[i];
let webhookData = {};
try {
let fd = fs.readFileSync(Kener_folder + "/" + file, "utf8");
webhookData = JSON.parse(fd);
for (const timestamp in webhookData) {
originalData[timestamp] = webhookData[timestamp];
}
//delete the file
fs.unlinkSync(Kener_folder + "/" + file);
} catch (error) {
console.error(error);
}
}
return originalData;
};
const updateDayData = async (mergedData, startOfMinute, monitor) => {
let dayData = JSON.parse(fs.readFileSync(monitor.path0Day, "utf8"));
for (const timestamp in mergedData) {
dayData[timestamp] = mergedData[timestamp];
}
let since = 24 * 91;
let mxBackDate = startOfMinute - since * 3600;
let _0Day = {};
for (const ts in dayData) {
const element = dayData[ts];
if (ts >= mxBackDate) {
_0Day[ts] = element;
}
}
//sort the keys
let keys = Object.keys(_0Day);
keys.sort();
let sortedDay0 = {};
keys.reverse().forEach((key) => {
sortedDay0[key] = _0Day[key];
});
try {
fs.writeFileSync(monitor.path0Day, JSON.stringify(sortedDay0, null, 2));
} catch (error) {
console.error(error);
}
};
const Minuter = async (envSecrets, monitor, githubConfig) => {
if (apiQueue.length > 0) console.log("Queue length is " + apiQueue.length);
let apiData = {};
let pingData = {};
let webhookData = {};
let manualData = {};
const startOfMinute = GetMinuteStartNowTimestampUTC();
if (monitor.hasAPI) {
let apiResponse = await apiCall(
envSecrets,
monitor.api.url,
monitor.api.method,
JSON.stringify(monitor.api.headers),
monitor.api.body,
monitor.api.timeout,
monitor.api.eval
);
apiData[startOfMinute] = apiResponse;
if (apiResponse.type === "timeout") {
console.log(
"Retrying api call for " + monitor.name + " at " + startOfMinute + " due to timeout"
);
//retry
apiQueue.push(async (cb) => {
apiCall(
envSecrets,
monitor.api.url,
monitor.api.method,
JSON.stringify(monitor.api.headers),
monitor.api.body,
monitor.api.timeout,
monitor.api.eval
).then(async (data) => {
let day0 = {};
day0[startOfMinute] = data;
fs.writeFileSync(
Kener_folder +
`/${monitor.folderName}.webhook.${Randomstring.generate()}.json`,
JSON.stringify(day0, null, 2)
);
cb();
});
});
}
}
if (monitor.hasPing) {
let pingResponse = await pingCall(monitor.ping.hostsV4, monitor.ping.hostsV6);
pingData[startOfMinute] = pingResponse;
}
webhookData = await getWebhookData(monitor);
manualData = await manualIncident(monitor, githubConfig);
//merge noData, apiData, webhookData, dayData
let mergedData = {};
if (monitor.defaultStatus !== undefined && monitor.defaultStatus !== null) {
if ([UP, DOWN, DEGRADED].indexOf(monitor.defaultStatus) !== -1) {
mergedData[startOfMinute] = {
status: monitor.defaultStatus,
latency: 0,
type: "defaultStatus"
};
}
}
for (const timestamp in pingData) {
mergedData[timestamp] = pingData[timestamp];
}
for (const timestamp in apiData) {
mergedData[timestamp] = apiData[timestamp];
}
for (const timestamp in webhookData) {
mergedData[timestamp] = webhookData[timestamp];
}
for (const timestamp in manualData) {
mergedData[timestamp] = manualData[timestamp];
}
//update day data
await updateDayData(mergedData, startOfMinute, monitor);
};
apiQueue.start((err) => {
if (err) {
console.error("Error occurred:", err);
} else {
console.log("All tasks completed");
}
});
export { Minuter };
+31
View File
@@ -0,0 +1,31 @@
import fs from "fs";
import Mustache from "mustache";
import dotenv from "dotenv";
import { fileURLToPath } from "url";
import path from "path";
// Load environment variables from .env file
dotenv.config();
// Resolve paths correctly in ES modules
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Load the template
const templatePath = path.resolve(__dirname, "../README.template.md");
const template = fs.readFileSync(templatePath, "utf-8");
// Load environment variables and provide default values
const data = {
kener_full_version: process.env.BUILD_FULL_VERSION || "N/A",
kener_major_version: process.env.BUILD_MAJOR_VERSION || "N/A",
kener_major_minor_version: process.env.BUILD_MAJOR_MINOR_VERSION || "N/A",
};
// Render README.md
const output = Mustache.render(template, data);
// Write to README.md
fs.writeFileSync(path.resolve(__dirname, "../README.md"), output);
console.log("✅ README.md generated successfully!");
-446
View File
@@ -1,446 +0,0 @@
// @ts-nocheck
import axios from "axios";
import { GetMinuteStartNowTimestampUTC } from "./tool.js";
import { marked } from "marked";
import { fileURLToPath } from "url";
import { dirname } from "path";
import dotenv from "dotenv";
dotenv.config();
const GH_TOKEN = process.env.GH_TOKEN;
const GhnotconfireguredMsg =
"owner or repo or GH_TOKEN is undefined. Read the docs to configure github: https://kener.ing/docs#h2github-setup";
/**
* @param {any} url
*/
function getAxiosOptions(url) {
const options = {
url: url,
method: "GET",
headers: {
Accept: "application/vnd.github+json",
Authorization: "Bearer " + GH_TOKEN,
"X-GitHub-Api-Version": "2022-11-28"
}
};
return options;
}
function postAxiosOptions(url, data) {
const options = {
url: url,
method: "POST",
headers: {
Accept: "application/vnd.github+json",
Authorization: "Bearer " + GH_TOKEN,
"X-GitHub-Api-Version": "2022-11-28"
},
data: data
};
return options;
}
function patchAxiosOptions(url, data) {
const options = {
url: url,
method: "PATCH",
headers: {
Accept: "application/vnd.github+json",
Authorization: "Bearer " + GH_TOKEN,
"X-GitHub-Api-Version": "2022-11-28"
},
data: data
};
return options;
}
const GetAllGHLabels = async function (owner, repo) {
if (owner === undefined || repo === undefined || GH_TOKEN === undefined) {
console.log(GhnotconfireguredMsg);
return [];
}
const options = getAxiosOptions(
`https://api.github.com/repos/${owner}/${repo}/labels?per_page=1000`
);
let labels = [];
try {
const response = await axios.request(options);
labels = response.data.map((label) => label.name);
} catch (error) {
console.log(error.response?.data);
return [];
}
return labels;
};
function generateRandomColor() {
var randomColor = Math.floor(Math.random() * 16777215).toString(16);
return randomColor;
//random color will be freshly served
}
const CreateGHLabel = async function (owner, repo, label, description, color) {
if (owner === undefined || repo === undefined || GH_TOKEN === undefined) {
console.log(GhnotconfireguredMsg);
return null;
}
if (color === undefined) {
color = generateRandomColor();
}
const options = postAxiosOptions(`https://api.github.com/repos/${owner}/${repo}/labels`, {
name: label,
color: color,
description: description
});
try {
const response = await axios.request(options);
return response.data;
} catch (error) {
console.log(error.response.data);
return null;
}
};
const GetStartTimeFromBody = function (text) {
const pattern = /\[start_datetime:(\d+)\]/;
const matches = pattern.exec(text);
if (matches) {
const timestamp = matches[1];
return parseInt(timestamp);
}
return null;
};
const GetEndTimeFromBody = function (text) {
const pattern = /\[end_datetime:(\d+)\]/;
const matches = pattern.exec(text);
if (matches) {
const timestamp = matches[1];
return parseInt(timestamp);
}
return null;
};
const GetIncidentByNumber = async function (githubConfig, incidentNumber) {
if (
githubConfig.owner === undefined ||
githubConfig.repo === undefined ||
GH_TOKEN === undefined
) {
console.log(GhnotconfireguredMsg);
return null;
}
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;
const options = getAxiosOptions(url);
try {
const response = await axios.request(options);
return response.data;
} catch (error) {
console.log(error.message, options, url);
return null;
}
};
const GetIncidents = async function (tagName, githubConfig, state = "all") {
if (
githubConfig.owner === undefined ||
githubConfig.repo === undefined ||
GH_TOKEN === undefined
) {
console.log(GhnotconfireguredMsg);
return [];
}
if (tagName === undefined) {
return [];
}
const since = GetMinuteStartNowTimestampUTC() - githubConfig.incidentSince * 60 * 60;
const sinceISO = new Date(since * 1000).toISOString();
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues?state=${state}&labels=${tagName},incident&sort=created&direction=desc&since=${sinceISO}`;
const options = getAxiosOptions(url);
try {
const response = await axios.request(options);
let issues = response.data;
//issues.createAt should be after sinceISO
issues = issues.filter((issue) => {
return new Date(issue.created_at) >= new Date(sinceISO);
});
return issues;
} catch (error) {
console.log(error.response?.data);
return [];
}
};
const GetOpenIncidents = async function (githubConfig) {
if (
githubConfig.owner === undefined ||
githubConfig.repo === undefined ||
GH_TOKEN === undefined
) {
console.log(GhnotconfireguredMsg);
return [];
}
const since = GetMinuteStartNowTimestampUTC() - githubConfig.incidentSince * 60 * 60;
const sinceISO = new Date(since * 1000).toISOString();
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues?state=open&labels=incident&sort=created&direction=desc&since=${sinceISO}`;
const options = getAxiosOptions(url);
try {
const response = await axios.request(options);
let issues = response.data;
//issues.createAt should be after sinceISO
issues = issues.filter((issue) => {
return new Date(issue.created_at) >= new Date(sinceISO);
});
return issues;
} catch (error) {
console.log(error.response?.data);
return [];
}
};
function FilterAndInsertMonitorInIncident(openIncidentsReduced, monitorsActive) {
let openIncidentExploded = [];
for (let i = 0; i < openIncidentsReduced.length; i++) {
for (let j = 0; j < monitorsActive.length; j++) {
if (openIncidentsReduced[i].labels.includes(monitorsActive[j].tag)) {
let incident = JSON.parse(JSON.stringify(openIncidentsReduced[i]));
incident.monitor = {
name: monitorsActive[j].name,
tag: monitorsActive[j].tag,
image: monitorsActive[j].image,
description: monitorsActive[j].description
};
openIncidentExploded.push(incident);
}
}
}
return openIncidentExploded;
}
function Mapper(issue) {
const html = marked.parse(issue.body);
//convert issue.created_at from iso to timestamp UTC minutes
const issueCreatedAt = new Date(issue.created_at);
const issueCreatedAtTimestamp = issueCreatedAt.getTime() / 1000;
//convert issue.closed_at from iso to timestamp UTC minutes
let issueClosedAtTimestamp = null;
if (issue.closed_at !== null) {
const issueClosedAt = new Date(issue.closed_at);
issueClosedAtTimestamp = issueClosedAt.getTime() / 1000;
}
let labels = issue.labels.map(function (label) {
return label.name;
});
//find and add monitors tag in labels
let res = {
title: issue.title,
incident_start_time: GetStartTimeFromBody(issue.body) || issueCreatedAtTimestamp,
incident_end_time: GetEndTimeFromBody(issue.body) || issueClosedAtTimestamp,
number: issue.number,
body: html,
created_at: issue.created_at,
updated_at: issue.updated_at,
collapsed: true,
// @ts-ignore
state: issue.state,
closed_at: issue.closed_at,
// @ts-ignore
labels: labels,
html_url: issue.html_url,
comments: []
};
return res;
}
async function GetCommentsForIssue(issueID, githubConfig) {
if (
githubConfig.owner === undefined ||
githubConfig.repo === undefined ||
GH_TOKEN === undefined
) {
console.log(GhnotconfireguredMsg);
return [];
}
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${issueID}/comments`;
try {
const response = await axios.request(getAxiosOptions(url));
return response.data;
} catch (error) {
console.log(error.response.data);
return [];
}
}
async function CreateIssue(githubConfig, issueTitle, issueBody, issueLabels) {
if (
githubConfig.owner === undefined ||
githubConfig.repo === undefined ||
GH_TOKEN === undefined
) {
console.log(GhnotconfireguredMsg);
return null;
}
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues`;
try {
const payload = {
title: issueTitle,
body: issueBody,
labels: issueLabels
};
const response = await axios.request(postAxiosOptions(url, payload));
return response.data;
} catch (error) {
console.log(error.response.data);
return null;
}
}
async function UpdateIssue(
githubConfig,
incidentNumber,
issueTitle,
issueBody,
issueLabels,
state = "open"
) {
if (
githubConfig.owner === undefined ||
githubConfig.repo === undefined ||
GH_TOKEN === undefined
) {
console.log(GhnotconfireguredMsg);
return null;
}
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;
try {
const payload = {
title: issueTitle,
body: issueBody,
labels: issueLabels,
state: state
};
const response = await axios.request(patchAxiosOptions(url, payload));
return response.data;
} catch (error) {
console.log(error.response.data);
return null;
}
}
async function CloseIssue(githubConfig, incidentNumber) {
if (
githubConfig.owner === undefined ||
githubConfig.repo === undefined ||
GH_TOKEN === undefined
) {
console.log(GhnotconfireguredMsg);
return null;
}
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;
try {
const payload = {
state: "closed"
};
const response = await axios.request(patchAxiosOptions(url, payload));
return response.data;
} catch (error) {
console.log(error.response.data);
return null;
}
}
async function AddComment(githubConfig, incidentNumber, commentBody) {
if (
githubConfig.owner === undefined ||
githubConfig.repo === undefined ||
GH_TOKEN === undefined
) {
console.log(GhnotconfireguredMsg);
return null;
}
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}/comments`;
try {
const payload = {
body: commentBody
};
const response = await axios.request(postAxiosOptions(url, payload));
return response.data;
} catch (error) {
console.log(error.response.data);
return null;
}
}
//update issue labels
async function UpdateIssueLabels(githubConfig, incidentNumber, issueLabels, body, state = "open") {
if (
githubConfig.owner === undefined ||
githubConfig.repo === undefined ||
GH_TOKEN === undefined
) {
console.log(GhnotconfireguredMsg);
return null;
}
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;
try {
const payload = {
labels: issueLabels,
body: body,
state: state
};
const response = await axios.request(patchAxiosOptions(url, payload));
return response.data;
} catch (error) {
console.log(error.response.data);
return null;
}
}
//search issue
async function SearchIssue(query, page, per_page) {
if (GH_TOKEN === undefined) {
console.log(GhnotconfireguredMsg);
return null;
}
const searchQuery = query
.filter(function (q) {
if (q == "" || q === undefined || q === null) {
return false;
}
const qs = q.split(":");
if (qs.length < 2) {
return false;
}
if (qs[1] === "" || qs[1] === undefined || qs[1] === null) {
return false;
}
return true;
})
.join(" ");
const url = `https://api.github.com/search/issues?q=${encodeURIComponent(
searchQuery
)}&per_page=${per_page}&page=${page}`;
try {
const response = await axios.request(getAxiosOptions(url));
return response.data;
} catch (error) {
console.log(error.response.data);
return [];
}
}
export {
GetAllGHLabels,
CreateGHLabel,
GetIncidents,
GetStartTimeFromBody,
GetEndTimeFromBody,
GetCommentsForIssue,
Mapper,
CreateIssue,
AddComment,
GetIncidentByNumber,
UpdateIssueLabels,
UpdateIssue,
CloseIssue,
GetOpenIncidents,
FilterAndInsertMonitorInIncident,
SearchIssue
};
-155
View File
@@ -1,155 +0,0 @@
import fs from "fs-extra";
import { GetMinuteStartNowTimestampUTC, BeginningOfDay } from "./tool.js";
import { StatusObj, ParseUptime } from "../src/lib/helpers.js";
function getDayMessage(type, numOfMinute) {
if (numOfMinute > 59) {
let hour = Math.floor(numOfMinute / 60);
let minute = numOfMinute % 60;
return `${type} for ${hour}h:${minute}m`;
} else {
return `${type} for ${numOfMinute} minute${numOfMinute > 1 ? "s" : ""}`;
}
}
const NO_DATA = "No Data";
function getDayData(day0, startTime, endTime, dayDownMinimumCount, dayDegradedMinimumCount) {
let dayData = {
UP: 0,
DEGRADED: 0,
DOWN: 0,
timestamp: startTime,
cssClass: StatusObj.NO_DATA,
message: NO_DATA
};
//loop through the ts range
for (let i = startTime; i <= endTime; i += 60) {
//if the ts is in the day0 then add up, down degraded data, if not initialize it
if (day0[i] === undefined) {
continue;
}
if (day0[i].status == "UP") {
dayData.UP++;
} else if (day0[i].status == "DEGRADED") {
dayData.DEGRADED++;
} else if (day0[i].status == "DOWN") {
dayData.DOWN++;
}
}
let cssClass = StatusObj.UP;
let message = "Status OK";
if (dayData.DEGRADED >= dayDegradedMinimumCount) {
cssClass = StatusObj.DEGRADED;
message = getDayMessage("DEGRADED", dayData.DEGRADED);
}
if (dayData.DOWN >= dayDownMinimumCount) {
cssClass = StatusObj.DOWN;
message = getDayMessage("DOWN", dayData.DOWN);
}
if (
dayData.DEGRADED + dayData.DOWN + dayData.UP >=
Math.min(dayDownMinimumCount, dayDegradedMinimumCount)
) {
dayData.message = message;
dayData.cssClass = cssClass;
}
return dayData;
}
const Ninety = async (monitor) => {
let _0Day = {};
let _90Day = {};
let uptime0Day = "0";
let dailyUps = 0;
let dailyDown = 0;
let dailyDegraded = 0;
let completeUps = 0;
let completeDown = 0;
let completeDegraded = 0;
const secondsInDay = 24 * 60 * 60;
const now = GetMinuteStartNowTimestampUTC();
const midnight = BeginningOfDay({ timeZone: "GMT" });
const midnight90DaysAgo = midnight - 90 * 24 * 60 * 60;
const midnightTomorrow = midnight + secondsInDay;
for (let i = midnight; i <= now; i += 60) {
_0Day[i] = {
timestamp: i,
status: "NO_DATA",
cssClass: StatusObj.NO_DATA,
index: (i - midnight) / 60
};
}
let day0 = JSON.parse(fs.readFileSync(monitor.path0Day, "utf8"));
for (const timestamp in day0) {
const element = day0[timestamp];
let status = element.status;
if (status == "UP") {
completeUps++;
} else if (status == "DEGRADED") {
completeDegraded++;
} else if (status == "DOWN") {
completeDown++;
}
//0 Day data
if (_0Day[timestamp] !== undefined) {
_0Day[timestamp].status = status;
_0Day[timestamp].cssClass = StatusObj[status];
dailyUps = status == "UP" ? dailyUps + 1 : dailyUps;
dailyDown = status == "DOWN" ? dailyDown + 1 : dailyDown;
dailyDegraded = status == "DEGRADED" ? dailyDegraded + 1 : dailyDegraded;
}
}
for (let i = midnight90DaysAgo; i < midnightTomorrow; i += secondsInDay) {
_90Day[i] = getDayData(
day0,
i,
i + secondsInDay - 1,
monitor.dayDownMinimumCount,
monitor.dayDegradedMinimumCount
);
}
for (const key in _90Day) {
const element = _90Day[key];
delete _90Day[key].UP;
delete _90Day[key].DEGRADED;
delete _90Day[key].DOWN;
if (element.message == NO_DATA) continue;
}
let uptime0DayNumerator = dailyUps + dailyDegraded;
let uptime0DayDenominator = dailyUps + dailyDown + dailyDegraded;
let uptime90DayNumerator = completeUps + completeDegraded;
let uptime90DayDenominator = completeUps + completeDown + completeDegraded;
if (monitor.includeDegradedInDowntime === true) {
uptime0DayNumerator = dailyUps;
uptime90DayNumerator = completeUps;
}
uptime0Day = ParseUptime(uptime0DayNumerator, uptime0DayDenominator);
const dataToWrite = {
_90Day: _90Day,
uptime0Day,
uptime90Day: ParseUptime(uptime90DayNumerator, uptime90DayDenominator),
dailyUps,
dailyDown,
dailyDegraded
};
await fs.writeJson(monitor.path90Day, dataToWrite);
return true;
};
export { Ninety };
-45
View File
@@ -1,45 +0,0 @@
//read from process.env.PUBLIC_KENER_FOLDER / site.json
//read from process.env.PUBLIC_KENER_FOLDER / monitors.json
// create sitemap.xml
import fs from "fs-extra";
let siteMap = "";
import dotenv from "dotenv";
dotenv.config();
const site = JSON.parse(fs.readFileSync(process.env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
const monitors = JSON.parse(
fs.readFileSync(process.env.PUBLIC_KENER_FOLDER + "/monitors.json", "utf8")
);
if (site.siteURL !== undefined && site.siteURL !== null && site.siteURL !== "") {
if (monitors.length > 0) {
siteMap = `<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="https://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.sitemaps.org/schemas/sitemap/0.9
https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
${monitors
.map((monitor) => {
return `<url>
<loc>${site.siteURL}/incident/${monitor.folderName}</loc>
<lastmod>${new Date().toISOString()}</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>`;
})
.join("\n")}
${monitors
.map((monitor) => {
return `<url>
<loc>${site.siteURL}/monitor-${encodeURIComponent(monitor.tag)}</loc>
<lastmod>${new Date().toISOString()}</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>`;
})
.join("\n")}
</urlset>`;
}
}
//export default siteMap
export default siteMap;
-396
View File
@@ -1,396 +0,0 @@
/*
The startup js script will
check if monitors.yaml exists
if it does, it will read the file and parse it into a json array of objects
each objects will have a name, url, method: required
name of each of these objects need to be unique
*/
import * as dotenv from "dotenv";
import fs from "fs-extra";
import yaml from "js-yaml";
import { Cron } from "croner";
import { FOLDER, FOLDER_MONITOR, FOLDER_SITE, API_TIMEOUT } from "./constants.js";
import {
IsValidURL,
IsValidHTTPMethod,
LoadMonitorsPath,
LoadSitePath,
ValidateIpAddress
} from "./tool.js";
import { GetAllGHLabels, CreateGHLabel } from "./github.js";
import { Minuter } from "./cron-minute.js";
import axios from "axios";
import { Ninety } from "./ninety.js";
let monitors = [];
let site = {};
const envSecrets = [];
const defaultEval = `(function (statusCode, responseTime, responseData) {
let statusCodeShort = Math.floor(statusCode/100);
if(statusCode == 429 || (statusCodeShort >=2 && statusCodeShort <= 3)) {
return {
status: 'UP',
latency: responseTime,
}
}
return {
status: 'DOWN',
latency: responseTime,
}
})`;
function checkIfDuplicateExists(arr) {
return new Set(arr).size !== arr.length;
}
function getWordsStartingWithDollar(text) {
const regex = /\$\w+/g;
const wordsArray = text.match(regex);
return wordsArray || [];
}
if (!fs.existsSync(FOLDER)) {
fs.mkdirSync(FOLDER);
console.log(".kener folder created successfully!");
}
const Startup = async () => {
try {
const fileContent = fs.readFileSync(LoadMonitorsPath(), "utf8");
site = yaml.load(fs.readFileSync(LoadSitePath(), "utf8"));
monitors = yaml.load(fileContent);
} catch (error) {
console.log(error);
process.exit(1);
}
// Use the 'monitors' array of JSON objects as needed
//check if each object has name, url, method
//if not, exit with error
//if yes, check if name is unique
for (let i = 0; i < monitors.length; i++) {
const monitor = monitors[i];
let name = monitor.name;
let tag = monitor.tag;
let hasAPI = monitor.api !== undefined && monitor.api !== null;
let hasPing = monitor.ping !== undefined && monitor.ping !== null;
let folderName = name.replace(/[^a-z0-9]/gi, "-").toLowerCase();
monitors[i].folderName = folderName;
if (!name || !tag) {
console.log("name, tag are required");
process.exit(1);
}
if (
monitor.dayDegradedMinimumCount &&
(isNaN(monitor.dayDegradedMinimumCount) || monitor.dayDegradedMinimumCount < 1)
) {
console.log("dayDegradedMinimumCount is not a number or it is less than 1");
process.exit(1);
} else if (monitor.dayDegradedMinimumCount === undefined) {
monitors[i].dayDegradedMinimumCount = 1;
}
if (
monitor.dayDownMinimumCount &&
(isNaN(monitor.dayDownMinimumCount) || monitor.dayDownMinimumCount < 1)
) {
console.log("dayDownMinimumCount is not a number or it is less than 1");
process.exit(1);
} else if (monitor.dayDownMinimumCount === undefined) {
monitors[i].dayDownMinimumCount = 1;
}
if (
monitor.includeDegradedInDowntime === undefined ||
monitor.includeDegradedInDowntime !== true
) {
monitors[i].includeDegradedInDowntime = false;
}
if (hasPing) {
let hostsV4 = monitor.ping.hostsV4;
let hostsV6 = monitor.ping.hostsV6;
let hasV4 = false;
let hasV6 = false;
if (hostsV4 && Array.isArray(hostsV4) && hostsV4.length > 0) {
hostsV4.forEach((host) => {
if (ValidateIpAddress(host) == "Invalid") {
console.log(`hostsV4 ${host} is not valid`);
process.exit(1);
}
});
hasV4 = true;
}
if (hostsV6 && Array.isArray(hostsV6) && hostsV6.length > 0) {
hostsV6.forEach((host) => {
if (ValidateIpAddress(host) == "Invalid") {
console.log(`hostsV6 ${host} is not valid`);
process.exit(1);
}
});
hasV6 = true;
}
if (!hasV4 && !hasV6) {
console.log("hostsV4 or hostsV6 is required");
process.exit(1);
}
monitors[i].hasPing = true;
}
if (hasAPI) {
let url = monitor.api.url;
let method = monitor.api.method;
let headers = monitor.api.headers;
let evaluator = monitor.api.eval;
let body = monitor.api.body;
let timeout = monitor.api.timeout;
//url
if (!!url) {
if (!IsValidURL(url)) {
console.log("url is not valid");
process.exit(1);
}
}
if (!!method) {
if (!IsValidHTTPMethod(method)) {
console.log("method is not valid");
process.exit(1);
}
method = method.toUpperCase();
} else {
method = "GET";
}
monitors[i].api.method = method;
//headers
if (headers === undefined || headers === null) {
monitors[i].api.headers = undefined;
} else {
//check if headers is a valid json
try {
JSON.parse(JSON.stringify(headers));
} catch (error) {
console.log("headers are not valid. Quiting");
process.exit(1);
}
}
//eval
if (evaluator === undefined || evaluator === null) {
monitors[i].api.eval = defaultEval;
} else {
let evalResp = eval(evaluator + `(200, 1000, "e30=")`);
if (
evalResp === undefined ||
evalResp === null ||
evalResp.status === undefined ||
evalResp.status === null ||
evalResp.latency === undefined ||
evalResp.latency === null
) {
console.log("eval is not valid ");
process.exit(1);
}
monitors[i].api.eval = evaluator;
}
//body
if (body === undefined || body === null) {
monitors[i].api.body = undefined;
} else {
//check if body is a valid string
if (typeof body !== "string") {
console.log("body is not valid should be a string");
process.exit(1);
}
}
//timeout
if (timeout === undefined || timeout === null) {
monitors[i].api.timeout = API_TIMEOUT;
} else {
//check if timeout is a valid number
if (isNaN(timeout) || timeout < 0) {
console.log("timeout is not valid ");
process.exit(1);
}
}
//add a description to the monitor if it is website using api.url and method = GET and headers == undefined
//call the it to see if recevied content-type is text/html
//if yes, append to description
if (
(headers === undefined || headers === null) &&
url !== undefined &&
method === "GET"
) {
try {
const response = await axios({
method: "GET",
url: url,
timeout: API_TIMEOUT
});
if (response.headers["content-type"].includes("text/html")) {
let link = `<a href="${url}" class="font-medium underline underline-offset-4" target="_blank">${url}</a>`;
if (monitors[i].description === undefined) {
monitors[i].description = link;
} else {
monitors[i].description = monitors[i].description?.trim() + " " + link;
}
}
} catch (error) {
console.log(error);
}
}
}
monitors[i].path0Day = `${FOLDER}/${folderName}.0day.utc.json`;
monitors[i].path90Day = `${FOLDER}/${folderName}.90day.utc.json`;
monitors[i].hasAPI = hasAPI;
//secrets can be in url/body/headers
//match in monitor.url if a words starts with $, get the word
const requiredSecrets = getWordsStartingWithDollar(
`${monitor.url} ${monitor.body} ${JSON.stringify(monitor.headers)}`
).map((x) => x.substr(1));
//iterate over process.env
for (const [key, value] of Object.entries(process.env)) {
if (requiredSecrets.indexOf(key) !== -1) {
envSecrets.push({
find: `$${key}`,
replace: value
});
}
}
}
if (
site.github === undefined ||
site.github.owner === undefined ||
site.github.repo === undefined
) {
console.log("github owner and repo are required");
process.exit(1);
}
if (site.github.incidentSince === undefined || site.github.incidentSince === null) {
site.github.incidentSince = 48;
}
if (checkIfDuplicateExists(monitors.map((monitor) => monitor.folderName)) === true) {
console.log("duplicate monitor detected");
process.exit(1);
}
if (checkIfDuplicateExists(monitors.map((monitor) => monitor.tag)) === true) {
console.log("duplicate tag detected");
process.exit(1);
}
fs.ensureFileSync(FOLDER_MONITOR);
fs.ensureFileSync(FOLDER_SITE);
try {
fs.writeFileSync(FOLDER_MONITOR, JSON.stringify(monitors, null, 4));
fs.writeFileSync(FOLDER_SITE, JSON.stringify(site, null, 4));
} catch (error) {
console.log(error);
process.exit(1);
}
if (!!site.github && !!site.github.owner && !!site.github.repo) {
const ghowner = site.github.owner;
const ghrepo = site.github.repo;
const ghlabels = await GetAllGHLabels(ghowner, ghrepo);
const tagsAndDescription = monitors.map((monitor) => {
return { tag: monitor.tag, description: monitor.name };
});
//add incident label if does not exist
if (ghlabels.indexOf("incident") === -1) {
await CreateGHLabel(ghowner, ghrepo, "incident", "Status of the site");
}
if (ghlabels.indexOf("resolved") === -1) {
await CreateGHLabel(ghowner, ghrepo, "resolved", "Incident is resolved", "65dba6");
}
if (ghlabels.indexOf("identified") === -1) {
await CreateGHLabel(ghowner, ghrepo, "identified", "Incident is Identified", "EBE3D5");
}
if (ghlabels.indexOf("investigating") === -1) {
await CreateGHLabel(
ghowner,
ghrepo,
"investigating",
"Incident is investigated",
"D4E2D4"
);
}
if (ghlabels.indexOf("incident-degraded") === -1) {
await CreateGHLabel(
ghowner,
ghrepo,
"incident-degraded",
"Status is degraded of the site",
"f5ba60"
);
}
if (ghlabels.indexOf("incident-down") === -1) {
await CreateGHLabel(
ghowner,
ghrepo,
"incident-down",
"Status is down of the site",
"ea3462"
);
}
//add tags if does not exist
for (let i = 0; i < tagsAndDescription.length; i++) {
const tag = tagsAndDescription[i].tag;
const description = tagsAndDescription[i].description;
if (ghlabels.indexOf(tag) === -1) {
await CreateGHLabel(ghowner, ghrepo, tag, description);
}
}
}
// init monitors
for (let i = 0; i < monitors.length; i++) {
const monitor = monitors[i];
if (!fs.existsSync(monitor.path0Day)) {
fs.ensureFileSync(monitor.path0Day);
fs.writeFileSync(monitor.path0Day, JSON.stringify({}));
}
if (!fs.existsSync(monitor.path90Day)) {
fs.ensureFileSync(monitor.path90Day);
fs.writeFileSync(monitor.path90Day, JSON.stringify({}));
}
console.log("Initial Fetch for ", monitor.name);
await Minuter(envSecrets, monitor, site.github);
await Ninety(monitor);
}
//trigger minute cron
for (let i = 0; i < monitors.length; i++) {
const monitor = monitors[i];
let cronExpession = "* * * * *";
if (monitor.cron !== undefined && monitor.cron !== null) {
cronExpession = monitor.cron;
}
console.log("Staring " + cronExpession + " Cron for ", monitor.name);
Cron(cronExpession, async () => {
await Minuter(envSecrets, monitor, site.github);
});
}
//pre compute 90 day data at 1 minute interval
Cron(
"* * * * *",
async () => {
for (let i = 0; i < monitors.length; i++) {
const monitor = monitors[i];
Ninety(monitor);
}
},
{
protect: true
}
);
};
export { Startup };
-12
View File
@@ -1,12 +0,0 @@
import { GetMinuteStartNowTimestampUTC, GetDayStartWithOffset, BeginningOfDay } from "./tool.js";
let tzOffset = -330;
let ts = GetMinuteStartNowTimestampUTC();
console.log("GetMinuteStartNowTimestampUTC India 12AM: " + ts);
let tm = GetDayStartWithOffset(GetMinuteStartNowTimestampUTC(), tzOffset);
console.log("GetMinuteStartTimestampUTC India 12AM: should be 18:30PM " + tm);
console.log(
`getUTCTimestampAtStartOfDayForOffset(${GetMinuteStartNowTimestampUTC()}, ${tzOffset})`
);
console.log(BeginningOfDay({ timeZone: "GMT" }));
console.log(BeginningOfDay({ timeZone: "Asia/Kolkata", date: new Date(1703223388000) }));
-182
View File
@@ -1,182 +0,0 @@
// @ts-nocheck
import { MONITOR, SITE } from "./constants.js";
import dotenv from "dotenv";
dotenv.config();
const IsValidURL = function (url) {
return /^(http|https):\/\/[^ "]+$/.test(url);
};
const IsStringURLSafe = function (str) {
const regex = /^[A-Za-z0-9\-_.~]+$/;
return regex.test(str);
};
const IsValidHTTPMethod = function (method) {
return /^(GET|POST|PUT|DELETE|HEAD|OPTIONS|PATCH)$/.test(method);
};
function generateRandomColor() {
var randomColor = Math.floor(Math.random() * 16777215).toString(16);
return randomColor;
//random color will be freshly served
}
const LoadMonitorsPath = function () {
const argv = process.argv;
if (!!process.env.MONITOR_YAML_PATH) {
return process.env.MONITOR_YAML_PATH;
}
for (let i = 0; i < argv.length; i++) {
const arg = argv[i];
if (arg === "--monitors") {
return argv[i + 1];
}
}
return MONITOR;
};
const LoadSitePath = function () {
const argv = process.argv;
if (!!process.env.SITE_YAML_PATH) {
return process.env.SITE_YAML_PATH;
}
for (let i = 0; i < argv.length; i++) {
const arg = argv[i];
if (arg === "--site") {
return argv[i + 1];
}
}
return SITE;
};
//return given timestamp in UTC
const GetNowTimestampUTC = function () {
//use js date instead of moment
const now = new Date();
const timestamp = now.getTime();
return Math.floor(timestamp / 1000);
};
//return given timestamp minute start timestamp in UTC
const GetMinuteStartTimestampUTC = function (timestamp) {
//use js date instead of moment
const now = new Date(timestamp * 1000);
const minuteStart = new Date(
now.getFullYear(),
now.getMonth(),
now.getDate(),
now.getHours(),
now.getMinutes(),
0,
0
);
const minuteStartTimestamp = minuteStart.getTime();
return Math.floor(minuteStartTimestamp / 1000);
};
//return current timestamp minute start timestamp in UTC
const GetMinuteStartNowTimestampUTC = function () {
//use js date instead of moment
const now = new Date();
const minuteStart = new Date(
now.getFullYear(),
now.getMonth(),
now.getDate(),
now.getHours(),
now.getMinutes(),
0,
0
);
const minuteStartTimestamp = minuteStart.getTime();
return Math.floor(minuteStartTimestamp / 1000);
};
//return given timestamp day start timestamp in UTC
const GetDayStartTimestampUTC = function (timestamp) {
//use js date instead of moment
const now = new Date(timestamp * 1000);
const dayStart = new Date(
Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0, 0)
);
const dayStartTimestamp = dayStart.getTime();
return Math.floor(dayStartTimestamp / 1000);
};
const GetDayEndTimestampUTC = function (timestamp) {
//use js date instead of moment
const now = new Date(timestamp * 1000);
const dayEnd = new Date(
Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999)
);
const dayEndTimestamp = dayEnd.getTime();
return Math.floor(dayEndTimestamp / 1000) + 60;
};
const DurationInMinutes = function (start, end) {
return Math.floor((end - start) / 60);
};
const GetDayStartWithOffset = function (timeStampInSeconds, offsetInMinutes) {
const then = new Date(GetMinuteStartTimestampUTC(timeStampInSeconds) * 1000);
let dayStartThen = GetDayStartTimestampUTC(then.getTime() / 1000);
let dayStartTomorrow = dayStartThen + 24 * 60 * 60;
let dayStartYesterday = dayStartThen - 24 * 60 * 60;
//have to figure out when to add a day
//20-12AM [21-12AM] =21:630 xtm [22-12AM] xtd =22:630 23-12AM
//if xtm - 330 > 1 day , add a day to xtm - 330
if (offsetInMinutes < 0) {
//add one day to dayStartThen
dayStartThen = dayStartThen + 24 * 60 * 60;
}
return dayStartThen + offsetInMinutes * 60;
};
const BeginningOfDay = (options = {}) => {
const { date = new Date(), timeZone } = options;
const parts = Intl.DateTimeFormat("en-US", {
timeZone,
hourCycle: "h23",
hour: "numeric",
minute: "numeric",
second: "numeric"
}).formatToParts(date);
const hour = parseInt(parts.find((i) => i.type === "hour").value);
const minute = parseInt(parts.find((i) => i.type === "minute").value);
const second = parseInt(parts.find((i) => i.type === "second").value);
const dt = new Date(
1000 * Math.floor((date - hour * 3600000 - minute * 60000 - second * 1000) / 1000)
);
return dt.getTime() / 1000;
};
const ValidateIpAddress = function (input) {
// Check if input is a valid IPv4 address
const ipv4Regex = /^(\d{1,3}\.){3}\d{1,3}$/;
if (ipv4Regex.test(input)) {
return "IPv4";
}
// Check if input is a valid IPv6 address
const ipv6Regex = /^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/;
if (ipv6Regex.test(input)) {
return "IPv6";
}
// Check if input is a valid domain name
const domainRegex = /^[a-zA-Z0-9]+([\-\.]{1}[a-zA-Z0-9]+)*\.[a-zA-Z]{2,}$/;
if (domainRegex.test(input)) {
return "Domain Name";
}
// If none of the above conditions match, the input is invalid
return "Invalid";
};
export {
IsValidURL,
IsValidHTTPMethod,
LoadMonitorsPath,
LoadSitePath,
GetMinuteStartTimestampUTC,
GetNowTimestampUTC,
GetDayStartTimestampUTC,
GetMinuteStartNowTimestampUTC,
DurationInMinutes,
GetDayStartWithOffset,
BeginningOfDay,
IsStringURLSafe,
ValidateIpAddress
};
+32
View File
@@ -0,0 +1,32 @@
import monitorSeed from "../src/lib/server/db/seedMonitorData.js";
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
export async function seed(knex) {
// Check if the table is empty
const count = await knex("monitors").count("id as CNT").first();
if (count.CNT == 0) {
// Deletes ALL existing entries
for (const monitor of monitorSeed) {
await knex("monitors").insert({
tag: monitor.tag,
name: monitor.name,
description: monitor.description,
image: monitor.image,
cron: monitor.cron,
default_status: monitor.default_status,
status: monitor.status,
category_name: monitor.category_name,
monitor_type: monitor.monitor_type,
type_data: monitor.type_data,
day_degraded_minimum_count: monitor.day_degraded_minimum_count,
day_down_minimum_count: monitor.day_down_minimum_count,
include_degraded_in_downtime: monitor.include_degraded_in_downtime,
created_at: knex.fn.now(),
updated_at: knex.fn.now()
});
}
}
}
+24
View File
@@ -0,0 +1,24 @@
import seedSiteData from "../src/lib/server/db/seedSiteData.js";
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
export async function seed(knex) {
// Check if the table is empty
const count = await knex("site_data").count("id as CNT").first();
for (const key in seedSiteData) {
if (Object.prototype.hasOwnProperty.call(seedSiteData, key)) {
let value = seedSiteData[key];
let data_type = typeof value;
if (data_type === "object") {
value = JSON.stringify(value);
}
const existingEntry = await knex("site_data").where({ key: key }).first();
if (!existingEntry) {
await knex("site_data").insert([{ key: key, value: value, data_type: data_type }]);
}
}
}
}

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