forever94yu/icloud-prime
关于
Self-hosted iCloud Hide My Email management console with Windows portable releases
效率与自动化可以做什么
- Local web console at http://127.0.0.1:8081
- Multi-account management
- Create iCloud Hide My Email aliases
- Batch-create up to 5 aliases per account per hour
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文iCloud Prime
iCloud Prime is a local, self-hosted management console for Apple iCloud Hide My Email aliases. It provides a web UI and HTTP API for managing multiple iCloud accounts, creating aliases, listing aliases, and reading mail sent to aliases.
Repository: https://github.com/forever94yu/icloud-prime
Project Status
This project is public and open to community contributions.
- Issues are enabled for bug reports, feature requests, questions, and documentation feedback.
- Pull requests are welcome from forks.
- Discussions are enabled for usage help and roadmap conversations.
- CI runs on pushes and pull requests.
- Releases include a Windows 10 portable package with placeholder-only configuration.
Security First
Never commit real account data.
The following files and directories must stay local:
data/accounts.jsondata/create_jobs.json.envlogs/build/- any
.exebinary
The Windows portable release does not include real account data. It includes only
data/accounts.example.json with placeholder values.
Your local data/accounts.json may contain iCloud Cookie values, App-specific passwords,
and proxy settings. Treat it like a password file.
Your local data/create_jobs.json contains scheduled alias creation jobs and stays local too.
Features
- Local web console at
http://127.0.0.1:8081 - Multi-account management
- Create iCloud Hide My Email aliases
- Batch-create up to 5 aliases per account per hour
- Schedule automatic alias creation by duration or daily time window
- List aliases for each account
- Deactivate, reactivate, and delete aliases
- Read mail through IMAP first, with Web API Cookie fallback
- Click inbox messages to open a centered detail modal instead of scrolling to the bottom
- Lazy-load and cache full message bodies for faster repeated mail-detail viewing
- Support for
icloud.comandicloud.com.cn - Optional HTTP/SOCKS5 proxy settings
- Windows 10 portable release package
Screenshots
The screenshots below use public demo values only. Real account data, aliases, verification codes, and message previews are not included.
Account Overview

Alias Creation

Alias List

Inbox

Verification Codes

Settings

Quick Start: Windows 10 Portable Package
This is the easiest way to run the project. You do not need Go or Node.js.
1. Download
Open the Releases page:
https://github.com/forever94yu/icloud-prime/releases
Download:
icloud-prime-windows10-portable-v0.1.10.zip
2. Extract
Extract the zip to a stable folder, for example:
D:\Tools\icloud-prime
The extracted folder contains:
icloud-prime-windows10-portable-v0.1.10/
|-- icloud-prime.exe
|-- start.bat
|-- stop.bat
|-- README-Usage.txt
|-- data/
| `-- accounts.example.json
`-- logs/
3. Start
Double-click:
start.bat
Then open:
Manual start:
.\icloud-prime.exe -addr 127.0.0.1:8081 -data .\data
4. Add an Account
In the web console:
- Open the account area.
- Add a display name such as
Main account. - Use
icloud.comfor most accounts. - Use
icloud.com.cnfor China-region iCloud accounts. - Add Cookie values now, or add the account first and update Cookie values later.
Runtime account data is stored in:
data/accounts.json
If data/accounts.json does not exist and data/accounts.example.json contains
real non-placeholder account values, the app imports those values once and saves
them to data/accounts.json. The placeholder example account is ignored.
Do not upload or share that file.
5. Configure Cookie Values
Cookie authentication is used for Hide My Email alias management and as a Web API mail fallback.
The app saves refreshed Set-Cookie values from iCloud responses and removes
values the server deletes or expires. HME requests send each Cookie only once,
using the latest session values. However,
Apple can still revoke web sessions. If a VPS IP, proxy, browser session, or
account security state changes, refresh the Cookie values or log in again from
the account screen. Keeping each account on a stable host/proxy can reduce
session invalidation.
Common browser workflow:
- Open https://www.icloud.com or https://www.icloud.com.cn.
- Log in to your iCloud account.
- Open browser developer tools.
- Open Application or Storage.
- Find Cookies for iCloud.
- Copy the relevant iCloud Cookie values.
- Paste them into the web console account form.
Accepted Cookie input formats:
X-APPLE-WEBAUTH-TOKEN=value; X-APPLE-WEBAUTH-USER=value; X-APPLE-DS-WEB-SESSION-TOKEN=value
or:
{
"X-APPLE-WEBAUTH-TOKEN": "value",
"X-APPLE-WEBAUTH-USER": "value",
"X-APPLE-DS-WEB-SESSION-TOKEN": "value"
}
If alias creation returns 401 or 403, refresh your Cookie values.
The app cannot extend a session that Apple has revoked, and an App-specific
password only authenticates IMAP mail reading; it cannot renew HME Cookies.
Copy the complete current iCloud Cookie set, not just one token.
If an automatic job stops after a session error:
- Open the account screen and update the Cookies or sign in again.
- Check that the account is active and refresh its alias list successfully.
- Open automatic creation and resume the stopped job.
Updating Cookies does not itself resume an errored job. Resuming a duration job starts a new interval of its configured length, while preserving its created count and the account's consumed hourly quota. Temporary HTTP 421/429/5xx or network errors instead keep the job running and retry at the next hour. Do not post Cookie values in Issues.
6. Configure an App-Specific Password
An App-specific password is used for IMAP mail reading. It is not your Apple ID password.
- Open https://appleid.apple.com.
- Log in.
- Open "Sign-In and Security".
- Create an App-specific password.
- Save your iCloud email address and App-specific password in the web console.
Example:
{
"icloud_email": "[email protected]",
"app_password": "xxxx-xxxx-xxxx-xxxx"
}
7. Create a Hide My Email Alias
In the web console:
- Select an account.
- Enter a label such as
Example site. - Click create.
- Copy the generated alias.
API example:
curl -X POST http://127.0.0.1:8081/api/create \
-H "Content-Type: application/json" \
-d "{\"account_id\":\"acc_1\",\"label\":\"Example site\"}"
8. Batch Create Aliases
Batch creation shares the same hourly quota as single creation and automatic jobs. Each account can successfully create up to 5 aliases per hour.
In the web console:
- Select an account.
- Open the batch creation area.
- Choose a count from
1to5. - Enter a label prefix such as
Signup. - Start the batch creation.
- Review the created aliases, skipped count, and remaining hourly quota.
API example:
curl -X POST http://127.0.0.1:8081/api/create/batch \
-H "Content-Type: application/json" \
-d "{\"account_id\":\"acc_1\",\"count\":5,\"label_prefix\":\"Signup\"}"
9. Schedule Automatic Alias Creation
Automatic jobs are stored locally in:
data/create_jobs.json
The same file also stores current-hour quota usage, so restarting the program does not reset an account's already consumed quota for that hour. Automatic jobs pace successful creates evenly across the remaining per-account hourly quota, so one account reaching quota does not block other accounts from continuing their own scheduled jobs.
Do not upload or share that file.
Duration-based job:
- Select an account.
- Open the automatic creation area.
- Choose
duration. - Enter a duration in hours, for example
12. - Enter a label prefix.
- Save the job.
- Use pause, resume, or delete when needed.
For example, to run for the next 12 hours from 22:36, choose duration and
enter 12; the original end time is 10:36 the following day. Keep the program
running. The limit is up to 5 successful creates per account per calendar
hour, using the server's local time, shared with manual and batch creation.
The scheduler spreads creates across the remaining hour and resets the quota
at the next full hour. It does not create a batch of 5 exactly at :36 each hour,
and a 12-hour job does not guarantee exactly 60 aliases. Partial hours, existing
quota usage, session expiration, and upstream throttling can affect the total.
Daily-window job:
- Select an account.
- Choose
daily_window. - Enter
start_timeandend_timeinHH:mmformat. - Use a cross-midnight range when needed, for example
22:00to02:00. - Save the job.
API examples:
curl -X POST http://127.0.0.1:8081/api/create/jobs \
-H "Content-Type: application/json" \
-d "{\"account_id\":\"acc_1\",\"mode\":\"duration\",\"duration_hours\":12,\"label_prefix\":\"Auto\"}"
curl -X POST http://127.0.0.1:8081/api/create/jobs \
-H "Content-Type: application/json" \
-d "{\"account_id\":\"acc_1\",\"mode\":\"daily_window\",\"start_time\":\"09:00\",\"end_time\":\"18:00\",\"label_prefix\":\"Workday\"}"
curl "http://127.0.0.1:8081/api/create/jobs?account_id=acc_1"
10. Read Mail
In the web console, select an account and alias. Click a message row to open the full mail details in a modal window. The modal shows the subject, sender, recipient, time, detected verification code, and body preview without forcing you to scroll to the bottom of the page. The app now loads full message bodies on demand and prefetches visible messages in the background, so verification-code extraction and repeated detail views are faster after the first read.
API example:
curl "http://127.0.0.1:8081/api/inbox?account_id=acc_1&[email protected]&limit=20&days=7"
Read order:
- IMAP through App-specific password.
- Web API through Cookie fallback.
11. Stop
Double-click:
stop.bat
Or run:
taskkill /F /IM icloud-prime.exe
Build From Source
1. Requirements
- Git
- Go 1.26 or newer
- Node.js 20 or newer if you need to rebuild the web UI
2. Clone
git clone https://github.com/forever94yu/icloud-prime.git
cd icloud-prime
3. Download Go Dependencies
go mod download
4. Rebuild the Web UI
Only needed when changing files under web/.
cd web
npm ci
npm run build
cd ..
The Vite build writes static files to:
internal/server/static/dist
The Go binary embeds that directory.
5. Build
go build -ldflags="-s -w" -o icloud-prime.exe .
6. Run
.\icloud-prime.exe -addr 127.0.0.1:8081 -data .\data
Open:
Command-Line Options
.\icloud-prime.exe
Uses 127.0.0.1:8081 and .\data.
.\icloud-prime.exe -addr 127.0.0.1:9000
Uses port 9000.
.\icloud-prime.exe -data D:\icloud-prime-data
Uses a custom data directory.
.\icloud-prime.exe -debug
Enables debug logging.
Remote Access and Docker
Since v0.1.9, the default listener and portable launcher accept only local
connections. Binding to a non-loopback address requires an API access token.
Existing deployments using -addr :8081 must configure a token when upgrading.
$env:ICLOUD_PRIME_API_TOKEN = "REPLACE_WITH_A_LONG_RANDOM_TOKEN"
.\icloud-prime.exe -addr :8081 -data .\data
Open Settings in the web console and enter the same API token. API clients send
Authorization: Bearer <token>. The token is stored in this browser's local
storage; it is separate from iCloud Cookies and App-specific passwords. Use an
HTTPS reverse proxy when accessing the console over an untrusted network.
The Docker image listens on :8081 and also requires ICLOUD_PRIME_API_TOKEN.
Mount a persistent volume at /app/data to preserve accounts, jobs, and quota.
docker run --rm -p 127.0.0.1:8081:8081 \
-e ICLOUD_PRIME_API_TOKEN=REPLACE_WITH_A_LONG_RANDOM_TOKEN \
-v icloud-prime-data:/app/data icloud-prime
API Summary
Account management:
GET /api/accounts
POST /api/accounts
DELETE /api/accounts/:id
POST /api/accounts/:id/password
PUT /api/accounts/:id/cookies
POST /api/accounts/:id/login
Alias management:
POST /api/create
POST /api/create/batch
GET /api/create/jobs?account_id=acc_1
POST /api/create/jobs
POST /api/create/jobs/:id/pause
POST /api/create/jobs/:id/resume
DELETE /api/create/jobs/:id
GET /api/aliases?account_id=acc_1
POST /api/aliases/:id/deactivate
POST /api/aliases/:id/reactivate
DELETE /api/aliases/:id
Mail:
GET /api/inbox?account_id=acc_1&[email protected]&limit=20&days=7
GET /api/messages/:id?account_id=acc_1&folder=INBOX
POST /api/messages
GET /api/mailboxes?account_id=acc_1
See API.md for more detail.
Contributing
Contributions are welcome.
Good first contributions:
- Improve documentation
- Add tests around account file parsing
- Improve error messages
- Improve Windows packaging
- Add screenshots or setup guides
- Report iCloud region compatibility issues
Before opening a PR, read CONTRIBUTING.md.
Maintainer Workflow
The project is maintained through normal open-source workflows:
- Issues for bug reports and feature requests
- Pull requests for code and documentation changes
- GitHub Actions CI for validation
- Tagged releases for downloadable builds
- Security policy for responsible disclosure
This setup is intended to make the project easier to maintain with Codex-assisted triage, review, release, and documentation workflows.
License
MIT. See LICENSE.
探索相关项目
加载中…