forked from lolcat/4get
1
0
Fork 0
4get/docs/docker.md

153 lines
3.4 KiB
Markdown
Raw Normal View History

2024-03-22 07:34:50 +00:00
#### Install guide for Docker
When using docker container any environment variables prefixed with `FOURGET_` will be added to the generated config located at `/var/www/html/4get/data/config.php`
2024-04-19 20:47:02 +00:00
When lists of data is expected in [data/config.php](../data/config.php), such as `INSTANCES`, you can pass in a comma separated string via environment variable.
Example:
`FOURGET_INSTANCES="https://4get.ca,https://domain.tld"`
2024-03-22 07:34:50 +00:00
#### Special environment variables
| Name | value | Example |
| - | - | - |
| FOURGET_PROTO | "http" or "https" | "https" |
2024-04-19 20:47:02 +00:00
2024-03-22 07:34:50 +00:00
#### Important directories
| Mountpoint | Description |
| - | - |
| /etc/4get/certs | SSL certificate directory |
| /var/www/html/4get/banner | Custom Banners directory |
| /var/www/html/4get/data/captcha | Captcha dataset |
the certificate directory `/etc/4get/certs` expects files named `fullchain.pem` and `privkey.pem`
The captcha dataset should have a subdirectory for each category. In each category, images should be named from 1.png to X.png, and be 100x100 in size.
example directory structure:
2024-02-25 23:56:28 +00:00
```
2024-03-22 07:34:50 +00:00
captcha/
birds/
1.png
2.png
3.png
anime/
1.png
2.png
2024-02-25 23:56:28 +00:00
```
2024-03-22 07:34:50 +00:00
For more information on configuration view [data/config.php](../data/config.php)
#### Usage
You can start 4get with
2024-02-25 23:56:28 +00:00
```
2024-03-22 07:34:50 +00:00
docker run -d -p 80:80 -e FOURGET_SERVER_NAME="4get.ca" -e FOURGET_PROTO="http" luuul/4get:latest
2024-02-25 23:56:28 +00:00
```
2024-03-22 07:34:50 +00:00
...Or with SSL:
2024-02-25 23:56:28 +00:00
2024-03-22 07:34:50 +00:00
```
docker run -d -p 443:443 -e FOURGET_SERVER_NAME="4get.ca" -e FOURGET_PROTO="https" -v /etc/letsencrypt/live/domain.tld:/etc/4get/certs luuul/4get:latest
```
2024-02-25 23:56:28 +00:00
2024-03-22 07:34:50 +00:00
#### With Docker Compose
2024-02-25 23:56:28 +00:00
2024-03-22 07:34:50 +00:00
Replace relevant values and start with `docker compose up -d`
2024-02-25 23:56:28 +00:00
2024-03-22 07:34:50 +00:00
##### HTTP
2024-02-25 23:56:28 +00:00
2024-03-22 07:34:50 +00:00
```
# docker-compose.yaml
version: "3.7"
services:
fourget:
image: luuul/4get:latest
2024-04-19 20:47:02 +00:00
restart: unless-stopped
2024-03-22 07:34:50 +00:00
environment:
- FOURGET_PROTO=http
- FOURGET_SERVER_NAME=4get.ca
2024-02-25 23:56:28 +00:00
2024-03-22 07:34:50 +00:00
ports:
- "80:80"
```
2024-02-25 23:56:28 +00:00
2024-03-22 07:34:50 +00:00
##### HTTPS
2024-02-25 23:56:28 +00:00
```
2024-03-22 07:34:50 +00:00
# docker-compose.yaml
2024-02-25 23:56:28 +00:00
version: "3.7"
services:
fourget:
image: luuul/4get:latest
2024-04-19 20:47:02 +00:00
restart: unless-stopped
2024-02-25 23:56:28 +00:00
environment:
2024-03-22 07:34:50 +00:00
- FOURGET_PROTO=https
2024-02-25 23:56:28 +00:00
- FOURGET_SERVER_NAME=4get.ca
ports:
- "80:80"
- "443:443"
2024-03-22 07:34:50 +00:00
2024-02-25 23:56:28 +00:00
volumes:
- /etc/letsencrypt/live/domain.tld:/etc/4get/certs
```
2024-03-22 07:34:50 +00:00
##### Captcha Enabled
Set `FOURGET_BOT_PROTECTION=1` and mount a directory containing captcha files to `/var/www/html/4get/data/captcha`
```
# docker-compose.yaml
version: "3.7"
services:
fourget:
image: luuul/4get:latest
2024-04-19 20:47:02 +00:00
restart: unless-stopped
2024-03-22 07:34:50 +00:00
environment:
- FOURGET_PROTO=http
- FOURGET_SERVER_NAME=4get.ca
- FOURGET_BOT_PROTECTION=1
ports:
- "80:80"
volumes:
- ./captcha:/var/www/html/4get/data/captcha
```
##### Custom Banners
```
# docker-compose.yaml
version: "3.7"
services:
fourget:
image: luuul/4get:latest
2024-04-19 20:47:02 +00:00
restart: unless-stopped
2024-03-22 07:34:50 +00:00
environment:
- FOURGET_PROTO=http
- FOURGET_SERVER_NAME=4get.ca
ports:
- "80:80"
volumes:
- ./banners:/var/www/html/4get/banner
```
2024-06-20 02:24:01 +00:00
##### Tor
You can route incoming and outgoing requests through tor by following [docker tor documentation](./docker_tor.md)