commit ed92960c47483fe4da7363ea79952061f8aaa37c Author: Co-op Cloud <> Date: Fri Jun 11 13:36:21 2021 +0200 Initial commit diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..71780b3 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,56 @@ +--- +kind: pipeline +name: deploy to swarm-test.autonomic.zone +steps: + - name: deployment + image: decentral1se/stack-ssh-deploy:latest + settings: + host: swarm-test.autonomic.zone + stack: keycloak_collective_portal + purge: true + deploy_key: + from_secret: drone_ssh_swarm_test + environment: + DOMAIN: keycloak-collective-portal.swarm-test.autonomic.zone + STACK_NAME: keycloak_collective_portal + LETS_ENCRYPT_ENV: production + + - name: notify coopcloud-dev on failure + image: plugins/matrix + settings: + homeserver: https://matrix.autonomic.zone + roomid: "IFazIpLtxiScqbHqoa:autonomic.zone" + userid: "@autono-bot:autonomic.zone" + accesstoken: + from_secret: autono_bot_access_token + depends_on: + - deployment + when: + status: + - failure +trigger: + branch: + - main + +--- +kind: pipeline +name: recipe release +steps: + - name: release a new version + image: decentral1se/drone-abra:latest + settings: + command: recipe keycloak-collective-portal release + deploy_key: + from_secret: abra_bot_deploy_key + + - name: trigger downstream builds + image: plugins/downstream + settings: + server: https://drone.autonomic.zone + token: + from_secret: decentral1se_token + fork: true + repositories: + - coop-cloud/auto-apps-json + depends_on: + - release a new version \ No newline at end of file diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000..04eb791 --- /dev/null +++ b/.env.sample @@ -0,0 +1,6 @@ +TYPE=keycloak-collective-portal + +DOMAIN=keycloak-collective-portal.example.com +## Domain aliases +#EXTRA_DOMAINS=', `www.keycloak-collective-portal.example.com`' +LETS_ENCRYPT_ENV=production diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..37b52cc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.envrc diff --git a/README.md b/README.md new file mode 100644 index 0000000..7af47d7 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# Keycloak-Collective-Portal + +Community Keycloak SSO user management. + + +* **Category**: +* **Status**: +* **Image**: [`keycloak-collective-portal`](https://hub.docker.com/r/keycloak-collective-portal/keycloak-collective-portal) +* **Healthcheck**: +* **Backups**: +* **Email**: +* **Tests**: +* **SSO**: + + +## Basic usage + +1. Set up Docker Swarm and [`abra`] +2. Deploy [`coop-cloud/traefik`] +3. `abra app new keycloak-collective-portal --secrets` (optionally with `--pass` if you'd like + to save secrets in `pass`) +4. `abra app YOURAPPDOMAIN config` - be sure to change `DOMAIN` to something that resolves to + your Docker swarm box +5. `abra app YOURAPPDOMAIN deploy` +6. Open the configured domain in your browser to finish set-up + +[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra +[`coop-cloud/traefik`]: https://git.autonomic.zone/coop-cloud/traefik diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..662a96c --- /dev/null +++ b/compose.yml @@ -0,0 +1,31 @@ +--- +version: "3.8" + +services: + app: + image: nginx:1.19.2 + networks: + - proxy + deploy: + restart_policy: + condition: on-failure + labels: + - "traefik.enable=true" + - "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80" + - "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})" + - "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure" + - "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}" + ## Redirect from EXTRA_DOMAINS to DOMAIN + #- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect" + #- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true" + #- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost"] + interval: 30s + timeout: 10s + retries: 10 + start_period: 1m + +networks: + proxy: + external: true