This commit is contained in:
hailin 2025-05-26 17:13:17 +08:00
parent 30e1cde3b2
commit ccac741f70
2 changed files with 11 additions and 10 deletions

View File

@ -204,20 +204,20 @@ BEGIN
IF NOT EXISTS (
SELECT 1 FROM pg_policies WHERE policyname = 'anon upload profile_images'
) THEN
EXECUTE $$CREATE POLICY "anon upload profile_images"
ON storage.objects
FOR INSERT
TO anon
WITH CHECK (bucket_id = 'profile_images')$$;
EXECUTE 'CREATE POLICY "anon upload profile_images"
ON storage.objects
FOR INSERT
TO anon
WITH CHECK (bucket_id = ''profile_images'')';
END IF;
IF NOT EXISTS (
SELECT 1 FROM pg_policies WHERE policyname = 'anon read profile_images'
) THEN
EXECUTE $$CREATE POLICY "anon read profile_images"
ON storage.objects
FOR SELECT
TO anon
USING (bucket_id = 'profile_images')$$;
EXECUTE 'CREATE POLICY "anon read profile_images"
ON storage.objects
FOR SELECT
TO anon
USING (bucket_id = ''profile_images'')';
END IF;
END$$;

View File

@ -12,6 +12,7 @@ export STORAGE_BACKEND="file"
export FILE_SIZE_LIMIT=52428800 # 50 * 1024 * 1024
export FILE_STORAGE_BACKEND_PATH="/var/lib/storage"
export DB_INSTALL_ROLES="true"
export MULTI_TENANT=false
# 等待 gotrue 服务可用(健康检查)
echo "[storage-api] Waiting for GoTrue at /user..."