mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
feat(repositories): azure blob storage
This commit is contained in:
@@ -738,6 +738,19 @@ export type ListRepositoriesResponses = {
|
||||
endpoint: string;
|
||||
secretAccessKey: string;
|
||||
}
|
||||
| {
|
||||
accountKey: string;
|
||||
accountName: string;
|
||||
backend: "azure";
|
||||
container: string;
|
||||
endpointSuffix?: string;
|
||||
}
|
||||
| {
|
||||
backend: "gcs";
|
||||
bucket: string;
|
||||
credentialsJson: string;
|
||||
projectId: string;
|
||||
}
|
||||
| {
|
||||
backend: "local";
|
||||
name: string;
|
||||
@@ -748,7 +761,7 @@ export type ListRepositoriesResponses = {
|
||||
lastError: string | null;
|
||||
name: string;
|
||||
status: "error" | "healthy" | "unknown" | null;
|
||||
type: "local" | "s3";
|
||||
type: "azure" | "gcs" | "local" | "s3";
|
||||
updatedAt: number;
|
||||
}>;
|
||||
};
|
||||
@@ -765,6 +778,19 @@ export type CreateRepositoryData = {
|
||||
endpoint: string;
|
||||
secretAccessKey: string;
|
||||
}
|
||||
| {
|
||||
accountKey: string;
|
||||
accountName: string;
|
||||
backend: "azure";
|
||||
container: string;
|
||||
endpointSuffix?: string;
|
||||
}
|
||||
| {
|
||||
backend: "gcs";
|
||||
bucket: string;
|
||||
credentialsJson: string;
|
||||
projectId: string;
|
||||
}
|
||||
| {
|
||||
backend: "local";
|
||||
name: string;
|
||||
@@ -835,6 +861,19 @@ export type GetRepositoryResponses = {
|
||||
endpoint: string;
|
||||
secretAccessKey: string;
|
||||
}
|
||||
| {
|
||||
accountKey: string;
|
||||
accountName: string;
|
||||
backend: "azure";
|
||||
container: string;
|
||||
endpointSuffix?: string;
|
||||
}
|
||||
| {
|
||||
backend: "gcs";
|
||||
bucket: string;
|
||||
credentialsJson: string;
|
||||
projectId: string;
|
||||
}
|
||||
| {
|
||||
backend: "local";
|
||||
name: string;
|
||||
@@ -845,7 +884,7 @@ export type GetRepositoryResponses = {
|
||||
lastError: string | null;
|
||||
name: string;
|
||||
status: "error" | "healthy" | "unknown" | null;
|
||||
type: "local" | "s3";
|
||||
type: "azure" | "gcs" | "local" | "s3";
|
||||
updatedAt: number;
|
||||
};
|
||||
};
|
||||
@@ -1030,6 +1069,19 @@ export type ListBackupSchedulesResponses = {
|
||||
endpoint: string;
|
||||
secretAccessKey: string;
|
||||
}
|
||||
| {
|
||||
accountKey: string;
|
||||
accountName: string;
|
||||
backend: "azure";
|
||||
container: string;
|
||||
endpointSuffix?: string;
|
||||
}
|
||||
| {
|
||||
backend: "gcs";
|
||||
bucket: string;
|
||||
credentialsJson: string;
|
||||
projectId: string;
|
||||
}
|
||||
| {
|
||||
backend: "local";
|
||||
name: string;
|
||||
@@ -1040,7 +1092,7 @@ export type ListBackupSchedulesResponses = {
|
||||
lastError: string | null;
|
||||
name: string;
|
||||
status: "error" | "healthy" | "unknown" | null;
|
||||
type: "local" | "s3";
|
||||
type: "azure" | "gcs" | "local" | "s3";
|
||||
updatedAt: number;
|
||||
};
|
||||
repositoryId: string;
|
||||
@@ -1216,6 +1268,19 @@ export type GetBackupScheduleResponses = {
|
||||
endpoint: string;
|
||||
secretAccessKey: string;
|
||||
}
|
||||
| {
|
||||
accountKey: string;
|
||||
accountName: string;
|
||||
backend: "azure";
|
||||
container: string;
|
||||
endpointSuffix?: string;
|
||||
}
|
||||
| {
|
||||
backend: "gcs";
|
||||
bucket: string;
|
||||
credentialsJson: string;
|
||||
projectId: string;
|
||||
}
|
||||
| {
|
||||
backend: "local";
|
||||
name: string;
|
||||
@@ -1226,7 +1291,7 @@ export type GetBackupScheduleResponses = {
|
||||
lastError: string | null;
|
||||
name: string;
|
||||
status: "error" | "healthy" | "unknown" | null;
|
||||
type: "local" | "s3";
|
||||
type: "azure" | "gcs" | "local" | "s3";
|
||||
updatedAt: number;
|
||||
};
|
||||
repositoryId: string;
|
||||
@@ -1383,6 +1448,19 @@ export type GetBackupScheduleForVolumeResponses = {
|
||||
endpoint: string;
|
||||
secretAccessKey: string;
|
||||
}
|
||||
| {
|
||||
accountKey: string;
|
||||
accountName: string;
|
||||
backend: "azure";
|
||||
container: string;
|
||||
endpointSuffix?: string;
|
||||
}
|
||||
| {
|
||||
backend: "gcs";
|
||||
bucket: string;
|
||||
credentialsJson: string;
|
||||
projectId: string;
|
||||
}
|
||||
| {
|
||||
backend: "local";
|
||||
name: string;
|
||||
@@ -1393,7 +1471,7 @@ export type GetBackupScheduleForVolumeResponses = {
|
||||
lastError: string | null;
|
||||
name: string;
|
||||
status: "error" | "healthy" | "unknown" | null;
|
||||
type: "local" | "s3";
|
||||
type: "azure" | "gcs" | "local" | "s3";
|
||||
updatedAt: number;
|
||||
};
|
||||
repositoryId: string;
|
||||
|
||||
@@ -31,6 +31,7 @@ const defaultValuesForType = {
|
||||
local: { backend: "local" as const, compressionMode: "auto" as const },
|
||||
s3: { backend: "s3" as const, compressionMode: "auto" as const },
|
||||
gcs: { backend: "gcs" as const, compressionMode: "auto" as const },
|
||||
azure: { backend: "azure" as const, compressionMode: "auto" as const },
|
||||
};
|
||||
|
||||
export const CreateRepositoryForm = ({
|
||||
@@ -102,6 +103,7 @@ export const CreateRepositoryForm = ({
|
||||
<SelectItem value="local">Local</SelectItem>
|
||||
<SelectItem value="s3">S3</SelectItem>
|
||||
<SelectItem value="gcs">Google Cloud Storage</SelectItem>
|
||||
<SelectItem value="azure">Azure Blob Storage</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormDescription>Choose the storage backend for this repository.</FormDescription>
|
||||
@@ -244,6 +246,67 @@ export const CreateRepositoryForm = ({
|
||||
</>
|
||||
)}
|
||||
|
||||
{watchedBackend === "azure" && (
|
||||
<>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="container"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Container</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="my-backup-container" {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>Azure Blob Storage container name for storing backups.</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="accountName"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Account Name</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="mystorageaccount" {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>Azure Storage account name.</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="accountKey"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Account Key</FormLabel>
|
||||
<FormControl>
|
||||
<Input type="password" placeholder="••••••••" {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>Azure Storage account key for authentication.</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="endpointSuffix"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Endpoint Suffix (Optional)</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="core.windows.net" {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>Custom Azure endpoint suffix (defaults to core.windows.net).</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
{mode === "update" && (
|
||||
<Button type="submit" className="w-full" loading={loading}>
|
||||
Save Changes
|
||||
|
||||
Reference in New Issue
Block a user