No description
- Go 92.3%
- Makefile 5.5%
- Dockerfile 1.1%
- Nix 0.7%
- Shell 0.4%
| .docker | ||
| .forgejo/workflows | ||
| .hooks | ||
| assets/templates/mail | ||
| controllers | ||
| ent | ||
| enums | ||
| errors | ||
| healthcheck | ||
| middlewares | ||
| routes | ||
| tests | ||
| tmp | ||
| tools | ||
| utils | ||
| .air.toml | ||
| .devenv.flake.nix | ||
| .env.example | ||
| .envrc | ||
| .gitignore | ||
| devenv.lock | ||
| devenv.nix | ||
| devenv.yaml | ||
| entrypoint.sh | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| Makefile | ||
| README.md | ||
| sonar-project.properties | ||
Template golang
Template Golang for the backend
Authors
Badges
Add badges from somewhere like: shields.io
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
- Create role
- 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