让我们与Traefik加密(Let's Encrypt with Traefik)
我尝试使用Let's Encrypt与Traefik,但这里是Traefik的日志:
Looking for provided certificate to validate [rancher.foo.bar]... No provided certificate found for domains [rancher.foo.bar], get ACME certificate. Looking for an existing ACME challenge for rancher.foo.bar... No certificate found or generated for rancher.foo.bar http2: server: error reading preface from client 1.2.3.4:60876: remote error: tls: unknown certificate authority
这是我的配置:
traefikLogsFile = "/tmp/traefik.log" logLevel = "DEBUG" # DEBUG, INFO, WARN, ERROR, FATAL, PANIC [accessLog] filePath = "/tmp/access.log" [entryPoints] [entryPoints.http] address = ":80" [entryPoints.https] address = ":443" [entryPoints.https.tls] # Enable ACME (Let's Encrypt): automatic SSL. [acme] email = "foo@foo.bar" storage = "/tmp/acme.json" entryPoint = "https" onHostRule = true [acme.httpChallenge] entryPoint = "http" [api] entryPoint = "traefik" dashboard = true [docker] endpoint = "unix:///var/run/docker.sock" domain = "foo.bar" watch = true exposedbydefault = true usebindportip = true swarmmode = false
Traefik提供者:
{ "docker": { "backends": { "backend-rancher": { "servers": { "server-rancher": { "url": "http://172.17.0.3:8080", "weight": 0 } }, "loadBalancer": { "method": "wrr" } } }, "frontends": { "frontend-Host-rancher-foo-bar-0": { "entryPoints": [ "http" ], "backend": "backend-rancher", "routes": { "route-frontend-Host-rancher-foo-bar-0": { "rule": "Host:rancher.foo.bar" } }, "passHostHeader": true, "priority": 0, "basicAuth": [] } } } }
怎么了?
谢谢I try to use Let's Encrypt with Traefik, but here are Traefik's log:
Looking for provided certificate to validate [rancher.foo.bar]... No provided certificate found for domains [rancher.foo.bar], get ACME certificate. Looking for an existing ACME challenge for rancher.foo.bar... No certificate found or generated for rancher.foo.bar http2: server: error reading preface from client 1.2.3.4:60876: remote error: tls: unknown certificate authority
Here is my config:
traefikLogsFile = "/tmp/traefik.log" logLevel = "DEBUG" # DEBUG, INFO, WARN, ERROR, FATAL, PANIC [accessLog] filePath = "/tmp/access.log" [entryPoints] [entryPoints.http] address = ":80" [entryPoints.https] address = ":443" [entryPoints.https.tls] # Enable ACME (Let's Encrypt): automatic SSL. [acme] email = "foo@foo.bar" storage = "/tmp/acme.json" entryPoint = "https" onHostRule = true [acme.httpChallenge] entryPoint = "http" [api] entryPoint = "traefik" dashboard = true [docker] endpoint = "unix:///var/run/docker.sock" domain = "foo.bar" watch = true exposedbydefault = true usebindportip = true swarmmode = false
Traefik providers:
{ "docker": { "backends": { "backend-rancher": { "servers": { "server-rancher": { "url": "http://172.17.0.3:8080", "weight": 0 } }, "loadBalancer": { "method": "wrr" } } }, "frontends": { "frontend-Host-rancher-foo-bar-0": { "entryPoints": [ "http" ], "backend": "backend-rancher", "routes": { "route-frontend-Host-rancher-foo-bar-0": { "rule": "Host:rancher.foo.bar" } }, "passHostHeader": true, "priority": 0, "basicAuth": [] } } } }
What's wrong?
Thanks
原文:https://stackoverflow.com/questions/48686001
更新时间:2022-09-15 14:09
最满意答案
您必须
append
到文件不write
文件。
这是修复:f = open('results.txt','a')
'w'
表示您正在写入文件(覆盖)
'a'
表示您要附加到该文件如果您想了解有关打开文件的不同模式的更多信息,请访问: http : //www.tutorialspoint.com/python/python_files_io.htm
You must
append
to file notwrite
to file.
Here is the fix:f = open('results.txt','a')
'w'
signifies that you are writing to the file (overwrites)
'a'
signifies that you are appending to the fileIf you want to learn more about different modes of opening file, visit: http://www.tutorialspoint.com/python/python_files_io.htm
相关问答
更多-
您应该知道dict中键的顺序是实现定义的,即随机的。 因此,建议对它们进行排序 。 除此之外,只需使用csv模块应该工作: import csv maxDict = {'test1': ('alpha', 2), 'test2': ('gamma', 2)} keys = sorted(maxDict.keys()) csvw = csv.writer(open('output.csv', 'wb')) csvw.writerow(keys) data = [maxDict[k] for k in key ...
-
编写一个pytest函数来检查输出到Python中的文件?(writing a pytest function to check outputting to a file in python?)[2023-04-06]
有tmpdir夹具将为您创建每个测试临时目录。 所以测试看起来像这样: def writetoafile(fname): with open(fname, 'w') as fp: fp.write('Hello\n') def test_writetofile(tmpdir): file = tmpdir.join('output.txt') writetoafile(file.strpath) # or use str(file) assert file ... -
试试这段代码(使用-1退出): savings = [] def add_accounts(date, account, balance): savings.append({'date': date, 'account': account, 'balance': balance}) def print_accounts(): print(savings) while True: date = input('Enter the date, type exit to exit ...
-
您必须append到文件不 write文件。 这是修复: f = open('results.txt','a') 'w'表示您正在写入文件(覆盖) 'a'表示您要附加到该文件 如果您想了解有关打开文件的不同模式的更多信息,请访问: http : //www.tutorialspoint.com/python/python_files_io.htm You must append to file not write to file. Here is the fix: f = open('results. ...
-
with open (input_file_name) as fi, open(output_file_name, 'w') as fo: fo.writelines(reversed(fi.readlines())) 如果input_file格式错误(最后一行不以'\ n'结尾),您可以使用快速(可能不太高效)的黑客攻击: with open ('c:\\temp\\input_file') as fi, open('c:\\temp\\output_file', 'w') as fo: ...
-
当从-main调用时,Clojure函数不会将输出写入文件(Clojure function not writing output to file when called from -main)[2023-03-06]
for不是一个循环。 你的-main返回一个懒惰的序列,你永远不会强迫它的任何元素。 复制力量为了打印,这就是为什么你看到不同。 如果您想要副作用而不是序列, doseq与其他语义具有相同的语义。 for is not a loop. Your -main is returning a lazy sequence, and you never force any of its elements. The repl forces in order to print, which is why you see ... -
无需测试,只需使用getattr() : # retrieve stdout as a binary file object output = getattr(sys.stdout, 'buffer', sys.stdout) 这将检索sys.stdout上的.buffer属性,但如果它不存在(Python 2),它将返回sys.stdout对象本身。 Python 2: >>> import sys >>> getattr(sys.stdout, 'buffer', sys.stdout)@reculseSoul,使用str.format方法并关闭for循环外部的str.format fileWrite.close() 。 请尝试下面它应该工作。 def ChkCon(): Flag = False FlagTcp = False NewStr = '' OutStr = '' HOST = '' MARKER = '----------------' NEWLINE = '\n' fileData = 'ld ...
计算文件中的字母频率并写入输出文件python(Counting Frequency of Letters in a file and writing to a output file python)[2022-10-04]
根本没有必要分词; 直接将字符串传递给计数器会更新每个字符的计数。 您还需要先收集所有计数,然后才将它们写入输出文件: from collections import Counter def count_letters(in_filename, out_filename): counts = Counter() with open(in_filename, "r") as in_file: for chunk in iter(lambda: in_file.read(819 ...首先,你的缩进是错误的。 其次,你将f传递给def但似乎f是一个文件处理程序,所以你不能再在定义中打开它。 这是一个有效的代码: file.txt的内容: asd >No D bsd csd 代码: f = open("file.txt", "r+") def Filter_NoD(f): """this function filters out lines with no D region and saves them in a separate file""" lines = f.re ...相关文章
更多- Android平台下的AES加密和Java平台下的运行结果不同的解决办法
- SVN使用SASL加密
- 微信,让我们走出家门,但光着身子
- Base64加密解密
- discuz7.0论坛整合自己的项目 主要是改登录加密改成自己的加密方式
- She’s Not Carrying A Handbag
- Storm,yahoo!S4比较
- Just Forget To Ask The Handbag's Name
- (转)魔兽地图加密脚本和反作弊脚本原理一览
- Yahoo! s4和Twitter storm的粗略比较
最新问答
更多- 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
- 如何通过引用返回对象?(How is returning an object by reference possible?)
- 矩阵如何存储在内存中?(How are matrices stored in memory?)
- 每个请求的Java新会话?(Java New Session For Each Request?)
- css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
- 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
- xcode语法颜色编码解释?(xcode syntax color coding explained?)
- 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
- 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
- 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
- 西安哪有PLC可控制编程的培训
- 在Entity Framework中选择基类(Select base class in Entity Framework)
- 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
- 电脑二级VF有什么用
- Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
- 金华英语角.
- 手机软件如何制作
- 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
- 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
- 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
- Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
- 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
- python的访问器方法有哪些
- DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
- 在Ruby中对组合进行排序(Sorting a combination in Ruby)
- 网站开发的流程?
- 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
- 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
- 透明度错误IE11(Transparency bug IE11)
- linux的基本操作命令。。。