Commit Graph
1198 Commits
Author SHA1 Message Date
Jarek Radosz 0fcd2f12dc DEV: Prepare for admin -> discourse/admin rename (#35322)
To simplify our repository architecture, we're moving the admin panel from a separate package(/ember-addon) to a directory inside the main app package. This will make future configuration of tools like typescript/glint, and Vite, much easier. It also means that the admin panel is now transpiled via Webpack, and can internally make use of async-imports and bundle-splitting.

Admin modules will now be referenced like `discourse/admin/...`. Backwards-compatibility is maintained for the old import paths via a custom babel transform.

A 'compatModules' technique is used to keep all of the admin invokables and routes/controllers/templates available to Ember's resolver.
2025-10-20 12:46:11 +01:00
JsBergbau a225da4fd3 DEV: Enhance MyLittleForum importer (#34696)
This extends the **MyLittleForum (MLF) importer** with several optional features to make migrations more complete and reliable.

### New Features (optional via environment variables)
 **Uploads import**: supports attachments and images from the MLF uploads table.  
  - Imported uploads are stored with relative links, ensuring they continue to work even if the forum domain changes.  
- **Legacy link rewriting**: absolute links (`index.php?id=...`) are converted into working Discourse permalinks.  
  - Rewritten links are also created as relative links, so they remain valid after a domain move.  
- **Parent category option**: all imported MLF categories can be placed under a chosen existing category.  
- **Upload repair pass / incremental imports:** already-imported posts can be rescanned to fix broken or newly available upload references, allowing the importer to be run again later with a more up-to-date dataset.  
- **Relaxed upload constraints**: temporarily increases file size limits and allows all extensions during the import step.  

### Other Improvements
- Adjusted for MyLittleForum 2.x schema changes (e.g. `user_location` instead of `user_place`).  
- User import now respects already staged users; avoids errors that would otherwise occur when trying to create them again.  
- Improved BBCode → Markdown conversion: lists and quotes are converted more reliably.  
  - Especially improves handling of quotes at the beginning of posts and ensures following text is not mistakenly included in the quoted block.  
- Thread interlinking restored: legacy links between threads are now rewritten to point to the correct Discourse topics.  

### Environment Variables
- `PARENT_CATEGORY` – import all categories under an existing Discourse category.  
- `REWRITE_LINKS` – rewrite absolute legacy links.  
- `UPLOADS_DIR` – path to the MLF uploads directory (flat namespace).  
- `REPAIR_UPLOAD_LINKS` – repair pass for already-imported posts with links.  
- `LOOSEN_UPLOAD_CONSTRAINTS` – relax upload size/extension checks during import and increases file size limits and allows all extensions during the import step.
2025-10-13 21:23:34 +02:00
David Taylor 288e2e1ccb DEV: Update to latest @glint/ember-tsc (#35337) 2025-10-11 19:40:00 +01:00
Jarek RadoszandLoïc Guitaut 71834c898f DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073)
Co-authored-by: Loïc Guitaut <loic@discourse.org>
2025-10-06 16:11:01 +02:00
Jarek RadoszandLoïc Guitaut a54e3208cb DEV: Hand-pick Rails/WhereNot autofixes (#35117)
We can't enable `Rails/WhereNot` lint/autofix, because it would break
code that uses mini_sql instead of AR (which rubocop, and tbh also we,
can't easily differentiate)

Those are safe because they either:
* are executed in AR model scope definitions
* are clearly chained starting from a AR model
* are less-clearly chained, but still can be traced to a AR model/scope

---------

Co-authored-by: Loïc Guitaut <loic@discourse.org>
2025-10-03 13:29:22 +02:00
Jarek Radosz 60dadd2166 DEV: Remove unnecessary freeze calls (#35064)
All those files have `# frozen_string_literal: true`
2025-09-30 15:36:16 +02:00
Jarek RadoszandLoïc Guitaut e372355fd0 DEV: Clean up scope resolution operators in plugins (#34979)
Co-authored-by: Loïc Guitaut <loic@discourse.org>
2025-09-30 14:36:34 +02:00
David Taylor 1313b4af4c DEV: Relax rules for JS build reuse (#34489)
With this commit, pre-built assets will be fetched and re-used even if
there is a diff on non-js-related files in the core repository
2025-09-26 13:12:28 +01:00
Jay Pfaffman df7c097bea DEV: Change default text color from 'FFF' to 'FFFFFF' in import scripts (#34859) 2025-09-24 14:46:09 +02:00
Jarek Radosz 52e872961a DEV: Clean up requires (#34946)
1. remove unnecessary `.rb` filename suffixes from `require_relative`
calls
2. replace `require File.expand_path(File.dirname(__FILE__) + …` with
`require_relative`
3. remove `./` prefixes from `require_relative` calls
2025-09-24 12:00:22 +02:00
依云 cb53518cea DEV: Some fixes and updates for the FluxBB importer (#34210) 2025-08-20 23:21:05 +02:00
Michał Cichoń a078ec3a2f FIX: Respect database prefix param in SMF2 importer (#34446)
SMF2 importer script accepts the database prefix param (-f) but it is
not properly applied for some of the tables. To fix it, the hardcoded
`smf_` prefix is replaced by `{prefix}` as for other tables in the
importer script.

Affected tables:
- personal_messages 
- pm_recipients
2025-08-20 23:18:21 +02:00
Jarek Radosz 0b5211671c DEV: Update jsconfig (#34285)
to include recently bundled plugins and themes
2025-08-13 21:17:50 +02:00
Ted Johansson 71ea236a79 FIX: Use a valid value for disabling backups using backup_frequency (#34245)
In #33558 we removed automatic_backups_enabled setting, and instead rely on backup_frequency being blank to disable.

There was a big oversight there with the site setting type system, which will coerce the value to an integer. It also makes it so you can't blank the value out in the UI.

This is a "fix forward" solution where instead of "set to blank to disable" we do "set to 0 to disable". This works along the grain of the site setting type system for a workable fix where we don't have to deal with the irreversible migration in the previous change.

We can potentially go and add in "nullable" to the type system at a later point.
2025-08-12 13:19:56 +08:00
Ted Johansson f8bf51441e DEV: Remove automatic_backups_enabled setting (#33558)
We're removing the automatic_backups_enabled toggle and depending solely on the backup_frequency value. This PR replaces the setting and adds a migration for any forum that has automatic_backups_enabled disabled.
2025-08-11 14:56:38 +08:00
Sam e6f9cde35e DEV: update various ai agent configurations (#34192)
Shortened AI agent file, so we conserve tokens
Use symlinks for all agent files where needed to avoid round trips to
llm
Added config for Open AI Codex / Gemini and Cursor
2025-08-11 10:08:41 +10:00
Martin Brennan 7121cfd4ab FEATURE: User preference for editor Markdown monospace font (#34051)
This commit responds to feedback in the Discourse Meta discussion

https://meta.discourse.org/t/monospace-font-in-the-markdown-only-editor/359936

This change introduces a user preference that allows users to choose
whether the Markdown editor uses a monospace font. The default setting
is `true` for new sites, but set to `false` for existing sites to avoid
disrupting current users' experiences.

Admins can change the `default_other_enable_markdown_monospace_font`
site setting to manage this for all users.
2025-08-04 14:56:21 +10:00
David Taylor ac3428f930 FIX: Handle LOAD_PLUGINS=0 in assemble_ember_build.rb (#34029) 2025-08-01 14:49:27 +01:00
Selase Krakani 8e1e54cbc1 FIX: Ensure imported category slug is deduplicate (#34012)
This change ensures the incoming category slug doesn't already exist
2025-08-01 00:06:34 +00:00
David Taylor 59764e43c9 FEATURE: Fetch pre-build JS assets by default (#34009)
Followup to fcaa068b87

Meta announcement: https://meta.discourse.org/t/376700
2025-07-31 17:00:55 +01:00
David Taylor fcaa068b87 DEV: Publish and enable use of pre-built JS assets (#33973)
Building the Discourse ember app is resource-intensive process. This
commit introduces a framework for us to build these assets centrally,
and make them available for people to download.

On every commit to `main`, a new GitHub actions workflow will build
development & production versions of the core assets, and publish them
as a github release under the `discourse/discourse-assets` repository. A
separate repository is being used to avoid polluting the main
`discourse/discourse` repository with one-git-tag-per-release.

The `assemble_ember_build.rb` script is updated to fetch the relevant
asset bundle. Requests are made to `get.discourse.org`, which then
redirects to GitHub releases. This redirection service is being used so
that we have the option to switch away from GitHub releases in future
without breaking existing Discourse installations.

For now, this behavior can be enabled by setting
`DISCOURSE_DOWNLOAD_PRE_BUILT_ASSETS=1`. In the near future, we hope to
make this the default, with opt-out via
`DISCOURSE_DOWNLOAD_PRE_BUILT_ASSETS=0`.
2025-07-31 14:22:51 +01:00
Martin Brennan 77211b43ee FEATURE: Enable rich editor for all users (#33699)
We believe the rich editor is a great experience for the
vast majority of sites and users, so we are enabling it
for all sites and all users by default.

This commit does the following:

* Hides the rich_editor site setting and sets it to true by default.
  It can still be overridden by sites that want to disable it
  completely.
* Sets `rich_editor` to true for all sites to enable the rich editor
  everywhere.
* Adds a new `default_composition_mode` site setting and corresponding
user option that defaults to Rich for all users. The other option is
Markdown.
* Changes the rich editor toggle in the composer to use the new
  database-backed user option (`composition_mode`) instead of a local
  storage key/value store. This makes the preference persistent
  across devices.

Existing key/value store settings for the markdown toggle are
kept, the preference will be saved to the user option automatically.
2025-07-28 10:08:50 +10:00
Selase Krakani 6f73f31a45 FIX: Store context for failed uploads (#33546)
This change makes it easier to review failed uploads, especially
downloadable ones, by standardizing `skip_reason` and adding a
`skip_details` column to the uploads DB's `uploads` table for extended
failure information.
2025-07-24 12:05:32 +00:00
_RahulRakesh d249c46224 Add XenForo direct messages importer with improved recipient handling for XF2.0+ (#31508)
Have tested the import of direct messages on Xenforo 2.3 to Discourse
latest version with half a million conversations.
2025-07-23 21:39:55 +02:00
Gabriel Grubba c31ae4a1bc FIX: Update wrong link to discourse-migratepassword (#33688)
This link should be
https://github.com/communiteq/discourse-migratepassword/
2025-07-17 17:38:09 -04:00
Selase Krakani fb9c25b4b8 FIX: Various optimization step fixes (#33523)
1. Ensure `Creating optimized images...` message is only available
during optimization
2. Guard upload lookup for optimization
3. Replace  undefined `stacktrace` method invocation with `backtrace`
2025-07-10 01:53:29 +00:00
Ruben Oussoren be300f960b fix/ Added default values for category color and text_color (#33479) 2025-07-03 20:16:40 -04:00
Ruben Oussoren a697740929 Add category moderation groups and more attributes to generic importer (#32561)
This PR improves the generic bulk import and base scripts by adding
support for several previously unimplemented features and attributes:

- Category Moderation Groups: Implements the import of group-based
moderation settings for categories.
- Group Attributes: Adds import support for public_admission,
public_exit, allow_membership_requests, and assignable_level.
- User Attributes: Adds import support for trust_level and
primary_group_id.
- User Option: Adds import support for the hide_profile_and_presence
user option.
- Multiple Tag Groups per Tag: Updates tag import logic to handle tags
belonging to multiple tag groups.
2025-07-03 17:03:10 -04:00
Gerhard Schlager 249d9514c8 DEV: Import user title in generic_bulk 2025-06-15 15:56:36 +02:00
Bianca Nenciu 1f2efa7954 FEATURE: Add utilities for importing and exporting backups (#32992)
This commit introduces new features and utilities related to the backup
and restore system that make use of remote URLs:

- `discourse restore` accepts a URL to a backup file

- `discourse backup_url` generates a URL of a backup file (S3 only)

- `discourse import_backup_url` downloads a backup file from a URL to
the configured backup store

This can be used to move content between two Discourse instances by
backing up the entire site, copying the backup URL, importing or
restoring it on the other instance.
2025-06-11 15:44:10 +03:00
Gerhard Schlager e371e1b3cd FIX: Skip importing solved topics when plugin isn't installed (#32922) 2025-05-27 22:08:43 +02:00
Abhiram Shibu e5e775de8b Scripts:Xenforo: Modify importer to use reactions table (#31859)
This PR addresses a problem with the Xenforo importer.

Xenforo has moved from "likes" table and now calls the same table
"reactions" table. Similarly the columns has been also renamed.

With this PR, the importer is upgraded to use the latest naming.

Signed-off-by: Abhiram Shibu <abhiramshibu1998@gmail.com>
2025-05-08 12:55:32 +10:00
Selase Krakani 5702cc9250 DEV: Enable migrated_site flag during bulk imports (#32256)
Extend the `import_site_settings` import step to enable the
`migrated_site` flag if possible.

It also includes an escape hatch via the
`SKIP_MIGRATED_SITE_FLAG_UPDATE` flag for cases where you really don't
want to toggle it on.
2025-04-29 22:00:48 +00:00
Ahmed Gagan 1ede31b704 DEV: Update topic solutions import for new table structure (generic_bulk.rb) (#32051) 2025-04-29 10:43:59 +00:00
Alan Guo Xiang Tan b3389a4cc3 PERF: Set JOBS=1 for low memory build environment (#32326)
This restores the fix in ae2bc240af
2025-04-16 10:14:23 +01:00
David Taylor f3d3c61754 PERF: Reuse existing core JS build where possible (#32311)
Building the Discourse JS app is very resource-intensive. This commit
introduces an `assemble_ember_build` script which will check the
existing content of the `dist/` directory and re-use the core build if
possible. Plugins will always be rebuilt.

For now, this functionality is only useful for multi-stage (i.e.
non-standard) Discourse deployments. But in future, this script may be
extended to pull the contents of the `dist/` directory from a remote
location.
2025-04-15 16:18:22 +01:00
Selase Krakani 9bfb4c005d FIX: Set last_read_post_number for imported watching topic users (#32229)
Ensure `last_read_post_number` is set to the latest post for imported
topic users with a `watching` notification level, even if they haven't
engaged with the topic
2025-04-10 12:35:51 +00:00
Selase Krakani fb5cdb1da4 DEV: Grant all anniversary badges during imports (#31830)
This change adds an import step to retroactively grant anniversary
badges to users.
2025-03-18 10:45:47 +00:00
Kevin Hwang e080712c24 DEV: Support connecting to Redis with a username. (#31710)
Redis / Valkey over TLS requires authentication involving both a
username and a password.

On most instances, the default username is `default`, but this allows
Discourse to provide its own.
2025-03-13 10:39:50 +08:00
Ruben Oussoren a585fc5a24 FIX: Calculate reaction_users_count in the bulk import script (#30964)
`reaction_users_count` should be calculated in the import script instead
of the converter.
2025-02-12 17:29:10 -05:00
Gerhard Schlager eb305e0a98 DEV: Update default config for uploads_importer (#31208) 2025-02-11 16:33:15 +01:00
Gerhard Schlager 9279487079 DEV: Use correct method for creating slugs (#31273)
Empty slugs for topics break Discourse. This makes sure that we always
fall back to "topic" as default. And it also uses the configured slug
generation method instead of always using ASCII.
2025-02-11 16:29:08 +01:00
Renato AtilioandDavid Taylor 0e61565b2b FEATURE: introduce a ProseMirror editor (#30815)
This is the first in a series of PRs to introduce a
ProseMirror-based
WYSIWYM editor experience
alongside our current textarea Markdown editor.

Behind a hidden site setting, this PR adds a toggle to the composer
toolbar, allowing users to switch between the two options.

Our implementation builds upon the excellent ProseMirror and its
non-core Markdown
module, using the
module's schema, parsing, and serialization definitions as the base for
further Discourse-specific features.

An extension API is included to enable further customizations.

The necessary extensions to support all Discourse's core and core
plugins features **will be implemented in subsequent PRs**.

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2025-02-04 14:37:18 -03:00
David Taylor 6d6e9c174d DEV: Switch to 'unstable' glint dependencies (#31169)
This may help to resolve the "ScriptType" errors we're seeing in the
language server
2025-02-04 17:32:00 +00:00
Adam SkalickyandSelase Krakani 6053dc8aa6 FIX: Prevent frozen string error in import scripts (#30325)
Co-authored-by: Selase Krakani <849886+s3lase@users.noreply.github.com>
2025-01-22 22:44:49 +01:00
Ruben Oussoren fba1a483c1 FIX: Avoid loading reactions index when plugin is not installed (#30749)
Adding fix to avoid loading reactions indexes when plugin is not
installed
2025-01-13 17:35:22 -05:00
David Taylor d2ee0609a6 DEV: Remove discourse-common package (#30741)
All modules have now been migrated to `discourse/`
2025-01-13 16:01:51 +00:00
Ruben OussorenandGerhard Schlager 20a16ea231 Adding Import Support for Discourse Reactions Plugin (#30361)
* Adding Import Support for Discourse Reactions Plugin

---------

Co-authored-by: Gerhard Schlager <gerhard.schlager@discourse.org>
2025-01-07 08:58:26 -05:00
Jarek Radoszanddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> affe26f0dd DEV: Update nokogiri to 1.18.1 (#30554)
Nokogiri/libxml is now more strict in terms of params it receives.

It uses kwargs vs options object (I fixed an issue there in #30545) doesn't accept nil/blank html (fixed here) and most importantly handles encoding in a different way. It seems to require explicitly specifying UTF8.

* Build(deps): Bump nokogiri from 1.16.8 to 1.18.1

Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.16.8 to 1.18.1.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.16.8...v1.18.1)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-07 12:05:39 +01:00
Gerhard Schlager 6b3e28216c FEATURE: Allow pausing of restore before DB migration and uploads are restored (#30269)
This can be helpful if you need to fix problems in the DB before the DB gets migrated as well as before uploads are restored.
2024-12-16 12:50:08 +01:00