feat(cloudflare): add custom targets and node failover (#43)

* feat(cloudflare): add custom targets and node failover

* fix(cloudflare): propagate batch sync errors

---------

Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
Ryan
2026-10-07 11:29:41 +08:00
committed by GitHub
parent e49e0ad2bf
commit fd0e9acc2f
28 changed files with 1144 additions and 155 deletions
@@ -0,0 +1,16 @@
-- +goose Up
ALTER TABLE of_cf_pointing_groups
ADD COLUMN target_mode VARCHAR(16) NOT NULL DEFAULT 'node',
ADD COLUMN record_type VARCHAR(8) NOT NULL DEFAULT 'A',
ADD COLUMN record_content VARCHAR(255) NOT NULL DEFAULT '';
INSERT INTO w_schedules (id, name, task_type, cron, payload, is_active, created_at, updated_at)
VALUES (105, 'Cloudflare 节点故障回退检查', 'of_cloudflare_failover_check', '* * * * *', '{}', TRUE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
ON CONFLICT (id) DO NOTHING;
-- +goose Down
DELETE FROM w_schedules WHERE id = 105;
ALTER TABLE of_cf_pointing_groups
DROP COLUMN record_content,
DROP COLUMN record_type,
DROP COLUMN target_mode;
@@ -0,0 +1,14 @@
-- +goose Up
ALTER TABLE of_cf_pointing_groups ADD COLUMN target_mode VARCHAR(16) NOT NULL DEFAULT 'node';
ALTER TABLE of_cf_pointing_groups ADD COLUMN record_type VARCHAR(8) NOT NULL DEFAULT 'A';
ALTER TABLE of_cf_pointing_groups ADD COLUMN record_content VARCHAR(255) NOT NULL DEFAULT '';
INSERT INTO w_schedules (id, name, task_type, cron, payload, is_active, created_at, updated_at)
VALUES (105, 'Cloudflare 节点故障回退检查', 'of_cloudflare_failover_check', '* * * * *', '{}', 1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
ON CONFLICT (id) DO NOTHING;
-- +goose Down
DELETE FROM w_schedules WHERE id = 105;
ALTER TABLE of_cf_pointing_groups DROP COLUMN record_content;
ALTER TABLE of_cf_pointing_groups DROP COLUMN record_type;
ALTER TABLE of_cf_pointing_groups DROP COLUMN target_mode;