summaryrefslogtreecommitdiff
path: root/scripts/ac_source_server
diff options
context:
space:
mode:
authorJames E.H. Turner <jturner@gemini.edu>2016-09-28 16:53:53 -0400
committerJames E.H. Turner <jturner@gemini.edu>2016-09-28 16:53:53 -0400
commit3db56b2d83f73a2763a6ad2a0a505bc646ec0573 (patch)
tree86a1a6a6f3b923ff534e4e3fca42580bbf94bf95 /scripts/ac_source_server
parent1c5e4711881ede7d26e0b0edf5c161229c8eb599 (diff)
downloadastroconda-iraf-helpers-3db56b2d83f73a2763a6ad2a0a505bc646ec0573.tar.gz
Very simple script to serve local tarballs for the build process with HTTPS.
Diffstat (limited to 'scripts/ac_source_server')
-rwxr-xr-xscripts/ac_source_server34
1 files changed, 34 insertions, 0 deletions
diff --git a/scripts/ac_source_server b/scripts/ac_source_server
new file mode 100755
index 0000000..d7fb0f3
--- /dev/null
+++ b/scripts/ac_source_server
@@ -0,0 +1,34 @@
+#!/usr/bin/python
+
+# A minimal Web server to provide local source tarballs to AstroConda package
+# builds, using the same hostname alias ("astroconda-source") across sites.
+#
+# To get this working:
+# - Define an "astroconda-source" alias for the host where the local tarballs
+# are located.
+# - Place an SSL certificate file, "astroconda.pem", in the same directory as
+# the source tarballs.
+# - Start this script in the directory containing the source tarballs.
+# - Point each client build machine to a copy of the SSL certificate like so:
+# conda config --set ssl_verify /path/to/astroconda.pem.
+
+import BaseHTTPServer
+import SimpleHTTPServer
+import ssl
+
+# It seems common practice to use port 4443 for unprivileged HTTPS services but
+# 4440 is unassigned and less likely to conflict with any other HTTPS service:
+port=4440
+
+httpd = BaseHTTPServer.HTTPServer(
+ ('', port), SimpleHTTPServer.SimpleHTTPRequestHandler
+)
+
+httpd.socket = ssl.wrap_socket(
+ httpd.socket,
+ certfile='astroconda.pem', # cert. kept in CWD with source tarballs
+ server_side=True
+)
+
+httpd.serve_forever()
+