diff --git a/Makefile b/Makefile index ebc3789..db6d038 100644 --- a/Makefile +++ b/Makefile @@ -325,7 +325,7 @@ publish-zpush: tag-zpush component=zpush make publish-container lint: - git ls-files | xargs --max-lines=1 eclint check + git ls-files | xargs eclint check grep -rIl '^#![[:blank:]]*/bin/\(bash\|sh\|zsh\)' \ --exclude-dir=.git --exclude=*.sw? \ | xargs shellcheck -x diff --git a/docker-compose.yml b/docker-compose.yml index 05463b3..d63f212 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -240,7 +240,6 @@ services: - ADDITIONAL_KOPANO_WEBAPP_PLUGINS=${ADDITIONAL_KOPANO_WEBAPP_PLUGINS} - KCCONF_WEBAPP_OIDC_ISS=https://${FQDN} - KCCONF_WEBAPP_OIDC_CLIENT_ID=webapp - env_file: - kopano_webapp.env networks: diff --git a/grapi-explorer/README.md b/grapi-explorer/README.md new file mode 100644 index 0000000..bfd1758 --- /dev/null +++ b/grapi-explorer/README.md @@ -0,0 +1,14 @@ +# Kopano Grapi Explorer + +The Grapi Explorer is a fork of the Microsoft Graph Explorer, which has been modified so that it can connect against a self hosted Kopano GRAPI. Similar to the Grapi Playground it can be used to inspect the flows that are required to use the Kopano RestAPI and experiment with different query types. + +## How to use the Grapi Explorer? + + 1. Add the `grapi-explorer.yml` to the `COMPOSE_FILE` variable in your `.env` file. + + Example: +``` +COMPOSE_FILE=docker-compose.yml:docker-compose.ports.yml:grapi-explorer/grapi-explorer.yml +``` + + 2. Run `docker-compose up -d` and you will find the grapi-explorer at `https://your-fqdn/grapi-explorer/`. \ No newline at end of file diff --git a/grapi-explorer/grapi-explorer.yml b/grapi-explorer/grapi-explorer.yml new file mode 100644 index 0000000..9b9c165 --- /dev/null +++ b/grapi-explorer/grapi-explorer.yml @@ -0,0 +1,15 @@ +version: "3.5" + +services: + kopano_grapi-explorer: + image: kopano/grapi-explorer + restart: unless-stopped + depends_on: + - kopano_kapi + - kopano_konnect + environment: + - GRAPI_EXPLORER_ISS=https://${FQDN} + - GRAPI_EXPLORER_GRAPH_URL=https://${FQDN}/api/gc + networks: + - kopano-net + - web-net \ No newline at end of file diff --git a/konnect/wrapper.sh b/konnect/wrapper.sh index c5cb803..9a9a181 100755 --- a/konnect/wrapper.sh +++ b/konnect/wrapper.sh @@ -10,7 +10,9 @@ cd /kopano/ssl/ konnectd utils jwk-from-pem --use sig /kopano/ssl/meet-kwmserver.pem > /tmp/jwk-meet.json CONFIG_JSON=/etc/kopano/konnectd-identifier-registration.yaml -yq -y ".clients |= [{\"id\": \"kpop-https://$FQDN/meet/\", \"name\": \"Kopano Meet\", \"application_type\": \"web\", \"trusted\": true, \"redirect_uris\": [\"https://$FQDN/meet/\"], \"trusted_scopes\": [\"konnect/guestok\", \"kopano/kwm\"], \"jwks\": {\"keys\": [{\"kty\": $(jq .kty /tmp/jwk-meet.json), \"use\": $(jq .use /tmp/jwk-meet.json), \"crv\": $(jq .crv /tmp/jwk-meet.json), \"d\": $(jq .d /tmp/jwk-meet.json), \"kid\": $(jq .kid /tmp/jwk-meet.json), \"x\": $(jq .x /tmp/jwk-meet.json), \"y\": $(jq .y /tmp/jwk-meet.json)}]},\"request_object_signing_alg\": \"ES256\"}]" $CONFIG_JSON | sponge /kopano/ssl/konnectd-identifier-registration.yaml +#yq -y ".clients += [{\"id\": \"grapi-explorer.js\", \"name\": \"Grapi Explorer\", \"application_type\": \"web\", \"trusted\": true, \"insecure\": true, \"redirect_uris\": [\"http://$FQDNCLEANED:3000/\"]}]" $CONFIG_JSON | sponge $CONFIG_JSON +yq -y ".clients += [{\"id\": \"kpop-https://$FQDN/meet/\", \"name\": \"Kopano Meet\", \"application_type\": \"web\", \"trusted\": true, \"redirect_uris\": [\"https://$FQDN/meet/\"], \"trusted_scopes\": [\"konnect/guestok\", \"kopano/kwm\"], \"jwks\": {\"keys\": [{\"kty\": $(jq .kty /tmp/jwk-meet.json), \"use\": $(jq .use /tmp/jwk-meet.json), \"crv\": $(jq .crv /tmp/jwk-meet.json), \"d\": $(jq .d /tmp/jwk-meet.json), \"kid\": $(jq .kid /tmp/jwk-meet.json), \"x\": $(jq .x /tmp/jwk-meet.json), \"y\": $(jq .y /tmp/jwk-meet.json)}]},\"request_object_signing_alg\": \"ES256\"}]" $CONFIG_JSON | sponge $CONFIG_JSON +yq -y . $CONFIG_JSON | sponge /kopano/ssl/konnectd-identifier-registration.yaml # shellcheck disable=SC2154 if [ -n "$log_level" ]; then @@ -31,7 +33,7 @@ dockerize \ -wait file:///kopano/ssl/konnectd-tokens-signing-key.pem \ -wait file:///kopano/ssl/konnectd-encryption.key \ -timeout 360s -konnectd serve \ +exec konnectd serve \ --signing-private-key=/kopano/ssl/konnectd-tokens-signing-key.pem \ --encryption-secret=/kopano/ssl/konnectd-encryption.key \ --iss=https://"$FQDN" \ diff --git a/web/kweb.cfg b/web/kweb.cfg index b21c577..81842b4 100644 --- a/web/kweb.cfg +++ b/web/kweb.cfg @@ -1,4 +1,4 @@ -{%FQDN%}:80, :80 { +{%FQDN%}:80, *:80 { redir / https://{host}{uri} } @@ -103,7 +103,6 @@ } folderish /kapi-playground - # Kwmserver proxy /upstreams/kwmserver/ { without /upstreams/kwmserver/ @@ -197,4 +196,11 @@ transparent } redir /password-reset /password-reset/ + + proxy /grapi-explorer/ http://kopano_grapi-explorer:3000/ { + fail_timeout 10s + try_duration 30s + transparent + keepalive 100 + } }