feat(platform): harden telemetry pipeline and unify Semi UI workspaces

This commit is contained in:
lingniu
2026-07-18 00:26:36 +08:00
parent 65b4e4f055
commit 159c80b0ae
136 changed files with 21616 additions and 1785 deletions

22
deploy/feichi-ocr/ocr.py Normal file
View File

@@ -0,0 +1,22 @@
import re
import sys
import ddddocr
def main() -> int:
image = sys.stdin.buffer.read()
if not image:
print("captcha image is empty", file=sys.stderr)
return 2
result = ddddocr.DdddOcr(show_ad=False).classification(image)
code = re.sub(r"[^0-9A-Za-z]", "", result).upper()
if not re.fullmatch(r"[0-9A-Z]{4}", code):
print(f"invalid OCR result: {code!r}", file=sys.stderr)
return 3
print(code)
return 0
if __name__ == "__main__":
raise SystemExit(main())