Skip to content

Commit

Permalink
docs: update website document
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrailgun committed Jan 8, 2024
1 parent 0eedd7d commit 0076a3b
Show file tree
Hide file tree
Showing 24 changed files with 178 additions and 577 deletions.
2 changes: 1 addition & 1 deletion reporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type ReportData struct {
}

var (
Mode = flag.String("mode", "http", "The send mode of report data, you can select: `http` or `udp`, default is `http`")
Mode = flag.String("mode", "http", "The send mode of report data, you can select: 'http' or 'udp', default is 'http'")
Url = flag.String("url", "", "The http url of tianji, for example: https://tianji.msgbyte.com")
WorkspaceId = flag.String("workspace", "", "The workspace id for tianji, this should be a uuid")
Name = flag.String("name", "", "The identification name for this machine")
Expand Down
35 changes: 0 additions & 35 deletions website/docs/deployments/docker.md

This file was deleted.

13 changes: 13 additions & 0 deletions website/docs/environment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
sidebar_position: 2
---

# Environment

Here is enviroment which you can config in docker

| Name | Default Value | Description |
| ---- | ---- | ----- |
| ALLOW_REGISTER | false | whether allow user can register account |
| ALLOW_OPENAPI | false | whether allow openapi which can fetch or post data just like you with ui |
| SANDBOX_MEMORY_LIMIT | 16 | custom script monitor sandbox memory limit, which can control which monitor script not use too many memory (unit MB, the minimum value is 8) |
45 changes: 17 additions & 28 deletions website/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,35 @@
sidebar_position: 1
---

# Tutorial Intro
# Introduction

Let's discover **Docusaurus in less than 5 minutes**.
## What is Tianji

## Getting Started
One sentence to summarize:

Get started by **creating a new site**.
**Tianji** = **Website Analytics** + **Uptime Monitor** + **Server Status**

Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
### Why is it called Tianji?

### What you'll need
Tianji(天机, pronunciation Tiān Jī) in chinese which means **Heavenly Opportunity** or **Strategy**

- [Node.js](https://nodejs.org/en/download/) version 16.14 or above:
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
The characters 天 (Tiān) and 机 (Jī) can be translated as "heaven" and "machine" or "mechanism" respectively. When combined, it might refer to a strategic or opportunistic plan or opportunity that seems to be orchestrated by a higher power or a celestial force.

## Generate a new site
## Installation

Generate a new Docusaurus site using the **classic template**.
Install Tianji with Docker is very simple. just make sure you have been install docker and docker-compose plugin

The classic template will automatically be added to your project after you run the command:
and then, run those command in anywhere:

```bash
npm init docusaurus@latest my-website classic
wget https://raw.githubusercontent.com/msgbyte/tianji/master/docker-compose.yml
docker compose up -d
```

You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.
## Community

The command also installs all necessary dependencies you need to run Docusaurus.
Join our thriving community to connect with fellow users, share experiences, and stay updated on the latest features and developments. Collaborate, ask questions, and contribute to the growth of the Tianji community.

## Start your site

Run the development server:

```bash
cd my-website
npm run start
```

The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.

The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.

Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.
- [GitHub](https://github.com/msgbyte/tianji)
- [Discord](https://discord.gg/8Vv47wAEej)
- [Stack Overflow](https://stackoverflow.com/questions/tagged/tianji)
4 changes: 4 additions & 0 deletions website/docs/monitor/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Monitor",
"position": 3
}
40 changes: 40 additions & 0 deletions website/docs/monitor/custom-script.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
sidebar_position: 1
---

# Custom Script

Compared with traditional monitoring services, **Tianji** supports custom scripts to support more customized scenarios.

Here is some example

## Examples

### get available service number from health endpoint

```js
const res = await request({
url: 'https://<tailchat-server-api>/health'
})

if(!res || !res.data || !res.data.services) {
return -1
}

return res.data.services.length
```

### get github star count

```js
const res = await request({
url: 'https://api.github.com/repos/msgbyte/tianji'
})

return res.data.stargazers_count ?? -1
```
### or more
Very very welcome to submit your script in this page. Tianji is driven by open source community.
4 changes: 4 additions & 0 deletions website/docs/server-status/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Server Status",
"position": 4
}
31 changes: 31 additions & 0 deletions website/docs/server-status/server-status-reporter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
sidebar_position: 1
---

# Server Status Reporter

you can report your server status easily with tianji reporter

you can download from [https://github.com/msgbyte/tianji/releases](https://github.com/msgbyte/tianji/releases)

## Usage

```
Usage of tianji-reporter:
--interval int
Input the INTERVAL, seconed (default 5)
--mode http
The send mode of report data, you can select: `http` or `udp`, default is `http` (default "http")
--name string
The identification name for this machine
--url string
The http url of tianji, for example: https://tianji.msgbyte.com
--vnstat
Use vnstat for traffic statistics, linux only
--workspace string
The workspace id for tianji, this should be a uuid
```

the **url** and **workspace** is required, its means you will report your service to which host and which workspace.

default a server node name will be same with hostname, so you can custom your name with `--name` which can help you identify server.
14 changes: 14 additions & 0 deletions website/docs/special-thanks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
sidebar_position: 99
---

# Special thanks

## Open source project

Tianji is very inspired by those project, thanks for your contributions to the open source community.

I also loves those project. Salute to these excellent projects!

- [umami](https://github.com/umami-software/umami)
- [uptime kuma](https://github.com/louislam/uptime-kuma)
8 changes: 0 additions & 8 deletions website/docs/tutorial-basics/_category_.json

This file was deleted.

23 changes: 0 additions & 23 deletions website/docs/tutorial-basics/congratulations.md

This file was deleted.

34 changes: 0 additions & 34 deletions website/docs/tutorial-basics/create-a-blog-post.md

This file was deleted.

57 changes: 0 additions & 57 deletions website/docs/tutorial-basics/create-a-document.md

This file was deleted.

43 changes: 0 additions & 43 deletions website/docs/tutorial-basics/create-a-page.md

This file was deleted.

Loading

0 comments on commit 0076a3b

Please sign in to comment.