Skip to content

Commit 8b5cd70

Browse files
committed
notarize rclone for Mac, tests with S3, Dropbox and GDrive
1 parent ad23a01 commit 8b5cd70

File tree

5 files changed

+46
-27
lines changed

5 files changed

+46
-27
lines changed

Documentation/Classes/FileTransfer_rclone.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ result.list contains collection, each representing one file/directory:
215215
- MimeType // such as application/pdf
216216
- ModTime // ISO Format, 2014-06-18T20:31:41+02:00
217217
- IsDir // true/false if directory
218+
- ID // optional, depending of service (GDrive, Dropbox)
219+
- IsBucket // optional, depending of service (S3)
218220

219221
This function uses [lsjson](https://rclone.org/commands/rclone_lsjson/).
220222

Project/Sources/Classes/FileTransfer_rclone.4dm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Function getDirectoryListing($targetpath : Text)->$success : Object
2121
$url:="lsjson "+This:C1470._wrapRemote($targetpath)
2222
$success:=This:C1470._runWorker($url)
2323
If ($success.success)
24-
If ($success.data="[@")
24+
If ($success.data="[@]\n")
2525
$json:=JSON Parse:C1218($success.data)
2626
$success.list:=$json
2727
Else
@@ -30,6 +30,7 @@ Function getDirectoryListing($targetpath : Text)->$success : Object
3030
End if
3131
End if
3232

33+
3334
Function upload($sourcepath : Text; $targetpath : Text)->$success : Object
3435
//$sourcepath just file name for local directory, else full path in POSIX syntax
3536
// targetpath is full remote path (starting with /, ending with file name

Project/Sources/Methods/test_rclone.4dm

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,38 @@
33
// url like ftp.4D.com or ftp.4d.com:1234
44
// if you use ftps or sftp, also modify the last parameter (protocol) in .new() below
55
// don't add the protocol to the hostname, don't use https://xxx or ftp://xxx
6-
$credentialspath:=Get 4D folder:C485(Database folder:K5:14)
7-
$folder:=Folder:C1567($credentialspath; fk platform path:K87:2)
8-
$credentialsfile:=$folder.parent.file("credentials.txt").getText()
9-
$credentials:=JSON Parse:C1218($credentialsfile)
10-
If (False:C215)
11-
$credentials.url:="192.168.10.54:3421"
12-
// $credentials.user:="myself"
13-
// $credentials.pass:="notmypass"
14-
End if
156

7+
$test:="S3"
168
var $ftp : cs:C1710.FileTransfer_rclone
17-
18-
//$ftp:=cs.FileTransfer_rclone.new("ftp_nas")
19-
If (True:C214)
20-
$ftp:=cs:C1710.FileTransfer_rclone.new("Devcon")
21-
$ftp.setPath("/users/thomas/Desktop/rclone-v1.59.1-osx-arm64/rclone")
22-
23-
Else
24-
$ftp:=cs:C1710.FileTransfer_rclone.new(":ftp") //not a config name, but service name
25-
$ftp.setPath("/users/thomas/Desktop/rclone-v1.59.1-osx-arm64/rclone")
26-
27-
$pass:=$ftp.obscure($credentials.pass)
28-
$url:=Replace string:C233($credentials.url; ":3421"; "")
29-
$port:="3421"
30-
$ftp.setPrefix("--ftp-host "+$url+" --ftp-port 3421 --ftp-user "+$credentials.user+" --ftp-pass "+$pass)
31-
End if
9+
$path:="/users/thomas/Desktop/rclone-v1.59.1-osx-arm64/rclone"
10+
11+
Case of
12+
: ($test="credentials")
13+
$credentialspath:=Get 4D folder:C485(Database folder:K5:14)
14+
$folder:=Folder:C1567($credentialspath; fk platform path:K87:2)
15+
$credentialsfile:=$folder.parent.file("credentials.txt").getText()
16+
$credentials:=JSON Parse:C1218($credentialsfile)
17+
If (False:C215)
18+
$credentials.url:="192.168.10.54:3421"
19+
// $credentials.user:="myself"
20+
// $credentials.pass:="notmypass"
21+
End if
22+
23+
$ftp:=cs:C1710.FileTransfer_rclone.new(":ftp") //not a config name, but service name
24+
$ftp.setPath($path)
25+
26+
$pass:=$ftp.obscure($credentials.pass)
27+
$url:=Replace string:C233($credentials.url; ":3421"; "")
28+
$port:="3421"
29+
$ftp.setPrefix("--ftp-host "+$url+" --ftp-port 3421 --ftp-user "+$credentials.user+" --ftp-pass "+$pass)
30+
31+
: ($test="ftp")
32+
//$ftp:=cs.FileTransfer_rclone.new("ftp_nas")
33+
$ftp:=cs:C1710.FileTransfer_rclone.new("Devcon")
34+
Else
35+
$ftp:=cs:C1710.FileTransfer_rclone.new($test)
36+
End case
37+
$ftp.setPath($path)
3238

3339
If (False:C215)
3440
$result:=$ftp.version()

optional/rclone/HowToBuildYourself.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ this should return:
1414
x86_64 arm64
1515

1616

17-
Now sign it:
18-
codesign --sign "Developer ID Application: 4D Deutschland GmbH" /Users/thomas/Desktop/rclone/rclone
17+
Now sign it (replace path to 4D depending of your version):
18+
codesign --force --sign "Developer ID Application: 4D Deutschland GmbH" --verbose --timestamp --options runtime --entitlements /Applications/4D\ v19\ R6/4D.app/Contents/Resources/4D.entitlements /Users/thomas/Desktop/rclone/rclone
1919

20+
21+
22+
Finally notarize. To do so, you need to prepare your computer, as described here:
23+
https://blog.4d.com/how-to-notarize-your-merged-4d-application-macos-12-xcode-13/
24+
25+
Zip with:
26+
/usr/bin/ditto -c -k --keepParent /Users/thomas/Desktop/rclone/rclone /Users/thomas/Desktop/rclone/rclone.zip
27+
28+
Notarize with:
29+
xcrun notarytool submit /Users/thomas/Desktop/rclone/rclone.zip --keychain-profile notarytool --wait

optional/rclone/rclone.zip

947 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)