vps/README.md

61 lines
1.1 KiB
Markdown
Raw Normal View History

2024-02-17 19:01:04 +01:00
# vps
2024-10-08 20:56:26 +02:00
This repository contains all the files I use to manage my services hosted on [viyurz.fr](https://viyurz.fr).
2024-02-17 19:01:04 +01:00
## Requirements
2024-10-07 15:09:54 +02:00
2024-10-08 20:56:26 +02:00
### Initial setup
2024-10-07 15:09:54 +02:00
2024-10-08 20:56:26 +02:00
Run the setup script:
2024-10-07 15:09:54 +02:00
2024-10-08 20:56:26 +02:00
```sh
./setup.sh
2024-02-17 19:01:04 +01:00
```
2024-03-16 13:49:47 +01:00
### SSL certificates
2024-10-07 15:09:54 +02:00
2024-03-16 13:49:47 +01:00
Install Certbot:
2024-10-07 15:09:54 +02:00
2024-02-17 19:01:04 +01:00
```
2024-03-16 13:49:47 +01:00
sudo apt install -y certbot python3-certbot-dns-ovh python3-certbot-nginx
```
Request certificates:
2024-10-07 15:09:54 +02:00
2024-03-16 13:49:47 +01:00
```
# For the NGINX reverse proxy
sudo certbot certonly --nginx -d viyurz.fr,*.viyurz.fr
# For Coturn
bash <(wget -q -O - https://github.com/zerossl/zerossl-bot/raw/master/get-zerosslbot.sh)
sudo zerossl-bot certonly --nginx -m viyurz@viyurz.fr -d turn.viyurz.fr
# For the mailserver
sudo certbot certonly --nginx -d mail.viyurz.fr
2024-02-17 19:01:04 +01:00
```
2024-10-08 20:56:26 +02:00
### Secrets
Copy the existing `secrets.yml.example` file to `secrets.yml` and fill the variables.
2024-10-07 15:06:44 +02:00
### Storagebox
Add credential:
2024-10-07 15:09:54 +02:00
2024-10-07 15:06:44 +02:00
```
/etc/storagebox-cifs-credentials.txt
---
username=MYUSERNAME
password=MYPASSWORD
```
2024-10-08 20:56:26 +02:00
Copy the file `fstab` and edit it accordingly (username and potentially uids/gids).
## Backups
2024-10-07 15:09:54 +02:00
2024-10-08 20:56:26 +02:00
Create a cronjob to periodically backup all projects:
```
2024-10-08 20:56:26 +02:00
0 4 * * * /home/viyurz/vps/manage.py backup ''
```