trek 2.6.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AGENTS.md +12 -11
- data/CHANGELOG.md +51 -0
- data/Gemfile.lock +124 -126
- data/Makefile +7 -1
- data/README.md +17 -21
- data/app/components/trek/form/content_editor_component/content_editor_component.css +4 -8
- data/app/components/trek/form/image_field_component/image_field_component.js +1 -2
- data/app/components/trek/form/password_strength_component/password_strength_component.css +2 -0
- data/app/components/trek/form/sound_field_component/sound_field_component.js +1 -2
- data/app/components/trek/security_check_component/security_check_component.css +69 -0
- data/app/components/trek/security_check_component/security_check_component.html.slim +19 -0
- data/app/components/trek/security_check_component/security_check_component.js +15 -0
- data/app/components/trek/security_check_component.rb +19 -0
- data/app/content/trek/content/cleaner.rb +1 -1
- data/app/content/trek/content/list_item.rb +1 -1
- data/app/content/trek/content/paragraph.rb +7 -2
- data/app/controllers/concerns/trek/auditable.rb +5 -2
- data/app/controllers/concerns/trek/localization.rb +6 -2
- data/app/jobs/trek/purge_expired_sign_in_codes_job.rb +15 -0
- data/app/policies/trek/security_check_policy.rb +8 -0
- data/app/uploaders/image_uploader.rb +77 -15
- data/config/locales/trek.en.yml +71 -0
- data/config/locales/trek.fr.yml +71 -0
- data/docs/.vitepress/config.mjs +1 -0
- data/docs/background-jobs.md +10 -5
- data/docs/deploy.md +69 -6
- data/docs/getting-started.md +15 -17
- data/docs/index.md +1 -1
- data/docs/personal-data.md +61 -0
- data/docs/proxies.md +2 -2
- data/docs/reference/components.md +2 -2
- data/docs/reference/concerns/fragmentable.md +12 -6
- data/docs/reference/concerns/orderable.md +2 -2
- data/docs/reference/concerns/search-engine-optimizable.md +1 -1
- data/docs/reference/concerns/searchable.md +14 -1
- data/docs/reference/concerns/sectionable.md +7 -3
- data/docs/reference/concerns/versionable.md +1 -1
- data/docs/reference/controllers.md +33 -1
- data/docs/reference/environment-variables.md +2 -2
- data/docs/reference/formatters.md +2 -1
- data/docs/reference/forms.md +6 -3
- data/docs/reference/generators/admin-user.md +1 -1
- data/docs/reference/generators/audit-log.md +12 -13
- data/docs/reference/generators/install.md +20 -9
- data/docs/reference/generators/public-accounts.md +21 -3
- data/docs/reference/generators/scaffold.md +28 -9
- data/docs/reference/generators/security-headers.md +4 -3
- data/docs/reference/generators/taxonomies.md +1 -1
- data/docs/reference/icons.md +5 -3
- data/docs/reference/index.md +10 -8
- data/docs/reference/models/current.md +5 -3
- data/docs/reference/models/page-version.md +1 -1
- data/docs/reference/models/user.md +5 -8
- data/docs/reference/uploaders.md +25 -0
- data/docs/reference/validators.md +1 -1
- data/docs/security.md +30 -9
- data/docs/what-is-trek.md +3 -3
- data/lib/generators/trek/USAGE +1 -1
- data/lib/generators/trek/audit_log_generator.rb +8 -0
- data/lib/generators/trek/helpers.rb +17 -0
- data/lib/generators/trek/install/admin/routes_generator.rb +2 -1
- data/lib/generators/trek/install/admin/security_check_generator.rb +36 -0
- data/lib/generators/trek/install/ci_generator.rb +19 -0
- data/lib/generators/trek/install/postcss_generator.rb +1 -2
- data/lib/generators/trek/install/translations_generator.rb +1 -2
- data/lib/generators/trek/install_generator.rb +8 -7
- data/lib/generators/trek/public_accounts_generator.rb +34 -7
- data/lib/generators/trek/scaffold_generator.rb +22 -21
- data/lib/generators/trek/scalingo_generator.rb +13 -1
- data/lib/generators/trek/templates/.gitlab-ci.yml +10 -1
- data/lib/generators/trek/templates/AGENTS.md +2 -2
- data/lib/generators/trek/templates/Makefile +1 -0
- data/lib/generators/trek/templates/config/i18n-tasks.yml.erb +0 -8
- data/lib/generators/trek/templates/controllers/admin/security_checks_controller.rb +11 -0
- data/lib/generators/trek/templates/controllers/concerns/trek/authentication.rb +13 -4
- data/lib/generators/trek/templates/initializers/good_job.rb.tt +7 -5
- data/lib/generators/trek/templates/layouts/admin.html.slim +5 -0
- data/lib/generators/trek/templates/policies/security_check.rb +4 -0
- data/lib/generators/trek/templates/public_accounts/api/controllers/sessions_controller.rb.tt +13 -1
- data/lib/generators/trek/templates/public_accounts/api/controllers/sign_in_codes_controller.rb.tt +5 -0
- data/lib/generators/trek/templates/public_accounts/jobs/sign_in_code_job.rb.tt +10 -0
- data/lib/generators/trek/templates/public_accounts/locales/accounts.en.yml.tt +10 -0
- data/lib/generators/trek/templates/public_accounts/locales/accounts.fr.yml.tt +10 -0
- data/lib/generators/trek/templates/public_accounts/models/account.rb.tt +16 -2
- data/lib/generators/trek/templates/public_accounts/spec/api/sign_ins_spec.rb.tt +30 -0
- data/lib/generators/trek/templates/public_accounts/spec/models/account/sign_in_code_spec.rb.tt +10 -0
- data/lib/generators/trek/templates/public_accounts/spec/models/account_spec.rb.tt +21 -1
- data/lib/generators/trek/templates/public_accounts/spec/web/sign_ins_spec.rb.tt +22 -0
- data/lib/generators/trek/templates/public_accounts/web/authentication.rb.tt +1 -1
- data/lib/generators/trek/templates/public_accounts/web/controllers/sessions_controller.rb.tt +8 -1
- data/lib/generators/trek/templates/public_accounts/web/controllers/sign_in_codes_controller.rb.tt +5 -0
- data/lib/generators/trek/templates/public_accounts/web/views/password_resets/edit.html.slim.tt +4 -1
- data/lib/generators/trek/templates/public_accounts/web/views/passwords/edit.html.slim.tt +4 -1
- data/lib/generators/trek/templates/public_accounts/web/views/registrations/new.html.slim.tt +3 -1
- data/lib/generators/trek/templates/public_accounts/web/views/sessions/new.html.slim.tt +3 -1
- data/lib/generators/trek/templates/spec/requests/admin/pages_spec.rb +11 -0
- data/lib/generators/trek/templates/spec/requests/admin/security_checks_spec.rb +24 -0
- data/lib/generators/trek/templates/spec/requests/admin/sign_in_notices_spec.rb +33 -0
- data/lib/generators/trek/templates/views/admin/pages/_form.html.slim +1 -1
- data/lib/generators/trek/templates/views/admin/security_checks/show.html.slim +9 -0
- data/lib/generators/trek/templates/views/admin/user_password_resets/edit.html.slim +6 -1
- data/lib/generators/trek/templates/views/admin/user_sessions/new.html.slim +4 -1
- data/lib/tasks/trek/attachments.rake +12 -0
- data/lib/tasks/trek/security.rake +10 -0
- data/lib/trek/disposable_email_domains.rb +9 -20
- data/lib/trek/engine.rb +5 -0
- data/lib/trek/json_compatibility.rb +20 -0
- data/lib/trek/security_check.rb +241 -0
- data/lib/trek/stored_image_metadata.rb +88 -0
- data/lib/trek/version.rb +1 -1
- data/lib/trek.rb +2 -1
- data/package.json +5 -6
- data/postcss.config.js +0 -3
- data/trek.gemspec +5 -6
- data/yarn.lock +983 -1042
- metadata +33 -31
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 03b9804e1d6af7dbc4c266cf1a7380ae465840d125095ef970229b0f2b6a7488
|
|
4
|
+
data.tar.gz: 3eda65aaabb84fb33770f83b3f8ad1048180ca773eea0746eaeb691dfad042b5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 67d42c244017d6d8c3417b619d34e0148be67ecc9a6d4400134a32c3132fa763a965540d1331e3db6d77851b7089586172245203533e078e5fff5bd89201e126
|
|
7
|
+
data.tar.gz: 76add725b10eee26ec497612565d3a5b1bc49ac4e1e5fe93a72a1a0e385958f80686f84abc3dc7590ffb49a270eb920841af1a05adf929ebd5b2b5c6e3833c77
|
data/AGENTS.md
CHANGED
|
@@ -4,13 +4,13 @@ Guidance for AI coding agents working in this repository. Keep it accurate — u
|
|
|
4
4
|
|
|
5
5
|
## What is Trek
|
|
6
6
|
|
|
7
|
-
Trek is a customizable CMS for Ruby on Rails, shipped as a **Ruby gem** (`trek`) plus a companion **NPM package** (`trek`). It's a Rails **engine** (`lib/trek/engine.rb`) that installs a back-office/admin into a host app. Installation and features are driven by Rails generators (`rails g trek:install`, `trek:scaffold`, `trek:admin:user`, …). Authored by Etamin Studio. Distributed publicly: the gem on [RubyGems](https://rubygems.org/gems/trek), the npm package on [npmjs.com](https://www.npmjs.com/package/trek); the source repository stays private on self-hosted GitLab (`git.etamin.studio`).
|
|
7
|
+
Trek is a customizable CMS for Ruby on Rails, shipped as a **Ruby gem** (`trek`) plus a companion **NPM package** (`trek`). It's a Rails **engine** (`lib/trek/engine.rb`) that installs a back-office/admin into a host app. Installation and features are driven by Rails generators (`bin/rails g trek:install`, `trek:scaffold`, `trek:admin:user`, …). Authored by Etamin Studio. Distributed publicly: the gem on [RubyGems](https://rubygems.org/gems/trek), the npm package on [npmjs.com](https://www.npmjs.com/package/trek); the source repository stays private on self-hosted GitLab (`git.etamin.studio`).
|
|
8
8
|
|
|
9
9
|
## Tech stack
|
|
10
10
|
|
|
11
|
-
- **Ruby** `>= 3.3` (RuboCop targets 3.4) · **Rails** `>= 8.0, < 8.2` (lockfile 8.1.4)
|
|
11
|
+
- **Ruby** `>= 3.3` (RuboCop targets 3.4) · **Rails** `>= 8.0, < 8.2` (lockfile 8.1.4.1)
|
|
12
12
|
- **Node** 24.22.1 (`.node-version`) · **Yarn** 4.18.1 with its defaults: no install scripts, no package published less than a day ago · **PostgreSQL** 12+ · **libvips** for images
|
|
13
|
-
- Backend: `action_policy`, `closure_tree`, `acts_as_list`, `mobility` + `i18n-tasks`, `shrine` (+ blurhash/image_processing/aws-sdk-s3), `view_component` + `slim-rails` + `lookbook`, `kaminari
|
|
13
|
+
- Backend: `action_policy`, `closure_tree`, `acts_as_list`, `mobility` + `i18n-tasks`, `shrine` (+ blurhash/image_processing/aws-sdk-s3), `view_component` + `slim-rails` + `lookbook`, `kaminari`
|
|
14
14
|
- Frontend: **esbuild** (`esbuild.config.js`) + **PostCSS** (`postcss.config.js`); Stimulus/Turbo, TipTap, Uppy, Tom Select, SortableJS
|
|
15
15
|
- Tests: **RSpec** (`rspec-rails`, capybara with Cuprite, simplecov), **Vitest** (browser mode, headless Chrome through Playwright) · Docs: **VitePress** (`docs/`)
|
|
16
16
|
|
|
@@ -24,7 +24,7 @@ rake spec # run tests (or: bundle exec rspec)
|
|
|
24
24
|
yarn test # JavaScript tests (Vitest): the admin's Stimulus controllers, e.g. the content editor's
|
|
25
25
|
COVERAGE=1 bundle exec rspec # tests + SimpleCov report in coverage/ (fails under the minimum set in spec/spec_helper.rb)
|
|
26
26
|
make lint # all linters below (make -k lint to run them all despite a failure)
|
|
27
|
-
make security # brakeman + bundler-audit
|
|
27
|
+
make security # brakeman + bundler-audit + yarn npm audit
|
|
28
28
|
make fix # rubocop/eslint/stylelint/prettier autocorrect, then make i18n-normalize
|
|
29
29
|
make i18n-normalize # sort the locale keys (i18n-tasks normalize), then Prettier them; CI checks it
|
|
30
30
|
make release # bump version (version.rb + package.json), stamp CHANGELOG, tag, push gem + npm
|
|
@@ -39,15 +39,16 @@ bundle exec slim-lint "app/**/*.slim"
|
|
|
39
39
|
yarn eslint "app/**/*.js"
|
|
40
40
|
yarn stylelint "app/**/*.css"
|
|
41
41
|
yarn prettier --check "{app,config,lib,spec}/**/*.{css,js,json,md,yml}"
|
|
42
|
+
bundle exec i18n-tasks missing -t diff
|
|
42
43
|
```
|
|
43
44
|
|
|
44
|
-
Security: `bundle exec brakeman` · `bundle exec bundle-audit check --update`
|
|
45
|
+
Security: `bundle exec brakeman` · `bundle exec bundle-audit check --update` · `yarn npm audit --recursive --environment production` (skipped advisories in `.yarnrc.yml`)
|
|
45
46
|
|
|
46
47
|
## Structure
|
|
47
48
|
|
|
48
|
-
- `app/` — engine code, namespaced under `trek/`: `components/` (ViewComponents), `controllers/`, `forms/`, `models/`, `policies/` (ActionPolicy), `uploaders/` (Shrine), `validators/` (top-level, e.g. `NotDisposableValidator`), `views/`, `javascript/` (Stimulus)
|
|
49
|
-
- `lib/generators/trek/` — the heart of the gem: `install/` (~
|
|
50
|
-
- `lib/trek/` — `engine.rb`, `version.rb`, `
|
|
49
|
+
- `app/` — engine code, namespaced under `trek/`: `components/` (ViewComponents), `content/` (`Trek::Content`, the content editor's schema and node types), `controllers/`, `forms/`, `helpers/`, `jobs/`, `models/`, `policies/` (ActionPolicy), `uploaders/` (Shrine), `validators/` (top-level, e.g. `NotDisposableValidator`), `views/`, `javascript/` (Stimulus), `assets/` (icons, stylesheets)
|
|
50
|
+
- `lib/generators/trek/` — the heart of the gem: `install/` (~55 generators, `install/admin/` included), `scaffold_generator.rb`, `taxonomies_generator.rb`, `audit_log_generator.rb`, `public_accounts_generator.rb`, `scalingo_generator.rb`, `admin/`, `upgrade/`, `templates/`
|
|
51
|
+
- `lib/trek/` — `engine.rb`, `version.rb`, and the engine's plain Ruby classes (`typography_formatter.rb`, `security_check.rb`, `admin_ip_allowlist.rb`…); rake tasks in `lib/tasks/trek/`
|
|
51
52
|
- `config/locales/` — `trek.en.yml`, `trek.fr.yml`
|
|
52
53
|
- `spec/` — RSpec suite, two kinds of spec:
|
|
53
54
|
- **isolated** (`require_relative` the file under test, stub its host): concerns, helpers, simple components
|
|
@@ -55,7 +56,7 @@ Security: `bundle exec brakeman` · `bundle exec bundle-audit check --update`
|
|
|
55
56
|
- **Host-app specs**: model, admin request, policy and mailer specs and their [Oaken](https://github.com/kaspth/oaken) seeds are templates (`lib/generators/trek/templates/{spec/models,spec/requests,spec/policies,spec/mailers,db/seeds}/`), installed in host apps by `trek:install:model_specs` and run by Trek's suite from `tmp/dummy` (`spec/dummy/generated_specs_spec.rb`); test data comes from `users.create`, `pages.create` and `seed "cases/…"`, not factories. Write specs for Trek's models there, in host-app style (no `frozen_string_literal`, Ruby 3.3-compatible — no bare `it` block parameter), so host apps get them too.
|
|
56
57
|
- **Generators** (`spec/trek/generators_spec.rb`): every generator runs on a copy of a real `rails new` app (`spec/support/generators.rb`, built once per run into `tmp/generator_skeleton`), then again to check it changes nothing. Shell-outs are recorded in `shell_commands`, not run. A new generator is picked up automatically; if it needs arguments, an earlier Trek step or a starting file, add it to the spec's `arguments`, `prerequisites` or `setups`.
|
|
57
58
|
- **System** (`spec/system`, `type: :system`): the admin in a headless Chrome (Cuprite), for what needs a real browser: typing, Turbo panels, uploads. `spec/support/system.rb` builds Trek's JS and CSS once per run (`node esbuild.config.js`) and serves them as the admin's `admin.js` and `admin.css`. Keep them few: they take seconds each.
|
|
58
|
-
- `spec/javascript/` — Vitest tests (`yarn test`) of the admin's Stimulus controllers with their libraries, in a headless Chrome (the installed one, or `CHROME_PATH`): the content editor's controller and Tiptap, mounted on its component's markup, driven with the keyboard and the mouse (`userEvent`). Most editor behaviour is tested there: the
|
|
59
|
+
- `spec/javascript/` — Vitest tests (`yarn test`) of the admin's Stimulus controllers with their libraries, in a headless Chrome (the installed one, or `CHROME_PATH`): the content editor's controller and Tiptap, mounted on its component's markup, driven with the keyboard and the mouse (`userEvent`), and the image and sound fields' controllers with Uppy (`upload_fields.test.js`). Most editor behaviour is tested there: the editor's file runs in about five seconds.
|
|
59
60
|
- Both kinds run in one process, so an isolated spec must restore any global it changes (`I18n`, `Shrine` storages…). `spec_helper` loads Rails and Action View before Trek, as a host app does: several dependencies (ActionPolicy, Slim, ViewComponent) configure themselves from what is already loaded.
|
|
60
61
|
- `docs/` — VitePress site
|
|
61
62
|
|
|
@@ -63,10 +64,10 @@ Security: `bundle exec brakeman` · `bundle exec bundle-audit check --update`
|
|
|
63
64
|
|
|
64
65
|
- **Ruby**: rubocop-rails-omakase + rubocop-rspec (`.rubocop.yml`) — double-quoted strings, line length 120, target 3.4
|
|
65
66
|
- **Slim** linted via slim_lint; **JS/CSS** via ESLint + Stylelint + Prettier 2.8.8
|
|
66
|
-
- **i18n**: keep English + French locales in sync (`config/locales/trek.*.yml`)
|
|
67
|
+
- **i18n**: keep English + French locales in sync (`config/locales/trek.*.yml`)
|
|
67
68
|
- **Versioning**: version lives in both `lib/trek/version.rb` and `package.json` — keep in sync via `make release`
|
|
68
69
|
- **CHANGELOG.md**: Keep-a-Changelog format. **Every MR must add an `[Unreleased]` entry**, except one that only changes specs or the repository's own tooling (`Makefile`, CI, Renovate config), which host apps never see. Keep entries short: one or two sentences on what changed for host apps, not how it was found or fixed — the MR description holds the details. When the change requires action in the host app on upgrade, end the entry with a bold `**Upgrade note:**` label followed by what to do. Use the same label when the change lets host apps remove or simplify existing patches or custom implementations (e.g. "**Upgrade note:** you can now drop your custom …") — never as an unlabelled trailing sentence.
|
|
69
70
|
- **Generated model names**: a new model template belonging to another model is nested under it, in `models/<owner>/` (`User::Session`, `User::PreviousPassword`), not prefixed (`UserSession`). Nested in an Active Record model, it keeps the prefixed table name (`user_sessions`) and its owner's `has_many` finds it without `class_name:`. The older `PagePath`, `PageVersion` and `TagCategory` move in Trek 3 (#248).
|
|
70
|
-
- **Generators' npm packages**: the install generators' `NPM_DEPENDENCIES` (`lib/generators/trek/install/*_generator.rb`) add to host apps the packages needed by the config files they copy from Trek's root (`esbuild.config.js`, `postcss.config.js`, `.eslintrc.json`, `.stylelintrc.json`, `lefthook.yml`). When a package is bumped in Trek's `package.json` — by hand or by Renovate, which doesn't touch the generators — bump its range in the generator in the same MR, or new apps get a version the copied config may not work with (as esbuild 0.15 did). List only packages those configs or the generated scripts use.
|
|
71
|
+
- **Generators' npm packages**: the install generators' `NPM_DEPENDENCIES` (`lib/generators/trek/install/*_generator.rb`) add to host apps the packages needed by the config files they copy from Trek's root (`esbuild.config.js`, `postcss.config.js`, `.eslintrc.json`, `.stylelintrc.json`, `lefthook.yml`). When a package is bumped in Trek's `package.json` — by hand or by Renovate, which doesn't touch the generators — bump its range in the generator in the same MR, or new apps get a version the copied config may not work with (as esbuild 0.15 did). List only packages those configs or the generated scripts use, and install them as `devDependencies` (`install_npm_dependencies(…, dev: true)`): they only run at build time, and the generated `npm-audit` job checks the production dependencies, which would otherwise include them.
|
|
71
72
|
- **Public code**: Trek ships publicly (gem, npm, docs), so nothing committed may mention a client or project name, nor a client's domain models or business logic — not in code, comments, specs, templates, docs, CHANGELOG or commit messages. Use neutral examples (`Page`, `Shop::Product`, an engine's `Blog::Post`). Client context belongs in GitLab issues and MR descriptions only.
|
|
72
73
|
- **CI**: GitLab CI (`.gitlab-ci.yml`), stages build → lint (one job: `make -k lint security i18n-check`) → test → deploy, the test jobs starting without waiting for lint; docs deploy to Netlify; deps via Renovate
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [2.7.0] - 2026-11-16
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `rails g trek:public_accounts Member --invite-only`, for a private site where only the accounts the app created sign in: a code is emailed only to an email that has an account, with the same answer for every email, and signing in never creates an account. Which accounts may sign in is `Member.for_sign_in(email)`, to narrow in the app (e.g. `active.find_by(email:)`). Codes only. See [Public accounts](https://trek.etamin.studio/reference/generators/public-accounts#invite-only).
|
|
8
|
+
- Generated apps check their npm packages for known vulnerabilities, as bundler-audit does their gems: `make scan` and a new `npm-audit` CI job run `yarn npm audit`, failing on any advisory or deprecation in the packages the app bundles (`dependencies`, not `devDependencies`). See [Vulnerable dependencies](https://trek.etamin.studio/reference/generators/install#vulnerable-dependencies) for how to resolve one. **Upgrade note:** move the PostCSS packages to `devDependencies` first (see below), then add the `npm-audit` job next to `bundler-audit` in `.gitlab-ci.yml`, and `yarn npm audit --recursive --environment production` to `make scan` (see `lib/generators/trek/templates/.gitlab-ci.yml`).
|
|
9
|
+
- The [Controllers](https://trek.etamin.studio/reference/controllers#localization) reference documents `Trek::Localization`: where a request's locale comes from, and how to add a source by overriding `locale_for_request`.
|
|
10
|
+
- `bin/rails trek:security:check` checks a deployed app's configuration against Trek's recommended settings: HTTPS and HSTS, the Content Security Policy, the cache store, the proxies and `ADMIN_ALLOWED_IPS`, the audit log and the scheduled purges, the admin users (password only, dormant, password expiry) and Active Record Encryption's keys. It prints each check with ✓, •, ⚠ or ✗ and a link to the docs, in a dated report to keep as evidence, and exits with status 1 when a check fails. See [Self-check](https://trek.etamin.studio/security#self-check).
|
|
11
|
+
- A **Settings › Security** page in the admin, for admins only, shows the same checks, dated, and checks the request that opened it too: that it reached the app over HTTPS, and that the IP address Rails sees is the one a CDN forwards. See [In the admin](https://trek.etamin.studio/security#in-the-admin). **Upgrade note:** run `rails g trek:install:admin:security_check`, and add the page to the Settings section of `app/views/layouts/admin.html.slim`, after the background jobs: `s.with_item(text: t("admin.security_checks.show.title"), href: %i[admin security_check], allowed_to: Current.user.admin?)`. In apps with Trek's host specs, copy `spec/requests/admin/security_checks_spec.rb` from Trek's templates (`lib/generators/trek/templates/spec/requests/admin/`).
|
|
12
|
+
- A [Personal data](https://trek.etamin.studio/personal-data) page lists the personal data Trek's generators create, table by table: why it's kept, for how long, and what deletes it; what deleting a user or an account leaves; and the third parties a default app sends some of it to. For an app's record of processing activities, and security questionnaires.
|
|
13
|
+
- The [Deploying to Scalingo](https://trek.etamin.studio/deploy) guide covers what a first deploy still needed: keeping Solid Cache in the app's single database, the environment variables the generated code reads, domains and their certificates, deploying from GitLab CI, and `> /dev/null` on `env-set` so secrets aren't printed.
|
|
14
|
+
- `Trek::Auditable`'s `audit_read_actions` lists actions that only read although they're not a GET, such as the chips hotwire_combobox requests with a POST, to keep them out of the audit log. See [Customizing](https://trek.etamin.studio/reference/generators/audit-log#customizing). **Upgrade note:** an app overriding `read_only_request?` for this can set `self.audit_read_actions = %i[chips]` instead.
|
|
15
|
+
- `Trek::PurgeExpiredSignInCodesJob` deletes a public account model's expired sign-in codes, which each hold an email: only a new code deleted them, so the last ones requested were kept for good. `rails g trek:public_accounts` schedules it every night in GoodJob's cron, with codes (3:45am). See [Public accounts](https://trek.etamin.studio/reference/generators/public-accounts#sessions). **Upgrade note:** in apps signing in with codes, add to `config.good_job.cron`, for each public account model (here `Member`): `purge_expired_member_sign_in_codes: { cron: "45 3 * * *", class: "Trek::PurgeExpiredSignInCodesJob", args: ["Member::SignInCode"] }`.
|
|
16
|
+
- `bin/rails trek:attachments:strip_image_metadata` strips the metadata of the images stored before `ImageUploader` stripped it on upload (`DRY_RUN=1` only lists them). Each image is re-encoded and replaced in place, so every record, page version and content editor block pointing to it keeps working. See [Image metadata](https://trek.etamin.studio/reference/uploaders#image-metadata). **Upgrade note:** once the app's `ImageUploader` strips metadata (see below), back up the bucket, or enable its versioning, then run the task once in production.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- `NotDisposableValidator` searches the disposable domains with valid_email2's `SortedDomainList`, new in valid_email2 7.2, instead of Trek's own copy of the same search, and shares valid_email2's list when the app sets `ValidEmail2.disposable_domains_lookup = :sorted_list` rather than loading a second one. Trek requires valid_email2 7.2. See [Validators](https://trek.etamin.studio/reference/validators#disposable-email-addresses). **Upgrade note:** an app that pinned valid_email2 to a Git revision for the sorted list can go back to the released gem (`~> 7.2`).
|
|
21
|
+
- A paragraph holding only line breaks (Shift+Enter) counts as empty, as a paragraph with no content does: it renders nothing (`Trek::Content::Paragraph.empty?`) instead of a blank space, a list item holding only such a paragraph is skipped, and content is cleaned of them before it is saved (`Trek::Contentable`). A line break between words stays. **Upgrade note:** existing content is cleaned the next time it is saved; apps that pruned these paragraphs before saving can drop that code.
|
|
22
|
+
- The `trek_known_users` cookie, which recognizes a browser that already signed in as a user so that only a new one emails them, is encrypted and kept 13 months after the last sign-in, instead of signed and kept 20 years: someone using the browser can no longer read who else signed in from it. Browsers recognized by the former signed cookie still are. **Upgrade note:** apps have their own copy of `app/controllers/concerns/trek/authentication.rb`: replace its `signed_in_from_this_browser?` and `remember_sign_in_from_this_browser`, and add `known_user_ids`, from Trek's (`lib/generators/trek/templates/controllers/concerns/trek/authentication.rb`). In apps with Trek's host specs, copy `spec/requests/admin/sign_in_notices_spec.rb` from Trek's templates.
|
|
23
|
+
- **Security:** the `ImageUploader` `trek:install:uploaders` copies strips an uploaded image's metadata (EXIF, with the GPS location and the camera's serial number, XMP, IPTC), which was published with the file. It re-encodes the image in its own format after applying its orientation (a JPEG or a WebP at quality 90, every frame of an animated WebP), and keeps its color profile with libvips 8.15 or later. It also accepts WebP images, besides JPEG and PNG. Thumbnails and other sizes are on by default: the derivation endpoint is enabled and mounted at `/derivations/image`, and makes every size a WebP at quality 80, without metadata. An image's sizes are deleted with it. See [Images: types and sizes](https://trek.etamin.studio/reference/uploaders#images-types-and-sizes). **Upgrade note:** apps have their own copy of `app/uploaders/image_uploader.rb`: re-run `rails g trek:install:uploaders`, which offers to replace it with Trek's, then bring back the app's own changes, and mount the endpoint in `config/routes.rb` if it's commented out: `mount ImageUploader.derivation_endpoint => "derivations/image"`. Images uploaded before keep their metadata until they're uploaded again, but their sizes don't.
|
|
24
|
+
- The generators schedule Trek's purges every night in GoodJob's cron, which they left to each app, and most never did: expired sessions and old audit log rows were kept for good. `rails g trek:install` schedules `Trek::PurgeExpiredSessionsJob` (the admin's sessions, 3am), `trek:audit_log` adds `Trek::AuditLog::PurgeJob` (4am), and `trek:public_accounts` the purge of its accounts' sessions (3:30am). Without GoodJob's initializer, the generators say what to schedule instead. See [Scheduled jobs](https://trek.etamin.studio/background-jobs#scheduled-jobs-cron). **Upgrade note:** in `config/initializers/good_job.rb`, add to `config.good_job.cron` the entries the app is missing: `purge_expired_sessions: { cron: "0 3 * * *", class: "Trek::PurgeExpiredSessionsJob" }`, `purge_audit_logs: { cron: "0 4 * * *", class: "Trek::AuditLog::PurgeJob" }` with the audit log, and `purge_expired_member_sessions: { cron: "30 3 * * *", class: "Trek::PurgeExpiredSessionsJob", args: ["Member::Session"] }` for each public account model (here `Member`). An app on another Active Job backend schedules the same jobs with it.
|
|
25
|
+
- The admin's image and sound fields upload with Uppy 6, up from Uppy 3, which brought nanoid 4 and its four advisories (three high) that `yarn npm audit` reported in every app (no nanoid 4 fixes them). The fields no longer bundle Uppy's stylesheet: it only styles Uppy's own interface, which Trek doesn't use.
|
|
26
|
+
- `rails g trek:install:postcss` adds the PostCSS packages to `devDependencies`, as the other build and lint tools, rather than to `dependencies`, and no longer adds `postcss-inline-svg`, which Trek's stylesheets don't use any more: it brought a css-what with a high advisory. **Upgrade note:** in `package.json`, move `postcss`, `postcss-flexbugs-fixes`, `postcss-import`, `postcss-modules` and `postcss-preset-env` to `devDependencies`, and run `yarn install`. Unless the app's own CSS uses `@svg-load` or `svg-load()`, remove `postcss-inline-svg` from `package.json` and its `require("postcss-inline-svg")(…)` from `postcss.config.js`.
|
|
27
|
+
- `rails g trek:scalingo` and the [Deploying to Scalingo](https://trek.etamin.studio/deploy) guide pin [trek-buildpack](https://github.com/etaminstudio/trek-buildpack) 0.1.4, up from 0.1.0. Since 0.1.0, the buildpack installs the Bundler version of `Gemfile.lock` (apps whose lockfile asked for a newer one died on start with `Could not find 'bundler'`) and forces its install past the default gem, and it now preloads jemalloc: the `libjemalloc2` of the `Aptfile` was installed but never used, as rv's Rubies aren't built with it. **Upgrade note:** on each Scalingo app, run `scalingo --app <app> env-set BUILDPACK_URL=https://github.com/etaminstudio/trek-buildpack/archive/refs/tags/v0.1.4.tar.gz`; it applies from the next deploy.
|
|
28
|
+
- Trek no longer requires `json` < 3, which made `bundle add trek` on a fresh Rails 8.1.4 app silently install Trek 2.2.0. json 3 needs Rails 8.1.4 or later: with an older Rails, the app now fails at boot saying so. **Upgrade note:** apps on Rails 8.0 or 8.1.0 to 8.1.3.1 keep the json 2 in their `Gemfile.lock`; add `gem "json", "< 3"` to the Gemfile so a `bundle update` doesn't bring json 3.
|
|
29
|
+
- `rails g trek:scalingo` comments out the `kamal` gem `rails new` adds, since a Scalingo app doesn't deploy with it, and runs `bundle install`: Kamal's SSH dependencies (`net-ssh`, `net-scp`, `net-sftp`, `sshkit`, `bcrypt_pbkdf`, `ed25519`) leave the bundle, and with them the advisories that kept failing bundler-audit. `config/deploy.yml`, `.kamal/secrets` and `bin/kamal` stay in place. **Upgrade note:** apps already on Scalingo can re-run `rails g trek:scalingo`, or comment out `gem "kamal"` by hand and run `bundle install`.
|
|
30
|
+
- `bin/rails g trek:scaffold` gives the new model a `to_s` returning its first string attribute (`title.presence || super`), which the admin shows records by: they were listed as `#<Book:0x…>` until its commented-out `to_s` was filled in. Without a string attribute, it stays a TODO. The [Getting started](https://trek.etamin.studio/getting-started#scaffold-your-first-resource) guide and the [Scaffold](https://trek.etamin.studio/reference/generators/scaffold) page now say to run the migration, and list the model's TODOs.
|
|
31
|
+
- The docs, the generators' messages and the security checks write commands as `bin/rails …`, the app's own Rails, instead of a mix of `rails g …` and `bin/rails …`.
|
|
32
|
+
|
|
33
|
+
### Removed
|
|
34
|
+
|
|
35
|
+
- DeepL: the scaffold generator no longer translates the new locale files with `DEEPL_AUTH_KEY`, Trek no longer depends on `deepl-rb`, and `rails g trek:install:translations` no longer adds it, nor a DeepL `translation:` section to `config/i18n-tasks.yml`. **Upgrade note:** apps can remove `gem "deepl-rb"` from their Gemfile, the `translation:` section from `config/i18n-tasks.yml`, and `DEEPL_AUTH_KEY` from their environment; an app that still translates with `i18n-tasks translate-missing --backend=deepl` keeps the gem and the section.
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- Password managers such as Bitwarden didn't offer to save the password after signing in to the admin, until the page was reloaded: Turbo replaced the page's body, and the prompt they had added to it. The forms that take a password (the admin's sign-in and password reset, and `trek:public_accounts`' sign-in, sign-up, password reset and password change) now submit without Turbo, and load the next page in full. **Upgrade note:** add `data: { turbo: false }` to the `form_with` of `app/views/admin/user_sessions/new.html.slim` and `app/views/admin/user_password_resets/edit.html.slim`, and, in apps that ran `trek:public_accounts`, of its `sessions/new` (the password form), `registrations/new`, `password_resets/edit` and `passwords/edit` views.
|
|
40
|
+
- A `locale` param that isn't one of the app's locales (`?locale=xx`) made every controller including `Trek::Localization` answer with a 500 (`I18n::InvalidLocale`), the admin's included. It's now ignored, and the locale comes from the user or the browser as without it.
|
|
41
|
+
- The password strength meter no longer makes the form grow when its label appears, as a password is typed.
|
|
42
|
+
- An app that resolved Prism 2, as a fresh one has since rubocop-ast 1.51.0, failed at boot wherever it eager loads, in production and on CI (`uninitialized constant Prism::MissingNode`): refract, which `prosemirror` brings through Phlex, uses a node Prism 2 removed. Trek now requires Prism < 2. **Upgrade note:** if the app's `Gemfile.lock` has Prism 2 (`bundle info prism`), `bundle update trek` brings it back to 1.x.
|
|
43
|
+
- The arrows around a larger image in the content editor didn't show in host apps: their build looked for the icons in the app's own `app/assets/icons`, and left an invalid rule. The icons are now inlined in the stylesheet.
|
|
44
|
+
- The generated `.gitlab-ci.yml` ran on the `ci-ruby/node-24` image whatever Node the app pins: `rails g trek:install:ci` now picks the image of the major in `.node-version` (20, 22, 24 or 26), and falls back to Node 24, with a warning, without the file or for a major `ci-ruby` has no image for. **Upgrade note:** apps pinning another Node than 24 can set `node-<major>` in the `image:` of `.gitlab-ci.yml`.
|
|
45
|
+
- `rails g trek:public_accounts` added the account's attributes to `Current` without indenting them. **Upgrade note:** apps that ran it on Trek 2.6.0 can indent the three lines it added to `app/models/current.rb`.
|
|
46
|
+
- The sign-in concern `rails g trek:public_accounts` generates for a website (`app/controllers/concerns/<accounts>/authentication.rb`) failed the generated CI's Brakeman job (HTTP verb confusion): it now remembers the page to return to for `HEAD` requests too, as for `GET`. **Upgrade note:** apps that ran it on Trek 2.6.0 can replace `if request.get?` with `if request.get? || request.head?` in `require_<account>`.
|
|
47
|
+
- The Getting started guide and the README installed Yarn with `corepack enable`, which Node 25 and later no longer ship (`corepack: command not found`). They now install corepack first, with `npm install --global corepack`, or Yarn with mise.
|
|
48
|
+
- The admin's edit form of a page made of sections (`sectioned`) but not versioned failed with a `NameError` (`vf`). **Upgrade note:** in `app/views/admin/pages/_form.html.slim`, replace `vf.object.sections_instances` with `@object.sections_instances` in the branch for pages without versions (the second one).
|
|
49
|
+
- Docs that no longer matched the code: the Fragmentable configuration, the scaffold's form fields and route, icon keys (`trek/search`), `Trek::Search`, Sectionable, Orderable's `ordered`, the SEO fallbacks, the cryptography table and self-check levels in Security, CSP reports in Personal data, `S3_BASE_URL`, the admin's per-IP sign-in limit, the installer's linters, mailers and specs, `media-src`, `FEATURE_STORAGE`, `TREK_LOCALES`, and the json pin Rails before 8.1.4 needs.
|
|
50
|
+
- Deleting a public account left the sign-in codes waiting for its email, which hold that email: they're keyed by email, not linked to the account, so only their expiry and the nightly purge deleted them. `rails g trek:public_accounts` (with codes) now deletes them with the account. **Upgrade note:** in apps signing in with codes, add to the account model (here `Member`), after `has_many :sign_in_codes`: `after_destroy { Member::SignInCode.where(email:, purpose: "sign_in").delete_all }`.
|
|
51
|
+
- Small inaccuracies in the reference docs: `GateComponent` and the toast component's name, what `f.group` renders, the formatter's narrow no-break spaces, `User#last_activity_at`, `Current`'s attributes, `page.versions.current`, and the generators list, which now has `trek:scalingo` and `trek:upgrade:v2`.
|
|
52
|
+
- `bin/rails g trek:scaffold` left the new model's entry in `Admin::Dashboard::MODELS_IN_MENU` unindented.
|
|
53
|
+
|
|
3
54
|
## [2.6.0] - 2026-10-28
|
|
4
55
|
|
|
5
56
|
### Added
|