Compare commits

..

5 Commits

Author SHA1 Message Date
ikun0014
839e922d79 2.0.7 2025-09-20 18:57:20 +08:00
ikun0014
2bd2f23838 Update version to v2.0.7 and remove license section
Bumped the displayed version in about.html from v2.0.6 to v2.0.7. Removed the commented-out project license agreement section from README.md for clarity.
2025-09-20 18:57:15 +08:00
ikun0014
9e68621e76 Remove 'verify=False' from HTTP client instantiations
Eliminated the 'verify=False' parameter from all httpx.Client and httpx.AsyncClient initializations to enforce SSL certificate verification. This improves security by ensuring HTTPS requests validate server certificates.
2025-09-20 18:56:29 +08:00
ikun0014
2a6a9421ca Refactor IP location check and update HTTP client config
Moved the IP location check logic to constants.py and set IS_CN at import time, removing the async check_ip method from OnekeyApp. Updated all httpx client instantiations to use verify=False for SSL verification. Adjusted imports and usages accordingly in web/app.py and main.py.
2025-09-20 18:55:49 +08:00
ikun0014
1a6cf47882 Refactor constants and update HTTP client config
Added type annotations to constants in constants.py and set IS_CN default to True. Updated main.py to use 'flag' instead of 'ip_flag' from API response. Removed 'verify=False' and 'proxy=None' from httpx.AsyncClient initialization in client.py for improved security and clarity.
2025-09-20 18:32:28 +08:00
7 changed files with 27 additions and 33 deletions

View File

@@ -47,20 +47,6 @@ git clone https://github.com/ikunshare/Onekey
pip install -r requirements.txt
```
<!-- ## 项目协议
本项目基于 GPL-2.0 许可证发行,以下协议是对于 GPL-2.0 原协议的补充,如有冲突,以以下协议为准。
词语约定: “使用者”指签署本协议的使用者;“版权数据”指包括但不限于图像、音频、名字等在内的他人拥有所属版权的数据。
本项目的数据来源原理是从Steam官方的CDN服务器中拉取游戏清单数据经过对数据简单地筛选与合并后进行展示因此本项目不对数据的准确性负责。
使用本项目的过程中可能会产生版权数据对于这些版权数据本项目不拥有它们的所有权为了避免造成侵权使用者务必在24 小时内清除使用本项目的过程中所产生的版权数据。
由于使用本项目产生的包括由于本协议或由于使用或无法使用本项目而引起的任何性质的任何直接、间接、特殊、偶然或结果性损害(包括但不限于因商誉损失、停工、计算机故障或故障引起的损害赔偿,或任何及所有其他商业损害或损失)由使用者负责。
本项目完全免费,且开源发布于 GitHub 面向全世界人用作对技术的学习交流,本项目不对项目内的技术可能存在违反当地法律法规的行为作保证,禁止在违反当地法律法规的情况下使用本项目,对于使用者在明知或不知当地法律法规不允许的情况下使用本项目所造成的任何违法违规行为由使用者承担,本项目不承担由此造成的任何直接、间接、特殊、偶然或结果性责任。
而且,本项目已禁止使用于商业用途,以及不得进行未经允许的二次修改,否则必须同时发布源代码。
若你使用了本项目,将代表你接受以上协议。
Steam正版平台不易请尊重版权支持正版。
本项目仅用于对技术可行性的探索及研究,不接受任何商业(包括但不限于广告等)合作。 -->
## Star 趋势图

View File

@@ -1,6 +1,6 @@
{
"name": "onekey",
"version": "2.0.6",
"version": "2.0.7",
"description": "一个Steam仓库清单下载器",
"main": "index.js",
"scripts": {

View File

@@ -1,14 +1,32 @@
"""常量定义"""
from pathlib import Path
from httpx import Client
LOG_DIR = Path("logs")
IS_CN = False
CONFIG_FILE = Path("config.json")
LOG_DIR: Path = Path("logs")
CONFIG_FILE: Path = Path("config.json")
STEAM_API_BASE = "https://steam.ikunshare.com/api"
STEAM_CACHE_CDN_LIST = (
def check_ip():
try:
with Client(timeout=5.0) as client:
req = client.get(
"https://mips.kugou.com/check/iscn",
)
req.raise_for_status()
body = req.json()
print("已获取IP属地")
return bool(body["flag"])
except:
print("获取IP属地失败, 默认您位于中国大陆境内")
return True
IS_CN: bool = check_ip()
STEAM_API_BASE: str = "https://steam.ikunshare.com/api"
STEAM_CACHE_CDN_LIST: list = (
[
"http://alibaba.cdn.steampipe.steamcontent.com",
"http://steampipe.steamcontent.tnkjmec.com",

View File

@@ -5,7 +5,6 @@ from .logger import Logger
from .models import DepotInfo, ManifestInfo, SteamAppInfo, SteamAppManifestInfo
from .network.client import HttpClient
from .manifest_handler import ManifestHandler
from . import constants
class OnekeyApp:
@@ -20,14 +19,6 @@ class OnekeyApp:
)
self.client = HttpClient()
async def check_ip(self):
req = await self.client.get(
"https://mips.kugou.com/check/iscn",
)
req.raise_for_status()
body = req.json()
constants.IS_CN = bool(body["ip_flag"])
async def fetch_key(self):
trans = {
"week": "周卡",
@@ -165,7 +156,6 @@ class OnekeyApp:
self.logger.error("Steam路径未配置或无效无法继续")
return False
await self.check_ip()
await self.fetch_key()
manifests = []

View File

@@ -8,7 +8,7 @@ class HttpClient:
"""HTTP客户端封装"""
def __init__(self):
self._client = httpx.AsyncClient(verify=False, timeout=60, proxy=None)
self._client = httpx.AsyncClient(timeout=60.0)
async def get(self, url: str, headers: Optional[Dict] = None) -> httpx.Response:
"""GET请求"""
@@ -23,4 +23,3 @@ class HttpClient:
async def __aexit__(self, exc_type, exc_val, exc_tb):
await self.close()

View File

@@ -13,6 +13,7 @@ from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse, RedirectResponse
from fastapi.templating import Jinja2Templates
from src import constants
from src.constants import STEAM_API_BASE

View File

@@ -26,7 +26,7 @@
<p class="project-subtitle">直观,优雅的游戏解锁解决方案</p>
</div>
<div class="project-version">
<span class="version-label">v2.0.6</span>
<span class="version-label">v2.0.7</span>
<span class="version-type">Web UI</span>
</div>
</div>