1
0
mirror of https://github.com/zokradonh/kopano-docker synced 2025-06-07 16:06:14 +00:00

Add grapi-explorer (#215)

* grapi explorer is located in its own (optional) file
* update readme
* optimize eclint check
This commit is contained in:
Felix Bartels 2019-08-20 21:58:54 +02:00 committed by GitHub
parent f7934cbc51
commit 87b844b10e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 42 additions and 6 deletions

View File

@ -325,7 +325,7 @@ publish-zpush: tag-zpush
component=zpush make publish-container component=zpush make publish-container
lint: lint:
git ls-files | xargs --max-lines=1 eclint check git ls-files | xargs eclint check
grep -rIl '^#![[:blank:]]*/bin/\(bash\|sh\|zsh\)' \ grep -rIl '^#![[:blank:]]*/bin/\(bash\|sh\|zsh\)' \
--exclude-dir=.git --exclude=*.sw? \ --exclude-dir=.git --exclude=*.sw? \
| xargs shellcheck -x | xargs shellcheck -x

View File

@ -240,7 +240,6 @@ services:
- ADDITIONAL_KOPANO_WEBAPP_PLUGINS=${ADDITIONAL_KOPANO_WEBAPP_PLUGINS} - ADDITIONAL_KOPANO_WEBAPP_PLUGINS=${ADDITIONAL_KOPANO_WEBAPP_PLUGINS}
- KCCONF_WEBAPP_OIDC_ISS=https://${FQDN} - KCCONF_WEBAPP_OIDC_ISS=https://${FQDN}
- KCCONF_WEBAPP_OIDC_CLIENT_ID=webapp - KCCONF_WEBAPP_OIDC_CLIENT_ID=webapp
env_file: env_file:
- kopano_webapp.env - kopano_webapp.env
networks: networks:

14
grapi-explorer/README.md Normal file
View File

@ -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/`.

View File

@ -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

View File

@ -10,7 +10,9 @@ cd /kopano/ssl/
konnectd utils jwk-from-pem --use sig /kopano/ssl/meet-kwmserver.pem > /tmp/jwk-meet.json konnectd utils jwk-from-pem --use sig /kopano/ssl/meet-kwmserver.pem > /tmp/jwk-meet.json
CONFIG_JSON=/etc/kopano/konnectd-identifier-registration.yaml 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 # shellcheck disable=SC2154
if [ -n "$log_level" ]; then if [ -n "$log_level" ]; then
@ -31,7 +33,7 @@ dockerize \
-wait file:///kopano/ssl/konnectd-tokens-signing-key.pem \ -wait file:///kopano/ssl/konnectd-tokens-signing-key.pem \
-wait file:///kopano/ssl/konnectd-encryption.key \ -wait file:///kopano/ssl/konnectd-encryption.key \
-timeout 360s -timeout 360s
konnectd serve \ exec konnectd serve \
--signing-private-key=/kopano/ssl/konnectd-tokens-signing-key.pem \ --signing-private-key=/kopano/ssl/konnectd-tokens-signing-key.pem \
--encryption-secret=/kopano/ssl/konnectd-encryption.key \ --encryption-secret=/kopano/ssl/konnectd-encryption.key \
--iss=https://"$FQDN" \ --iss=https://"$FQDN" \

View File

@ -1,4 +1,4 @@
{%FQDN%}:80, :80 { {%FQDN%}:80, *:80 {
redir / https://{host}{uri} redir / https://{host}{uri}
} }
@ -103,7 +103,6 @@
} }
folderish /kapi-playground folderish /kapi-playground
# Kwmserver # Kwmserver
proxy /upstreams/kwmserver/ { proxy /upstreams/kwmserver/ {
without /upstreams/kwmserver/ without /upstreams/kwmserver/
@ -197,4 +196,11 @@
transparent transparent
} }
redir /password-reset /password-reset/ redir /password-reset /password-reset/
proxy /grapi-explorer/ http://kopano_grapi-explorer:3000/ {
fail_timeout 10s
try_duration 30s
transparent
keepalive 100
}
} }