Skip to content

Conversation

@kastov
Copy link
Contributor

@kastov kastov commented Dec 20, 2025

No description provided.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 20, 2025

Greptile Summary

This release refactors subscription page settings from environment variables to a centralized configuration system managed through the Remnawave API. The PR removes hardcoded META_TITLE, META_DESCRIPTION, and SUBSCRIPTION_UI_DISPLAY_RAW_KEYS environment variables, replacing them with dynamic settings fetched via SubpageConfigService.getBaseSettings().

Key changes:

  • Migrated meta tags (metaTitle, metaDescription) and connection keys visibility (showConnectionKeys) from environment config to subpage configuration
  • Added getBaseSettings() method in SubpageConfigService with fallback defaults when config is not found
  • Frontend: Added copyButton button type support with clipboard functionality and user notifications
  • Updated dependencies: @remnawave/backend-contract to 2.4.1 and @remnawave/subscription-page-types to 0.3.3
  • Cleaned up .env.sample to remove deprecated variables

Architecture impact:
The change centralizes configuration management, allowing different subscription pages to have distinct settings without requiring environment variable changes or service restarts.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The refactoring is well-structured with proper fallback handling. The getBaseSettings() method provides sensible defaults when configuration is missing. No breaking changes to existing functionality since the code gracefully handles missing configs. The dependency updates are minor version bumps. All changes follow established patterns in the codebase.
  • No files require special attention

Important Files Changed

Filename Overview
.env.sample Removed deprecated META_TITLE and META_DESCRIPTION environment variables, also removed SUBSCRIPTION_UI_DISPLAY_RAW_KEYS (now handled via subpage config)
backend/src/common/config/app-config/config.schema.ts Removed META_TITLE, META_DESCRIPTION, and SUBSCRIPTION_UI_DISPLAY_RAW_KEYS from environment config schema, reordered Marzban legacy fields
backend/src/modules/root/root.service.ts Replaced hardcoded environment config with getBaseSettings() service method for meta tags and connection keys visibility
backend/src/modules/root/subpage-config.service.ts Added getBaseSettings() method and replaced hardcoded UUID constant with imported SUBPAGE_DEFAULT_CONFIG_UUID
frontend/src/widgets/main/installation-guide/installation-guide.connector.tsx Added support for copyButton type in button configuration with clipboard functionality and user notifications

Sequence Diagram

sequenceDiagram
    participant User
    participant Browser
    participant RootController
    participant RootService
    participant SubpageConfigService
    participant AxiosService
    participant RemnawaveAPI

    User->>Browser: Access subscription page
    Browser->>RootController: GET /:shortUuid
    RootController->>RootService: serveSubscriptionPage()
    
    alt User Agent is Browser
        RootService->>RootService: isBrowser(userAgent)
        RootService->>RootService: returnWebpage()
        RootService->>AxiosService: getSubscriptionInfo(shortUuid)
        AxiosService->>RemnawaveAPI: Fetch subscription info
        RemnawaveAPI-->>AxiosService: Subscription data
        AxiosService-->>RootService: Subscription response
        
        RootService->>AxiosService: getSubpageConfig(shortUuid)
        AxiosService->>RemnawaveAPI: Fetch subpage config
        RemnawaveAPI-->>AxiosService: Subpage config (with UUID)
        AxiosService-->>RootService: Config response
        
        RootService->>SubpageConfigService: getBaseSettings(uuid)
        SubpageConfigService->>SubpageConfigService: Check subpageConfigMap
        alt Config found
            SubpageConfigService-->>RootService: {metaTitle, metaDescription, showConnectionKeys}
        else Config not found
            SubpageConfigService-->>RootService: Default settings
        end
        
        alt showConnectionKeys is false
            RootService->>RootService: Clear links and ssConfLinks
        end
        
        RootService->>Browser: Render page with dynamic meta tags
        Browser-->>User: Display subscription page
    end
Loading

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 20, 2025

Greptile's behavior is changing!

From now on, if a review finishes with no comments, we will not post an additional "statistics" comment to confirm that our review found nothing to comment on. However, you can confirm that we reviewed your changes in the status check section.

This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR".

@kastov kastov merged commit 0d3648f into main Dec 20, 2025
4 checks passed
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.

2 participants