Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,21 @@ For self-hosting, follow [the steps below](#deploy-your-own-5-min). See the [hos

1. Open the [hosted service](https://shotsync-hosted.defiabell.workers.dev), register with an email and password, and save your recovery code. No email verification is required.
2. Choose **+ 图片** to upload an image or **文字** to send text. Sign in to the same account on another device to retrieve it.
3. Open settings to copy the gallery address, check quotas and retention, or generate a device token for the Mac app / iOS Shortcut.
3. On a phone, open **⚙ Settings → 📱 手机快捷入口设置** at the top of settings and follow the home-screen guide. Tap the ShotSync icon to return later; the first launch may require signing in again.

### Common actions

| Task | Where to go |
| --- | --- |
| Send images or text | **+ 图片** / **文字** on the gallery; drag or paste images on desktop |
| Retrieve or share content | Open an item → **取回** (download), **复制文字** (copy text) or **分享** (share) |
| Delete several items | **选择** → select items → **删除选中** → confirm; failed items stay selected for retry |
| Add a phone shortcut | **⚙ Settings → 📱 手机快捷入口设置** at the top; iPhone, Android and Shortcuts instructions |
| Open on another device | **Settings → 连接其他设备 → 复制相册地址**; open the copied address and sign in to the same account |
| Connect the Mac app / upload Shortcut | **Settings → 连接其他设备** → enter a device name and generate a token; configure the client with the gallery address and token |
| Check quotas and retention | Account details in settings; new accounts default to 7 days, with the actual policy shown there |

New device tokens are masked by default and can be revealed/copied again in the current page, even after closing settings. **Reloading the page or signing out clears them**, so save them in a password manager. If an existing token is unavailable, revoke it and generate another. Browser sign-in uses your email and password; it does not require a device token.

On a phone, follow the [home-screen shortcut guide](https://shotsync-hosted.defiabell.workers.dev/mobile) for iPhone or Android to open your gallery from an app icon.

Expand Down
16 changes: 15 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,21 @@

1. 打开[在线版](https://shotsync-hosted.defiabell.workers.dev),注册邮箱和密码,无需邮件验证;保存页面给出的恢复码。
2. 点击「+ 图片」上传,或点击「文字」发送;另一台设备登录同一账号即可取回。
3. 设置中可复制相册地址、查看额度和保留期,或生成设备令牌连接 Mac 客户端/快捷指令。
3. 手机端点右上角「⚙ 设置」→ 顶部「📱 手机快捷入口设置」,按教程添加到主屏幕。以后点 ShotSync 图标即可打开;首次可能需要重新登录。

### 常用操作

| 想做什么 | 在哪里操作 |
| --- | --- |
| 上传图片/发送文字 | 首页「+ 图片」/「文字」;电脑也可拖入或粘贴图片 |
| 取回或分享 | 点开内容 →「取回」「复制文字」或「分享」 |
| 批量删除 | 首页「选择」→ 点选内容 →「删除选中」;确认后删除,失败项保留供重试 |
| 手机快捷入口 | 「⚙ 设置」→ 顶部「📱 手机快捷入口设置」;支持 iPhone、Android 与快捷指令引导 |
| 另一台设备使用 | 「⚙ 设置」→「连接其他设备」→「复制相册地址」;浏览器打开后登录同一账号 |
| Mac 客户端/上传快捷指令 | 「⚙ 设置」→「连接其他设备」→ 填设备名并生成令牌;客户端填相册地址和令牌 |
| 查看额度和保留期 | 「⚙ 设置」中的账号信息;新账号默认保留 7 天,以页面实际显示为准 |

新生成的设备令牌默认遮掩,在当前页面可显示、复制,关闭设置后也可再次查看。**刷新页面或退出后无法再次查看**,请保存到密码管理器;已有令牌不能恢复时,可撤销后重新生成。网页登录只需邮箱和密码,不需要填写设备令牌。

手机用户可打开[手机快捷入口设置](https://shotsync-hosted.defiabell.workers.dev/mobile),按 iPhone / Android 指引添加到主屏幕,以后点图标就能进入相册。

Expand Down
2 changes: 2 additions & 0 deletions docs/hosted.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,5 @@ The setting applies to **new uploads**. Existing files keep their stored expiry
In `/api/list` and upload responses, `expiresAt: null` means no automatic expiry; `limits.retentionDays: 0` has the same meaning. Internally, only a ready file with `expires_at=0` is permanent; pending reservations always have a short timeout. Cleanup still removes pending/deleting records and expiring share links.

Rollback constraint: after migration 0005, keep code that understands `storage_prefix` and permanent `expires_at=0`. Older Workers assume every object is under `users/`, and their cleanup treats zero as expired; rolling back to them can delete permanent files. Suspend uploads and repair forward instead of deploying an old cleanup implementation.

The **📱 手机快捷入口设置** button is at the top of settings, before account quotas. It opens the phone guide for home-screen and Shortcuts setup.
2 changes: 1 addition & 1 deletion src/hosted/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function hostedHTML(env: HostedEnv): string {
<section id="app" hidden><div class="toolbar"><div class="brand">shotsync</div><button id="add-text">文字</button><button id="add-image" class="primary">+ 图片</button><button id="select-items">选择</button><button id="delete-selected" class="danger" hidden disabled>删除选中 (0)</button><button id="cancel-selection" hidden>取消</button><button id="refresh" aria-label="刷新内容" title="刷新内容">↻</button><button id="open-settings" aria-label="设置" title="设置">⚙</button><input id="file" type="file" accept="image/jpeg,image/png,image/webp" multiple hidden></div><div id="gallery" class="grid"></div><div id="empty" class="empty" hidden>传一张图片,或发一段文字。<p class="muted">另一台设备登录,即可取回。也可以拖入或粘贴图片。</p></div></section>
<dialog id="composer-dialog" aria-labelledby="composer-title"><div class="row spread dialog-head"><h2 id="composer-title">发送文字</h2><button id="close-composer" aria-label="关闭文字输入">关闭</button></div><form id="text-form"><textarea id="text" aria-label="同步文字" placeholder="粘贴或输入文字,在另一台设备取回……" required></textarea><div class="row spread" style="margin-top:12px"><span class="muted">最多 100 KiB</span><button class="primary">发送</button></div></form></dialog>
<dialog id="viewer-dialog" aria-labelledby="viewer-name"><div class="row spread"><h2 id="viewer-name"></h2><button id="close-viewer">关闭</button></div><p id="viewer-meta" class="muted"></p><div id="viewer-content"></div><div class="row"><button id="viewer-copy" class="primary" hidden>复制文字</button><button id="viewer-download">取回</button><button id="viewer-share">分享</button><button id="viewer-revoke">撤销分享</button><button id="viewer-delete" class="danger">删除</button></div><div id="share-result" hidden><input id="share-link" readonly aria-label="分享链接"><p class="muted">任何持有链接的人都可访问,最多 24 小时、最多 50 次;可随时撤销。</p><button id="copy-share">复制链接</button></div></dialog>
<dialog id="settings-dialog" aria-labelledby="settings-title"><div class="row spread dialog-head"><h2 id="settings-title">设置</h2><button id="close-settings">关闭</button></div><p id="identity" class="account-email"></p><p id="retention" class="muted"></p><div id="meters" class="meters"></div><p class="muted">每日额度按 UTC 零点重置。图片最多 10 MiB,文字最多 100 KiB;每分钟最多上传 10 次。删除不返还当天上传额度。</p><section><h2>手机快捷入口</h2><p><a id="mobile-guide" href="/mobile" target="_blank" rel="noopener">添加到主屏幕 / 快捷指令 →</a></p></section><section><h2>连接其他设备</h2><label for="gallery-url">相册地址</label><input id="gallery-url" readonly><button id="copy-gallery-url" style="margin-top:8px">复制相册地址</button><p class="muted">其他浏览器打开相册地址后登录。Mac 客户端和快捷指令使用此地址与设备令牌连接。</p><p class="muted">本次页面中新建的令牌可再次查看、复制;刷新页面或退出后无法再次查看,请保存到密码管理器。服务端仅保存令牌哈希,已有令牌无法恢复,可撤销后重新生成。</p><form id="device-form" class="row"><input id="device-name" maxlength="60" required placeholder="设备名称,例如:我的 Mac" aria-label="设备名称" style="flex:1;min-width:150px"><button>生成令牌</button></form><div id="new-token" hidden><p id="token-label">设备令牌</p><p class="muted">请复制并安全保存;刷新页面或退出后无法再次查看。</p><code id="token-value" class="token"></code><div class="row" style="margin-top:12px"><button id="reveal-token">显示令牌</button><button id="copy-token">复制令牌</button><button id="dismiss-token">我已保存,隐藏</button></div></div><div id="devices"></div></section><div class="row spread" style="margin-top:24px"><a class="muted" href="https://github.com/Defiabell/shotsync/blob/main/README.zh-CN.md#自己部署约-5-分钟">自己部署</a><button id="logout" hidden>退出登录</button></div></dialog>
<dialog id="settings-dialog" aria-labelledby="settings-title"><div class="row spread dialog-head"><h2 id="settings-title">设置</h2><button id="close-settings">关闭</button></div><p><a class="button primary" id="mobile-guide" href="/mobile" target="_blank" rel="noopener" style="display:inline-block;text-decoration:none">📱 手机快捷入口设置 →</a></p><p class="muted">添加到主屏幕,或设置快捷指令,以后点图标就能打开。</p><p id="identity" class="account-email"></p><p id="retention" class="muted"></p><div id="meters" class="meters"></div><p class="muted">每日额度按 UTC 零点重置。图片最多 10 MiB,文字最多 100 KiB;每分钟最多上传 10 次。删除不返还当天上传额度。</p><section><h2>连接其他设备</h2><label for="gallery-url">相册地址</label><input id="gallery-url" readonly><button id="copy-gallery-url" style="margin-top:8px">复制相册地址</button><p class="muted">其他浏览器打开相册地址后登录。Mac 客户端和快捷指令使用此地址与设备令牌连接。</p><p class="muted">本次页面中新建的令牌可再次查看、复制;刷新页面或退出后无法再次查看,请保存到密码管理器。服务端仅保存令牌哈希,已有令牌无法恢复,可撤销后重新生成。</p><form id="device-form" class="row"><input id="device-name" maxlength="60" required placeholder="设备名称,例如:我的 Mac" aria-label="设备名称" style="flex:1;min-width:150px"><button>生成令牌</button></form><div id="new-token" hidden><p id="token-label">设备令牌</p><p class="muted">请复制并安全保存;刷新页面或退出后无法再次查看。</p><code id="token-value" class="token"></code><div class="row" style="margin-top:12px"><button id="reveal-token">显示令牌</button><button id="copy-token">复制令牌</button><button id="dismiss-token">我已保存,隐藏</button></div></div><div id="devices"></div></section><div class="row spread" style="margin-top:24px"><a class="muted" href="https://github.com/Defiabell/shotsync/blob/main/README.zh-CN.md#自己部署约-5-分钟">自己部署</a><button id="logout" hidden>退出登录</button></div></dialog>
</main><script>
'use strict';
const config=${config};
Expand Down
Loading