Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/automated backups #2142

Merged
merged 25 commits into from
May 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix target forms
MattDHill committed May 9, 2023
commit ae38c57348f562c41549b58377d40c7f2cbb0591
Original file line number Diff line number Diff line change
@@ -1,59 +1,63 @@
import { InputSpec } from 'start-sdk/types/config-types'
import { InputSpec } from 'start-sdk/lib/config/configTypes'

export const DropboxSpec: InputSpec = {
name: {
type: 'string',
type: 'text',
inputmode: 'text',
minLength: null,
maxLength: null,
patterns: [],
name: 'Name',
description: 'A friendly name for this Dropbox target',
placeholder: 'My Dropbox',
nullable: false,
required: true,
masked: false,
warning: null,
textarea: false,
pattern: null,
'pattern-description': null,
default: null,
},
token: {
type: 'string',
type: 'text',
inputmode: 'text',
minLength: null,
maxLength: null,
patterns: [],
name: 'Access Token',
description: 'The secret access token for your custom Dropbox app',
warning: null,
placeholder: null,
nullable: false,
required: true,
masked: true,
textarea: false,
pattern: null,
'pattern-description': null,
default: null,
},
path: {
type: 'string',
type: 'text',
inputmode: 'text',
minLength: null,
maxLength: null,
patterns: [],
name: 'Path',
description: 'The fully qualified path to the backup directory',
warning: null,
placeholder: 'e.g. /Desktop/my-folder',
nullable: false,
required: true,
masked: false,
textarea: false,
pattern: null,
'pattern-description': null,
default: null,
},
}

export const GoogleDriveSpec: InputSpec = {
name: {
type: 'string',
type: 'text',
inputmode: 'text',
minLength: null,
maxLength: null,
patterns: [],
name: 'Name',
description: 'A friendly name for this Google Drive target',
warning: null,
placeholder: 'My Google Drive',
nullable: false,
required: true,
masked: false,
textarea: false,
pattern: null,
'pattern-description': null,
default: null,
},
key: {
@@ -62,111 +66,123 @@ export const GoogleDriveSpec: InputSpec = {
description:
'Your Google Drive service account private key file (.json file)',
warning: null,
placeholder: `e.g. 'My Computer' OR 'my-computer.local'`,
nullable: false,
required: true,
extensions: ['json'],
},
path: {
type: 'string',
type: 'text',
inputmode: 'text',
minLength: null,
maxLength: null,
patterns: [],
name: 'Path',
description: 'The fully qualified path to the backup directory',
placeholder: 'e.g. /Desktop/my-folder',
nullable: false,
required: true,
masked: false,
warning: null,
textarea: false,
pattern: null,
'pattern-description': null,
default: null,
},
}

export const CifsSpec: InputSpec = {
name: {
type: 'string',
type: 'text',
inputmode: 'text',
minLength: null,
maxLength: null,
patterns: [],
name: 'Name',
description: 'A friendly name for this Network Folder',
warning: null,
placeholder: 'My Network Folder',
nullable: false,
required: true,
masked: false,
textarea: false,
pattern: null,
'pattern-description': null,
default: null,
},
hostname: {
type: 'string',
type: 'text',
inputmode: 'text',
minLength: null,
maxLength: null,
patterns: [
{
regex: '^[a-zA-Z0-9._-]+( [a-zA-Z0-9]+)*$',
description: `Must be a valid hostname. e.g. 'My Computer' OR 'my-computer.local'`,
},
],
name: 'Hostname',
description:
'The hostname of your target device on the Local Area Network.',
warning: null,
textarea: false,
nullable: false,
required: true,
masked: false,
placeholder: `e.g. 'My Computer' OR 'my-computer.local'`,
pattern: '^[a-zA-Z0-9._-]+( [a-zA-Z0-9]+)*$',
'pattern-description': `Must be a valid hostname. e.g. 'My Computer' OR 'my-computer.local'`,
default: null,
},
path: {
type: 'string',
type: 'text',
inputmode: 'text',
minLength: null,
maxLength: null,
patterns: [],
name: 'Path',
description: `On Windows, this is the fully qualified path to the shared folder, (e.g. /Desktop/my-folder).\n\n On Linux and Mac, this is the literal name of the shared folder (e.g. my-shared-folder).`,
placeholder: 'e.g. my-shared-folder or /Desktop/my-folder',
nullable: false,
required: true,
masked: false,
warning: null,
textarea: false,
pattern: null,
'pattern-description': null,
default: null,
},
username: {
type: 'string',
type: 'text',
inputmode: 'text',
minLength: null,
maxLength: null,
patterns: [],
name: 'Username',
description: `On Linux, this is the samba username you created when sharing the folder.\n\n On Mac and Windows, this is the username of the user who is sharing the folder.`,
nullable: false,
required: true,
masked: false,
warning: null,
placeholder: 'My Network Folder',
textarea: false,
pattern: null,
'pattern-description': null,
default: null,
},
password: {
type: 'string',
type: 'text',
inputmode: 'text',
minLength: null,
maxLength: null,
patterns: [],
name: 'Password',
description: `On Linux, this is the samba password you created when sharing the folder.\n\n On Mac and Windows, this is the password of the user who is sharing the folder.`,
nullable: true,
required: false,
masked: true,
warning: null,
placeholder: 'My Network Folder',
textarea: false,
pattern: null,
'pattern-description': null,
default: null,
},
}

export const RemoteBackupTargetSpec: InputSpec = {
type: {
type: 'union',
name: 'Target Type',
description: null,
warning: null,
required: true,
variants: {
dropbox: DropboxSpec,
'google-drive': GoogleDriveSpec,
cifs: CifsSpec,
},
tag: {
id: 'type',
name: 'Target Type',
description: null,
warning: null,
'variant-names': {
dropbox: 'Dropbox',
'google-drive': 'Google Drive',
cifs: 'Network Folder',
dropbox: {
name: 'Dropbox',
spec: DropboxSpec,
},
'google-drive': {
name: 'Google Drive',
spec: GoogleDriveSpec,
},
cifs: {
name: 'Network Folder',
spec: CifsSpec,
},
},
default: 'dropbox',
@@ -175,29 +191,31 @@ export const RemoteBackupTargetSpec: InputSpec = {

export const DiskBackupTargetSpec: InputSpec = {
name: {
type: 'string',
type: 'text',
inputmode: 'text',
minLength: null,
maxLength: null,
patterns: [],
name: 'Name',
description: 'A friendly name for this physical target',
placeholder: 'My Physical Target',
nullable: false,
required: true,
masked: false,
warning: null,
textarea: false,
pattern: null,
'pattern-description': null,
default: null,
},
path: {
type: 'string',
type: 'text',
inputmode: 'text',
minLength: null,
maxLength: null,
patterns: [],
name: 'Path',
description: 'The fully qualified path to the backup directory',
placeholder: 'e.g. /Backups/my-folder',
nullable: false,
required: true,
masked: false,
warning: null,
textarea: false,
pattern: null,
'pattern-description': null,
default: null,
},
}