mirror of
				https://github.com/zokradonh/kopano-docker
				synced 2025-10-30 18:07:46 +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:
		
							parent
							
								
									f7934cbc51
								
							
						
					
					
						commit
						87b844b10e
					
				
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								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 | ||||
|  | ||||
| @ -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: | ||||
|  | ||||
							
								
								
									
										14
									
								
								grapi-explorer/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								grapi-explorer/README.md
									
									
									
									
									
										Normal 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/`. | ||||
							
								
								
									
										15
									
								
								grapi-explorer/grapi-explorer.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								grapi-explorer/grapi-explorer.yml
									
									
									
									
									
										Normal 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 | ||||
| @ -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" \ | ||||
|  | ||||
							
								
								
									
										10
									
								
								web/kweb.cfg
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								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 | ||||
| 	} | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user