{"id":14975897,"url":"https://github.com/liq05/kong-kong-dashboard-docker-compose","last_synced_at":"2026-03-02T22:06:59.132Z","repository":{"id":203259844,"uuid":"164422440","full_name":"liq05/kong-kong-dashboard-docker-compose","owner":"liq05","description":"kong + kong dashboard docker-compose","archived":false,"fork":false,"pushed_at":"2019-01-16T10:15:36.000Z","size":23,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T02:18:13.825Z","etag":null,"topics":["docker-compose","dockercompose","kong","kong-dashboard"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liq05.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-07T11:25:22.000Z","updated_at":"2021-11-08T06:40:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"63b1e189-f2ed-4d92-ad6a-67ea192dc30b","html_url":"https://github.com/liq05/kong-kong-dashboard-docker-compose","commit_stats":{"total_commits":17,"total_committers":2,"mean_commits":8.5,"dds":0.2941176470588235,"last_synced_commit":"71f1f1dfa7b881934d516c24220afb92d172e2af"},"previous_names":["liq05/kong-kong-dashboard-docker-compose"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liq05%2Fkong-kong-dashboard-docker-compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liq05%2Fkong-kong-dashboard-docker-compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liq05%2Fkong-kong-dashboard-docker-compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liq05%2Fkong-kong-dashboard-docker-compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liq05","download_url":"https://codeload.github.com/liq05/kong-kong-dashboard-docker-compose/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241110788,"owners_count":19911396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-compose","dockercompose","kong","kong-dashboard"],"created_at":"2024-09-24T13:52:49.776Z","updated_at":"2026-03-02T22:06:59.074Z","avatar_url":"https://github.com/liq05.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker compose of kong and kong dashboard\n\n- postgresql volume mapping \n\n- logging:fluentd+elasticsearch+kibana\n\n#### reference\n\n1.logging\n\nhttps://docs.fluentd.org/v0.12/articles/docker-logging-efk-compose\n\n2.kong\n\nhttps://github.com/Kong/docker-kong/blob/master/compose/docker-compose.yml\n\n3.kong dashboard\n\nhttps://gist.github.com/oogali/0a3555b0f766dcecc104717203130f6e\n\n4.kong oauth2(notice parameter:grant_type)\n\nhttps://github.com/Kong/kong-oauth2-hello-world\n\ngrant_type details\n\nhttps://docs.konghq.com/hub/kong-inc/oauth2/\n\n##### grant_type as follows(four type):\nconfig.enable_authorization_code\n\ndetails:https://tools.ietf.org/html/rfc6749#section-4.1\n\nconfig.enable_client_credentials\n\ndetails:https://tools.ietf.org/html/rfc6749#section-4.4\n\nconfig.enable_implicit_grant\n\ndetails:https://tools.ietf.org/html/rfc6749#section-4.2\n\nconfig.enable_password_grant(**the easiest type,personal recommendation--test first**)\n\ndatails:https://tools.ietf.org/html/rfc6749#section-4.3 \n\n### Kong Plugin ACL Usage Example:\nSpend several hours. So record the process.\n\nReference:\n\nhttps://docs.konghq.com/hub/kong-inc/acl/\n\nhttps://github.com/Kong/kong-oauth2-hello-world\n\n - Step 1. create a service named as \"mockacl\".\n```shell\ncurl -X POST \\\n  --url \"http://127.0.0.1:8001/services\" \\\n  --data \"name=mockacl\" \\\n  --data \"url=http://mockbin.org/request\"\n```\nResponse:\n```json\n    {\n          \"host\": \"mockbin.org\",\n          \"created_at\": 1547608887,\n          \"connect_timeout\": 60000,\n          \"id\": \"24ad5ced-e5e8-4945-810f-f744fc7354bc\",\n          \"protocol\": \"http\",\n          \"name\": \"mockacl\",\n          \"read_timeout\": 60000,\n          \"port\": 80,\n          \"path\": \"/request\",\n          \"updated_at\": 1547608887,\n          \"retries\": 5,\n          \"write_timeout\": 60000\n      }\n```\n - Step 2. create a route for above service named as  \"mockacl\"\n```shell\ncurl -X POST \\\n  --url \"http://127.0.0.1:8001/services/mockacl/routes\" \\\n  --data 'hosts[]=mockbin.org' \\\n  --data 'paths[]=/mockacl'\n```\nResponse:\n```json\n{\n  \"created_at\": 1547609697,\n  \"strip_path\": true,\n  \"hosts\": [\n    \"mockbin.org\"\n  ],\n  \"preserve_host\": false,\n  \"regex_priority\": 0,\n  \"updated_at\": 1547609697,\n  \"paths\": [\n    \"/mockacl\"\n  ],\n  \"service\": {\n    \"id\": \"24ad5ced-e5e8-4945-810f-f744fc7354bc\"\n  },\n  \"methods\": null,\n  \"protocols\": [\n    \"http\",\n    \"https\"\n  ],\n  \"id\": \"a3cb5007-f351-481e-ac9d-02fbf3e22d0b\"\n}\n```\nNow,try the new service/api. Work fine:\n```shell\ncurl -X GET \\\n  --url \"http://127.0.0.1:8000/mockacl\" \\\n  --header \"Host: mockbin.org\"\n```\nResponse:\n```json\n{\n  \"startedDateTime\": \"2019-01-16T03:15:58.678Z\",\n  \"clientIPAddress\": \"172.20.0.1\",\n  \"method\": \"GET\",\n  \"url\": \"http://mockbin.org/request\",\n  \"httpVersion\": \"HTTP/1.1\",\n  \"cookies\": {},\n  \"headers\": {\n    \"host\": \"mockbin.org\",\n    \"connection\": \"close\",\n    \"x-forwarded-for\": \"172.20.0.1, 10.1.193.136, 54.209.226.208\",\n    \"x-forwarded-proto\": \"http\",\n    \"x-forwarded-host\": \"mockbin.org\",\n    \"x-forwarded-port\": \"80\",\n    \"x-real-ip\": \"118.122.119.70\",\n    \"kong-cloud-request-id\": \"c56edc7f1eb558d21f2047ef0c56b1b2\",\n    \"kong-client-id\": \"mockbineast\",\n    \"user-agent\": \"curl/7.29.0\",\n    \"accept\": \"*/*\",\n    \"x-request-id\": \"001f06cb-c332-4b4b-bb6e-53b68fc920c3\",\n    \"via\": \"1.1 vegur\",\n    \"connect-time\": \"0\",\n    \"x-request-start\": \"1547608558674\",\n    \"total-route-time\": \"0\"\n  },\n  \"queryString\": {},\n  \"postData\": {\n    \"mimeType\": \"application/octet-stream\",\n    \"text\": \"\",\n    \"params\": []\n  },\n  \"headersSize\": 505,\n  \"bodySize\": 0\n}\n```\n - Step 3. create ACL plugin for above service\n```shell\ncurl -X POST http://127.0.0.1:8001/services/mockacl/plugins \\\n     --data \"name=acl\"  \\\n     --data \"config.whitelist=aclgroup\" \\\n     --data \"config.hide_groups_header=true\"\n```\nNow,try the new service/api. You will not be allowed to consume this service:\n```shell\ncurl -X GET \\\n  --url \"http://127.0.0.1:8000/mockacl\" \\\n  --header \"Host: mockbin.org\"\n```\nThe response as follows:\n```json\n{\"message\":\"You cannot consume this service\"}\n```\nACL plugin become effective.\n - Step 4. create a Kong consumer (called \"mockacluser\")  and add group to above consumer\n```shell\ncurl -X POST \\\n  --url \"http://127.0.0.1:8001/consumers/\" \\\n  --data \"username=mockacluser\"\n```\nResponse :\n```json\n{\n  \"custom_id\": null,\n  \"created_at\": 1547621622,\n  \"username\": \"mockacluser\",\n  \"id\": \"cf88cb4f-fb5b-4158-9915-eb5df988b1fd\"\n}\n```\nAdd ACL group(called \"aclugroup\") to above consumer, the group name must be the same as \"config.whitelist\" of Step 3\n```shell\ncurl -X POST \\\n  --url \"http://127.0.0.1:8001/consumers/mockacluser/acls\" \\\n  --data \"group=aclgroup\"\n```\nResponse :\n```json\n{\n  \"group\": \"aclgroup\",\n  \"created_at\": 1547624003000,\n  \"id\": \"8913b7ef-54a9-422a-b2be-d04274dd5c9b\",\n  \"consumer_id\": \"cf88cb4f-fb5b-4158-9915-eb5df988b1fd\"\n}\n```\n - Step 5. follow the official description. We add basic Authorization (username is \"mockacluser\", password is \"mockaclpw\" ) to above consumer.\n```shell\ncurl -X POST \\\n     --url http://127.0.0.1:8001/consumers/mockacluser/basic-auth \\\n     --data \"username=mockacluser\" \\\n     --data \"password=mockaclpw\"\n```\nResponse :\n```json\n{\n  \"created_at\": 1547624451000,\n  \"id\": \"84516d9a-a0fa-4f57-af1b-aca5319bfb37\",\n  \"username\": \"mockacluser\",\n  \"password\": \"9b91b3b39365d00cf0a1f283647aebbd5472013f\",\n  \"consumer_id\": \"cf88cb4f-fb5b-4158-9915-eb5df988b1fd\"\n}\n```\nFollow the official description, we get the Authorization header is \"bW9ja2FjbHVzZXI6bW9ja2FjbHB3\". Then, we try the service as follows:\n```shell\ncurl -X GET \\\n     --url \"http://127.0.0.1:8000/mockacl\" \\\n     --header \"Host: mockbin.org\" \\\n     --header \"Authorization: Basic bW9ja2FjbHVzZXI6bW9ja2FjbHB3\"\n```\nwe get the response\n```json\n{\"message\":\"You cannot consume this service\"}\n```\nWhy?  There are some problems which i spend a lot of time to solve. You must config authentication plugin to the service named as \"mockacl\" .Otherwise, you will never be allowed to consume this service. So we try to do it.\n```shell\ncurl -X POST http://127.0.0.1:8001/services/mockacl/plugins \\\n    --data \"name=basic-auth\"  \\\n    --data \"config.hide_credentials=true\"  \n```\nResponse:\n```json\n{\n  \"created_at\": 1547625339000,\n  \"config\": {\n    \"hide_credentials\": true,\n    \"anonymous\": \"\"\n  },\n  \"id\": \"f56e2e6e-0ec9-4faf-801d-b402393f54fc\",\n  \"enabled\": true,\n  \"service_id\": \"24ad5ced-e5e8-4945-810f-f744fc7354bc\",\n  \"name\": \"basic-auth\"\n}\n```\nNow, try the service/api\n```shell\ncurl -X GET \\\n     --url \"http://127.0.0.1:8000/mockacl\" \\\n     --header \"Host: mockbin.org\" \\\n     --header \"Authorization: Basic bW9ja2FjbHVzZXI6bW9ja2FjbHB3\"\n```\nWe get the correct result the same as the Step 2.The all about ACL plugin control.\n\n\n### Kong Plugin OAuth2 Usage Example:\n\nReference:\n\nhttps://github.com/Kong/kong-oauth2-hello-world\n\n - Step 1. create a service named as \"mockauth2\".\n```shell\ncurl -X POST \\\n  --url \"http://127.0.0.1:8001/services\" \\\n  --data \"name=mockauth2\" \\\n  --data \"url=http://mockbin.org/request\"\n```\nResponse:\n```json\n{\n  \"host\": \"mockbin.org\",\n  \"created_at\": 1547630135,\n  \"connect_timeout\": 60000,\n  \"id\": \"798f5c93-7eae-41b0-a3b3-565c23b1ae56\",\n  \"protocol\": \"http\",\n  \"name\": \"mockauth2\",\n  \"read_timeout\": 60000,\n  \"port\": 80,\n  \"path\": \"/request\",\n  \"updated_at\": 1547630135,\n  \"retries\": 5,\n  \"write_timeout\": 60000\n}\n```\n - Step 2. create a route for above service named as  \"mockauth2\"\n```shell\ncurl -X POST \\\n  --url \"http://127.0.0.1:8001/services/mockauth2/routes\" \\\n  --data 'hosts[]=mockbin.org' \\\n  --data 'paths[]=/mockauth2' \n```\nResponse:\n```json\n{\n  \"created_at\": 1547630170,\n  \"strip_path\": true,\n  \"hosts\": [\n    \"mockbin.org\"\n  ],\n  \"preserve_host\": false,\n  \"regex_priority\": 0,\n  \"updated_at\": 1547630170,\n  \"paths\": [\n    \"/mockauth2\"\n  ],\n  \"service\": {\n    \"id\": \"798f5c93-7eae-41b0-a3b3-565c23b1ae56\"\n  },\n  \"methods\": null,\n  \"protocols\": [\n    \"http\",\n    \"https\"\n  ],\n  \"id\": \"9d6e848a-56f9-456f-b6d6-e7b873c0298d\"\n}\n```\nNow,try the new service/api. Work fine:\n```shell\ncurl -X GET \\\n  --url \"http://127.0.0.1:8000/mockauth2\" \\\n  --header \"Host: mockbin.org\" \n```\nResponse:\n```json\n{  \n  \"startedDateTime\": \"2019-01-16T08:56:17.135Z\",  \n  \"clientIPAddress\": \"172.20.0.1\",  \n  \"method\": \"GET\",  \n  \"url\": \"http://mockbin.org/request\",  \n  \"httpVersion\": \"HTTP/1.1\",  \n  \"cookies\": {},  \n  \"headers\": {  \n  \"host\": \"mockbin.org\",  \n  \"connection\": \"close\",  \n  \"x-forwarded-for\": \"172.20.0.1, 10.1.192.50, 18.204.28.183\",  \n  \"x-forwarded-proto\": \"http\",  \n  \"x-forwarded-host\": \"mockbin.org\",  \n  \"x-forwarded-port\": \"80\",  \n  \"x-real-ip\": \"118.122.119.70\",  \n  \"kong-cloud-request-id\": \"2c06c12be5c592b2ea8b0f996acb1a05\",  \n  \"kong-client-id\": \"mockbineast\",  \n  \"user-agent\": \"curl/7.29.0\",  \n  \"accept\": \"*/*\",  \n  \"x-request-id\": \"9994115f-6f03-49fa-9ac4-2285c13aff9f\",  \n  \"via\": \"1.1 vegur\",  \n  \"connect-time\": \"0\",  \n  \"x-request-start\": \"1547628977129\",  \n  \"total-route-time\": \"0\"  \n },  \"queryString\": {},  \n  \"postData\": {  \n  \"mimeType\": \"application/octet-stream\",  \n  \"text\": \"\",  \n  \"params\": []  \n },  \"headersSize\": 503,  \n  \"bodySize\": 0  \n}\n```\n - Step 3. create OAuth2 plugin for above service, notice: we use \"enable_password_grant\"\n```shell\ncurl -X POST \\\n  --url http://127.0.0.1:8001/services/mockauth2/plugins/ \\\n  --data \"name=oauth2\" \\\n  --data \"config.enable_password_grant=true\" \n```\nResponse:\n```json\n{\n  \"created_at\": 1547630668000,\n  \"config\": {\n    \"refresh_token_ttl\": 1209600,\n    \"token_expiration\": 7200,\n    \"mandatory_scope\": false,\n    \"hide_credentials\": false,\n    \"enable_client_credentials\": false,\n    \"enable_implicit_grant\": false,\n    \"global_credentials\": false,\n    \"accept_http_if_already_terminated\": false,\n    \"enable_password_grant\": true,\n    \"anonymous\": \"\",\n    \"enable_authorization_code\": false,\n    \"provision_key\": \"iSlVBaFgzDr5UMRGceOcKGCjGo1NgVfL\",\n    \"auth_header_name\": \"authorization\"\n  },\n  \"id\": \"86de0fb3-3016-4ad0-96ee-eab5d07e6948\",\n  \"enabled\": true,\n  \"service_id\": \"798f5c93-7eae-41b0-a3b3-565c23b1ae56\",\n  \"name\": \"oauth2\"\n}\n```\nWe get provision_key \"iSlVBaFgzDr5UMRGceOcKGCjGo1NgVfL\"\n\nNow,try the new service/api. You will not be allowed to access this service:\n```shell\ncurl -X GET \\\n  --url \"http://127.0.0.1:8000/mockauth2\" \\\n  --header \"Host: mockbin.org\"\n```\nThe response as follows:\n```json\n{\"error_description\":\"The access token is missing\",\"error\":\"invalid_request\"}\n```\nOAuth2 plugin become effective.\n - Step 4. create a Kong consumer (called \"authuser\")  and add group to above consumer\n```shell\ncurl -X POST \\\n  --url \"http://127.0.0.1:8001/consumers/\" \\\n  --data \"username=authuser\"\n```\nResponse :\n```json\n{\n  \"custom_id\": null,\n  \"created_at\": 1547630753,\n  \"username\": \"authuser\",\n  \"id\": \"78bf6e92-e0b0-48ff-b81f-a6f3853f1364\"\n}\n```\n - Step 5. add OAuth 2.0 client application to above consumer.\n```shell\ncurl -X POST \\\n  --url \"http://127.0.0.1:8001/consumers/authuser/oauth2/\" \\\n  --data \"name=oauthapp\" \\\n  --data \"redirect_uri=http://konghq.com/\"\n```\nResponse :\n```json\n{\n  \"client_id\": \"SG0g4maGKdOujhnkm5Pl9UwUWk5mQHrP\",\n  \"created_at\": 1547630810000,\n  \"id\": \"c077d6e2-8095-4c94-b46f-4388b7fb33de\",\n  \"redirect_uri\": [\n    \"http://konghq.com/\"\n  ],\n  \"name\": \"oauthapp\",\n  \"client_secret\": \"V0aNTpcrSaePFMibdXyrlFeBOpGeTZSG\",\n  \"consumer_id\": \"78bf6e92-e0b0-48ff-b81f-a6f3853f1364\"\n}\n```\nWe get consumer_id \"78bf6e92-e0b0-48ff-b81f-a6f3853f1364\", client_id \"SG0g4maGKdOujhnkm5Pl9UwUWk5mQHrP\", client_secret \"V0aNTpcrSaePFMibdXyrlFeBOpGeTZSG\". \n - Step 5. Get the token. grant_type is password. authenticated_userid is consumer_id we get in Step 4. provision_key we get in Step 3, client_id and client_secret we get in Step 4\n```shell\n  curl -X POST \\\n  --url \"https://127.0.0.1:8443/mockauth2/oauth2/token\" \\\n  --header \"Host: mockbin.org\" \\\n  --data \"grant_type=password\" \\\n  --data \"client_id=SG0g4maGKdOujhnkm5Pl9UwUWk5mQHrP\" \\\n  --data \"client_secret=V0aNTpcrSaePFMibdXyrlFeBOpGeTZSG\" \\\n  --data \"authenticated_userid=78bf6e92-e0b0-48ff-b81f-a6f3853f1364\"\\\n  --data \"provision_key=iSlVBaFgzDr5UMRGceOcKGCjGo1NgVfL\" \\\n  --insecure\n```\nwe get the response\n```json\n{\n  \"refresh_token\": \"4rlpoLiA2dQQOKcdZjuYD0QxR9oh9l2s\",\n  \"token_type\": \"bearer\",\n  \"access_token\": \"9TS6s8pZvZYMM8pNL0weeNBVkWPe2V5w\",\n  \"expires_in\": 7200\n}\n```\n - Step 6. access above service/api by access_token of Step 5\n```shell\ncurl -X GET \\\n  --url \"http://127.0.0.1:8000/mockauth2\" \\\n  --header \"Host: mockbin.org\" \\\n  --header \"Authorization: bearer 9TS6s8pZvZYMM8pNL0weeNBVkWPe2V5w\"\n```\nIt's work well. The all about OAuth2 plugin control.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliq05%2Fkong-kong-dashboard-docker-compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliq05%2Fkong-kong-dashboard-docker-compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliq05%2Fkong-kong-dashboard-docker-compose/lists"}