Skip to content

Commit

Permalink
Add docs on headless mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bclswl0827 committed Dec 18, 2023
1 parent a52981e commit 5928095
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 29 deletions.
40 changes: 21 additions & 19 deletions docs/AnyShake Observer/Development/headless.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,28 @@ sidebar_position: 3

# Headless Mode

For some reasons, you may want to run AnyShake Observer without its embedded frontend server. In this case, you can have AnyShake Observer provide only the back-end interface, hosting the front-end on Nginx, Apache or Caddy.
For some reasons, you may want to run AnyShake Observer without its web UI. In this case, you can have AnyShake Observer provide only the back-end APIs, hosting your own front-end dist on Nginx, Apache or Caddy.

## Nginx Configuration

Here is an example of Nginx configuration, assuming that the AnyShake Observer is running on `http://localhost:8073`, your dist frontend root directory is `/var/www/html/anyshake`, the Nginx is listening on port `80` and the domain name is `localhost`.

```
TODO
```

The final URL will be `http://localhost/anyshake`.

## Apache Configuration

```
TODO
```

## Caddy Configuration
To use AnyShake Observer in headless mode, you can set up a reverse proxy to forward requests to AnyShake Observer's back-end APIs. Assuming that your URL of AnyShake Observer is `https://127.0.0.1:8073`, and you want to host your front-end dist on `https://example.org`, an Nginx example is given as follows:

```
TODO
server {
listen 80;
server_name example.org;
location / {
index index.html;
root /path/to/your/dist;
}
location /api {
proxy_pass https://127.0.0.1:8073/api;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
```
24 changes: 23 additions & 1 deletion docs/AnyShake Observer/Development/src-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,31 @@ If you don't have `git` installed, you can download the source code as a `.zip`
- [github.com/anyshake/observer/archive/refs/heads/master.zip](https://github.com/anyshake/observer/archive/refs/heads/master.zip)
- [github.com/anyshake/observer/archive/refs/heads/master.tar.gz](https://github.com/anyshake/observer/archive/refs/heads/master.tar.gz)

## Build Docs

Install `swag` by running `go install` command.

```bash
$ go install github.com/swaggo/swag/cmd/swag@latest
```

Check if `swag` is installed successfully.

```bash
$ swag --version
swag version v1.16.2
```

Enter the `docs` directory, use `swag init` to generate Swagger docs.

```bash
$ cd docs
$ swag init -g ../cmd/main.go -d ../app,../server,../publisher -o ./
```

## Build Frontend

Remove the `frontend/dist` to avoid conflicts.
Go back to the repository root directory, remove the `frontend/dist` to avoid conflicts.

``` bash
$ rm -rf frontend/dist
Expand Down
5 changes: 0 additions & 5 deletions docs/AnyShake Observer/Development/versioning.md

This file was deleted.

8 changes: 4 additions & 4 deletions docs/AnyShake Observer/questions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ sidebar_position: 5

Listed below are some frequently asked questions about AnyShake Observer.

## How to upgrade
## How to Upgrade

To update AnyShake Observer, you can always get the latest version from [github.com/anyshake/observer/releases/latest](https://github.com/anyshake/observer/releases/latest)

## I have a feature request
## I Have a Feature Request

If you have a feature request, please [open an issue](https://github.com/anyshake/observer/issues/new/choose) on GitHub, choose the `Feature Request` template and fill in the form.

However, we may not be able to implement all feature requests, so please don't be disappointed if your feature request is rejected.

## AnyShake Observer crashes
## AnyShake Observer Crashes

If you encounter a crash, please copy the log and [open an issue](https://github.com/anyshake/observer/issues/new/choose) on GitHub, choose the `Bug Report` template and fill in the form.

## Backward compatibility
## Backward Compatibility

1. For configuration files, backward compatibility applies to at least one major version. For example, AnyShake Observer v1.x.x supports configuration files from v2.x.x.
2. For data (Database, MiniSEED, SAC, etc.), backward compatibility applies to at least one minor version. For example, AnyShake Observer v2.1.x supports data from v2.0.x.
15 changes: 15 additions & 0 deletions docs/AnyShake Observer/versioning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
sidebar_position: 6
---

# Versioning

AnyShake Observer follows the [Semantic Versioning (SemVer)](https://semver.org) principles.

That means that with a version number x.y.z:

- When releasing critical bug fixes, we make a patch release by changing the z number (ex: 2.1.2 to 2.1.3).
- When releasing new features or non-critical fixes, we make a minor release by changing the y number (ex: 2.1.2 to 2.2.0).
- When releasing breaking changes, we make a major release by changing the x number (ex: 2.1.2 to 3.0.0).

Major releases can also contain new features, and any release can include bug fixes, minor releases are the most common type of release.

0 comments on commit 5928095

Please sign in to comment.