我已经安装了 microk8s、traefik 和 cert-manager。当我尝试接收 LetsEncrypt 证书时,会创建一个用于回答挑战的新 Pod,但来自 LetEnCryt 服务器的请求不会到达此 Pod。相反,请求会转发到为网站提供服务的 Pod。
看起来将流量路由到 Web Pod 的入口路由的优先级高于将请求路由/.well-known/acme-challenge/...到正确 Pod 的入口。我缺少什么?
kubectl edit clusterissuer letsencrypt-prod:
kind: ClusterIssuer
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"cert-manager.io/v1","kind":"ClusterIssuer","metadata":{"annotations":{},"name":"letsencrypt-prod"},"spec":{"acme":{"email":"office@mydomain.com","privateKeySecretRef":{"name":"letsencrypt-prod"},"server":"https://acme-v02.api.letsencrypt.org/directory","solvers":[{"http01":{"ingress":{"class":"traefik"}}}]}}}
creationTimestamp: "2022-07-11T14:32:15Z"
generation: 11
name: letsencrypt-prod
resourceVersion: "49979842"
uid: 40c4e26d-9c94-4cda-aa3a-357491bdb25a
spec:
acme:
email: office@mydomain.com
preferredChain: ""
privateKeySecretRef:
name: letsencrypt-prod
server: https://acme-v02.api.letsencrypt.org/directory
solvers:
- http01:
ingress: {}
status:
acme:
lastRegisteredEmail: office@mydomain.com
uri: https://acme-v02.api.letsencrypt.org/acme/acct/627190636
conditions:
- lastTransitionTime: "2022-07-11T14:32:17Z"
message: The ACME account was registered with the ACME server
observedGeneration: 11
reason: …Run Code Online (Sandbox Code Playgroud) 在脚本中,我想确保一个mysql用户在特定数据库上根本没有任何权限.所以我这样做:
revoke all privileges on `testdb`.* from 'testuser'@'%'
Run Code Online (Sandbox Code Playgroud)
但是如果用户对此数据库没有任何权限,我会收到此错误:
There is no such grant defined for user 'testuser' on host '%'
Run Code Online (Sandbox Code Playgroud)
什么是绝对正确的,但我的脚本现在抛出一个错误并停止.我不想让我的脚本忽略此语句中的所有错误.
所以有类似的东西
revoke all privileges if exist ...
Run Code Online (Sandbox Code Playgroud)
我在mysql手册中找不到任何相关内容.
我在 Ubuntu 上使用最新版本的 Visual Studio Code (1.52.1) 和 PHP Intelephense 1.5.4。尽管它是最新版本,但它似乎不知道新的 PHP 8 语法。例如,它在使用 nullsafe 运算符时显示错误:
$myobject?->myfunction();
Run Code Online (Sandbox Code Playgroud)
有没有办法教 VSC PHP 8 还是我们必须等待更新?
我在test.php中有以下测试代码:
<?php
$step = $_GET['step'];
switch($step) {
case 1:
include 'foo.php'; # line 5
file_put_contents('foo.php', '<?php print "bar\\n"; ?>');
header('Location: test.php?step=2');
break;
case 2:
print "step 2:\n";
include 'foo.php';
break;
}
?>
Run Code Online (Sandbox Code Playgroud)
foo.php最初有以下内容:
<?php print "foo\n"; ?>
Run Code Online (Sandbox Code Playgroud)
当我在浏览器中调用test.php?step = 1时,我希望得到以下输出:
step 2:
bar
Run Code Online (Sandbox Code Playgroud)
但我得到这个输出:
step 2:
foo
Run Code Online (Sandbox Code Playgroud)
当我在第5行注释掉include时,我得到了理想的结果.结论是,PHP缓存了foo.php的内容.当我用step = 2重新加载页面时,我也得到了所需的结果.
现在......为什么这样以及如何避免这种情况?
VBA的奇怪行为:
这会在第3行中出现错误94"非法使用Null":
Function test1()
Dim a As String
a = Null
test1 = a
End Function
Run Code Online (Sandbox Code Playgroud)
但是......这很完美:
Function test1()
Dim a, b As String
a = Null
test1 = a
End Function
Run Code Online (Sandbox Code Playgroud)
唯一的区别是第2行中的变量b,它从未使用过!WTF正在这里?
php ×2
caching ×1
cert-manager ×1
intelephense ×1
kubernetes ×1
mysql ×1
php-8 ×1
ssl ×1
traefik ×1
vba ×1