summaryrefslogtreecommitdiff
path: root/docs/docker.md
blob: 2507bcfe37d452b697181f695a4c05a94b5a1393 (plain)
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
#### 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`

#### Special environment variables

| Name              | value                          | Example                              |
| -                 | -                              | -                                    |
| FOURGET_PROTO     | "http" or "https"              | "https"                              |
| FOURGET_INSTANCES | comma separated string of urls | "https://4get.ca,https://domain.tld" |

#### 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:

```
captcha/
  birds/
    1.png
    2.png
    3.png
 anime/
    1.png
    2.png
```

For more information on configuration view [data/config.php](../data/config.php)

#### Usage

You can start 4get with

```
docker run -d -p 80:80 -e FOURGET_SERVER_NAME="4get.ca" -e FOURGET_PROTO="http" luuul/4get:latest
```

...Or with SSL:

```
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
```


#### With Docker Compose

Replace relevant values and start with `docker compose up -d`

##### HTTP

```
# docker-compose.yaml
version: "3.7"

services:
  fourget:
    image: luuul/4get:latest
    restart: always
    environment:
      - FOURGET_VERSION=6
      - FOURGET_PROTO=http
      - FOURGET_SERVER_NAME=4get.ca

    ports:
      - "80:80"
```

##### HTTPS

```
# docker-compose.yaml
version: "3.7"

services:
  fourget:
    image: luuul/4get:latest
    restart: always
    environment:
      - FOURGET_VERSION=6
      - FOURGET_PROTO=https
      - FOURGET_SERVER_NAME=4get.ca

    ports:
      - "80:80"
      - "443:443"
      
    volumes:
      - /etc/letsencrypt/live/domain.tld:/etc/4get/certs
```

##### 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
    restart: always
    environment:
      - FOURGET_VERSION=6
      - 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
    restart: always
    environment:
      - FOURGET_VERSION=6
      - FOURGET_PROTO=http
      - FOURGET_SERVER_NAME=4get.ca

    ports:
      - "80:80"
      
    volumes:
      - ./banners:/var/www/html/4get/banner
```