@bluedynamics/cdk8s-plone 0.3.3 → 0.3.4

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.
package/.jsii CHANGED
@@ -2385,7 +2385,7 @@
2385
2385
  },
2386
2386
  "locationInModule": {
2387
2387
  "filename": "src/vinylcache.ts",
2388
- "line": 579
2388
+ "line": 613
2389
2389
  },
2390
2390
  "parameters": [
2391
2391
  {
@@ -2411,7 +2411,7 @@
2411
2411
  "kind": "class",
2412
2412
  "locationInModule": {
2413
2413
  "filename": "src/vinylcache.ts",
2414
- "line": 569
2414
+ "line": 603
2415
2415
  },
2416
2416
  "name": "PloneVinylCache",
2417
2417
  "properties": [
@@ -2424,7 +2424,7 @@
2424
2424
  "immutable": true,
2425
2425
  "locationInModule": {
2426
2426
  "filename": "src/vinylcache.ts",
2427
- "line": 799
2427
+ "line": 840
2428
2428
  },
2429
2429
  "name": "invalidationUrl",
2430
2430
  "type": {
@@ -2440,7 +2440,7 @@
2440
2440
  "immutable": true,
2441
2441
  "locationInModule": {
2442
2442
  "filename": "src/vinylcache.ts",
2443
- "line": 574
2443
+ "line": 608
2444
2444
  },
2445
2445
  "name": "vinylCacheServiceName",
2446
2446
  "type": {
@@ -2573,7 +2573,7 @@
2573
2573
  "immutable": true,
2574
2574
  "locationInModule": {
2575
2575
  "filename": "src/vinylcache.ts",
2576
- "line": 425
2576
+ "line": 447
2577
2577
  },
2578
2578
  "name": "image",
2579
2579
  "optional": true,
@@ -2591,7 +2591,7 @@
2591
2591
  "immutable": true,
2592
2592
  "locationInModule": {
2593
2593
  "filename": "src/vinylcache.ts",
2594
- "line": 397
2594
+ "line": 419
2595
2595
  },
2596
2596
  "name": "invalidation",
2597
2597
  "optional": true,
@@ -2646,7 +2646,7 @@
2646
2646
  "immutable": true,
2647
2647
  "locationInModule": {
2648
2648
  "filename": "src/vinylcache.ts",
2649
- "line": 418
2649
+ "line": 440
2650
2650
  },
2651
2651
  "name": "monitoring",
2652
2652
  "optional": true,
@@ -2665,7 +2665,7 @@
2665
2665
  "immutable": true,
2666
2666
  "locationInModule": {
2667
2667
  "filename": "src/vinylcache.ts",
2668
- "line": 438
2668
+ "line": 460
2669
2669
  },
2670
2670
  "name": "nodeSelector",
2671
2671
  "optional": true,
@@ -2725,7 +2725,7 @@
2725
2725
  "immutable": true,
2726
2726
  "locationInModule": {
2727
2727
  "filename": "src/vinylcache.ts",
2728
- "line": 410
2728
+ "line": 432
2729
2729
  },
2730
2730
  "name": "purgeHosts",
2731
2731
  "optional": true,
@@ -2903,7 +2903,7 @@
2903
2903
  "immutable": true,
2904
2904
  "locationInModule": {
2905
2905
  "filename": "src/vinylcache.ts",
2906
- "line": 431
2906
+ "line": 453
2907
2907
  },
2908
2908
  "name": "tolerations",
2909
2909
  "optional": true,
@@ -2967,7 +2967,7 @@
2967
2967
  "immutable": true,
2968
2968
  "locationInModule": {
2969
2969
  "filename": "src/vinylcache.ts",
2970
- "line": 510
2970
+ "line": 532
2971
2971
  },
2972
2972
  "name": "vclBackendErrorSnippet",
2973
2973
  "optional": true,
@@ -2985,7 +2985,7 @@
2985
2985
  "immutable": true,
2986
2986
  "locationInModule": {
2987
2987
  "filename": "src/vinylcache.ts",
2988
- "line": 504
2988
+ "line": 526
2989
2989
  },
2990
2990
  "name": "vclBackendFetchSnippet",
2991
2991
  "optional": true,
@@ -3004,7 +3004,7 @@
3004
3004
  "immutable": true,
3005
3005
  "locationInModule": {
3006
3006
  "filename": "src/vinylcache.ts",
3007
- "line": 391
3007
+ "line": 413
3008
3008
  },
3009
3009
  "name": "vclBackendResponseSnippet",
3010
3010
  "optional": true,
@@ -3022,7 +3022,7 @@
3022
3022
  "immutable": true,
3023
3023
  "locationInModule": {
3024
3024
  "filename": "src/vinylcache.ts",
3025
- "line": 444
3025
+ "line": 466
3026
3026
  },
3027
3027
  "name": "vclDeliverSnippet",
3028
3028
  "optional": true,
@@ -3040,7 +3040,7 @@
3040
3040
  "immutable": true,
3041
3041
  "locationInModule": {
3042
3042
  "filename": "src/vinylcache.ts",
3043
- "line": 498
3043
+ "line": 520
3044
3044
  },
3045
3045
  "name": "vclFiniSnippet",
3046
3046
  "optional": true,
@@ -3058,7 +3058,7 @@
3058
3058
  "immutable": true,
3059
3059
  "locationInModule": {
3060
3060
  "filename": "src/vinylcache.ts",
3061
- "line": 486
3061
+ "line": 508
3062
3062
  },
3063
3063
  "name": "vclHashSnippet",
3064
3064
  "optional": true,
@@ -3076,7 +3076,7 @@
3076
3076
  "immutable": true,
3077
3077
  "locationInModule": {
3078
3078
  "filename": "src/vinylcache.ts",
3079
- "line": 450
3079
+ "line": 472
3080
3080
  },
3081
3081
  "name": "vclHitSnippet",
3082
3082
  "optional": true,
@@ -3094,7 +3094,7 @@
3094
3094
  "immutable": true,
3095
3095
  "locationInModule": {
3096
3096
  "filename": "src/vinylcache.ts",
3097
- "line": 492
3097
+ "line": 514
3098
3098
  },
3099
3099
  "name": "vclInitSnippet",
3100
3100
  "optional": true,
@@ -3112,7 +3112,7 @@
3112
3112
  "immutable": true,
3113
3113
  "locationInModule": {
3114
3114
  "filename": "src/vinylcache.ts",
3115
- "line": 456
3115
+ "line": 478
3116
3116
  },
3117
3117
  "name": "vclMissSnippet",
3118
3118
  "optional": true,
@@ -3130,7 +3130,7 @@
3130
3130
  "immutable": true,
3131
3131
  "locationInModule": {
3132
3132
  "filename": "src/vinylcache.ts",
3133
- "line": 462
3133
+ "line": 484
3134
3134
  },
3135
3135
  "name": "vclPassSnippet",
3136
3136
  "optional": true,
@@ -3148,7 +3148,7 @@
3148
3148
  "immutable": true,
3149
3149
  "locationInModule": {
3150
3150
  "filename": "src/vinylcache.ts",
3151
- "line": 468
3151
+ "line": 490
3152
3152
  },
3153
3153
  "name": "vclPipeSnippet",
3154
3154
  "optional": true,
@@ -3166,7 +3166,7 @@
3166
3166
  "immutable": true,
3167
3167
  "locationInModule": {
3168
3168
  "filename": "src/vinylcache.ts",
3169
- "line": 480
3169
+ "line": 502
3170
3170
  },
3171
3171
  "name": "vclPurgeSnippet",
3172
3172
  "optional": true,
@@ -3174,18 +3174,37 @@
3174
3174
  "primitive": "string"
3175
3175
  }
3176
3176
  },
3177
+ {
3178
+ "abstract": true,
3179
+ "docs": {
3180
+ "default": "- for the Volto variant without a custom `vclRecvSnippet`: the\nbuilt-in plone-vinyl-recv-routing-volto.vcl, which sends `/++api++` and\nblob URLs to `plone_backend` with a VirtualHostMonster rewrite for\n`plone.siteId` and everything else to `plone_frontend`. Otherwise none.",
3181
+ "remarks": "cloud-vinyl runs it for every request method except PURGE and BAN, before\nits GET/HEAD check, so set the backend and rewrite URLs here.\nAddress a backend through its director as `<name>.backend(by=URL)`,\ne.g. `plone_backend.backend(by=URL)`: backends without their own director\nare shard directors in cloud-vinyl.\n\nRequires the operator and CRD of cloud-vinyl 1.2.0 or later. An older CRD\ndrops the field without an error.",
3182
+ "stability": "stable",
3183
+ "summary": "VCL snippet for routing in vcl_recv (`spec.vcl.snippets.vclRecvRouting`)."
3184
+ },
3185
+ "immutable": true,
3186
+ "locationInModule": {
3187
+ "filename": "src/vinylcache.ts",
3188
+ "line": 406
3189
+ },
3190
+ "name": "vclRecvRoutingSnippet",
3191
+ "optional": true,
3192
+ "type": {
3193
+ "primitive": "string"
3194
+ }
3195
+ },
3177
3196
  {
3178
3197
  "abstract": true,
3179
3198
  "docs": {
3180
3199
  "default": "- uses built-in plone-vinyl-recv.vcl",
3181
- "remarks": "Replaces the default Plone recv snippet.",
3200
+ "remarks": "cloud-vinyl runs it for GET and HEAD only. Route requests in\n`vclRecvRoutingSnippet` instead, otherwise POST, PUT, PATCH, DELETE and\nOPTIONS go to the first backend without your rewrites.",
3182
3201
  "stability": "stable",
3183
- "summary": "Custom VCL snippet for vcl_recv subroutine."
3202
+ "summary": "Custom VCL snippet for vcl_recv subroutine. Replaces the default Plone recv snippet."
3184
3203
  },
3185
3204
  "immutable": true,
3186
3205
  "locationInModule": {
3187
3206
  "filename": "src/vinylcache.ts",
3188
- "line": 384
3207
+ "line": 388
3189
3208
  },
3190
3209
  "name": "vclRecvSnippet",
3191
3210
  "optional": true,
@@ -3203,7 +3222,7 @@
3203
3222
  "immutable": true,
3204
3223
  "locationInModule": {
3205
3224
  "filename": "src/vinylcache.ts",
3206
- "line": 474
3225
+ "line": 496
3207
3226
  },
3208
3227
  "name": "vclSynthSnippet",
3209
3228
  "optional": true,
@@ -3783,6 +3802,6 @@
3783
3802
  "symbolId": "src/vinylcache:VinylCacheTracing"
3784
3803
  }
3785
3804
  },
3786
- "version": "0.3.3",
3787
- "fingerprint": "nJX1t9f3qumXXSIN9idM7+CqQwi2igWF2zZmvy9lXdU="
3805
+ "version": "0.3.4",
3806
+ "fingerprint": "4k58oBhT6zKpF8LUEwJMIk/uPzREvJ7JkfpG+Vg7kbY="
3788
3807
  }
package/API.md CHANGED
@@ -2338,7 +2338,8 @@ const ploneVinylCacheOptions: PloneVinylCacheOptions = { ... }
2338
2338
  | <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.vclPassSnippet">vclPassSnippet</a></code> | <code>string</code> | Custom VCL snippet for vcl_pass subroutine. |
2339
2339
  | <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.vclPipeSnippet">vclPipeSnippet</a></code> | <code>string</code> | Custom VCL snippet for vcl_pipe subroutine. |
2340
2340
  | <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.vclPurgeSnippet">vclPurgeSnippet</a></code> | <code>string</code> | Custom VCL snippet for vcl_purge subroutine. |
2341
- | <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.vclRecvSnippet">vclRecvSnippet</a></code> | <code>string</code> | Custom VCL snippet for vcl_recv subroutine. |
2341
+ | <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.vclRecvRoutingSnippet">vclRecvRoutingSnippet</a></code> | <code>string</code> | VCL snippet for routing in vcl_recv (`spec.vcl.snippets.vclRecvRouting`). |
2342
+ | <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.vclRecvSnippet">vclRecvSnippet</a></code> | <code>string</code> | Custom VCL snippet for vcl_recv subroutine. Replaces the default Plone recv snippet. |
2342
2343
  | <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.vclSynthSnippet">vclSynthSnippet</a></code> | <code>string</code> | Custom VCL snippet for vcl_synth subroutine. |
2343
2344
 
2344
2345
  ---
@@ -2879,6 +2880,28 @@ Custom VCL snippet for vcl_purge subroutine.
2879
2880
 
2880
2881
  ---
2881
2882
 
2883
+ ##### `vclRecvRoutingSnippet`<sup>Optional</sup> <a name="vclRecvRoutingSnippet" id="@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.vclRecvRoutingSnippet"></a>
2884
+
2885
+ ```typescript
2886
+ public readonly vclRecvRoutingSnippet: string;
2887
+ ```
2888
+
2889
+ - *Type:* string
2890
+ - *Default:* for the Volto variant without a custom `vclRecvSnippet`: the built-in plone-vinyl-recv-routing-volto.vcl, which sends `/++api++` and blob URLs to `plone_backend` with a VirtualHostMonster rewrite for `plone.siteId` and everything else to `plone_frontend`. Otherwise none.
2891
+
2892
+ VCL snippet for routing in vcl_recv (`spec.vcl.snippets.vclRecvRouting`).
2893
+
2894
+ cloud-vinyl runs it for every request method except PURGE and BAN, before
2895
+ its GET/HEAD check, so set the backend and rewrite URLs here.
2896
+ Address a backend through its director as `<name>.backend(by=URL)`,
2897
+ e.g. `plone_backend.backend(by=URL)`: backends without their own director
2898
+ are shard directors in cloud-vinyl.
2899
+
2900
+ Requires the operator and CRD of cloud-vinyl 1.2.0 or later. An older CRD
2901
+ drops the field without an error.
2902
+
2903
+ ---
2904
+
2882
2905
  ##### `vclRecvSnippet`<sup>Optional</sup> <a name="vclRecvSnippet" id="@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.vclRecvSnippet"></a>
2883
2906
 
2884
2907
  ```typescript
@@ -2888,9 +2911,11 @@ public readonly vclRecvSnippet: string;
2888
2911
  - *Type:* string
2889
2912
  - *Default:* uses built-in plone-vinyl-recv.vcl
2890
2913
 
2891
- Custom VCL snippet for vcl_recv subroutine.
2914
+ Custom VCL snippet for vcl_recv subroutine. Replaces the default Plone recv snippet.
2892
2915
 
2893
- Replaces the default Plone recv snippet.
2916
+ cloud-vinyl runs it for GET and HEAD only. Route requests in
2917
+ `vclRecvRoutingSnippet` instead, otherwise POST, PUT, PATCH, DELETE and
2918
+ OPTIONS go to the first backend without your rewrites.
2894
2919
 
2895
2920
  ---
2896
2921
 
@@ -0,0 +1,21 @@
1
+ # Plone Volto routing snippet for cloud-vinyl (spec.vcl.snippets.vclRecvRouting)
2
+ # Runs in vcl_recv for every method except PURGE and BAN, before cloud-vinyl's
3
+ # GET/HEAD check, so logins, saves and uploads take the same route as reads.
4
+ # PloneVinylCache fills in the site id at synth time.
5
+ # Backends without their own director are shard directors in cloud-vinyl, so
6
+ # they are resolved by URL, like cloud-vinyl's own default backend hint.
7
+
8
+ # The REST API and blobs go to the Plone backend, rewritten for the
9
+ # VirtualHostMonster so that it answers for the site and builds public URLs.
10
+ if (req.url ~ "^/\+\+api\+\+" || req.url ~ "/@@(images|download|display-file)(/|$)") {
11
+ set req.backend_hint = plone_backend.backend(by=URL);
12
+ set req.http.x-vcl-proto = "http";
13
+ if (req.http.X-Forwarded-Proto) {
14
+ set req.http.x-vcl-proto = req.http.X-Forwarded-Proto;
15
+ }
16
+ set req.url = "/VirtualHostBase/" + req.http.x-vcl-proto + "/" + req.http.host + "/__PLONE_SITE_ID__/VirtualHostRoot" + req.url;
17
+ unset req.http.x-vcl-proto;
18
+ } else {
19
+ # Everything else is rendered by Volto.
20
+ set req.backend_hint = plone_frontend.backend(by=URL);
21
+ }
package/lib/httpcache.js CHANGED
@@ -56,7 +56,7 @@ const constructs_1 = require("constructs");
56
56
  * });
57
57
  */
58
58
  class PloneHttpcache extends constructs_1.Construct {
59
- static [JSII_RTTI_SYMBOL_1] = { fqn: "@bluedynamics/cdk8s-plone.PloneHttpcache", version: "0.3.3" };
59
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "@bluedynamics/cdk8s-plone.PloneHttpcache", version: "0.3.4" };
60
60
  /**
61
61
  * Name of the Varnish service created by the Helm chart.
62
62
  * Use this to reference the cache service from ingress or other constructs.