|
1 | 1 | # Backend |
2 | 2 |
|
3 | | -- Ubuntu 24.04.2 LTS |
4 | | -- Hostname: srbsci-141.ost.ch |
5 | | -- IP: 10.8.36.141/23 |
6 | | -- DNS: 130.59.31.251(primary)/130.59.31.248 |
7 | | -- all ports are open |
8 | | -- 2 vCPU, RAM 4096 MB, Drive 50 GB |
9 | | -- End of life: 2025-10-31 (automatically deleted after this date) |
10 | | -- Support: <sgi-support@ost.ch> |
| 3 | +Runs in DMZ Kubernetes cluster of the institute for network and security at the eastern swiss university of applied sciences (OST). |
| 4 | +- Support: <jan.untersander@ost.ch> |
11 | 5 |
|
12 | 6 | ## Service |
13 | 7 |
|
14 | 8 | The backend service is written in python. For development follow these [instructions](service/README.md) |
15 | 9 |
|
16 | | -## Connect to Ubuntu server |
17 | | - |
18 | | -1. Connect to OST VPN. |
19 | | -2. `ssh -i ~/.ssh/id_ed25519 ins@srbsci-141.ost.ch` |
20 | | - |
21 | | -The SSH keys of all our team members were added to the server. |
22 | | - |
23 | | -## Connect to DB |
24 | | - |
25 | | -OST VPN connection required! Any application that can make connections to a postgres database should work. For example [pgadmin4](https://www.pgadmin.org/download/). |
26 | | - |
27 | | -- Hostname: `srbsci-141.ost.ch` |
28 | | -- Port: `5432` |
29 | | -- Database: `ost` |
30 | | -- Username: `postgres` |
31 | | -- Password: ask Roman |
32 | | - |
33 | | - |
34 | | - |
35 | | -## Server setup |
36 | | - |
37 | | -This is the server setup part, which is only needed in case the server needs to be reinstalled! |
38 | | - |
39 | | -### Authorized keys |
40 | | - |
41 | | -[SSH keys](https://ostch-my.sharepoint.com/:t:/r/personal/leo_oetterli_ost_ch/Documents/Bachelor_Inf_Sem6/SE-Project/Server/authorized_keys.txt?csf=1&web=1&e=AtQha6) were added to ./ssh/authorized_keys. |
42 | | - |
43 | | -### Docker installation |
44 | | - |
45 | | -Docker was installed using the apt repository and as shown in [this guide](https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository). |
46 | | - |
47 | | -#### Add user to docker group |
48 | | - |
49 | | -The INS user needs to be added to the docker group, otherwise a permission denied error appears when using docker run. Refer [to this guide](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user) for more details. The commands are the following: |
50 | | - |
51 | | -```terminal |
52 | | -sudo groupadd docker |
53 | | -sudo usermod -aG docker $USER |
54 | | -newgrp docker # applies group changes |
55 | | -docker run hello-world # confirms the successful installation. |
56 | | -``` |
57 | | - |
58 | | -### Clone backend repository |
59 | | - |
60 | | -1. A new SSH key called `backend-SSH-key` was created on the server (no passphrase). |
61 | | -2. The SSK key was added as a deploy-key (read/write) in the backend repository. [Link to guide](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/managing-deploy-keys#deploy-keys). |
62 | | -3. `~/.ssh/config` created to use correct SSH key. |
63 | | - |
64 | | - ```text |
65 | | - Host github.com |
66 | | - User git |
67 | | - IdentityFile ~/.ssh/backend-SSH-key |
68 | | - IdentitiesOnly yes |
69 | | - ``` |
70 | | -
|
71 | | -### Postgres password |
72 | | -
|
73 | | -1. In the backend repository, create a new file `touch .env` and add the password. |
74 | | -
|
75 | | -The docker-compose file will import the file as a secret and set it as the Postgres password. `.env` is added go the `.gitignore` file, so the password isn't in GitHub. |
76 | | -
|
77 | 10 | ## Dev Setup |
78 | 11 |
|
79 | 12 | ### Environment Variables |
80 | | -Create a `.env` in the root of the directory. See the environment variables in the example.env file. |
| 13 | +Create a `.env` in the root of the directory. See the environment variables in the example.env file. |
0 commit comments