You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.7 KiB
1.7 KiB
Create the avatars storage bucket
If you see "Bucket not found" when saving a profile with an uploaded image, the avatars bucket does not exist yet. Create it once using one of the methods below.
Option 1: Supabase Dashboard (recommended)
- Open your project: https://supabase.com/dashboard (or your self‑hosted URL, e.g.
https://supa1.satoshinakamoto.win). - Go to Storage in the left sidebar.
- Click New bucket.
- Set:
- Name:
avatars(must be exactly this). - Public bucket: ON (so avatar URLs work without signed links).
- File size limit:
2MB (optional). - Allowed MIME types:
image/jpeg,image/png,image/gif,image/webp(optional).
- Name:
- Click Create bucket.
Then add policies so users can upload only to their own folder and everyone can read:
- Open the avatars bucket.
- Go to Policies (or Storage → Policies).
- Add policies equivalent to the ones in
supabase/migrations/20250213200000_profiles_avatar_and_storage.sql(from the line-- RLS: allow authenticated users...onward), or run that part of the migration in the SQL Editor.
Option 2: SQL Editor (if your Supabase allows it)
Run in SQL Editor:
INSERT INTO storage.buckets (id, name, public, file_size_limit, allowed_mime_types)
VALUES (
'avatars',
'avatars',
true,
2097152,
ARRAY['image/jpeg', 'image/png', 'image/gif', 'image/webp']
)
ON CONFLICT (id) DO NOTHING;
If you get an error (e.g. column names or schema differ), use Option 1 instead.
After the bucket exists, run the storage RLS policies from supabase/migrations/20250213200000_profiles_avatar_and_storage.sql (the CREATE POLICY statements for storage.objects) so uploads and public read work correctly.