refactor: externalize hardcoded URLs to environment configuration#795
Open
vcnainala wants to merge 6 commits into
Open
refactor: externalize hardcoded URLs to environment configuration#795vcnainala wants to merge 6 commits into
vcnainala wants to merge 6 commits into
Conversation
Move S3 public and download bases to filesystems disk config with AWS_* defaults. Extend services.php for cheminf, citation, regapp OIDC, pubchem, npclassifier, taxonomy APIs, avatars, and coconut public URL. Document keys in .env.example and .env.ci. Set APP_URL default to http://localhost for local dev.
Expose filesystems.disks.s3.url and downloads_url via public_storage_url() and public_downloads_url() for consistent object-storage links in Blade and PHP.
Use services.* config for PubChem, NPClassifier, NFDI OIDC, OLS, GlobalNames, and ui-avatars. Use url() for collection DOI landing pages. Use public_storage_url in Filament collection image state.
Build CSP allowlists from app.url, services.coconut.public_url, S3 endpoints, cheminf, and citation services instead of hardcoded production hostnames.
Use url(), public_storage_url(), public_downloads_url(), and config-driven cheminf depict base in structure editor, download pages, and navigation.
CI caches config from .env.ci where NFDI_REDIRECT_URL is unset, causing Policy::add() to receive null and return 500 on email verification routes.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## development #795 +/- ##
================================================
+ Coverage 6.13% 6.38% +0.24%
- Complexity 1737 1744 +7
================================================
Files 227 227
Lines 8961 8992 +31
================================================
+ Hits 550 574 +24
- Misses 8411 8418 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
config/app.php,config/filesystems.php,config/services.php) backed by.envvariables documented in.env.exampleand.env.ci.public_storage_url()andpublic_downloads_url()helpers for S3/Ceph public object and release download links.config(),url(), and the new helpers.Commits
refactor(config)— env keys, filesystems S3/download URLs, services integrationsfeat(helper)—public_storage_url/public_downloads_urlrefactor(app)— PubChem, NPClassifier, OIDC, OLS, GlobalNames, avatars, DOI URLs, Filamentrefactor(csp)— configurable CSP originsrefactor(views)— Blade templates and structure editor cheminf depictConfiguration
New/updated env vars (see
.env.example):AWS_URL,AWS_ENDPOINT,AWS_BUCKET,AWS_USE_PATH_STYLE_ENDPOINT,AWS_DOWNLOADS_URL,COCONUT_PUBLIC_URL,CM_PUBLIC_API,API_URL, citation APIs,PUBCHEM_API_BASE,NP_CLASSIFIER_URL,NFDI_OIDC_BASE_URL,GLOBALNAMES_API_URL,OLS4_API_BASE,UI_AVATARS_URL.APP_URLconfig default is nowhttp://localhostfor local development.Test plan
php artisan config:clearsucceedsphp artisan test(28 passed, 4 skipped).envResolves
Closes #780