效果预览
安装 cloudflared
Linux,macOS,Windows,Docker
Cloudflare 官方文档
Cloudflare
OpenWrt
OpenwrtCloudflare
Coralesoft
获取 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; }
button[role="combobox"] { display: none !important; }
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="margin-top: 9px; font-weight: bold;">
<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="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>
<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>
<script> let interval = setInterval(() => { if (document.querySelector(".footer")) { document.querySelector("#customize").style.display = ""; clearInterval(interval); } }, 200); </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>
|