Skip to content

fix: strip the development forum's accounts and sessions from the Flarum seed - #9127

Merged
mengw15 merged 1 commit into
apache:mainfrom
mengw15:fix/9126-flarum-seed-dev-data
Oct 25, 2026
Merged

mengw15 merged 1 commit into
apache:mainfrom
mengw15:fix/9126-flarum-seed-dev-data

Conversation

@mengw15

@mengw15 mengw15 commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

bin/forum/flarum.sql was dumped from a development forum and still held its member accounts, login sessions, visit logs with IP addresses, and an API key that the dashboard's forum sign-up sent.

  • flarum.sql: the three seeded accounts get placeholder emails (@example.com) and no password, so their posts stay but nobody can sign in as them. The sessions, the API key and the visit log are dropped, and the posts' IP addresses are cleared.
  • Sign-up without the key: the seed already allows open sign-up (allow_sign_up = 1), so the key only let FlarumService.register skip Flarum's CSRF check. The new bin/extend.php exempts the sign-up route instead (by default Flarum exempts only login), and both install scripts copy it into the forum.

Any related issues, documentation, discussions?

Closes #9126. Independent of #9005, which is under discussion in #9006.

How was this PR tested?

  • flarum.service.spec.ts now checks that sign-up sends no Authorization header. It passes, and fails against the old service.
  • On Flarum 1.8.5 (the seed's version) with the cleaned seed: the seed imports, sign-up then login works with extend.php, sign-up is rejected by the CSRF check without it, and the seeded accounts cannot sign in.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (claude-opus-5-5)

…rum seed

bin/forum/flarum.sql was dumped from a development forum and still held its
member accounts, login sessions, visit logs with IP addresses, and an API key
that the dashboard's forum sign-up sent. Give the seeded accounts placeholder
emails and no password, drop the sessions, the API key and the visit log, and
clear the posts' IP addresses.

Sign-up does not need the key: the seed already allows open sign-up, so the
key only let FlarumService.register skip Flarum's CSRF check. bin/extend.php
exempts the sign-up route instead, and both install scripts copy it into the
forum.
@github-actions github-actions Bot added ddl-change Changes to the TexeraDB DDL fix frontend Changes related to the frontend GUI docs Changes related to documentations infra labels Oct 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Committers with relevant context: @parshimers
    You can request their reviews formally with /request-review @parshimers.

  • Contributors with relevant context: @aglinxinyuan, @Yicong-Huang, @Ma77Ball
    You can notify them by mentioning @aglinxinyuan, @Yicong-Huang, @Ma77Ball in a comment.

@Yicong-Huang Yicong-Huang added release/v1.3 back porting to release/v1.3 release/v1.2 back porting to release/v1.2 labels Oct 24, 2026
@github-actions
github-actions Bot requested a review from xuang7 October 24, 2026 21:29
@github-actions

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. A release/* label nominates a backport target; the branch's release manager approving this PR is what sends the fix there. The required Backport Approvals check stays red until every label below is approved, so each manager either approves or removes their own label — which is why the labels left on a merged PR are exactly the branches it reached.

Release branch Analysis
✅ release/v1.3 Change detected on this branch — label added; this fix is queued to backport here.
✅ release/v1.2 Change detected on this branch — label added; this fix is queued to backport here. @xuang7 decides: approving sends the fix here, removing this label declines it. The merge waits on one or the other. Review requested.

Auto-label run.

@codecov-commenter

codecov-commenter commented Oct 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.80%. Comparing base (98c6337) to head (d103ec1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9127      +/-   ##
============================================
+ Coverage     91.87%   92.80%   +0.92%     
- Complexity     5049     6309    +1260     
============================================
  Files          1265     1278      +13     
  Lines         54915    67060   +12145     
  Branches       6940     9349    +2409     
============================================
+ Hits          50453    62233   +11780     
- Misses         2769     2982     +213     
- Partials       1693     1845     +152     
Flag Coverage Δ *Carryforward flag
access-control-service 79.63% <ø> (+2.25%) ⬆️
agent-service 99.16% <ø> (ø) Carriedforward from 98c6337
amber 87.93% <ø> (+1.86%) ⬆️
computing-unit-managing-service 62.70% <ø> (+2.22%) ⬆️
config-service 90.51% <ø> (+3.13%) ⬆️
file-service 83.58% <ø> (+1.57%) ⬆️
frontend 96.89% <100.00%> (+0.39%) ⬆️
notebook-migration-service 85.63% <ø> (+1.90%) ⬆️
pyamber 98.54% <ø> (ø) Carriedforward from 98c6337
workflow-compiling-service 73.77% <ø> (+1.33%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Freshly seeded forums have no usable administrator, and neither installer provisions a replacement.

No open issues 🎉

What changed in this PR

This PR sanitizes the development Flarum seed while preserving Texera’s optional forum integration and existing posts.

Changes:

  • Removes seeded credentials, sessions, visit logs, and post IP addresses.
  • Replaces API-key-based registration with a signup-route CSRF exemption installed by both setup scripts.
  • Updates the registration test and documents the new extender file.
File Description
frontend/​src/​app/​dashboard/​service/​user/​flarum/​flarum.service.ts Removes the hard-coded registration authorization header.
frontend/​src/​app/​dashboard/​service/​user/​flarum/​flarum.service.spec.ts Checks that registration sends no authorization header.
bin/​README.md Lists the Flarum extender file.
bin/​forum/​ubuntu-install.sh Copies the extender into Ubuntu installations.
bin/​forum/​macos-install.sh Copies the extender into macOS installations.
bin/​forum/​flarum.sql Sanitizes accounts and removes authentication and IP data.
bin/​extend.php Exempts the signup route from CSRF checks.

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 1 better · 🔴 4 worse · ⚪ 10 noise (<±5%) · 0 without baseline

Compared against main 98c6337 benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🟢 bs=10 sw=10 sl=64 563 0.343 16,777/23,319/23,319 us 🟢 -5.4% / 🔴 +63.8%
🔴 bs=100 sw=10 sl=64 1,217 0.743 81,208/102,627/102,627 us 🔴 +6.3% / 🟢 -8.7%
🔴 bs=1000 sw=10 sl=64 1,374 0.838 717,755/826,779/826,779 us 🔴 +8.5% / 🟢 -17.8%
Baseline details

Latest main 98c6337 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 563 tuples/sec 554 tuples/sec 879.16 tuples/sec +1.6% -36.0%
bs=10 sw=10 sl=64 MB/s 0.343 MB/s 0.338 MB/s 0.537 MB/s +1.5% -36.1%
bs=10 sw=10 sl=64 p50 16,777 us 17,731 us 11,504 us -5.4% +45.8%
bs=10 sw=10 sl=64 p95 23,319 us 24,279 us 14,234 us -4.0% +63.8%
bs=10 sw=10 sl=64 p99 23,319 us 24,279 us 17,338 us -4.0% +34.5%
bs=100 sw=10 sl=64 throughput 1,217 tuples/sec 1,222 tuples/sec 1,147 tuples/sec -0.4% +6.1%
bs=100 sw=10 sl=64 MB/s 0.743 MB/s 0.746 MB/s 0.7 MB/s -0.4% +6.1%
bs=100 sw=10 sl=64 p50 81,208 us 80,508 us 88,987 us +0.9% -8.7%
bs=100 sw=10 sl=64 p95 102,627 us 96,524 us 96,473 us +6.3% +6.4%
bs=100 sw=10 sl=64 p99 102,627 us 96,524 us 102,791 us +6.3% -0.2%
bs=1000 sw=10 sl=64 throughput 1,374 tuples/sec 1,395 tuples/sec 1,182 tuples/sec -1.5% +16.3%
bs=1000 sw=10 sl=64 MB/s 0.838 MB/s 0.851 MB/s 0.721 MB/s -1.5% +16.2%
bs=1000 sw=10 sl=64 p50 717,755 us 716,550 us 872,751 us +0.2% -17.8%
bs=1000 sw=10 sl=64 p95 826,779 us 761,914 us 910,151 us +8.5% -9.2%
bs=1000 sw=10 sl=64 p99 826,779 us 761,914 us 941,479 us +8.5% -12.2%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,355.52,200,128000,563,0.343,16777.43,23319.21,23319.21
1,100,10,64,20,1643.91,2000,1280000,1217,0.743,81207.69,102627.22,102627.22
2,1000,10,64,20,14559.44,20000,12800000,1374,0.838,717755.28,826779.49,826779.49

@aglinxinyuan aglinxinyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mengw15
mengw15 added this pull request to the merge queue Oct 25, 2026
Merged via the queue into apache:main with commit d108cc1 Oct 25, 2026
96 of 125 checks passed
@mengw15
mengw15 deleted the fix/9126-flarum-seed-dev-data branch October 25, 2026 02:40
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened: #9130 (#9130) to release/v1.3 — the cherry-pick was clean, so it is ready for review, waiting on @mengw15. It needs to be reopened once to start its checks; the PR says how.

@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened: draft #9131 (#9131) to release/v1.2, assigned to @mengw15 — needs manual work because the cherry-pick conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ddl-change Changes to the TexeraDB DDL docs Changes related to documentations fix frontend Changes related to the frontend GUI infra release/v1.2 back porting to release/v1.2 release/v1.3 back porting to release/v1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Strip the development forum's accounts and sessions from the Flarum seed

6 participants