aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: ee65daaf7668d35b9d4c4694b84d8baf01d297f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# September

[![github.com](https://github.com/gemrest/september/actions/workflows/check.yaml/badge.svg?branch=main)](https://github.com/gemrest/september/actions/workflows/check.yaml)

A simple and efficient Gemini-to-HTTP proxy written in Rust.

## Usage

### Docker

```shell
$ docker run -d [ -e ROOT="gemini://fuwn.me" ] [ -e PORT="8080"] [ -e CSS_EXTERNAL="https://example.com/style.css"] fuwn/september:latest
```

### Docker Compose

Edit the `docker-compose.yaml` file to your liking, and then

```shell
$ docker-compose up -d
```

### Executable

```shell
$ [ ROOT="gemini://fuwn.me" ] [ PORT="8080"] [ CSS_EXTERNAL="https://example.com/style.css"] ./september
```

or use a `.env` file

```dotenv
# .env

ROOT=gemini://fuwn.me
PORT=8080
CSS_EXTERNAL=https://example.com/style.css
```

and then

```shell
$ ./september
```

## Configuration

Configuration for September is done solely via environment variables, for
simplicity, and Docker support.

### `PORT`

Bind September to a custom port.

Generally, you shouldn't touch this if you are deploying using Docker.

If no `PORT` is provided or the `PORT` could not be properly parsed as a `u16`;
port `80` will be assumed.

```dotenv
PORT=8080
```

### `ROOT`

The root Gemini capsule to proxy when not visiting a "/proxy" route.

If no `ROOT` is provided, `"gemini://fuwn.me"` will be assumed.

```dotenv
ROOT=gemini://fuwn.me
```

### `CSS_EXTERNAL`

An external CSS file to apply to the HTML response.

If no `CSS_EXTERNAL` is provided, there will be no styling done to the HTML
response.

```dotenv
CSS_EXTERNAL=https://cdnjs.cloudflare.com/ajax/libs/mini.css/3.0.1/mini-default.min.css
```

### `KEEP_GEMINI_EXACT`

Keeps exactly matching URLs as a Gemini URL.

#### Examples

If `KEEP_GEMINI_EXACT` is equal to `KEEP_GEMINI_EXACT=gemini://fuwn.me/gemini`,
all routes will be proxied their "/proxy" equivalent (e.g.,
"https://fuwn.me/proxy/fuwn.me/gopher"), except occurrences of
"gemini://fuwn.me/skills" will be kept as is.

```dotenv
KEEP_GEMINI_EXACT=gemini://fuwn.me/skills
```

### `KEEP_GEMINI_DOMAIN`

Similar to `KEEP_GEMINI_EXACT`, except proxies based on entire domains instead
of exact matches.

```dotenv
KEEP_GEMINI_DOMAIN=fuwn.me
```

### `PROXY_BY_DEFAULT`

Control weather or not all Gemini URLs will be proxied.

Similar to `KEEP_GEMINI_EXACT` and `KEEP_GEMINI_DOMAIN` but global.

Defaults to `true`.

```dotenv
PROXY_BY_DEFAULT=false
```

### `FAVICON_EXTERNAL`

An external favicon file to apply to the HTML response.

```dotenv
FAVICON_EXTERNAL=https://host.fuwn.me/8te8lw0lxm03.webp
```

### `PLAIN_TEXT_ROUTE`

A comma-seperated list of paths to treat as plain text routes.

```dotenv
PLAIN_TEXT_ROUTE=/robots.txt,/license.txt
```

### `MATHJAX`

Enable MathJax support for rendering LaTeX.

Defaults to `false`.

```dotenv
MATHJAX=true
```

## Styling

Want to give your website a shiny new look? Try using one of sources
to find a stylish and **minimal** (!!) CSS theme/ framework!

- [dohliam/dropin-minimal-css](https://github.com/dohliam/dropin-minimal-css): Drop-in switcher for previewing minimal CSS frameworks
- [dbohdan/classless-css](https://github.com/dbohdan/classless-css): A list of classless CSS themes/frameworks with screenshots

## Capsules using September

[Add yours!](https://github.com/gemrest/september/edit/main/README.md)

- <https://fuwn.me/>
- <https://gem.rest/>

## License

This project is licensed with the
[GNU General Public License v3.0](https://github.com/gemrest/september/blob/main/LICENSE).