Skip to content
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

Branding: Change File IDs to full URL #5953

Closed
dennisreimann opened this issue Apr 24, 2024 · 2 comments · Fixed by #5947
Closed

Branding: Change File IDs to full URL #5953

dennisreimann opened this issue Apr 24, 2024 · 2 comments · Fixed by #5947
Assignees

Comments

@dennisreimann
Copy link
Member

dennisreimann commented Apr 24, 2024

For the branding properties, which refer to files (e.g. logo and CSS), we save the file ID and generate the URL when needed. Examples:

This makes it incompatible with the API, because the API does not offer file upload and setters for the file IDs.

The most practical way to fix this would be to switch from saving the file IDs to the full URL. This way the URLs could be read and set via the API without the need to also provide file upload via the API.

@dennisreimann dennisreimann self-assigned this Apr 24, 2024
@ndeet
Copy link
Contributor

ndeet commented Apr 24, 2024

Sounds great!

For internal files you might want to store the absolute path to the file and not the full URL with domain. E.g. I have a BTCPay instance with multiple domains mapped. I mean it would not be any problem if you use the full URL as long as that domain stays mapped. Problem will arise if you switch to another domain then the old asset links might break, this a big pain point with wordpress for example. So if possible, for internal URLs I would store the absolute path (/files/public/path/file-something-logo.png) because it will be domain agnostic.

@Kukks
Copy link
Member

Kukks commented Apr 25, 2024

how about we introduce format resolvers like "filed:xyz" or otherwise "https://xyz.com/image.png" or "base64..."

dennisreimann added a commit to dennisreimann/btcpayserver that referenced this issue Apr 26, 2024
dennisreimann added a commit to dennisreimann/btcpayserver that referenced this issue May 7, 2024
NicolasDorier pushed a commit to dennisreimann/btcpayserver that referenced this issue May 8, 2024
NicolasDorier added a commit that referenced this issue May 9, 2024
* Remove deprecated CSS options

Closes #5945.

* Greenfield: Add brandColor to store APIs

Closes #5946.

* Migrate file IDs to URLs

Closes #5953.

* Greenfield: Add CSS and logo URL to store settings API

Closes #5945.

* Add migration test

* Store and Server branding can reference file's via fileid:ID

* Add PaymentSoundUrl to Store API

---------

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
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 a pull request may close this issue.

3 participants