-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
41 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
FROM kong | ||
FROM kong/kong:latest-ubuntu | ||
|
||
RUN whoami | ||
|
||
USER root | ||
RUN apk update && apk add curl vim httpie jq | ||
RUN apt-get update && apt-get install -y curl vim-tiny httpie jq | ||
#RUN luarocks install kong-upstream-jwt-extended | ||
#RUN apk update && apk add curl vim httpie jq | ||
COPY kong.yml kong.yml | ||
#COPY csc_certs.sh /usr/local/openresty/bin/csc_certs.sh | ||
#RUN chmod u+x /usr/local/openresty/bin/csc_certs.sh | ||
RUN chown kong:kong kong.yml | ||
|
||
USER kong | ||
RUN which kong | ||
RUN which http | ||
#CMD /usr/local/bin/kong start && sleep 10 && /usr/bin/http :8001/config [email protected] | ||
CMD kong start | ||
#CMD /bin/bash -c "/usr/local/openresty/bin/csc_certs.sh" && kong start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
HTTPD=`curl -A "Web Check" -sL --connect-timeout 3 -w "%{http_code}\n" "http://csc:9000/csc/register" -o /dev/null` | ||
until [ "$HTTPD" == "200" ]; do | ||
printf '.' | ||
sleep 3 | ||
HTTPD=`curl -A "Web Check" -sL --connect-timeout 3 -w "%{http_code}\n" "http://csc:9000/csc/register" -o /dev/null` | ||
done | ||
|
||
passkey=$(curl -s http://csc:9000/csc/register | jq -r .passkey) | ||
certs=$(curl -s -d '{"fqdn": "dog", "passkey": "'$passkey'"}' http://csc:9000/csc/cert) | ||
echo $certs | jq -r .server_key > /usr/local/openresty/server.key | ||
echo $certs | jq -r .server_crt > /usr/local/openresty/server.crt | ||
echo $certs | jq -r .ca_crt > /usr/local/openresty/ca.crt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters