Skip to content

Implemented voog footer and redis cache - #1584

Open
maricavor wants to merge 4 commits into
masterfrom
add-voog-footer
Open

Implemented voog footer and redis cache#1584
maricavor wants to merge 4 commits into
masterfrom
add-voog-footer

Conversation

@maricavor

@maricavor maricavor commented May 27, 2026

Copy link
Copy Markdown
Contributor

Overview
This PR significantly refactors the footer component to use the new voog_footer gem for managing dynamic footer content from the Voog CMS, adds Redis caching infrastructure, and improves invoice authorization security.

Key Changes

  1. Voog Footer Integration

Replaced legacy footer system with the new voog_footer gem (added to Gemfile)

Created config/initializers/voog_footer.rb to configure the VoogFooter with:

Site URL and API key support
Redis cache store integration with configurable TTL (default 3600s)
Locale support (English & Estonian)
SSL verification settings
Completely rewrote app/components/common/footer/component.rb (~437 lines):

Added sophisticated footer link mapping between app slots and Voog keys
Implemented fallback navigation columns for when Voog is disabled
Added support for dynamic footer navigation structure from Voog
Added footer contacts, social links, and highlight section rendering
Integrated social media link handling with icon mapping
Removed hardcoded footer links in favor of configuration-driven approach
Updated footer template (app/components/common/footer/component.html.erb):

Changed from hardcoded links to dynamic rendering using helper methods
Updated to render navigation columns using footer_navigation_columns
Added dynamic social links rendering
Cleaned up inline styles and made HTML more maintainable

  1. Redis Cache Support

Added Redis cache configuration in config/environments/production.rb:

Uses REDIS_CACHE_URL environment variable (defaults to localhost:6379/2)
Includes error handler for graceful cache failures
Updated config/cable.yml to use REDIS_CABLE_URL instead of generic REDIS_URL (better separation of concerns)

Removed Redis health check from bin/docker-entrypoint (likely handled elsewhere or simplified)

  1. Invoice Access Control Hardening
    Updated app/models/ability.rb: Changed Invoice authorization from allowing all invoice reads/updates to only allowing access to user's own invoices

Ruby
can %i[read update], Invoice, user_id: user.id # Previously: can %i[read update], Invoice
Updated app/controllers/invoices_controller.rb: Added user_id filtering in set_invoice to ensure users can only access their own invoices

Updated tests in test/integration/invoices_test.rb: Changed expected behavior from 500 errors to 404 (not found) when accessing other users' invoices

  1. Dependency Updates
    JWT gem pinned to version ~> 2.10.3 (was unpinned)
    Added voog_footer gem from GitHub: internetee/voog_footer

  2. Configuration & Localization
    Added configuration keys to config/customization.yml.sample:

voog_site_url, voog_api_key, voog_site_fetching_enabled, voog_footer_cache_ttl
Expanded English and Estonian locales in config/locales/common.*.yml:

Added labels section for footer link text (links may differ from labels)
Added social section for social media titles
Added links section with centralized footer URLs
Updated copyright year to 2026

  1. Cleanup
    Removed legacy footer fetcher: Deleted app/jobs/shared_footer_fetcher_job.rb (old manual footer HTML scraping approach)
    Removed cached footer helper: Deleted cached_footer from app/helpers/application_helper.rb
    Removed footer job reference from app/models/job.rb
    Removed Settings seeds for Voog configuration (now in config/customization.yml)
    Updated test fixtures in test/components/common/footer_test.rb to work with new component architecture

  2. New Assets
    Added SVG icons for social media:
    app/views/svg/_instagram.html.erb
    app/views/svg/_spotify.html.erb

  3. Other Updates
    Updated .dockerignore with comprehensive exclusion patterns
    Added health check route in config/routes.rb

@sonarqubecloud

Copy link
Copy Markdown

@maricavor
maricavor requested a review from OlegPhenomenon May 27, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant