Compare commits

..
Author SHA1 Message Date
dependabot[bot] 41e3ce1b9c chore(deps): bump actions/upload-pages-artifact from 3 to 5
Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 3 to 5.
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](https://github.com/actions/upload-pages-artifact/compare/v3...v5)

---
updated-dependencies:
- dependency-name: actions/upload-pages-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-14 13:47:25 +00:00
14 changed files with 14 additions and 93 deletions

No files matched your search

+1 -1
View File
@@ -51,7 +51,7 @@ jobs:
working-directory: docs
run: pnpm run docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v5
with:
path: docs/.vitepress/dist
+1 -1
View File
@@ -1,3 +1,3 @@
{
".": "2.6.1"
".": "2.6.0"
}
+1 -1
View File
@@ -1 +1 @@
2.6.1
2.6.0
+4 -10
View File
@@ -1567,16 +1567,10 @@ class ConfigService:
detail="storage_limit 不能小于 0",
)
# 只校验"发生变化"的值:升级前存入的旧格式 background(相对路径、含空格
# 或括号)在旧版本是合法的,若每次保存都重新校验,存量部署会连无关设置项
# 都保存不了(一律 400)。渲染侧仍然 html 转义,而任何修改都必须通过校验。
current_background = str(settings.background or "")
candidate_background = str(next_config.get("background") or "")
if candidate_background != current_background:
try:
validate_background_url(candidate_background)
except ValueError as exc:
raise HTTPException(status_code=400, detail=str(exc))
try:
validate_background_url(next_config.get("background", ""))
except ValueError as exc:
raise HTTPException(status_code=400, detail=str(exc))
if admin_password_changed:
next_config["jwt_secret"] = generate_jwt_secret()
+1 -3
View File
@@ -174,9 +174,7 @@ def verify_password(password: str, hashed: str) -> bool:
p=int(p),
maxmem=_SCRYPT_MAXMEM,
).hex()
# 默认解释器对超范围的 n/r/p 抛 TypeError/ValueError;部分构建会抛
# OverflowError,一并视为校验失败,避免坏掉的存量哈希影响登录路径。
except (ValueError, TypeError, OverflowError):
except (ValueError, TypeError):
return False
return hmac.compare_digest(password_hash, stored_hash)
+1 -1
View File
@@ -1,7 +1,7 @@
version: "3"
services:
file-code-box:
image: lanol/filecodebox:2.6.1 # x-release-please-version
image: lanol/filecodebox:2.6.0 # x-release-please-version
volumes:
- fcb-data:/app/data:rw
restart: unless-stopped
-8
View File
@@ -1,13 +1,5 @@
# Changelog
## [2.6.1](https://github.com/vastsa/FileCodeBox/compare/v2.6.0...v2.6.1) (2026-09-14)
### Bug Fixes
* don't let a legacy background value block settings saves ([eb2db8f](https://github.com/vastsa/FileCodeBox/commit/eb2db8f507e3198e0ae45b976bdd90eab2f7d1ed))
* 存量 background 值不再阻塞后台设置保存([#514](https://github.com/vastsa/FileCodeBox/issues/514) 升级回归) ([0d82fbe](https://github.com/vastsa/FileCodeBox/commit/0d82fbe26ad06ca77af7b2b5aa05f514e8362295))
## [2.6.0](https://github.com/vastsa/FileCodeBox/compare/v2.5.6...v2.6.0) (2026-09-14)
+1 -1
View File
@@ -1,6 +1,6 @@
## [Unreleased]
<!-- Current release: 2.6.1 x-release-please-version -->
<!-- Current release: 2.6.0 x-release-please-version -->
### Added
+1 -1
View File
@@ -42,7 +42,7 @@ docker run -d --restart unless-stopped \
--log-opt max-size=10m \
--log-opt max-file=3 \
--name filecodebox \
lanol/filecodebox:2.6.1 # x-release-please-version
lanol/filecodebox:2.6.0 # x-release-please-version
```
Open `http://localhost:12345` and complete the first-run setup.
+1 -1
View File
@@ -42,7 +42,7 @@ docker run -d --restart unless-stopped \
--log-opt max-size=10m \
--log-opt max-file=3 \
--name filecodebox \
lanol/filecodebox:2.6.1 # x-release-please-version
lanol/filecodebox:2.6.0 # x-release-please-version
```
打开 `http://localhost:12345`,按引导完成首次初始化。
+1 -1
View File
@@ -32,7 +32,7 @@ docker run -d --restart unless-stopped \
--log-opt max-size=10m \
--log-opt max-file=3 \
--name filecodebox \
lanol/filecodebox:2.6.1 # x-release-please-version
lanol/filecodebox:2.6.0 # x-release-please-version
```
访问 `http://localhost:12345`,完成首次初始化。生产环境建议固定版本号;`latest` 指向最新正式版。
+1 -1
View File
@@ -32,7 +32,7 @@ docker run -d --restart unless-stopped \
--log-opt max-size=10m \
--log-opt max-file=3 \
--name filecodebox \
lanol/filecodebox:2.6.1 # x-release-please-version
lanol/filecodebox:2.6.0 # x-release-please-version
```
Open `http://localhost:12345` and complete first-run setup. Pin a version in production; `latest` tracks the newest stable release.
-58
View File
@@ -73,63 +73,5 @@ class ConfigServiceBackgroundGuardTests(SettingsOverrideMixin, unittest.TestCase
await close_db()
class LegacyBackgroundUpgradeTests(SettingsOverrideMixin, unittest.TestCase):
"""存量部署升级:旧版本合法、新校验不接受的值,不得阻塞设置保存。"""
def test_unchanged_legacy_background_does_not_block_unrelated_save(self):
asyncio.run(self._unchanged_legacy_allows_save())
async def _unchanged_legacy_allows_save(self):
await init_memory_db()
try:
from apps.base.config import refresh_settings
from apps.base.models import KeyValue
# 旧版本合法(相对路径 + 空格),新的 http(s) 校验会拒绝
legacy = "/static/bg image.png"
await KeyValue.create(
key="settings", value={"background": legacy, "name": "old"}
)
await refresh_settings(force=True)
service = ConfigService()
# 修复前这里会 400,导致存量部署连无关设置项都保存不了
await service.update_config({"name": "new"})
record = await KeyValue.filter(key="settings").first()
self.assertEqual(record.value.get("background"), legacy, "旧值应原样保留")
self.assertEqual(record.value.get("name"), "new")
finally:
await close_db()
def test_changing_background_is_still_validated(self):
asyncio.run(self._change_still_validated())
async def _change_still_validated(self):
await init_memory_db()
try:
from fastapi import HTTPException
from apps.base.config import refresh_settings
from apps.base.models import KeyValue
await KeyValue.create(key="settings", value={"background": "/legacy/bg.png"})
await refresh_settings(force=True)
service = ConfigService()
# 修改为恶意值仍然被拒
with self.assertRaises(HTTPException) as ctx:
await service.update_config(
{"background": "x') ;background:url(https://evil.com/)"}
)
self.assertEqual(ctx.exception.status_code, 400)
# 修改为合法值可以通过
await service.update_config({"background": "https://ok.example/bg.png"})
record = await KeyValue.filter(key="settings").first()
self.assertEqual(record.value.get("background"), "https://ok.example/bg.png")
finally:
await close_db()
if __name__ == "__main__":
unittest.main()
-5
View File
@@ -53,11 +53,6 @@ class PasswordHashSchemeTests(unittest.TestCase):
self.assertFalse(verify_password("x", "scrypt$n$r$p$salt$zzz"))
self.assertFalse(verify_password("x", "sha256$only-two"))
self.assertFalse(verify_password("x", ""))
# 超范围的 n/r/p:解释器抛 TypeError/ValueError(部分构建抛 OverflowError),
# 都必须被吞掉并判为不匹配,而不是让登录及每个请求 500
self.assertFalse(
verify_password("x", "scrypt$99999999999999999999999999$8$1$aa$bb")
)
class TransparentRehashTests(SettingsOverrideMixin, unittest.TestCase):