Add Microsoft and Meta IP lists to the database

Modify the database migration script to insert Microsoft Azure and Meta/Facebook IP address lists, ensuring idempotency by checking for existing entries before insertion.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7a657272-55ba-4a79-9a2e-f1ed9bc7a528
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 6356f864-1db9-4ace-8af2-69d49012f49b
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/449cf7c4-c97a-45ae-8234-e5c5b8d6a84f/7a657272-55ba-4a79-9a2e-f1ed9bc7a528/vkzPhDc
This commit is contained in:
marco370 2026-02-14 09:46:56 +00:00
parent 5fdd99f585
commit 1bb9a65d0f

View File

@ -3,27 +3,17 @@
-- Microsoft Azure IP ranges (whitelist - cloud provider)
INSERT INTO public_lists (name, url, type, enabled, fetch_interval_minutes)
VALUES (
'Microsoft Azure',
SELECT 'Microsoft Azure',
'https://raw.githubusercontent.com/femueller/cloud-ip-ranges/master/microsoft-azure-ip-ranges.json',
'whitelist',
true,
60
) ON CONFLICT (name) DO UPDATE SET
url = EXCLUDED.url,
enabled = EXCLUDED.enabled;
'whitelist', true, 60
WHERE NOT EXISTS (SELECT 1 FROM public_lists WHERE name = 'Microsoft Azure');
-- Meta/Facebook IP ranges (whitelist - major service provider)
INSERT INTO public_lists (name, url, type, enabled, fetch_interval_minutes)
VALUES (
'Meta (Facebook)',
SELECT 'Meta (Facebook)',
'https://raw.githubusercontent.com/parseword/util-misc/master/block-facebook/facebook-ip-ranges.txt',
'whitelist',
true,
60
) ON CONFLICT (name) DO UPDATE SET
url = EXCLUDED.url,
enabled = EXCLUDED.enabled;
'whitelist', true, 60
WHERE NOT EXISTS (SELECT 1 FROM public_lists WHERE name = 'Meta (Facebook)');
-- Update schema version
UPDATE schema_version SET version = 9, updated_at = NOW();