Newer
Older
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
# Kuadrado Software Website
## install
### Prerequisite
- docker
- docker-compose
- certbot for prod or mkcert for dev
---
### TLS CERTS
- ### Localhost
With mkcert
```sh
$ sudo mkdir -p /etc/letsencrypt/live/localhost
$ sudo chmod 777 -R /etc/letsencryt/live/localhost
$ mkcert -key-file privkey.pem -cert-file fullchain.pem localhost
```
- ### Real server
Install snapd and certbot at system level. https://certbot.eff.org/lets-encrypt/debianbuster-other
Then run
```sh
$ sudo certbot certonly --standalone
```
---
## Build
```sh
$ git clone https://gitlab.com/kuadrado-software/kuadrado-website.git
$ cd kuadrado-website
$ touch ./.env
# Fill .env file with the required variables described below
# Build the website
$ cd website
$ npm install
$ npm run build
# or
$ npm run build-debug
$ cd ..
# build the image and run the container
$ docker-compose up --build
# Or
$ docker-compose -f ./dev.docker-compose.yml up --build
```
---
## Expected environment variables
_Env vars may be defined in a .env file at the root of the project_
- `RELEASE_MODE`: Can be either "debug", "test" or "prod". It's used to define the log level. Not required. Default is "prod"
- `SERVER_PORT`: The port bound the Actix server
- `SERVER_PORT_TLS`: The tls port bound the Actix server
- `SERVER_HOST`: IP address or domain name hosting the API.
- `SERVER_PROTOCOL`: http or https regarding the protocol used to connect the server
- `RESOURCES_DIR`: A linux directory that will be used to mount static resources like certs and html files