plone.recipe.vinylcache 9.0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. plone_recipe_vinylcache-9.0.3.0/.coveragerc +7 -0
  2. plone_recipe_vinylcache-9.0.3.0/.gitignore +33 -0
  3. plone_recipe_vinylcache-9.0.3.0/CHANGES.rst +235 -0
  4. plone_recipe_vinylcache-9.0.3.0/LICENSE.rst +33 -0
  5. plone_recipe_vinylcache-9.0.3.0/MANIFEST.in +3 -0
  6. plone_recipe_vinylcache-9.0.3.0/PKG-INFO +974 -0
  7. plone_recipe_vinylcache-9.0.3.0/README.rst +707 -0
  8. plone_recipe_vinylcache-9.0.3.0/TODO.rst +38 -0
  9. plone_recipe_vinylcache-9.0.3.0/base.cfg +15 -0
  10. plone_recipe_vinylcache-9.0.3.0/bootstrap.sh +5 -0
  11. plone_recipe_vinylcache-9.0.3.0/buildout.cfg +25 -0
  12. plone_recipe_vinylcache-9.0.3.0/pyproject.toml +80 -0
  13. plone_recipe_vinylcache-9.0.3.0/requirements.txt +1 -0
  14. plone_recipe_vinylcache-9.0.3.0/setup.cfg +14 -0
  15. plone_recipe_vinylcache-9.0.3.0/setup.py +12 -0
  16. plone_recipe_vinylcache-9.0.3.0/src/plone/__init__.py +1 -0
  17. plone_recipe_vinylcache-9.0.3.0/src/plone/recipe/__init__.py +1 -0
  18. plone_recipe_vinylcache-9.0.3.0/src/plone/recipe/vinylcache/__init__.py +9 -0
  19. plone_recipe_vinylcache-9.0.3.0/src/plone/recipe/vinylcache/recipe.py +611 -0
  20. plone_recipe_vinylcache-9.0.3.0/src/plone/recipe/vinylcache/templates/start_script.jinja2 +30 -0
  21. plone_recipe_vinylcache-9.0.3.0/src/plone/recipe/vinylcache/templates/varnish.vcl.jinja2 +501 -0
  22. plone_recipe_vinylcache-9.0.3.0/src/plone/recipe/vinylcache/tests/__init__.py +1 -0
  23. plone_recipe_vinylcache-9.0.3.0/src/plone/recipe/vinylcache/tests/recipe.rst +353 -0
  24. plone_recipe_vinylcache-9.0.3.0/src/plone/recipe/vinylcache/tests/test_recipe.py +62 -0
  25. plone_recipe_vinylcache-9.0.3.0/src/plone/recipe/vinylcache/tests/test_vclgen.py +25 -0
  26. plone_recipe_vinylcache-9.0.3.0/src/plone/recipe/vinylcache/tests/vclgen.rst +431 -0
  27. plone_recipe_vinylcache-9.0.3.0/src/plone/recipe/vinylcache/vclgen.py +149 -0
  28. plone_recipe_vinylcache-9.0.3.0/src/plone.recipe.vinylcache.egg-info/PKG-INFO +974 -0
  29. plone_recipe_vinylcache-9.0.3.0/src/plone.recipe.vinylcache.egg-info/SOURCES.txt +37 -0
  30. plone_recipe_vinylcache-9.0.3.0/src/plone.recipe.vinylcache.egg-info/dependency_links.txt +1 -0
  31. plone_recipe_vinylcache-9.0.3.0/src/plone.recipe.vinylcache.egg-info/entry_points.txt +5 -0
  32. plone_recipe_vinylcache-9.0.3.0/src/plone.recipe.vinylcache.egg-info/namespace_packages.txt +2 -0
  33. plone_recipe_vinylcache-9.0.3.0/src/plone.recipe.vinylcache.egg-info/not-zip-safe +1 -0
  34. plone_recipe_vinylcache-9.0.3.0/src/plone.recipe.vinylcache.egg-info/requires.txt +7 -0
  35. plone_recipe_vinylcache-9.0.3.0/src/plone.recipe.vinylcache.egg-info/top_level.txt +1 -0
  36. plone_recipe_vinylcache-9.0.3.0/tests.cfg +6 -0
  37. plone_recipe_vinylcache-9.0.3.0/tox.ini +26 -0
  38. plone_recipe_vinylcache-9.0.3.0/versions.cfg +26 -0
@@ -0,0 +1,7 @@
1
+ [report]
2
+ omit =
3
+ */bin/test
4
+ */eggs/*
5
+ */lib/python*
6
+ */parts/*
7
+ */usr/*
@@ -0,0 +1,33 @@
1
+ *.egg
2
+ *.egg-info
3
+ *.mo
4
+ *.pyc
5
+ *.pyo
6
+ *.swp
7
+ .Python
8
+ .installed.cfg
9
+ .mr.developer.cfg
10
+ pip-selfcheck.json
11
+ pyvenv.cfg
12
+ .python-version
13
+ .coverage
14
+ /bin/
15
+ /build/
16
+ /develop-eggs/
17
+ /dist/
18
+ /downloads/
19
+ /eggs/
20
+ /fake-eggs/
21
+ /include/
22
+ /lib/
23
+ /lib64
24
+ /local/
25
+ /parts/
26
+ /var/
27
+ /selfcheck/bin/
28
+ /selfcheck/parts/
29
+ /selfcheck/lib/
30
+ /selfcheck/local/
31
+ /selfcheck/include/
32
+ /selfcheck/develop-eggs/
33
+ /selfcheck/.*
@@ -0,0 +1,235 @@
1
+ Changelog
2
+ =========
3
+
4
+ 9.0.3.0 (2026-09-25)
5
+ --------------------
6
+
7
+ - Moved the package source to a ``src`` layout and migrated packaging
8
+ metadata from ``setup.py`` to ``pyproject.toml`` (``setup.py`` now only
9
+ carries the legacy ``namespace_packages``/``packages``/``package_dir``
10
+ arguments that PEP 621's ``[project]`` table cannot express). Dropped
11
+ Python 3.9 support, added 3.12 and 3.13.
12
+ [mamico]
13
+
14
+ - BUGFIX: ``plone.recipe.vinylcache:build``'s ``url`` (and
15
+ ``vmods_url``) option now falls back to the built-in default download
16
+ URL when set to an *empty* string, not just when entirely absent. An
17
+ inherited/extended ``buildout.cfg`` declaring ``url =`` with no value
18
+ as a placeholder for a downstream override previously made
19
+ ``setdefault()`` a no-op (the key already existed), which
20
+ ``zc.recipe.cmmi`` then handed to ``zc.buildout.download.Download()``
21
+ as if it were a local path, failing with ``FileNotFoundError: [Errno
22
+ 2] No such file or directory: ''`` instead of using the default.
23
+ [mamico]
24
+
25
+ - BUGFIX: the new default ``name`` (``${buildout:directory}/var/<part
26
+ name>``, see above) broke ``varnishd`` startup and even ``varnishd -C``
27
+ syntax checks with "Error: Cannot create working directory ...: No
28
+ such file or directory": ``varnishd`` only creates the leaf directory
29
+ of its ``-n`` working directory, not missing parents (e.g. ``var/``
30
+ itself). ``plone.recipe.vinylcache:script`` now creates that directory
31
+ (and any missing parents) itself during install. Caught by actually
32
+ running the compiled binary against the generated script in CI/locally,
33
+ not just by inspecting the VCL. [mamico]
34
+
35
+ - New features, beyond parity with ``plone.recipe.varnish``:
36
+
37
+ - ``vcl_hash`` default now includes ``req.http.host`` (falling back to
38
+ ``server.ip``), matching Varnish's own built-in default. The previous
39
+ default hashed on ``req.url`` alone, which can cross-contaminate the
40
+ cache between two different vhosts/backends serving overlapping URL
41
+ paths on the same Vinyl Cache instance.
42
+ - ``PATCH`` added to the method whitelist in ``vcl_recv`` (alongside
43
+ ``PUT``/``POST``/``DELETE``), for REST APIs (e.g. ``plone.restapi``).
44
+ - WebSocket upgrade requests (``Upgrade: websocket``) are now piped
45
+ straight through in ``vcl_recv`` instead of falling into normal
46
+ GET/HEAD caching logic.
47
+ - ``Accept-Encoding`` is normalized in ``vcl_recv`` (to ``gzip`` or
48
+ unset) to avoid fragmenting the cache per client-specific
49
+ ``Accept-Encoding`` strings.
50
+ - Large files (by extension) are now streamed (``beresp.do_stream``)
51
+ instead of piped in ``vcl_backend_response`` -- streaming keeps the
52
+ response cacheable and visible to logging, unlike pipe.
53
+ - ``balancer`` accepts a new value, ``shard``, using Varnish's
54
+ consistent-hashing director: the same request lands on the same
55
+ backend every time, which is better for cache hit ratio than
56
+ ``round_robin``/``random`` when several backends could each
57
+ independently cache the same content. Emits the documented
58
+ ``.reconfigure()`` call after adding backends.
59
+ - The purge ACL (``acl list_purge``) now sets ``+fold(-report)``,
60
+ keeping Vinyl Cache 9.0's default ACL-folding optimization but
61
+ silencing the (harmless but noisy) compiler warning it emits for
62
+ common setups, e.g. a backend on 127.0.0.1 overlapping with the
63
+ "localhost" entry.
64
+ - ``verbose-headers`` is a real, working option again (it was removed
65
+ earlier in this fork's history because it was dead code in the
66
+ version it was forked from). When ``off`` (the default), the
67
+ diagnostic ``X-Cache``, ``X-Cacheable`` and ``grace`` response
68
+ headers are stripped before delivery; set to ``on`` to keep them
69
+ for debugging.
70
+ - New ``purge-by-id`` option (default ``off``) for
71
+ ``plone.recipe.vinylcache:configuration``, compatible with
72
+ `collective.purgebyid <https://github.com/collective/collective.purgebyid>`_:
73
+ ``GET /@@purgebyid/<id>`` purges every cached object tagged with
74
+ that id (via the backend's ``X-Ids-Involved`` header) without
75
+ needing to enumerate every cached URL variant of that content. Two
76
+ modes: ``ban`` (also ``on``, the default when enabled) purges via
77
+ ``ban()`` and needs no vmod, matching a real-world production
78
+ pattern found in the wild that avoids the vmod-compile step
79
+ entirely; ``xkey`` purges via the ``xkey`` vmod's secondary-key
80
+ support instead (more efficient, requires
81
+ ``[varnish-build] compile-vmods = true`` -- the ``xkey`` import is
82
+ only emitted in this mode).
83
+ - New ``tls-config`` option for ``plone.recipe.vinylcache:script``,
84
+ mapping to ``varnishd -A`` (a Vinyl Cache 9.0 addition letting
85
+ ``varnishd`` terminate TLS itself via a hitch-like config file,
86
+ instead of needing a separate TLS terminator in front of it).
87
+ - New ``max-cacheable-size`` option for
88
+ ``plone.recipe.vinylcache:configuration`` (default: unset, no limit).
89
+ Objects whose backend response ``Content-Length`` exceeds this value
90
+ (a VCL BYTES literal, e.g. ``50MB``) are marked uncacheable in
91
+ ``vcl_backend_response``. Without a limit, a single very large
92
+ object can nuke a large fraction of the cache under LRU pressure
93
+ just to make room for itself, evicting many still-useful smaller
94
+ objects along the way.
95
+ - New ``plone.recipe.vinylcache:selfsigned`` recipe: generates a
96
+ self-signed certificate/key (via ``openssl``, idempotently -- it
97
+ won't regenerate an already-present certificate on later buildout
98
+ runs) plus a ready-to-use ``-A``-style config file, for pairing with
99
+ ``tls-config`` in internal/dev/testing setups where a CA-issued
100
+ certificate isn't warranted. The key file, the combined cert+key
101
+ file, and the directory holding them are all written with
102
+ restricted permissions (0600/0600/0700) since they contain private
103
+ key material.
104
+
105
+ [mamico]
106
+
107
+ - Default ``plone.recipe.vinylcache:script``'s ``name`` option (which maps
108
+ to ``varnishd -n``, controlling its working directory) to
109
+ ``${buildout:directory}/var/<part name>`` instead of leaving it unset.
110
+ Without it, ``varnishd`` picks its own system default working directory
111
+ (typically under ``/var/run``), which requires root and is the most
112
+ common "Permission denied: Cannot create working directory" trap when
113
+ running ``varnishd`` unprivileged from a buildout. Deliberately placed
114
+ under ``var``, not ``parts`` (which is disposable/regenerated e.g. on a
115
+ ``varnish-build`` recompile), and keyed by the part's own name so
116
+ multiple instances in one buildout don't collide. Set ``name``
117
+ explicitly to override. [mamico]
118
+
119
+ - BUGFIX: revert to legacy (``pkg_resources``-declared) ``plone``/
120
+ ``plone.recipe`` namespace packages (restoring ``plone/__init__.py``
121
+ and ``plone/recipe/__init__.py``, and ``namespace_packages=`` in
122
+ ``setup.py``) instead of pure PEP 420 native namespaces. Real-world
123
+ Plone buildouts still mix in many ``plone.*`` eggs that declare the
124
+ namespace the legacy way; when this package was native-only, its
125
+ develop egg became invisible to ``zc.buildout``'s ``pkg_resources``-
126
+ based dependency/recipe resolution as soon as it was combined with
127
+ those other eggs in the same buildout (reproduced with a real
128
+ Plone-buildout-shaped setup: worked in isolation, failed with
129
+ "Couldn't find index page for 'plone.recipe.vinylcache'" once other
130
+ legacy-``plone``-namespace eggs were also present -- the exact same
131
+ root cause as the ``zc.recipe.testrunner`` CI fix above, this time
132
+ hitting real users). [mamico]
133
+
134
+ - CI: py39 is only tested against Plone 6.0 -- Plone's floating
135
+ ``6.1-latest``/``6.2-latest`` requirements.txt now pin a ``pip``
136
+ release requiring Python>=3.10. [mamico]
137
+
138
+ - Fork of `plone.recipe.varnish <https://pypi.org/project/plone.recipe.varnish/>`_,
139
+ created to track the Varnish Cache -> Vinyl Cache project rename (early
140
+ 2026) and the new 9.0.x stable release line. All credit for the original
141
+ recipe design and years of maintenance goes to the
142
+ ``plone.recipe.varnish`` authors and contributors. If you don't need
143
+ Vinyl Cache 9.0.x, please keep using ``plone.recipe.varnish`` -- it is
144
+ unaffected by this fork and continues to target Varnish 6.0 LTS.
145
+ [mamico]
146
+
147
+ - BREAKING: only support Vinyl Cache (formerly Varnish Cache) version
148
+ 9.0.x and generate config (VCL) for this version only. [mamico]
149
+
150
+ - BUGFIX: ``vcl_hit``'s grace-handling code used ``return(miss)``, which
151
+ is no longer a valid VCL return action from ``vcl_hit`` as of VCL
152
+ syntax 4.1 (confirmed against the real Vinyl Cache 9.0.3 VCC returns
153
+ table -- discovered by actually compiling the generated VCL in CI, not
154
+ just by reading docs). Replaced with ``return(restart)``, which
155
+ re-enters VCL processing at ``vcl_recv`` and naturally resolves to a
156
+ fresh fetch once an object's grace window has genuinely expired.
157
+ [mamico]
158
+
159
+ - Drop Python 3.8 from the test matrix and ``python_requires`` (matches
160
+ upstream ``plone.recipe.varnish``, which dropped it for the same
161
+ reason: Plone's floating "-latest" requirements.txt files now pin
162
+ setuptools/packaging releases with no Python 3.8 wheels). [mamico]
163
+
164
+ - Pin ``zc.recipe.egg`` to ``3.0.0`` in ``versions.cfg``: the current
165
+ ``zc.recipe.egg`` (4.0.0, pulled in transitively by
166
+ ``zc.recipe.testrunner``) requires ``zc.buildout>=5.0.0``, which
167
+ conflicts with Plone 6.1's pinned ``zc.buildout==4.2.0``. [mamico]
168
+
169
+ - Pin ``zc.recipe.testrunner`` to ``3.2``: releases from 4.0 onwards
170
+ dropped the ``namespace_packages.txt`` metadata shim that
171
+ ``pkg_resources`` (still used internally by ``zc.buildout``) needs to
172
+ merge a purely-PEP-420 package into a ``zc`` namespace that is
173
+ otherwise legacy-declared -- which it is here, because of the
174
+ ``zc.recipe.egg`` pin above. Without this, buildout's own entry-point
175
+ loader fails with ``ModuleNotFoundError: No module named
176
+ 'zc.recipe.testrunner'`` even though the same package installs and
177
+ imports fine via plain ``pip install``. Reproduced locally against both
178
+ a Plone-6.0/6.1-like (``zc.buildout`` 4.x) and Plone-6.2-like
179
+ (``zc.buildout`` 5.x) environment; 3.2 works in both. [mamico]
180
+
181
+ - Update the default download URL to Vinyl Cache 9.0.3 and the default
182
+ ``varnish-modules`` URL to release 0.28.0 (the release targeting the
183
+ 9.0 line; ``varnish-modules`` dropped support for Varnish 6.0 LTS
184
+ starting with the releases that target 7.0+). Note: despite the
185
+ project's rename from Varnish Cache to Vinyl Cache, the installed
186
+ daemon binary is still called ``varnishd`` as of 9.0.x (confirmed
187
+ against the upstream source), so this recipe does *not* rename it;
188
+ only the download defaults and the recipe's own package name track
189
+ the new branding/release line. [mamico]
190
+
191
+ - BUGFIX: ``vcl_init`` and ``vcl_pass`` custom VCL snippet options were
192
+ silently dropped by the recipe (present in the template and documented
193
+ in the README, but missing from the option-collection list); they are
194
+ now correctly included in the generated VCL. [mamico]
195
+
196
+ - BUGFIX: ``user``/``group`` options for ``plone.recipe.vinylcache:script``
197
+ were silently ignored because of a dead, version-gated template branch
198
+ left over from supporting older Varnish releases; they now correctly
199
+ emit ``-j unix,user=...[,ccgroup=...]``. [mamico]
200
+
201
+ - Fix the internal VCL syntax version marker to be the string ``"4.1"``
202
+ instead of the float ``4.0`` -- this recipe always generates VCL syntax
203
+ version 4.1. [mamico]
204
+
205
+ - Remove the ``verbose-headers`` option: it computed a value that was
206
+ never actually forwarded to the VCL template and so never had any
207
+ effect. [mamico]
208
+
209
+ - Remove the ``saint-mode`` option: saint mode was removed from Varnish
210
+ itself years ago, and this recipe's own implementation of it was
211
+ already disabled. Setting ``saint-mode`` to anything other than
212
+ ``off`` now raises a clear error instead of being silently ignored.
213
+ [mamico]
214
+
215
+ - Remove the undocumented-in-code, docs-only ``vcl-version`` option; no
216
+ code ever read it. This recipe always targets VCL syntax version 4.1.
217
+ [mamico]
218
+
219
+ - Drop Python 2.7 support. Modernize packaging: native PEP 420 namespace
220
+ packages (no more ``plone/__init__.py``/``plone/recipe/__init__.py``
221
+ ``declare_namespace`` calls), remove the broken ``setup.py`` test
222
+ command (``setuptools.command.test`` was removed in setuptools>=72),
223
+ update classifiers/``python_requires`` to Python 3.8+. [mamico]
224
+
225
+ - Test against Plone 6.0, 6.1 and 6.2 (and their respective zc.buildout
226
+ versions) in CI; drop the Plone 5.2 / Python 2.7 test variant.
227
+ [mamico]
228
+
229
+ - Carried over from ``plone.recipe.varnish``'s own history (already fixed
230
+ there, not novel to this fork): the ``cookie-pass-not-exclude`` config
231
+ option and ``vcl_synth`` custom VCL insertion point (6.0.13); the
232
+ hostname-matching regex character-class bug for ``hostname:path``
233
+ backends, fixed the same way independently while porting (6.0.18); and
234
+ the ``cookie-pass`` default extension list dropping ``kss`` in favour of
235
+ ``woff``/``woff2`` (6.0.13.1, [erral]). [mamico]
@@ -0,0 +1,33 @@
1
+ Copyright (c) 2026, plone.recipe.vinylcache contributors.
2
+ All rights reserved.
3
+
4
+ This package is a fork of ``plone.recipe.varnish``
5
+ (https://github.com/collective/plone.recipe.varnish), copyright its
6
+ respective contributors, redistributed and modified under the same
7
+ license terms.
8
+
9
+ Redistribution and use in source and binary forms, with or without
10
+ modification, are permitted provided that the following conditions are
11
+ met:
12
+
13
+ * Redistributions of source code must retain the above copyright
14
+ notice, this list of conditions and the following disclaimer.
15
+ * Redistributions in binary form must reproduce the above copyright
16
+ notice, this list of conditions and the following disclaimer in
17
+ the documentation and/or other materials provided with the
18
+ distribution.
19
+ * Neither the name of the copyright holders nor the names of its
20
+ contributors may be used to endorse or promote products derived
21
+ from this software without specific prior written permission.
22
+
23
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
24
+ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25
+ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
26
+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,3 @@
1
+ recursive-include src/plone *
2
+ include *
3
+ global-exclude *.pyc