lan-file-transfer

NextWeb4MIT活跃维护

局域网内快速传文件的桌面应用,带用户/组权限和审计日志,适合团队内部安全共享文件。

Local LAN file transfer desktop app with user/group permissions and audit logs.

v1.0.0发布于 2026-07-12 03:45 UTC241star15fork同步于 2026-11-07 07:34 UTC

怎么上手

由 README 提炼,执行前请确认
py -m venv .venv
.\.venv\Scripts\python.exe -m pip install --upgrade pip
.\.venv\Scripts\python.exe -m pip install -r requirements.txt
.\.venv\Scripts\python.exe -m lan_transfer.desktop
硬件要求按 README 说明

README 未说明显存或 GPU 要求;这是 Windows 桌面应用,通过 Tkinter 启动本地服务,手机、平板、电脑在同一局域网用浏览器访问即可。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

Windows 局域网文件共享服务器,带用户/组权限与审计日志,适合可信内网内传文件

局域网内快速传文件的桌面应用,带用户/组权限和审计日志,适合团队内部安全共享文件。

核心能力

  • Tkinter 启动本地 uvicorn 服务并显示用户/管理员 URL 与二维码
  • 按 guest/user/admin 三级角色和组控制文件可见性
  • 上传按字节流写入并记录 SHA-256 与 mtime,不改动文件内容
  • 支持搜索、排序、单文件与批量 ZIP 打包下载
  • 审计日志递归脱敏密码、token、cookie 等敏感字段

容易踩的坑

新目录首次启动会创建默认管理员 admin / 12345678,必须立即改密码;服务默认监听 0.0.0.0 且为 HTTP 明文,只能在可信局域网使用;发布版 EXE 未数字签名,Windows 可能提示未知发布者。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

1 个版本v1.0.0
  1. v1.0.0Initial Clean Release v1.0.0最新正式版2026-07-12 · 2026-07-12 03:45 UTC

    Initial Clean Release v1.0.0

    中文

    LAN File Transfer 是一个 Windows 本地局域网文件传输工具。它使用 Python Tkinter 提供桌面窗口,使用 FastAPI/uvicorn 提供本地 HTTP 服务,并提供原生 HTML/CSS/JavaScript 的用户页和管理员页。

    下载说明

    • LANFileTransfer.exe:Windows 单文件可执行程序,双击即可运行。
    • lan-file-transfer-v1.0.0-windows.zip:包含 LANFileTransfer.exe 的压缩包,适合下载后解压运行或归档保存。
    • SHA256SUMS.txt:发布文件的 SHA256 校验值。

    主要功能

    • 同一 Wi-Fi / 局域网内通过浏览器上传、下载和打包文件。
    • 游客、普通用户、管理员三类权限;游客只能访问公开文件。
    • 管理员可创建用户、批量创建普通用户、管理用户组、设置文件可见组和查看审计日志。
    • 保留原始二进制内容,计算 SHA-256,尽量保留文件修改时间。
    • Web UI 支持中文 / English 切换,并保存语言偏好。

    作者信息

    许可协议

    MIT License。

    English

    LAN File Transfer is a local Windows LAN file-transfer tool. It uses a Python Tkinter desktop window, a FastAPI/uvicorn local HTTP service, and vanilla HTML/CSS/JavaScript user and admin pages.

    Downloads

    • LANFileTransfer.exe: Windows one-file executable. Double-click to run.
    • lan-file-transfer-v1.0.0-windows.zip: Zip archive containing LANFileTransfer.exe, useful for extraction or archival.
    • SHA256SUMS.txt: SHA256 checksums for release files.

    Highlights

    • Upload, download, and zip files from browsers on the same Wi-Fi / LAN.
    • Guest, user, and admin permissions. Guests can only access public files.
    • Admins can create users, batch-create user accounts, manage groups, set file visibility groups, and inspect audit logs.
    • Preserves original binary content, records SHA-256, and attempts to preserve file modification times.
    • Web UI supports Chinese / English switching and stores the language preference.

    Author

    License

    MIT License.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    LAN File Transfer

    A Windows desktop file-sharing server with a Tkinter launcher, FastAPI backend, browser clients, role/group permissions, and an auditable local data model.

    Last commit Repository size GitHub stars Python and FastAPI MIT License

    Overview

    The Tkinter window starts a local uvicorn service, shows user/admin URLs and QR codes, and lets you select the save directory. Phones, tablets, and computers on the same trusted Wi-Fi or LAN can then upload, browse, download, and package files from native HTML/CSS/JavaScript pages.

    The service listens on 0.0.0.0 by default. This makes LAN access possible and also exposes the service to every reachable network. Run it only on a trusted network.

    Features

    • Streams uploaded bytes without transcoding, recompression, image/video rewriting, EXIF changes, or extension changes.
    • Stores size and SHA-256; attempts to preserve browser-provided File.lastModified values.
    • Supports raw downloads, single-file ZIP, selected/batch ZIP, search, and server-side sorting.
    • Uses guest, user, and admin roles. Guests see only files in the public group.
    • Signed-in users can upload and delete their own files; admins manage all files, users, groups, visibility, and audit history.
    • Creates built-in public and everyone groups for a new save directory.
    • Creates an initial administrator account: admin / 12345678.
    • Recursively redacts password, token, session, authorization, cookie, and secret fields from audit metadata.
    • Provides Chinese/English browser UI with the preference stored in localStorage.
    • Uses a Tkinter desktop lifecycle controller rather than a background system service.

    Change the default administrator password immediately after first launch. The default password exists only to initialize a new local save directory.

    Install and Run

    Use a Windows release

    GitHub Release v1.0.0 provides three assets:

    • LANFileTransfer.exe: one-file Windows application;
    • lan-file-transfer-v1.0.0-windows.zip: portable archive containing the executable;
    • SHA256SUMS.txt: SHA-256 values for the published files.

    Verify the EXE or ZIP against SHA256SUMS.txt, then run LANFileTransfer.exe. No installer or background service is created. The executable is not digitally signed, so Windows may show an unknown-publisher warning.

    Run from source

    py -m venv .venv
    .\.venv\Scripts\python.exe -m pip install --upgrade pip
    .\.venv\Scripts\python.exe -m pip install -r requirements.txt
    .\.venv\Scripts\python.exe -m lan_transfer.desktop
    

    The desktop app displays two addresses:

    • User URL for guests and ordinary users.
    • Admin URL for administrator sign-in and management.

    Wait until the desktop status reads Running, then open a URL or scan its QR code from a device on the same LAN.

    Typical Workflow

    1. Start the desktop app and choose a save directory.
    2. Open the Admin URL and sign in with the initial account on a new directory.
    3. Change the administrator password before sharing the User URL.
    4. Create individual users or up to 200 ordinary users in one validated batch; create groups and assign memberships.
    5. Upload files or folders and choose their visibility groups.
    6. Use search/sort and raw or ZIP download from another LAN device.
    7. Review audit events for login, logout, upload, download, delete, permission, account, and group changes.

    Mobile browsers do not always apply an HTTP Last-Modified value to the downloaded file on disk. Use ZIP download when preserving the archive entry mtime is important.

    Permission Model

    • Guests can list/download only public files and cannot upload or delete.
    • Ordinary users can see files assigned to their groups, upload files, and delete only their own uploads.
    • Admins can manage accounts/groups, set file allowed_groups, inspect audits, and delete all files.
    • The built-in public and everyone groups and the built-in admin account cannot be deleted.
    • Deleting a user transfers that user's existing files to admin so a future account with the same name cannot inherit deletion rights.
    • A group cannot be deleted while any user or file references it.

    User and administrator endpoints are deliberately separate. A same-origin admin cookie must never enlarge what the User page can list or download.

    Storage and Integrity

    The selected save directory contains uploaded files and local control data:

    manifest.json
    .lan-transfer-auth.json
    .lan-transfer-audit.jsonl
    

    These control names, their temporary variants, and unsafe absolute/parent paths are reserved by path validation. Uploads use chunked .part files, size verification, SHA-256, nonconflicting names, mtime application, and atomic publication. Manifest and auth updates use hidden randomized temporary files and atomic replacement.

    Strongly audited operations are transactional:

    • a pending upload is invisible until its audit entry and manifest publication both succeed;
    • audit failure rolls back login/logout, password, account, group, upload, delete, and permission changes;
    • deletion uses a recoverable tombstone until manifest and audit work can commit;
    • unsafe or stale manifest paths are revalidated before list, download, ZIP, delete, or rollback use.

    Test and Validate

    .\.venv\Scripts\python.exe -m pytest
    node --check .\lan_transfer\static\user.js
    node --check .\lan_transfer\static\admin.js
    

    Tests cover authentication, lockout, account/group permissions, batch creation, visibility, search/sort, byte integrity, mtime, response headers, ZIP behavior, paths, duplicate names, transaction rollback, audit redaction, desktop lifecycle, logging, release metadata, and frontend contracts.

    No dedicated lint or format command is declared. The two node --check commands are JavaScript syntax checks.

    Package a Windows Release

    powershell -ExecutionPolicy Bypass -File .\scripts\build_exe.ps1
    

    The script installs dependencies, runs tests, and builds a windowed one-file executable with PyInstaller.

    dist\LANFileTransfer.exe
    release-assets\LANFileTransfer.exe
    release-assets\lan-file-transfer-v1.0.0-windows.zip
    release-assets\SHA256SUMS.txt
    

    No MSI is generated because there is no WiX, Inno Setup, or NSIS definition. Release binaries are not digitally signed; Windows may show an unknown-publisher warning. Download from the project Release page and verify SHA256SUMS.txt.

    Project Structure

    PathResponsibility
    lan_transfer/desktop.pyTkinter window, QR codes, save-directory selection, and service lifecycle
    lan_transfer/server.pyuvicorn thread startup, health, timeout, and shutdown
    lan_transfer/api.pyFastAPI routes, role/session boundaries, visibility, sorting, downloads, and error mapping
    lan_transfer/auth.pyAccounts, groups, PBKDF2 password hashes, sessions, IP lockout, and auth persistence
    lan_transfer/storage.pyStreamed files, manifest, hash/mtime, ZIP, ownership, visibility, transactions, and tombstones
    lan_transfer/security.pyUpload and stored-manifest path normalization/containment
    lan_transfer/audit.pyRedacted JSONL audit trail
    lan_transfer/config.pySave directory, available port, LAN address, and URLs
    lan_transfer/static/Native user/admin browser applications
    tests/Backend, desktop, release, and frontend-contract regression suites

    Security Notes

    • Passwords are locally hashed with PBKDF2; session values and passwords must never be returned in JSON, validation errors, logs, or audit metadata.
    • Five failed logins from one IP trigger a three-hour lockout.
    • The service is HTTP on the LAN, not HTTPS. Network peers may be able to observe traffic; use only a trusted network.
    • Guest-visible public filenames and files are intentionally reachable without sign-in.
    • Raw download headers include integrity/cache/mtime metadata, but browsers control the final filesystem timestamp.
    • Do not expose the listener through port forwarding, public Wi-Fi, a public firewall rule, or an untrusted VPN.

    Maintenance and Contributions

    • Keep route policy in api.py, accounts and sessions in auth.py, file transactions in storage.py, and path validation in security.py; add focused regression coverage in the corresponding tests/test_*.py suite.
    • Browser changes must preserve the separate user/admin contracts, Chinese/English strings, stale-response guards, and native no-CDN frontend. Run both node --check commands after editing JavaScript.
    • Re-run permission, path, audit, rollback, and byte-integrity tests whenever a change crosses more than one backend module; a successful UI action alone does not prove the disk and audit state committed together.
    • Dependency changes require an update to the open-source audit. Release changes must rebuild, launch, inspect the portable archive, and verify metadata and checksums.
    • Keep all three README versions aligned and retain the HTTP, trusted-LAN, default-password, public-file, mtime, and unsigned-binary warnings.

    Author

    License

    MIT © 2026 HaoXiang Huang.