Initialisation du Homelab
This commit is contained in:
32
.gitignore
vendored
Normal file
32
.gitignore
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# Secrets
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
secrets/
|
||||||
|
*.key
|
||||||
|
*.pem
|
||||||
|
*.crt
|
||||||
|
*.token
|
||||||
|
.vault_pass
|
||||||
|
|
||||||
|
# Runtime / data
|
||||||
|
data/
|
||||||
|
postgres/
|
||||||
|
backup/
|
||||||
|
backups/
|
||||||
|
logs/
|
||||||
|
|
||||||
|
# Dumps / exports
|
||||||
|
*.sql
|
||||||
|
*.dump
|
||||||
|
*.zip
|
||||||
|
*.tar.gz
|
||||||
|
*.gz
|
||||||
|
|
||||||
|
# Gitea runtime config
|
||||||
|
app.ini
|
||||||
|
|
||||||
|
# OS / editors
|
||||||
|
Thumbs.db
|
||||||
|
.DS_Store
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
28
README.md
Normal file
28
README.md
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
\# Homelab
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Dépôt d'infrastructure du homelab.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Objectifs :
|
||||||
|
|
||||||
|
\- centraliser les stacks Docker Compose
|
||||||
|
|
||||||
|
\- éviter les secrets en clair dans Git
|
||||||
|
|
||||||
|
\- préparer le déploiement via Ansible
|
||||||
|
|
||||||
|
\- préparer le CI/CD via Gitea Actions
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Règles :
|
||||||
|
|
||||||
|
\- aucun mot de passe dans les docker-compose.yml
|
||||||
|
|
||||||
|
\- aucun fichier .env de production dans Git
|
||||||
|
|
||||||
|
\- aucun dossier data, postgres, backup ou secrets dans Git
|
||||||
|
|
||||||
32
docs/bootstrap.md
Normal file
32
docs/bootstrap.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
\# Bootstrap initial
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Ce dépôt est initialisé manuellement car Gitea et Ansible ne sont pas encore automatisés.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Ordre de mise en place :
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
1\. Création du LXC Docker pour Gitea
|
||||||
|
|
||||||
|
2\. Installation manuelle de Docker
|
||||||
|
|
||||||
|
3\. Déploiement de Gitea avec Docker Compose
|
||||||
|
|
||||||
|
4\. Création du dépôt homelab
|
||||||
|
|
||||||
|
5\. Création future d'un LXC ansible-runner
|
||||||
|
|
||||||
|
6\. Mise en place d'Ansible Vault
|
||||||
|
|
||||||
|
7\. Ajout futur de Gitea Actions
|
||||||
|
|
||||||
|
8\. Migration progressive des services vers Docker Compose + Ansible
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Les secrets ne doivent jamais être versionnés.
|
||||||
|
|
||||||
49
services/gitea/docker-compose.yml
Normal file
49
services/gitea/docker-compose.yml
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
services:
|
||||||
|
db:
|
||||||
|
image: postgres:16-alpine
|
||||||
|
container_name: gitea-db
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: gitea
|
||||||
|
POSTGRES_USER: gitea
|
||||||
|
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
||||||
|
volumes:
|
||||||
|
- ./postgres:/var/lib/postgresql/data
|
||||||
|
secrets:
|
||||||
|
- postgres_password
|
||||||
|
networks:
|
||||||
|
- gitea_internal
|
||||||
|
|
||||||
|
gitea:
|
||||||
|
image: docker.gitea.com/gitea:1.24.7
|
||||||
|
container_name: gitea
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
environment:
|
||||||
|
USER_UID: 1000
|
||||||
|
USER_GID: 1000
|
||||||
|
GITEA__server__DOMAIN: git.thomasmlg.fr
|
||||||
|
GITEA__server__ROOT_URL: https://git.thomasmlg.fr/
|
||||||
|
GITEA__server__SSH_DOMAIN: git.thomasmlg.fr
|
||||||
|
GITEA__server__SSH_PORT: 2222
|
||||||
|
GITEA__server__START_SSH_SERVER: "false"
|
||||||
|
GITEA__service__DISABLE_REGISTRATION: "true"
|
||||||
|
volumes:
|
||||||
|
- ./data:/data
|
||||||
|
- /etc/timezone:/etc/timezone:ro
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
|
- "2222:22"
|
||||||
|
secrets:
|
||||||
|
- postgres_password
|
||||||
|
networks:
|
||||||
|
- gitea_internal
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
postgres_password:
|
||||||
|
file: ./secrets/postgres_password
|
||||||
|
|
||||||
|
networks:
|
||||||
|
gitea_internal:
|
||||||
Reference in New Issue
Block a user