Commit ab291660 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Allow port-proxy to run locally, for testing

parent 9917c484
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -172,7 +172,10 @@ def main(argv=None):

	# Template engine
	env = jinja2.Environment(
		loader=jinja2.FileSystemLoader('/usr/share/nginx/templates'),
		loader=jinja2.FileSystemLoader([
			pathlib.Path(__file__).with_name('templates'),
			'/usr/share/nginx/templates',
		]),
		keep_trailing_newline=True, # It's a line ENDING people! Leave it in.
	)
	env.filters['nginx_addr'] = nginx_addr_format
@@ -250,6 +253,7 @@ def filter_services(stream: TextIO):
	and any configuration changes should be committed.
	"""
	external_addrs = set(get_host_addr())
	logger.debug("found local addresses: %s", external_addrs)
	buf = io.StringIO()
	for line in stream:
		buf.write(line)