Add docker file and example content

main
Mikael Nordin 3 years ago
parent b639e73d35
commit 2e8b87103f

@ -0,0 +1,23 @@
FROM debian:10 AS build-stage
RUN apt-get update
RUN apt-get -y install openssl
RUN mkdir -p /app/certs
COPY openssl.conf .
RUN openssl req \
-x509 \
-newkey rsa:4096 \
-sha256 \
-days 3560 \
-nodes \
-keyout /app/certs/cert.key \
-out /app/certs/cert.pem \
-subj "/C=SE/ST=W/L=Borlange/O=Skunkworks/CN=gmnd.local" \
-extensions san \
-config openssl.conf
FROM python:3 AS deploy-stage
WORKDIR /app
COPY ./gmnd/__init__.py .
COPY ./content content
COPY --from=build-stage /app/certs certs
EXPOSE 1965
CMD ["python", "__init__.py"]

@ -0,0 +1,3 @@
# Headin
=> test/

@ -72,7 +72,7 @@ class gMNd:
conn.close()
def get_dir_list(self,directory):
contents = b"Contents:\r\n"
contents = b"#Contents:\r\n"
dirs = []
files = []
for mfile in os.listdir(self.base_path + directory):
@ -105,5 +105,5 @@ def get_header(status='20', meta = b""):
if __name__ == "__main__":
server = gMNd({'allow_dir_list': True})
server = gMNd({'allow_dir_list': True, 'logg_level': logging.DEBUG, 'listen_addr': '0.0.0.0'})
server.run()

@ -0,0 +1,4 @@
[req]
distinguished_name=req
[san]
subjectAltName=DNS:localhost,DNS:gmnd.local
Loading…
Cancel
Save