效果预览

安装 cloudflared

Linux,macOS,Windows,Docker

OpenWrt

获取 Token

登录 Cloudflare 控制台 → 左侧菜单点击 联网 → 点击Tunnels

下图中,绿色方框框选部分就是 Token(点击右侧按钮复制完整的命令行,粘贴后能看见完整的信息)

设置开机自启

安装完成后,如果需要开机自启 cloudflared 服务,运行

1
/etc/init.d/cloudflared enable

添加路由

选择已发布的应用程序

填入信息后,点击添加路由就能通过域名在公网访问本地服务了 ! ! !

为AList添加存储,修改样式等

可以参考以下链接:

我修改的样式

README.md的内容

1
2
3
4
5
6
7
8
9
## 👋 欢迎来到本站

这里是一个简单的文件存储与分享空间。

用于整理和存放一些日常使用的资源。

<div align="center" style="margin: 20px 0;">
<img src="https://imgbed.o0w0b.top/file/1738413277612_genshin0.jpg" style="max-width: 100%; border-radius: 12px;">
</div>

我在设置->全局->自定义头部中添加的内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!-- 字体 -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lxgw-wenkai-webfont@latest/lxgwwenkai-regular.css">

<style>
/* ========== 全局字体 ========== */
* {
font-family: "LXGW WenKai", sans-serif !important;
}

/* ========== 白天背景 ========== */
.hope-ui-light {
background: url("https://imgbed.o0w0b.top/file/1738413260342_genshin2.png") no-repeat center center fixed !important;
background-size: cover !important;
}

/* ========== 夜间背景 ========== */
.hope-ui-dark {
background: url("https://imgbed.o0w0b.top/file/1766659823394_genshin1.jpg") no-repeat center center fixed !important;
background-size: cover !important;
}

/* ========== 去掉底部 ========== */
footer, .footer {
display: none !important;
}

/* 隐藏 README.md 右上角的下拉菜单 */
button[role="combobox"] {
display: none !important;
}

/* 防止背景盖住canvas */
body {
background: transparent !important;
}

/* ========= 光点层 ========= */
#universe {
position: fixed !important;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 0 !important;
pointer-events: none;
}

/* 页面内容在上面 */
body > *:not(#universe) {
position: relative;
z-index: 1;
}
</style>

<script>
(function () {
function init() {
if (document.getElementById("universe")) return;

const canvas = document.createElement("canvas");
canvas.id = "universe";
document.documentElement.appendChild(canvas);

const ctx = canvas.getContext("2d");

function resize() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
}
resize();
window.addEventListener("resize", resize);

let stars = Array.from({ length: 150 }, () => ({
x: Math.random() * canvas.width,
y: Math.random() * canvas.height,
r: Math.random() * 2,
dx: Math.random() * 0.2,
dy: Math.random() * 0.2
}));

function draw() {
ctx.clearRect(0, 0, canvas.width, canvas.height);

stars.forEach(s => {
s.x += s.dx;
s.y += s.dy;

if (s.x > canvas.width) s.x = 0;
if (s.y > canvas.height) s.y = 0;

ctx.fillStyle = "rgba(255,255,255,0.8)";
ctx.fillRect(s.x, s.y, s.r, s.r);
});

requestAnimationFrame(draw);
}

draw();
}

setTimeout(init, 500);
document.addEventListener("pjax:end", () => setTimeout(init, 300));
})();
</script>

我在设置->全局->自定义内容中添加的内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<!-- ================= 延迟加载 ================= -->
<!-- 如果要写自定义内容建议都加到这个延迟加载的范围内 -->
<div id="customize" style="display: none;">
<div>
<br />

<center class="dibu">

<!-- ================= 一言 ================= -->
<!--
<div style="line-height: 20px;font-weight: bold;">
<span>
"
<span style="color: rgb(13, 109, 252); font-weight: bold;" id="hitokoto">
<a href="#" id="hitokoto_text">
"您好。"
</a>
</span> "
</span>
<p style="margin-left: 10rem;">
<small>
—— Hitokoto
</small>
</p>
</div> -->


<!-- ================= 底部导航 ================= -->
<div style="margin-top: 9px; font-weight: bold;">

<!-- QQ -->
<!--
<span class="nav-item">
<a class="nav-link" href="xxxxxxxxxx" target="_blank">
<i class="fab fa-qq" style="color:#409EFF" aria-hidden="true"></i>
QQ |
</a>
</span> -->


<!-- 邮箱 -->
<span class="nav-item">
<a class="nav-link" href="mailto:2362760448@qq.com" target="_blank">
<i class="fa-duotone fa-envelope-open" style="color:#409EFF" aria-hidden="true"></i>
邮箱 |
</a>
</span>

<!-- 博客 -->
<span class="nav-item">
<a class="nav-link" href="https://blog.o0w0b.top" target="_blank">
<i class="fas fa-edit" style="color:#409EFF" aria-hidden="true"></i>
博客 |
</a>
</span>

<!-- 留言 -->
<!--
<span class="nav-item">
<a class="nav-link" href="xxxxxxxx" target="_blank">
<i class="fas fa-comment-lines" style="color:#409EFF" aria-hidden="true"></i>
留言 |
</a>
</span>
-->

<!-- 云盘 -->
<!--
<span class="nav-item">
<a class="nav-link" href="xxxxxxx" target="_blank">
<i class="fa fa-cloud-download" style="color:#409EFF" aria-hidden="true"></i>
云盘 |
</a>
</span>
-->

<!-- 原项目 -->
<span class="nav-item">
<a class="nav-link" href="https://github.com/Xhofe/alist" target="_blank">
<i class="fa-solid fa-copyright" style="color:#409EFF" aria-hidden="true"></i>
Alist |
</a>
</span>

<!-- 后台入口 -->
<span class="nav-item">
<a class="nav-link" href="/@manage" target="_blank">
<i class="fa-solid fa-folder-gear" style="color:#409EFF" aria-hidden="true"></i>
管理
</a>
</span>
</div>

<!-- ================= 备案信息 ================= -->
<!--
<div style="font-size: 13px; font-weight: bold;">
<span class="nav-item">
<a class="nav-link" href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">
<i class="fa-solid fa-shield-check" style="color:#409EFF" aria-hidden="true"></i>
xICP备xxxxxxxxxx号
</a>
</span>
</div> -->


<!-- ================= 版权信息 ================= -->
<p id="copyright" class="para" style="margin-top: 9px;"></p>
<script>
document.addEventListener("DOMContentLoaded", function () {
const start = 2025;
const now = new Date().getFullYear();
document.getElementById("copyright").innerHTML =
start === now
? ${now} By 开心就好`
: ${start} - ${now} By 开心就好`;
});
</script>

<!-- ================= 运行时间 ================= -->
<div style="margin-top: 9px; font-weight: bold;">
<span id="runningTime"></span>
</div>

<script>
function updateTime() {
var start = new Date("2025/01/30 14:10:11");
var now = new Date();

var years = now.getFullYear() - start.getFullYear();
var anniversary = new Date(start);
anniversary.setFullYear(start.getFullYear() + years);
if (now < anniversary) {
years--;
anniversary.setFullYear(start.getFullYear() + years);
}

var diff = now - anniversary;
var dayMs = 24 * 60 * 60 * 1000;
var hourMs = 60 * 60 * 1000;
var minMs = 60 * 1000;

var days = Math.floor(diff / dayMs);
diff %= dayMs;
var hours = Math.floor(diff / hourMs);
diff %= hourMs;
var mins = Math.floor(diff / minMs);
diff %= minMs;
var secs = Math.floor(diff / 1000);

document.getElementById("runningTime").innerHTML =
`<span class="runningTxt">${years}${days}${hours} 小时 ${mins}${secs} 秒</span>`;
}

updateTime();
setInterval(updateTime, 1000);
</script>

</center>

<br />
<br />
</div>
</div>

<!-- ================= 延迟加载配套使用 JS ================= -->
<script>
let interval = setInterval(() => {
if (document.querySelector(".footer")) {
document.querySelector("#customize").style.display = "";
clearInterval(interval);
}
}, 200);
</script>

<!-- ================= 一言 API ================= -->
<!-- <script src="https://v1.hitokoto.cn/?encode=js&select=%23hitokoto" defer></script> -->

<!-- ================= 渐变背景初始化 ================= -->
<!-- 下面的几行都是渐变的一套,自定义头部内还有一个关联的自定义CSS -->
<!--
<canvas id="canvas-basic"></canvas>
<script src="https://cdn.jsdelivr.net/npm/granim@latest/dist/granim.min.js"></script>
<script>
var granimInstance = new Granim({
element: '#canvas-basic',
direction: 'left-right',
isPausedWhenNotInView: true,
states: {
"default-state": {
gradients: [
['#a18cd1', '#fbc2eb'],
['#fff1eb', '#ace0f9'],
['#d4fc79', '#96e6a1'],
['#a1c4fd', '#c2e9fb'],
['#a8edea', '#fed6e3'],
['#9890e3', '#b1f4cf'],
['#a1c4fd', '#c2e9fb'],
['#fff1eb', '#ace0f9']
]
}
}
});
</script> -->


<!-- ================= 网页鼠标点击特效 - 核心价值观关键字 ================= -->
<!--
<script>
(function () {
var a_idx = 0;
window.onclick = function (event) {
var a = new Array("❤富强❤", "❤民主❤", "❤文明❤", "❤和谐❤", "❤自由❤", "❤平等❤", "❤公正❤", "❤法治❤", "❤爱国❤", "❤敬业❤", "❤诚信❤", "❤友善❤");
var heart = document.createElement("b");
heart.onselectstart = new Function('event.returnValue=false');
document.body.appendChild(heart).innerHTML = a[a_idx];
a_idx = (a_idx + 1) % a.length;
heart.style.cssText = "position: fixed;left:-100%;";

var f = 13,
x = event.clientX - f / 2 - 30,
y = event.clientY - f,
c = randomColor(),
a = 1,
s = 0.8;

var timer = setInterval(function () {
if (a <= 0) {
document.body.removeChild(heart);
clearInterval(timer);
} else {
heart.style.cssText =
"font-size:16px;cursor: default;position: fixed;color:" + c +
";left:" + x + "px;top:" + y + "px;opacity:" + a +
";transform:scale(" + s + ");";
y--;
a -= 0.016;
s += 0.002;
}
}, 15);
}

function randomColor() {
return "rgb(" + (~~(Math.random() * 255)) + "," +
(~~(Math.random() * 255)) + "," +
(~~(Math.random() * 255)) + ")";
}
}());
</script> -->


<!-- ================= 网页鼠标点击特效 - 爱心 ================= -->
<script type="text/javascript">
! function (e, t, a) {
function r() {
for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t.body.removeChild(s[e].el), s.splice(e, 1)) : (s[
e].y--, s[e].scale += .004, s[e].alpha -= .013, s[e].el.style.cssText = "left:" + s[e].x +
"px;top:" + s[e].y + "px;opacity:" + s[e].alpha + ";transform:scale(" + s[e].scale + "," + s[e]
.scale + ") rotate(45deg);background:" + s[e].color + ";z-index:99999");
requestAnimationFrame(r)
}
function n() {
var t = "function" == typeof e.onclick && e.onclick;
e.onclick = function (e) {
t && t(), o(e)
}
}

function o(e) {
var a = t.createElement("div");
a.className = "heart", s.push({
el: a,
x: e.clientX - 5,
y: e.clientY - 5,
scale: 1,
alpha: 1,
color: c()
}), t.body.appendChild(a)
}

function i(e) {
var a = t.createElement("style");
a.type = "text/css";
try {
a.appendChild(t.createTextNode(e))
} catch (t) {
a.styleSheet.cssText = e
}
t.getElementsByTagName("head")[0].appendChild(a)
}

function c() {
return "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math
.random()) + ")"
}
var s = [];
e.requestAnimationFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e
.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || function (e) {
setTimeout(e, 1e3 / 60)
}, i(
".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"
), n(), r()
}(window, document);
</script>