2024-05-29 14:19:50 +02:00
|
|
|
# Server Config
|
2024-05-06 18:58:15 +02:00
|
|
|
|
2024-05-29 14:19:50 +02:00
|
|
|
Fichiers de configuration du serveur Coh@bit.
|
|
|
|
|
2024-05-29 14:20:41 +02:00
|
|
|
## Usage général
|
2024-05-29 14:19:50 +02:00
|
|
|
|
|
|
|
Cloner ce dépôts sur votre système (pas de répertoire privilégié).
|
|
|
|
|
2024-05-29 14:25:16 +02:00
|
|
|
```sh
|
|
|
|
# Clone repository
|
|
|
|
git clone https://git.cohabit.fr/cohabit/server_config.git
|
|
|
|
cd server_config
|
|
|
|
|
2024-05-30 15:23:38 +02:00
|
|
|
# Decrypt secrets
|
2024-05-30 17:52:19 +02:00
|
|
|
gpg -d .env.gpg > .env
|
2024-05-30 15:23:38 +02:00
|
|
|
|
2024-05-29 14:25:16 +02:00
|
|
|
# Allow execute scripts
|
|
|
|
sudo chmod +x ./install.sh
|
|
|
|
sudo chmod +x ./deploy.sh
|
|
|
|
|
|
|
|
# Install and deploy services
|
2024-05-30 12:33:42 +02:00
|
|
|
sudo ./install.sh --all && sudo ./deploy.sh --all
|
2024-05-29 14:25:16 +02:00
|
|
|
```
|
|
|
|
|
2024-05-30 15:23:38 +02:00
|
|
|
> [!WARNING]
|
|
|
|
>
|
|
|
|
> Après avoir executer `deploy.sh` tous les secrets sont écrits en clair dans
|
|
|
|
> les fichiers de configs et les scripts.\
|
|
|
|
> Ne surtout pas faire de `git commit` ou de `git push`.\
|
|
|
|
> Pour retourner à l'état d'origine faire un `git reset --hard HEAD` ou
|
|
|
|
> équivalent.
|
|
|
|
|
2024-05-29 14:19:50 +02:00
|
|
|
## Installation
|
|
|
|
|
2024-05-29 14:20:41 +02:00
|
|
|
Pour installer les différents services/apps du serveur.
|
2024-05-29 14:19:50 +02:00
|
|
|
|
|
|
|
### Usage
|
|
|
|
|
|
|
|
```sh
|
|
|
|
sudo (bash|sh|zsh) ./install.sh [SERVICES...]
|
|
|
|
```
|
|
|
|
|
|
|
|
### Examples
|
|
|
|
|
2024-05-29 14:20:41 +02:00
|
|
|
- Install `caddy` and `iptables`.
|
2024-05-29 14:19:50 +02:00
|
|
|
```sh
|
|
|
|
sudo ./install.sh caddy iptables
|
|
|
|
```
|
2024-05-29 14:20:41 +02:00
|
|
|
- Install all services.
|
2024-05-29 14:19:50 +02:00
|
|
|
```sh
|
2024-05-30 12:33:42 +02:00
|
|
|
sudo ./install.sh -a
|
2024-05-29 14:19:50 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
## Déploiement
|
|
|
|
|
|
|
|
Pour déployer les différents services/apps dur serveur.
|
|
|
|
|
|
|
|
Nécessite d'avoir [installer les services](#installation) au préalable.
|
|
|
|
|
|
|
|
### Usage
|
|
|
|
|
|
|
|
```sh
|
|
|
|
sudo (bash|sh|zsh) ./deploy.sh [SERVICES...]
|
|
|
|
```
|
|
|
|
|
|
|
|
### Examples
|
|
|
|
|
2024-05-29 14:20:41 +02:00
|
|
|
- Install `caddy` and `iptables`.
|
2024-05-29 14:19:50 +02:00
|
|
|
```sh
|
|
|
|
sudo ./deploy.sh caddy iptables
|
|
|
|
```
|
2024-05-29 14:20:41 +02:00
|
|
|
- Install all services.
|
2024-05-29 14:19:50 +02:00
|
|
|
```sh
|
2024-05-30 12:33:42 +02:00
|
|
|
sudo ./deploy.sh -a
|
2024-05-29 14:19:50 +02:00
|
|
|
```
|