This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch release/v1.3
in repository https://gitbox.apache.org/repos/asf/texera.git


The following commit(s) were added to refs/heads/release/v1.3 by this push:
     new 10827b7c3b fix(v1.3): strip the development forum's accounts and 
sessions from the Flarum seed (#9130)
10827b7c3b is described below

commit 10827b7c3b5d00c4813052c407979034a1eabbe4
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sun Oct 25 03:55:51 2026 +0000

    fix(v1.3): strip the development forum's accounts and sessions from the 
Flarum seed (#9130)
    
    ### What changes were proposed in this PR?
    
    Automated backport of #9127 to `release/v1.3`.
    
    Source: d108cc19fda36c7b8aa1b68dfc934c1c3563b99b · [automation
    run](https://github.com/apache/texera/actions/runs/40155367470)
    
    ### Any related issues, documentation, discussions?
    
    Backport of #9127. Originally linked #9126.
    
    ### How was this PR tested?
    
    The backported tree built green before #9127 merged. Release-branch CI
    runs on this PR once it is reopened — see the comment below.
    
    ### Was this PR authored or co-authored using generative AI tooling?
    
    No.
    
    Co-authored-by: Meng Wang <[email protected]>
---
 bin/README.md                                      |  2 +-
 bin/extend.php                                     | 27 ++++++++++++++++++++++
 bin/forum/flarum.sql                               |  7 ++----
 bin/forum/macos-install.sh                         |  1 +
 bin/forum/ubuntu-install.sh                        |  1 +
 .../service/user/flarum/flarum.service.spec.ts     |  2 +-
 .../service/user/flarum/flarum.service.ts          | 12 ++++------
 7 files changed, 37 insertions(+), 15 deletions(-)

diff --git a/bin/README.md b/bin/README.md
index 7dd25dc35a..4bbe7c5cc4 100644
--- a/bin/README.md
+++ b/bin/README.md
@@ -85,5 +85,5 @@ binary `NOTICE`/`LICENSE` files (`audit_jar_licenses.py`,
 | `pylsp/` | Dockerized Python language server used by the UDF editor. |
 | `y-websocket-server/` | Dockerized Yjs websocket server backing 
collaborative editing. |
 | `forum/` | Flarum-based community forum setup (install scripts and seed 
SQL). |
-| `config.php`, `.htaccess` | Flarum runtime config and Apache rewrite rules 
for the forum. |
+| `config.php`, `extend.php`, `.htaccess` | Flarum runtime config, extenders, 
and Apache rewrite rules for the forum. |
 | `litellm-config.yaml` | LiteLLM proxy configuration for AI features. |
diff --git a/bin/extend.php b/bin/extend.php
new file mode 100644
index 0000000000..11328a914b
--- /dev/null
+++ b/bin/extend.php
@@ -0,0 +1,27 @@
+<?php
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use Flarum\Extend;
+
+// The Texera dashboard signs users up to the forum through Flarum's API
+// (FlarumService.register). Flarum exempts only its login route from CSRF
+// checks, so exempt the sign-up route too. Whether anyone may sign up is still
+// decided by the forum's allow_sign_up setting.
+return [
+    (new Extend\Csrf())->exemptRoute('users.create'),
+];
diff --git a/bin/forum/flarum.sql b/bin/forum/flarum.sql
index 743b730eac..857ce2211a 100644
--- a/bin/forum/flarum.sql
+++ b/bin/forum/flarum.sql
@@ -66,7 +66,6 @@ CREATE TABLE `access_tokens` (
 
 LOCK TABLES `access_tokens` WRITE;
 /*!40000 ALTER TABLE `access_tokens` DISABLE KEYS */;
-INSERT INTO `access_tokens` VALUES 
(1,'IgO67IH27IxOvvtgXvET4KHleDvf5TjEmGxSp14r',1,'2023-09-30 
20:58:55','2023-09-30 
20:58:55','session_remember',NULL,NULL,NULL),(3,'4r7sjWlKaN9uEH45Fh2AyDXtrMjficVfUUqJ8dhe',1,'2023-09-30
 21:27:35','2023-09-30 
21:27:35','session_remember',NULL,'::1','PostmanRuntime/7.32.3'),(4,'YCA69PvpLrUj8EKaRewSRPxzl16TjBPWOoO43EyG',1,'2023-09-30
 21:27:57','2023-09-30 21:27:57','session_remember',NULL,'::1','Mozilla/5.0 
(Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/ [...]
 /*!40000 ALTER TABLE `access_tokens` ENABLE KEYS */;
 UNLOCK TABLES;
 
@@ -98,7 +97,6 @@ CREATE TABLE `api_keys` (
 
 LOCK TABLES `api_keys` WRITE;
 /*!40000 ALTER TABLE `api_keys` DISABLE KEYS */;
-INSERT INTO `api_keys` VALUES 
('hdebsyxiigyklxgsqivyswwiisohzlnezzzzzzzz',1,NULL,NULL,NULL,'2023-09-30 
21:19:35','2023-10-01 04:14:27');
 /*!40000 ALTER TABLE `api_keys` ENABLE KEYS */;
 UNLOCK TABLES;
 
@@ -187,7 +185,6 @@ CREATE TABLE `discussion_views` (
 
 LOCK TABLES `discussion_views` WRITE;
 /*!40000 ALTER TABLE `discussion_views` DISABLE KEYS */;
-INSERT INTO `discussion_views` VALUES (1,4,5,'128.195.14.114','2024-01-09 
00:41:35'),(6,NULL,5,'128.195.14.114','2024-01-09 03:15:01');
 /*!40000 ALTER TABLE `discussion_views` ENABLE KEYS */;
 UNLOCK TABLES;
 
@@ -720,7 +717,7 @@ CREATE TABLE `posts` (
 
 LOCK TABLES `posts` WRITE;
 /*!40000 ALTER TABLE `posts` DISABLE KEYS */;
-INSERT INTO `posts` VALUES (2,2,1,'2023-10-09 
19:31:56',1,'comment','<t><p>idk</p></t>',NULL,NULL,NULL,NULL,'::1',0,1,0,0),(3,3,1,'2023-10-09
 19:46:22',1,'comment','<r><p><STRONG><s>**</s>sxxbnsb 
nxsbxsxnsx<e>**</e></STRONG></p></r>',NULL,NULL,NULL,NULL,'::1',0,1,0,1),(4,3,2,'2023-10-09
 
19:46:54',1,'comment','<t><p>fjyfj</p></t>',NULL,NULL,NULL,NULL,'::1',0,1,0,1),(5,3,3,'2023-10-09
 19:47:12',1,'comment','<r> <p><USERMENTION displayname=\"myAdmin\" 
id=\"1\">@myAdmin</USERMENTION></p> \n< [...]
+INSERT INTO `posts` VALUES (2,2,1,'2023-10-09 
19:31:56',1,'comment','<t><p>idk</p></t>',NULL,NULL,NULL,NULL,NULL,0,1,0,0),(3,3,1,'2023-10-09
 19:46:22',1,'comment','<r><p><STRONG><s>**</s>sxxbnsb 
nxsbxsxnsx<e>**</e></STRONG></p></r>',NULL,NULL,NULL,NULL,NULL,0,1,0,1),(4,3,2,'2023-10-09
 
19:46:54',1,'comment','<t><p>fjyfj</p></t>',NULL,NULL,NULL,NULL,NULL,0,1,0,1),(5,3,3,'2023-10-09
 19:47:12',1,'comment','<r> <p><USERMENTION displayname=\"myAdmin\" 
id=\"1\">@myAdmin</USERMENTION></p> \n</r> [...]
 /*!40000 ALTER TABLE `posts` ENABLE KEYS */;
 UNLOCK TABLES;
 
@@ -932,7 +929,7 @@ CREATE TABLE `users` (
 
 LOCK TABLES `users` WRITE;
 /*!40000 ALTER TABLE `users` DISABLE KEYS */;
-INSERT INTO `users` VALUES 
(1,'myAdmin',NULL,'[email protected]',1,'$2a$10$0raoWm.MtGloDa95/CDgne54rX9uoa4RlmeoCA.ce9V1axfIHECSK',NULL,NULL,'2023-09-30
 20:58:55','2024-01-09 03:24:06',NULL,'2023-10-17 03:07:23',3,49,'2023-10-16 
06:52:14',NULL,NULL,NULL,0),(4,'[email protected]',NULL,'[email protected]',1,'$2a$10$63ISJ9VtBtA7R33QqNWLxeqb9Qqg97nq6D8E4sSAfIiquLcSO9XHC',NULL,NULL,NULL,'2024-01-09
 
00:51:18',NULL,NULL,1,1,NULL,NULL,NULL,NULL,0),(6,'[email protected]',NULL,'[email protected]',
 [...]
+INSERT INTO `users` VALUES 
(1,'myAdmin',NULL,'[email protected]',1,'',NULL,NULL,'2023-09-30 
20:58:55','2024-01-09 03:24:06',NULL,'2023-10-17 03:07:23',3,49,'2023-10-16 
06:52:14',NULL,NULL,NULL,0),(4,'user4',NULL,'[email protected]',1,'',NULL,NULL,NULL,'2024-01-09
 
00:51:18',NULL,NULL,1,1,NULL,NULL,NULL,NULL,0),(6,'user6',NULL,'[email protected]',1,'',NULL,NULL,NULL,'2024-01-09
 02:54:23',NULL,'2024-01-09 02:55:22',0,0,NULL,NULL,NULL,NULL,0);
 /*!40000 ALTER TABLE `users` ENABLE KEYS */;
 UNLOCK TABLES;
 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
diff --git a/bin/forum/macos-install.sh b/bin/forum/macos-install.sh
index f38b0b972d..a33002228c 100755
--- a/bin/forum/macos-install.sh
+++ b/bin/forum/macos-install.sh
@@ -29,6 +29,7 @@ composer create-project flarum/flarum 
/opt/homebrew/var/www/flarum
 composer require --working-dir=/opt/homebrew/var/www/flarum 
michaelbelgium/flarum-discussion-views
 composer require --working-dir=/opt/homebrew/var/www/flarum fof/byobu:"*"
 cp config.php /opt/homebrew/var/www/flarum/config.php
+cp extend.php /opt/homebrew/var/www/flarum/extend.php
 cp .htaccess /opt/homebrew/var/www/flarum/public/.htaccess
 
 # Database Configuration
diff --git a/bin/forum/ubuntu-install.sh b/bin/forum/ubuntu-install.sh
index e4d7c11952..bd96434507 100755
--- a/bin/forum/ubuntu-install.sh
+++ b/bin/forum/ubuntu-install.sh
@@ -32,6 +32,7 @@ composer create-project flarum/flarum /opt/flarum
 composer require --working-dir=/opt/flarum 
michaelbelgium/flarum-discussion-views
 composer require --working-dir=/opt/flarum fof/byobu:"*"
 sudo cp bin/config.php /opt/flarum/config.php
+sudo cp bin/extend.php /opt/flarum/extend.php
 sudo cp bin/.htaccess /opt/flarum/public/.htaccess
 sudo chown -R www-data:www-data /opt/flarum
 sudo mysql -u root -p < sql/flarum.sql
diff --git 
a/frontend/src/app/dashboard/service/user/flarum/flarum.service.spec.ts 
b/frontend/src/app/dashboard/service/user/flarum/flarum.service.spec.ts
index 76ac6a0f0e..b8754dee8b 100644
--- a/frontend/src/app/dashboard/service/user/flarum/flarum.service.spec.ts
+++ b/frontend/src/app/dashboard/service/user/flarum/flarum.service.spec.ts
@@ -58,7 +58,7 @@ describe("FlarumService", () => {
         email: "[email protected]",
         password: "secret-token",
       });
-      expect(req.request.headers.get("Authorization")).toContain("Token ");
+      expect(req.request.headers.has("Authorization")).toBe(false);
       req.flush({});
     });
 
diff --git a/frontend/src/app/dashboard/service/user/flarum/flarum.service.ts 
b/frontend/src/app/dashboard/service/user/flarum/flarum.service.ts
index 3e2722621b..98da83eaca 100644
--- a/frontend/src/app/dashboard/service/user/flarum/flarum.service.ts
+++ b/frontend/src/app/dashboard/service/user/flarum/flarum.service.ts
@@ -32,15 +32,11 @@ export class FlarumService {
 
   register() {
     const user = this.userService.getCurrentUser();
-    return this.http.post(
-      "forum/api/users",
-      {
-        data: {
-          attributes: { username: user!.email.split("@")[0] + user!.uid, 
email: user!.email, password: user!.googleId },
-        },
+    return this.http.post("forum/api/users", {
+      data: {
+        attributes: { username: user!.email.split("@")[0] + user!.uid, email: 
user!.email, password: user!.googleId },
       },
-      { headers: { Authorization: "Token 
hdebsyxiigyklxgsqivyswwiisohzlnezzzzzzzz;userId=1" } }
-    );
+    });
   }
 
   auth() {

Reply via email to