Prettier 内联忽略文件
不想在项目中再多一个 .prettierignore 文件,并且还希望 ignore pattern 能和 Sharable Configurations 一起打包共享。Ignore commonly generated folders · Issue #4547 · prettier/prettier 给出了个好办法,使用 requirePragma 来在没主动指定标记的文件中关闭格式化
/**
* @see https://prettier.io/docs/configuration
* @type {import("prettier").Config}
*/
const config = {
// 文件特殊规则
overrides: [
{
// requirePragma 用来禁用格式化
// https://github.com/prettier/prettier/issues/4547#issuecomment-1606712871
files: ["pnpm-lock.yaml"],
options: { requirePragma: true },
},
],
};
// noinspection JSUnusedGlobalSymbols
export default config;nginx 在 IPv6 下串站
我在 BT-Panel 下用 Docker 部署了网站,绑定了多个域名,其中主域名是走 EdgeOne CDN 访问没问题,有一个备用调试域名访问返回 403(BT-Panel 对找不到站点的默认响应),使用 curl -4 强制 IPv4 没问题。
回退到默认就是串站了,修起来很简单,网站的设置 > 全局设置(有缓存、内容压缩、IP 黑白名单的设置页面) > IPv6 开启。
最终配置文件长这样,监听 IPv6 地址。宝塔面板没有批量设置页面,得一个个改
server {
listen 80;
listen 443 quic;
listen 443 ssl;
listen [::]:80;
listen [::]:443 quic;
listen [::]:443 ssl ;
http2 on;
server_name httpbin.kokomi.me httpbin.paimon.kokomi.me;umami 更新 v2.20 后数据丢失
还好只是表现地像数据丢失一样,其实数据都好好地在数据库里存着,只是因为镜像中多了个 .env 文件,没加载我的数据库
添加 -v /dev/null:/app/.env:ro 把文件从镜像中隐去就没事了。别忘了事后 Umami IP 定位到南非 Pretoria
然后这就是那个文件的内容,居然是互联网可访问的地址,我说怎么日志中有 clickhouse 的查询
LOG_QUERY=1
DEBUG=umami:*
APP_SECRET=paisley-polo-solo
DATABASE_URL=postgresql://umami:battle-wizard-penny@dev-01.umami.dev:5432/umami?schema=analytics
#DATABASE_URL=mysql://root:regal-knight-pepper@dev-01.umami.dev:3306/umami_dev
CLICKHOUSE_URL=http://umami:agile-tank-crouton@dev-01.umami.dev:8123/umami
REDIS_URL=redis://:feisty-bandit-paisley@dev-01.umami.dev:6379
ENABLE_TEST_CONSOLE=1
FAVICON_URL=https://www.google.com/s2/favicons?domain={{domain}}
#DISABLE_LOGIN=1
#DISABLE_UI=1更新 Umami 后无法访问 dashboard 页面
在访问 https://umami.kokomi.me/dashboard 时因一个 POST /dashboard 接口返回 404 而中断,显示白屏。
# curl 'https://umami.kokomi.me/dashboard' -H 'accept: text/x-component' -H 'accept-language: zh-CN,zh;q=0.9,en;q=0.8' -H 'content-type: text/plain;charset=UTF-8' -H 'next-action: 00fad67d81baab4f9063f34d277fd0521af73950c5' -H 'next-router-state-tree: %5B%22%22%2C%7B%22children%22%3A%5B%22(main)%22%2C%7B%22children%22%3A%5B%22dashboard%22%2C%7B%22children%22%3A%5B%22__PAGE__%22%2C%7B%7D%2C%22%2Fdashboard%22%2C%22refresh%22%5D%7D%5D%7D%5D%7D%2Cnull%2Cnull%2Ctrue%5D' -H 'origin: https://umami.kokomi.me' -H 'priority: u=1, i' -H 'referer: https://umami.kokomi.me/dashboard' -H 'sec-ch-ua: "Chromium";v="142", "Microsoft Edge";v="142", "Not_A Brand";v="99"' -H 'sec-ch-ua-mobile: ?0' -H 'sec-ch-ua-platform: "Windows"' -H 'sec-fetch-dest: empty' -H 'sec-fetch-mode: cors' -H 'sec-fetch-site: same-origin' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0' --data-raw '[]' -v
* Host umami.kokomi.me:443 was resolved.
* IPv6: 2409:8c1e:8f80:2:6f::15, 2409:8c1e:68e0:a08:5e::27
* IPv4: 112.13.210.179, 36.150.72.224
* Trying [2409:8c1e:8f80:2:6f::15]:443...
> POST /dashboard HTTP/2
> Host: umami.kokomi.me
> accept: text/x-component
> accept-language: zh-CN,zh;q=0.9,en;q=0.8
> content-type: text/plain;charset=UTF-8
> next-action: 00fad67d81baab4f9063f34d277fd0521af73950c5
> next-router-state-tree: %5B%22%22%2C%7B%22children%22%3A%5B%22(main)%22%2C%7B%22children%22%3A%5B%22dashboard%22%2C%7B%22children%22%3A%5B%22__PAGE__%22%2C%7B%7D%2C%22%2Fdashboard%22%2C%22refresh%22%5D%7D%5D%7D%5D%7D%2Cnull%2Cnull%2Ctrue%5D
> origin: https://umami.kokomi.me
> priority: u=1, i
> referer: https://umami.kokomi.me/dashboard
> sec-ch-ua: "Chromium";v="142", "Microsoft Edge";v="142", "Not_A Brand";v="99"
> sec-ch-ua-mobile: ?0
> sec-ch-ua-platform: "Windows"
> sec-fetch-dest: empty
> sec-fetch-mode: cors
> sec-fetch-site: same-origin
> user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0
> Content-Length: 2
>
* upload completely sent off: 2 bytes
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
< HTTP/2 404
< server: nginx
< content-type: text/plain
< x-dns-prefetch-control: on
< content-security-policy: default-src 'self';img-src * data:;script-src 'self' 'unsafe-eval' 'unsafe-inline';style-src 'self' 'unsafe-inline';connect-src 'self' api.umami.is cloud.umami.is;frame-ancestors 'self'
< vary: rsc, next-router-state-tree, next-router-prefetch, next-router-segment-prefetch, Accept-Encoding
< x-nextjs-action-not-found: 1
< x-nextjs-cache: HIT
< x-nextjs-prerender: 1
< etag: "b11cvpkueto"
< cache-control: must-revalidate, no-cache, no-store, max-age=0
< content-length: 24
< date: Sat, 06 Dec 2025 18:27:04 GMT
< eo-log-uuid: 7342127085742984751
< eo-cache-status: MISS
< nel: {"success_fraction":0.1,"report_to":"eo-nel","max_age":604800}
< report-to: {"endpoints":[{"url":"https://nel.teo-rum.com/eo-cgi/nel"}],"group":"eo-nel","max_age":604800}
<
* Connection #0 to host umami.kokomi.me left intact其实就是 GET /dashboard 的页面资源被 EdgeOne 缓存住了,用旧版本的 'next-action: 00fad67d81baab4f9063f34d277fd0521af73950c5' 尝试做 POST 请求铁定失败,去清理缓存就好