Skip to content

A modern, self-hosted backup solution for secure, encrypted backups across local and cloud storage.

10.4 KB
Raw Blame
const sftpSettings = [
	{
		label: 'SSH Host',
		command: '--sftp-host',
		fieldType: 'string',
		authFieldType: 'password',
		required: true,
		value: 'host',
		default: '',
		description: 'SSH host to connect to. E.g. "example.com".',
	},
	{
		label: 'SSH Port',
		command: '--sftp-port',
		fieldType: 'int',
		authFieldType: 'password',
		required: false,
		value: 'port',
		default: '22',
		description: 'SSH port number.',
	},
	{
		label: 'SSH Username',
		command: '--sftp-user',
		fieldType: 'string',
		authFieldType: 'password',
		required: false,
		value: 'user',
		default: '$user',
		description: 'SSH username.',
	},
	{
		label: 'SSH Password',
		command: '--sftp-pass',
		fieldType: 'password',
		authFieldType: 'password',
		required: false,
		value: 'pass',
		default: '',
		description: 'SSH password. Leave blank to use SSH agent.',
	},
	{
		label: 'PEM-Encoded Private Key',
		command: '--sftp-key-pem',
		fieldType: 'string',
		required: false,
		value: 'key_pem',
		default: '',
		description:
			'Raw PEM-encoded private key. Must be on a single line with line endings replaced by \\n.',
	},
	{
		label: 'Private Key File',
		command: '--sftp-key-file',
		fieldType: 'string',
		required: false,
		value: 'key_file',
		default: '',
		description:
			'Path to PEM-encoded private key file. Leave blank or enable Use SSH Agent to use an SSH agent.',
	},
	{
		label: 'Private Key Passphrase',
		command: '--sftp-key-file-pass',
		fieldType: 'password',
		required: false,
		authFieldType: 'all',
		value: 'key_file_pass',
		default: '',
		description:
			'Passphrase to decrypt the PEM-encoded private key file. Only old OpenSSH format encrypted keys are supported.',
	},
	{
		label: 'SSH Public Certificate',
		command: '--sftp-pubkey',
		fieldType: 'string',
		required: false,
		value: 'pubkey',
		default: '',
		description:
			'SSH public certificate for certificate-based authentication. If specified, overrides the Public Key File setting.',
	},
	{
		label: 'Public Key File',
		command: '--sftp-pubkey-file',
		fieldType: 'string',
		required: false,
		value: 'pubkey_file',
		default: '',
		description:
			'Optional path to public key file. Set this if you have a signed certificate you want to use for authentication.',
	},
	{
		label: 'Use SSH Agent',
		command: '--sftp-key-use-agent',
		fieldType: 'bool',
		required: false,
		value: 'key_use_agent',
		default: false,
		description:
			'Force the use of an SSH agent for authentication. When a Private Key File is also set, only the matching key is requested from the agent.',
	},
	{
		label: 'Allow Insecure Ciphers',
		command: '--sftp-use-insecure-cipher',
		fieldType: 'bool',
		required: false,
		value: 'use_insecure_cipher',
		default: false,
		description:
			'Enable the use of insecure ciphers and key exchange methods. Only use this if your server requires legacy encryption.',
	},
	{
		label: 'Disable Hash Check',
		command: '--sftp-disable-hashcheck',
		fieldType: 'bool',
		required: false,
		value: 'disable_hashcheck',
		default: false,
		description:
			'Disable checking for remote file hashing support. Leave disabled to enable hashing (recommended).',
	},
	{
		label: 'External SSH Binary',
		command: '--sftp-ssh',
		fieldType: 'spaceseplist',
		required: false,
		value: 'ssh',
		default: '',
		description:
			'Path and arguments to an external SSH binary. Use this if you need SSH options not supported by the built-in SSH library.',
	},
	{
		label: 'Known Hosts File',
		command: '--sftp-known-hosts-file',
		fieldType: 'string',
		required: false,
		value: 'known_hosts_file',
		default: '',
		description:
			'Optional path to known_hosts file. Set this value to enable server host key validation.',
	},
	{
		label: 'Ask for Password',
		command: '--sftp-ask-password',
		fieldType: 'bool',
		required: false,
		value: 'ask_password',
		default: false,
		description: 'Allow prompting for an SFTP password when none is configured.',
	},
	{
		label: 'SSH Path Override',
		command: '--sftp-path-override',
		fieldType: 'string',
		required: false,
		value: 'path_override',
		default: '',
		description:
			'Override path used by SSH shell commands. Use this when SFTP and SSH paths differ, such as on Synology NAS devices.',
	},
	{
		label: 'Set Remote Modified Time',
		command: '--sftp-set-modtime',
		fieldType: 'bool',
		required: false,
		value: 'set_modtime',
		default: true,
		description: 'Set the modified time on the remote if set.',
	},
	{
		label: 'Remote Shell Type',
		command: '--sftp-shell-type',
		fieldType: 'select',
		required: false,
		value: 'shell_type',
		default: '',
		description: 'The type of SSH shell on remote server, if any. Leave blank for autodetect.',
		options: [
			{ label: 'Autodetect', value: '' },
			{ label: 'No shell access', value: 'none' },
			{ label: 'Unix shell', value: 'unix' },
			{ label: 'PowerShell', value: 'powershell' },
			{ label: 'Windows Command Prompt', value: 'cmd' },
		],
	},
	{
		label: 'MD5 Hash Command',
		command: '--sftp-md5sum-command',
		fieldType: 'string',
		required: false,
		value: 'md5sum_command',
		default: '',
		description: 'The command used to read md5 hashes. Leave blank for autodetect.',
	},
	{
		label: 'SHA1 Hash Command',
		command: '--sftp-sha1sum-command',
		fieldType: 'string',
		required: false,
		value: 'sha1sum_command',
		default: '',
		description: 'The command used to read sha1 hashes. Leave blank for autodetect.',
	},
	{
		label: 'Skip Symlinks',
		command: '--sftp-skip-links',
		fieldType: 'bool',
		required: false,
		value: 'skip_links',
		default: false,
		description: 'Set to skip any symlinks and any other non regular files.',
	},
	{
		label: 'SSH Subsystem',
		command: '--sftp-subsystem',
		fieldType: 'string',
		required: false,
		value: 'subsystem',
		default: 'sftp',
		description: 'Specifies the SSH2 subsystem on the remote host.',
	},
	{
		label: 'SFTP Server Command',
		command: '--sftp-server-command',
		fieldType: 'string',
		required: false,
		value: 'server_command',
		default: '',
		description:
			'Path or command to run an SFTP server on the remote host. The SSH Subsystem setting is ignored when this is set.',
	},
	{
		label: 'Use fstat Instead of stat',
		command: '--sftp-use-fstat',
		fieldType: 'bool',
		required: false,
		value: 'use_fstat',
		default: false,
		description:
			'Use fstat instead of stat. Enable this if your server limits open files and throws errors when checking file status.',
	},
	{
		label: 'Disable Concurrent Reads',
		command: '--sftp-disable-concurrent-reads',
		fieldType: 'bool',
		required: false,
		value: 'disable_concurrent_reads',
		default: false,
		description:
			'Disable concurrent reads. Concurrent reads are normally safe and improve performance.',
	},
	{
		label: 'Disable Concurrent Writes',
		command: '--sftp-disable-concurrent-writes',
		fieldType: 'bool',
		required: false,
		value: 'disable_concurrent_writes',
		default: false,
		description:
			'Disable concurrent writes. Concurrent writes improve upload performance, especially for distant servers.',
	},
	{
		label: 'Idle Connection Timeout',
		command: '--sftp-idle-timeout',
		fieldType: 'duration',
		required: false,
		value: 'idle_timeout',
		default: '1m0s',
		description:
			'Max time before closing idle connections. If no connections are used within this time, the connection pool is emptied.',
	},
	{
		label: 'Chunk Size',
		command: '--sftp-chunk-size',
		fieldType: 'sizesuffix',
		required: false,
		value: 'chunk_size',
		default: '32ki',
		description:
			'Upload and download chunk size. Increasing this can significantly improve transfer speed on high-latency connections. Most servers support up to 255k.',
	},
	{
		label: 'Max Concurrent Requests per File',
		command: '--sftp-concurrency',
		fieldType: 'int',
		required: false,
		value: 'concurrency',
		default: '64',
		description:
			'Maximum number of outstanding requests for one file. Increasing this can improve throughput on high-latency connections at the cost of more memory.',
	},
	{
		label: 'Max Simultaneous Connections',
		command: '--sftp-connections',
		fieldType: 'int',
		required: false,
		value: 'connections',
		default: '0',
		description:
			'Maximum number of SFTP simultaneous connections, 0 for unlimited. Setting this is likely to cause deadlocks, so use with care.',
	},
	{
		label: 'Environment Variables',
		command: '--sftp-set-env',
		fieldType: 'spaceseplist',
		required: false,
		value: 'set_env',
		default: '',
		description: 'Environment variables to pass to SFTP commands.',
	},
	{
		label: 'Session Encryption Ciphers',
		command: '--sftp-ciphers',
		fieldType: 'spaceseplist',
		required: false,
		value: 'ciphers',
		default: '',
		description:
			'Space-separated list of ciphers for session encryption, ordered by preference. At least one must match the server configuration.',
	},
	{
		label: 'Key Exchange Algorithms',
		command: '--sftp-key-exchange',
		fieldType: 'spaceseplist',
		required: false,
		value: 'key_exchange',
		default: '',
		description:
			'Space-separated list of key exchange algorithms, ordered by preference. At least one must match the server configuration.',
	},
	{
		label: 'Message Authentication Code (MAC) Algorithms',
		command: '--sftp-macs',
		fieldType: 'spaceseplist',
		required: false,
		value: 'macs',
		default: '',
		description:
			'Space-separated list of MAC (message authentication code) algorithms, ordered by preference. At least one must match the server configuration.',
	},
	{
		label: 'Host Key Algorithms',
		command: '--sftp-host-key-algorithms',
		fieldType: 'spaceseplist',
		required: false,
		value: 'host_key_algorithms',
		default: '',
		description:
			'Space-separated list of host key algorithms, ordered by preference. At least one must match the server configuration.',
	},
	{
		label: 'SOCKS Proxy',
		command: '--sftp-socks-proxy',
		fieldType: 'string',
		required: false,
		value: 'socks_proxy',
		default: '',
		description:
			'Socks 5 proxy host. Supports the format user:pass@host:port, user@host:port, host:port.',
	},
	{
		label: 'Enable Hardlink Copy',
		command: '--sftp-copy-is-hardlink',
		fieldType: 'bool',
		required: false,
		value: 'copy_is_hardlink',
		default: false,
		description:
			'Enable server-side copies using hardlinks. The SFTP protocol does not natively support a copy command, so this uses hardlinks instead.',
	},
	{
		label: 'Description',
		command: '--sftp-description',
		fieldType: 'string',
		required: false,
		value: 'description',
		default: '',
		description: 'Description of the Storage.',
	},
];

export default sftpSettings;