Commit Graph

45 Commits

Author SHA1 Message Date
Jeremy Daer c691d39ecf Integrate fizzy-saas as vendored gem at saas/
- Update Gemfile.saas to use path: "saas" instead of GitHub source
- Update config/database.yml to reference local saas/ directory
- Update bin/setup to source saas/bin/setup directly
- Remove redundant dotfiles (ruby-version, gitignore, rubocop, github workflows)
- Add saas/db exclusions to root rubocop config
2025-12-16 12:25:22 -08:00
Mike Dalessio bd19b91e05 Make sure the sqlite db is prepared in SAAS mode
Previously, the mysql database was prepared twice and sqlite not at all.
2025-11-29 14:09:55 -05:00
Jorge Manrubia 35b49a417d Move the SASS database config to the gem 2025-11-28 15:53:48 +01:00
Jorge Manrubia cf59ac1da9 Split database files 2025-11-28 15:53:48 +01:00
Jorge Manrubia bab914d4e0 Move db check to the Fizzy module 2025-11-28 15:53:48 +01:00
Donal McBreen 18fa877882 Switch to a pool size of 5 2025-11-26 10:27:06 +00:00
Donal McBreen c4498212dc Merge branch 'main' into sqlite
* main: (116 commits)
  Ensure avatar thumbnails are square
  Update useragent to recognize twitterbot/facebot
  Add defensive styles for non-square avatar images
  Update test for copy changes
  Missed commit
  AI: standardize on https://agents.md
  Make it clear this is just notifications, not comprehensive activity
  AI: configure MCP servers for Chrome, Grafana, and Sentry (#1727)
  Allow requests from Google Image Proxy
  Update to basecamp's useragent fork
  Clean up a little bit the CSRF reporting code
  Claude: production observability guidance (#1725)
  Prevent autoscroll to the root columns container to prevent jump on page load
  Include full name string so you can type your name to filter
  Prioritize current user and assigned users in assignment dropdown
  Check and report on Sec-Fetch-Site header for forgery protection
  bundle update
  Bump bootsnap from 1.18.6 to 1.19.0
  Bump rails from `077c3ad` to `17f6e00`
  Fix cards getting stuck in edit mode
  ...
2025-11-26 10:07:41 +00:00
Kevin McConnell b6e31a234a Set MySQL max statement timeout to 5s 2025-11-25 12:58:17 +00:00
Donal McBreen e07419e953 Update config/database.yml
Co-authored-by: Mike Dalessio <mike.dalessio@gmail.com>
2025-11-25 11:38:21 +00:00
Donal McBreen b96ea6e9d0 Update config/database.yml
Co-authored-by: Mike Dalessio <mike.dalessio@gmail.com>
2025-11-25 11:38:13 +00:00
Donal McBreen f384a0d9b8 Fix database.yml merge error 2025-11-21 14:30:17 +00:00
Donal McBreen 32c3bcec9f Merge branch 'main' into sqlite 2025-11-21 14:26:21 +00:00
Jorge Manrubia c1f5699443 Switch READ-COMMITED so that queries see the last committed data
This should help solving the problem with overlapping bundles

It is what we use in HEY and Basecamp
2025-11-21 14:35:29 +01:00
Donal McBreen f665b5a1fa No need for default schema 2025-11-21 09:15:19 +00:00
Donal McBreen bb36b4846f Support SQLite searching 2025-11-21 09:15:19 +00:00
Donal McBreen a2333d9a37 Add SQLite support
- UUID support
- Schema compatibility layer, ignore MySQL specific options
- Search not working yet
2025-11-21 09:15:19 +00:00
Kevin McConnell 11a38a4526 Initial (wip) staging deployment
This adds an initial configuration for staging. Note that we are doing
this ahead of having the full infrastructure in all 3 DCs. So this
this will result in some cross-DC writes for now (e.g. we have a single cache in
IAD). We'll correct this as the infrastructure becomes available.

We'll also run jobs on every app server, until we split them out to
separate instances.
2025-11-17 09:12:41 -05:00
Kevin McConnell 915c1202f8 Initial minimal primary/replica switching 2025-11-17 09:11:57 -05:00
Mike Dalessio d6c7fc9e0a Database config for mysql 2025-11-17 09:11:42 -05:00
Stanko K.R. 6705b5225f Remove the untenanted database 2025-11-17 09:11:36 -05:00
Mike Dalessio 4d3c265042 Rip out activerecord-tenanting
Co-authored-by: Stanko K.R. <stanko@stanko.io>
2025-11-17 09:11:35 -05:00
Kevin McConnell e5bbe6cf64 Remove Beamer 2025-11-17 09:11:28 -05:00
David Heinemeier Hansson 38a7a14466 Remove vector extension that we are no longer using 2025-11-03 13:40:03 +01:00
Stanko Krtalić 880ad7ff12 Use Beamer through its gem (#1230) 2025-10-23 12:14:00 +02:00
Stanko K.R. b016bd7cae Fix replicaiton wiht the untenanted DB 2025-10-13 14:09:37 +02:00
Stanko K.R. d3816bc212 Create testbed to test beamer scenarios in Fizzy 2025-10-13 13:46:00 +02:00
Mike Dalessio c368485e84 db: Add beamer to the untenanted database 2025-10-10 11:43:07 -04:00
Mike Dalessio 3399e45130 Introduce an "Identity" model to ease login
- New untenanted Identity and Membership models
- New `identity_token` cookie with path "/" holds state across tenants

We're not sure whether the untenanted database will be sqlite or
MySQL, and so I've been careful to minimize

- database reads, placing them behind etags and caching
- database writes, only writing when a new Session is created (login)

Note that we track two things in the identity_token cookie: a signed
id, and the updated_at for the underlying Identity object. This allows
us to effectively cache on the Identity without having to hit the
database, by using an Identity::Mock object that is compatible with
etag and cache methods.

The new integration test shows the desired user-facing behavior, which
is to make it easy to login without a tenanted URL and to jump between
tenants.

- the untenanted "login_help" page shows all linked memberships
- the jump menu shows all linked memberships (except the current)

Also introduced a utility script to populate existing employee
Identities, grouping accounts by email address.
2025-10-10 10:12:25 -04:00
Mike Dalessio 8d23af3b70 Increase connection pool size from 5 to 50
which might improve performance and will certainly prevent connection
pool exhaustion exceptions.
2025-08-15 14:47:52 -04:00
Jorge Manrubia 1c6adf54a8 Restore semantic searches 2025-07-24 16:47:57 +02:00
Jorge Manrubia 9e3dbb0858 Remove semantic searches
We may revisit in the future but we'll go with keyword search only for launch
2025-06-25 09:36:14 +02:00
Kevin McConnell 63c2aa1367 Enable VFS, but don't load extension again
We only need to load the extension once, which we're doing in an
initializer. So no need to load it again on the tenanted connections
(and doing so is problematic when it occurs after a fork).
2025-06-16 14:48:13 +01:00
Kevin McConnell 7d027f6699 Disable replication temporarily 2025-06-06 09:02:13 +01:00
Kevin McConnell e998783155 Use VFS-based Beamer 2025-06-05 11:59:30 +01:00
Mike Dalessio e67d59e341 Introduce a staging environment
ref: https://3.basecamp.com/2914079/buckets/21350690/card_tables/cards/8708868711
2025-06-04 11:06:09 -04:00
Mike Dalessio c3a9ac7391 Create a distinct "beta" environment
and move secrets into Rails credentials for both beta and production
environments.
2025-05-31 10:57:26 -04:00
Jorge Manrubia 40b78e4115 Move extension configuration to config file
Kudos to Mike for the tip
2025-05-16 16:17:54 +02:00
Mike Dalessio ea56968c05 Remove "primary_original" database
which was created to perform the tenanting migration from 300dffd3,
and can now be cleaned up.
2025-04-23 15:39:50 -04:00
Kevin McConnell 91df76928b Add fizzy-app-102 as a replica
The setup here is a bit rough while we settle some of the details, but
the gist of it is:

- Define accessories to run the primary/replica processes
- Add a web-replica role, which is similar to web but has the
  replication-side accessory
- Load the beamer extension on the app's primary tenanted database

Note that we aren't sending any traffic into the replica yet, but it
would be functional to do so. This stage is mainly about testing the
database replication.
2025-04-16 17:46:44 +01:00
Mike Dalessio 300dffd376 Script and configuration for a multi-tenant migration
ref: https://3.basecamp.com/2914079/buckets/37331921/messages/8422006338

The script takes advantage of the fact that we can bind to the
existing untenanted database by adding it explicitly (and temporarily)
as a readonly shard to the database.yml, and so in the script
with_original_db is connected to the original database.

storage/tenants/%{tenant}/ is now the root directory for all
state stored for a particular tenant, including active storage and the
database.

We leave the existing files and production database in place after the
migration, in case we need to roll back (by reverting the code and
config).

We also don't do a granular active storage blob copy, since the
attachments are mostly on Account (and not on Bubble). Instead we
hardlink the blobs on disk (so we don't take up additional space with
duplicates).

Finally, we're manually adding the kamal-proxy hosts to the deploy
file, so that we can generate letsencrypt certs for the
subdomains. This is only intended to be a short-term solution, we'll
want something like a wildcard cert before we go live.
2025-03-12 07:53:31 -04:00
Mike Dalessio d9ece38753 Make the application multi-tenant 2025-03-12 07:53:31 -04:00
Kevin McConnell 90538afb3b Add Solid Queue
We'll run jobs via the Puma plugin for now, to simplify the deployment.
2025-01-08 14:02:45 +00:00
Kevin McConnell 2e892e0766 Add Solid Cache 2025-01-08 14:02:45 +00:00
Kevin McConnell 648e9b2296 Add solid_cable 2025-01-03 16:29:43 +00:00
Kevin McConnell 564a0f48ae New Rails app 2024-06-21 13:19:56 +01:00