分类 其他 中的文章

caddy

caddy 是什么 golang 编写的反向代理服务器, 并提供了很多的插件, 可以自动注册 https 证书, 对懒人极度友好 版本选择 目前分为 v1, v2 两个版本, 本人迁移发现 v1,v2 版本并不兼容(Caddyfile), 建议使用 V2 版本, 但是目前中文教程里面使用 v1 版本的还是有很多 v1 版本密码认证是明文, v2 是一个 hash 后的密文 下载 && 安装 下载 在很早的时候 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.……

阅读全文

博客搭建

准备 hugo github nginx/caddy hugo 注意: 安装 extended 版本, 否则使用第三方主题时会有问题 hugo new site quickstart cd quickstart git clone https://github.com/flysnow-org/maupassant-hugo themes/maupassant echo theme = \"maupassant\" >> config.toml hugo new posts/my-first-post.md // 测试 hugo server -D // 生成静态文件 hugo -D github 创建 repo 设置 webhook 将上面的 quickstart 文件夹整体进行版本管理(其实只管理 content 也行, 要是为了方便换主题, 可以直接搞整个) 在 server 上启动 webhook server eg. package main import ( "crypto/hmac" "crypto/sha1" "encoding/hex" "fmt" "io/ioutil" "net/http" "os/exec" ) var ( key []byte ) func sha1Data(data []byte) string { h := hmac.……

阅读全文