Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default defineConfig({
{text: 'Configuration', link: '/docs/config'},
{text: 'First Login', link: '/docs/first-login'},
{text: 'Push messages', link: '/docs/pushmsg'},
{text: 'Message Priority', link: '/docs/priority'},
{text: 'Message Extras', link: '/docs/msgextras'},
],
},
Expand All @@ -54,22 +55,30 @@ export default defineConfig({
{text: 'Setup Environment', link: '/docs/dev-setup'},
{text: 'Servers and Tests', link: '/docs/dev-server-and-tests'},
{text: 'Build Gotify', link: '/docs/build'},
{
text: 'Testing unreleased changes',
link: '/docs/testing-master',
},
],
},
{
text: 'Guides',
items: [
{text: 'OpenID Connect (OIDC)', link: '/docs/oidc'},
{text: 'Session Elevation', link: '/docs/session-elevation'},
{text: 'Migrate to 3.x', link: '/docs/migrate-to-3'},
{text: 'Apache reverse proxy', link: '/docs/apache'},
{text: 'Caddy 2 reverse proxy', link: '/docs/caddy'},
{text: 'Haproxy reverse proxy', link: '/docs/haproxy'},
{text: '(more) Push message examples', link: '/docs/more-pushmsg'},
{text: 'nginx reverse proxy', link: '/docs/nginx'},
{text: 'Optimize uploaded images', link: '/docs/optimize-images'},
{text: 'systemd configuration', link: '/docs/systemd'},
{text: 'Traefik reverse proxy', link: '/docs/traefik'},
{text: 'Session Elevation', link: '/docs/session-elevation'},
{text: 'Systemd configuration', link: '/docs/systemd'},
{
text: 'Reverse Proxies',
items: [
{text: 'Apache', link: '/docs/apache'},
{text: 'Caddy 2', link: '/docs/caddy'},
{text: 'HAProxy', link: '/docs/haproxy'},
{text: 'Nginx', link: '/docs/nginx'},
{text: 'Traefik', link: '/docs/traefik'},
],
},
],
},
],
Expand Down
12 changes: 6 additions & 6 deletions docs/apache.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Apache reverse proxy

Here are configuration examples for setting up apache as reverse proxy for gotify/server.
Here are configuration examples for setting up Apache as a reverse proxy for Gotify.

The following modules are required:

Expand All @@ -16,11 +16,11 @@ The following modules are required:

Keepalive On

# The proxy must preserve the host because gotify verifies the host with the origin
# The proxy must preserve the host because Gotify verifies the host with the origin
# for WebSocket connections
ProxyPreserveHost On

# Proxy web socket requests to /stream
# Proxy WebSocket requests to /stream
ProxyPass "/stream" ws://127.0.0.1:GOTIFY_PORT/stream retry=0 timeout=60

# Proxy all other requests to /
Expand All @@ -39,11 +39,11 @@ The following modules are required:

Redirect 301 "/gotify" "/gotify/"

# The proxy must preserve the host because gotify verifies the host with the origin
# The proxy must preserve the host because Gotify verifies the host with the origin
# for WebSocket connections
ProxyPreserveHost On

# Proxy web socket requests to /stream
# Proxy WebSocket requests to /stream
ProxyPass "/gotify/stream" ws://127.0.0.1:GOTIFY_PORT/stream retry=0 timeout=60

# Proxy all other requests to /
Expand All @@ -57,7 +57,7 @@ The following modules are required:
## Troubleshooting

With some additional Apache configuration, the `ProxyPass` for the `/stream` endpoint may not work correctly.
The request fails with `400 Bad Request` and the following error is logged inside gotify/server.
The request fails with `400 Bad Request` and Gotify logs the following error.

```
Error #01: websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header
Expand Down
7 changes: 4 additions & 3 deletions docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

1. Build the Go Binary

It is recommended to build gotify/server via the [gotify/build docker images](https://github.com/gotify/build),
this ensures that [plugins](plugin.md) will be compatible with the built binary (because the same build environment is used).
It is recommended to build gotify/server via the [gotify/build docker images](https://github.com/gotify/build).
This ensures that [plugins](plugin.md) will be compatible with the built binary because the same build environment is used.

Set the LD_FLAGS with meta information like the version or the commit:

Expand All @@ -29,6 +29,7 @@
$ make build-linux-arm-7
$ make build-linux-arm64
$ make build-linux-386
$ make build-linux-riscv64
$ make build-windows-amd64
$ make build-windows-386
```
Expand All @@ -39,7 +40,7 @@
$ go build -ldflags="$LD_FLAGS" -o gotify-server
```

_The project has a CGO reference (because of sqlite3), therefore a CGO cross compiler is needed for compiling for
_The project has a CGO reference (because of sqlite3), therefore a CGO cross compiler is needed when compiling for
other platforms (the gotify/build docker images already contain the needed cross compilers)._

```bash
Expand Down
14 changes: 7 additions & 7 deletions docs/caddy.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# Caddy 2 reverse proxy

Setting up [Caddy](https://caddyserver.com) as a reverse proxy is very straightforward. Here are two config examples.
Here are configuration examples for setting up [Caddy](https://caddyserver.com) as a reverse proxy for Gotify.

## As a standalone domain

Here is a sample config file if you run your gotify instance on port 1245
Here is a sample config file if your Gotify instance runs on port 1245.

```
gotify.example.com {
# Set the port to the one you are using in gotify
# Websocket support, proxy headers, etc. are enabled by default
# Set the port to the one you are using in Gotify
# WebSocket support, proxy headers, etc. are enabled by default
reverse_proxy localhost:1245
}
```

Caddy automatically deploys SSL certificates from Let's Encrypt for your domain. If you want to explicitly disable TLS encryption, prefix your server name with `http://`.
Caddy automatically obtains TLS certificates from Let's Encrypt for your domain. If you want to explicitly disable TLS, prefix your server name with `http://`.

## At a subpath

Here is the equivalent of the sample config above but running under a sub path.
Here is the equivalent of the sample config above but running at a subpath.

```
example.com {
route /gotify/* {
uri strip_prefix /gotify
# Set the port to the one you are using in gotify
# Set the port to the one you are using in Gotify
reverse_proxy localhost:1245
}
redir /gotify /gotify/
Expand Down
29 changes: 12 additions & 17 deletions docs/dev-server-and-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Backend

The backend needs a built ui. Run
The backend embeds the built UI, so build it first.

```bash
$ (cd ui && yarn build)
Expand All @@ -26,17 +26,18 @@ _Commands must be executed inside the ui directory._
$ yarn start
```

Open `http://localhost:3000` inside your favorite browser.
Open `http://localhost:5173` inside your favorite browser.

The UI requires a Gotify server running on `localhost:80`. This can be adjusted inside
[ui/src/index.tsx](https://github.com/gotify/server/blob/master/ui/src/index.tsx).
The UI development server proxies API requests to a Gotify server running on
`localhost:80`. Create a `gotify-server.env` in the gotify/server repository
containing `GOTIFY_SERVER_PORT=8080` to change the port.

## Update Swagger spec

The [gotify/server REST-API](/api-docs) is documented via Swagger. The Swagger definition is generated via source code comments
The [gotify/server REST-API](/api-docs) is documented via Swagger. The Swagger definition is generated from source code comments
([example comment](https://github.com/gotify/server/blob/09c1516a170dfb47d29644db622655b540b94922/api/application.go#L33)).

After changing such a source code comment, you can run the following command to update the Swagger definition.
After changing such a comment, run the following command to update the Swagger definition.

```bash
$ make update-swagger
Expand All @@ -46,7 +47,7 @@ $ make update-swagger

### Execute Backend Tests

#### Run tests with parallelism
#### Run tests

```bash
$ go test ./...
Expand All @@ -59,30 +60,24 @@ $ make test-coverage
$ go tool cover -html=coverage.txt # get a HTML coverage report
```

#### Run Tests with Race Detector

```bash
$ make test-race
```

### Execute UI (end2end) Tests

Build the ui because the end2end test should be run against the production build.
(This needs to be done on every change in the UI)
Build the UI because the end2end tests run against the production build.
(This needs to be done after every change in the UI)

```bash
$ (cd ui && yarn build)
```

Now execute the tests with yarn
Now execute the tests with yarn.

```bash
$ (cd ui && yarn test)
```

### Execute Static Checks

The following command checks the formatting and executes some linters like tslint and govet.
The following command checks the formatting, runs linters like golangci-lint and eslint, and verifies that the Swagger spec is up to date.

```bash
$ make check
Expand Down
8 changes: 4 additions & 4 deletions docs/dev-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

Gotify requires:

- Go 1.18 or newer
- Node 16.x or newer
- Go 1.25 or newer
- Node 24 or newer
- Yarn 1.9 or newer

## Clone sources

Clone gotify server source from git:
Clone the gotify/server source from git:

```bash
$ git clone https://github.com/gotify/server.git && cd server
```

## Setup Backend

Download dependencies
Install the development tools (needed for generating the Swagger spec):

```bash
$ make download-tools
Expand Down
6 changes: 3 additions & 3 deletions docs/first-login.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# First Login

After setting up gotify/server you can login to the WebUI. When first launched an initial account is created so you can log in. If you have not overriden the defaults in the configuration, use username: `admin` password: `admin`.
After setting up gotify/server you can log in to the WebUI. On first launch an initial admin account is created. If you have not overridden the defaults in the configuration, use username `admin` and password `admin`.

Once you have logged in you can create your own user(s) and, if desired, delete the default account (after creating a separate administrator account). You can also remove any username/password overrides in your configuration, as they are only used to initially create this account.
Once logged in you can create your own user(s) and, if desired, delete the default account (after creating another administrator account). You can also remove any username/password overrides from your configuration, they are only used to create this initial account.

If you choose to keep the default account be sure to change the password so it is not `admin`!
If you keep the default account, be sure to change its password so it is not `admin`!
4 changes: 2 additions & 2 deletions docs/haproxy.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Haproxy reverse proxy
# HAProxy reverse proxy

Here are configuration examples for setting up Haproxy as reverse proxy for gotify/server.
Here are configuration examples for setting up HAProxy as a reverse proxy for Gotify.

## Proxy requests

Expand Down
9 changes: 4 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Intro

This is the documentation of gotify/server. Lets start with some definitions:
This is the documentation of gotify/server. Let's start with some definitions:

A client is a device or application that can manage clients, messages and applications.
However a client is not allowed to send messages.
A client is a device or program that receives messages and can manage clients, applications and messages. A client cannot send messages.

An application is a device or application that only can send messages.
An application is a device or program that can only send messages.

Users are only able to manage (view/edit/delete) clients and applications (includes messages sent by the app) that they've created.
Users can only manage (view/edit/delete) the clients and applications they created, including messages sent by those applications.

A message has the following attributes: content, title, creation date, application id and priority.

Expand Down
20 changes: 9 additions & 11 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

## Docker

Setting up gotify/server with docker is pretty easy, you basically just have to start the docker container and you are ready to go:

Before starting gotify/server you may read the [Configuration](config.md) if you f.ex. use a different database.
Before starting, read the [Configuration](config.md) page if you, for example, want to use a different database.

```bash
$ docker run -p 80:80 -v /var/gotify/data:/app/data gotify/server
Expand All @@ -14,11 +12,10 @@ $ docker run -p 80:80 -v /var/gotify/data:/app/data ghcr.io/gotify/server

[gotify/server](https://hub.docker.com/r/gotify/server) and
[ghcr.io/gotify/server](https://github.com/gotify/server/pkgs/container/server)
are multi-arch docker images, they will work for the architectures: amd64,
i386, arm64, armv7, and riscv64.
are multi-arch Docker images supporting amd64, i386, arm64, armv7, and riscv64.

`/app/data` contains the database file (if sqlite is used), images for applications and cert-files (if lets encrypt is enabled).
In this example the directory is mounted to `/var/gotify/data` this directory should be included in a backup.
`/app/data` contains the database file (if SQLite is used), application images and certificates (if Let's Encrypt is enabled).
In this example the directory is mounted to `/var/gotify/data`, include this directory in your backups.

The time zone inside the container is configurable via the `TZ` environment variable:

Expand Down Expand Up @@ -53,12 +50,13 @@ Latest version:
<img alt="latest release" src="https://img.shields.io/github/release/gotify/server.svg">
</a>

### Supported Platforms:
### Supported Platforms

- linux-amd64 (64bit)
- linux-386 (32bit)
- linux-arm-7 (32bit used for Raspberry Pi)
- linux-arm-7 (32bit, used for Raspberry Pi)
- linux-arm64 (ARMv8)
- linux-riscv64 (RISC-V)
- windows-386.exe (32bit)
- windows-amd64.exe (64bit)

Expand All @@ -83,9 +81,9 @@ Make the binary executable.
$ chmod +x gotify-{PLATFORM}
```

Execute gotify/server. (By default gotify/server is started on port 80 so it requires sudo)
Execute gotify/server. By default it listens on port 80, which requires sudo.

Before starting gotify/server you may read the [Configuration](config.md) if you f.ex. want to change the port or use a different database.
Before starting, read the [Configuration](config.md) page if you, for example, want to change the port or use a different database.

```bash
$ sudo ./gotify-{PLATFORM}
Expand Down
Loading