summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouisJackman <LouisJackman@users.noreply.github.com>2020-01-23 21:29:13 +0000
committerLouisJackman <LouisJackman@users.noreply.github.com>2020-01-23 21:29:13 +0000
commitbd1ab74031f3b589582848ffeb6361f3dbf6a630 (patch)
tree539e204b83760514cef2466e612b5e1c1e2e827d
parentcf96c113e1f521a85372f81c0d4d5a6dada941ca (diff)
downloadpelican-bd1ab74031f3b589582848ffeb6361f3dbf6a630.tar.gz
Add a devserver-global task for non-local dev testing
The devserver target recently acquired a sane default of restricting access only to localhost. This is good for security. However, it can frustrate some usages like testing on phones on a local network or hosting the dev server within VMs (e.g. Docker for Mac) which see host OS browsers as not being 127.0.0.1. Add a new target called `devserver-global` for this case. As it's longer to type, the more svelte `devserver` will retain the more secure defaults that will suffice for most users; they can use the longer-to-type `devserver-global` target to relax the localhost-only restriction.
-rw-r--r--pelican/tools/templates/Makefile.jinja27
1 files changed, 7 insertions, 0 deletions
diff --git a/pelican/tools/templates/Makefile.jinja2 b/pelican/tools/templates/Makefile.jinja2
index 91b44320..0d27defd 100644
--- a/pelican/tools/templates/Makefile.jinja2
+++ b/pelican/tools/templates/Makefile.jinja2
@@ -114,6 +114,13 @@ else
$(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
endif
+devserver-global:
+ifdef PORT
+ $(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT) -b 0.0.0.0
+else
+ $(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -b 0.0.0.0
+endif
+
publish:
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)