From 8b28c36d480070c8cf954cb27bec3b44bd7d12ca Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Thu, 6 Feb 2020 18:46:52 -0700 Subject: Remove Starlark, for now This is temporary as we prepare for a stable v2 release. We don't want to make promises we don't know we can keep, and the Starlark integration deserves much more focused attention which resources and funding do not currently permit. When the project is financially stable, I will be able to revisit this properly and add flexible, robust Starlark scripting support to Caddy 2. --- .../caddyhttp/starlarkmw/tools/gen/example.star | 40 ---------------------- 1 file changed, 40 deletions(-) delete mode 100644 modules/caddyhttp/starlarkmw/tools/gen/example.star (limited to 'modules/caddyhttp/starlarkmw/tools/gen') diff --git a/modules/caddyhttp/starlarkmw/tools/gen/example.star b/modules/caddyhttp/starlarkmw/tools/gen/example.star deleted file mode 100644 index 6ccab32..0000000 --- a/modules/caddyhttp/starlarkmw/tools/gen/example.star +++ /dev/null @@ -1,40 +0,0 @@ -# any module that provisions resources -proxyConfig = { - 'load_balance_type': 'round_robin', - 'upstreams': [ - { - 'host': 'http://localhost:8080', - 'circuit_breaker': { - 'type': 'status_ratio', - 'threshold': 0.5 - } - }, - { - 'host': 'http://localhost:8081' - } - ] -} - -sfConfig = { - 'root': '/Users/dev/Desktop', - 'browse': {}, -} - -proxy = loadResponder('reverse_proxy', proxyConfig) -static_files = loadResponder('file_server', sfConfig) - -def setup(r): - # create some middlewares specific to this request - mid = [] - - if r.query.get('log') == 'true': - logMid = loadMiddleware('log', {'file': 'access.log'}) - mid.append(logMid) - - execute(mid) - -def serveHTTP(w, r): - if r.url.find('static') > 0: - return static_files - - return proxy -- cgit v1.2.3