~cadence/tube-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] Allow configuring the bind host address and port.

Details
Message ID
<20210228174000.33179-1-olivier@librepush.net>
DKIM signature
pass
Download raw message
Patch: +16 -1
---
 configuration.sample.py | 11 +++++++++++
 index.py                |  6 +++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/configuration.sample.py b/configuration.sample.py
index 27143ce..b3a1ad9 100644
--- a/configuration.sample.py
+++ b/configuration.sample.py
@@ -4,3 +4,14 @@

# A URL that this site can be accessed on. Do not include a trailing slash.
website_origin = "http://example.com:3000"


# ==============================
#  These settings are optional.
# ==============================

# The address of the interface to bind to.
#bind_host = "0.0.0.0"

# The port to bind to.
#bind_port = 3000
diff --git a/index.py b/index.py
index 1760190..facee1a 100644
--- a/index.py
+++ b/index.py
@@ -8,6 +8,7 @@ from extractors.manifest import extract_manifest
from extractors.search import extract_search
from extractors.suggestions import extract_search_suggestions
from extractors.captions import extract_captions
import configuration

@cherrypy.tools.register("before_finalize", priority=60)
def custom_headers():
@@ -126,7 +127,10 @@ class NewLeaf(object):
			cherrypy.response.headers["content-type"] = r.headers["content-type"]
			return r

cherrypy.config.update({"server.socket_port": 3000, "server.socket_host": "0.0.0.0"})
bind_port = getattr(configuration, "bind_port", 3000)
bind_host = getattr(configuration, "bind_host", "0.0.0.0")

cherrypy.config.update({"server.socket_port": bind_port, "server.socket_host": bind_host})
cherrypy.quickstart(NewLeaf(), "/", {
	"/": {
		"tools.custom_headers.on": True
-- 
2.25.1
Details
Message ID
<20210312002155.f018df6ed1d42904f46067fb@disroot.org>
In-Reply-To
<20210228174000.33179-1-olivier@librepush.net> (view parent)
DKIM signature
pass
Download raw message
I'm really sorry this took me so long to get to for such a simple
patch.

Applied, thank you.
Reply to thread Export thread (mbox)