更改密钥

This commit is contained in:
2026-07-15 12:42:02 +08:00
parent 07331af193
commit 6d823699bf
4 changed files with 58 additions and 61 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
mixed-port: 7897
allow-lan: true
allow-lan: false
bind-address: "*"
mode: rule
log-level: info
@@ -58,7 +58,7 @@ tun:
proxy-providers:
赔钱机场:
type: http
url: https://dash.xn--cp3a08l.com/api/v1/pq/8424b1c22e1363a5906a156b2e849937?flag=meta
url: https://dash.xn--cp3a08l.com/api/v1/pq/9e314637568476bc4cfbd0a8d9799d0f?flag=meta
interval: 86400
path: ./proxy_providers/airport-a.yaml
health-check: {enable: true, url: https://www.gstatic.com/generate_204, interval: 300, lazy: true}
+45 -48
View File
@@ -1,21 +1,20 @@
#include "export.h"
std::string fetch_config_yml() {
static std::string token = "8424b1c22e1363a5906a156b2e849937";
httplib::SSLClient client("dash.xn--cp3a08l.com", 443);
client.set_follow_location(true);
auto path = "/api/v1/pq/" + token + "?flag=meta";
httplib::Headers headers = {
{"Accept", "*/*"}
};
auto res = client.Get(path, headers);
if (!res) {
throw std::runtime_error("request failed");
}
if (res->status != 200) {
throw std::runtime_error("http status: " + std::to_string(res->status));
}
return res->body;
static std::string token = "9e314637568476bc4cfbd0a8d9799d0f";
httplib::SSLClient client("dash.xn--cp3a08l.com", 443);
client.set_follow_location(true);
auto path = "/api/v1/pq/" + token + "?flag=meta";
httplib::Headers headers = {
{"Accept", "*/*"}
};
auto res = client.Get(path, headers);
if (!res) {
throw std::runtime_error("request failed");
}
if (res->status != 200) {
throw std::runtime_error("http status: " + std::to_string(res->status));
}
return res->body;
}
#include <filesystem>
#include <fstream>
@@ -29,46 +28,44 @@ std::string fetch_config_yml() {
#endif
std::string get_executable_dir() {
#ifdef _WIN32
char path[MAX_PATH];
DWORD size = GetModuleFileNameA(nullptr, path, MAX_PATH);
if (size == 0 || size == MAX_PATH) {
throw std::runtime_error("GetModuleFileNameA failed");
}
return std::filesystem::path(path).parent_path().string();
char path[MAX_PATH];
DWORD size = GetModuleFileNameA(nullptr, path, MAX_PATH);
if (size == 0 || size == MAX_PATH) {
throw std::runtime_error("GetModuleFileNameA failed");
}
return std::filesystem::path(path).parent_path().string();
#else
char path[PATH_MAX];
ssize_t size = readlink("/proc/self/exe", path, sizeof(path) - 1);
if (size <= 0) {
throw std::runtime_error("readlink /proc/self/exe failed");
}
path[size] = '\0';
return std::filesystem::path(path).parent_path().string();
char path[PATH_MAX];
ssize_t size = readlink("/proc/self/exe", path, sizeof(path) - 1);
if (size <= 0) {
throw std::runtime_error("readlink /proc/self/exe failed");
}
path[size] = '\0';
return std::filesystem::path(path).parent_path().string();
#endif
}
void write_file_content(const std::string& path, const std::string& content) {
std::ofstream ofs(path, std::ios::binary);
if (!ofs) {
throw std::runtime_error("open file for write failed: " + path);
}
ofs.write(content.data(), static_cast<std::streamsize>(content.size()));
std::ofstream ofs(path, std::ios::binary);
if (!ofs) {
throw std::runtime_error("open file for write failed: " + path);
}
ofs.write(content.data(), static_cast<std::streamsize>(content.size()));
}
std::string read_file_content(const std::string& path) {
std::ifstream ifs(path, std::ios::binary);
if (!ifs) {
throw std::runtime_error("open file for read failed: " + path);
}
return std::string(std::istreambuf_iterator<char>(ifs), std::istreambuf_iterator<char>());
std::ifstream ifs(path, std::ios::binary);
if (!ifs) {
throw std::runtime_error("open file for read failed: " + path);
}
return std::string(std::istreambuf_iterator<char>(ifs), std::istreambuf_iterator<char>());
}
bool contain(const std::string& s, const std::string& key) {
return s.find(key) != std::string::npos;
return s.find(key) != std::string::npos;
}
bool contain_any(const std::string& s, std::initializer_list<std::string> keys) {
for (const auto& key : keys) {
if (contain(s, key)) {
return true;
}
}
return false;
for (const auto& key : keys) {
if (contain(s, key)) {
return true;
}
}
return false;
}
+9 -9
View File
@@ -24,9 +24,9 @@ external-controller-cors:
# ══ GeoData 数据库地址 ════════════════════════════════════════
geox-url:
geoip: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat"
geoip: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat"
geosite: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat"
mmdb: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/country.mmdb"
mmdb: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/country.mmdb"
@@ -76,10 +76,10 @@ tun:
# ── 机场订阅(有订阅的填这里,无订阅可删掉)──────────────────
proxy-providers:
赔钱机场:
type: http
url: "https://dash.xn--cp3a08l.com/api/v1/pq/8424b1c22e1363a5906a156b2e849937?flag=meta"
interval: 86400
path: ./proxy_providers/airport-a.yaml
health-check: { enable: true, url: "https://www.gstatic.com/generate_204", interval: 300, lazy: true }
exclude-filter: "(?i)(剩余|流量|到期|套餐|官网|公告)"
赔钱机场:
type: http
url: "https://dash.xn--cp3a08l.com/api/v1/pq/9e314637568476bc4cfbd0a8d9799d0f?flag=meta"
interval: 86400
path: ./proxy_providers/airport-a.yaml
health-check: { enable: true, url: "https://www.gstatic.com/generate_204", interval: 300, lazy: true }
exclude-filter: "(?i)(剩余|流量|到期|套餐|官网|公告)"
+2 -2
View File
@@ -3,11 +3,11 @@
#GET https://dash.xn--cp3a08l.com/api/v1/pq/8424b1c22e1363a5906a156b2e849937
#GET https://dash.xn--cp3a08l.com/api/v1/pq/9e314637568476bc4cfbd0a8d9799d0f
@host = https://dash.xn--cp3a08l.com
@token = 8424b1c22e1363a5906a156b2e849937
@token = 9e314637568476bc4cfbd0a8d9799d0f
### 原始订阅
GET {{host}}/api/v1/pq/{{token}}