Skip to content

Commit

Permalink
docs: updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Raj Nandan Sharma authored and Raj Nandan Sharma committed Nov 14, 2024
1 parent e1fe07c commit e45b016
Show file tree
Hide file tree
Showing 14 changed files with 185 additions and 74 deletions.
19 changes: 19 additions & 0 deletions config/monitors.example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- name: OkBookmarks
description: A free bookmark manager that lets you save and search your bookmarks in the cloud.
tag: "frogment"
image: "https://okbookmarks.com/assets/img/extension_icon128.png"
api:
method: GET
url: https://okbookmarks.com
- 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 changes: 44 additions & 0 deletions config/site.example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
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
35 changes: 20 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
version: '3.7'
services:
kener:
build:
context: .
dockerfile: Dockerfile
container_name: kener
env_file: .env
image: rajnandan1/kener:release-candidate-0.0.16 # assuming this is final namespace/image
container_name: kener-rc
#env_file: .env #uncomment this, if you are using .env file
environment:
- TZ=Etc/GMT
- PUID=911
- PGID=911
#- GH_TOKEN=
#- API_TOKEN=
#- API_IP=
#- API_IP_REGEX=
#- KENER_BASE_PATH=

# 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
ports:
- "3001:3001"
- '3000:3000/tcp'
volumes:
- ./database:/app/database:rw
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:3001"]
interval: 30s
timeout: 30s
retries: 3
- './database:/app/database:rw'
- './config:/app/config'
64 changes: 40 additions & 24 deletions docs/deployment.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
# Deployment

```shell
export NODE_ENV=production
npm i
npm run build
npm run serve
```
---
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.
---

It also needs 2 yaml files to work
# Deployment

- site.yaml: Contains information about the site
- monitors.yaml: Contains your monitors and their related specifications
Kener can be deployed in multiple ways. You can use the pre-built docker image or build from source.

By default these are present in `config/`. However you can use different location either passing them as argument or having the path as enviorment variable
## Prerequisites

## Add as Environment variables
Make sure you have the following installed:

```shell
export MONITOR_YAML_PATH=/your/path/monitors.yaml
export SITE_YAML_PATH=/your/path/site.yaml
```
- [Node.js](https://nodejs.org/en/download/)
- [npm](https://www.npmjs.com/get-npm)
- [config/site.yaml](/docs/customize-site) Contains information about the site
- [config/monitors.yaml](/docs/monitors) Contains your monitors and their related specifications
- [Set up Environment Variables](/docs/environment-vars)

## Add as argument to prod.js
## Source

```shell
npm run serve -- --monitors /your/path/monitors.yaml --site /your/path/site.yaml
npm i
npm run build
npm run prod
```

## Install using Docker
## Docker

[Dockerhub](https://hub.docker.com/r/rajnandan1/kener)

Expand All @@ -41,12 +39,26 @@ docker.io/rajnandan1/kener:latest
ghcr.io/rajnandan1/kener:latest
```

You should mount a host directory to persist your configuration and expose the web port. [Environmental variables](https://rajnandan1.github.io/kener-docs/docs/environment-vars) can be passed with `-e` An example `docker run` command:
You should mount two host directories to persist your configuration and database. [Environmental variables](https://rajnandan1.github.io/kener-docs/docs/environment-vars) can be passed with `-e` An example `docker run` command:

```shell
docker run \
-v $(pwd)/database:/app/database \
-v $(pwd)/config:/app/config \
-p 3000:3000 \
-e "GH_TOKEN=1234" \
rajnandan1/kener
```

Make sure you have a `/static` folder inside your config folder
You can also use a .env file

```shell
docker run -d -v /path/on/host/config:/config -p 3000:3000 -e "GH_TOKEN=1234" rajnandan1/kener
docker run \
-v $(pwd)/database:/app/database \
-v $(pwd)/config:/app/config \
--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)
Expand All @@ -71,4 +83,8 @@ Then add to your docker command like so:
docker run -d ... -e "PUID=1000" -e "PGID=1000" ... rajnandan1/kener
```

or substitute them in [docker-compose.yml](https://raw.githubusercontent.com/rajnandan1/kener/main/docker-compose.yml)
or substitute them in [docker-compose.yml](https://raw.githubusercontent.com/rajnandan1/kener/main/docker-compose.yml)

## 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)
13 changes: 13 additions & 0 deletions docs/environment-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,16 @@ By default kener runs on `/` but you can change it to `/status` or any other pat
```shell
export KENER_BASE_PATH=/status
```

## 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

```shell
PORT=4242
GH_TOKEN=your-github-token
API_TOKEN=sometoken
API_IP=
API_IP_REGEX=
KENER_BASE_PATH=/status
```
13 changes: 3 additions & 10 deletions docs/home.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Kener - Status Page System
# Kener - A Sveltekit NodeJS Status Page System

<p align="center">
<img src="/newbg.png" width="100%" height="auto" class="rounded-lg shadow-lg" alt="kener example illustration">
Expand All @@ -19,7 +19,7 @@

#### 👉 Visit a live server [here](https://kener.ing)

#### 👉 Quick Start [here](https://rajnandan1.github.io/kener-docs/docs/quick-start)
#### 👉 Quick Start [here](/docs/quick-start)

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.

Expand All @@ -36,7 +36,7 @@ It uses files to store the data. Other adapters are coming soon
- 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 a Default Status for Monitors. Example defaultStatus=DOWN if you don't hit API per minute with Status UP
- Supports base path for hosting in k8s
- Pre-built docker image for easy deployment

Expand Down Expand Up @@ -71,13 +71,6 @@ It uses files to store the data. Other adapters are coming soon

- [Upptime](https://upptime.js.org/)

## Roadmap

- [x] Add api to create incident
- [x] Add docker file
- [ ] Add notification
- [ ] Add Mysql adapter

## Support Me

If you are using Kener and want to support me, you can do so by sponsoring me on GitHub or buying me a coffee.
Expand Down
4 changes: 2 additions & 2 deletions docs/how-it-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Kener has two parts.

## 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
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.
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)
17 changes: 7 additions & 10 deletions docs/i18n.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 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.
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

Expand All @@ -18,22 +18,19 @@ i18n:
> **_defaultLocale:_** The default locale to be used. This will be the language used when a user visits the site for the first time. It is important to note that the default locale json file should be present in the locales folder.
## 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
> **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.

- %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
> **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.
There is no auto detection of the language. The user has to manually select the language.
4 changes: 2 additions & 2 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ npm install
- Rename `config/monitors.example.yaml` -> `config/monitors.yaml`

```shell
mv src/lib/server/config/site.example.yaml src/lib/server/config/site.yaml
mv src/lib/server/config/monitors.example.yaml src/lib/server/config/monitors.yaml
mv config/site.example.yaml config/site.yaml
mv config/monitors.example.yaml config/monitors.yaml
```

## Start Kener Development Server
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
"schedule": "node src/lib/server/startup.js",
"development": "vite dev",
"dev": "npm-run-all --parallel schedule development",
"prettify": "prettier --write ."
"prettify": "prettier --write .",
"start": "node main.js",
"prod": "npm-run-all --parallel schedule start"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0",
Expand Down
3 changes: 3 additions & 0 deletions src/docs.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
code:not([class^="language-"]) {
@apply rounded bg-gray-100 px-1.5 py-0.5 font-mono text-sm text-xs dark:bg-gray-800;
}
12 changes: 10 additions & 2 deletions src/lib/components/monitor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,11 @@
on:click={copyDotStandard}
>
{#if !copiedBadgeDotStandard}
<img src={pathMonitorBadgeDot} class="mr-1 inline h-5" />
<img
src={pathMonitorBadgeDot}
class="mr-1 inline h-5"
alt="status"
/>
<span class="font-medium">
{l(lang, "monitor.standard")}
</span>
Expand All @@ -371,7 +375,11 @@
on:click={copyDotPing}
>
{#if !copiedBadgeDotPing}
<img src={pathMonitorBadgeDotPing} class="mr-1 inline h-5" />
<img
src={pathMonitorBadgeDotPing}
class="mr-1 inline h-5"
alt="status"
/>
<span class="font-medium">
{l(lang, "monitor.pinging")}
</span>
Expand Down
1 change: 0 additions & 1 deletion src/lib/server/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ let monitors = [];
let site = {};
const envSecrets = [];
const DATABASE_PATH = "./database";
console.log(process.env);
const Startup = async () => {
const FOLDER_MONITOR_JSON = DATABASE_PATH + "/monitors.json";
const monitors = fs.readJSONSync(FOLDER_MONITOR_JSON);
Expand Down
Loading

0 comments on commit e45b016

Please sign in to comment.