Commit Graph
144 Commits
Author SHA1 Message Date
Brenda Wallace 7a86c711a9 Update API base URL configuration to conditionally set based on presence of HOST and API_BASE_URL 2026-10-26 21:18:13 +13:00
Brenda Wallace 75da93694a Merge branch 'main' into api/graphiti 2026-10-26 20:11:16 +13:00
Brenda Wallace 948cc59d1b Remove Sidekiq integration and update mailer delivery methods to deliver immediately 2026-10-26 19:38:38 +13:00
Brenda Wallace 1135c763de Tidy API resources: read_only and owned macros, private hook helpers
Declare read-only resources and the owner relationship once each, make
the resource hook helpers private, simplify token auth, and cache the
generated API docs for an hour.
2026-10-25 11:48:28 +13:00
Brenda Wallace 73f62d4983 Add API resources for photos, plantings, and seeds; update application configuration
- Introduced `PhotoResource`, `PlantingResource`, and `SeedResource` to manage respective models.
- Updated application configuration to include API base URL.
- Modified production and test environments to set API base URL dynamically.
- Removed outdated JSONAPI resources initializers and patches.
- Refactored routes to use resourceful routing for API endpoints.
- Updated request specs to reflect changes in API responses and relationships.
- Added helper methods for generating related links in request specs.
2026-10-24 18:19:11 +13:00
Brenda Wallace e68c98fd38 Add JavaScript functionality for planting alternate names and tab navigation
- Implemented `planting_alternate_name.js` to load alternate names for crops in the planting form based on user input.
- Added `tab_navigation.js` to manage tab navigation and update the URL hash accordingly.

Update map rendering in member and place views

- Modified `_map.html.haml` to include a custom marker icon for member maps.
- Updated `index.html.haml` and `show.html.haml` to pass `places_map_data` to the map sections.

Refactor asset management in Rails application

- Removed Sprockets from the application configuration and adjusted asset paths.
- Updated asset precompilation settings and removed deprecated asset configurations from environment files.
- Added new build scripts for CSS and updated package dependencies in `package.json` for Bootstrap, Chart.js, and others.

Ensure React and CSS bundles are built before running tests

- Updated `react_bundle.rb` to check for the existence of both JavaScript and CSS bundles and build them if missing.
2026-10-20 23:55:33 +13:00
Brenda Wallace d112116148 Reduce memory store size in production configuration to optimize resource usage 2026-10-11 19:50:29 +13:00
Brenda WallaceandClaude Opus 5 888b0d1db9 Make memcached opt-in, default to a capped in-process cache
The free Memcachier dev plan is timing out on every call in production
(58 IO::TimeoutError in a 14 minute log window). Each request pays the
0.5s socket timeout and then renders uncached anyway, so the cache is
currently pure overhead on a dyno that is already being OOM-killed.

Memcached is now used only when USE_MEMCACHED=true and MEMCACHIER_SERVERS
is present. Otherwise production uses a memory store capped at 32MB via
RAILS_CACHE_SIZE_MB, so deploying restores real caching without the
timeouts and without an addon upgrade.

The memory store is per process, so homepage_stats gets an expires_in to
bound staleness. It is the only fragment that relies on expire_fragment
rather than a versioned cache key.

Sessions are cookie-based and every other cached value is either keyed by
cache_key_with_version or carries a TTL, so nothing depends on the cache
being shared between processes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-20 21:38:42 +12:00
Daniel O'Connorandgoogle-labs-jules[bot] a8053dd6b6 Change production log_level from :debug to :info by default (#4810)
Updated config/environments/production.rb to set config.log_level using
ENV.fetch("RAILS_LOG_LEVEL", "info").to_sym. This prevents excessive SQL
query logging in production by default while allowing configuration via
the RAILS_LOG_LEVEL environment variable.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-09-20 17:52:12 +09:30
Brenda WallaceandClaude Sonnet 5 571405a840 Stop Rack::Attack depending on memcached, and cut the memcached timeout (#4800)
* Keep Rack::Attack counters in process memory

Rack::Attack was storing its request counters in Rails.cache, which is
memcached in production. On 2026-09-19, memcached calls were timing out
in the production logs. When that happens, the counters stop working.

In the same log window, one IP made 753 requests. 717 of them
succeeded. The 15 per minute throttle and the 500 per day ban did not
stop it.

Rack::Attack now uses its own in-memory store, capped at 8 MB. Each
Puma worker keeps its own counters, so the limits apply per worker.

Refs #1640

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add BLOCKED_IPS list to Rack::Attack

When one crawler overloads the site, we need a fast way to block it.
Rack::Attack now blocks every IP listed in the BLOCKED_IPS environment
variable. The list is comma separated.

Setting the variable does not need a code change. It also keeps IP
addresses out of the repository.

Refs #1640

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Lower the memcached socket timeout to 0.5 seconds

The production cache store waited up to 1.5 seconds for each memcached
call. Dalli's own default is 1 second. Dalli also retries after a
failure, so one bad cache call can block a Puma thread for longer than
the timeout.

On 2026-09-19, the production logs showed memcached timeouts every few
seconds. With only 5 threads per Puma worker, blocked threads make the
site slow. Slow requests hold memory for longer.

The timeout is now 0.5 seconds. A healthy memcached call takes a few
milliseconds. A call that takes 0.5 seconds has failed in practice, so the
request is better off skipping the cache.

Refs #1640

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 13:36:25 +09:30
Daniel O'Connor 555d5ddf15 Revert "Replace Sidekiq with Solid Queue (#4619)" (#4620)
This reverts commit 4659ac5464.
2026-05-04 18:15:17 +09:30
4659ac5464 Replace Sidekiq with Solid Queue (#4619)
* Replace Sidekiq with Solid Queue

This commit transitions the background job processing from Sidekiq to
Solid Queue.

Changes:
- Replaced `sidekiq` gem with `solid_queue` in Gemfile.
- Updated `development.rb` and `production.rb` to use `:solid_queue` as
  the queue adapter.
- Added Solid Queue database tables via a new migration.
- Configured Solid Queue in `config/queue.yml` and `config/recurring.yml`.
- Integrated Solid Queue supervisor as a Puma plugin in `config/puma.rb`.
- Removed separate worker process from `Procfile`.
- Removed Sidekiq-specific configuration files.
- Updated Gemfile.lock to support both `ruby` and `x86_64-linux` platforms.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>

* Fix regression in gemfiles

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-05-03 15:29:03 +09:30
Daniel O'Connorandgoogle-labs-jules[bot] e63089e03b Remove deprecated config.read_encrypted_secrets from production.rb (#4603)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-04-30 12:54:17 +09:30
Daniel O'Connor 81060cccf7 Ruby 3.2: Rubocop - Lint/* and Style/* (#3786)
* Rubocop - Layout/*
* Rubocop - Lint and Style
2024-07-13 15:38:37 +09:30
Daniel O'Connor 4f5c47ba58 Ruby 3.2: Rubocop - Layout/* (#3785)
* Rubocop - Layout/*

* Regenerate
2024-07-13 15:19:09 +09:30
Daniel O'Connor d542326047 Ruby 3.2: Rubocop - Rails/FilePath (#3783)
* Rails/FilePath
2024-07-13 15:13:56 +09:30
Daniel O'Connor 26189855cc Reduce visual impact of hover, and make snappier (#3712)
* Reduce visual impact of hover, and make snappier

* Better seed

* Improve seeding

* Fix codespaces login
2024-04-07 22:17:16 +09:30
Daniel O'Connor 008667515e Swap from ugifier to terser 2024-01-27 01:28:55 +00:00
Daniel O'Connor f338274611 Rails 7.1 (#3590)
* Rails 7.1

* Update application.rb

* Bump searchkick

* Bump to 7.0.0

* Fix

* Fix crop search

* Sync translation

* Drop required from form group

* Loosen specs further

* Fix Gemfile

* Update seeds_request_spec.rb

* Update test.rb

* Rename
2024-01-27 10:06:47 +10:30
Cesy 3820b01769 Adding codespace host so you can view things in the browser 2023-04-13 16:50:23 +01:00
Daniel O'Connorandcodefactor-io e1fb08707a Issue/2419: Limit map to the most recent plantings only (#3191)
* For now, drop mapbox for OSM tiles

* For now, drop mapbox for OSM tiles

* Use OSM tiles

* Remove mapbox secrets for now. If we bring back mapbox; we should re-enstate

* Only show up to 200 plantings

* Update app/assets/javascripts/members.js.erb

* [CodeFactor] Apply fixes

* Update production.rb

---------

Co-authored-by: codefactor-io <support@codefactor.io>
2023-03-13 15:13:28 +10:30
Daniel O'Connor 449c6c4487 Issue/3189: Fix map displays by dropping mapbox (#3190)
* For now, drop mapbox for OSM tiles

* For now, drop mapbox for OSM tiles

* Use OSM tiles

* Remove mapbox secrets for now. If we bring back mapbox; we should re-enstate

* Update members.js.erb

* Change placeholder
2023-03-13 13:04:16 +10:30
Cesy 60608411ed Merge branch 'dev' into issue/1642 2022-12-17 10:41:35 +00:00
Cesy 59c212ecf5 Switching from SendGrid to Mailgun for sending emails 2022-12-15 10:35:52 +00:00
Daniel O'Connor 07feb1cd85 Drop tests 2022-12-10 15:54:58 +10:30
Brenda Wallace 9dbf8b7c8f New robocops 2020-08-26 12:36:58 +12:00
Brenda a4afeea025 Updated test stubs to support geocoder 1.6
https://github.com/alexreisner/geocoder/issues/1258
2020-06-20 10:57:03 +12:00
codefactor-io 4ff95fbac9 [CodeFactor] Apply fixes 2020-01-21 22:26:08 +13:00
Brenda 7257b2ada1 Update with frozen literals 2020-01-10 16:50:52 +13:00
Brenda Wallace 04fd1a343a Rubocop update (#2334)
* Update rubocop config

* Rubocop update - for rubocop 0.77

* [CodeFactor] Apply fixes

* rubocop fixes

* [CodeFactor] Apply fixes to commit 2826c2e
2019-12-16 22:35:33 +13:00
Brenda 9159df81c9 Turn on bullet in dev 2019-12-04 21:02:33 +13:00
Brenda Wallace 7b6dc1943a Fixes staging linking to production 2019-07-11 15:12:16 +00:00
Brenda Wallace f5f5ecdea7 Merge remote-tracking branch 'upstream/dev' into material-merge
Conflicts:
	Gemfile.lock
	app/assets/javascripts/application.js
	app/assets/stylesheets/application.sass
	app/assets/stylesheets/plantings.sass
	app/views/crops/_thumbnail.html.haml
	app/views/crops/show.html.haml
	app/views/home/_members.html.haml
	app/views/layouts/application.html.haml
	app/views/photos/show.html.haml
	app/views/plantings/_descendants.html.haml
	app/views/plantings/show.html.haml
	app/views/seeds/_thumbnail.html.haml
	app/views/shared/_global_actions.html.haml
	spec/models/crop_spec.rb
2019-04-21 11:27:27 +12:00
Brenda Wallace 10a7689b05 Lint 2019-04-20 19:30:09 +12:00
Brenda Wallace f60174a8b9 Merge remote-tracking branch 'upstream/dev' into feature/memcachier 2019-04-19 09:30:48 +12:00
Brenda Wallace ad90dd6dfa Fixes wrong host name in emails 2019-04-08 14:23:34 +12:00
Brenda Wallace 8e8c9d179b Added growstuff prefix to env variables 2019-03-26 15:57:29 +13:00
Brenda Wallace 607f0e3887 Rename to mapbox map id 2019-03-26 15:57:29 +13:00
Brenda Wallace 875fa49d44 Remove distinct staging env file 2019-03-26 15:57:29 +13:00
Brenda Wallace ba27e14226 Move mapbox config to env 2019-03-26 15:57:29 +13:00
Brenda Wallace 59b3a68fc3 Configure memcachier for production 2019-03-26 15:57:29 +13:00
Brenda Wallace 3ed173ebcd Material design changes 2019-02-17 21:33:36 +13:00
Brenda Wallace 5b732fedae Remove references to MANDRILL 2019-01-19 12:36:27 +13:00
Brenda Wallace f453682696 Fixing sendgrid 2019-01-19 12:33:58 +13:00
Brenda Wallace 6f23a203a2 Switch to SendGrid (remove sparkhost) 2019-01-19 11:57:50 +13:00
Brenda Wallace b6a7fa0efd Force to redirect to ssl 2019-01-19 08:51:55 +13:00
Brenda Wallace 656510855d Switch to new syntax for initing uglifier 2019-01-18 14:21:11 +13:00
Brenda Wallace 164e43f054 Merge remote-tracking branch 'upstream/dev' into upgrade/rails-5-2 2019-01-01 13:32:57 +13:00
Brenda Wallace a43c235423 Upgrade to Rails 5.2 2019-01-01 10:31:53 +13:00
Brenda Wallace a6a75050bb Make mail sender host configurable 2019-01-01 09:55:29 +13:00