101 Commits

Author SHA1 Message Date
mayx b666bd16b2 Update file 2025-01-01-temp.md 2025-01-01 10:06:30 +00:00
mayx bc094788c2 Update 2 files
- /_posts/2025-01-01-summary.md
- /_posts/2025-01-01-temp.md
2025-01-01 10:05:08 +00:00
mayx c0b1009935 Update file 2024-12-29-vm.md 2024-12-29 15:00:35 +00:00
mayx 129c4d1b5b Update 2024-12-08-simulator.md 2024-12-08 15:07:29 +00:00
mayx a8b9118a20 Update 2 files
- /links.md
- /_posts/2024-12-08-simulator.md
2024-12-08 11:50:52 +00:00
mayx dff8a2d2c9 Update 2 files
- /_layouts/post.html
- /service.md
2024-11-20 06:32:07 +00:00
mayx 2952d9f63e Update 3 files
- /Live2dHistoire/live2d/js/message.js
- /proxylist.md
- /README.md
2024-11-19 08:50:58 +00:00
mayx 3de3d63d77 Update 2 files
- /links.md
- /_posts/2024-11-02-trojan.md
2024-11-02 12:32:13 +00:00
mayx 3dab9f333a Update file default.html 2024-10-21 11:21:43 +00:00
mayx 85aa965218 Update 3 files
- /Live2dHistoire/live2d/js/message.js
- /Live2dHistoire/live2d/css/live2d.css
- /_layouts/default.html
2024-10-21 11:16:17 +00:00
mayx 0e065bf282 Update file message.js 2024-10-21 10:12:21 +00:00
mayx 680afdca5a Update 2 files
- /index.html
- /service.md
2024-10-15 10:10:20 +00:00
mayx 9e7e727897 Update file message.js 2024-10-15 08:38:03 +00:00
mayx f5accbcad4 Update 2 files
- /_posts/2024-10-13-arm-linux.md
- /proxylist.md
2024-10-14 02:27:17 +00:00
mayx d3ef0a278b Update file 2024-10-13-arm-linux.md 2024-10-13 12:13:18 +00:00
mayx 38c549606e Update 4 files
- /_layouts/default.html
- /_layouts/post.html
- /_posts/2024-10-01-suggest.md
- /js/main.js
2024-10-04 07:13:10 +00:00
mayx 443d65ac50 Update 4 files
- /_layouts/default.html
- /_layouts/post.html
- /js/main.js
- /_posts/2024-10-01-suggest.md
2024-10-04 06:19:24 +00:00
mayx c8ce8de1d9 Update 3 files
- /js/main.js
- /_posts/2024-10-01-suggest.md
- /_posts/2024-09-27-rag.md
2024-10-01 10:12:03 +00:00
mayx 03d9517241 Update 2 files
- /js/main.js
- /_layouts/post.html
2024-09-30 14:59:32 +00:00
mayx 9b9efd0f60 Update 3 files
- /js/main.js
- /_layouts/default.html
- /_layouts/post.html
2024-09-30 13:59:21 +00:00
mayx 07a3d18350 Update 3 files
- /js/main.js
- /_layouts/post.html
- /search.json
2024-09-30 13:51:26 +00:00
mayx 550321e80a Update 2 files
- /_layouts/default.html
- /search.html
2024-09-29 15:20:22 +00:00
mayx 50c6c49c4c Update 2 files
- /_posts/2024-09-27-rag.md
- /_posts/2024-07-03-ai-summary.md
2024-09-27 03:24:54 +00:00
mayx 593b4fa003 Update main.js 2024-09-26 10:15:00 +00:00
mayx 46f1b8d742 Update file 2024-09-02-gmssl.md 2024-09-02 09:40:45 +00:00
mayx 7a525073f9 Update file 2024-08-17-mac-mini.md 2024-08-17 11:40:35 +00:00
mayx dc37b70586 Update file 2024-08-03-cangjie.md 2024-08-03 17:33:00 +00:00
mayx 2fd191d418 Update file 2024-07-03-ai-summary.md 2024-07-03 13:41:02 +00:00
mayx 99ec7de3cd Update file 2024-07-03-ai-summary.md 2024-07-03 13:32:37 +00:00
mayx cd294479e0 Update file 2024-07-03-ai-summary.md 2024-07-03 13:01:14 +00:00
mayx b7ab4e6356 Update file post.html 2024-07-02 08:46:57 +00:00
mayx 934c04aea7 Update file post.html 2024-07-02 08:25:21 +00:00
mayx 5c7773fb59 Update 2 files
- /_layouts/post.html
- /js/main.js
2024-07-02 08:09:28 +00:00
mayx 41ce7aabb0 Update 2 files
- /proxylist.md
- /js/main.js
2024-07-02 03:59:47 +00:00
mayx cbe4db5992 Update file 2024-06-16-hackintosh.md 2024-06-16 12:26:12 +00:00
mayx 04e63388b6 Update 2 files
- /_posts/2024-05-19-bt-ops.md
- /proxylist.md
2024-05-19 11:10:53 +00:00
mayx 106aa95def Update default.html 2024-04-15 07:29:05 +00:00
mayx f1e7070380 Update 2 files
- /js/main.js
- /_posts/2024-04-06-old-pc.md
2024-04-08 12:52:09 +00:00
mayx 10a3521795 Update file 2024-04-06-old-pc.md 2024-04-06 09:43:54 +00:00
mayx 881ed13576 Update 2 files
- /_posts/2024-04-06-old-pc.md
- /index.html
2024-04-06 09:41:50 +00:00
mayx 982a87e0bf Update file proxylist.md 2024-03-21 01:54:03 +00:00
mayx 5097364988 Update 3 files
- /images/offline.svg
- /images/online.svg
- /proxylist.md
2024-03-21 01:45:48 +00:00
mayx c437b255f1 Update file 2024-03-16-ssl-pinning.md 2024-03-16 13:17:54 +00:00
mayx efaaa32674 Update default.html 2024-02-24 16:02:33 +00:00
mayx 8a51f7a942 Update 3 files
- /images/17966333.png
- /_config.yml
- /_layouts/default.html
2024-02-24 15:58:24 +00:00
mayx afe8b95115 Update 4 files
- /proxylist.md
- /images/17966333.png
- /_config.yml
- /_posts/2024-02-24-luckfox.md
2024-02-24 15:53:16 +00:00
mayx 2aad4be863 Update 2 files
- /_posts/2024-02-03-1panel.md
- /_posts/2024-01-20-renpy.md
2024-02-03 14:04:27 +00:00
mayx 74cb7d028c Update 4 files
- /llama.html
- /_posts/2024-01-20-renpy.md
- /index.html
- /proxylist.md
2024-01-20 11:01:55 +00:00
mayx d74fe7b4b8 Update file index.html 2024-01-01 10:54:46 +00:00
mayx 8f7d02697d Update 5 files
- /card.html
- /llama.html
- /index.html
- /Live2dHistoire/live2d/js/message.js
- /js/main.js
2024-01-01 10:53:46 +00:00
mayx 4afea923c5 Update 3 files
- /package.json
- /_posts/2023-04-05-ai.md
- /_posts/2024-01-01-summary.md
2024-01-01 09:01:21 +00:00
mayx e6281bfa5f Update file Gemfile 2023-12-30 15:27:02 +00:00
mayx a4e9d17cf1 Update file Gemfile 2023-12-30 15:16:27 +00:00
mayx 975fcf9d8e Update 2 files
- /Gemfile
- /.gitlab-ci.yml
2023-12-30 15:12:33 +00:00
mayx 1734d36dd5 Update file Gemfile 2023-12-30 15:02:50 +00:00
mayx eefdb73475 Update 3 files
- /Gemfile
- /.gitlab-ci.yml
- /Live2dHistoire/live2d/js/message.js
2023-12-30 14:59:15 +00:00
mayx c622346eaa Update 2 files
- /Gemfile
- /Live2dHistoire/live2d/js/message.js
2023-12-30 13:58:00 +00:00
mayx 7609bb0b8f Update message.js 2023-12-30 13:41:55 +00:00
mayx 2298c9b271 更新.gitlab-ci.yml文件 2023-12-24 16:49:42 +00:00
mayx f9abd1e5d7 Update file 2023-12-24-android.md 2023-12-24 12:30:52 +00:00
mayx 62ea62e8e8 Update file 2023-12-10-openfyde.md 2023-12-09 17:42:34 +00:00
mayx 3dc82a814a Update 2 files
- /_posts/2023-02-03-mbp.md
- /_posts/2023-10-21-game.md
2023-10-21 15:24:08 +00:00
mayx 09c88ebf18 Update file 2023-09-24-rpi-ubuntu.md 2023-09-24 12:34:21 +00:00
Mayx 2aed9e9d90 Update links.md 2023-09-10 16:38:27 +08:00
Mayx bfe05eef58 Update links.md 2023-09-09 00:47:24 +08:00
mayx 5713b1b477 Update file 2023-09-06-satellite.md 2023-09-06 11:51:39 +00:00
mayx 52eb8cd0a7 Update file 2023-08-01-auth.md 2023-08-01 14:09:27 +00:00
Mayx c17b6f0971 Update 2023-06-30-nucleic-acid.md 2023-07-18 11:07:05 +08:00
mayx e7ad732f8d Update 2 files
- /BlogCard.svg
- /proxylist.md
2023-07-11 03:59:38 +00:00
mayx 8b6738dcef Update links.md 2023-07-09 04:07:23 +00:00
mayx c52e7ded82 Update file 2023-07-09-bitmo.md 2023-07-08 18:41:24 +00:00
mayx 2df79d6a44 Update file 2023-07-09-bitmo.md 2023-07-08 18:37:14 +00:00
mayx 59688d1e1f Update file 2023-06-30-nucleic-acid.md 2023-06-29 18:54:54 +00:00
mayx 86edb37efb Update file 2023-06-30-nucleic-acid.md 2023-06-29 18:54:54 +00:00
mayx d06229e705 Update file 2023-06-30-nucleic-acid.md 2023-06-29 18:53:24 +00:00
mayx 385b842c80 Update 2 files
- /_layouts/post.html
- /_posts/2023-06-30-nucleic-acid.md
2023-06-29 18:44:09 +00:00
mayx 1cd08a24bd Update file 2023-06-30-nucleic-acid.md 2023-06-29 18:35:27 +00:00
mayx c664d9e93a Update file 2023-05-22-rpi-win.md 2023-05-21 16:28:06 +00:00
mayx 8dcfcaeb7b Update 3 files
- /iwara.html
- /index.html
- /card.html
2023-04-22 12:06:10 +00:00
Mayx 57f8e30bf4 Update links.md 2023-04-11 09:08:32 +08:00
Mayx ae5d4d5a8e Create 2023-04-05-ai.md 2023-04-05 15:12:50 +08:00
mayx 7b2a1df6ef Update 2 files
- /index.html
- /_posts/2023-03-12-php-async.md
2023-03-12 14:53:07 +00:00
mayx b7ec2f390f Update index.html 2023-03-01 06:14:56 +00:00
mayx 4da70fb10f Update index.html 2023-03-01 06:06:58 +00:00
mayx 3248be8d53 Update file 2023-02-22-cron.md 2023-02-22 13:36:12 +00:00
mayx afc549167c Update file 2023-02-03-mbp.md 2023-02-02 18:30:30 +00:00
mayx 8772648878 Update file 2023-01-01-summary.md 2023-01-01 08:55:40 +00:00
mayx 2d68e34467 Update proxylist.md 2022-12-26 18:29:09 +00:00
mayx dd5ab4867c Update file 2022-12-26-i2p-ssl.md 2022-12-26 15:20:43 +00:00
mayx 033f7ce32b 更新 _posts/2022-12-12-bt-s3-comp.md 2022-12-12 13:23:54 +00:00
mayx 2d4609d0ab 更新 links.md, proxylist.md 2022-12-02 18:11:38 +00:00
mayx c61e461e5b 更新 _posts/2022-11-29-free-server.md 2022-11-29 15:59:11 +00:00
mayx 5d1c867bf5 Update proxylist.md 2022-11-26 18:30:22 +00:00
mayx b2968c3001 Update proxylist.md 2022-11-23 13:03:34 +00:00
mayx e5e81ca40b 更新 _posts/2022-11-23-i2p.md 2022-11-23 12:45:55 +00:00
mayx 4579da904a Update proxylist.md 2022-11-16 15:53:04 +00:00
Mayx 537c25eaa8 Update 2022-11-16-tor.md 2022-11-16 19:57:20 +08:00
mayx 9f81162cb9 更新 _posts/2022-11-16-tor.md 2022-11-16 11:32:50 +00:00
mayx f87ba583aa 更新 _posts/2022-11-08-cf-acc.md 2022-11-08 05:21:31 +00:00
mayx 28a80e08d5 Update 2022-10-19-web3.md 2022-10-19 16:06:13 +00:00
mayx 93d07f16d4 更新 _posts/2022-10-19-web3.md 2022-10-19 15:14:20 +00:00
60 changed files with 4961 additions and 354 deletions
+2 -2
View File
@@ -6,14 +6,14 @@
# Template project: https://gitlab.com/pages/jekyll
# Docs: https://docs.gitlab.com/ee/pages/
image: ruby:2.6
image: ruby:2.7
variables:
JEKYLL_ENV: production
LC_ALL: C.UTF-8
before_script:
- gem install bundler
- gem install bundler -v 2.4.22
- bundle install
pages:
+5 -5
View File
@@ -105,31 +105,31 @@
<g class="stagger" style="animation-delay: 450ms" transform="translate(25, 0)">
<line x1="12" y1="6.25" x2="19" y2="6.25"
style="stroke:rgb(255,255,255);stroke-width:2"/>
<text class="stat bold" x="25" y="12.5">{{ site.posts[0].title }}</text>
<text class="stat bold" x="25" y="12.5">{{ site.posts[0].title | truncate: 18 }}</text>
</g>
</g><g transform="translate(0, 25)">
<g class="stagger" style="animation-delay: 600ms" transform="translate(25, 0)">
<line x1="12" y1="6.25" x2="19" y2="6.25"
style="stroke:rgb(255,255,255);stroke-width:2"/>
<text class="stat bold" x="25" y="12.5">{{ site.posts[1].title }}</text>
<text class="stat bold" x="25" y="12.5">{{ site.posts[1].title | truncate: 18 }}</text>
</g>
</g><g transform="translate(0, 50)">
<g class="stagger" style="animation-delay: 750ms" transform="translate(25, 0)">
<line x1="12" y1="6.25" x2="19" y2="6.25"
style="stroke:rgb(255,255,255);stroke-width:2"/>
<text class="stat bold" x="25" y="12.5">{{ site.posts[2].title }}</text>
<text class="stat bold" x="25" y="12.5">{{ site.posts[2].title | truncate: 18 }}</text>
</g>
</g><g transform="translate(0, 75)">
<g class="stagger" style="animation-delay: 900ms" transform="translate(25, 0)">
<line x1="12" y1="6.25" x2="19" y2="6.25"
style="stroke:rgb(255,255,255);stroke-width:2"/>
<text class="stat bold" x="25" y="12.5">{{ site.posts[3].title }}</text>
<text class="stat bold" x="25" y="12.5">{{ site.posts[3].title | truncate: 18 }}</text>
</g>
</g><g transform="translate(0, 100)">
<g class="stagger" style="animation-delay: 1050ms" transform="translate(25, 0)">
<line x1="12" y1="6.25" x2="19" y2="6.25"
style="stroke:rgb(255,255,255);stroke-width:2"/>
<text class="stat bold" x="25" y="12.5">{{ site.posts[4].title }}</text>
<text class="stat bold" x="25" y="12.5">{{ site.posts[4].title | truncate: 18 }}</text>
</g>
</g>
</svg>
+9 -7
View File
@@ -1,11 +1,13 @@
source "https://rubygems.org"
gem "jekyll", "~> 4.1.0"
gem "jekyll", "~> 3.9.3"
group :jekyll_plugins do
gem "jekyll-gist"
gem "jekyll-coffeescript"
gem "jekyll-assets"
gem "jekyll-sitemap"
gem "jekyll-feed"
gem "jekyll-gist", "~> 1.5.0"
gem "jekyll-coffeescript", "~> 1.1.1"
gem "jekyll-assets", "~> 1.0.0"
gem "jekyll-sitemap", "~> 1.4.0"
gem "jekyll-feed", "~> 0.15.1"
gem "jekyll-theme-minimal"
gem "jekyll-paginate"
gem "jekyll-paginate", "~> 1.1.0"
gem "kramdown-parser-gfm", "~> 1.1.0"
gem "kramdown", "~> 2.3.2"
end
+1 -1
View File
@@ -79,7 +79,7 @@
background-color: rgba(74, 59, 114,0.9);
}
.live_talk_input_name_body{
width:70px;
width:100px;
box-sizing:border-box;
height:24px;
border: 2px solid rgb(223, 179, 241);
+33 -32
View File
@@ -158,7 +158,7 @@ if(!norunFlag){
function showHitokoto(){
if(sessionStorage.getItem("Sleepy")!=="1"){
if(!AITalkFlag){
$.getJSON('https://v1.hitokoto.cn/',function(result){
$.getJSON('https://hitokoto.mayx.eu.org/',function(result){
talkValTimer();
showMessage(result.hitokoto, 0);
});
@@ -188,7 +188,26 @@ if(!norunFlag){
if(Array.isArray(text)) text = text[Math.floor(Math.random() * text.length + 1)-1];
//console.log('showMessage', text);
$('.message').stop();
$('.message').html(text);
if(text instanceof EventSource){
var outputContainer = $('.message')[0];
var eventFlag = false;
text.onmessage = (event) => {
if (event.data == "[DONE]") {
text.close();
return;
} else {
if(!eventFlag){
talkValTimer();
outputContainer.textContent = "";
eventFlag = true;
}
const data = JSON.parse(event.data);
outputContainer.textContent += data.response;
}
}
}else{
$('.message').html(text);
}
$('.message').fadeTo(200, 1);
//if (timeout === null) timeout = 5000;
//hideMessage(timeout);
@@ -275,36 +294,18 @@ if(!norunFlag){
});
$('#talk_send').on('click',function(){
var info_ = $('#AIuserText').val();
var userid_ = $('#AIuserName').val();
// var userid_ = $('#AIuserName').val();
let add_id = "";
if($('#load_this').prop("checked")){
add_id = "&id="+encodeURIComponent($('#post_id').val());
}
if(info_ == "" ){
showMessage('写点什么吧!',0);
return;
}
if(userid_ == ""){
showMessage('聊之前请告诉我你的名字吧!',0);
return;
}
showMessage('思考中~', 0);
$.ajax({
type: 'POST',
url: talkAPI,
data: {
"info":info_,
"userid":userid_
},
success: function(res) {
if(res.code !== 100000){
talkValTimer();
showMessage('似乎有什么错误,请和站长联系!',0);
}else{
talkValTimer();
showMessage(res.text,0);
}
console.log(res);
$('#AIuserText').val("");
sessionStorage.setItem("live2duser", userid_);
}
});
const evSource = new EventSource(talkAPI + "?info=" + encodeURIComponent(info_) + add_id);
showMessage(evSource);
});
}else{
$('#showInfoBtn').hide();
@@ -379,11 +380,11 @@ if(!norunFlag){
showMessage('音乐似乎加载不出来了呢!',0);
});
}
//获取用户名
var live2dUser = sessionStorage.getItem("live2duser");
if(live2dUser !== null){
$('#AIuserName').val(live2dUser);
}
// //获取用户名
// var live2dUser = sessionStorage.getItem("live2duser");
// if(live2dUser !== null){
// $('#AIuserName').val(live2dUser);
// }
//获取位置
var landL = sessionStorage.getItem("historywidth");
var landB = sessionStorage.getItem("historyheight");
+6 -3
View File
@@ -16,13 +16,16 @@ Powered by [Jekyll](https://github.com/jekyll/jekyll)
[Simple-Jekyll-Search](https://github.com/christian-fei/Simple-Jekyll-Search)
## 使用的网络资源
[Github](https://github.com/) | 包含:
[Github](https://github.com/) | 包含
- Issue
- Pages
- Git
[Cloudflare](https://www.cloudflare.com/) | 包含:
- CDN、规则以及缓存
- Workers、D1 SQL 数据库、Vectorize 数据库、AI
[网易云音乐](https://music.163.com/)
[一言](https://hitokoto.cn/)
[CDNJS](https://cdnjs.com/)
[unpkg](https://unpkg.com/)
+121 -117
View File
@@ -1,153 +1,157 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% seo %}
{% feed_meta %}
<link rel="stylesheet" href="{{ "/assets/css/style.css?v=" | append: site.github.build_revision | relative_url }}">
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<script src="/js/jquery.min.js"></script>
<!-- <![endif]-->
<!--[if lt IE 9]>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% seo %}
{% feed_meta %}
<link rel="stylesheet" href="{{ "/assets/css/style.css?v=" | append: site.github.build_revision | relative_url }}">
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<script src="/js/jquery.min.js"></script>
<!-- <![endif]-->
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<![endif]-->
{% if site.google_analytics %}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
{% if site.google_analytics %}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ site.google_analytics }}');
var lastUpdated = new Date("{{ site.time | date: "%FT%T%z" }}");
Date.prototype.format = function(fmt) {
var o = {
"M+" : this.getMonth()+1, //月份
"d+" : this.getDate(), //日
"h+" : this.getHours(), //小时
"m+" : this.getMinutes(), //分
"s+" : this.getSeconds(), //秒
"q+" : Math.floor((this.getMonth()+3)/3), //季度
"S" : this.getMilliseconds() //毫秒
};
if(/(y+)/.test(fmt)) {
fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
var BlogAPI = "https://summary.mayx.eu.org";
function getSearchJSON(callback) {
var searchData = JSON.parse(localStorage.getItem("blog_" + lastUpdated.valueOf()));
if (!searchData) {
localStorage.clear();
$.getJSON("/search.json", function (data) {
localStorage.setItem("blog_" + lastUpdated.valueOf(), JSON.stringify(data));
callback(data);
});
} else {
callback(searchData);
}
for(var k in o) {
if(new RegExp("("+ k +")").test(fmt)){
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
}
}
return fmt;
}
</script>
{% endif %}
<style>
.backToTop {
display: none;
width: 18px;
line-height: 1.2;
padding: 5px 0;
background-color: #000;
color: #fff;
font-size: 12px;
text-align: center;
position: fixed;
_position: absolute;
right: 10px;
bottom: 100px;
_bottom: "auto";
cursor: pointer;
opacity: .6;
filter: Alpha(opacity=60);
}
</style>
</head>
<body>
<div class="wrapper">
<header>
<h1><a href="{{ "/" | relative_url }}">{{ site.title | default: site.github.repository_name }}</a></h1>
{% if site.logo %}
<img src="{{ site.logo | relative_url}}" alt="Logo" />
</script>
{% endif %}
<style>
.backToTop {
display: none;
width: 18px;
line-height: 1.2;
padding: 5px 0;
background-color: #000;
color: #fff;
font-size: 12px;
text-align: center;
position: fixed;
_position: absolute;
right: 10px;
bottom: 100px;
_bottom: "auto";
cursor: pointer;
opacity: .6;
filter: Alpha(opacity=60);
}
</style>
</head>
<body>
<div class="wrapper">
<header>
<h1><a href="{{ "/" | relative_url }}">{{ site.title | default: site.github.repository_name }}</a></h1>
{% if site.logo %}
<img src="{{ site.logo }}" alt="Logo" />
{% endif %}
<p>{{ site.description | default: site.github.project_tagline }}</p>
<p><form action="/search.html"><input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.."> <input type="submit"></form></p>
<p>{{ site.description | default: site.github.project_tagline }}</p>
{% if site.github.is_project_page %}
<p class="view"><a href="{{ site.github.repository_url }}">View the Project on GitHub <small>{{ site.github.repository_nwo }}</small></a></p>
{% endif %}
<p>
<form action="/search.html"><input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts..">
<input type="submit">
</form>
</p>
{% if site.github.is_user_page %}
<p class="view"><a href="{{ site.github.owner_url }}">View My GitHub Profile</a></p>
{% endif %}
<p class="view"><a href="{{ "/Mabbs/" | relative_url }}">About Me</a></p>
{% if site.github.is_project_page %}
<p class="view"><a href="{{ site.github.repository_url }}">View the Project on GitHub
<small>{{ site.github.repository_nwo }}</small></a></p>
{% endif %}
<ul class="downloads">
{% if site.github.is_user_page %}
<p class="view"><a href="{{ site.github.owner_url }}">View My GitHub Profile</a></p>
{% endif %}
<p class="view"><a href="/Mabbs/">About Me</a></p>
<ul class="downloads">
{% if site.github %}
<li><a href="{{ site.github.zip_url }}">Download <strong>ZIP File</strong></a></li>
<li><a href="{{ site.github.tar_url }}">Download <strong>TAR Ball</strong></a></li>
<li><a href="{{ site.github.repository_url }}">View On <strong>GitHub</strong></a></li>
<li><a href="{{ site.github.zip_url }}">Download <strong>ZIP File</strong></a></li>
<li><a href="{{ site.github.tar_url }}">Download <strong>TAR Ball</strong></a></li>
<li><a href="{{ site.github.repository_url }}">View On <strong>GitHub</strong></a></li>
{% else %}
<li style="width: 270px;border-right:0px;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
<li style="width: 270px;border-right:0px;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
{% endif %}
</ul>
</header>
<section>
</ul>
</header>
<section>
{{ content }}
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<div class="live_talk_input_name_body" style="display:none;">
<input name="name" type="hidden" class="live_talk_name white_input" id="AIuserName" value="Mayx_Blog_Talk" />
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<div class="live_talk_input_name_body" {% unless page.layout == "post" %}style="display:none;"{% endunless %}>
<input type="checkbox" id="load_this">
<input type="hidden" id="post_id" value="{{ page.url }}">
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&nbsp;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?"/>
<button type="button" class="live_talk_send_btn" id="talk_send">发送</button>
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?"/>
<button type="button" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden">
</div>
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p><small>Made with ❤ by Mayx<br />Last updated at <script>document.write(lastUpdated.format("yyyy-MM-dd hh:mm:ss"));</script><br /> 总字数:
{% assign count = 0 %}{% for post in site.posts %}{% assign single_count = post.content | strip_html | strip_newlines | remove: " " | size %}
{% assign count = count | plus: single_count %}{% endfor %}{% if count > 10000 %}{{ count | divided_by: 10000 }} 万 {{ count | modulo: 10000 }}
{% else %}{{ count }}{% endif %} - 文章数:{% for post in site.posts %}{% assign co = co | plus: 1 %}{% endfor %}{{ co }} - <a href="{{ "/atom.xml" | relative_url }}" >Atom</a> - <a href="{{ "/README.html" | relative_url }}" >About</a></small></p>
</footer>
</div>
<script src="{{ "/assets/js/scale.fix.js" | relative_url }}"></script>
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at <script>document.write(lastUpdated.toLocaleString());</script><br /> 总字数:{% assign count = 0 %}{% for post in site.posts %}{% assign single_count = post.content | strip_html | strip_newlines | remove: " " | size %}{% assign count = count | plus: single_count %}{% endfor %}{% if count > 10000 %}{{ count | divided_by: 10000 }} 万 {{ count | modulo: 10000 }}{% else %}{{ count }}{% endif %} - 文章数:{% for post in site.posts %}{% assign co = co | plus: 1 %}{% endfor %}{{ co }} - <a href="{{ "/atom.xml" | relative_url }}" >Atom</a> - <a href="{{ "/README.html" | relative_url }}" >About</a></small>
</p>
</footer>
</div>
<script src="{{ "/assets/js/scale.fix.js" | relative_url }}"></script>
<script src="/js/main.js"></script>
<!--[if !IE]> -->
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<script src="/js/main.js"></script>
<!--[if !IE]> -->
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>
<!-- <![endif]-->
</body>
</html>
+131 -59
View File
@@ -2,89 +2,161 @@
layout: default
---
<small>{{ page.date | date: "%-d %B %Y" }} - 字数统计:{% if page.layout == "encrypt" %}God Knows {% else %}{{ page.content | strip_html | strip_newlines | remove: " " | size }} - 阅读大约需要{{ page.content | strip_html | strip_newlines | remove: " " | size | divided_by: 350 | plus: 1 }}分钟{% endif %} - Hits: <span id="{{ page.url }}" class="visitors" >Loading...</span>
</small>
<small>{{ page.date | date: "%-d %B %Y" }} - 字数统计:{% if page.layout == "encrypt" %}God Knows {% else %}{{ page.content | strip_html | strip_newlines | remove: " " | size }} - 阅读大约需要{{ page.content | strip_html | strip_newlines | remove: "" | size | divided_by: 350 | plus: 1 }}分钟{% endif %} - Hits: <span id="{{ page.url }}" class="visitors">Loading...</span></small>
<h1>{{ page.title }}</h1>
<p class="view">by <a href="//github.com/{{ page.author | default: "Mabbs" }}">{{ page.author | default: site.author }}</a></p>
<div id="outdate" style="display:none;">
<hr />
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
<br /><br />
<hr />
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
<br /><br />
</div>
<script>
BirthDay = new Date("{{ page.date | date: "%m/%d/%Y" }} 00:00:00");
today = new Date();
timeold = (today.getTime() - BirthDay.getTime());
secondsold = Math.floor(timeold / 1000);
e_daysold = timeold / (24 * 60 * 60 * 1000);
daysold = Math.floor(e_daysold);
if (daysold > 90) {
BirthDay = new Date("{{ page.date | date: "%m/%d/%Y" }} 00:00:00");
today = new Date();
timeold = (today.getTime() - BirthDay.getTime());
secondsold = Math.floor(timeold / 1000);
e_daysold = timeold / (24 * 60 * 60 * 1000);
daysold = Math.floor(e_daysold);
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
}
</script>
<hr />
{% if page.layout != "encrypt" %}
<!--[if !IE]> -->
<b>AI摘要</b>
<p id="ai-output">正在生成中……</p>
<script>
async function sha(str) {
const encoder = new TextEncoder();
const data = encoder.encode(str);
const hashBuffer = await crypto.subtle.digest("SHA-256", data);
const hashArray = Array.from(new Uint8Array(hashBuffer)); // convert buffer to byte array
const hashHex = hashArray
.map((b) => b.toString(16).padStart(2, "0"))
.join(""); // convert bytes to hex string
return hashHex;
}
async function ai_gen(){
var postContent = "文章标题:" + {{ page.title | jsonify }} + ";文章内容:" + {{ page.content | strip_html | strip_newlines | jsonify }};
var postContentSign = await sha(postContent);
var outputContainer = document.getElementById("ai-output");
$.get(BlogAPI + "/is_uploaded?id={{ page.url }}&sign=" + postContentSign, function (data) {
if (data == "yes") {
$.get(BlogAPI + "/get_summary?id={{ page.url }}&sign=" + postContentSign, function (data2) {
outputContainer.textContent = data2;
});
} else {
$.post(BlogAPI + "/upload_blog?id={{ page.url }}", postContent, function (data) {
$.get(BlogAPI + "/get_summary?id={{ page.url }}&sign=" + postContentSign);
const evSource = new EventSource(BlogAPI + "/summary?id={{ page.url }}");
outputContainer.textContent = "";
evSource.onmessage = (event) => {
if (event.data == "[DONE]") {
evSource.close();
return;
} else {
const data = JSON.parse(event.data);
outputContainer.textContent += data.response;
}
}
});
}
});
}
ai_gen();
</script>
<hr />
<!-- <![endif]-->
{% endif %}
{% include toc.html html=content sanitize=true %}
{% include toc.html html=content sanitize=true h_max=3 %}
{{content}}
{% if page.tags %}
<small>tags: <em>{{ page.tags | join: "</em> - <em>" }}</em></small>
<small>tags: <em>{{ page.tags | join: "</em> - <em>" }}</em></small>
{% endif %}
<br />
<br />
<p id="suggest-container"></p>
<script>
var blogurl = "{{ page.url }}";
var suggest = $("#suggest-container")[0];
suggest.innerHTML = "Loading...";
$.get(BlogAPI + "/suggest?id=" + blogurl + "&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.innerHTML = '<b>推荐文章</b><hr style="margin: 0 0 5px"/>';
const searchMap = new Map(search.map(item => [item.url, item]));
const merged = data.map(suggestObj => {
const searchObj = searchMap.get(suggestObj.id);
return searchObj ? { ...searchObj } : null;
});
merged.forEach(element => {
if (element) {
suggest.innerHTML += "<a href=" + element.url + ">" + element.title + "</a> - " + element.date + "<br />";
}
});
});
} else {
suggest.innerHTML = "暂无推荐文章……";
}
});
</script>
<div class="pagination">
{% if page.previous.url %}
<span class="prev" >
<a href="{{ site.baseurl }}{{ page.previous.url }}">
上一篇:{{ page.previous.title }}
</a>
</span>
{% endif %}
{% if page.previous.url %}
<span class="prev">
<a href="{{ site.baseurl }}{{ page.previous.url }}">
上一篇:{{ page.previous.title }}
</a>
</span>
{% endif %}
<br />
{% if page.next.url %}
<span class="next" >
<a href="{{ site.baseurl }}{{ page.next.url }}">
下一篇:{{ page.next.title }}
</a>
</span>
{% endif %}
</div>
{% if page.next.url %}
<span class="next">
<a href="{{ site.baseurl }}{{ page.next.url }}">
下一篇:{{ page.next.title }}
</a>
</span>
{% endif %}
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/css/gitalk.css">
<script src="/js/gitalk.min.js"></script>
<link rel="stylesheet" href="/css/gitalk.css">
<script src="/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
if (window.location.host != "mabbs.github.io")
{
var gitalk = new Gitalk({
clientID: '098934a2556425f19d6e',
clientSecret: '0bd44eed8425e5437ce43c4ba9b2791fbc04581d',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '{{ page.id }}', // Ensure uniqueness and length less than 50
distractionFreeMode: false // Facebook-like distraction free mode
})
}
else
{
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '{{ page.id }}', // Ensure uniqueness and length less than 50
distractionFreeMode: false // Facebook-like distraction free mode
})
}
if (window.location.host != "mabbs.github.io") {
var gitalk = new Gitalk({
clientID: '098934a2556425f19d6e',
clientSecret: '0bd44eed8425e5437ce43c4ba9b2791fbc04581d',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '{{ page.id }}', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
}
else {
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '{{ page.id }}', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
}
gitalk.render('gitalk-container')
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
<!-- <![endif]-->
+27
View File
@@ -0,0 +1,27 @@
---
layout: post
title: 在Web3上搭建一个自己的博客
tags: [Web3, 博客, 搭建]
---
感觉Web3可以真正的为现在的人们使用了呢。<!--more-->
# 起因
最近偶然看到了一个很有意思的东西,叫[xLog](https://xlog.app/),大概试了试,这是在一条叫Crossbell的区块链上使用智能合约操作和存储元数据,并把实际数据存到IPFS上的项目。看了一眼还挺有意思,就在上面搭了一个自己的[另一个博客](https://mayx.xlog.app/),另外他们还使用这套方案写了一个类似Twitter的社交系统,也叫Crossbell,非常的人性化,可以说是把Web3真正的带给了普通用户。至于怎么搭他们的项目成员写了篇教程,[5分钟就能搭好在Web3的博客](https://song.xlog.app/5m-zh)。
不过使用xLog那就不是技术人员的事了,而是让一个不怎么懂电脑的人来做的事情了。另外他们宣称数据是“Permanently stored on the blockchain”这一点我不太认同,要是说存到了Web3成为了其他人无法修改的数据,这倒是没什么问题,但是存到IPFS上只要没有被Pin,就有可能在节点GC的过程中永远消失。另外我其实对区块链接触不多,不清楚能不能完整的同步他们的链,如果不能那就是私链了,那样元数据也不能永久保留了……所以我只能说这个平台是Web3,可以保证不因为审查而404,但是不能在时间的长河中保留信息。
# 技术人员的方法
所以作为技术人员,我的博客当然直接上IPFS那更好啦,因为他们的平台毕竟可定制性不高,而且好多组件不知道有没有可替代性,比如以太坊JSON-RPC,不过他们的服务好像是都开源了,只要这个链可以被同步,能搭属于自己的RPC那倒是问题不大。
直接用IPFS客户端直接上传是最原生的办法,但是我不喜欢在自己电脑上安一堆莫名其妙的软件,像我现在写博客都是直接在Github或者Gitlab上写好然后直接用[之前提到的静态页面服务商](/2022/02/14/move.html)一次性部署好。所以我也希望能有一个类似的服务商能帮我把我的博客上传到IPFS上。最后我找到的服务商就是[4EVERLAND](https://www.4everland.org/)。它可以绑定Git仓库并监听变化,当有变化的时候就会自动部署到IPFS上,并且他们提供免费的Gateway来直接访问在IPFS上的内容,非常的不错。不过有个问题就是不知道什么原因,它的部署模板里面没有Jekyll的语句,然后前端还不能自定义……所以只能靠抓包的方式来修改成自己想要的部署语句。
# 从IPFS直接访问
使用4everland部署完之后直接访问当然也很好,但是总感觉和其他服务商差不多,谁知道它读取网页到底是从自己服务器上还是IPFS网络上读取呢?所以我还想整个更好的方式从IPFS上读取,也能证明它确实在IPFS上了。
直接通过Gateway去访问我的博客当然也没问题,但是每次部署的时候CID是会变化的,那这样我想访问也不方便啊……后来我听说可以把CID用一种叫dnslink的方式记录到DNS里,这样就能通过固定又好记的方式来访问。不过那时候我不知道怎么访问dnslink记录的网站……而且每次部署CID会变,那部署完我还要更新我的DNS记录啊?后来我查了查原来还有一种叫IPNS的东西,看了一眼4everland的控制台,原来每个网站它也会生成一个固定的IPNS,然后用dnslink可以指向IPNS。那如何访问呢?IPFS又没有一个IP地址,光TXT记录肯定不够的吧?后来我才知道原来要用CNAME解析到Gateway才能访问,设置之后每次访问Gateway就会自动解析在TXT记录里的dnslink了。现在 <https://ipfs.mayx.eu.org> 这个网站就可以直接访问我博客在IPFS上的数据了。这不比xLog自由度高?不过我这个没办法存评论数据,可能xLog的特色就是社交吧,毕竟他们的主项目Crossbell就是主打的社交。希望可以整一个单独的插件,专门用他们的网络来为我这种静态博客提供评论功能,也是一个不错的选择(毕竟ETH公链上的手续费太贵啦😂)。
# 更好的永久存储
前面我说过,IPFS只能防止篡改,但不是作为永久存储的方案,上公链当然是也一种永久存储的方案但是成本太高了我付不起。后来我了解到一种叫做Arweave的东西可以永久存储你的数据,不过这不是免费的,想存得要付AR币到链上才可以。还好4EVERLAND提供了一些免费上传到AR网络的额度,非常的不错,这样我以后每次上传我会把地址写到[Github的Releases](https://github.com/Mabbs/mabbs.github.io/releases)里面,进一步的提高我博客永久存储的可能性。
另外我还听说似乎还有一种叫做ZeroNet的东西也是通过分布式的方式存储数据,据群友所说也能在一定程度上永久存储。不过我试了试访问实在是太困难了😂,而且现在程序也不在维护了,所以也就放弃了。
# 感想
Web3真是发展的越来越好了,希望能有更多的人参与其中,一起创建不受管束的网络吧。(还有实现我的Mayx Forever计划😝)
不过说来我也挺担心那个Crossbell的项目,作为不受监管的平台只要知名度上来肯定会被滥用到死,希望他们能活得更长一些吧。
+32
View File
@@ -0,0 +1,32 @@
---
layout: post
title: 提高Cloudflare站点在中国的体验
tags: [Cloudflare, 加速]
---
从此,Cloudflare不再是减速CDN了<!--more-->
# 起因
众所周知,因为很多人用Cloudflare当作梯子中转之类的原因,中国对Cloudflare网络的速度会有很大程度的劣化,所以在上面的网站访问速度也会非常烂。最近我发现了一个不错的办法可以在一定程度上避免这个问题,所以今天就来说一说。
# 普通用户的解决方法
对于网站的访问者来说,使用[CloudflareSpeedTest](https://github.com/XIU2/CloudflareSpeedTest)这个工具就挺不错的,它能检测到当前网络连哪个IP是最好的。因为Cloudflare网络用的是Anycast,无论从哪个IP进入都可以,所以用这个检测出来的IP直接改Hosts访问就能解决访问网站慢的问题。
不过有些地区可能是服务商主动对Cloudflare的IP段进行限速,那这样有可能测试出来没有可以使用的节点,那么还有一种方法,网络上有些可能是企业之类的人会反代Cloudflare的网站用于解决在国内访问慢的问题,并且没有对host头做限制,那么这些第三方的节点同样也可以作为访问Cloudflare网站的方法。具体怎么找到这样的IP有一个[仓库](https://github.com/ip-scanner/cloudflare)每天都会扫描全网去找像这样的节点。
当然这些节点也不是所有的IP从中国连接速度都很好,这时候可以把这个仓库的所有IP收集起来然后再丢给CloudflareSpeedTest去测试,具体我写了个简单的脚本来处理:
```bash
git clone https://github.com/ip-scanner/cloudflare.git
cat cloudflare/*.txt > proxy.txt
./CloudflareST -allip -sl 0.1 -f proxy.txt -n 500
```
这样获得的第三方IP就基本上不会被限速,里面甚至有可能有通过IPLC或者IEPL的节点,包括拿来当梯子中转速度都几乎可以跑满带宽,另外还有一个优点是这样Cloudflare获得的IP就是第三方节点的IP,可以起到匿名的作用。
# 对于站长的解决方法
上面的方法相当于是用户自己去解决访问的问题,但是操作可能还是会有点复杂,所以对于网站站长来说不可能去期待访客通过这种方法来提高访问自己网站的速度。不过Cloudflare网站接入只能通过NS方式接入,这样接入的话域名解析的IP就是自动分配的,没办法自己设定解析,也就不能选择更合适的IP,另外之前用CF Partner通过CNAME接入的方法基本上都全死光了,那现在应该怎么办呢?后来我搜了一下,Cloudflare原来已经提供了官方通过CNAME接入的方法(应该是新加的功能),除了要绑信用卡之外就没别的要求了。
在使用这个功能之前,必须先有2个域名,一个是不重要的域名,通过NS方式接入Cloudflare,另一个是主要使用的域名,可以接到Cloudflare上,也可以接到别的NS服务商上。然后在那个不重要的域名中先设定好源站的解析,可以解析到“@”或者随便一个二级域名也可以,并且打开代理。然后点开SSL/TLS->自定义主机名,第一次使用需要绑定信用卡或者PayPal,好像是因为它是个什么预付费的项目,免费100个CNAME,超过100个每个0.1USD。打开以后在回退源中输入刚刚设置好解析的那个域名,当回退源状态显示有效后就可以添加自定义主机名了。这里添加的主机名就是主要使用的域名,输入后根据提示在主域名上设定好TXT记录,完成后只要看到刚刚设定的主机名后面跟了两个有效就可以了。
这样准备工作就做完了,现在只要把主域名的解析设定到Cloudflare网络的任意节点,它就会自动连接到不重要的域名所解析的IP上。至于怎么获得优秀的IP,就可以像普通用户那样操作了,获得优秀的IP以后我们就可以设定一个A记录解析过去。
不过这里需要注意一些地方,如果使用的优选IP是Cloudflare官方的IP,那基本上也不会有什么问题,只是这个IP可能有些地区还是会访问缓慢,毕竟它也算是在重点关注对象中。如果是选择第三方节点IP,大多数情况速度都能保障,但是有个很大的问题就是那些节点的主人如果发现了你在使用他们的节点,他们是可以很轻易的进行中间人攻击的,毕竟域名都解析过去了,整个SSL证书也很简单,为了能避免这个问题一定要开启“证书透明度监视”保证能在第一时间避免有人进行中间人攻击。另外还有一个问题就是既然第三方IP可以匿名,那么网站也没办法获取到用户的真实IP地址了,像Cloudflare一些根据IP的防火墙也会无法生效,像WAF中的速率限制规则是万万不能开的,开了很大可能网站就访问不了了。还有就是DDoS是可以击垮第三方节点的,可能会使网站的可用性下降。所以如果对速度没有特别在意的情况下还是解析到官方IP上更好一些。
所以为了避免节点可能会用不了的情况,我有个想法(因为我没有大陆地区的服务器所以只是设想),之前我用过一个可以给Cloudflare设定DDNS的脚本,叫[cloudflare-api-v4-ddns](https://github.com/aipeach/cloudflare-api-v4-ddns),原本它是去请求获取本机IP的API设定解析的,那么如果把上面优选IP的结果输入到这个脚本中,放到国内的服务器上,每天自动执行一次,那这样我的网站不就会一直使用最优秀的IP了嘛,可惜我没有国内的服务器,改起来还要费点事就算了吧。
# 感想
有了很多辅助的工具,能让Cloudflare不再成为减速CDN,那它岂不是可以吊打国内其他CDN厂商了😆,果然还是良心厂商啊。

Some files were not shown because too many files have changed in this diff Show More