Skip to content

Commit 5517e75

Browse files
feat: add rclone (#1362)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced full RClone remote management with creation, deletion, listing, and detailed remote info via a multi-step, schema-driven UI. - Added guided configuration forms supporting advanced and provider-specific options for RClone remotes. - Enabled flash backup initiation through API mutations. - Added new Vue components for RClone configuration, overview, remote item cards, and flash backup page. - Integrated new combobox, stepped layout, control wrapper, label renderer, and improved form renderers with enhanced validation and error display. - Added JSON Forms visibility composable and Unraid settings layout for consistent UI rendering. - **Bug Fixes** - Standardized JSON scalar usage in Docker-related types, replacing `JSONObject` with `JSON`. - **Chores** - Added utility scripts and helpers to manage rclone binary installation and versioning. - Updated build scripts and Storybook configuration for CSS handling and improved developer workflow. - Refactored ESLint config for modularity and enhanced code quality enforcement. - Improved component registration with runtime type checks and error handling. - **Documentation** - Added extensive test coverage for RClone API service, JSON Forms schema merging, and provider config slice generation. - **Style** - Improved UI consistency with new layouts, tooltips on select options, password visibility toggles, and error handling components. - Removed deprecated components and consolidated renderer registrations for JSON Forms. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent d37dc3b commit 5517e75

File tree

101 files changed

+9398
-858
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+9398
-858
lines changed

.cursor/rules/no-comments.mdc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: true
5+
---
6+
Never add comments for obvious things, and avoid commenting when starting and ending code blocks

.rclone-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.69.1

api/.env.development

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ PATHS_PARITY_CHECKS=./dev/states/parity-checks.log
1313
PATHS_CONFIG_MODULES=./dev/configs
1414
PATHS_ACTIVATION_BASE=./dev/activation
1515
PATHS_PASSWD=./dev/passwd
16+
PATHS_RCLONE_SOCKET=./dev/rclone-socket
17+
PATHS_LOG_BASE=./dev/log # Where we store logs
1618
ENVIRONMENT="development"
1719
NODE_ENV="development"
1820
PORT="3001"

api/generated-schema.graphql

Lines changed: 91 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,25 @@ type ParityCheckMutations {
946946
cancel: JSON!
947947
}
948948

949+
"""RClone related mutations"""
950+
type RCloneMutations {
951+
"""Create a new RClone remote"""
952+
createRCloneRemote(input: CreateRCloneRemoteInput!): RCloneRemote!
953+
954+
"""Delete an existing RClone remote"""
955+
deleteRCloneRemote(input: DeleteRCloneRemoteInput!): Boolean!
956+
}
957+
958+
input CreateRCloneRemoteInput {
959+
name: String!
960+
type: String!
961+
parameters: JSON!
962+
}
963+
964+
input DeleteRCloneRemoteInput {
965+
name: String!
966+
}
967+
949968
type ParityCheck {
950969
"""Date of the parity check"""
951970
date: DateTime
@@ -1299,20 +1318,15 @@ type DockerContainer implements Node {
12991318

13001319
"""Total size of all the files in the container"""
13011320
sizeRootFs: Int
1302-
labels: JSONObject
1321+
labels: JSON
13031322
state: ContainerState!
13041323
status: String!
13051324
hostConfig: ContainerHostConfig
1306-
networkSettings: JSONObject
1307-
mounts: [JSONObject!]
1325+
networkSettings: JSON
1326+
mounts: [JSON!]
13081327
autoStart: Boolean!
13091328
}
13101329

1311-
"""
1312-
The `JSONObject` scalar type represents JSON objects as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
1313-
"""
1314-
scalar JSONObject @specifiedBy(url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf")
1315-
13161330
enum ContainerState {
13171331
RUNNING
13181332
EXITED
@@ -1325,15 +1339,15 @@ type DockerNetwork implements Node {
13251339
scope: String!
13261340
driver: String!
13271341
enableIPv6: Boolean!
1328-
ipam: JSONObject!
1342+
ipam: JSON!
13291343
internal: Boolean!
13301344
attachable: Boolean!
13311345
ingress: Boolean!
1332-
configFrom: JSONObject!
1346+
configFrom: JSON!
13331347
configOnly: Boolean!
1334-
containers: JSONObject!
1335-
options: JSONObject!
1336-
labels: JSONObject!
1348+
containers: JSON!
1349+
options: JSON!
1350+
labels: JSON!
13371351
}
13381352

13391353
type Docker implements Node {
@@ -1342,6 +1356,49 @@ type Docker implements Node {
13421356
networks(skipCache: Boolean! = false): [DockerNetwork!]!
13431357
}
13441358

1359+
type FlashBackupStatus {
1360+
"""Status message indicating the outcome of the backup initiation."""
1361+
status: String!
1362+
1363+
"""Job ID if available, can be used to check job status."""
1364+
jobId: String
1365+
}
1366+
1367+
type RCloneDrive {
1368+
"""Provider name"""
1369+
name: String!
1370+
1371+
"""Provider options and configuration schema"""
1372+
options: JSON!
1373+
}
1374+
1375+
type RCloneBackupConfigForm {
1376+
id: ID!
1377+
dataSchema: JSON!
1378+
uiSchema: JSON!
1379+
}
1380+
1381+
type RCloneBackupSettings {
1382+
configForm(formOptions: RCloneConfigFormInput): RCloneBackupConfigForm!
1383+
drives: [RCloneDrive!]!
1384+
remotes: [RCloneRemote!]!
1385+
}
1386+
1387+
input RCloneConfigFormInput {
1388+
providerType: String
1389+
showAdvanced: Boolean = false
1390+
parameters: JSON
1391+
}
1392+
1393+
type RCloneRemote {
1394+
name: String!
1395+
type: String!
1396+
parameters: JSON!
1397+
1398+
"""Complete remote configuration"""
1399+
config: JSON!
1400+
}
1401+
13451402
type Flash implements Node {
13461403
id: PrefixedID!
13471404
guid: String!
@@ -1543,6 +1600,7 @@ type Query {
15431600
docker: Docker!
15441601
disks: [Disk!]!
15451602
disk(id: PrefixedID!): Disk!
1603+
rclone: RCloneBackupSettings!
15461604
health: String!
15471605
getDemo: String!
15481606
}
@@ -1572,12 +1630,16 @@ type Mutation {
15721630
vm: VmMutations!
15731631
parityCheck: ParityCheckMutations!
15741632
apiKey: ApiKeyMutations!
1633+
rclone: RCloneMutations!
15751634
updateApiSettings(input: ApiSettingsInput!): ConnectSettingsValues!
15761635
connectSignIn(input: ConnectSignInInput!): Boolean!
15771636
connectSignOut: Boolean!
15781637
setupRemoteAccess(input: SetupRemoteAccessInput!): Boolean!
15791638
setAdditionalAllowedOrigins(input: AllowedOriginInput!): [String!]!
15801639
enableDynamicRemoteAccess(input: EnableDynamicRemoteAccessInput!): Boolean!
1640+
1641+
"""Initiates a flash drive backup using a configured remote."""
1642+
initiateFlashBackup(input: InitiateFlashBackupInput!): FlashBackupStatus!
15811643
setDemo: String!
15821644
}
15831645

@@ -1674,6 +1736,22 @@ input AccessUrlInput {
16741736
ipv6: URL
16751737
}
16761738

1739+
input InitiateFlashBackupInput {
1740+
"""The name of the remote configuration to use for the backup."""
1741+
remoteName: String!
1742+
1743+
"""Source path to backup (typically the flash drive)."""
1744+
sourcePath: String!
1745+
1746+
"""Destination path on the remote."""
1747+
destinationPath: String!
1748+
1749+
"""
1750+
Additional options for the backup operation, such as --dry-run or --transfers.
1751+
"""
1752+
options: JSON
1753+
}
1754+
16771755
type Subscription {
16781756
displaySubscription: Display!
16791757
infoSubscription: Info!

api/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@
109109
"graphql-scalars": "^1.23.0",
110110
"graphql-subscriptions": "^3.0.0",
111111
"graphql-tag": "^2.12.6",
112-
"graphql-type-json": "^0.3.2",
113-
"graphql-type-uuid": "^0.2.0",
114112
"graphql-ws": "^6.0.0",
115113
"ini": "^5.0.0",
116114
"ip": "^2.0.1",

0 commit comments

Comments
 (0)