feat: add support for REST server

This commit is contained in:
Nicolas Meienberger
2025-11-16 18:24:09 +01:00
parent df6b70c96f
commit 4d48d7be58
5 changed files with 98 additions and 2 deletions

View File

@@ -84,6 +84,10 @@ const buildRepoUrl = (config: RepositoryConfig): string => {
return `azure:${config.container}:/`;
case "rclone":
return `rclone:${config.remote}:${config.path}`;
case "rest": {
const path = config.path ? `/${config.path}` : "";
return `rest:${config.url}${path}`;
}
default: {
throw new Error(`Unsupported repository backend: ${JSON.stringify(config)}`);
}
@@ -133,6 +137,15 @@ const buildEnv = async (config: RepositoryConfig) => {
}
break;
}
case "rest": {
if (config.username) {
env.RESTIC_REST_USERNAME = await cryptoUtils.decrypt(config.username);
}
if (config.password) {
env.RESTIC_REST_PASSWORD = await cryptoUtils.decrypt(config.password);
}
break;
}
}
return env;