<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>运维与部署 on Two Tigers Engineering</title>
    <link>https://blog.twotigers.xyz/categories/%E8%BF%90%E7%BB%B4%E4%B8%8E%E9%83%A8%E7%BD%B2/</link>
    <description>Recent content in 运维与部署 on Two Tigers Engineering</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 12 Feb 2023 22:00:08 +0800</lastBuildDate><atom:link href="https://blog.twotigers.xyz/categories/%E8%BF%90%E7%BB%B4%E4%B8%8E%E9%83%A8%E7%BD%B2/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>caddy</title>
      <link>https://blog.twotigers.xyz/posts/caddy/</link>
      <pubDate>Sun, 12 Feb 2023 22:00:08 +0800</pubDate>
      
      <guid>https://blog.twotigers.xyz/posts/caddy/</guid>
      <description>caddy 是什么 golang 编写的反向代理服务器, 并提供了很多的插件, 可以自动注册 https 证书, 对懒人极度友好
版本选择 目前分为 v1, v2 两个版本, 本人迁移发现 v1,v2 版本并不兼容(Caddyfile), 建议使用 V2 版本, 但是目前中文教程里面使用 v1 版本的还是有很多 v1 版本密码认证是明文, v2 是一个 hash 后的密文
下载 &amp;amp;&amp;amp; 安装 下载 在很早的时候 caddy 跟 cloudflare 不太兼容, 会导致无法注册 https 证书, 虽然概率不高, 但是遇见了就比较蛋疼, 建议选择上 caddy-dns/cloudflare 插件 安装 下载完二进制文件后, 建议配置 systemd, 参考 官方文档 以下是我自己使用的配置文件, 大家可以参考下
# caddy.service # # For using Caddy with a config file. # # Make sure the ExecStart and ExecReload commands are correct # for your installation.</description>
    </item>
    
    <item>
      <title>ufw 无法禁用 docker端口问题</title>
      <link>https://blog.twotigers.xyz/posts/docker/</link>
      <pubDate>Sun, 06 Nov 2022 13:00:00 +0800</pubDate>
      
      <guid>https://blog.twotigers.xyz/posts/docker/</guid>
      <description>装好了docker,以及 ufw 然后禁用了 3000 端口, ufw deny 3000
并且启动了一个容器 启动命令是这样的 docker run -it -p 3000:3000 python 但之后发现一个问题, IP:3000 居然可以访问到
查询资料得知, 淦, 发现这是个陈年老问题了 查到一个好用的 repo, https://github.com/chaifeng/ufw-docker 并且按照他的教程进行了设置
但是紧接着发现了问题 这样设置完之后, 开放端口3000(ufw allow 3000), 居然不生效了 看了下 readme 显示 现在外部就已经无法访问 Docker 发布出来的任何端口了，但是容器内部以及私有网络地址上可以正常互相访问，而且容器也可以正常访问外部的网络。 显然这不是我想要的结果
最终在stackoverflow找到了符合我需求的解决方案
cat &amp;lt;&amp;lt; EOF &amp;gt;&amp;gt; /etc/docker/daemon.json { &amp;#34;iptables&amp;#34;: false } EOF echo &amp;#34;DOCKER_OPTS=\&amp;#34;--iptables=false\&amp;#34;&amp;#34; &amp;gt;&amp;gt; /etc/default/docker service docker restart -参考资料: https://stackoverflow.com/a/67641547</description>
    </item>
    
  </channel>
</rss>
