Commit 3a308c36 authored by Lasse Karstensen's avatar Lasse Karstensen

Rename default.vcl to builtin.vcl.

The default.vcl name was thought up in 2007 and have been a point of confusion
since.

New users take the old default VCL, uncomment what they think makes sense, and
always end with return(lookup) because that seems to be needed. But it isn't,
and the defaults in the built-in VCL are much better at handling all things
they haven't learned about yet.
parent d9cc0a70
...@@ -44,8 +44,8 @@ cscope.*out ...@@ -44,8 +44,8 @@ cscope.*out
/varnishapi-uninstalled.pc /varnishapi-uninstalled.pc
# Default vcl made from bin/varnishd/default.vcl # Default vcl made from bin/varnishd/default.vcl
/bin/varnishd/default_vcl.h /bin/varnishd/builtin_vcl.h
/etc/default.vcl /etc/builtin.vcl
# Various auto-generated code snippets # Various auto-generated code snippets
/include/vcl.h /include/vcl.h
......
...@@ -93,7 +93,7 @@ noinst_HEADERS = \ ...@@ -93,7 +93,7 @@ noinst_HEADERS = \
cache/cache_backend.h \ cache/cache_backend.h \
cache/cache_esi.h \ cache/cache_esi.h \
common/heritage.h \ common/heritage.h \
default_vcl.h \ builtin_vcl.h \
hash/hash_slinger.h \ hash/hash_slinger.h \
mgt/mgt.h \ mgt/mgt.h \
mgt/mgt_cli.h \ mgt/mgt_cli.h \
...@@ -126,26 +126,26 @@ varnishd_LDADD = \ ...@@ -126,26 +126,26 @@ varnishd_LDADD = \
@PCRE_LIBS@ \ @PCRE_LIBS@ \
${DL_LIBS} ${PTHREAD_LIBS} ${NET_LIBS} ${LIBM} ${LIBUMEM} ${DL_LIBS} ${PTHREAD_LIBS} ${NET_LIBS} ${LIBM} ${LIBUMEM}
EXTRA_DIST = default.vcl EXTRA_DIST = builtin.vcl
DISTCLEANFILES = default_vcl.h DISTCLEANFILES = builtin_vcl.h
# #
# Turn the default.vcl file into a C-string we can include in the program. # Turn the builtin.vcl file into a C-string we can include in the program.
# #
default_vcl.h: default.vcl builtin_vcl.h: builtin.vcl
echo '/*' > $@ echo '/*' > $@
echo ' * NB: This file is machine generated, DO NOT EDIT!' >> $@ echo ' * NB: This file is machine generated, DO NOT EDIT!' >> $@
echo ' *' >> $@ echo ' *' >> $@
echo ' * Edit default.vcl instead and run make' >> $@ echo ' * Edit builtin.vcl instead and run make' >> $@
echo ' *' >> $@ echo ' *' >> $@
echo ' */' >> $@ echo ' */' >> $@
echo '' >> $@ echo '' >> $@
sed -e 's/"/\\"/g' \ sed -e 's/"/\\"/g' \
-e 's/$$/\\n"/' \ -e 's/$$/\\n"/' \
-e 's/^/ "/' $(srcdir)/default.vcl >> $@ -e 's/^/ "/' $(srcdir)/builtin.vcl >> $@
# Explicitly record dependency # Explicitly record dependency
mgt/mgt_vcc.c: default_vcl.h mgt/mgt_vcc.c: builtin_vcl.h
varnishd.1: $(top_srcdir)/doc/sphinx/reference/varnishd.rst varnishd.1: $(top_srcdir)/doc/sphinx/reference/varnishd.rst
if HAVE_RST2MAN if HAVE_RST2MAN
......
...@@ -95,7 +95,7 @@ LD_ADD += -lm ...@@ -95,7 +95,7 @@ LD_ADD += -lm
RST_MAN += $(TOPDIR)/doc/sphinx/reference/varnishd.rst RST_MAN += $(TOPDIR)/doc/sphinx/reference/varnishd.rst
MADE_FILES += default_vcl.h MADE_FILES += builtin_vcl.h
TODO_INSTALL += install_etc TODO_INSTALL += install_etc
...@@ -103,20 +103,20 @@ TOPDIR = $(CURDIR)/../.. ...@@ -103,20 +103,20 @@ TOPDIR = $(CURDIR)/../..
include $(TOPDIR)/Makefile.inc.phk include $(TOPDIR)/Makefile.inc.phk
# #
# Turn the default.vcl file into a C-string we can include in the program. # Turn the builtin.vcl file into a C-string we can include in the program.
# #
default_vcl.h: default.vcl builtint_vcl.h: builtin.vcl
echo '/*' > $@ echo '/*' > $@
echo ' * NB: This file is machine generated, DO NOT EDIT!' >> $@ echo ' * NB: This file is machine generated, DO NOT EDIT!' >> $@
echo ' *' >> $@ echo ' *' >> $@
echo ' * Edit default.vcl instead and run make' >> $@ echo ' * Edit builtin.vcl instead and run make' >> $@
echo ' *' >> $@ echo ' *' >> $@
echo ' */' >> $@ echo ' */' >> $@
echo '' >> $@ echo '' >> $@
sed -e 's/"/\\"/g' \ sed -e 's/"/\\"/g' \
-e 's/$$/\\n"/' \ -e 's/$$/\\n"/' \
-e 's/^/ "/' default.vcl >> $@ -e 's/^/ "/' builtin.vcl >> $@
.PHONY: install_etc .PHONY: install_etc
install_etc: default_vcl.h install_etc: builtin_vcl.h
@cp default_vcl.h $(INSTALL_BASE)/etc/ @cp builtin_vcl.h $(INSTALL_BASE)/etc/
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
* *
* *
* The default VCL code. * The built-in (previously called default) VCL code.
* *
* NB! You do NOT need to copy & paste all of these functions into your * NB! You do NOT need to copy & paste all of these functions into your
* own vcl code, if you do not provide a definition of one of these * own vcl code, if you do not provide a definition of one of these
......
...@@ -71,8 +71,8 @@ static struct vcc *vcc; ...@@ -71,8 +71,8 @@ static struct vcc *vcc;
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
static const char * const default_vcl = static const char * const builtin_vcl =
#include "default_vcl.h" #include "builtin_vcl.h"
"" ; "" ;
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
...@@ -488,7 +488,7 @@ mgt_vcc_init(void) ...@@ -488,7 +488,7 @@ mgt_vcc_init(void)
vcc = VCC_New(); vcc = VCC_New();
AN(vcc); AN(vcc);
VCC_Default_VCL(vcc, default_vcl); VCC_Default_VCL(vcc, builtin_vcl);
AZ(atexit(mgt_vcc_atexit)); AZ(atexit(mgt_vcc_atexit));
} }
......
...@@ -922,7 +922,7 @@ specified: ...@@ -922,7 +922,7 @@ specified:
.port = "http"; .port = "http";
} }
.. include:: ../../../bin/varnishd/default.vcl .. include:: ../../../bin/varnishd/builtin.vcl
:literal: :literal:
The following example shows how to support multiple sites running on The following example shows how to support multiple sites running on
......
# #
DISTCLEANFILES = default.vcl DISTCLEANFILES = builtin.vcl
dist_varnishconf_DATA = default.vcl dist_varnishconf_DATA = builtin.vcl
default.vcl: $(top_srcdir)/bin/varnishd/default.vcl builtin.vcl: $(top_srcdir)/bin/varnishd/builtin.vcl
( printf "vcl 4.0;\nThis is a basic VCL configuration file for varnish. See the vcl(7)\n\ ( printf "This is the VCL configuration Varnish will automatically append to your VCL\nfile during compilation/loading. See the vcl(7) man page for details on syntax\nand semantics.\n\
man page for details on VCL syntax and semantics.\n\ New users is recommended to use the example.vcl file as a starting point.\n\n";\
\n\ sed -n '/vcl_recv/,$$p' $(top_srcdir)/bin/varnishd/builtin.vcl ) | \
Default backend definition. Set this to point to your content\n\ sed 's/^\(.*\)$$/# \1/' > builtin.vcl
server.\n\
\n\
backend default {\n\
.host = \"127.0.0.1\";\n\
.port = \"8080\";\n\
}\n\
\n\
Below is a commented-out copy of the default VCL logic. If you\n\
redefine any of these subroutines, the built-in logic will be\n\
appended to your code.\n" ; \
sed -n '/vcl_recv/,$$p' $(top_srcdir)/bin/varnishd/default.vcl ) | \
sed 's/^\(.*\)$$/# \1/' > default.vcl
...@@ -12,7 +12,7 @@ dist_man_MANS = vcl.7 varnish-cli.7 varnish-counters.7 vsl.7 vsl-query.7 ...@@ -12,7 +12,7 @@ dist_man_MANS = vcl.7 varnish-cli.7 varnish-counters.7 vsl.7 vsl-query.7
MAINTAINERCLEANFILES = $(dist_man_MANS) MAINTAINERCLEANFILES = $(dist_man_MANS)
vcl.7: $(top_srcdir)/doc/sphinx/reference/vcl.rst \ vcl.7: $(top_srcdir)/doc/sphinx/reference/vcl.rst \
$(top_srcdir)/bin/varnishd/default.vcl $(top_srcdir)/bin/varnishd/builtin.vcl
if HAVE_RST2MAN if HAVE_RST2MAN
${RST2MAN} $(top_srcdir)/doc/sphinx/reference/vcl.rst $@ ${RST2MAN} $(top_srcdir)/doc/sphinx/reference/vcl.rst $@
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment