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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add storage.file_size_limit_bytes config #494

Merged

Conversation

grschafer
Copy link
Contributor

What kind of change does this PR introduce?

Feature

Adds [storage] table to config.toml with a file_size_limit_bytes value that defaults to 50 MiB. This config value becomes the FILE_SIZE_LIMIT env var for the storage docker container.

What is the current behavior?

The storage-api's file size limit is hard-coded to 50 MiB and is not configurable.

This PR fixes #489

What is the new behavior?

The storage-api's file size limit can be configured in config.toml like below:

[storage]
# The maximum file size allowed, in bytes.
file_size_limit_bytes = 52428800

If the storage table or the file_size_limit_bytes key are not specified, the limit defaults to 50 MiB.

Additional context

I'm unfamiliar with Go, so please let me know if I did anything wrong! 馃榾

Adds [storage] table to config.toml with a file_size_limit_bytes value
that defaults to 50 MiB. This config value becomes the FILE_SIZE_LIMIT
env var for the storage docker container.

Fixes supabase#489
@grschafer grschafer requested a review from a team as a code owner September 30, 2022 20:30
Copy link
Contributor

@sweatybridge sweatybridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with just a small suggestion.

internal/utils/config.go Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Oct 2, 2022

Pull Request Test Coverage Report for Build 3212624764

  • 7 of 10 (70.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.07%) to 40.603%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/start/start.go 0 1 0.0%
internal/utils/config.go 7 9 77.78%
Totals Coverage Status
Change from base Build 3172031283: 0.07%
Covered Lines: 2048
Relevant Lines: 5044

馃挍 - Coveralls

grschafer added a commit to grschafer/supabase-cli that referenced this pull request Oct 3, 2022
It seems preferable to transform a config file value (and throw any
resulting errors) when parsing the config file, rather than waiting
until we're starting up containers.
@grschafer grschafer force-pushed the add-storage-filesizelimit-config branch from 012e632 to 55afc8b Compare October 3, 2022 22:33
@sweatybridge sweatybridge changed the title feat: Add storage.file_size_limit_bytes config feat: add storage.file_size_limit_bytes config Oct 9, 2022
@sweatybridge sweatybridge merged commit 201fbbc into supabase:main Oct 9, 2022
sweatybridge pushed a commit that referenced this pull request Oct 9, 2022
@github-actions
Copy link

github-actions bot commented Oct 9, 2022

馃帀 This PR is included in version 1.7.0 馃帀

The release is available on:

Your semantic-release bot 馃摝馃殌

@grschafer
Copy link
Contributor Author

Thanks for pushing this over the finish line! 馃帀

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.

Configurable storage FILE_SIZE_LIMIT
3 participants