Skip to content

Commit

Permalink
Merge branch 'v4' of https://github.com/ArenaDruid/quartz into dev/ch…
Browse files Browse the repository at this point in the history
…inese-italic
  • Loading branch information
ArenaDruid committed Feb 6, 2025
2 parents 2b339d9 + 49e2a13 commit bcb31a5
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 17 deletions.
1 change: 1 addition & 0 deletions content/Nginx-Proxy-Manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ publish: true
date: 2025-01-23
tags:
- 运维
- Nginx
---
# 问题描述
Nginx Proxy manager 默认标准情况下启动时会尝试向[ip-ranges.amazonaws.com](https://ip-ranges.amazonaws.com/ip-ranges.json)获取ip-ranges.json。但是可能由于某种未确定的原因导致程序卡在这一步,日志如下:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions content/blog-20230126.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: 利用Nginx反代实现软件对IPv6网络访问的支持
publish: true
date: 2023-01-26
comments: true
tags:
- 运维
- Nginx
description:
---
# 前言
## 事情的起因
今天在为自己家里的NAS的Serviio家庭影音系统做调试的时候发现一个问题:Serviio的端口只能通过IPv4地址访问,而IPv6访问同样的端口却无法访问。如下图所示。

![[Pasted image 20250205162251.png]]
*IPv4可以访问,IPv6无法访问*
## 环境
- NAS:一台老台式机(i3-4150, 16G RAM, 500G HDD, Windows 8.1)
- 客户机:戴尔G15 5511
- 网络: 光猫拨号, 两台红米AX6S做AP Mesh组网,NAS与其中一台红米做有线连接,客户机无线接入网络

---

# 问题及其原因
## 问题
一些软件在IPv4环境下可以正常访问,但是在IPv6环境上无法访问。
## 原因猜测
一些软件没有监听来自IPv6的相同端口,导致IPv6环境无法访问IPv4环境下可以访问的端口。

---
# 处理方案
1. 下载并且安装好Nginx(本文不提供教程[^1]
2. **修改conf文件**:在 `%nginx目录%\conf\nginx.conf` 文件中的 `http{}` 内输入以下代码
```nginx
server{
listen [::]:<目标软件占用的端口>;
server_name localhost;
location /{
proxy_pass http://localhost:<目标软件占用的端口>/;
}
}
```

---
# 成果
![[Pasted image 20250205162912.png]]*IPv6和IPv4都能够正常访问*

---
# 问题与展望
## 关于代码的进一步改进
文中使用的反代代码只用了一个proxy_pass,这导致在日志中会出现无法追溯到原始ip的问题,这个在家庭个人使用作者觉得可以接受,如果觉得有需要的读者,可以自行研究 proxy_set_header的内容。
## 公网下家用宽带通过IPv6访问NAS或者家用服务器
如今IPv4资源已经枯竭,而国家正在大力推动IPv6发展,并最后实现[IPv6单栈网络](http://www.cac.gov.cn/2021-07/23/c_1628629122784001.htm)的愿景。

目前,家用宽带获取IPv4公网IP的难度越来越高;而家庭通过互联网来实现对家用设备的远程操控的需求也越来越高,因而,从长期来看,IPv6是大势所趋。 但是目前有许多软件对IPv6的兼容性并不好,出现了一些类似于本文所提到的问题。

本文提供了一种通过反向代理的方法来兼容IPv6网络的访问,方便有需要的家庭通过IPv6来远程操控,当然作者也更加希望在软件开发者们能够针对IPv6开发出更好的软件。

---
# 版权声明
Copyright © 2025 arenadruid.top | [![CC BY 4.0](https://licensebuttons.net/l/by/4.0/80x15.png)](https://creativecommons.org/licenses/by/4.0/)

[^1]: 如今从官网下载的最新windows版nginx和Ubuntu通过apt安装的最新nginx都是支持ipv6功能的
21 changes: 10 additions & 11 deletions content/blog-20250130.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
title: 运维案例:让不同SD-WAN工具统一虚拟IP的一个方法
title: 案例:让不同组网工具统一虚拟IP的一个方法
date: 2025-01-30
tags:
- 运维
- Tailscale
comments: true
publish: true
---
Expand Down Expand Up @@ -37,8 +38,7 @@ nginx 4378 root 37u IPv4 82287 0t0 UDP localhost:57131-
>53号端口的占用情况
![[Pasted image 20250130235953.png]]
>[!Note] 图注
>Tailscale拒绝了我使用非正式端口的服务作为名称服务器的操作
*Tailscale拒绝了我使用非正式端口的服务作为名称服务器的操作*

“这下一根筋变两头堵了”,我思考了一下,“也就是说,如果我想要实现这个方案,要不就得多弄一个服务器专门用来解析,要不就得对这个systemd-resovled服务下刀了。”无论哪个我都觉得麻烦。因此这个方案就搁浅了。

Expand All @@ -48,19 +48,18 @@ nginx 4378 root 37u IPv4 82287 0t0 UDP localhost:57131-
## 实践
首先,根据[子网路由文档](https://tailscale.com/kb/1019/subnets)的说明,我在服务器命令行终端运行了以下命令。

```text
sudo tailscale up --advertise-routes=192.168.188.3/32
```SHELL
sudo tailscale up --advertise-routes="192.168.188.3/32"
```
随后登陆[Tailscale管理控制台](https://login.tailscale.com/admin/machines),定位NAS所在位置,在额外选项中点击 *"Edit route settings"*,并给设置的192.168.188.3/32网段打勾。
![[Pasted image 20250131005212.png]]
>[!note] 图注
>给NAS端申请的网段打勾批准
*给NAS端申请的网段打勾批准*

此外还需要为客户端的Tailscale打开 **"Use Tailscale subnets"** 功能。

![[Pasted image 20250131005522.png]]
>[!note] 图注
>打开客户端Tailscale的"Use Tailscale subnets"功能
*打开客户端Tailscale的"Use Tailscale subnets"功能*
## 效果图

![[Pasted image 20250131005808.png]]
>[!note] 图注
Expand All @@ -75,9 +74,9 @@ sudo tailscale up --advertise-routes=192.168.188.3/32

---
# 版权页
<p xmlns:cc="http://creativecommons.org/ns#" >This work is licensed under <a href="https://creativecommons.org/licenses/by/4.0/?ref=chooser-v1" target="_blank" rel="license noopener noreferrer" style="display:inline-block;">CC BY 4.0<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://www.arenadruid.top/attachments/cc.svg" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://www.arenadruid.top/attachments/by.svg" alt=""></a></p>
Copyright © 2025 arenadruid.top | [![CC BY 4.0](https://licensebuttons.net/l/by/4.0/80x15.png)](https://creativecommons.org/licenses/by/4.0/)

[^1]: 理论上,专业版星空组网的**端口转发**功能也能实现类似效果。
[^2]: 关于Tailscale子网路由的更详细信息,可以参阅这篇文章[Subnet routers · Tailscale Docs](https://tailscale.com/kb/1019/subnets)
[^3]: 本文中Tailscale强制虚拟网段为100.64.0.0/10,而星空组网需要升级专业版来自定义虚拟网段,而且即使可以自定义虚拟网段,不同SD-WAN的虚拟网段重合只会导致网段冲突和网络问题
[^4]: 红迪上也聊到了这个问题
[^4]: 红迪[Share subnet with other user : r/Tailscale](https://www.reddit.com/r/Tailscale/comments/1b398x5/share_subnet_with_other_user/)上也聊到了这个问题
6 changes: 6 additions & 0 deletions content/blog-20250204.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ tags:
- obsidian
date: 2025-02-04
comments: true
description: 让 Obsidian 的中文斜体优雅显示为楷体,同时保持英文原生斜体效果
---
>[!abstract] 简介
>让 Obsidian 的中文斜体优雅显示为楷体,同时保持英文原生斜体效果
Expand Down Expand Up @@ -82,6 +83,11 @@ A:纯 CSS 实现,零性能影响
**Q:支持移动端吗?**
A:完全兼容 iOS/Android 版 Obsidian

%%
**Q:用了这个插件我的英文斜体字体改了怎么办?**
A:目前版本插件事实上既处理了中文也处理了英文斜体,你**必须**在插件中调整字体栈换上你想要的字体
%%

---

## 📜 协议许可
Expand Down
5 changes: 3 additions & 2 deletions content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Nice to meet you! This is Arena speaking.
我以前在想阿巴拉契亚是个什么样子的形象,但是如今认真思考了阿巴拉契亚的历史缘由和发展之后。我认为阿巴拉契亚只要是和阿瑞纳不一样的形象就足以了,无须拘泥于其设定。
# 随笔
1. [[blog-20250204|Obsidian 中文斜体楷体优化插件]]
2. [[blog-20250130|运维案例:让不同SD-WAN工具统一虚拟IP的一个方法]]
2. [[blog-20250130|案例:让不同组网工具统一虚拟IP的一个方法]]
3. [[Nginx-Proxy-Manager|Nginx proxy manager关于获取ip-ranges.json时卡住的解决方案]]
4. [[LOOPERS|时廻者 LOOPERS 短评]]
5. [[blog-20230310|在国际妇女节的思考——如何解决女性职场不公问题]]
5. [[blog-20230310|在国际妇女节的思考——如何解决女性职场不公问题]]
6. [[blog-20230126|利用Nginx反代实现软件对IPv6网络访问的支持]]
6 changes: 4 additions & 2 deletions content/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
comments: false
publish: false
---

"" “” *“”*
*纯中文斜体*
_中英文混合斜体 Chinese & English_

Chinese & English
**粗体 _嵌套斜体_**
`代码块不受影响`
`*代码块不受影响*`

![[Pic_20250204.png]]
*This is a caption. 这是题注*
4 changes: 2 additions & 2 deletions quartz.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const config: QuartzConfig = {
locale: "zh-CN",
baseUrl: "www.arenadruid.top",
ignorePatterns: ["private", "templates", ".obsidian"],
defaultDateType: "modified",
defaultDateType: "created",
generateSocialImages: {
colorScheme: "darkMode",
},
Expand Down Expand Up @@ -58,7 +58,7 @@ const config: QuartzConfig = {
transformers: [
Plugin.FrontMatter(),
Plugin.CreatedModifiedDate({
priority: ["frontmatter", "filesystem"],
priority: ["frontmatter","git","filesystem"],
}),
Plugin.SyntaxHighlighting({
theme: {
Expand Down

0 comments on commit bcb31a5

Please sign in to comment.