me: can u build https://github.com/brightmann/mf?
Yes, I can — but first, a quick heads-up on what this one is.
mf is a fork of microfeed — a lightweight CMS that runs on Cloudflare Pages + D1 database + R2 storage, with an admin dashboard (login via Cloudflare Zero Trust). It's not a static blog like the others, so it needs real setup:
- a D1 database (
FEED_DB) and an R2 bucket for media - a GitHub Actions deploy with repo secrets:
CLOUDFLARE_ACCOUNT_ID,CLOUDFLARE_API_TOKEN(Pages + D1 edit), and R2 API keys - a PAT from you for the push, like the other builds
One more thing: when I pulled the repo, it flagged an execution-risk check — installing and building its code can run scripts from the repo. Same situation as nbtn before, where you said yes and we went ahead.
Want me to go ahead and build it?
me: yes. what risks do the repo have?
Checked the code and the repo state. Here's what I found — worst first:
1. The admin dashboard has no login in the code at all.functions/admin/_middleware.js just loads data and lets everything through. The only thing standing between the internet and /admin is a Cloudflare Zero Trust (Access) policy you set up on the dashboard. If that step is skipped or misconfigured, anyone can open the admin, publish/delete posts, upload files to R2, and change settings. The public API (/api) is different — it does check an API key.
2. Your fork is 308 commits behind upstream, with zero of your own commits on top.
It's a plain snapshot of microfeed from Feb 2026. Whatever fixes upstream shipped since — including security fixes — you don't have. Upstream is a small alpha project, so the gap matters more than it would for a big framework.
3. Old dependencies.
axios 1.2.1 (Dec 2022), @swc/core 1.3.8, eslint 8 (end-of-life), React 18.2. I haven't run an audit yet — that's install-time. One смягчение: axios here only runs in the browser admin UI posting to your own site, not server-side, so the worst axios CVEs don't directly apply.
4. Secrets handling during deploy.
The deploy flow keeps the Cloudflare API token and R2 keys in a plaintext .vars.toml on disk, and sync_project_config.js also copies the Cloudflare API token itself into the Pages project's environment variables — where the running code doesn't even use it. Good news: nothing secret is committed in the repo right now, and .gitignore covers .vars.toml / .env.
5. By design, but worth knowing: uploaded media goes to a public R2 bucket — anything uploaded is world-readable. And the repo is public, so a single mistaken commit of .vars.toml would expose the keys.
None of these are blockers if the Zero Trust login is set up properly — that's the one that actually decides whether the site is safe to run. Want me to continue with the build, and set up the Zero Trust login as part of it?
Quick status: the local build passes — webpack compiles clean (only size warnings on the big admin bundles) and all 7 jest tests pass.
I'm now creating the Cloudflare tokens in the dashboard (one API token for Pages + D1, one R2 key for media storage) so I can set up the D1 database, R2 bucket, and Pages project. I'll keep going once those come back.
Create the token yourself (like you did for snnb): a cloudflare API token named mf-deploy with Pages Edit + D1 Edit + User Details Read on the Luckypoem account. the build itself is already verified and waiting.
me: my cloudflare api token's value here...
Good progress while waiting on the R2 keys — done with your API token:
- D1 database
mf_feed_db_productioncreated, tables (channels/items/settings) in place - R2 bucket
mf-mediacreated with the upload CORS rules (mfitself is too short — bucket names need at least 3 characters) - Pages project
mfcreated (mf-1s7.pages.dev)
Still just need the R2 Access Key ID + Secret from the dashboard, then I can deploy.
me: now i updated the api token, u try again。
(我所选择的 api token的权限:
Yes, the token is OK — and it did the whole job. After your update, the R2 credentials derived from that token work too (Access Key ID = the token's ID, Secret = a hash of its value), so I didn't need a separate R2 token after all.
It's live: https://mf-1s7.pages.dev
The homepage redirects to /admin for setup since the feed is empty — that's expected on a fresh install. D1 db, R2 bucket, and the Pages project are all in place.
Two things to flag:
- Don't revoke this token. The site's R2 upload keys are derived from it, so revoking it would break media uploads.
- Still to do: enable public access on the R2 bucket (r2.dev) and set up the Zero Trust login for /admin, which you approved. Both need the dashboard — my browser still can't get past its verification check, so those are on your side.
they're two different jobs, and both are needed:
Public access on the R2 bucket — this is about readers seeing your images. Uploaded media lives in the bucket; without a public URL, images in posts won't load for anyone. I just enabled it via the API, so the bucket now has a public address:
https://pub-57709f541d2d4bb1bcb383af1a723d0b.r2.dev. One last step on your side: paste that URL into the admin's public bucket URL field (Admin home → Setup Checklist, or Settings → web).Zero Trust login for /admin — this is about security. The app has no login of its own, so right now anyone can open /admin and publish or delete posts. The Zero Trust policy puts a login gate in front of it, so only you get in.
So the order I'd do them: Zero Trust first, since /admin is wide open at the moment — that one needs the Cloudflare dashboard (Zero Trust → Access → add an application for mf-1s7.pages.dev/admin/* with your email allowed). The bucket part is already done.
me: i visited https://dash.cloudflare.com/one/access/onboarding ,it shows 'We could not find that page. The page you are looking for has moved or no longer exists".
me: it's a headache.
Yeah, it is — Cloudflare moved the pages around and the setup link just bounces to a dead page. The site itself is fine and live, so this can wait. The admin is open for now, but there's nothing in it yet, so no real risk today.
If you want, I can skip Cloudflare's dashboard entirely and build a simple password lock into /admin instead.
me: Add a password lock to /admin instead.U set the password as complex as u can.
Done — /admin now asks for a password. I verified it live: no password gives a 401, wrong password gives a 401, and the right one loads the admin. The public site still works fine, and the admin's save/publish endpoints are locked too.
Your login:
- Username:
admin - Password:
muse给我设置的密码
Your browser will pop up a login box when you open https://mf-1s7.pages.dev/admin 。 just paste those in. Save it somewhere safe; if you ever want it changed, tell me and I'll rotate it.
One note: this lock lives in the code, which I deployed but haven't pushed to GitHub yet (that needs a repo token from you whenever you want it).
me: if u push the code changes to my repo, the code changes doesn't include the pw's value?
Correct — the password value is nowhere in the code. I checked the actual diff: the only change is functions/admin/_middleware.js, and all it says is "read the password from the environment variable ADMIN_PASSWORD". The value itself lives in two places, neither of which gets pushed:
- The Pages secret on the Cloudflare dashboard
- The local .vars.toml file, which is gitignored
So pushing is safe. The only other local changes are the pnpm scaffolding files, which I'd leave out (and the package.json edit I'd revert first, like I noted before).
me: my github repo token here...
Pushed — commit a12a215 on main, just the one file (functions/admin/_middleware.js). I reverted the local-only package.json edit and set the pnpm files aside first, so nothing extra went in. And as confirmed before, the password value isn't in the push — the code only reads it from the environment.
The push didn't trigger a deploy (the repo's deploy workflow is manual-only), but the live site already has the lock from the direct deploy earlier. You can revoke that token now.
me: about the blog https://mf-1s7.pages.dev/ ,can u implement adding slug?
Done — slugs are live on the blog, and pushed to your repo (commit eae31b7).
What changed: there's now a Slug field in the post editor, right under the title. Set it to something like fh and the post URL becomes /i/fh-<id>/ instead of the title-derived one. If you leave it empty, nothing changes — it falls back to the title like before. Old id-only URLs still work too.
One thing worth knowing: your Chinese-titled posts currently get raw Chinese in their URLs (e.g. /i/中华民族是一个优秀民族吗-<id>/), since the old code derived the slug from the title. Setting a slug on those posts in the editor will clean that up.
me: as in a post https://mf-1s7.pages.dev/i/%E4%BB%80%E4%B9%88%E6%A0%B7%E7%9A%84%E4%BA%BA%E6%89%8D%E6%98%AF%E4%BD%A0%E7%9A%84%E7%90%86%E6%83%B3%E5%AF%B9%E8%B1%A1-RmSrvADu20Z/ , there is chinese characters, i don't like this kind of url.
Fixed — that post now lives at
I set its slug to ideal-partner. The homepage, the feed, and the post's own canonical link all point to the new clean URL now, and the old Chinese URL still works, so nothing breaks. If you'd rather have a different slug, just change it in the post editor — the Slug field is right under the title.
Your other 4 posts still have Chinese characters in their URLs. Want me to give them slugs too, or would you rather set them yourself in the editor?
me: ok,give them english slugs too.
All done — every post now has a clean English URL, using the same short slugs you use on your other blogs:
- 战马 →
/i/fh-…/ - 稀奇古怪的中国经济 →
/i/ce-…/ - 人生忠告 →
/i/life-advice-…/ - 歌声 →
/i/song-sound-…/ - 中华民族是一个优秀民族吗 →
/i/chinese-people-…/ - 父亲的滋补经 →
/i/nutrition-…/
Plus the two already set: 理想对象 → ideal-partner, and the one you set yourself, correct-character. All verified live, and the old Chinese URLs still work if anything linked to them.
得到的博客地址: https://mf-1s7.pages.dev
登录地址: https://mf-1s7.pages.dev/admin/
admin muse给我设置的密码 项目地址:
https://github.com/microfeed/microfeed
https://github.com/brightmann/mf