Skip to content

Commit

Permalink
Merge pull request #8 from james-stevens/dev
Browse files Browse the repository at this point in the history
fixes before live
  • Loading branch information
james-stevens authored Jul 10, 2022
2 parents 7b2e468 + f5ec8fc commit bd41085
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# epp-restapi - [Docker.com - jamesstevens/epprest](https://hub.docker.com/r/jamesstevens/epprest)
# epp-restapi - [Docker.com - jamesstevens/epp-restapi](https://hub.docker.com/r/jamesstevens/epp-restapi)

`epp-restapi` is a Python/Flask service to provide a rest/api for EPP domain registration / management.
It does this by providing a transparent proxy to an existing EPP registry service.
Expand Down
2 changes: 1 addition & 1 deletion Your-Container/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM jamesstevens/epprest
FROM jamesstevens/epp-restapi

COPY certkey.pem /opt/keys/

Expand Down
11 changes: 8 additions & 3 deletions bin/start
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ if test -z "${EPP_USERNAME}" -o -z "${EPP_PASSWORD}" -o -z "${EPP_SERVER}"
fi

{
echo "::respawn:/sbin/syslogd -n -O -"
if test "${SYSLOG_SERVER}"
then
echo "::respawn:/sbin/syslogd -n -R ${SYSLOG_SERVER}"
else
echo "::respawn:/sbin/syslogd -n -O -"
fi

sessions=1
if test "${EPP_SESSIONS}"; then sessions="${EPP_SESSIONS}"; fi
Expand All @@ -28,9 +33,9 @@ cp -a /opt/keys /run
chmod 700 /run/keys
chown -R nginx: /run/keys

if ! test -f /run/keys/client.pem
if test -f /opt/keys/certkey.pem -a ! -f /run/keys/client.pem
then
cp -a /opt/keys/certkey.perm /run/keys/client.pem
cp -a /opt/keys/certkey.pem /run/keys/client.pem
fi

mkdir /run/nginx; chown nginx: /run/nginx
Expand Down
4 changes: 3 additions & 1 deletion bin/start_epprest
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
session="${1}"

cd /opt
exec gunicorn --bind unix:/run/epprest_${session}.sock epprest
exec gunicorn \
--bind unix:/run/epprest_${session}.sock \
epprest
13 changes: 10 additions & 3 deletions bin/start_nginx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ events {
worker_connections 1024;
}
user daemon;
error_log syslog:server=unix:/dev/log,facility=local5,tag=nginx,severity=warn;
http {
access_log off;
error_log stderr error;
access_log syslog:server=unix:/dev/log,facility=local5,tag=nginx,severity=info;
include mime.types;
default_type application/octet-stream;
sendfile on;
Expand All @@ -37,7 +36,11 @@ while test ${x} -lt ${sessions}
done
echo "
}
"

if test -f /run/keys/certkey.pem
then
echo "
server {
listen 443 ssl;
server_name ${SERVER_NAME};
Expand All @@ -59,6 +62,10 @@ echo "
proxy_pass http://epp_servers;
}
}
"
fi

echo "
server {
listen 80;
server_name ${SERVER_NAME};
Expand Down
2 changes: 1 addition & 1 deletion dkmk
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# (c) Copyright 2019-2022, James Stevens ... see LICENSE for details
# Alternative license arrangements are possible, contact me for more information

docker image build -t epprest .
docker image build -t epp-restapi .
2 changes: 1 addition & 1 deletion dkrun
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ if test -f ./my-env; then env="./my-env"; fi

docker run --read-only --env-file=${env} -it \
-p 127.0.0.1:443:443 -p 127.0.0.1:80:80 \
epprest
epp-restapi
3 changes: 3 additions & 0 deletions dktst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /bin/sh

docker run -it epp-restapi /bin/sh
2 changes: 1 addition & 1 deletion epprest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import flask

client_pem = "/run/keys/certkey.pem"
client_pem = "/run/keys/client.pem"

syslogFacility = syslog.LOG_LOCAL6

Expand Down
2 changes: 1 addition & 1 deletion list
Original file line number Diff line number Diff line change
@@ -1 +1 @@
epprest
epp-restapi
10 changes: 5 additions & 5 deletions push_to_docker_com
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#! /bin/sh

id=$(docker image ls | awk '{ if($1=="epprest") print $3 }')
id=$(docker image ls | awk '{ if($1=="epp-restapi") print $3 }')

docker tag ${id} jamesstevens/epprest
docker push jamesstevens/epprest
docker tag ${id} jamesstevens/epp-restapi
docker push jamesstevens/epp-restapi

ver="$1"
if test -z "${ver}"; then ver="$(date +%Y-%m-%d)"; fi

if test "$1"
then
docker tag ${id} jamesstevens/epprest:${1}
docker push jamesstevens/epprest:${1}
docker tag ${id} jamesstevens/epp-restapi:${1}
docker push jamesstevens/epp-restapi:${1}
fi

0 comments on commit bd41085

Please sign in to comment.