diff --git a/README.md b/README.md index 52ade4d..ae5a21b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,49 @@ -# Template-Docker +# vault -Template-Docker \ No newline at end of file +Vault est un outil permettant d'accéder à des secrets en toute sécurité. Un secret est un élément dont vous souhaitez contrôler étroitement l'accès, comme les clés d'API, les mots de passe, les certificats, etc. Vault fournit une interface unifiée à n'importe quel secret, tout en assurant un contrôle d'accès strict et en enregistrant un journal d'audit détaillé. + +# A propos de + +# Prérequis + +Vous avez besoin d'une installation docker fonctionnelle et de docker-compose sur votre machine. + +# Démarrage + +~~~bash + git clone https://gitea.tips-of-mine.com/Tips-Of-Mine/vault.git + cd vault +~~~ + +## Personnalisation + +Le fichier .env pour les variable d'environnement +~~~bash + nano .env +~~~ + +Modification des labels pour traefik +~~~bash + nano docker-compose.yml +~~~ + +## Lancement + +~~~bash + docker compose up -d +~~~ + +~~~bash + docker compose logs -f +~~~ + +~~~bash + docker exec -it vault-app /bin/sh +~~~ + +~~~bash + vault operator init +~~~ + +# Buy me a coffe +Buy Me a Coffee at ko-fi.com \ No newline at end of file diff --git a/config/config.hcl b/config/config.hcl new file mode 100644 index 0000000..7a5e510 --- /dev/null +++ b/config/config.hcl @@ -0,0 +1,18 @@ + +ui = true +disable_mlock = "true" + +storage "raft" { + path = "/vault/data" + node_id = "node1" +} + +listener "tcp" { + address = "[::]:8200" + tls_disable = "true" + tls_cert_file = "/certs/cert.pem" + tls_key_file = "/certs/privkey.pem" +} + +api_addr = "https://vault.tips-of-mine.com" +cluster_addr = "https://vault.tips-of-mine.com:8201" diff --git a/docker-compose.yml b/docker-compose.yml index 06cfd5f..69187d8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,28 +2,19 @@ networks: traefik_front_network: external: true - back_network_vault: - driver: bridge - attachable: true #### SERVICES services: vault: - container_name: vault-new - hostname: vault-new + container_name: vault-app + hostname: vault-app image: hashicorp/vault:latest environment: VAULT_ADDR: "https://vault.tips-of-mine.com" VAULT_API_ADDR: "https://vault.tips-of-mine.com" VAULT_ADDRESS: "https://vault.tips-of-mine.com" - # VAULT_UI: true - # VAULT_TOKEN: -# ports: -# - "8200:8200" -# - "8201:8201" networks: - traefik_front_network - - back_network_vault labels: - "traefik.enable=true" - "traefik.docker.network=traefik_front_network" diff --git a/install-docker.sh b/install-docker.sh new file mode 100644 index 0000000..354aade --- /dev/null +++ b/install-docker.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# Pour docker et le plugin compose pour docker sur un Debian + + +# Add Docker's official GPG key: +apt-get update +apt-get install ca-certificates curl +install -m 0755 -d /etc/apt/keyrings +curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc +chmod a+r /etc/apt/keyrings/docker.asc + +# Add the repository to Apt sources: +echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \ + $(. /etc/os-release && echo "VERSION_CODENAME") stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null +apt-get update + +apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin \ No newline at end of file