feat/config export v1 payload - #1125
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42df072f90
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8350d11081
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
8350d11 to
276fa30
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 276fa30686
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| skipHostKeyCheck: z.boolean(), | ||
| knownHosts: z.string().optional(), | ||
| allowLegacySshRsa: z.boolean(), | ||
| allowUnsafeSymlinkTargets: z.boolean(), |
There was a problem hiding this comment.
Normalize legacy SFTP configs before encoding
When exporting an SFTP volume created before allowUnsafeSymlinkTargets was added, its persisted JSON has no such property because the field was introduced with a schema default but no lifecycle backfill; these volumes remain usable when parsed through the regular volume schema, which supplies false, but this required boolean makes encodeCurrentConfigTransferPayload reject the raw stored config. Normalize volume configs through the current schema before applying the frozen transfer schema, or make the encoder supply the legacy default.
Useful? React with 👍 / 👎.
| repositoryRef: transferRefSchema, | ||
| enabled: z.boolean(), | ||
| cronExpression: z.string(), | ||
| retentionPolicy: retentionPolicySchema.nullable(), |
There was a problem hiding this comment.
Normalize empty retention policies to null
When a transferred schedule contains retentionPolicy: {}, this schema preserves it as a non-null policy even though createSchedule and updateSchedule explicitly normalize an empty policy to null. If the decoded model is materialized as represented, post-backup maintenance treats the empty object as truthy and invokes restic forget without any keep rule, causing the retention task to fail after every backup instead of behaving as a schedule with no retention policy; reject the empty object or normalize it during decoding.
Useful? React with 👍 / 👎.
| ref: transferRefSchema, | ||
| name: z.string().min(1), | ||
| enabled: z.boolean(), | ||
| config: notificationConfigSchema, |
There was a problem hiding this comment.
Validate notification targets during import
When a payload contains a generic, Gotify, ntfy, or custom notification target that is malformed or not permitted by WEBHOOK_ALLOWED_ORIGINS, this schema accepts it even though normal destination creation calls assertNotificationTargetAllowed. Materializing the decoded destination leaves an apparently enabled notification that fails the same policy check on every test or delivery, so apply the target policy when importing the destination rather than accepting an unusable configuration.
Useful? React with 👍 / 👎.
Stack created with GitHub Stacks CLI • Give Feedback 💬