9.2 KiB
📘 Gesthub
Construit avec les outils et les technologies nécessaires :
🧱 Objectif
Créer un site web multi-services (extranet/intranet) avec :
- Authentification centralisée via Keycloak
- Reverse proxy Caddy
- Frontend/backend Flask
- Chat & Gestion de tâches via Mattermost
- Gestion d’annonces via JSON avec droits
/admin(a faire)
🐳 Démarrage du projet
1. Structure Docker
Les services sont définis dans docker-compose.yml :
caddy: Reverse proxy + HTTPS automatiqueflask: Application web backendmariadb: Base de donnéeskeycloak: SSO + gestion utilisateursmattermost: Chat et gestion de tâches (type Trello)
Réseau utilisé : gesthub_gesthub
🔐 Authentification Keycloak
✅ Étapes :
-
Création du realm
Gesthub -
Ajout des clients (Flask et Mattermost)
-
Activation
OpenID Connect -
Configuration des Redirect URIs
- Exemples :
- Flask →
https://dashboard.ninolbt.com/login/callback - Mattermost →
https://mattermost.ninolbt.com/signup/openid/complete
- Flask →
- Exemples :
-
Pour les utilisateurs
/admin, on utilise le groupe/admindans Keycloak.
🌐 Reverse Proxy Caddy
🛠️ Caddyfile :
https://dashboard.ninolbt.com {
reverse_proxy flask:5000
}
https://keycloak.ninolbt.com {
reverse_proxy keycloak:8080
}
https://mattermost.ninolbt.com {
reverse_proxy mattermost:8065
}
Volumes persistants :
caddy_data et caddy_config montés dans /data et /config
🧩 Flask
- back du dashboard
- Permet la création/modification/suppression d’annonces en JSON (en test)
- Accessible uniquement pour les utilisateurs avec le rôle
/admin(via token) (en test) - Chargement des assets statiques corrigé avec Caddy
🗂️ Gestion des droits
- Auth via Keycloak pour Flask, Mattermost, Wekan
- Vérification des groupes dans Flask (
/admin) - Redirections correctes avec URLs HTTPS Caddy
📌 Bugs et corrections
- ⚠️ Redirection Keycloak incorrecte → Corrigé avec bon
redirect_uri - ⚠️ Assets statiques Flask → corrigé via URL absolue en HTTPS
- ✅ Reverse proxy fonctionne avec tous les services
- ✅ HTTPS opérationnel via Caddy avec certificats Let's Encrypt
🚀 Démarrage
docker compose up --build -d
Si besoin :
docker compose logs -f [service]
📤 Export complet
Pour rendre le projet exportable :
- Tout est containerisé (Docker)
- Config Keycloak exporté (JSON disponible dans le dossier
export_keycloak) docker-compose.yml,Caddyfile, fichier disponible dans le repo
Built with the tools and technologies:
Table of Contents
Overview
Gesthub is a powerful developer tool designed to streamline the setup and management of full-stack applications by integrating essential services into a cohesive environment.
Why Gesthub?
This project simplifies the development process, allowing developers to focus on building features rather than managing infrastructure. The core features include:
- 🚀 Docker Compose Configuration: Simplifies orchestration of multiple services, reducing setup complexity.
- 🌐 Local Domain Management: Scripts to add local domain entries streamline access to services, enhancing the development experience.
- 🔒 Integrated User Authentication: Utilizes Keycloak for secure user management, addressing security concerns.
- ⚙️ Seamless Routing and Load Balancing: Caddyfile configuration ensures efficient request handling, improving performance.
- 🎨 User-Friendly Interface: Responsive design enhances collaboration and user experience.
- 📊 Centralized Data Management: Structured storage for advertisements improves data handling capabilities.
Getting Started
Prerequisites
This project requires the following dependencies:
- Programming Language: Shell
- Package Manager: Bash
- Container Runtime: Docker
Installation
Build gesthub from the source and intsall dependencies:
-
Clone the repository:
❯ git clone https://github.com/M1n-0/gesthub -
Navigate to the project directory:
❯ cd gesthub -
Install the dependencies:
Using docker:
❯ docker build -t M1n-0/gesthub .
Using bash:
❯ chmod +x {entrypoint}
Usage
Run the project with:
Using docker:
docker run -it {image_name}
Using bash:
./{entrypoint}
Testing
Gesthub uses the {test_framework} test framework. Run the test suite with:
Using docker:
echo 'INSERT-TEST-COMMAND-HERE'
Using bash:
bats *.bats
Contributing
- 💬 Join the Discussions: Share your insights, provide feedback, or ask questions.
- 🐛 Report Issues: Submit bugs found or log feature requests for the
gesthubproject. - 💡 Submit Pull Requests: Review open PRs, and submit your own PRs.
Contributing Guidelines
- Fork the Repository: Start by forking the project repository to your github account.
- Clone Locally: Clone the forked repository to your local machine using a git client.
git clone https://github.com/M1n-0/gesthub - Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x - Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.' - Push to github: Push the changes to your forked repository.
git push origin new-feature-x - Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
- Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
Contributor Graph
Acknowledgments
- Credit
contributors,inspiration,references, etc.