]> git.sesse.net Git - letsencrypt-varnish-plugin/commitdiff
Rename letsencrypt to certbot everywhere.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 16 Apr 2023 10:59:58 +0000 (12:59 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 16 Apr 2023 11:00:06 +0000 (13:00 +0200)
varnish.py

index 650bcbb8f71d4977b8afa7c7e25187de83c21ec9..a1d144871f3dc1c64ca353132b05fa3c09edd3f1 100644 (file)
@@ -19,10 +19,10 @@ logger = logging.getLogger(__name__)
 
 def vcl_recv_line(achall):
     # Don't bother checking for the right host, we could be coming in through a redirect.
-    return 'if (req.url == "/%s/%s") { return (synth(999, "Challenge")); }  # Added by letsencrypt Varnish plugin for authentication\n' % (achall.URI_ROOT_PATH, achall.chall.encode("token"))
+    return 'if (req.url == "/%s/%s") { return (synth(999, "Challenge")); }  # Added by certbot Varnish plugin for authentication\n' % (achall.URI_ROOT_PATH, achall.chall.encode("token"))
 
 def vcl_synth_line(validation):
-    return 'if (resp.status == 999) { set resp.status = 200; set resp.http.Content-Type = "text/plain"; synthetic("%s"); return (deliver); }  # Added by letsencrypt Varnish plugin for authentication\n' % (validation);
+    return 'if (resp.status == 999) { set resp.status = 200; set resp.http.Content-Type = "text/plain"; synthetic("%s"); return (deliver); }  # Added by certbot Varnish plugin for authentication\n' % (validation);
 
 @implementer(interfaces.IAuthenticator)
 @provider(interfaces.IPluginFactory)
@@ -66,7 +66,7 @@ class Authenticator(common.Plugin):
         found_vcl_synth = False
         new_content = []
         for line in content:
-            if re.search("# Added by letsencrypt Varnish plugin", line):
+            if re.search("# Added by certbot Varnish plugin", line):
                 # Don't include this line; left by a previous run.
                 continue
             new_content.append(line)
@@ -78,14 +78,14 @@ class Authenticator(common.Plugin):
                 found_vcl_synth = True
 
         if not found_vcl_recv:
-            new_content.append("sub vcl_recv {  # Added by letsencrypt Varnish plugin for authentication\n")
+            new_content.append("sub vcl_recv {  # Added by certbot Varnish plugin for authentication\n")
             new_content.append(vcl_recv_line(achall))
-            new_content.append("}  # Added by letsencrypt Varnish plugin for authentication\n")
+            new_content.append("}  # Added by certbot Varnish plugin for authentication\n")
 
         if not found_vcl_synth:
-            new_content.append("sub vcl_synth {  # Added by letsencrypt Varnish plugin for authentication\n")
+            new_content.append("sub vcl_synth {  # Added by certbot Varnish plugin for authentication\n")
             new_content.append(vcl_synth_line(validation))
-            new_content.append("}  # Added by letsencrypt Varnish plugin for authentication\n")
+            new_content.append("}  # Added by certbot Varnish plugin for authentication\n")
 
         with open("/etc/varnish/default.vcl", "w") as vcl:
             vcl.writelines(new_content)