Files
gesthub/README.md
2025-05-19 19:36:44 +02:00

9.2 KiB
Raw Blame History

📘 Gesthub

last-commit

Construit avec les outils et les technologies nécessaires :

Flask JSON Keycloak GNU%20Bash MariaDB
Docker Python Mattermost

🧱 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 dannonces 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 automatique
  • flask: Application web backend
  • mariadb: Base de données
  • keycloak: SSO + gestion utilisateurs
  • mattermost: Chat et gestion de tâches (type Trello)

Réseau utilisé : gesthub_gesthub


🔐 Authentification Keycloak

Étapes :

  1. Création du realm Gesthub

  2. Ajout des clients (Flask et Mattermost)

  3. Activation OpenID Connect

  4. Configuration des Redirect URIs

    • Exemples :
      • Flask → https://dashboard.ninolbt.com/login/callback
      • Mattermost → https://mattermost.ninolbt.com/signup/openid/complete
  5. Pour les utilisateurs /admin, on utilise le groupe /admin dans 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 dannonces 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
repo-top-language repo-language-count

Built with the tools and technologies:

Flask JSON Keycloak GNU%20Bash MariaDB
Docker Python Mattermost bat

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:

  1. Clone the repository:

     git clone https://github.com/M1n-0/gesthub
    
  2. Navigate to the project directory:

     cd gesthub
    
  3. 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

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your github account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone https://github.com/M1n-0/gesthub
    
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
    
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
    
  6. Push to github: Push the changes to your forked repository.
    git push origin new-feature-x
    
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. 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.