No description
  • Go 92.3%
  • Makefile 5.5%
  • Dockerfile 1.1%
  • Nix 0.7%
  • Shell 0.4%
Find a file Use this template
2024-10-30 00:12:51 +01:00
.docker 🐛 Fix dockerfile 2024-10-30 00:12:51 +01:00
.forgejo/workflows 🐛 Fix vars 2024-10-28 22:03:49 +01:00
.hooks 🚀 Add template 2024-10-28 19:25:20 +01:00
assets/templates/mail 🚀 Add template 2024-10-28 19:25:20 +01:00
controllers 🚀 Add template 2024-10-28 19:25:20 +01:00
ent 🚀 Add template 2024-10-28 19:25:20 +01:00
enums 🚀 Add template 2024-10-28 19:25:20 +01:00
errors 🚀 Add template 2024-10-28 19:25:20 +01:00
healthcheck 🚀 Add template 2024-10-28 19:25:20 +01:00
middlewares 🚀 Add template 2024-10-28 19:25:20 +01:00
routes 🚀 Add template 2024-10-28 19:25:20 +01:00
tests 🚀 Add template 2024-10-28 19:25:20 +01:00
tmp 🚀 Add template 2024-10-28 19:25:20 +01:00
tools 🚀 Add template 2024-10-28 19:25:20 +01:00
utils 🚀 Add template 2024-10-28 19:25:20 +01:00
.air.toml 🚀 Add template 2024-10-28 19:25:20 +01:00
.devenv.flake.nix 🚀 Add template 2024-10-28 19:25:20 +01:00
.env.example 🚀 Add template 2024-10-28 19:25:20 +01:00
.envrc 🚀 Add template 2024-10-28 19:25:20 +01:00
.gitignore 🚀 Add template 2024-10-28 19:25:20 +01:00
devenv.lock 🚀 Add template 2024-10-28 19:25:20 +01:00
devenv.nix 🚀 Add template 2024-10-28 19:25:20 +01:00
devenv.yaml 🚀 Add template 2024-10-28 19:25:20 +01:00
entrypoint.sh 🚀 Add template 2024-10-28 19:25:20 +01:00
go.mod 🚀 Add template 2024-10-28 19:25:20 +01:00
go.sum 🚀 Add template 2024-10-28 19:25:20 +01:00
LICENSE Initial commit 2024-10-16 22:45:11 +02:00
main.go 🚀 Add template 2024-10-28 19:25:20 +01:00
Makefile 🚀 Add template 2024-10-28 19:25:20 +01:00
README.md 📝 Update readme 2024-10-28 19:28:11 +01:00
sonar-project.properties 🚀 Add template 2024-10-28 19:25:20 +01:00

Template golang

Template Golang for the backend

Authors

Badges

Add badges from somewhere like: shields.io

MIT License GPLv3 License AGPL License

Requirements

On Ubuntu

  • make apt install make -y
  • devenv
  • docker and docker compote curl -fsSL https://get.docker.com -o get-docker.sh

Installation

Preparation for devs

  cd {repository}
  make prepare-dev
  make install

Develop

  • Start stack redis/minio/postgres with make docker-dev-up
  • Start backend make dev

Production

OIDC setup

For keycloak :

  • Créer a new openid client
  • Set Valid redirect URL to environment variable OIDC_REDIRECT
  • For RGPD, in "Login settings" enable "Consent required"
  • Go to "Roles"
    • Create role admin
    • Create role user
  • Ensure to add client role scope
    • Go to "Client scopes"
    • Click on "[client-name]-dedicated"
    • Add Mapper
    • By configuration
    • User Client Role
      • Name: roles (example)
      • Client ID : [select corresponding client]
      • Multivalued : On
      • Token Claim name : role
      • Claim JSON Type : String
      • Add to ID token : On
      • Add to access token : On
      • Add to userinfo : On
  • In .env file, complete the followed variables :
OIDC_ISSUER=https://[IP]/auth/realms/[REALM]
OIDC_CLIENT_ID=(see client name)
OIDC_CLIENT_SECRET=(see client->settings, enable "Client authentication", go to "Credentials" tab, copy "Client secret" value)
OIDC_REDIRECT=http://localhost:3000/auth/callback