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

Feat: Standalone Storage Service #409

Merged
merged 2 commits into from
Jan 9, 2024
Merged

Feat: Standalone Storage Service #409

merged 2 commits into from
Jan 9, 2024

Conversation

fenos
Copy link
Contributor

@fenos fenos commented Jan 4, 2024

What kind of change does this PR introduce?

Standalone Storage Service

Base migrations are now part of the service.
Storage can now be run as a fully standalone service.

Fully decoupled from auth,realtime,postgrest

Notable changes

Migrations

Added a new migration 0002-storage-schema.sql

To keep backward compatibility and not break self-hosted instances the migration tool is now able to "refresh" the migrations table if it detects that the newly created migration is not present in the migrations records.

This refreshing mechanism only takes place for projects that have already run the migrations at least once.

New installations and new projects will start fresh and don't need to refresh

Granular Roles

Introduced 4 new environment variables for new installations

  • DB_ANON_ROLE default anon
  • DB_SERVICE_ROLE default service_role
  • DB_AUTHENTICATED_ROLE default authenticated
  • DB_INSTALL_ROLES default true
  • DB_SUPER_USER default supabase_storage_admin
  • DB_SEARCH_PATH default ''

If these roles are already present in the database we can simply pass DB_INSTALL_ROLES=false and the migration will not install these roles

@inian
Copy link
Member

inian commented Jan 5, 2024

I still see base migrations has a dependency on a extensions schema and supabase_admin. Do we really need supabase_admin role here? Shouldn't supabase_storage_admin role be sufficient?
Do we need realtime publication here?

Any other schema, extension or role thats not required for the standalone functioning of storage?

@fenos fenos force-pushed the fix/base-migrations branch 3 times, most recently from 5137ff6 to de282e9 Compare January 5, 2024 13:54
@fenos fenos changed the title fix: add base migrations to storage service Feat: Standalone Storage Service Jan 5, 2024
@fenos fenos force-pushed the fix/base-migrations branch from de282e9 to 2c21686 Compare January 5, 2024 14:16
@coveralls
Copy link

coveralls commented Jan 5, 2024

Pull Request Test Coverage Report for Build 7450741493

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.5%) to 84.248%

Totals Coverage Status
Change from base Build 7446101654: -0.5%
Covered Lines: 7851
Relevant Lines: 9245

💛 - Coveralls

@fenos fenos force-pushed the fix/base-migrations branch from 2c21686 to 531e8af Compare January 8, 2024 12:02
@fenos fenos force-pushed the fix/base-migrations branch from ffde5ec to c9787f2 Compare January 8, 2024 17:04
@fenos fenos merged commit b0331a1 into master Jan 9, 2024
1 check passed
@fenos fenos deleted the fix/base-migrations branch January 9, 2024 09:12
Copy link

🎉 This PR is included in version 0.44.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants