-
-
Notifications
You must be signed in to change notification settings - Fork 1
tweak coolify env grabber and ensure all head links are https #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughThe changes enforce HTTPS across configuration and metadata. getCoolifyURL() now always returns an HTTPS URL with a simplified signature. Astro site config updates to call it without arguments. Head.astro adds a helper to convert any http URL to https for og, twitter, canonical, and URL meta tags. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Build/Runtime
participant Config as astro-config-utils.getCoolifyURL
participant Astro as Astro (Head.astro)
participant Meta as Head Meta Tags
Dev->>Config: getCoolifyURL()
Note right of Config: Reads COOLIFY_FQDN<br/>Selects first URL<br/>Forces HTTPS
Config-->>Dev: https://... (URL)
Dev->>Astro: Render page (Astro.url, ogImage)
Astro->>Astro: convertToHTTPS(Astro.url)
Astro->>Astro: convertToHTTPS(ogImage or '/og.png')
Astro->>Meta: Emit og:url, twitter:url, canonical, og:image, twitter:image (HTTPS)
Note over Meta: All public-facing URLs use HTTPS
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
… function and restore astro.config.mts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
www/astro-config-utils.ts(1 hunks)www/astro.config.mts(1 hunks)www/src/components/Head.astro(4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
www/astro.config.mts (1)
www/astro-config-utils.ts (1)
getCoolifyURL(17-25)
🔇 Additional comments (2)
www/astro.config.mts (1)
4-12: Site fallback now consistently defaults to HTTPSImporting the simplified helper and defaulting the
siteconfig to HTTPS keeps things tidy while still honoring env-based overrides. Looks good.www/src/components/Head.astro (1)
18-85: HTTPS sanitation in head metadata looks solidThe helper cleanly upgrades request and image URLs to HTTPS, and wiring
safeUrl/safeOgImagethrough Open Graph, Twitter, and canonical tags should eliminate the previous mixed-content edge cases. Nicely done.
This pull request focuses on improving URL handling throughout the codebase, particularly ensuring URLs use HTTPS for better security and simplifying related utility functions. The changes also update how environment variables are parsed and used, and make sure that Open Graph and Twitter meta tags consistently use HTTPS URLs.
URL Handling and Security Improvements:
convertToHTTPSfunction inHead.astroto ensure URLs use the HTTPS protocol for Open Graph and Twitter meta tags, and updated all relevant meta tags to use these safe URLs. [1] [2] [3] [4]stripHTTPandHTTPS,stripTrailingSlash,setHTTP) fromastro-config-utils.ts, keeping onlysetHTTPSfor consistent HTTPS enforcement.Environment Variable and Config Usage:
getCoolifyURLfunction inastro-config-utils.tsto always return an HTTPS URL and removed the option to return HTTP, improving consistency and security.astro.config.mtsto use the newgetCoolifyURLfunction, ensuring the site URL is always HTTPS and removing the legacy HTTP option.Summary by CodeRabbit
Bug Fixes
Refactor