175 Commits

Author SHA1 Message Date
9c8f045db8 updated README
All checks were successful
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-12 19:32:23 -05:00
d06b24674f updated build system
All checks were successful
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-12 19:04:05 -05:00
7299c4e96a build fails for unsupported os
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
BlockStorage/repertory_mac/pipeline/head This commit looks good
2025-08-12 18:51:17 -05:00
beaf4194c2 updated build system 2025-08-12 18:48:10 -05:00
877715aa22 updated build system 2025-08-12 18:43:55 -05:00
a16a795300 updated build system 2025-08-12 18:40:36 -05:00
7de7462548 updated build system 2025-08-12 18:30:52 -05:00
3effb4c80a updated build system 2025-08-12 18:28:15 -05:00
02d59cb047 [ui] Add auto-mount on first launch functionality #52
All checks were successful
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-08 19:07:13 -05:00
6968feac7e fix link error
Some checks failed
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-08 09:40:02 -05:00
c38e1ce43b fix
Some checks failed
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-08-08 09:15:40 -05:00
efbdd08187 cleanup
Some checks failed
BlockStorage/repertory/pipeline/head Build queued...
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
2025-08-08 09:12:43 -05:00
fcd88f8c3f hash passwords
Some checks reported errors
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-08-08 09:09:53 -05:00
546455eedc daemonize on unix
Some checks failed
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
2025-08-08 08:47:50 -05:00
70bcfe9a9a fix
Some checks failed
BlockStorage/repertory/pipeline/head Build queued...
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
2025-08-08 08:28:29 -05:00
0150cb2918 macos test fixes
Some checks failed
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-08 08:27:04 -05:00
5c5b7047a0 Create macOS bundle for simplified installation #58
Some checks failed
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-07 21:56:34 -05:00
b0c9d55658 Create macOS bundle for simplified installation #58
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-07 21:44:16 -05:00
c7e27c0080 Create macOS bundle for simplified installation #58 2025-08-07 21:19:24 -05:00
28800625e4 Create macOS bundle for simplified installation #58 2025-08-07 21:16:54 -05:00
666b3f2dc5 macos fix
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-07 18:40:34 -05:00
95cc859c9a spelling
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-07 18:35:16 -05:00
e8f0b3d8dc macos build fixes 2025-08-07 18:34:26 -05:00
7bfb4a9518 Create macOS bundle for simplified installation #58
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-07 14:22:38 -05:00
3f502eeb64 Create macOS bundle for simplified installation #58 2025-08-07 14:21:33 -05:00
4dcd7bd5ce added test retry
All checks were successful
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-06 17:40:23 -05:00
6821cf3707 fix
All checks were successful
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-06 17:14:54 -05:00
8a68d025b5 refactor test
Some checks failed
BlockStorage/repertory_mac/pipeline/head Build queued...
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-08-06 15:20:37 -05:00
6bc11ec727 fix
Some checks reported errors
BlockStorage/repertory/pipeline/head Build queued...
BlockStorage/repertory_mac/pipeline/head Something is wrong with the build of this commit
2025-08-06 15:11:08 -05:00
b8daf9b9b7 refactor
Some checks reported errors
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-08-06 14:53:59 -05:00
63ef79f441 updated CHANGELOG.md
Some checks failed
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-08-06 08:34:41 -05:00
f83b5d8d07 cleanup
Some checks failed
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-08-06 08:22:56 -05:00
cac52f739f fix
Some checks reported errors
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-08-06 07:30:56 -05:00
02045dfd07 fix
Some checks failed
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
2025-08-06 07:27:58 -05:00
1a86fc5c29 fix
Some checks failed
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
2025-08-06 07:25:47 -05:00
ba82f322af fix
Some checks failed
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
2025-08-06 07:22:48 -05:00
2a40d8207e fix
Some checks reported errors
BlockStorage/repertory_mac/pipeline/head Something is wrong with the build of this commit
2025-08-06 07:22:09 -05:00
62a06281ab refactor
Some checks failed
BlockStorage/repertory/pipeline/head Build queued...
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
2025-08-06 07:19:52 -05:00
3a2e83682e refactor
Some checks reported errors
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-08-05 19:01:29 -05:00
b28496c7b6 macos fixes 2025-08-05 18:43:16 -05:00
bea5e02c2e fix
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
2025-08-05 17:39:02 -05:00
de3eec47a0 cleanup
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-08-05 15:45:45 -05:00
08449b2468 fix linux
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-08-05 15:21:22 -05:00
84794ce862 fix
Some checks reported errors
BlockStorage/repertory_mac/pipeline/head Something is wrong with the build of this commit
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-08-05 15:01:56 -05:00
21fc375ce0 fix
Some checks reported errors
BlockStorage/repertory_mac/pipeline/head Something is wrong with the build of this commit
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-08-05 14:53:54 -05:00
f73cd9b6cf macos fixes
Some checks failed
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-08-05 14:28:39 -05:00
f674017610 macos fixs 2025-08-05 09:37:28 -05:00
48852b00f8 fix
All checks were successful
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-04 22:47:47 -05:00
28480b1ee5 fix
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
BlockStorage/repertory_mac/pipeline/head This commit looks good
2025-08-04 22:35:18 -05:00
5916f438ca fix
Some checks reported errors
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-08-04 22:23:57 -05:00
957a9f9c15 refactor
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
BlockStorage/repertory_mac/pipeline/head This commit looks good
2025-08-04 22:15:23 -05:00
efafa6bf68 common background fork 2025-08-04 22:15:09 -05:00
e88d53760d try to fix boost asio
All checks were successful
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-04 11:14:19 -05:00
ccb56485d8 don't cache disconnected sockets
Some checks failed
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-04 10:59:03 -05:00
c91e51a445 clear cache on close all
Some checks failed
BlockStorage/repertory/pipeline/head Build queued...
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
2025-08-04 10:52:01 -05:00
1a6ab2d020 fix
All checks were successful
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-04 10:40:39 -05:00
6dd96939c4 clear cache on failure
Some checks failed
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-08-04 10:34:06 -05:00
06aee5a899 test refactor
Some checks failed
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-04 10:14:17 -05:00
f56302769c added macos delivery
All checks were successful
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-04 09:00:37 -05:00
3e1d7e5e9b check remote prior to mount 2025-08-04 08:48:57 -05:00
ccbf64678e updated build system
All checks were successful
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-03 15:07:28 -05:00
a6ea47e1b0 refactor
Some checks failed
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-08-03 14:56:21 -05:00
dcddca16f3 updated build system
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
BlockStorage/repertory_mac/pipeline/head This commit looks good
2025-08-03 14:54:46 -05:00
25668a8d83 fix
Some checks failed
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-08-03 14:38:51 -05:00
8068adb1bf fix
Some checks are pending
BlockStorage/repertory_mac/pipeline/head Build queued...
2025-08-03 14:36:59 -05:00
c79af5b085 fix
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
BlockStorage/repertory_mac/pipeline/head This commit looks good
2025-08-03 14:32:40 -05:00
08057672d9 fix 2025-08-03 14:27:10 -05:00
542c8b9f32 enable macos tests
All checks were successful
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-03 13:51:24 -05:00
0cad44cd4e fix remote test
All checks were successful
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-03 13:42:55 -05:00
549afeacee linux fix
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
BlockStorage/repertory_mac/pipeline/head This commit looks good
2025-08-03 13:33:19 -05:00
e79322f670 fix
Some checks reported errors
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-08-03 13:26:36 -05:00
10e7f72eab fix
Some checks failed
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-08-03 10:54:18 -05:00
7c2ecd3340 fix response data
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
BlockStorage/repertory_mac/pipeline/head This commit looks good
2025-08-03 10:43:22 -05:00
29aaf625c7 Add macOS support #34
Some checks failed
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-08-03 10:41:21 -05:00
eee832ce49 fix linux
Some checks failed
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-08-02 20:45:52 -05:00
d8f3f87760 fix macos unit tests
Some checks failed
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-08-02 20:43:31 -05:00
2df11b693c fix macos deadlock
Some checks failed
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-08-02 19:18:22 -05:00
3805a27cd5 revert
All checks were successful
BlockStorage/repertory_mac/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-02 16:40:48 -05:00
d09bd35646 fix
Some checks failed
BlockStorage/repertory_mac/pipeline/head There was a failure building this commit
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-02 16:37:49 -05:00
5bbdcd9fb6 macos builds
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
BlockStorage/repertory_mac/pipeline/head Something is wrong with the build of this commit
2025-08-02 13:37:34 -05:00
437a3444ec Add macOS support #34
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-02 13:24:19 -05:00
77e0633c38 refactor
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-02 11:12:09 -05:00
ad5794c223 macos fixes 2025-08-02 10:55:00 -05:00
fdec5f7b6e fix
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
2025-08-02 10:24:22 -05:00
Scott E. Graves
fd1d32d314 Add macOS support #34
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-02 10:22:54 -05:00
0ca1a12cd4 updated build system
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-01 16:17:34 -05:00
6d456e5a7a Add macOS support #34
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-01 09:45:54 -05:00
07b6b5fca2 Add macOS support #34 2025-08-01 09:39:19 -05:00
15579ef3cb Add macOS support #34
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-01 08:04:34 -05:00
d9dd2a59e7 Add macOS support #34
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-08-01 07:57:42 -05:00
d45d91340f Add macOS support #34
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-08-01 07:42:58 -05:00
039ff6ba42 Add macOS support #34
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-08-01 14:39:34 +02:00
81c6875382 Add macOS support #34
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-08-01 14:12:27 +02:00
1bbe078799 updated build system
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-31 21:46:12 -05:00
17082eb271 update 2025-07-31 21:37:09 -05:00
9e5e775c71 update 2025-07-31 21:36:37 -05:00
bf63bdb8ea lfs 2025-08-01 04:22:13 +02:00
a0c412bd66 Add macOS support #34
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
2025-08-01 04:20:51 +02:00
d40ff7d14d Add macOS support #34
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-01 03:50:33 +02:00
85609be4b6 Add macOS support #34
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-08-01 03:21:01 +02:00
83fb6aaec3 fix
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-31 11:35:52 -05:00
22f546f14d fix test
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-07-31 11:09:15 -05:00
54376ae84a enable testing 2025-07-31 10:13:18 -05:00
2ac0f8fc52 copy icon
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-31 08:01:14 -05:00
bca7012d10 added macos icons 2025-07-31 07:58:01 -05:00
00b11da712 Create Windows installer #53
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-07-31 07:56:26 -05:00
b438b1b1f1 Merge remote-tracking branch 'remotes/origin/master' into v2.1.0-rc-develop
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
# Conflicts:
#	CHANGELOG.md
#	config.sh
#	repertory/repertory/src/ui/handlers.cpp
2025-07-31 07:04:42 -05:00
5ab7301cbe v2.0.7-release (#56)
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
Reviewed-on: #56
2025-07-31 06:58:43 -05:00
b360335655 merge
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-30 18:09:29 -05:00
2cba8936c4 updated version
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/pr-master This commit looks good
2025-07-30 18:00:53 -05:00
f8451c5514 refactor
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
BlockStorage/repertory/pipeline/pr-master This commit looks good
2025-07-30 17:43:19 -05:00
462a9446bd fix
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
BlockStorage/repertory/pipeline/pr-master Something is wrong with the build of this commit
2025-07-30 17:37:07 -05:00
a0a0d92169 updated CHANGELOG.md
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-30 15:26:15 -05:00
7fb34c1b4a Merge remote-tracking branch 'remotes/origin/v2.0.7-release-develop' into v2.1.0-rc-develop
# Conflicts:
#	CHANGELOG.md
#	config.sh
2025-07-30 15:25:31 -05:00
2ca345df8c updated CHANGELOG.md
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
2025-07-30 15:23:06 -05:00
2d53671fdf [bug] Directory entries . and .. are incorrectly being reported as files in Linux remote mounts #57
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
BlockStorage/repertory/pipeline/pr-master There was a failure building this commit
2025-07-30 15:22:13 -05:00
03b810ec75 updated CHANGELOG.md
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-30 15:15:57 -05:00
3f4b88a2c6 [bug] UI is unable to launch repertory.exe on Windows when absolute path contains spaces #55
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
BlockStorage/repertory/pipeline/pr-master There was a failure building this commit
2025-07-30 15:10:25 -05:00
0ad54c25a7 start minimized
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-30 14:47:16 -05:00
d97949cc3a Create Windows installer #53
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-30 14:30:20 -05:00
b1a1824050 Create Windows installer #53
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-30 14:12:04 -05:00
75fe994e95 Create Windows installer #53
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-30 13:55:19 -05:00
9d020dd241 Create Windows installer #53
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-30 12:31:47 -05:00
cbb2bfa73d Create Windows installer #53
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-07-30 12:15:58 -05:00
0404950693 Create Windows installer #53 2025-07-30 12:12:18 -05:00
9948df0541 Create Windows installer #53
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-07-30 12:06:21 -05:00
c53ab513a0 fix
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-07-30 11:55:29 -05:00
9e76f88c8f Create Windows installer #53
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
2025-07-30 11:44:39 -05:00
8da2a7d27a Merge branch 'v2.1.0-rc-develop' of ssh://git.fifthgrid.com:3022/blockstorage/repertory into v2.1.0-rc-develop
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-30 11:26:22 -05:00
025a5a0db7 fix mount failure when path contains a space 2025-07-30 11:23:00 -05:00
5fc391e5c0 spelling
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-30 11:21:56 -05:00
5357486659 fix mount failure when path contains a space 2025-07-30 07:56:11 -05:00
d8774ba7f7 Create Windows installer #53 2025-07-30 07:52:54 -05:00
1e7e304b43 Create Windows installer #53 2025-07-30 07:49:58 -05:00
17b7b09333 Create Windows installer #53 2025-07-30 07:49:34 -05:00
5f4b853764 fix mount failure when path contains a space 2025-07-29 15:16:34 -05:00
6d0f2a6c36 fix
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-29 14:28:25 -05:00
ccdbf2efde updated CHANGELOG.md
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-29 14:14:43 -05:00
e02eebba99 (Create Windows installer #53) ([ui] UI console window should close after launch #51) 2025-07-29 14:11:51 -05:00
7d06fb5617 Create Windows installer #53
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-29 12:48:32 -05:00
66053df28f Create Windows installer #53
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-29 10:59:18 -05:00
6920db4c88 updated build system
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-29 09:05:59 -05:00
e37b2492e9 Create Windows installer #53
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-29 08:07:49 -05:00
2435a765f0 Create Windows installer #53 2025-07-29 08:06:44 -05:00
f88e4181f1 Create Windows installer #53 2025-07-29 08:04:36 -05:00
5d2a1b0c17 Create Windows installer #53 2025-07-29 07:58:26 -05:00
1fff514e4e Create Windows installer #53
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-07-28 15:27:53 -05:00
2f14e0f054 Create Windows installer #53 2025-07-28 15:27:43 -05:00
0c049a17f6 Create Windows installer #53
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-07-28 13:14:28 -05:00
1390f96fdc Create Windows installer #53 2025-07-28 13:03:27 -05:00
1d7a3f5125 Create Windows installer #53 2025-07-28 12:47:27 -05:00
a9ebc52514 Create Windows installer #53 2025-07-28 11:53:54 -05:00
ca9eaf0249 Create Windows installer #53 2025-07-28 10:40:24 -05:00
7601746093 Create Windows installer #53 2025-07-28 10:37:03 -05:00
42f83170f7 Create Windows installer #53 2025-07-28 10:27:55 -05:00
9722cc06ff Create Windows installer #53 2025-07-28 10:24:54 -05:00
3d063a8ec2 Create Windows installer #53 2025-07-28 09:48:35 -05:00
b6719846bf Remove 'default' as initial bucket name for Sia #54
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-28 09:06:52 -05:00
9ed4187593 Remove 'default' as initial bucket name for Sia #54
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-07-28 08:20:13 -05:00
8c0bbe05ee Remove 'default' as initial bucket name for Sia #54
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-07-28 08:01:38 -05:00
c8b6d5053e Remove 'default' as initial bucket name for Sia #54
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-28 07:25:25 -05:00
4cf339cfc4 fix . and .. incorrectly being reported as files
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-26 13:37:59 -05:00
6fe23f270a fix . and .. incorrectly being reported as files 2025-07-26 13:17:06 -05:00
c85fe76a48 flutter ugrades
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-26 12:46:16 -05:00
4508b6d908 fix . and .. incorrectly being reported as files
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-26 11:04:59 -05:00
c74a70ce13 fix . and .. incorrectly being reported as files 2025-07-26 11:03:24 -05:00
f5e88e44bf cleanup
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
2025-07-26 08:59:33 -05:00
f11f92ba55 updated build system
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-26 08:52:20 -05:00
14d0173bd3 fix link
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-07-25 09:26:31 -05:00
5b56c73528 updated version
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-07-25 07:59:25 -05:00
87d336141c v2.0.6-release (#50)
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
Reviewed-on: #50
2025-07-25 07:51:03 -05:00
62555e6125 v2.0.5-rc (#41)
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
Reviewed-on: #41
2025-03-26 07:02:38 -05:00
24418ba03d v2.0.4-rc (#37)
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
# Changelog

## v2.0.4-rc

### BREAKING CHANGES

* `renterd` v2.0.0+ is now required. Prior versions will fail to mount.

### Issues

* \#35 [bug] Low frequency check is set to '0' instead of 1 hour by default
* \#36 [bug] Max cache size bytes is set to '0' by default

### Changes from v2.0.3-rc

* Added Sia API version check prior to mounting
* Added back `-cv` (check version) CLI option
* Continue documentation updates
* Fixed setting `ApiAuth` via `set_value_by_name`
* Fixed setting `HostConfig.ApiUser` via `set_value_by_name`
* Fixed setting `HostConfig.Path` via `set_value_by_name`
* Fixed setting `HostConfig.Protocol` via `set_value_by_name`
* Improved ring buffer read-ahead
* Integrated `renterd` version 2.0.0
* Prefer using local cache file when opening files
* Refactored `app_config` unit tests
* Refactored polling to be more accurate on scheduling tasks

Reviewed-on: #37
2025-02-22 09:48:00 -06:00
fa439c634f v2.0.3-rc (#32)
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
# Changelog

## v2.0.3-rc

### Issues

* \#28 \[bug\] Address slow directory responses in S3 mounts for deeply nested directories
* \#29 \[bug\] S3 error responses are not being logged
* \#30 \[bug\] Sia provider error responses are not logged
* \#31 \[bug\] S3 provider should limit max key size to 1024

### Changes from v2.0.2-rc

* Always use direct for read-only providers
* Fixed externally removed files not being processed during cleanup
* Fixed http headers not being added for requests
* Fixed incorrect `stat` values for remote mounts
* Fixed invalid directory nullptr error on remote mounts
* Fixed memory leak in event system
* Refactored application shutdown
* Refactored event system
* Updated build system to Alpine 3.21.0
* Updated build system to MinGW-w64 12.0.0
* Updated copyright to 2018-2025

Reviewed-on: #32
2025-02-11 17:26:24 -06:00
8dd46b8ad8 v2.0.2-rc (#27)
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
## v2.0.2-rc

### BREAKING CHANGES

* Refactored `config.json` - will need to verify configuration settings prior to mounting

### Issues

* \#12 \[Unit Test\] Complete all providers unit tests
* \#14 \[Unit Test\] SQLite mini-ORM unit tests and cleanup
* \#16 Add support for bucket name in Sia provider
* \#17 Update to common c++ build system
  * A single 64-bit Linux Jenkins server is used to build all Linux and Windows versions
  * All dependency sources are now included
  * MSVC is no longer supported
  * MSYS2 is required for building Windows binaries on Windows
  * OS X support is temporarily disabled
* \#19 \[bug\] Rename file is broken for files that are existing
* \#23 \[bug\] Incorrect file size displayed while upload is pending
* \#24 RocksDB implementations should be transactional
* \#25 Writes should block when maximum cache size is reached
* \#26 Complete ring buffer and direct download support

### Changes from v2.0.1-rc

* Ability to choose between RocksDB and SQLite databases
* Added direct reads and implemented download fallback
* Corrected file times on S3 and Sia providers
* Corrected handling of `chown()` and `chmod()`
* Fixed erroneous download of chunks after resize

Reviewed-on: #27
2024-12-28 15:56:40 -06:00
655 changed files with 72527 additions and 38318 deletions

View File

@@ -99,7 +99,7 @@ PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false

View File

@@ -1,10 +1,30 @@
---
Checks: '-*,clang-diagnostic-*,clang-analyzer-*,bugprone-*,concurrency-*,cppcoreguidelines-*,modernize-*,readability-*,-readability-redundant-access-specifiers,-readability-function-cognitive-complexity'
ExtraArgs: '-Wno-unknown-warning-option'
Checks: [
'-*',
'clang-diagnostic-*',
'clang-analyzer-*',
'bugprone-*',
'concurrency-*',
'cppcoreguidelines-*',
'modernize-*',
'readability-*',
'-readability-redundant-access-specifiers',
'-readability-function-cognitive-complexity'
]
ExtraArgs: ['-Wno-unknown-warning-option']
FormatStyle: none
HeaderFileExtensions: ['', 'h','hh','hpp','hxx']
HeaderFilterRegex: ''
ImplementationFileExtensions: ['c','cc','cpp','cxx']
CheckOptions:
- key: MinimumExceptionNameLength
value: 1
- key: MinimumLoopCounterNameLength
value: 3
- key: MinimumParameterNameLength
value: 3
- key: MinimumVariableNameLength
value: 3
User: 'scott.e.graves@protonmail.com'
WarningsAsErrors: ''
...

5
.clangd Normal file
View File

@@ -0,0 +1,5 @@
{
"CompileFlags": {
"Remove": ["-flarge-source-files", "-fext-numeric-literals"]
}
}

View File

@@ -1,3 +1,9 @@
_lseeki64
_mkgmtime
_sh_denyno
_sh_denyrd
_sh_denyrw
_spawnv
aarch64
advapi32
armv8
@@ -11,16 +17,26 @@ bugprone
cflags
chrono
cmake_current_source_dir
coinit_apartmentthreaded
comdlg32
cppcoreguidelines
cppdbg
cppflags
cpphttplib
cpptrace
cppvsdbg
create_notraverse
crypto_aead_xchacha20poly1305_ietf_npubbytes
cstdint
curl_zstd
curle_couldnt_resolve_host
curlopt_aws_sigv4
cxxflags
cxxstd
d_largefile64_source
d_largefile_source
d_ndebug
dacl_security_information
dbackward_shared
dbghelp
dboost_root
@@ -29,6 +45,9 @@ dcli11_warnings_as_errors
dcmake_cxx_flags
dcpphttplib_openssl_support
dcpphttplib_tcp_nodelay
dcpptrace_static_define
dcpptrace_unwind_with_execinfo
dcpptrace_unwind_with_libunwind
dcurl_ca_bundle
dcurl_ca_fallback
dcurl_disable_ldap
@@ -36,11 +55,13 @@ dcurl_staticlib
dcurl_use_libpsl
dcurl_use_libssh2
dcurl_zlib
dcurl_zstd
ddebug
decmult_gen_prec_bits
decmult_window_size
degl
denable_threaded_resolver
deps
devent__disable_openssl
devent__disable_tests
devent__library_type
@@ -65,7 +86,9 @@ drocksdb_install_on_windows
dshared
dspdlog_fmt_external
dthreads_prefer_pthread_flag
dunw_local_only
duse_libidn2
duse_nghttp2
duuid_build_tests
dwith_benchmark
dwith_gflags
@@ -76,17 +99,29 @@ ecdh
endforeach
endfunction
eventlib
expect_streq
fallocate
fallocate_impl
fext
fgetattr
fgetattr_impl
filebase
flac_version
flag_nopath
flarge
fontconfig_version
freetype2_version
fsetattr_x
fusermount
futimens
getxtimes
glapi
gmock
googletest
gpath
gtest_version
has_setxattr
hkey
httpapi
httplib
icudata
@@ -94,11 +129,15 @@ icui18n
icuuc
iostreams
iphlpapi
ipstream
jthread
libbitcoin
libbitcoinsystem
libcurl
libdsm
libevent
libexample
libexpat
libfuse3
libgmock
libgtest
@@ -109,41 +148,92 @@ libsfml
libsodium_type
libuuid
libuuid_include_dirs
libvlc
linkflags
localappdata
lpbyte
lpthread
lptr
lpwstr
markdownlint
mbig
minio
msvc
msvcr120
msys2
mtune
musl-libc
mwindows
nana
ncrypt
nlohmann
nlohmann_json
nmakeprg
noappledouble
nohup
nominmax
ntstatus
nullptr
nuspell_version
oleaut32
openal_version
openssldir
osascript
osxfuse
pistream
pkgconfig
plarge_integer
plex
println
project_enable_fontconfig
project_enable_gtkmm
project_enable_libdsm
project_enable_nana
project_macos_icns_name
propgrid
psecurity_descriptor
pthreads
pugi
pugixml_project
puint32
pvoid
pwstr
rdrw
remote_winfsp
renterd
richtext
rocksdb_library
rpcrt4
s_igid
s_isvtx
s_iuid
sddl_revision_1
secp256k1
secur32
sfml_project
shlwapi
sigchld
skynet
source_subdir
spdlog
spdlog_project
st_ctim
startf_useshowwindow
startupinfoa
static-libgcc
static-libstdc++
stbuf
stduuid_project
strequal
sw_shownoactivate
ularge_integer
uring
url
userenv
utimens_impl
utimensat
vorbis_version
waggressive
wall
wcast-align
wconversion
@@ -151,8 +241,10 @@ wdouble-promotion
wduplicated-branches
wduplicated-cond
wextra
wfloat
wformat=2
winfsp
winfsp_drive
winhttp
wininet
winspool
@@ -168,5 +260,6 @@ wserialization
wshadow
wsign-conversion
wunused
wuseless
wxwidgets_version
xattr

5
.gitattributes vendored Normal file
View File

@@ -0,0 +1,5 @@
*.msi filter=lfs diff=lfs merge=lfs -text
*.tar.gz filter=lfs diff=lfs merge=lfs -text
*.tar.xz filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text

12
.gitignore vendored
View File

@@ -1,12 +1,16 @@
.DS_Store
.cache/
.vs/
Info.plist
build*/
compile_commands.json
cspell.json
.vs/
support/Dockerfile
dist/
deps/
dist/
override.sh
repertory.iss
scripts/cleanup.cmd
scripts/cleanup.sh
version.rc
support/Dockerfile
version.cpp
version.rc

View File

@@ -4,7 +4,9 @@ pipeline {
agent none
environment {
PROJECT_TEST_DIR = "${HOME}/.ci/cfg"
DEVELOPER_PRIVATE_KEY = "/.ci/repertory/cert/developer.priv"
DEVELOPER_PUBLIC_KEY = "/.ci/repertory/cert/developer.pub"
PROJECT_TEST_CONFIG_DIR = "/.ci/repertory/test"
}
options {
@@ -19,7 +21,7 @@ pipeline {
steps {
retry(2) {
sleep time: 5, unit: 'SECONDS'
sh 'scripts/make_unix.sh x86_64'
sh 'scripts/make_unix.sh'
}
}
}
@@ -46,11 +48,24 @@ pipeline {
}
}
stage('linux_x86_64_test') {
agent any
steps {
retry(2) {
sleep time: 5, unit: 'SECONDS'
sh 'scripts/run_tests.sh'
}
}
}
stage('deliver') {
agent any
steps {
sh 'echo skipping deliver'
sh 'scripts/deliver.sh /mnt/repertory "" "" "" "" 1 1'
sh 'scripts/deliver.sh /mnt/repertory "" aarch64'
sh 'scripts/deliver.sh /mnt/repertory'
}
}
}

60
.jenkins_macos Normal file
View File

@@ -0,0 +1,60 @@
#!groovy
pipeline {
agent none
environment {
DEVELOPER_PRIVATE_KEY = "${env.HOME}/.ci/repertory/cert/developer.priv"
DEVELOPER_PUBLIC_KEY = "${env.HOME}/.ci/repertory/cert/developer.pub"
PROJECT_TEST_CONFIG_DIR = "${env.HOME}/.ci/repertory/test"
}
options {
disableConcurrentBuilds()
retry(2)
}
stages {
stage('darwin_aarch64') {
agent any
steps {
retry(2) {
sleep time: 5, unit: 'SECONDS'
sh 'scripts/make_unix.sh aarch64'
}
}
}
stage('darwin_x86_64') {
agent any
steps {
retry(2) {
sleep time: 5, unit: 'SECONDS'
sh 'scripts/make_unix.sh x86_64'
}
}
}
stage('darwin_aarch64_test') {
agent any
steps {
retry(2) {
sleep time: 5, unit: 'SECONDS'
sh 'scripts/run_tests.sh aarch64'
}
}
}
stage('deliver') {
agent any
steps {
sh "scripts/deliver.sh ${env.HOME}/mnt/repertory '' aarch64"
sh "scripts/deliver.sh ${env.HOME}/mnt/repertory '' x86_64"
}
}
}
}

View File

@@ -18,14 +18,14 @@ if vim.env.NV_DARCULA_ENABLE_DAP then
local externalConsole = gos.is_windows
local type = "cppdbg"
local cwd = gpath.create_path("./build")
local cwd = gpath.create_path("./dist/debug/shared/linux/x86_64/repertory/")
dap.configurations.cpp = {
{
name = "Mount",
type = type,
request = "launch",
program = function()
return gpath.create_path(cwd, "repertory")
return gpath.create_path(cwd, "bin/repertory")
end,
cwd = cwd,
stopAtEntry = true,
@@ -36,8 +36,9 @@ if vim.env.NV_DARCULA_ENABLE_DAP then
type = type,
request = "launch",
program = function()
return gpath.create_path(cwd, "repertory_tests")
return gpath.create_path(cwd, "bin/repertory_test")
end,
args={"--gtest_filter=utils_db*"},
cwd = cwd,
stopAtEntry = true,
externalConsole=externalConsole,

View File

@@ -1,36 +0,0 @@
{
"configurations": {
"UnixDebug": {
"adapter": "vscode-cpptools",
"configuration": {
"request": "launch",
"program": "${workspaceRoot}/build/debug/repertory",
"args": ["-f", "/home/sgraves/mnt"],
"cwd": "${workspaceRoot}/build/debug",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"stopAtEntry": true,
"logging": {
"engineLogging": false
}
}
},
"UnixDebugTest": {
"adapter": "vscode-cpptools",
"configuration": {
"request": "launch",
"program": "${workspaceRoot}/build/debug/unittests",
"args": ["--gtest_filter=file_manager.can_close_after_download_timeout"],
"cwd": "${workspaceRoot}/build",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"stopAtEntry": true,
"logging": {
"engineLogging": false
}
}
}
}
}

View File

@@ -1,20 +1,148 @@
# Changelog
## v2.0.2-rc
## v2.1.0-rc
### Issues
* \#12 [Unit Test] Complete all providers unit tests
* Switched to common build system
* \#34 Add macOS support
* \#51 [ui] UI console window should close after launch
* \#53 Create Windows installer
* \#54 Remove 'default' as initial bucket name for Sia
* \#58 Create macOS bundle for simplified installation
* \#59 [bug] [ui] UI is hanging after launching repertory mount in background
## v2.0.7-release
### Issues
* \#55 [bug] UI is unable to launch `repertory.exe` on Windows when absolute path contains spaces
* \#57 [bug] Directory entries . and .. are incorrectly being reported as files in Linux remote mounts
## v2.0.6-release
<!-- markdownlint-disable-next-line -->
### Issues
* \#42 [bug] Remote mount directory listing on Windows connected to Linux is failing
* \#43 [bug] Directories are not importing properly for Sia
* \#44 [bug] Windows-to-Linux remote mount ignores `CREATE_NEW`
* \#45 [bug] Windows-to-Linux remote mount is not handling attempts to remove a non-empty directory properly
* \#46 [bug] Changes to maximum cache size should be updated live
* \#47 [bug] Windows-to-Linux remote mount is allowing directory rename when directory is not empty
* \#48 [bug] Windows-to-Linux remote mount overlapped I/O is not detecting EOF for read operations
* \#49 [ui] Implement provider test button
### Changes from v2.0.5-rc
* Added request retry on `libcurl` error code `CURLE_COULDNT_RESOLVE_HOST`
* Added `libcurl` DNS caching
* Drive letters in UI should always be lowercase
* Fixed WinFSP directory rename for non-empty directories
* Fixed segfault in UI due to incorrect `SIGCHLD` handling
* Migrated to v2 error handling
* Upgraded WinFSP to v2.1 (2025)
## v2.0.5-rc
<!-- markdownlint-disable-next-line -->
### Issues
* \#39 Create management portal in Flutter
### Changes from v2.0.4-rc
* Continue documentation updates
* Fixed `-status` command erasing active mount information
* Fixed overlapping HTTP REST API port's
* Refactored/fixed instance locking
* Removed passwords and secret key values from API calls
* Renamed setting `ApiAuth` to `ApiPassword`
* Require `--name,-na` option for encryption provider
## v2.0.4-rc
### BREAKING CHANGES
* `renterd` v2.0.0+ is now required. Prior versions will fail to mount.
<!-- markdownlint-disable-next-line -->
### Issues
* \#35 [bug] Low frequency check is set to '0' instead of 1 hour by default
* \#36 [bug] Max cache size bytes is set to '0' by default
### Changes from v2.0.3-rc
* Added Sia API version check prior to mounting
* Added back `-cv` (check version) CLI option
* Continue documentation updates
* Fixed setting `ApiAuth` via `set_value_by_name`
* Fixed setting `HostConfig.ApiUser` via `set_value_by_name`
* Fixed setting `HostConfig.Path` via `set_value_by_name`
* Fixed setting `HostConfig.Protocol` via `set_value_by_name`
* Improved ring buffer read-ahead
* Integrated `renterd` version 2.0.0
* Prefer using local cache file when opening files
* Refactored `app_config` unit tests
* Refactored polling to be more accurate on scheduling tasks
## v2.0.3-rc
<!-- markdownlint-disable-next-line -->
### Issues
* \#28 \[bug\] Address slow directory responses in S3 mounts for deeply nested directories
* \#29 \[bug\] S3 error responses are not being logged
* \#30 \[bug\] Sia provider error responses are not logged
* \#31 \[bug\] S3 provider should limit max key size to 1024
### Changes from v2.0.2-rc
* Always use direct for read-only providers
* Fixed externally removed files not being processed during cleanup
* Fixed http headers not being added for requests
* Fixed incorrect `stat` values for remote mounts
* Fixed invalid directory nullptr error on remote mounts
* Fixed memory leak in event system
* Refactored application shutdown
* Refactored event system
* Updated build system to Alpine 3.21.0
* Updated build system to MinGW-w64 12.0.0
* Updated copyright to 2018-2025
## v2.0.2-rc
<!-- markdownlint-disable-next-line -->
### BREAKING CHANGES
* Refactored `config.json` - will need to verify configuration settings prior to mounting
<!-- markdownlint-disable-next-line -->
### Issues
* \#14 \[Unit Test\] SQLite mini-ORM unit tests and cleanup
* \#16 Add support for bucket name in Sia provider
* \#17 Update to common c++ build system
* A single 64-bit Linux Jenkins server is used to build all Linux and Windows versions
* All dependency sources are now included
* MSVC is no longer supported
* MSYS2 is required for building Windows binaries on Windows
* OS X support is temporarily disabled
* \#19 \[bug\] Rename file is broken for files that are existing
* \#23 \[bug\] Incorrect file size displayed while upload is pending
* \#24 RocksDB implementations should be transactional
* \#25 Writes should block when maximum cache size is reached
* \#26 Complete ring buffer and direct download support
### Changes from v2.0.1-rc
* Updated `JSON for Modern C++` to v3.11.3
* Ability to choose between RocksDB and SQLite databases
* Added direct reads and implemented download fallback
* Corrected file times on S3 and Sia providers
* Corrected handling of `chown()` and `chmod()`
* Fixed erroneous download of chunks after resize
## v2.0.1-rc
* Removed legacy win32 build binaries
<!-- markdownlint-disable-next-line -->
### Issues
@@ -23,16 +151,17 @@
### Changes from v2.0.0-rc
* Refactored Sia, S3 and base provider
* Fixed intermittent deadlock on file close
* Refactored Sia, S3 and base provider
* Removed MSVC compilation support (MinGW-64 should be used)
* Removed legacy win32 build binaries
* Require `c++20`
* Switched to Storj over Filebase for hosting binaries
* Updated `OpenSSL` to v3.2.0
* Updated `boost` to v1.83.0
* Updated `cpp-httplib` to v0.14.2
* Updated `curl` to v8.4.0
* Updated `libsodium` to v1.0.19
* Updated `OpenSSL` to v3.2.0
## v2.0.0-rc

View File

@@ -1,19 +1,71 @@
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.27)
cmake_policy(SET CMP0135 NEW)
cmake_policy(SET CMP0144 NEW)
include(project_name.cmake)
project(${PROJECT_NAME})
if (NOT PROJECT_INTERFACE)
message(FATAL_ERROR "Project must be compiled via 'make_win32.cmd'/'make_win32.sh' or 'make_unix.sh' build scripts. Invoking 'cmake' directly is not supported.")
endif()
project(${PROJECT_NAME}
DESCRIPTION ${PROJECT_DESC}
HOMEPAGE_URL ${PROJECT_URL}
VERSION ${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_REVISION_VERSION}
)
include(CheckIncludeFileCXX)
include(CheckIncludeFiles)
include(ExternalProject)
check_include_files(sys/xattr.h HAS_SETXATTR)
if(HAS_SETXATTR)
add_definitions(-DHAS_SETXATTR)
endif()
include(cmake/hashes.cmake)
include(cmake/versions.cmake)
include(cmake/arch.cmake)
include(cmake/os.cmake)
include(cmake/options.cmake)
option(PROJECT_REQUIRE_ALPINE "Require Alpine Linux as build system" OFF)
option(PROJECT_STATIC_LINK "Static link executables" OFF)
if(PROJECT_STATIC_LINK)
add_definitions(-DPROJECT_STATIC_LINK)
endif()
if(PROJECT_IS_MINGW)
add_definitions(-DPROJECT_IS_MINGW)
if(PROJECT_IS_MINGW_UNIX)
add_definitions(-DPROJECT_IS_MINGW_UNIX)
endif()
endif()
if(PROJECT_REQUIRE_ALPINE)
add_definitions(-DPROJECT_REQUIRE_ALPINE)
endif()
if(PROJECT_IS_ARM64)
add_definitions(-DPROJECT_IS_ARM64)
endif()
if(PROJECT_IS_DARWIN)
add_definitions(-DPROJECT_IS_DARWIN)
endif()
if(PROJECT_IS_MINGW)
option(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES "Enable path sizes of 32767 characters on Windows" OFF)
if(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES)
add_definitions(-DPROJECT_ENABLE_WIN32_LONG_PATH_NAMES)
endif()
endif()
if (PROJECT_ENABLE_V2_ERRORS)
add_definitions(-DPROJECT_ENABLE_V2_ERRORS)
endif()
include(cmake/settings.cmake)
include(cmake/flags.cmake)
@@ -22,39 +74,59 @@ include(cmake/functions.cmake)
include(cmake/libraries.cmake)
if(PROJECT_BUILD)
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE PROJECT_GIT_REV
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.cpp "")
if (PROJECT_IS_MINGW)
set(PROJECT_WINDOWS_VERSION_RC ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.rc)
file(WRITE ${PROJECT_WINDOWS_VERSION_RC} "")
endif()
file(GLOB_RECURSE ADDITIONAL_SOURCES
${PROJECT_3RD_PARTY_DIR}/src/*.c
${PROJECT_3RD_PARTY_DIR}/src/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.cpp
${PROJECT_SUPPORT_DIR}/src/*.c
${PROJECT_SUPPORT_DIR}/src/*.cpp
)
list(APPEND PROJECT_ADDITIONAL_SOURCES
${ADDITIONAL_SOURCES}
)
unset(PROJECT_GIT_REV CACHE)
unset(PROJECT_VERSION CACHE)
include(project.cmake)
string(REPLACE "\\<" "<" PROJECT_COMPANY_NAME "${PROJECT_COMPANY_NAME}")
string(REPLACE "\\<" "<" PROJECT_COPYRIGHT "${PROJECT_COPYRIGHT}")
string(REPLACE "\\<" "<" PROJECT_DESC "${PROJECT_DESC}")
string(REPLACE "\\>" ">" PROJECT_COMPANY_NAME "${PROJECT_COMPANY_NAME}")
string(REPLACE "\\>" ">" PROJECT_COPYRIGHT "${PROJECT_COPYRIGHT}")
string(REPLACE "\\>" ">" PROJECT_DESC "${PROJECT_DESC}")
if (PROJECT_IS_MINGW)
if ("${PROJECT_RELEASE_ITER}" STREQUAL "release")
set(PROJECT_PRERELEASE 0)
else()
set(PROJECT_PRERELEASE VS_FF_PRERELEASE)
endif()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.rc.in
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.rc
@ONLY
)
endif()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.cpp.in
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.cpp
@ONLY
)
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/build/version.sh "export PROJECT_VERSION=${PROJECT_VERSION}")
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/build/git_rev.sh "export PROJECT_GIT_REV=${PROJECT_GIT_REV}")
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.iss.in")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.iss.in
${PROJECT_DIST_DIR}/../${PROJECT_NAME}.iss
@ONLY
)
endif()
else()
message(STATUS "-=[CMake Settings]=-")
message(STATUS " C standard: ${CMAKE_C_STANDARD}")
@@ -64,6 +136,13 @@ if(PROJECT_ENABLE_FUSE)
message(STATUS " FUSE version: ${PROJECT_FUSE}")
endif()
string(REPLACE "<" "\\<" PROJECT_COMPANY_NAME "${PROJECT_COMPANY_NAME}")
string(REPLACE "<" "\\<" PROJECT_COPYRIGHT "${PROJECT_COPYRIGHT}")
string(REPLACE "<" "\\<" PROJECT_DESC "${PROJECT_DESC}")
string(REPLACE ">" "\\>" PROJECT_COMPANY_NAME "${PROJECT_COMPANY_NAME}")
string(REPLACE ">" "\\>" PROJECT_COPYRIGHT "${PROJECT_COPYRIGHT}")
string(REPLACE ">" "\\>" PROJECT_DESC "${PROJECT_DESC}")
add_custom_target(project ALL
DEPENDS ${PROJECT_DEPENDENCIES}
COMMAND cd build && cmake
@@ -76,51 +155,48 @@ endif()
-DPROJECT_BUILD_DIR=${PROJECT_BUILD_DIR}
-DPROJECT_BUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DPROJECT_CMAKE_BUILD_TYPE=${PROJECT_CMAKE_BUILD_TYPE}
-DPROJECT_COMPANY_NAME=${PROJECT_COMPANY_NAME}
-DPROJECT_COPYRIGHT=${PROJECT_COPYRIGHT}
-DPROJECT_DESC=${PROJECT_DESC}
-DPROJECT_DIST_DIR=${PROJECT_DIST_DIR}
-DPROJECT_ENABLE_WXWIDGETS=${PROJECT_ENABLE_WXWIDGETS}
-DPROJECT_ENABLE_WINFSP=${PROJECT_ENABLE_WINFSP}
-DPROJECT_ENABLE_VORBIS=${PROJECT_ENABLE_VORBIS}
-DPROJECT_ENABLE_TPL=${PROJECT_ENABLE_TPL}
-DPROJECT_ENABLE_TESTING=${PROJECT_ENABLE_TESTING}
-DPROJECT_ENABLE_STDUUID=${PROJECT_ENABLE_STDUUID}
-DPROJECT_ENABLE_SQLITE=${PROJECT_ENABLE_SQLITE}
-DPROJECT_ENABLE_SPDLOG=${PROJECT_ENABLE_SPDLOG}
-DPROJECT_ENABLE_SFML=${PROJECT_ENABLE_SFML}
-DPROJECT_ENABLE_SECP256K1=${PROJECT_ENABLE_SECP256K1}
-DPROJECT_ENABLE_SAGO_PLATFORM_FOLDERS=${PROJECT_ENABLE_SAGO_PLATFORM_FOLDERS}
-DPROJECT_ENABLE_ROCKSDB=${PROJECT_ENABLE_ROCKSDB}
-DPROJECT_ENABLE_PUGIXML=${PROJECT_ENABLE_PUGIXML}
-DPROJECT_ENABLE_OPENSSL=${PROJECT_ENABLE_OPENSSL}
-DPROJECT_ENABLE_OPENAL=${PROJECT_ENABLE_OPENAL}
-DPROJECT_ENABLE_OGG=${PROJECT_ENABLE_OGG}
-DPROJECT_ENABLE_NUSPELL=${PROJECT_ENABLE_NUSPELL}
-DPROJECT_ENABLE_LIBSODIUM=${PROJECT_ENABLE_LIBSODIUM}
-DPROJECT_ENABLE_LIBEVENT=${PROJECT_ENABLE_LIBEVENT}
-DPROJECT_ENABLE_LIBBITCOIN_SYSTEM=${PROJECT_ENABLE_LIBBITCOIN_SYSTEM}
-DPROJECT_ENABLE_JSON=${PROJECT_ENABLE_JSON}
-DPROJECT_ENABLE_GTKMM=${PROJECT_ENABLE_GTKMM}
-DPROJECT_ENABLE_FZF=${PROJECT_ENABLE_FZF}
-DPROJECT_ENABLE_FUSE=${PROJECT_ENABLE_FUSE}
-DPROJECT_ENABLE_FREETYPE2=${PROJECT_ENABLE_FREETYPE2}
-DPROJECT_ENABLE_FONTCONFIG=${PROJECT_ENABLE_FONTCONFIG}
-DPROJECT_ENABLE_FMT=${PROJECT_ENABLE_FMT}
-DPROJECT_ENABLE_FLAC=${PROJECT_ENABLE_FLAC}
-DPROJECT_ENABLE_DTL=${PROJECT_ENABLE_DTL}
-DPROJECT_ENABLE_CURL=${PROJECT_ENABLE_CURL}
-DPROJECT_ENABLE_CPP_HTTPLIB=${PROJECT_ENABLE_CPP_HTTPLIB}
-DPROJECT_ENABLE_CLI11=${PROJECT_ENABLE_CLI11}
-DPROJECT_ENABLE_V2_ERRORS=${PROJECT_ENABLE_V2_ERRORS}
-DPROJECT_ENABLE_WIN32_LONG_PATH_NAMES=${PROJECT_ENABLE_WIN32_LONG_PATH_NAMES}
-DPROJECT_ENABLE_BOOST=${PROJECT_ENABLE_BOOST}
-DPROJECT_ENABLE_CPP_HTTPLIB=${PROJECT_ENABLE_CPP_HTTPLIB}
-DPROJECT_ENABLE_CURL=${PROJECT_ENABLE_CURL}
-DPROJECT_ENABLE_FUSE=${PROJECT_ENABLE_FUSE}
-DPROJECT_ENABLE_JSON=${PROJECT_ENABLE_JSON}
-DPROJECT_ENABLE_LIBSODIUM=${PROJECT_ENABLE_LIBSODIUM}
-DPROJECT_ENABLE_OPENSSL=${PROJECT_ENABLE_OPENSSL}
-DPROJECT_ENABLE_PUGIXML=${PROJECT_ENABLE_PUGIXML}
-DPROJECT_ENABLE_ROCKSDB=${PROJECT_ENABLE_ROCKSDB}
-DPROJECT_ENABLE_SPDLOG=${PROJECT_ENABLE_SPDLOG}
-DPROJECT_ENABLE_SQLITE=${PROJECT_ENABLE_SQLITE}
-DPROJECT_ENABLE_STDUUID=${PROJECT_ENABLE_STDUUID}
-DPROJECT_ENABLE_TESTING=${PROJECT_ENABLE_TESTING}
-DPROJECT_ENABLE_WINFSP=${PROJECT_ENABLE_WINFSP}
-DPROJECT_EXTERNAL_BUILD_ROOT=${PROJECT_EXTERNAL_BUILD_ROOT}
-DPROJECT_FUSE=${PROJECT_FUSE}
-DPROJECT_FUSE_INCLUDE_DIRS=${PROJECT_FUSE_INCLUDE_DIRS}
-DPROJECT_GIT_REV=${PROJECT_GIT_REV}
-DPROJECT_INTERFACE=1
-DPROJECT_IS_ALPINE=${PROJECT_IS_ALPINE}
-DPROJECT_IS_ARM64=${PROJECT_IS_ARM64}
-DPROJECT_IS_DARWIN=${PROJECT_IS_DARWIN}
-DPROJECT_IS_MINGW=${PROJECT_IS_MINGW}
-DPROJECT_IS_MINGW_UNIX=${PROJECT_IS_MINGW_UNIX}
-DPROJECT_LINK_TYPE=${PROJECT_LINK_TYPE}
-DPROJECT_MAJOR_VERSION=${PROJECT_MAJOR_VERSION}
-DPROJECT_MACOS_ICNS_NAME=${PROJECT_MACOS_ICNS_NAME}
-DPROJECT_MINOR_VERSION=${PROJECT_MINOR_VERSION}
-DPROJECT_NAME=${PROJECT_NAME}
-DPROJECT_RELEASE_ITER=${PROJECT_RELEASE_ITER}
-DPROJECT_RELEASE_NUM=${PROJECT_RELEASE_NUM}
-DPROJECT_REQUIRE_ALPINE=${PROJECT_REQUIRE_ALPINE}
-DPROJECT_REVISION_VERSION=${PROJECT_REVISION_VERSION}
-DPROJECT_STATIC_LINK=${PROJECT_STATIC_LINK}
-DPROJECT_SUPPORT_DIR=${PROJECT_SUPPORT_DIR}
-DPROJECT_TOOLCHAIN_FILE_CMAKE=${PROJECT_TOOLCHAIN_FILE_CMAKE}
-DPROJECT_TOOLCHAIN_FILE_MESON=${PROJECT_TOOLCHAIN_FILE_MESON}
-DPROJECT_URL=${PROJECT_URL}
)
endif()

View File

@@ -1,5 +1,5 @@
# Repertory MIT License
### Copyright <2018-2024> <scott.e.graves@protonmail.com>
### Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

739
README.md
View File

@@ -1,79 +1,692 @@
# Repertory
Repertory allows you to mount AWS S3 and Sia via FUSE on Linux/OS X or via WinFSP
on Windows.
Repertory allows you to mount **S3** and **Sia** storage as local drives using:
- **FUSE** (Linux/macOS)
- **WinFSP** (Windows)
## Details and Features
It supports:
- Local mounts
- Remote encrypted mounts between systems
- Optional file name and data encryption using `XChaCha20-Poly1305`
* Optimized for [Plex Media Server](https://www.plex.tv/)
* Single application to mount AWS S3 and/or Sia
* Only 1 Sia mount and 1 S3 mount (per bucket) per user is supported.
* Remote mounting of Repertory instances on Linux, OS X and Windows
* Securely share your mounts over TCP/IP (`XChaCha20-Poly1305` stream cipher)
* Cross-platform support (Linux 64-bit, Linux arm64/aarch64, OS X, Windows 64-bit)
---
## Minimum Requirements
## 📖 Contents
* [Sia renterd](https://github.com/SiaFoundation/renterd/releases) v0.4.0+ for Sia support
* Only 64-bit operating systems are supported
* Linux requires `fusermount3` or `repertory` must be manually compiled with `libfuse2` support
* OS X requires the following dependency to be installed:
* [FUSE for macOS v4.5.0](https://github.com/osxfuse/osxfuse/releases/download/macfuse-4.5.0/macfuse-4.5.0.dmg)
* Windows requires the following dependencies to be installed:
* [WinFSP 2023](https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-2.0.23075.msi)
1. [Quick Start (Sia Example)](#-quick-start-sia-example)
2. [Details & Features](#-details-and-features)
3. [Minimum Requirements](#-minimum-requirements)
- [Supported Operating Systems](#supported-operating-systems)
4. [Data Directories](#-data-directories)
5. [GUI](#-gui)
6. [Usage](#-usage)
- [Important Options](#important-options)
- [Unmounting](#unmounting)
7. [Sia Setup](#-sia)
- [Sia Initial Configuration](#sia-initial-configuration)
- [Sia Mounting](#sia-mounting)
- [Sia Configuration File](#sia-configuration-file)
8. [S3 Setup](#-s3)
- [S3 Initial Configuration](#s3-initial-configuration)
- [S3 Mounting](#s3-mounting)
- [S3 Configuration File](#s3-configuration-file)
9. [Remote Mounting](#-remote-mounting)
- [Server Setup](#server-setup)
- [Client Setup](#client-setup)
- [Remote Mount Configuration File](#remote-mount-configuration-file)
10. [Compiling from Source](#-compiling)
- [Linux Compilation](#linux-compilation)
- [macOS Compilation](#macos-compilation)
- [Windows Compilation](#windows-compilation)
11. [Credits](#-credits)
12. [Developer Public Key](#-developer-public-key)
13. [Consult the Wiki for additional information](https://git.fifthgrid.com/BlockStorage/repertory/wiki)
## Supported Operating Systems
---
* Linux `arm64/aarch64`
* Linux `amd64`
* OS X Mojave and above
* Windows 64-bit 10, 11
## 🚀 Quick Start (Sia Example)
## Credits
> 💡 Want to mount S3 instead?
> Skip ahead to [S3 Setup](#-s3) — the process is almost identical.
* [boost c++ libraries](https://www.boost.org/)
* [cpp-httplib](https://github.com/yhirose/cpp-httplib)
* [curl](https://curl.haxx.se/)
* [FUSE for macOS](https://osxfuse.github.io/)
* [Google Test](https://github.com/google/googletest)
* [JSON for Modern C++](https://github.com/nlohmann/json)
* [libfuse](https://github.com/libfuse/libfuse)
* [libsodium](https://doc.libsodium.org/)
* [OpenSSL](https://www.openssl.org/)
* [ScPrime](https://scpri.me/)
* [Sia Decentralized Cloud Storage](https://sia.tech/)
* [SQLite](https://www.sqlite.org)
* [stduuid](https://github.com/mariusbancila/stduuid)
* [Storj](https://storj.io/)
* [WinFSP - FUSE for Windows](https://github.com/billziss-gh/winfsp)
* [zlib](https://zlib.net/)
This example mounts a Sia bucket from a running [renterd](https://github.com/SiaFoundation/renterd) instance.
## Developer Public Key
---
### 1. Install dependencies
**Linux**
```bash
sudo apt install fuse3 # Debian/Ubuntu
# or
sudo dnf install fuse3 # Fedora
```
**macOS**
- Install [macFUSE 4.10.2](https://github.com/macfuse/macfuse/releases/download/macfuse-4.10.2/macfuse-4.10.2.dmg)
**Windows**
- Install [WinFSP 2025](https://github.com/winfsp/winfsp/releases/download/v2.1/winfsp-2.1.25156.msi)
---
### 2. Configure
Replace placeholders with your values:
```bash
repertory --name mybucket -set HostConfig.ApiPassword "<renterd api password>"
repertory --name mybucket -set SiaConfig.Bucket "<bucket name>"
```
Optional:
```bash
# If renterd is not running locally
repertory --name mybucket -set HostConfig.HostNameOrIp "<hostname or IP>"
# If renterd uses a non-default port (default 9980)
repertory --name mybucket -set HostConfig.ApiPort <port>
```
---
### 3. Mount
**Linux**
```bash
repertory --name mybucket /mnt/mybucket
```
**macOS**
```bash
repertory --name mybucket /Volumes/mybucket
```
**Windows**
```powershell
repertory --name mybucket t:
```
---
### 4. Unmount
**Linux**
```bash
fusermount3 -u /mnt/mybucket
```
**macOS**
```bash
diskutil unmount /Volumes/mybucket
```
**Windows**
```powershell
net use t: /delete
```
---
## ✨ Details and Features
- **Optimized for [Plex Media Server](https://www.plex.tv/).**
- Remote mounting of `repertory` instances between Linux, macOS, and/or Windows.
- Securely share your mounts over TCP/IP via `XChaCha20-Poly1305` with other systems on your network or over the internet.
- Cross-platform support (Linux, macOS, and Windows).
- Optionally encrypt file names and file data via `XChaCha20-Poly1305` in S3 mounts.
---
## 📋 Minimum Requirements
- **Sia:** [renterd](https://github.com/SiaFoundation/renterd/releases) v2.0.0+ for Sia support
- **Linux:** requires `fusermount3`; otherwise, `repertory` must be manually compiled with `libfuse2` support
- **macOS:** requires:
- [macFUSE 4.10.2](https://github.com/macfuse/macfuse/releases/download/macfuse-4.10.2/macfuse-4.10.2.dmg)
- **Windows:** requires:
- [WinFSP 2025](https://github.com/winfsp/winfsp/releases/download/v2.1/winfsp-2.1.25156.msi)
### Supported Operating Systems
Only **64-bit operating systems** are supported:
- Linux `arm64/aarch64`
- Linux `x86_64`
- macOS `arm64/aarch64`
- macOS `x86_64`
- Windows `x86_64` 10, 11
---
## 📂 Data Directories
**Linux**
```
~/.local/repertory2/s3
~/.local/repertory2/sia
```
**Windows**
```
%LOCALAPPDATA%\repertory2\s3
%LOCALAPPDATA%\repertory2\sia
```
**IMPORTANT:**
It is highly recommended to **exclude** these folders from any anti-virus/anti-malware applications as severe performance issues may arise. Excluding the mounted drive letter is also highly recommended.
---
## 🖥 GUI
As of `v2.0.6-release`, mounts can be managed using the **Repertory Management Portal**.
Launch the portal:
```bash
repertory -ui
```
- Default username: `repertory`
- Default password: `repertory`
After first launch, `ui.json` will be created in the appropriate data directory (see [Data Directories](#-data-directories)). Modify this file directly or use the portal to change the default credentials.
**Screenshot**
<a href="https://ibb.co/fVyJqnbF"><img src="https://i.ibb.co/fVyJqnbF/repertory-portal.png" alt="repertory-portal" border="0"></a>
---
## 🛠 Usage
### Important Options
- `--help`
Display all mount utility options.
- `-f`
Keep process in foreground on Linux.
- `--name, -na [name]`
Identifies a unique configuration name to support multiple mounts.
The `--name` option can be set to any valid value allowed as a file name for your filesystem.
**The `--name` option is required.**
- `-dc`
Display mount configuration.
For Sia, the `--name` option is required.
For S3, the `-s3` and `--name` options are required.
### Unmounting
**Linux**
```bash
fusermount3 -u /path/to/mountpoint
```
**macOS**
```bash
diskutil unmount /Volumes/yourmount
```
**Windows**
```powershell
net use <driveletter>: /delete
```
---
## 🔒 Security Best Practices
When enabling **encryption tokens** for S3 or remote mounts:
- Use a **long, random string**.
- Store it **offline** (password manager and an offline backup).
- Losing it means **permanent data loss**.
---
## 🗄 Sia
### Sia Initial Configuration
**Required steps:**
- Set the appropriate bucket name and `renterd` API password in `repertory` configuration:
```bash
repertory --name '<my config name>' -set HostConfig.ApiPassword '<my password>'
repertory --name '<my config name>' -set SiaConfig.Bucket '<my bucket name>'
```
**Optional steps:**
- Set a user name used during `renterd` basic authentication:
```bash
repertory --name '<my config name>' -set HostConfig.ApiUser '<my user>'
```
- Set a custom agent string (default `Sia-Agent`):
```bash
repertory --name '<my config name>' -set HostConfig.AgentString '<my agent>'
```
- Set the host name or IP of the `renterd` instance (default `localhost`):
```bash
repertory --name '<my config name>' -set HostConfig.HostNameOrIp '<my host name>'
```
- Set the `renterd` API port (default `9980`):
```bash
repertory --name '<my config name>' -set HostConfig.ApiPort 9981
```
**Verify/view all configuration options:**
```bash
repertory --name '<my config name>' -dc
# Example:
repertory --name my_bucket -dc
```
### Sia Mounting
**Linux**
```bash
repertory --name '<my config name>' /mnt/location
# Example:
repertory --name my_bucket /mnt/location
```
**macOS**
```bash
repertory --name '<my config name>' /Volumes/mybucket
# Example:
repertory --name my_bucket /Volumes/mybucket
```
**Windows**
```powershell
repertory --name '<my config name>' t:
# Example:
repertory --name my_bucket t:
```
### Sia Configuration File
```json
{
"ApiPassword": "<random generated rpc password>",
"ApiPort": 10000,
"ApiUser": "repertory",
"DatabaseType": "rocksdb",
"DownloadTimeoutSeconds": 30,
"EnableDownloadTimeout": true,
"EnableDriveEvents": false,
"EventLevel": "info",
"EvictionDelayMinutes": 1,
"EvictionUseAccessedTime": false,
"HighFreqIntervalSeconds": 30,
"HostConfig": {
"AgentString": "Sia-Agent",
"ApiPassword": "<renterd api password>",
"ApiPort": 9980,
"ApiUser": "",
"HostNameOrIp": "localhost",
"Path": "",
"Protocol": "http",
"TimeoutMs": 60000
},
"LowFreqIntervalSeconds": 3600,
"MaxCacheSizeBytes": 21474836480,
"MaxUploadCount": 5,
"MedFreqIntervalSeconds": 120,
"OnlineCheckRetrySeconds": 60,
"PreferredDownloadType": "default",
"RemoteMount": {
"ApiPort": 20000,
"ClientPoolSize": 20,
"Enable": false,
"EncryptionToken": ""
},
"RetryReadCount": 6,
"RingBufferFileSize": 512,
"SiaConfig": {
"Bucket": "my_bucket"
},
"TaskWaitMs": 100,
"Version": 1
}
```
---
## 🗄 S3
### S3 Initial Configuration
**Required steps:**
- Set the appropriate base URL:
```bash
repertory -s3 --name '<my config name>' -set S3Config.URL '<my url>'
# Example:
repertory -s3 --name minio -set S3Config.URL 'http://localhost:9000'
```
- Set the appropriate bucket name:
```bash
repertory -s3 --name '<my config name>' -set S3Config.Bucket '<my bucket name>'
```
- Set the appropriate access key:
```bash
repertory -s3 --name '<my config name>' -set S3Config.AccessKey '<my access key>'
```
- Set the appropriate secret key:
```bash
repertory -s3 --name '<my config name>' -set S3Config.SecretKey '<my secret key>'
```
- For Sia and most local S3 gateway instances, enable path style URLs:
```bash
repertory -s3 --name '<my config name>' -set S3Config.UsePathStyle true
```
**Optional steps:**
- Set an appropriate region. Default is `any`:
```bash
repertory -s3 --name '<my config name>' -set S3Config.Region '<my region>'
```
- Enable encrypted file names and file data. Set a strong, random encryption token and store it securely:
```bash
repertory -s3 --name '<my config name>' -set S3Config.EncryptionToken '<my strong password>'
```
**Verify/view all configuration options:**
```bash
repertory -s3 --name '<my config name>' -dc
# Example:
repertory -s3 --name minio -dc
```
### S3 Mounting
**Linux**
```bash
repertory -s3 --name '<my config name>' /mnt/location
# Example:
repertory -s3 --name minio /mnt/location
```
**macOS**
```bash
repertory -s3 --name '<my config name>' /Volumes/minio
# Example:
repertory -s3 --name minio /Volumes/minio
```
**Windows**
```powershell
repertory -s3 --name '<my config name>' t:
# Example:
repertory -s3 --name minio t:
```
### S3 Configuration File
```json
{
"ApiPassword": "<random generated rpc password>",
"ApiPort": 10100,
"ApiUser": "repertory",
"DatabaseType": "rocksdb",
"DownloadTimeoutSeconds": 30,
"EnableDownloadTimeout": true,
"EnableDriveEvents": false,
"EventLevel": "info",
"EvictionDelayMinutes": 1,
"EvictionUseAccessedTime": false,
"HighFreqIntervalSeconds": 30,
"LowFreqIntervalSeconds": 3600,
"MaxCacheSizeBytes": 21474836480,
"MaxUploadCount": 5,
"MedFreqIntervalSeconds": 120,
"OnlineCheckRetrySeconds": 60,
"PreferredDownloadType": "default",
"RemoteMount": {
"ApiPort": 20100,
"ClientPoolSize": 20,
"Enable": false,
"EncryptionToken": ""
},
"RetryReadCount": 6,
"RingBufferFileSize": 512,
"S3Config": {
"AccessKey": "<my access key>",
"Bucket": "<my bucket name>",
"EncryptionToken": "",
"Region": "any",
"SecretKey": "<my secret key>",
"TimeoutMs": 60000,
"URL": "http://localhost:9000",
"UsePathStyle": true,
"UseRegionInURL": false
},
"TaskWaitMs": 100,
"Version": 1
}
```
---
## 🌐 Remote Mounting
`repertory` allows local mounts to be shared with other computers on your network or over the internet. This option is referred to as **remote mounting**.
### Server Setup
The following steps must be performed on the mount you wish to share with other systems. Changes to configuration will not take effect while a mount is active, so it is recommended to unmount beforehand.
**Required steps:**
- Enable remote mount:
- **Sia**
```bash
repertory -set RemoteMount.Enable true
repertory --name '<my config name>' -set RemoteMount.Enable true
```
- **S3**
```bash
repertory -s3 --name '<my config name>' -set RemoteMount.Enable true
```
- Set a secure encryption token:
- **Sia**
```bash
repertory -set RemoteMount.EncryptionToken '<my secure password>'
repertory --name '<my config name>' -set RemoteMount.EncryptionToken '<my secure password>'
```
- **S3**
```bash
repertory -s3 --name '<my config name>' -set RemoteMount.EncryptionToken '<my secure password>'
```
**Optional steps:**
- Change the port clients will use to connect to your mount:
- **Sia**
```bash
repertory -set RemoteMount.ApiPort 20000
repertory --name '<my config name>' -set RemoteMount.ApiPort 20000
```
- **S3**
```bash
repertory -s3 --name '<my config name>' -set RemoteMount.ApiPort 20000
```
**IMPORTANT:**
Be sure to configure your firewall to allow incoming TCP connections on the port configured in `RemoteMount.ApiPort`.
#### Remote Mount Configuration File Section
```json
{
"RemoteMount": {
"ApiPort": 20000,
"ClientPoolSize": 20,
"Enable": true,
"EncryptionToken": "<my secure password>"
}
}
```
### Client Setup
Client configuration is provider agnostic, so there's no need to specify `-s3` for S3 providers.
**Required steps:**
- Set the encryption token to the same value configured during server setup:
```bash
repertory -rm <host name or IP>:<port> -set RemoteConfig.EncryptionToken '<my secure password>'
# Replace <host name or IP> with the host name or IP of the server
# Replace <port> with the value of RemoteMount.ApiPort used in the server configuration
# Example:
repertory -rm 192.168.1.10:20000 -set RemoteConfig.EncryptionToken '<my secure password>'
repertory -rm my.host.com:20000 -set RemoteConfig.EncryptionToken '<my secure password>'
```
#### Client Remote Mounting
**Linux**
```bash
repertory -rm <host name or IP>:<port> /mnt/location
# Example:
repertory -rm 192.168.1.10:20000 /mnt/location
```
**macOS**
```bash
repertory -rm <host name or IP>:<port> /Volumes/remotemount
# Example:
repertory -rm 192.168.1.10:20000 /Volumes/remotemount
```
**Windows**
```powershell
repertory -rm <host name or IP>:<port> t:
# Example:
repertory -rm 192.168.1.10:20000 t:
```
#### Remote Mount Configuration File
```json
{
"ApiPassword": "<random generated rpc password>",
"ApiPort": 10010,
"ApiUser": "repertory",
"EnableDriveEvents": false,
"EventLevel": "info",
"RemoteConfig": {
"ApiPort": 20000,
"EncryptionToken": "<my secure password>",
"HostNameOrIp": "192.168.1.10",
"MaxConnections": 20,
"ReceiveTimeoutMs": 120000,
"SendTimeoutMs": 30000
},
"TaskWaitMs": 100,
"Version": 1
}
```
---
## 🧰 Compiling
Successful compilation will place all required files for execution in the `dist/` directory.
### Linux Compilation
- Ensure `docker` is installed
- For `x86_64`:
```bash
scripts/make_unix.sh x86_64
scripts/make_unix.sh x86_64 Release
scripts/make_unix.sh x86_64 Debug
```
- For `aarch64`:
```bash
scripts/make_unix.sh aarch64
scripts/make_unix.sh aarch64 Release
scripts/make_unix.sh aarch64 Debug
```
### macOS Compilation
- Ensure `Xcode` and `CMake` are installed
- For `x86_64`:
```bash
scripts/make_unix.sh x86_64
scripts/make_unix.sh x86_64 Release
scripts/make_unix.sh x86_64 Debug
```
- For `aarch64`:
```bash
scripts/make_unix.sh aarch64
scripts/make_unix.sh aarch64 Release
scripts/make_unix.sh aarch64 Debug
```
### Windows Compilation
- **OFFICIAL: Cross-compiling on Linux**
- Ensure `docker` is installed
```bash
scripts/make_win32.sh x86_64
scripts/make_win32.sh x86_64 Release
scripts/make_win32.sh x86_64 Debug
```
- **UNOFFICIAL: Compiling on Windows**
- Ensure latest [MSYS2](https://www.msys2.org/) is installed
```powershell
scripts\make_win32.cmd x86_64
scripts\make_win32.cmd x86_64 Release
scripts\make_win32.cmd x86_64 Debug
```
---
## 📜 Credits
- [binutils](https://www.gnu.org/software/binutils/)
- [boost c++ libraries](https://www.boost.org/)
- [cpp-httplib](https://github.com/yhirose/cpp-httplib)
- [curl](https://curl.haxx.se/)
- [docker](https://www.docker.com/)
- [Google Test](https://github.com/google/googletest)
- [ICU](https://icu.unicode.org/)
- [JSON for Modern C++](https://github.com/nlohmann/json)
- [libexpat](https://github.com/libexpat/libexpat)
- [libfuse](https://github.com/libfuse/libfuse)
- [libsodium](https://doc.libsodium.org/)
- [macFUSE](https://macfuse.github.io/)
- [mingw-w64](https://www.mingw-w64.org/)
- [MSYS2](https://www.msys2.org)
- [OpenSSL](https://www.openssl.org/)
- [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/)
- [pugixml](https://pugixml.org/)
- [RocksDB](https://rocksdb.org)
- [ScPrime](https://scpri.me/)
- [Sia Decentralized Cloud Storage](https://sia.tech/)
- [spdlog](https://github.com/gabime/spdlog)
- [SQLite](https://www.sqlite.org)
- [stduuid](https://github.com/mariusbancila/stduuid)
- [Storj](https://www.storj.io/)
- [WinFSP - FUSE for Windows](https://github.com/billziss-gh/winfsp)
- [zlib](https://zlib.net/)
---
## 🔑 Developer Public Key
```text
-----BEGIN PUBLIC KEY-----
MIIEIjANBgkqhkiG9w0BAQEFAAOCBA8AMIIECgKCBAEKfZmq5mMAtD4kSt2Gc/5J
H+HHTYtUZE6YYvsvz8TNG/bNL67ZtNRyaoMyhLTfIN4rPBNLUfD+owNS+u5Yk+lS
ZLYyOuhoCZIFefayYqKLr42G8EeuRbx0IMzXmJtN0a4rqxlWhkYufJubpdQ+V4DF
oeupcPdIATaadCKVeZC7A0G0uaSwoiAVMG5dZqjQW7F2LoQm3PhNkPvAybIJ6vBy
LqdBegS1JrDn43x/pvQHzLO+l+FIG23D1F7iF+yZm3DkzBdcmi/mOMYs/rXZpBym
2/kTuSGh5buuJCeyOwR8N3WdvXw6+KHMU/wWU8qTCTT87mYbzH4YR8HgkjkLHxAO
5waHK6vMu0TxugCdJmVV6BSbiarJsh66VRosn7+6hlq6AdgksxqCeNELZBS+LBki
tb5hKyL+jNZnaHiR0U7USWtmnqZG6FVVRzlCnxP7tZo5O5Ex9AAFGz5JzOzsFNbv
xwQ0zqaTQOze+MJbkda7JfRoC6TncD0+3hoXsiaF4mCn8PqUCn0DwhglcRucZlST
ZvDNDo1WAtxPJebb3aS6uymNhBIquQbVAWxVO4eTrOYEgutxwkHE3yO3is+ogp8d
xot7f/+vzlbsbIDyuZBDe0fFkbTIMTU48QuUUVZpRKmKZTHQloz4EHqminbfX1sh
M7wvDkpJEtqbc0VnG/BukUzP6e7Skvgc7eF1sI3+8jH8du2rivZeZAl7Q2f+L9JA
BY9pjaxttxsud7V5jeFi4tKuDHi21/XhSjlJK2c2C4AiUEK5/WhtGbQ5JjmcOjRq
yXFRqLlerzOcop2kbtU3Ar230wOx3Dj23Wg8++lV3LU4U9vMR/t0qnSbCSGJys7m
ax2JpFlTwj/0wYuTlVFoNQHZJ1cdfyRiRBY4Ou7XO0W5hcBBKiYsC+neEeMMHdCe
iTDIW/ojcVTdFovl+sq3n1u4SBknE90JC/3H+TPE1s2iB+fwORVg0KPosQSNDS0A
7iK6AZCDC3YooFo+OzHkYMt9uLkXiXMSLx70az+qlIwOzVHKxCo7W/QpeKCXUCRZ
MMdlYEUs1PC8x2qIRUEVHuJ0XMTKNyOHmzVLuLK93wUWbToh+rdDxnbhX+emuESn
XH6aKiUwX4olEVKSylRUQw8nVckZGVWXzLDlgpzDrLHC8J8qHzFt7eCqOdiqsxhZ
x1U5LtugxwSWncTZ7vlKl0DuC/AWB7SuDi7bGRMSVp2n+MnD1VLKlsCclHXjIciE
W29n3G3lJ/sOta2sxqLd0j1XBQddrFXl5b609sIY81ocHqu8P2hRu5CpqJ/sGZC5
mMH3segHBkRj0xJcfOxceRLj1a+ULIIR3xL/3f8s5Id25TDo/nqBoCvu5PeCpo6L
9wIDAQAB
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqXedleDOugdk9sBpgFOA
0+MogIbBF7+iXIIHv8CRBbrrf8nxLSgQvbHQIP0EklebDgLZRgyGI3SSQYj7D957
uNf1//dpkELNzfuezgAyFer9+iH4Svq46HADp5k+ugaK0mMDZM7OLOgo7415/+z4
NIQopv8prMFdxkShr4e4dpR+S6LYMYMVjsi1gnYWaZJMWgzeZouXFSscS1/XDXSE
vr1Jfqme+RmB4Q2QqGcDrY2ijumCJYJzQqlwG6liJ4FNg0U3POTCQDhQmuUoEJe0
/dyiWlo48WQbBu6gUDHbTCCUSZPs2Lc9l65MqOCpX76+VXPYetZgqpMF4GVzb2y9
kETxFNpiMYBlOBZk0I1G33wqVmw46MI5IZMQ2z2F8Mzt1hByUNTgup2IQELCv1a5
a2ACs2TBRuAy1REeHhjLgiA/MpoGX7TpoHCGyo8jBChJVpP9ZHltKoChwDC+bIyx
rgYH3jYDkl2FFuAUJ8zAZl8U1kjqZb9HGq9ootMk34Dbo3IVkc2azB2orEP9F8QV
KxvZZDA9FAFEthSiNf5soJ6mZGLi0es5EWPoKMUEd9tG5bP980DySAWSSRK0AOfE
QShT/z7oG79Orxyomwrb8ZJCi7wEfcCuK1NWgqLVUgXhpi2J9WYS6DAbF3Oh3Hhl
DYSHlcfFBteqNDlR2uFInIECAwEAAQ==
-----END PUBLIC KEY-----
```

View File

@@ -1,5 +1,8 @@
list(APPEND PROJECT_COMMON_FLAG_LIST
list(APPEND PROJECT_COMMON_FLAG_LIST
-D_FILE_OFFSET_BITS=64
-D_GNU_SOURCE
-D_LARGEFILE64_SOURCE
-D_LARGEFILE_SOURCE
-D_TIME_BITS=64
-march=${PROJECT_MARCH}
-mtune=generic
@@ -32,13 +35,9 @@ list(APPEND PROJECT_CXXFLAGS_LIST
-Wcast-align
-Wconversion
-Wdouble-promotion
-Wduplicated-branches
-Wduplicated-cond
-Wextra
-Wformat=2
-Wlogical-op
-Wmisleading-indentation
-Wno-useless-cast
-Wnon-virtual-dtor
-Wnull-dereference
-Wold-style-cast
@@ -49,6 +48,15 @@ list(APPEND PROJECT_CXXFLAGS_LIST
-Wunused
)
if (NOT PROJECT_IS_DARWIN)
list(APPEND PROJECT_CXXFLAGS_LIST
-Wduplicated-branches
-Wduplicated-cond
-Wlogical-op
-Wno-useless-cast
)
endif()
list(APPEND PROJECT_CFLAGS_LIST
${PROJECT_COMMON_FLAG_LIST}
-std=c${CMAKE_C_STANDARD}
@@ -56,11 +64,10 @@ list(APPEND PROJECT_CFLAGS_LIST
list(APPEND PROJECT_CXXFLAGS_LIST
${PROJECT_COMMON_FLAG_LIST}
-fext-numeric-literals
-std=c++${CMAKE_CXX_STANDARD}
-std=gnu++${CMAKE_CXX_STANDARD}
)
if(PROJECT_STATIC_LINK)
if(NOT PROJECT_IS_DARWIN AND PROJECT_STATIC_LINK)
list(APPEND PROJECT_CMAKE_EXE_LINKER_FLAGS
-static-libgcc
-static-libstdc++
@@ -87,7 +94,11 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${PROJECT_RELEASE_FLAG_L
set(CMAKE_EXE_LINKER_FLAGS "${PROJECT_CMAKE_EXE_LINKER_FLAGS}")
set(EXTERNAL_CMAKE_CXX_FLAGS "-include cstdint -include utility -fext-numeric-literals ${PROJECT_COMMON_FLAG_LIST}")
set(EXTERNAL_CMAKE_CXX_FLAGS "-include cstdint -include utility ${PROJECT_COMMON_FLAG_LIST}")
if (NOT PROJECT_IS_DARWIN)
set(EXTERNAL_CMAKE_CXX_FLAGS "-fext-numeric-literals ${EXTERNAL_CMAKE_CXX_FLAGS}")
endif()
list(APPEND PROJECT_EXTERNAL_CMAKE_FLAGS
-DCMAKE_BUILD_TYPE=${PROJECT_CMAKE_BUILD_TYPE}
-DCMAKE_COLOR_MAKEFILE=${CMAKE_COLOR_MAKEFILE}

View File

@@ -1,3 +1,7 @@
if (PROJECT_MACOS_ICNS_NAME)
set(PROJECT_MACOS_ICNS_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_MACOS_ICNS_NAME}")
endif()
function(set_common_target_options name)
target_compile_definitions(${name} PUBLIC
${PROJECT_DEFINITIONS}
@@ -26,6 +30,58 @@ function(set_common_target_options name)
endif()
endfunction(set_common_target_options)
function(add_project_executable2 name dependencies libraries headers sources is_win32)
if (PROJECT_WINDOWS_VERSION_RC)
list(APPEND sources ${PROJECT_WINDOWS_VERSION_RC})
endif()
if (PROJECT_IS_DARWIN AND PROJECT_MACOS_ICNS_SOURCE AND "${name}" STREQUAL "${PROJECT_NAME}")
set_source_files_properties(${PROJECT_MACOS_ICNS_SOURCE} PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources"
)
add_executable(${name}
MACOSX_BUNDLE
${headers}
${sources}
${PROJECT_MACOS_ICNS_SOURCE}
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/main.cpp
)
set_target_properties(${name} PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_ICON_FILE "${PROJECT_MACOS_ICNS_NAME}"
RESOURCE "${PROJECT_MACOS_ICNS_SOURCE}"
)
else()
add_executable(${name}
${headers}
${sources}
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/main.cpp
)
endif()
foreach(dependency ${dependencies})
set_common_target_options(${dependency})
endforeach()
set_common_target_options(${name})
if(dependencies)
add_dependencies(${name} ${dependencies})
endif()
target_link_libraries(${name} PRIVATE ${libraries})
if(PROJECT_ENABLE_SDL AND PROJECT_IS_MINGW)
target_link_libraries(${name} PRIVATE SDL2::SDL2main)
endif ()
if (is_win32 AND PROJECT_IS_MINGW)
target_link_options(${name} PRIVATE -mwindows)
endif()
endfunction(add_project_executable2)
function(add_project_executable name dependencies libraries)
file(GLOB_RECURSE headers
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/include/*.h
@@ -41,27 +97,15 @@ function(add_project_executable name dependencies libraries)
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/src/*.cxx
)
if (PROJECT_WINDOWS_VERSION_RC)
list(APPEND sources ${PROJECT_WINDOWS_VERSION_RC})
if(PROJECT_ENABLE_WXWIDGETS OR PROJECT_ENABLE_SDL OR PROJECT_ENABLE_SFML OR PROJECT_ENABLE_NANA)
set(IS_WIN32 ON)
endif()
add_executable(${name}
${headers}
${sources}
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/main.cpp
)
add_project_executable2(${name} "${dependencies}" "${libraries}" "${headers}" "${sources}" "${IS_WIN32}")
foreach(dependency ${dependencies})
set_common_target_options(${dependency})
endforeach()
set_common_target_options(${name})
if(dependencies)
add_dependencies(${name} ${dependencies})
if(PROJECT_ENABLE_WXWIDGETS)
target_link_libraries(${name} PRIVATE ${wxWidgets_LIBRARIES})
endif()
target_link_libraries(${name} PRIVATE ${libraries})
endfunction(add_project_executable)
function(add_project_library name dependencies libraries additional_sources)
@@ -96,7 +140,24 @@ function(add_project_test_executable name dependencies libraries)
find_package(GTest ${GTEST_VERSION} REQUIRED)
enable_testing()
add_project_executable(${name} "${dependencies}" "${libraries}")
file(GLOB_RECURSE headers
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/include/${name}/include/${name}/include/*.hxx
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/include/${name}/include/*.hpp
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/include/*.h
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/include/*.hh
${PROJECT_SUPPORT_DIR}/test/include/*.hpp
)
file(GLOB_RECURSE sources
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/src/*.c
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/src/*.cc
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/src/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/${name}/src/*.cxx
${PROJECT_SUPPORT_DIR}/test/src/*.cpp
${additional_sources}
)
add_project_executable2(${name} "${dependencies}" "${libraries}" "${headers}" "${sources}" OFF)
target_compile_definitions(${name} PRIVATE -DPROJECT_TESTING)
@@ -104,6 +165,10 @@ function(add_project_test_executable name dependencies libraries)
${GTEST_INCLUDE_DIRS}
)
target_include_directories(${name} AFTER PRIVATE
${PROJECT_SUPPORT_DIR}/test/include
)
target_link_libraries(${name} PRIVATE
GTest::gtest
GTest::gmock

22
cmake/hashes.cmake Normal file
View File

@@ -0,0 +1,22 @@
set(BINUTILS_HASH ce2017e059d63e67ddb9240e9d4ec49c2893605035cd60e92ad53177f4377237)
set(BOOST2_HASH 7bd7ddceec1a1dfdcbdb3e609b60d01739c38390a5f956385a12f3122049f0ca)
set(BOOST_HASH 3621533e820dcab1e8012afd583c0c73cf0f77694952b81352bf38c1488f9cb4)
set(CPP_HTTPLIB_HASH 410a1347ed6bcbcc4a19af8ed8ad3873fe9fa97731d52db845c4c78f3f9c31e6)
set(CURL_HASH 2937cadde007aa3a52a17c21ac9153ea054700f37926d1d96602bf07e888c847)
set(EXPAT_HASH 85372797ff0673a8fc4a6be16466bb5a0ca28c0dcf3c6f7ac1686b4a3ba2aabb)
set(GCC_HASH 51b9919ea69c980d7a381db95d4be27edf73b21254eb13d752a08003b4d013b1)
set(GTEST_HASH 65fab701d9829d38cb77c14acdc431d2108bfdbf8979e40eb8ae567edf10b27c)
set(ICU_HASH a2c443404f00098e9e90acf29dc318e049d2dc78d9ae5f46efb261934a730ce2)
set(INNOSETUP_HASH f3c42116542c4cc57263c5ba6c4feabfc49fe771f2f98a79d2f7628b8762723b)
set(JSON_HASH 4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187)
set(LIBSODIUM_HASH 8e5aeca07a723a27bbecc3beef14b0068d37e7fc0e97f51b3f1c82d2a58005c1)
set(MINGW_HASH 5afe822af5c4edbf67daaf45eec61d538f49eef6b19524de64897c6b95828caf)
set(OPENSSL_HASH 529043b15cffa5f36077a4d0af83f3de399807181d607441d734196d889b641f)
set(PKG_CONFIG_HASH 6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591)
set(PUGIXML_HASH 655ade57fa703fb421c2eb9a0113b5064bddb145d415dd1f88c79353d90d511a)
set(ROCKSDB_HASH afccfab496556904900afacf7d99887f1d50cb893e5d2288bd502db233adacac)
set(SPDLOG_HASH 15a04e69c222eb6c01094b5c7ff8a249b36bb22788d72519646fb85feb267e67)
set(SQLITE_HASH 9ad6d16cbc1df7cd55c8b55127c82a9bca5e9f287818de6dc87e04e73599d754)
set(STDUUID_HASH b1176597e789531c38481acbbed2a6894ad419aab0979c10410d59eb0ebf40d3)
set(WINFSP_HASH 073a70e00f77423e34bed98b86e600def93393ba5822204fac57a29324db9f7a)
set(ZLIB_HASH 17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c)

View File

@@ -2,45 +2,31 @@ find_package(PkgConfig REQUIRED)
set(Boost_USE_STATIC_LIBS ${PROJECT_STATIC_LINK})
set(CURL_USE_STATIC_LIBS ${PROJECT_STATIC_LINK})
set(LIBEVENT_STATIC_LINK ${PROJECT_STATIC_LINK})
set(OPENSSL_USE_STATIC_LIBS ${PROJECT_STATIC_LINK})
set(SFML_STATIC_LIBRARIES ${PROJECT_STATIC_LINK})
set(ZLIB_USE_STATIC_LIBS ${PROJECT_STATIC_LINK})
if (PROJECT_IS_DARWIN)
set(ZLIB_USE_STATIC_LIBS OFF)
else()
set(ZLIB_USE_STATIC_LIBS ${PROJECT_STATIC_LINK})
endif()
set(wxWidgets_USE_STATIC ${PROJECT_STATIC_LINK})
set(OPENSSL_ROOT_DIR $ENV{OPENSSL_ROOT_DIR})
include(cmake/libraries/openssl.cmake)
include(cmake/libraries/boost.cmake)
include(cmake/libraries/cli11.cmake)
include(cmake/libraries/cpphttplib.cmake)
include(cmake/libraries/cpp_httplib.cmake)
include(cmake/libraries/curl.cmake)
include(cmake/libraries/dtl.cmake)
include(cmake/libraries/flac.cmake)
include(cmake/libraries/fmt.cmake)
include(cmake/libraries/fontconfig.cmake)
include(cmake/libraries/freetype2.cmake)
include(cmake/libraries/fuse.cmake)
include(cmake/libraries/gtest.cmake)
include(cmake/libraries/gtkmm.cmake)
include(cmake/libraries/json.cmake)
include(cmake/libraries/libbitcoinsystem.cmake)
include(cmake/libraries/libevent.cmake)
include(cmake/libraries/libsodium.cmake)
include(cmake/libraries/nuspell.cmake)
include(cmake/libraries/ogg.cmake)
include(cmake/libraries/openal.cmake)
include(cmake/libraries/openssl.cmake)
include(cmake/libraries/pugixml.cmake)
include(cmake/libraries/rocksdb.cmake)
include(cmake/libraries/secp256k1.cmake)
include(cmake/libraries/sfml.cmake)
include(cmake/libraries/spdlog.cmake)
include(cmake/libraries/sqlite.cmake)
include(cmake/libraries/stduuid.cmake)
include(cmake/libraries/tpl.cmake)
include(cmake/libraries/vorbis.cmake)
include(cmake/libraries/testing.cmake)
include(cmake/libraries/winfsp.cmake)
include(cmake/libraries/wxwidgets.cmake)
if(PROJECT_BUILD)
find_package(Threads REQUIRED)
@@ -60,6 +46,7 @@ if(PROJECT_BUILD)
httpapi
iphlpapi
kernel32
mswsock
ncrypt
ole32
oleaut32
@@ -76,7 +63,7 @@ if(PROJECT_BUILD)
winspool
ws2_32
)
else()
elseif(NOT PROJECT_IS_DARWIN)
link_libraries(
uring
)

View File

@@ -1,6 +1,4 @@
if(PROJECT_ENABLE_BOOST)
add_definitions(-DPROJECT_ENABLE_BOOST)
if(PROJECT_ENABLE_LIBBITCOIN_SYSTEM)
set(BOOST_MAJOR_VERSION ${BOOST2_MAJOR_VERSION})
set(BOOST_MINOR_VERSION ${BOOST2_MINOR_VERSION})
@@ -18,25 +16,57 @@ if(PROJECT_ENABLE_BOOST)
)
if(PROJECT_BUILD)
find_package(Boost ${BOOST_MAJOR_VERSION}.${BOOST_MINOR_VERSION}.${BOOST_PATCH_VERSION} EXACT
REQUIRED
COMPONENTS
atomic
chrono
date_time
filesystem
iostreams
locale
log
log_setup
program_options
random
regex
serialization
system
thread
wserialization
)
add_definitions(-DPROJECT_ENABLE_BOOST)
if (PROJECT_ENABLE_LIBBITCOIN_SYSTEM)
find_package(Boost ${BOOST_MAJOR_VERSION}.${BOOST_MINOR_VERSION}.${BOOST_PATCH_VERSION} EXACT
REQUIRED
COMPONENTS
atomic
chrono
date_time
filesystem
iostreams
locale
log
log_setup
program_options
random
regex
serialization
system
thread
wserialization
)
else()
if(PROJECT_IS_DARWIN)
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
set(CMAKE_USE_PTHREADS_INIT 1)
set(CMAKE_USE_WIN32_THREADS_INIT 0)
set(THREADS_PREFER_PTHREAD_FLAG ON)
endif()
find_package(Boost ${BOOST_MAJOR_VERSION}.${BOOST_MINOR_VERSION}.${BOOST_PATCH_VERSION}
REQUIRED
COMPONENTS
atomic
chrono
date_time
filesystem
iostreams
locale
log
log_setup
program_options
random
regex
serialization
system
thread
wserialization
)
endif()
include_directories(BEFORE SYSTEM
${Boost_INCLUDE_DIRS}
@@ -46,67 +76,74 @@ if(PROJECT_ENABLE_BOOST)
${Boost_LIBRARIES}
)
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
if(PROJECT_CMAKE_BUILD_TYPE STREQUAL "Debug")
set(BOOST_BUILD_TYPE_LOWER debug)
else()
set(BOOST_BUILD_TYPE_LOWER release)
if (PROJECT_ENABLE_LIBBITCOIN_SYSTEM OR NOT CMAKE_HOST_WIN32)
if(PROJECT_CMAKE_BUILD_TYPE STREQUAL "Debug")
set(BOOST_BUILD_TYPE_LOWER debug)
else()
set(BOOST_BUILD_TYPE_LOWER release)
endif()
if(PROJECT_IS_ARM64)
set(BOOST_ARCH arm)
else()
set(BOOST_ARCH x86)
endif()
if(PROJECT_STATIC_LINK)
set(BOOST_LINK static)
else()
set(BOOST_LINK "static,shared")
endif()
set(BOOST_BUILD_ARGS
--openssldir=$ENV{OPENSSL_ROOT_DIR}
--prefix=${PROJECT_EXTERNAL_BUILD_ROOT}
address-model=64
architecture=${BOOST_ARCH}
cxxstd=20
cxxstd-dialect=gnu
cxxflags=-std=gnu++${CMAKE_CXX_STANDARD}
cxxstd=${CMAKE_CXX_STANDARD}
define=BOOST_ASIO_HAS_STD_STRING_VIEW
define=BOOST_SYSTEM_NO_DEPRECATED
link=${BOOST_LINK}
linkflags=-std=gnu++${CMAKE_CXX_STANDARD}
threading=multi
variant=${BOOST_BUILD_TYPE_LOWER}
)
if(PROJECT_ENABLE_LIBBITCOIN_SYSTEM)
set(BOOST_URL_HASH SHA256=${BOOST2_HASH})
else()
set(BOOST_URL_HASH SHA256=${BOOST_HASH})
endif()
ExternalProject_Add(boost_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/boost_${BOOST_MAJOR_VERSION}_${BOOST_MINOR_VERSION}_${BOOST_PATCH_VERSION}.tar.gz
URL_HASH ${BOOST_URL_HASH}
BUILD_IN_SOURCE 1
LIST_SEPARATOR |
CONFIGURE_COMMAND ./bootstrap.sh
--with-libraries=atomic,chrono,date_time,filesystem,iostreams,locale,log,program_options,random,regex,serialization,system,test,thread
BUILD_COMMAND
./b2
-sNO_BZIP2=1
-j$ENV{CMAKE_BUILD_PARALLEL_LEVEL}
${BOOST_BUILD_ARGS}
INSTALL_COMMAND
./b2
-sNO_BZIP2=1
-j$ENV{CMAKE_BUILD_PARALLEL_LEVEL}
${BOOST_BUILD_ARGS}
install
)
list(APPEND PROJECT_DEPENDENCIES boost_project)
if (NOT CMAKE_HOST_WIN32)
add_dependencies(boost_project openssl_project)
endif()
endif()
if(PROJECT_IS_ARM64)
set(BOOST_ARCH arm)
else()
set(BOOST_ARCH x86)
endif()
if(PROJECT_STATIC_LINK)
set(BOOST_LINK static)
else()
set(BOOST_LINK "static,shared")
endif()
set(BOOST_BUILD_ARGS
--openssldir=$ENV{OPENSSL_ROOT_DIR}
--prefix=${PROJECT_EXTERNAL_BUILD_ROOT}
address-model=64
architecture=${BOOST_ARCH}
cxxflags=-std=c++${CMAKE_CXX_STANDARD}
cxxstd=${CMAKE_CXX_STANDARD}
define=BOOST_ASIO_HAS_STD_STRING_VIEW
define=BOOST_SYSTEM_NO_DEPRECATED
link=${BOOST_LINK}
linkflags=-std=c++${CMAKE_CXX_STANDARD}
threading=multi
variant=${BOOST_BUILD_TYPE_LOWER}
)
if(PROJECT_ENABLE_LIBBITCOIN_SYSTEM)
set(BOOST_URL_HASH SHA256=7bd7ddceec1a1dfdcbdb3e609b60d01739c38390a5f956385a12f3122049f0ca)
else()
set(BOOST_URL_HASH SHA256=be0d91732d5b0cc6fbb275c7939974457e79b54d6f07ce2e3dfdd68bef883b0b)
endif()
ExternalProject_Add(boost_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/boost_${BOOST_MAJOR_VERSION}_${BOOST_MINOR_VERSION}_${BOOST_PATCH_VERSION}.tar.gz
URL_HASH ${BOOST_URL_HASH}
BUILD_IN_SOURCE 1
LIST_SEPARATOR |
CONFIGURE_COMMAND ./bootstrap.sh
--with-libraries=atomic,chrono,date_time,filesystem,iostreams,locale,log,program_options,random,regex,serialization,system,test,thread
BUILD_COMMAND
./b2
-j1
${BOOST_BUILD_ARGS}
INSTALL_COMMAND
./b2
-j1
${BOOST_BUILD_ARGS}
install
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
boost_project
)
endif()
endif()

View File

@@ -1,28 +0,0 @@
if(PROJECT_ENABLE_CLI11)
if(PROJECT_BUILD)
find_package(CLI11 ${CLI11_VERSION} REQUIRED)
add_definitions(-DPROJECT_ENABLE_CLI11)
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
ExternalProject_Add(cli11_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/CLI11-${CLI11_VERSION}.tar.gz
URL_HASH SHA256=f2d893a65c3b1324c50d4e682c0cdc021dd0477ae2c048544f39eed6654b699a
LIST_SEPARATOR |
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
-DCLI11_WARNINGS_AS_ERRORS=OFF
-DCLI11_SINGLE_FILE=ON
-DCLI11_BUILD_DOCS=OFF
-DCLI11_BUILD_TESTS=OFF
-DCLI11_BUILD_EXAMPLES=OFF
-DCLI11_INSTALL=ON
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
cli11_project
)
endif()
endif()

View File

@@ -1,40 +1,35 @@
if(PROJECT_ENABLE_CPP_HTTPLIB)
if(PROJECT_BUILD)
if(PROJECT_ENABLE_OPENSSL)
add_definitions(
-DCPPHTTPLIB_OPENSSL_SUPPORT
)
endif()
add_definitions(
-DPROJECT_ENABLE_CPP_HTTPLIB
-DCPPHTTPLIB_OPENSSL_SUPPORT
-DCPPHTTPLIB_TCP_NODELAY=true
-DCPPHTTPLIB_ZLIB_SUPPORT
-DPROJECT_ENABLE_CPP_HTTPLIB
)
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
ExternalProject_Add(cpphttplib_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/cpp-httplib-${CPP_HTTPLIB_VERSION}.tar.gz
URL_HASH SHA256=2121bbf38871bb2aafb5f7f2b9b94705366170909f434428352187cb0216124e
URL_HASH SHA256=${CPP_HTTPLIB_HASH}
LIST_SEPARATOR |
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
-DHTTPLIB_REQUIRE_OPENSSL=${PROJECT_ENABLE_OPENSSL}
-DHTTPLIB_REQUIRE_ZLIB=ON
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-DHTTPLIB_REQUIRE_BROTLI=OFF
-DHTTPLIB_REQUIRE_OPENSSL=ON
-DHTTPLIB_REQUIRE_ZLIB=ON
-DHTTPLIB_TEST=OFF
-DHTTPLIB_USE_BROTLI_IF_AVAILABLE=OFF
-DHTTPLIB_USE_OPENSSL_IF_AVAILABLE=ON
-DHTTPLIB_USE_ZLIB_IF_AVAILABLE=ON
-DOPENSSL_USE_STATIC_LIBS=${OPENSSL_USE_STATIC_LIBS}
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
cpphttplib_project
)
list(APPEND PROJECT_DEPENDENCIES cpphttplib_project)
add_dependencies(cpphttplib_project curl_project)
if(PROJECT_ENABLE_OPENSSL)
if (NOT CMAKE_HOST_WIN32)
add_dependencies(cpphttplib_project openssl_project)
endif()
endif()

View File

@@ -1,16 +1,12 @@
if(PROJECT_ENABLE_CURL)
if(PROJECT_BUILD)
find_package(CURL ${CURL_VERSION} REQUIRED)
add_definitions(-DPROJECT_ENABLE_CURL)
include_directories(BEFORE SYSTEM
${CURL_INCLUDE_DIRS}
)
find_package(CURL ${CURL_VERSION} REQUIRED)
link_libraries(
CURL::libcurl
)
include_directories(BEFORE SYSTEM ${CURL_INCLUDE_DIRS})
link_libraries(CURL::libcurl)
if (EXISTS ${PROJECT_DIST_DIR}/cacert.pem)
file(REMOVE ${PROJECT_DIST_DIR}/cacert.pem)
@@ -20,16 +16,20 @@ if(PROJECT_ENABLE_CURL)
ExternalProject_Add(curl_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/curl-${CURL_VERSION}.tar.gz
URL_HASH SHA256=f91249c87f68ea00cf27c44fdfa5a78423e41e71b7d408e5901a9896d905c495
URL_HASH SHA256=${CURL_HASH}
LIST_SEPARATOR |
CMAKE_ARGS
${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
BUILD_COMMAND
${CMAKE_COMMAND} --build . -- -j$ENV{CMAKE_BUILD_PARALLEL_LEVEL}
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_CURL_EXE=OFF
-DBUILD_LIBCURL_DOCS=OFF
-DBUILD_MISC_DOCS=OFF
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_CURL=ON
-DBUILD_STATIC_LIBS=ON
-DBUILD_TESTING=OFF
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-DCURL_BROTLI=OFF
-DCURL_CA_BUNDLE=./cacert.pem
-DCURL_CA_FALLBACK=ON
-DCURL_DISABLE_LDAP=ON
@@ -37,19 +37,19 @@ if(PROJECT_ENABLE_CURL)
-DCURL_USE_LIBSSH2=OFF
-DCURL_USE_OPENSSL=${PROJECT_ENABLE_OPENSSL}
-DCURL_ZLIB=ON
-DCURL_ZSTD=OFF
-DENABLE_CURL_MANUAL=OFF
-DENABLE_THREADED_RESOLVER=ON
-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR}
-DOPENSSL_USE_STATIC_LIBS=${OPENSSL_USE_STATIC_LIBS}
-DUSE_LIBIDN2=OFF
-DUSE_NGHTTP2=OFF
-DZLIB_USE_STATIC_LIBS=${ZLIB_USE_STATIC_LIBS}
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
curl_project
)
list(APPEND PROJECT_DEPENDENCIES curl_project)
if(PROJECT_ENABLE_OPENSSL)
if (NOT CMAKE_HOST_WIN32)
add_dependencies(curl_project openssl_project)
endif()
endif()

View File

@@ -1,20 +0,0 @@
if(PROJECT_ENABLE_DTL)
if(PROJECT_BUILD)
add_definitions(-DPROJECT_ENABLE_DTL)
else()
ExternalProject_Add(dtl_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/dtl-v${DTL_VERSION}.tar.gz
URL_HASH SHA256=d6dcc7834b4117b5c14456ea73b907d0e2bafa5058e3a06b2c504d53517438c5
LIST_SEPARATOR |
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
dtl_project
)
endif()
endif()

View File

@@ -1,37 +0,0 @@
if(PROJECT_ENABLE_FLAC)
if(PROJECT_BUILD)
find_package(FLAC ${FLAC_VERSION} REQUIRED)
add_definitions(-DPROJECT_ENABLE_FLAC)
include_directories(BEFORE SYSTEM
${FLAC_INCLUDE_DIRS}
)
link_libraries(
FLAC::FLAC
)
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
ExternalProject_Add(flac_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/flac-${FLAC_VERSION}.tar.gz
URL_HASH SHA256=0a4bb82a30609b606650d538a804a7b40205366ce8fc98871b0ecf3fbb0611ee
LIST_SEPARATOR |
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
-DBUILD_EXAMPLES=ON
-DBUILD_PROGRAMS=ON
-DBUILD_TESTING=OFF
-DBUILD_DOCS=OFF
-DINSTALL_MANPAGES=OFF
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
flac_project
)
add_dependencies(flac_project vorbis_project)
endif()
endif()

View File

@@ -1,30 +0,0 @@
if(PROJECT_ENABLE_FMT)
if(PROJECT_BUILD)
find_package(fmt ${FMT_VERSION} REQUIRED)
add_definitions(-DPROJECT_ENABLE_FMT)
include_directories(BEFORE SYSTEM
${FMT_INCLUDE_DIRS}
)
link_libraries(
fmt::fmt
)
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
ExternalProject_Add(fmt_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/fmt-${FMT_VERSION}.tar.gz
URL_HASH SHA256=1250e4cc58bf06ee631567523f48848dc4596133e163f02615c97f78bab6c811
LIST_SEPARATOR |
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
fmt_project
)
endif()
endif()

View File

@@ -1,41 +0,0 @@
if(PROJECT_ENABLE_FONTCONFIG)
if(PROJECT_BUILD)
find_package(Fontconfig ${FONTCONFIG_VERSION} REQUIRED)
add_definitions(-DPROJECT_ENABLE_FONTCONFIG)
include_directories(BEFORE SYSTEM
${FONTCONFIG_INCLUDE_DIRS}
)
link_libraries(
Fontconfig::Fontconfig
)
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
ExternalProject_Add(fontconfig_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/fontconfig-${FONTCONFIG_VERSION}.tar.gz
URL_HASH SHA256=cdebb4b805d33e9bdefcc0ef9743db638d2acb21139bbe1a6a85878d4c3e8c9e
BUILD_IN_SOURCE 1
LIST_SEPARATOR |
CONFIGURE_COMMAND meson
setup
--prefix=${PROJECT_EXTERNAL_BUILD_ROOT}
_build
BUILD_COMMAND meson
compile
-C _build
INSTALL_COMMAND meson
install
-C _build
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
fontconfig_project
)
add_dependencies(fontconfig_project freetype2_project)
endif()
endif()

View File

@@ -1,39 +0,0 @@
if(PROJECT_ENABLE_FREETYPE2)
if(PROJECT_BUILD)
find_package(Freetype ${FREETYPE2_VERSION} REQUIRED)
add_definitions(-DPROJECT_ENABLE_FREETYPE2)
include_directories(BEFORE SYSTEM
${FREETYPE_INCLUDE_DIRS}
)
link_libraries(
Freetype::Freetype
)
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
ExternalProject_Add(freetype2_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/freetype-${FREETYPE2_VERSION}.tar.gz
URL_HASH SHA256=1ac27e16c134a7f2ccea177faba19801131116fd682efc1f5737037c5db224b5
BUILD_IN_SOURCE 1
LIST_SEPARATOR |
CONFIGURE_COMMAND meson
setup
--prefix=${PROJECT_EXTERNAL_BUILD_ROOT}
_build
BUILD_COMMAND meson
compile
-C _build
INSTALL_COMMAND meson
install
-C _build
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
freetype2_project
)
endif()
endif()

View File

@@ -1,6 +1,7 @@
if(PROJECT_ENABLE_FUSE AND NOT PROJECT_IS_MINGW)
if(PROJECT_BUILD)
add_definitions(-DPROJECT_ENABLE_FUSE)
include_directories(BEFORE SYSTEM ${PROJECT_FUSE_INCLUDE_DIRS})
if(PROJECT_FUSE STREQUAL "fuse3")
@@ -18,23 +19,26 @@ if(PROJECT_ENABLE_FUSE AND NOT PROJECT_IS_MINGW)
link_libraries(fuse)
endif()
endif()
check_include_files(sys/xattr.h HAS_SETXATTR)
if(HAS_SETXATTR)
add_definitions(-DHAS_SETXATTR)
endif()
else()
pkg_check_modules(LIBFUSE3 fuse3>=3.0.0)
if(LIBFUSE3_FOUND)
set(PROJECT_FUSE fuse3)
set(PROJECT_FUSE_INCLUDE_DIRS ${LIBFUSE3_INCLUDE_DIRS})
if (PROJECT_IS_DARWIN)
find_library(OSXFUSE NO_CACHE NAMES OSXFUSE)
if (NOT OSXFUSE)
message(FATAL_ERROR "FUSE for macOS not found (https://macfuse.github.io)")
endif ()
set(PROJECT_FUSE fuse2)
else()
pkg_check_modules(LIBFUSE2 fuse>=2.9.0)
if(LIBFUSE2_FOUND)
set(PROJECT_FUSE fuse2)
set(PROJECT_FUSE_INCLUDE_DIRS ${LIBFUSE2_INCLUDE_DIRS})
pkg_check_modules(LIBFUSE3 fuse3>=3.0.0)
if(LIBFUSE3_FOUND)
set(PROJECT_FUSE fuse3)
set(PROJECT_FUSE_INCLUDE_DIRS ${LIBFUSE3_INCLUDE_DIRS})
else()
message(FATAL_ERROR "fuse library not found")
pkg_check_modules(LIBFUSE2 fuse>=2.9.0)
if(LIBFUSE2_FOUND)
set(PROJECT_FUSE fuse2)
set(PROJECT_FUSE_INCLUDE_DIRS ${LIBFUSE2_INCLUDE_DIRS})
else()
message(FATAL_ERROR "fuse library not found")
endif()
endif()
endif()
endif()

View File

@@ -1,14 +0,0 @@
if(PROJECT_ENABLE_GTKMM)
if(PROJECT_BUILD)
pkg_check_modules(GTKMM REQUIRED gtkmm-${GTKMM_VERSION})
add_definitions(
-DPROJECT_ENABLE_GTKMM
${GTKMM_DEFINITIONS}
)
include_directories(${GTKMM_INCLUDE_DIRS})
link_directories(${GTKMM_LIBRARY_DIRS})
link_libraries(${GTKMM_LIBRARIES})
endif()
endif()

View File

@@ -1,35 +1,29 @@
if(PROJECT_ENABLE_JSON)
if(PROJECT_BUILD)
find_package(nlohmann_json ${JSON_VERSION} REQUIRED)
add_definitions(-DPROJECT_ENABLE_JSON)
find_package(nlohmann_json ${JSON_VERSION} REQUIRED)
if(PROJECT_IS_MINGW AND PROJECT_IS_MINGW_UNIX)
include_directories(BEFORE SYSTEM
/mingw64/include/nlohmann
)
include_directories(BEFORE SYSTEM /mingw64/include/nlohmann)
else()
include_directories(BEFORE SYSTEM
${PROJECT_EXTERNAL_BUILD_ROOT}/include/nlohmann
)
include_directories(BEFORE SYSTEM ${PROJECT_EXTERNAL_BUILD_ROOT}/include/nlohmann)
endif()
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
ExternalProject_Add(json_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/json-${JSON_VERSION}.tar.gz
URL_HASH SHA256=0d8ef5af7f9794e3263480193c491549b2ba6cc74bb018906202ada498a79406
URL_HASH SHA256=${JSON_HASH}
LIST_SEPARATOR |
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-DJSON_BuildTests=OFF
-DJSON_Install=ON
-DJSON_MultipleHeaders=OFF
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
json_project
)
list(APPEND PROJECT_DEPENDENCIES json_project)
endif()
endif()

View File

@@ -1,72 +0,0 @@
if(PROJECT_ENABLE_LIBBITCOIN_SYSTEM)
if(PROJECT_BUILD)
add_definitions(
-DPROJECT_ENABLE_LIBBITCOIN_SYSTEM
-DBC_STATIC
-DECMULT_GEN_PREC_BITS=4
-DECMULT_WINDOW_SIZE=15
-DWITH_ICU
)
set(LIBBITCOIN_SYSTEM_ROOT
${PROJECT_BUILD_DIR}/external/src/libbitcoinsystem_project
)
include_directories(SYSTEM BEFORE
${LIBBITCOIN_SYSTEM_ROOT}/include
)
set(PROJECT_ADDITIONAL_SOURCES
${PROJECT_ADDITIONAL_SOURCES}
${LIBBITCOIN_SYSTEM_ROOT}/src/math/external/*.c
${LIBBITCOIN_SYSTEM_ROOT}/src/formats/*.cpp
${LIBBITCOIN_SYSTEM_ROOT}/src/config/*.cpp
${LIBBITCOIN_SYSTEM_ROOT}/src/math/*.cpp
${LIBBITCOIN_SYSTEM_ROOT}/src/unicode/*.cpp
${LIBBITCOIN_SYSTEM_ROOT}/src/utility/string.cpp
${LIBBITCOIN_SYSTEM_ROOT}/src/wallet/dictionary.cpp
${LIBBITCOIN_SYSTEM_ROOT}/src/wallet/electrum.cpp
${LIBBITCOIN_SYSTEM_ROOT}/src/wallet/electrum_dictionary.cpp
${LIBBITCOIN_SYSTEM_ROOT}/src/wallet/mnemonic.cpp
)
if(PROJECT_IS_MINGW)
pkg_check_modules(ICU_I18N icu-i18n)
pkg_check_modules(ICU_IO icu-io)
pkg_check_modules(ICU_UC icu-uc)
link_libraries(
${ICU_I18N_LINK_LIBRARIES}
${ICU_IO_LINK_LIBRARIES}
${ICU_UC_LINK_LIBRARIES}
)
else()
link_libraries(
icui18n
icuuc
icudata
)
endif()
else()
ExternalProject_Add(libbitcoinsystem_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/libbitcoin-system-${LIBBITCOIN_SYSTEM_VERSION}.tar.gz
URL_HASH SHA256=0d10d79472e914620223f1ddb9396b0fa92ae5eb0b31acc14b9aa634a01d78b6
CONFIGURE_COMMAND echo "No configure"
BUILD_COMMAND echo "No build"
INSTALL_COMMAND echo "No install"
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
libbitcoinsystem_project
)
if(NOT PROJECT_IS_MINGW_UNIX)
add_dependencies(libbitcoinsystem_project
boost_project
secp256k1_project
)
endif()
endif()
endif()

View File

@@ -1,40 +0,0 @@
if(PROJECT_ENABLE_LIBEVENT)
if(PROJECT_BUILD)
find_package(Libevent ${LIBEVENT_VERSION} REQUIRED)
add_definitions(-DPROJECT_ENABLE_LIBEVENT)
include_directories(BEFORE SYSTEM
${LIBEVENT_INCLUDE_DIRS}
)
link_libraries(
${LIBEVENT_LIBRARIES}
)
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
if(PROJECT_BUILD_SHARED_LIBS)
set(LIBEVENT_LIBRARY_TYPE BOTH)
else()
set(LIBEVENT_LIBRARY_TYPE STATIC)
endif()
ExternalProject_Add(libevent_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/libevent-${LIBEVENT_VERSION}-stable.tar.gz
URL_HASH SHA256=92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb
LIST_SEPARATOR |
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
-DEVENT__DISABLE_OPENSSL=ON
-DEVENT__DISABLE_SAMPLES=ON
-DEVENT__DISABLE_TESTS=ON
-DEVENT__LIBRARY_TYPE=${LIBEVENT_LIBRARY_TYPE}
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
libevent_project
)
endif()
endif()

View File

@@ -1,17 +1,21 @@
if(PROJECT_ENABLE_LIBSODIUM)
if(PROJECT_BUILD)
pkg_check_modules(SODIUM libsodium=${LIBSODIUM_VERSION} REQUIRED)
pkg_check_modules(SODIUM libsodium>=${LIBSODIUM_VERSION} REQUIRED)
add_definitions(-DPROJECT_ENABLE_LIBSODIUM)
include_directories(BEFORE SYSTEM
${SODIUM_INCLUDE_DIRS}
)
include_directories(BEFORE SYSTEM ${SODIUM_INCLUDE_DIRS})
link_libraries(
${SODIUM_LINK_LIBRARIES}
)
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
if(PROJECT_IS_MINGW_UNIX)
if(PROJECT_STATIC_LINK)
link_libraries(/mingw64/lib/libsodium.a)
else()
link_libraries(/mingw64/lib/libsodium.dll.a)
endif()
else()
link_libraries(${SODIUM_LIBRARIES})
endif()
elseif(NOT PROJECT_IS_MINGW)
if(PROJECT_IS_MINGW)
set(LIBSODIUM_TYPE mingw64)
else()
@@ -26,8 +30,8 @@ if(PROJECT_ENABLE_LIBSODIUM)
ExternalProject_Add(libsodium_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/libsodium-${LIBSODIUM_VERSION}-RELEASE.tar.gz
URL_HASH SHA256=4fb996013283f482f46a457c8ff2c1495e797788e78e8ec56b1aa1b19253bf75
URL ${PROJECT_3RD_PARTY_DIR}/libsodium-${LIBSODIUM_VERSION}.tar.gz
URL_HASH SHA256=${LIBSODIUM_HASH}
BUILD_IN_SOURCE 1
LIST_SEPARATOR |
CONFIGURE_COMMAND ${PROJECT_3RD_PARTY_DIR}/libsodium_configure.sh
@@ -39,9 +43,6 @@ if(PROJECT_ENABLE_LIBSODIUM)
INSTALL_COMMAND make install
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
libsodium_project
)
list(APPEND PROJECT_DEPENDENCIES libsodium_project)
endif()
endif()

View File

@@ -1,32 +0,0 @@
if(PROJECT_ENABLE_NUSPELL)
if(PROJECT_BUILD)
find_package(Nuspell ${NUSPELL_VERSION} REQUIRED)
add_definitions(-DPROJECT_ENABLE_NUSPELL)
include_directories(BEFORE SYSTEM
${NUSPELL_INCLUDE_DIRS}
)
link_libraries(
Nuspell::nuspell
)
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
ExternalProject_Add(nuspell_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/nuspell-v${NUSPELL_VERSION}.tar.gz
URL_HASH SHA256=bdf344c5adbcc6797940f8f8cb75cb59f5a3794eb21b9547751a11782a792ef7
LIST_SEPARATOR |
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
-DBUILD_TESTING=OFF
-DBUILD_TOOLS=OFF
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
nuspell_project
)
endif()
endif()

View File

@@ -1,30 +0,0 @@
if(PROJECT_ENABLE_OGG)
if(PROJECT_BUILD)
find_package(Ogg ${OGG_VERSION} REQUIRED)
add_definitions(-DPROJECT_ENABLE_OGG)
include_directories(BEFORE SYSTEM
${OGG_INCLUDE_DIRS}
)
link_libraries(
Ogg::ogg
)
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
ExternalProject_Add(ogg_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/ogg-v${OGG_VERSION}.tar.gz
URL_HASH SHA256=f6f1b04cfa4e98b70ffe775d5e302d9c6b98541f05159af6de2d6617817ed7d6
LIST_SEPARATOR |
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
ogg_project
)
endif()
endif()

View File

@@ -1,30 +0,0 @@
if(PROJECT_ENABLE_OPENAL)
if(PROJECT_BUILD)
find_package(OpenAL ${OPENAL_VERSION} REQUIRED)
add_definitions(-DPROJECT_ENABLE_OPENAL)
include_directories(BEFORE SYSTEM
${OPENAL_INCLUDE_DIR}
)
link_libraries(
${OPENAL_LIBRARY}
)
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
ExternalProject_Add(openal_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/openal-${OPENAL_VERSION}.tar.gz
URL_HASH SHA256=dfddf3a1f61059853c625b7bb03de8433b455f2f79f89548cbcbd5edca3d4a4a
LIST_SEPARATOR |
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
openal_project
)
endif()
endif()

View File

@@ -1,20 +1,26 @@
set(OPENSSL_ROOT_DIR $ENV{OPENSSL_ROOT_DIR})
if(PROJECT_ENABLE_OPENSSL)
if(PROJECT_BUILD)
find_package(OpenSSL ${OPENSSL_VERSION} REQUIRED)
add_definitions(-DPROJECT_ENABLE_OPENSSL)
include_directories(BEFORE SYSTEM
${OPENSSL_INCLUDE_DIR}
)
find_package(OpenSSL ${OPENSSL_VERSION} REQUIRED)
include_directories(BEFORE SYSTEM ${OPENSSL_INCLUDE_DIR})
link_libraries(
OpenSSL::Crypto
OpenSSL::SSL
)
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
elseif(NOT PROJECT_IS_MINGW)
if(PROJECT_IS_MINGW)
set(OPENSSL_COMPILE_TYPE mingw64)
elseif(PROJECT_IS_DARWIN)
if(PROJECT_IS_ARM64)
set(OPENSSL_COMPILE_TYPE darwin64-arm64)
else()
set(OPENSSL_COMPILE_TYPE darwin64-x86_64)
endif()
elseif(PROJECT_IS_ARM64)
set(OPENSSL_COMPILE_TYPE linux-aarch64)
else()
@@ -34,7 +40,7 @@ if(PROJECT_ENABLE_OPENSSL)
ExternalProject_Add(openssl_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/openssl-${OPENSSL_VERSION}.tar.gz
URL_HASH SHA256=53e66b043322a606abf0087e7699a0e033a37fa13feb9742df35c3a33b18fb02
URL_HASH SHA256=${OPENSSL_HASH}
BUILD_IN_SOURCE 1
LIST_SEPARATOR |
CONFIGURE_COMMAND ./Configure
@@ -48,9 +54,6 @@ if(PROJECT_ENABLE_OPENSSL)
INSTALL_COMMAND make install
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
openssl_project
)
list(APPEND PROJECT_DEPENDENCIES openssl_project)
endif()
endif()

View File

@@ -1,36 +1,28 @@
if(PROJECT_ENABLE_PUGIXML)
if(PROJECT_BUILD)
find_package(pugixml ${PUGIXML_VERSION} REQUIRED)
add_definitions(-DPROJECT_ENABLE_PUGIXML)
include_directories(BEFORE SYSTEM
${PUGIXML_INCLUDE_DIR}
)
find_package(pugixml ${PUGIXML_VERSION} REQUIRED)
include_directories(BEFORE SYSTEM ${PUGIXML_INCLUDE_DIR})
if(PROJECT_STATIC_LINK)
link_libraries(
pugixml::static
)
link_libraries(pugixml::static)
else()
link_libraries(
pugixml::pugixml
)
link_libraries(pugixml::pugixml)
endif()
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
elseif(NOT PROJECT_IS_MINGW)
ExternalProject_Add(pugixml_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/pugixml-${PUGIXML_VERSION}.tar.gz
URL_HASH SHA256=2f10e276870c64b1db6809050a75e11a897a8d7456c4be5c6b2e35a11168a015
URL_HASH SHA256=${PUGIXML_HASH}
LIST_SEPARATOR |
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
pugixml_project
)
list(APPEND PROJECT_DEPENDENCIES pugixml_project)
endif()
endif()

View File

@@ -1,27 +1,27 @@
if(PROJECT_ENABLE_ROCKSDB)
if(PROJECT_BUILD)
find_library(ROCKSDB_LIBRARY NAMES librocksdb.a REQUIRED)
add_definitions(-DPROJECT_ENABLE_ROCKSDB)
link_libraries(
${ROCKSDB_LIBRARY}
)
find_library(ROCKSDB_LIBRARY NAMES librocksdb.a REQUIRED)
link_libraries(${ROCKSDB_LIBRARY})
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
ExternalProject_Add(rocksdb_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/rocksdb-${ROCKSDB_VERSION}.tar.gz
URL_HASH SHA256=54ca90dd782a988cd3ebc3e0e9ba9b4efd563d7eb78c5e690c2403f1b7d4a87a
URL_HASH SHA256=${ROCKSDB_HASH}
LIST_SEPARATOR |
BUILD_COMMAND
${CMAKE_COMMAND} --build . -- -j$ENV{CMAKE_BUILD_PARALLEL_LEVEL}
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_SHARED_LIBS=OFF
-DBUILD_STATIC_LIBS=ON
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-DFAIL_ON_WARNINGS=OFF
-DPORTABLE=1
-DROCKSDB_BUILD_SHARED=${PROJECT_BUILD_SHARED_LIBS}
-DROCKSDB_BUILD_SHARED=OFF
-DROCKSDB_INSTALL_ON_WINDOWS=ON
-DWITH_BENCHMARK=OFF
-DWITH_BENCHMARK_TOOLS=OFF
-DWITH_BZ2=OFF
-DWITH_CORE_TOOLS=OFF
-DWITH_EXAMPLES=OFF
-DWITH_GFLAGS=OFF
@@ -33,9 +33,6 @@ if(PROJECT_ENABLE_ROCKSDB)
-DWITH_ZLIB=ON
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
rocksdb_project
)
list(APPEND PROJECT_DEPENDENCIES rocksdb_project)
endif()
endif()

View File

@@ -1,41 +0,0 @@
if(PROJECT_ENABLE_SECP256K1)
if(PROJECT_BUILD)
pkg_check_modules(SECP256K1 libsecp256k1=${SECP256K1_VERSION} REQUIRED)
add_definitions(-DPROJECT_ENABLE_SECP256K1)
include_directories(BEFORE SYSTEM
${SECP256K1_INCLUDE_DIRS}
)
link_libraries(
${SECP256K1_LINK_LIBRARIES}
)
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
if(PROJECT_BUILD_SHARED_LIBS)
set(SECP256K1_ENABLE_SHARED yes)
else()
set(SECP256K1_ENABLE_SHARED no)
endif()
ExternalProject_Add(secp256k1_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/secp256k1-${SECP256K1_VERSION}.tar.gz
URL_HASH SHA256=61583939f1f25b92e6401e5b819e399da02562de663873df3056993b40148701
BUILD_IN_SOURCE 1
LIST_SEPARATOR |
CONFIGURE_COMMAND ./autogen.sh && ./configure
--enable-shared=${SECP256K1_ENABLE_SHARED}
--enable-static=yes
--enable-module-ecdh
--enable-module-recovery
--prefix=${PROJECT_EXTERNAL_BUILD_ROOT}
BUILD_COMMAND make -j1
INSTALL_COMMAND make install
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
secp256k1_project
)
endif()
endif()

View File

@@ -1,66 +0,0 @@
if(PROJECT_ENABLE_SFML)
if(PROJECT_BUILD)
find_package(OpenGL REQUIRED)
find_package(X11 REQUIRED)
find_package(SFML ${SFML_VERSION}
COMPONENTS
audio
graphics
network
system
window
REQUIRED
)
add_definitions(-DPROJECT_ENABLE_SFML)
if(PROJECT_BUILD_SHARED_LIBS)
link_libraries(
${X11_LIBRARIES}
sfml-audio
sfml-graphics
sfml-network
sfml-system
sfml-window
)
else()
link_libraries(
${X11_LIBRARIES}
sfml-audio-s
sfml-graphics-s
sfml-network-s
sfml-system-s
sfml-window-s
)
endif()
include_directories(BEFORE SYSTEM
${X11_INCLUDE_DIR}
${SFML_INCLUDE_DIR}
)
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
ExternalProject_Add(sfml_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/SFML-${SFML_VERSION}.tar.gz
URL_HASH SHA256=82535db9e57105d4f3a8aedabd138631defaedc593cab589c924b7d7a11ffb9d
PATCH_COMMAND ${PROJECT_3RD_PARTY_DIR}/SFML_patch.sh
LIST_SEPARATOR |
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
sfml_project
)
add_dependencies(sfml_project
flac_project
fontconfig_project
freetype2_project
openal_project
)
endif()
endif()

View File

@@ -1,33 +1,26 @@
if(PROJECT_ENABLE_SPDLOG)
if(PROJECT_BUILD)
find_package(spdlog ${SPDLOG_VERSION} REQUIRED)
add_definitions(-DPROJECT_ENABLE_SPDLOG)
include_directories(BEFORE SYSTEM
${SPDLOG_INCLUDE_DIRS}
)
find_package(spdlog ${SPDLOG_VERSION} REQUIRED)
link_libraries(
spdlog::spdlog
)
include_directories(BEFORE SYSTEM ${SPDLOG_INCLUDE_DIRS})
link_libraries(spdlog::spdlog)
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
ExternalProject_Add(spdlog_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/spdlog-${SPDLOG_VERSION}.tar.gz
URL_HASH SHA256=1586508029a7d0670dfcb2d97575dcdc242d3868a259742b69f100801ab4e16b
URL_HASH SHA256=${SPDLOG_HASH}
LIST_SEPARATOR |
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-DSPDLOG_BUILD_EXAMPLE=OFF
-DSPDLOG_FMT_EXTERNAL=OFF
-DSPDLOG_FMT_EXTERNAL_HO=OFF
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
spdlog_project
)
list(APPEND PROJECT_DEPENDENCIES spdlog_project)
endif()
endif()

View File

@@ -1,32 +1,29 @@
if(PROJECT_ENABLE_SQLITE)
if(PROJECT_BUILD)
add_definitions(-DPROJECT_ENABLE_SQLITE)
if (PROJECT_IS_MINGW AND NOT PROJECT_IS_MINGW_UNIX)
pkg_check_modules(SQLITE3 REQUIRED sqlite3)
include_directories(SYSTEM BEFORE ${SQLITE3_INCLUDE_DIRS})
link_libraries(${SQLITE3_LIBRARIES})
else()
set(SQLITE_SYSTEM_ROOT ${PROJECT_BUILD_DIR}/external/src/sqlite_project)
set(SQLITE_SYSTEM_ROOT
${PROJECT_BUILD_DIR}/external/src/sqlite_project
)
include_directories(SYSTEM BEFORE ${SQLITE_SYSTEM_ROOT})
include_directories(SYSTEM BEFORE
${SQLITE_SYSTEM_ROOT}
)
set(PROJECT_ADDITIONAL_SOURCES
${PROJECT_ADDITIONAL_SOURCES}
${SQLITE_SYSTEM_ROOT}/sqlite3.c
)
else()
list(APPEND PROJECT_ADDITIONAL_SOURCES
${SQLITE_SYSTEM_ROOT}/sqlite3.c
)
endif()
elseif(NOT PROJECT_IS_MINGW OR PROJECT_IS_MINGW_UNIX)
ExternalProject_Add(sqlite_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/sqlite-amalgamation-${SQLITE_VERSION}.zip
URL_HASH SHA256=712a7d09d2a22652fb06a49af516e051979a3984adb067da86760e60ed51a7f5
URL_HASH SHA256=${SQLITE_HASH}
CONFIGURE_COMMAND echo "No configure"
BUILD_COMMAND echo "No build"
INSTALL_COMMAND echo "No install"
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
sqlite_project
)
list(APPEND PROJECT_DEPENDENCIES sqlite_project)
endif()
endif()

View File

@@ -1,33 +1,27 @@
if(PROJECT_ENABLE_STDUUID)
if(PROJECT_BUILD)
find_package(stduuid REQUIRED)
add_definitions(-DPROJECT_ENABLE_STDUUID)
include_directories(BEFORE SYSTEM
${stduuid_INCLUDE_DIRS}
)
find_package(stduuid REQUIRED)
link_libraries(
${stduuid_LIBRARIES}
)
include_directories(BEFORE SYSTEM ${stduuid_INCLUDE_DIRS})
link_libraries(${stduuid_LIBRARIES})
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
ExternalProject_Add(stduuid_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/stduuid-${STDUUID_VERSION}.tar.gz
URL_HASH SHA256=b1176597e789531c38481acbbed2a6894ad419aab0979c10410d59eb0ebf40d3
URL_HASH SHA256=${STDUUID_HASH}
LIST_SEPARATOR |
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-DUUID_BUILD_TESTS=OFF
-DUUID_ENABLE_INSTALL=ON
-DUUID_USING_CXX20_SPAN=ON
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
stduuid_project
)
list(APPEND PROJECT_DEPENDENCIES stduuid_project)
endif()
endif()

View File

@@ -1,18 +1,18 @@
if(NOT PROJECT_BUILD AND PROJECT_ENABLE_TESTING)
if(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
if (PROJECT_ENABLE_TESTING)
if(PROJECT_BUILD)
add_definitions(-DPROJECT_ENABLE_TESTING)
elseif(NOT PROJECT_IS_MINGW)
ExternalProject_Add(gtest_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/googletest-${GTEST_VERSION}.tar.gz
URL_HASH SHA256=8ad598c73ad796e0d8280b082cebd82a630d73e73cd3c70057938a6501bba5d7
URL_HASH SHA256=${GTEST_HASH}
LIST_SEPARATOR |
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
gtest_project
)
list(APPEND PROJECT_DEPENDENCIES gtest_project)
endif()
endif()

View File

@@ -1,27 +0,0 @@
if(PROJECT_ENABLE_TPL)
if(PROJECT_BUILD)
find_package(tiny-process-library REQUIRED)
add_definitions(-DPROJECT_ENABLE_TPL)
link_libraries(
tiny-process-library::tiny-process-library
)
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
ExternalProject_Add(tpl_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/tiny-process-library.tar.gz
URL_HASH SHA256=82e46657e697aff5bf980387c86ef3aa05bb184622abbd75663a4df549c68f73
LIST_SEPARATOR |
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
-DBUILD_TESTING=OFF
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
tpl_project
)
endif()
endif()

View File

@@ -1,33 +0,0 @@
if(PROJECT_ENABLE_VORBIS)
if(PROJECT_BUILD)
find_package(Vorbis ${VORBIS_VERSION} REQUIRED)
add_definitions(-DPROJECT_ENABLE_VORBIS)
include_directories(BEFORE SYSTEM
${VORBIS_INCLUDE_DIRS}
)
link_libraries(
Vorbis::vorbis
)
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
ExternalProject_Add(vorbis_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/vorbis-v${VORBIS_VERSION}.tar.gz
URL_HASH SHA256=270c76933d0934e42c5ee0a54a36280e2d87af1de3cc3e584806357e237afd13
PATCH_COMMAND ${PROJECT_3RD_PARTY_DIR}/vorbis_patch.sh ${PROJECT_3RD_PARTY_DIR} ${CMAKE_BINARY_DIR}/external/src/vorbis_project
LIST_SEPARATOR |
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
vorbis_project
)
add_dependencies(vorbis_project ogg_project)
endif()
endif()

View File

@@ -2,13 +2,9 @@ if(PROJECT_ENABLE_WINFSP AND PROJECT_IS_MINGW)
if(PROJECT_BUILD)
add_definitions(-DPROJECT_ENABLE_WINFSP)
include_directories(BEFORE SYSTEM
${PROJECT_3RD_PARTY_DIR}/winfsp-2.0/inc
)
include_directories(BEFORE SYSTEM ${PROJECT_3RD_PARTY_DIR}/winfsp-2.1/inc)
link_directories(BEFORE
${PROJECT_3RD_PARTY_DIR}/winfsp-2.0/lib
)
link_directories(BEFORE ${PROJECT_3RD_PARTY_DIR}/winfsp-2.1/lib)
if(PROJECT_IS_ARM64)
link_libraries(winfsp-a64)

View File

@@ -1,47 +0,0 @@
if(PROJECT_ENABLE_WXWIDGETS)
if(PROJECT_BUILD)
find_package(OpenGL REQUIRED)
find_package(wxWidgets ${WXWIDGETS_VERSION} REQUIRED
COMPONENTS
net
core
base
gl
adv
xml
aui
html
media
propgrid
qa
ribbon
richtext
stc
webview
xrc
)
if(wxWidgets_USE_FILE)
include(${wxWidgets_USE_FILE})
endif()
link_libraries(${wxWidgets_LIBRARIES})
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
ExternalProject_Add(wxwidgets_project
PREFIX external
URL ${PROJECT_3RD_PARTY_DIR}/wxWidgets-${WXWIDGETS_VERSION}.tar.bz2
URL_HASH SHA256=0ad86a3ad3e2e519b6a705248fc9226e3a09bbf069c6c692a02acf7c2d1c6b51
LIST_SEPARATOR |
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
-DwxBUILD_MONOLITHIC=OFF
-DwxBUILD_SHARED=${PROJECT_BUILD_SHARED_LIBS}
)
set(PROJECT_DEPENDENCIES
${PROJECT_DEPENDENCIES}
wxwidgets_project
)
add_dependencies(wxwidgets_project curl_project)
endif()
endif()

View File

@@ -1,64 +1,14 @@
option(PROJECT_ENABLE_BOOST "Enable boost libraries" OFF)
option(PROJECT_ENABLE_CLI11 "Enable CLI11 library" OFF)
option(PROJECT_ENABLE_CPP_HTTPLIB "Enable cpp-httplib" OFF)
option(PROJECT_ENABLE_CURL "Enable curl library" OFF)
option(PROJECT_ENABLE_DTL "Enable DTL" OFF)
option(PROJECT_ENABLE_FLAC "Enable FLAC library" OFF)
option(PROJECT_ENABLE_FMT "Enable fmt library" OFF)
option(PROJECT_ENABLE_FONTCONFIG "Enable fontconfig library" OFF)
option(PROJECT_ENABLE_FREETYPE2 "Enable freetype2 library" OFF)
option(PROJECT_ENABLE_FUSE "Enable FUSE" OFF)
option(PROJECT_ENABLE_FZF "Enable fzf" OFF)
option(PROJECT_ENABLE_GTKMM "Enable gtkmm" OFF)
option(PROJECT_ENABLE_JSON "Enable JSON for Modern C++ library" OFF)
option(PROJECT_ENABLE_LIBBITCOIN_SYSTEM "Enable libbitcoin-system library" OFF)
option(PROJECT_ENABLE_LIBEVENT "Enable libevent library" OFF)
option(PROJECT_ENABLE_LIBSODIUM "Enable libsodium library" OFF)
option(PROJECT_ENABLE_NUSPELL "Enable nuspell" OFF)
option(PROJECT_ENABLE_OGG "Enable OGG library" OFF)
option(PROJECT_ENABLE_OPENAL "Enable OpenAL" OFF)
option(PROJECT_ENABLE_OPENSSL "Enable OpenSSL library" OFF)
option(PROJECT_ENABLE_PUGIXML "Enable PugiXML library" OFF)
option(PROJECT_ENABLE_ROCKSDB "Enable RocksDB library" OFF)
option(PROJECT_ENABLE_SAGO_PLATFORM_FOLDERS "Enable Sago platform folders" OFF)
option(PROJECT_ENABLE_SECP256K1 "Enable secp256k1 library" OFF)
option(PROJECT_ENABLE_SFML "Enable SFML" OFF)
option(PROJECT_ENABLE_SPDLOG "Enable spdlog library" OFF)
option(PROJECT_ENABLE_SQLITE "Enable SQLite" OFF)
option(PROJECT_ENABLE_STDUUID "Enable stduuid library" OFF)
option(PROJECT_ENABLE_TESTING "Enable building unit tests" OFF)
option(PROJECT_ENABLE_TPL "Enable tiny process library" OFF)
option(PROJECT_ENABLE_VORBIS "Enable Vorbis library" OFF)
option(PROJECT_ENABLE_WINFSP "Enable WinFSP" OFF)
option(PROJECT_ENABLE_WXWIDGETS "Enable wxWidgets library" OFF)
option(PROJECT_REQUIRE_ALPINE "Require Alpine Linux as build system" OFF)
option(PROJECT_STATIC_LINK "Static link executables" OFF)
if(PROJECT_ENABLE_FZF)
add_definitions(-DPROJECT_ENABLE_FZF)
endif()
if(PROJECT_ENABLE_SAGO_PLATFORM_FOLDERS)
add_definitions(-DPROJECT_ENABLE_SAGO_PLATFORM_FOLDERS)
endif()
if(PROJECT_ENABLE_TESTING)
add_definitions(-DPROJECT_ENABLE_TESTING)
endif()
if(PROJECT_STATIC_LINK)
add_definitions(-DPROJECT_STATIC_LINK)
endif()
if(PROJECT_IS_MINGW)
add_definitions(-DPROJECT_IS_MINGW)
endif()
if(PROJECT_REQUIRE_ALPINE)
add_definitions(-DPROJECT_REQUIRE_ALPINE)
endif()
if(PROJECT_IS_ARM64)
add_definitions(-DPROJECT_IS_ARM64)
endif()
option(PROJECT_ENABLE_BOOST "Enable boost libraries" ON)
option(PROJECT_ENABLE_CPP_HTTPLIB "Enable cpp-httplib" ON)
option(PROJECT_ENABLE_CURL "Enable curl library" ON)
option(PROJECT_ENABLE_FUSE "Enable FUSE" ON)
option(PROJECT_ENABLE_JSON "Enable JSON for Modern C++ library" ON)
option(PROJECT_ENABLE_LIBSODIUM "Enable libsodium library" ON)
option(PROJECT_ENABLE_OPENSSL "Enable OpenSSL library" ON)
option(PROJECT_ENABLE_PUGIXML "Enable PugiXML library" ON)
option(PROJECT_ENABLE_ROCKSDB "Enable RocksDB library" ON)
option(PROJECT_ENABLE_SPDLOG "Enable spdlog library" ON)
option(PROJECT_ENABLE_SQLITE "Enable SQLite" ON)
option(PROJECT_ENABLE_STDUUID "Enable stduuid library" ON)
option(PROJECT_ENABLE_TESTING "Enable building unit tests" ON)
option(PROJECT_ENABLE_WINFSP "Enable WinFSP" ON)

View File

@@ -2,10 +2,6 @@ if(MSVC)
message(FATAL_ERROR "MSVC will not be supported")
endif()
if(UNIX AND APPLE)
message(FATAL_ERROR "Apple is not currently supported")
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
message(FATAL_ERROR "FreeBSD is not currently supported")
endif()
@@ -13,3 +9,11 @@ endif()
if(PROJECT_REQUIRE_ALPINE AND NOT PROJECT_IS_ALPINE AND PROJECT_IS_MINGW AND PROJECT_IS_MINGW_UNIX)
message(FATAL_ERROR "Project requires Alpine Linux to build")
endif()
if (PROJECT_IS_DARWIN)
if (PROJECT_IS_ARM64)
set(CMAKE_OSX_ARCHITECTURES "arm64")
else()
set(CMAKE_OSX_ARCHITECTURES "x86_64")
endif()
endif()

View File

@@ -41,7 +41,7 @@ if(PROJECT_IS_MINGW)
endif()
include_directories(BEFORE SYSTEM
${PROJECT_3RD_PARTY_DIR}/include
${PROJECT_SUPPORT_DIR}/include
${PROJECT_EXTERNAL_BUILD_ROOT}/include
)

View File

@@ -1,41 +1,30 @@
set(BINUTILS_VERSION 2.41)
set(BINUTILS_VERSION 2.44)
set(BOOST2_MAJOR_VERSION 1)
set(BOOST2_MINOR_VERSION 76)
set(BOOST2_PATCH_VERSION 0)
set(BOOST_MAJOR_VERSION 1)
set(BOOST_MINOR_VERSION 85)
set(BOOST_MINOR_VERSION 88)
set(BOOST_PATCH_VERSION 0)
set(CLI11_VERSION 2.4.2)
set(CPP_HTTPLIB_VERSION 0.15.3)
set(CURL_VERSION 8.7.1)
set(DTL_VERSION 2.01)
set(EXPAT_VERSION 2.6.2)
set(FLAC_VERSION 1.4.3)
set(FMT_VERSION 10.2.1)
set(FONTCONFIG_VERSION 2.15.0)
set(FREETYPE2_VERSION 2.13.2)
set(GCC_VERSION 13.2.0)
set(GTEST_VERSION 1.14.0)
set(GTKMM_VERSION 3.0)
set(ICU_VERSION 75-1)
set(JSON_VERSION 3.11.3)
set(LIBBITCOIN_SYSTEM_VERSION 3.8.0)
set(LIBEVENT_VERSION 2.1.12)
set(LIBSODIUM_VERSION 1.0.19)
set(MESA_VERSION 23.3.3)
set(MINGW_VERSION 11.0.1)
set(NUSPELL_VERSION 5.1.4)
set(OGG_VERSION 1.3.5)
set(OPENAL_VERSION 1.23.1)
set(OPENSSL_VERSION 3.3.0)
set(CPP_HTTPLIB_VERSION 0.23.1)
set(CURL2_VERSION 8_15_0)
set(CURL_VERSION 8.15.0)
set(EXPAT2_VERSION 2_7_1)
set(EXPAT_VERSION 2.7.1)
set(GCC_VERSION 15.1.0)
set(GTEST_VERSION 1.17.0)
set(ICU_VERSION 76-1)
set(INNOSETUP_VERSION 6.4.3)
set(JSON_VERSION 3.12.0)
set(LIBSODIUM_VERSION 1.0.20)
set(MINGW_VERSION 13.0.0)
set(OPENSSL_VERSION 3.5.1)
set(PKG_CONFIG_VERSION 0.29.2)
set(PUGIXML_VERSION 1.14)
set(ROCKSDB_VERSION 9.1.1)
set(SECP256K1_VERSION 0.1.0.20)
set(SFML_VERSION 2.6.1)
set(SPDLOG_VERSION 1.14.1)
set(SQLITE_VERSION 3460000)
set(PUGIXML_VERSION 1.15)
set(ROCKSDB_VERSION 10.4.2)
set(SPDLOG_VERSION 1.15.3)
set(SQLITE2_VERSION 3.50.3)
set(SQLITE_VERSION 3500300)
set(STDUUID_VERSION 1.2.3)
set(VORBIS_VERSION 1.3.7)
set(WXWIDGETS_VERSION 3.2.5)
set(WINFSP2_VERSION 2.1)
set(WINFSP_VERSION 2.1.25156)
set(ZLIB_VERSION 1.3.1)

View File

@@ -1,7 +1,31 @@
#!/bin/bash
PROJECT_APP_NAME="repertory"
PROJECT_NAME="repertory"
PROJECT_MACOS_ICNS_NAME="icon.icns"
PROJECT_COMPANY_NAME="https://git.fifthgrid.com/blockstorage"
PROJECT_URL="${PROJECT_COMPANY_NAME}/repertory"
PROJECT_COPYRIGHT="Copyright <2018-2025> <MIT License> <${PROJECT_URL}>"
PROJECT_DESC="Mount utility for Sia and S3"
PROJECT_MAJOR_VERSION=2
PROJECT_MINOR_VERSION=1
PROJECT_REVISION_VERSION=0
PROJECT_RELEASE_NUM=0
PROJECT_RELEASE_ITER=rc
PROJECT_APP_LIST=(${PROJECT_NAME})
PROJECT_PRIVATE_KEY=${DEVELOPER_PRIVATE_KEY}
PROJECT_PUBLIC_KEY=${DEVELOPER_PUBLIC_KEY}
PROJECT_FLUTTER_BASE_HREF="/ui/"
PROJECT_ENABLE_V2_ERRORS=ON
PROJECT_ENABLE_WIN32_LONG_PATH_NAMES=OFF
PROJECT_ENABLE_BACKWARD_CPP=OFF
PROJECT_ENABLE_BOOST=ON
PROJECT_ENABLE_CPP_HTTPLIB=ON
PROJECT_ENABLE_CURL=ON
@@ -10,6 +34,8 @@ PROJECT_ENABLE_JSON=ON
PROJECT_ENABLE_LIBSODIUM=ON
PROJECT_ENABLE_OPENSSL=ON
PROJECT_ENABLE_PUGIXML=ON
PROJECT_ENABLE_ROCKSDB=ON
PROJECT_ENABLE_SPDLOG=ON
PROJECT_ENABLE_SQLITE=ON
PROJECT_ENABLE_STDUUID=ON
PROJECT_ENABLE_TESTING=ON
@@ -20,7 +46,10 @@ PROJECT_STATIC_LINK=ON
PROJECT_MINGW64_COPY_DEPENDENCIES+=()
PROJECT_MSYS2_PACKAGE_LIST+=()
PROJECT_APP_LIST=(${PROJECT_APP_NAME})
if [ "${PROJECT_ENABLE_TESTING}" == "ON" ]; then
PROJECT_APP_LIST+=(${PROJECT_APP_NAME}_test)
PROJECT_APP_LIST+=(${PROJECT_NAME}_test)
fi
if [ -f "./override.sh" ]; then
. ./override.sh
fi

14
developer.pub Normal file
View File

@@ -0,0 +1,14 @@
-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqXedleDOugdk9sBpgFOA
0+MogIbBF7+iXIIHv8CRBbrrf8nxLSgQvbHQIP0EklebDgLZRgyGI3SSQYj7D957
uNf1//dpkELNzfuezgAyFer9+iH4Svq46HADp5k+ugaK0mMDZM7OLOgo7415/+z4
NIQopv8prMFdxkShr4e4dpR+S6LYMYMVjsi1gnYWaZJMWgzeZouXFSscS1/XDXSE
vr1Jfqme+RmB4Q2QqGcDrY2ijumCJYJzQqlwG6liJ4FNg0U3POTCQDhQmuUoEJe0
/dyiWlo48WQbBu6gUDHbTCCUSZPs2Lc9l65MqOCpX76+VXPYetZgqpMF4GVzb2y9
kETxFNpiMYBlOBZk0I1G33wqVmw46MI5IZMQ2z2F8Mzt1hByUNTgup2IQELCv1a5
a2ACs2TBRuAy1REeHhjLgiA/MpoGX7TpoHCGyo8jBChJVpP9ZHltKoChwDC+bIyx
rgYH3jYDkl2FFuAUJ8zAZl8U1kjqZb9HGq9ootMk34Dbo3IVkc2azB2orEP9F8QV
KxvZZDA9FAFEthSiNf5soJ6mZGLi0es5EWPoKMUEd9tG5bP980DySAWSSRK0AOfE
QShT/z7oG79Orxyomwrb8ZJCi7wEfcCuK1NWgqLVUgXhpi2J9WYS6DAbF3Oh3Hhl
DYSHlcfFBteqNDlR2uFInIECAwEAAQ==
-----END PUBLIC KEY-----

View File

@@ -1,4 +1,5 @@
FROM arm64v8/alpine:3.19
#comment
FROM arm64v8/alpine:3.21.4
MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com>
CMD bash
@@ -10,10 +11,13 @@ RUN apk add \
bash \
binutils \
binutils-dev \
bison \
boost-dev \
bzip2-static \
cmake \
diffutils \
elfutils-dev \
file \
fontconfig-dev \
fontconfig-static \
freetype \
@@ -27,6 +31,7 @@ RUN apk add \
gflags \
gflags-dev \
git \
git-lfs \
icu-dev \
icu-libs \
icu-static \
@@ -62,6 +67,9 @@ RUN apk add \
perl \
pkgconfig \
rsync \
tcl \
tcl-dev \
texinfo \
wget \
xz \
xz-dev \
@@ -74,3 +82,6 @@ RUN apk add \
zstd-libs \
zstd-static \
xz-static
RUN ln -sf /usr/bin/aclocal-1.17 /usr/bin/aclocal-1.16
RUN ln -sf /usr/bin/automake-1.17 /usr/bin/automake-1.16

View File

@@ -1,4 +1,5 @@
FROM alpine:3.19
#comment
FROM alpine:3.21.4
MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com>
CMD bash
@@ -10,10 +11,13 @@ RUN apk add \
bash \
binutils \
binutils-dev \
bison \
boost-dev \
bzip2-static \
cmake \
diffutils \
elfutils-dev \
file \
fontconfig-dev \
fontconfig-static \
freetype \
@@ -27,6 +31,7 @@ RUN apk add \
gflags \
gflags-dev \
git \
git-lfs \
icu-dev \
icu-libs \
icu-static \
@@ -62,6 +67,9 @@ RUN apk add \
perl \
pkgconfig \
rsync \
tcl \
tcl-dev \
texinfo \
wget \
xz \
xz-dev \
@@ -74,3 +82,6 @@ RUN apk add \
zstd-libs \
zstd-static \
xz-static
RUN ln -sf /usr/bin/aclocal-1.17 /usr/bin/aclocal-1.16
RUN ln -sf /usr/bin/automake-1.17 /usr/bin/automake-1.16

47
docker/x86_64/flutter Normal file
View File

@@ -0,0 +1,47 @@
FROM debian:latest
ARG UID=0
ARG GID=0
RUN apt-get update
RUN apt-get install -y \
bash \
curl \
fonts-droid-fallback \
gdb \
git \
lib32stdc++6 \
libglu1-mesa \
libstdc++6 \
python3 \
unzip \
wget
RUN apt-get clean
RUN git clone https://github.com/flutter/flutter.git /flutter
RUN git config --system --add safe.directory /flutter
ENV PATH="/flutter/bin:/flutter/bin/cache/dart-sdk/bin:${PATH}"
RUN flutter doctor -v
RUN flutter channel master
RUN flutter upgrade
RUN flutter --disable-analytics
RUN flutter config --no-analytics
RUN flutter config --enable-web
RUN flutter config --no-cli-animations
RUN mkdir /nonexistent
RUN chown -R $UID:$GID /nonexistent
RUN mkdir /.config
RUN chown -R $UID:$GID /.config
RUN mkdir /.dart-tool
RUN chown -R $UID:$GID /.dart-tool
RUN mkdir /.pub-cache
RUN chown -R $UID:$GID /.pub-cache
RUN chown -R $UID:$GID /flutter

View File

@@ -1,5 +1,5 @@
# comment
FROM alpine:3.19
#comment
FROM alpine:3.21.4
RUN apk update
RUN apk upgrade
@@ -12,11 +12,14 @@ RUN apk add \
bzip2 \
clang17-extra-tools \
cmake \
curl \
file \
flex \
g++ \
gcc \
gettext \
git \
git-lfs \
gmp \
gmp-dev \
gperf \
@@ -39,7 +42,9 @@ RUN apk add \
python3 \
rsync \
ruby \
texinfo \
unzip \
xvfb \
wget \
wine \
xz \
@@ -58,6 +63,9 @@ ENV MY_MINGW_PREFIX=${MINGW_PREFIX}
ARG NUM_JOBS=2
ENV MY_NUM_JOBS=${NUM_JOBS}
ARG CXX_STANDARD=20
ENV MY_CXX_STANDARD=${CXX_STANDARD}
ARG TOOLCHAIN_FILE_CMAKE=/cmake_toolchain.cmake
ENV MY_TOOLCHAIN_FILE_CMAKE=${TOOLCHAIN_FILE_CMAKE}
RUN echo -e \
@@ -87,8 +95,8 @@ RUN echo -e \
"windres = '${MY_MINGW_PREFIX}-windres'\n"\
"exe_wrapper = 'wine64'\n"\
"[properties]\n"\
"c_args = []\n"\
"c_link_args = []\n"\
"c_args = ['-I${MY_MINGW_DIR}/include']\n"\
"c_link_args = ['-L${MY_MINGW_DIR}/lib', '-L${MY_MINGW_DIR}/lib64']\n"\
"[host_machine]\n"\
"cpu = 'x86_64'\n"\
"cpu_family = 'x86_64'\n"\
@@ -96,6 +104,39 @@ RUN echo -e \
"system = 'windows'\n"\
> ${MY_TOOLCHAIN_FILE_MESON}
RUN mkdir -p /opt/bin;echo -e \
"#!/bin/sh\n"\
"COUNT=0\n"\
"echo \"Start waiting on \$@\"\n"\
"while pgrep \"\$@\" > /dev/null; do \n"\
" echo \"waiting ...\"\n"\
" sleep 1;\n"\
" COUNT=\$((COUNT+1))\n"\
" if [ \$COUNT -eq 60 ]; then\n"\
" exit 3;\n"\
" fi\n"\
"done\n"\
"echo \"\$@ completed\"\n"\
> /opt/bin/waitonprocess && \
chmod +x /opt/bin/waitonprocess && \
cat /opt/bin/waitonprocess
RUN echo -e \
"#!/bin/sh\n"\
"Xvfb \$DISPLAY &\n"\
"tokill=\$!\n"\
"wine wineboot --init\n"\
"waitonprocess wineserver\n"\
"\"\$@\"\n"\
"retval=\$?\n"\
"kill -15 \$tokill\n"\
"wine wineboot --shutdown\n"\
"return \$retval\n"\
> /opt/bin/wine-x11-run && \
chmod +x /opt/bin/wine-x11-run && \
cat /opt/bin/wine-x11-run
ENV PATH="/opt/bin:${PATH}"
SHELL [ "/bin/bash", "-c" ]
RUN mkdir -p \
@@ -104,15 +145,12 @@ RUN mkdir -p \
${MY_MINGW_DIR}/lib/pkgconfig \
${MY_MINGW_DIR}/lib64/pkgconfig
ENV LDFLAGS="-L${MY_MINGW_DIR}/lib -L${MY_MINGW_DIR}/lib64"
ENV PATH="${MY_MINGW_DIR}/bin:/usr/local/bin:${PATH}"
ENV PKG_CONFIG_PATH="${MY_MINGW_DIR}/lib/pkgconfig:${MY_MINGW_DIR}/lib64/pkgconfig"
ADD ./3rd_party /3rd_party
ARG BINUTILS_VERSION
ENV MY_BINUTILS_VERSION=${BINUTILS_VERSION}
RUN tar xvJf /3rd_party/mingw64/binutils-${MY_BINUTILS_VERSION}.tar.xz \
RUN cd /3rd_party/mingw64 && sha256sum -c ./binutils-${MY_BINUTILS_VERSION}.tar.xz.sha256 && cd - \
&& tar xvJf /3rd_party/mingw64/binutils-${MY_BINUTILS_VERSION}.tar.xz \
&& cd binutils-${MY_BINUTILS_VERSION} \
&& ./configure \
--disable-lto \
@@ -132,10 +170,11 @@ RUN tar xvJf /3rd_party/mingw64/binutils-${MY_BINUTILS_VERSION}.tar.xz \
ARG MINGW_VERSION
ENV MY_MINGW_VERSION=${MINGW_VERSION}
RUN tar xvzf /3rd_party/mingw64/mingw-w64-${MY_MINGW_VERSION}.tar.gz \
RUN cd /3rd_party/mingw64 && sha256sum -c ./mingw-w64-v${MY_MINGW_VERSION}.tar.bz2.sha256 && cd - \
&& tar xvjf /3rd_party/mingw64/mingw-w64-v${MY_MINGW_VERSION}.tar.bz2 \
&& mkdir mingw-w64 \
&& cd mingw-w64 \
&& ../mingw-w64-${MY_MINGW_VERSION}/mingw-w64-headers/configure \
&& ../mingw-w64-v${MY_MINGW_VERSION}/mingw-w64-headers/configure \
--enable-sdk=all \
--host=${MY_MINGW_PREFIX} \
--prefix=/usr/local/${MY_MINGW_PREFIX} \
@@ -143,7 +182,8 @@ RUN tar xvzf /3rd_party/mingw64/mingw-w64-${MY_MINGW_VERSION}.tar.gz \
ARG GCC_VERSION
ENV MY_GCC_VERSION=${GCC_VERSION}
RUN tar xvzf /3rd_party/mingw64/gcc-${MY_GCC_VERSION}.tar.gz \
RUN cd /3rd_party/mingw64 && sha256sum -c ./gcc-${MY_GCC_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/mingw64/gcc-${MY_GCC_VERSION}.tar.gz \
&& (mv gcc-releases-gcc-${MY_GCC_VERSION} gcc-${MY_GCC_VERSION} || echo "") \
&& mkdir gcc \
&& cd gcc \
@@ -186,7 +226,7 @@ RUN tar xvzf /3rd_party/mingw64/gcc-${MY_GCC_VERSION}.tar.gz \
&& make install-gcc
RUN cd mingw-w64 \
&& ../mingw-w64-${MY_MINGW_VERSION}/mingw-w64-crt/configure \
&& ../mingw-w64-v${MY_MINGW_VERSION}/mingw-w64-crt/configure \
--disable-lib32 \
--enable-lib64 \
--enable-wildcard \
@@ -196,7 +236,7 @@ RUN cd mingw-w64 \
&& make install
RUN cd mingw-w64 \
&& ../mingw-w64-${MY_MINGW_VERSION}/mingw-w64-libraries/winpthreads/configure \
&& ../mingw-w64-v${MY_MINGW_VERSION}/mingw-w64-libraries/winpthreads/configure \
--enable-shared \
--enable-static \
--host=${MY_MINGW_PREFIX} \
@@ -211,11 +251,12 @@ RUN cd gcc \
RUN cp /usr/local/${MY_MINGW_PREFIX}/lib/*.dll ${MY_MINGW_DIR}/bin \
&& cp /usr/local/${MY_MINGW_PREFIX}/bin/*.dll ${MY_MINGW_DIR}/bin \
&& rm -r gcc gcc-${MY_GCC_VERSION} \
&& rm -r mingw-w64 mingw-w64-${MY_MINGW_VERSION}
&& rm -r mingw-w64 mingw-w64-v${MY_MINGW_VERSION}
ARG PKG_CONFIG_VERSION
ENV MY_PKG_CONFIG_VERSION=${PKG_CONFIG_VERSION}
RUN tar xvzf /3rd_party/mingw64/pkg-config-${MY_PKG_CONFIG_VERSION}.tar.gz \
RUN cd /3rd_party/mingw64 && sha256sum -c ./pkg-config-${MY_PKG_CONFIG_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/mingw64/pkg-config-${MY_PKG_CONFIG_VERSION}.tar.gz \
&& cd pkg-config-${MY_PKG_CONFIG_VERSION} \
&& ./configure \
--disable-nls \
@@ -232,25 +273,83 @@ RUN python3 -m pip install --break-system-packages -U mako
RUN python3 -m pip install --break-system-packages -U meson
RUN python3 -m pip install --break-system-packages -U packaging
ENV CXXFLAGS="-std=gnu++20"
ENV LDFLAGS="-L${MY_MINGW_DIR}/lib -L${MY_MINGW_DIR}/lib64"
ENV PATH="${MY_MINGW_DIR}/bin:/usr/local/bin:${PATH}"
ENV PKG_CONFIG_PATH="${MY_MINGW_DIR}/lib/pkgconfig:${MY_MINGW_DIR}/lib64/pkgconfig"
ARG ZLIB_VERSION
ENV MY_ZLIB_VERSION=${ZLIB_VERSION}
RUN tar xvzf /3rd_party/mingw64/zlib-${MY_ZLIB_VERSION}.tar.gz \
RUN cd /3rd_party/mingw64 && sha256sum -c ./zlib-${MY_ZLIB_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/mingw64/zlib-${MY_ZLIB_VERSION}.tar.gz \
&& cd zlib-${MY_ZLIB_VERSION} \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=ON \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
&& rm -r zlib-${MY_ZLIB_VERSION}
ARG LIBJPEG_TURBO_VERSION
ENV MY_LIBJPEG_TURBO_VERSION=${LIBJPEG_TURBO_VERSION}
RUN if [ -f "/3rd_party/libjpeg_turbo-${MY_LIBJPEG_TURBO_VERSION}.tar.gz" ]; then \
cd /3rd_party && sha256sum -c ./libjpeg_turbo-${MY_LIBJPEG_TURBO_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/libjpeg_turbo-${MY_LIBJPEG_TURBO_VERSION}.tar.gz \
&& cd libjpeg-turbo-${MY_LIBJPEG_TURBO_VERSION} \
&& mkdir _build \
&& cd _build \
&& cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_SYSTEM_PROCESSOR=AMD64 \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DENABLE_SHARED=ON \
-DENABLE_STATIC=ON \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
&& rm -r libjpeg-turbo-${MY_LIBJPEG_TURBO_VERSION} \
; fi
ARG LIBPNG_VERSION
ENV MY_LIBPNG_VERSION=${LIBPNG_VERSION}
RUN if [ -f "/3rd_party/libpng-v${MY_LIBPNG_VERSION}.tar.gz" ]; then \
cd /3rd_party && sha256sum -c ./libpng-v${MY_LIBPNG_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/libpng-v${MY_LIBPNG_VERSION}.tar.gz \
&& cd libpng-${MY_LIBPNG_VERSION} \
&& mkdir _build \
&& cd _build \
&& cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DPNG_SHARED=ON \
-DPNG_STATIC=ON \
-DPNG_TESTS=OFF \
-DPNG_TOOLS=OFF \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
&& rm -r libpng-${MY_LIBPNG_VERSION} \
; fi
ARG FREETYPE2_VERSION
ENV MY_FREETYPE2_VERSION=${FREETYPE2_VERSION}
RUN if [ -f "/3rd_party/freetype-${MY_FREETYPE2_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/freetype-${MY_FREETYPE2_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./freetype-${MY_FREETYPE2_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/freetype-${MY_FREETYPE2_VERSION}.tar.gz \
&& cd freetype-${MY_FREETYPE2_VERSION} \
&& meson setup \
--cross-file ${MY_TOOLCHAIN_FILE_MESON} \
@@ -266,26 +365,30 @@ RUN if [ -f "/3rd_party/freetype-${MY_FREETYPE2_VERSION}.tar.gz" ]; then \
ARG EXPAT_VERSION
ENV MY_EXPAT_VERSION=${EXPAT_VERSION}
RUN tar xvzf /3rd_party/mingw64/expat-${MY_EXPAT_VERSION}.tar.gz \
&& cd expat-${MY_EXPAT_VERSION} \
RUN cd /3rd_party/mingw64 && sha256sum -c ./expat-${MY_EXPAT_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/mingw64/expat-${MY_EXPAT_VERSION}.tar.gz \
&& cd libexpat-*/expat \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=ON \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DEXPAT_BUILD_DOCS=OFF \
-DEXPAT_BUILD_EXAMPLES=OFF \
-DEXPAT_BUILD_TESTS=OFF \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
&& rm -r expat-${MY_EXPAT_VERSION}
&& rm -r libexpat-*
ARG FONTCONFIG_VERSION
ENV MY_FONTCONFIG_VERSION=${FONTCONFIG_VERSION}
RUN if [ -f "/3rd_party/fontconfig-${MY_FONTCONFIG_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/fontconfig-${MY_FONTCONFIG_VERSION}.tar.gz \
RUN if [ -f "/3rd_party/fontconfig-${MY_FONTCONFIG_VERSION}.tar.xz" ]; then \
cd /3rd_party && sha256sum -c ./fontconfig-${MY_FONTCONFIG_VERSION}.tar.xz.sha256 && cd - \
&& tar xvJf /3rd_party/fontconfig-${MY_FONTCONFIG_VERSION}.tar.xz \
&& cd fontconfig-${MY_FONTCONFIG_VERSION} \
&& meson setup \
--cross-file ${MY_TOOLCHAIN_FILE_MESON} \
@@ -305,12 +408,15 @@ RUN if [ -f "/3rd_party/fontconfig-${MY_FONTCONFIG_VERSION}.tar.gz" ]; then \
ARG OPENAL_VERSION
ENV MY_OPENAL_VERSION=${OPENAL_VERSION}
RUN if [ -f "/3rd_party/openal-${MY_OPENAL_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/openal-${MY_OPENAL_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./openal-${MY_OPENAL_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/openal-${MY_OPENAL_VERSION}.tar.gz \
&& cd openal-soft-${MY_OPENAL_VERSION} \
&& mkdir _build \
&& cd _build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& cmake .. \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& mv ${MY_MINGW_DIR}/bin/OpenAL32.dll ${MY_MINGW_DIR}/bin/openal32.dll \
@@ -320,10 +426,11 @@ RUN if [ -f "/3rd_party/openal-${MY_OPENAL_VERSION}.tar.gz" ]; then \
ARG ICU_VERSION
ENV MY_ICU_VERSION=${ICU_VERSION}
RUN tar xvzf /3rd_party/mingw64/icu-release-${MY_ICU_VERSION}.tar.gz \
RUN cd /3rd_party/mingw64 && sha256sum -c ./icu-release-${MY_ICU_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/mingw64/icu-release-${MY_ICU_VERSION}.tar.gz \
&& cp -r icu-release-${MY_ICU_VERSION} icu-release-${MY_ICU_VERSION}-cross \
&& cd icu-release-${MY_ICU_VERSION}-cross/icu4c/source \
&& ./configure \
&& CXXFLAGS="-std=gnu++17" ./configure \
--disable-samples \
--disable-tests \
--enable-shared \
@@ -334,7 +441,7 @@ RUN tar xvzf /3rd_party/mingw64/icu-release-${MY_ICU_VERSION}.tar.gz \
RUN cd ${MY_WORKDIR} \
&& cd icu-release-${MY_ICU_VERSION}/icu4c/source \
&& ./configure \
&& CXXFLAGS="-std=gnu++17" ./configure \
--build=x86_64-alpine-linux-musl \
--disable-samples \
--disable-tests \
@@ -353,12 +460,14 @@ RUN cd ${MY_WORKDIR} \
ARG OPENSSL_VERSION
ENV MY_OPENSSL_VERSION=${OPENSSL_VERSION}
RUN if [ -f "/3rd_party/openssl-${MY_OPENSSL_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/openssl-${MY_OPENSSL_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./openssl-${MY_OPENSSL_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/openssl-${MY_OPENSSL_VERSION}.tar.gz \
&& cd openssl-${MY_OPENSSL_VERSION} \
&& ./Configure \
--cross-compile-prefix=${MY_MINGW_PREFIX}- \
--prefix=${MY_MINGW_DIR} \
mingw64 \
no-shared \
no-apps \
no-docs \
&& make -j${MY_NUM_JOBS} \
@@ -375,11 +484,14 @@ ARG BOOST2_PATCH_VERSION
ENV MY_BOOST2_PATCH_VERSION=${BOOST2_PATCH_VERSION}
ENV MY_BOOST2_VERSION=${MY_BOOST2_MAJOR_VERSION}_${MY_BOOST2_MINOR_VERSION}_${MY_BOOST2_PATCH_VERSION}
RUN if [ -f "/3rd_party/boost_${MY_BOOST2_MAJOR_VERSION}_${MY_BOOST2_MINOR_VERSION}_${MY_BOOST2_PATCH_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/boost_${MY_BOOST2_MAJOR_VERSION}_${MY_BOOST2_MINOR_VERSION}_${MY_BOOST2_PATCH_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./boost_${MY_BOOST2_MAJOR_VERSION}_${MY_BOOST2_MINOR_VERSION}_${MY_BOOST2_PATCH_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/boost_${MY_BOOST2_MAJOR_VERSION}_${MY_BOOST2_MINOR_VERSION}_${MY_BOOST2_PATCH_VERSION}.tar.gz \
&& cd boost_${MY_BOOST2_VERSION} \
&& ./bootstrap.sh \
--with-libraries=atomic,chrono,date_time,filesystem,iostreams,locale,log,program_options,random,regex,serialization,system,test,thread \
address-model=64 \
cxxstd=${MY_CXX_STANDARD} \
cxxstd-dialect=gnu \
architecture=x86 \
link=static,shared \
target-os=windows \
@@ -392,6 +504,8 @@ RUN if [ -f "/3rd_party/boost_${MY_BOOST2_MAJOR_VERSION}_${MY_BOOST2_MINOR_VERSI
--prefix=${MY_MINGW_DIR} \
-j${MY_NUM_JOBS} \
address-model=64 \
cxxstd=${MY_CXX_STANDARD} \
cxxstd-dialect=gnu \
architecture=x86 \
link=static,shared \
target-os=windows \
@@ -411,7 +525,8 @@ ARG BOOST_PATCH_VERSION
ENV MY_BOOST_PATCH_VERSION=${BOOST_PATCH_VERSION}
ENV MY_BOOST_VERSION=${MY_BOOST_MAJOR_VERSION}_${MY_BOOST_MINOR_VERSION}_${MY_BOOST_PATCH_VERSION}
RUN if [ -f "/3rd_party/boost_${MY_BOOST_MAJOR_VERSION}_${MY_BOOST_MINOR_VERSION}_${MY_BOOST_PATCH_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/boost_${MY_BOOST_MAJOR_VERSION}_${MY_BOOST_MINOR_VERSION}_${MY_BOOST_PATCH_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./boost_${MY_BOOST_MAJOR_VERSION}_${MY_BOOST_MINOR_VERSION}_${MY_BOOST_PATCH_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/boost_${MY_BOOST_MAJOR_VERSION}_${MY_BOOST_MINOR_VERSION}_${MY_BOOST_PATCH_VERSION}.tar.gz \
&& cd boost_${MY_BOOST_VERSION} \
&& echo "using gcc : gcc : ${MY_MINGW_PREFIX}-g++ ;" \
>./user-config.jam \
@@ -419,6 +534,8 @@ RUN if [ -f "/3rd_party/boost_${MY_BOOST_MAJOR_VERSION}_${MY_BOOST_MINOR_VERSION
--with-libraries=atomic,chrono,date_time,filesystem,iostreams,locale,log,program_options,random,regex,serialization,system,test,thread \
address-model=64 \
architecture=x86 \
cxxstd=${MY_CXX_STANDARD} \
cxxstd-dialect=gnu \
link=static,shared \
target-os=windows \
threading=multi \
@@ -430,6 +547,8 @@ RUN if [ -f "/3rd_party/boost_${MY_BOOST_MAJOR_VERSION}_${MY_BOOST_MINOR_VERSION
-j${MY_NUM_JOBS} \
address-model=64 \
architecture=x86 \
cxxstd=${MY_CXX_STANDARD} \
cxxstd-dialect=gnu \
link=static,shared \
target-os=windows \
threading=multi \
@@ -442,30 +561,37 @@ RUN if [ -f "/3rd_party/boost_${MY_BOOST_MAJOR_VERSION}_${MY_BOOST_MINOR_VERSION
ARG OGG_VERSION
ENV MY_OGG_VERSION=${OGG_VERSION}
RUN if [ -f "/3rd_party/ogg-v${MY_OGG_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/ogg-v${MY_OGG_VERSION}.tar.gz \
&& cd ogg-${MY_OGG_VERSION} \
cd /3rd_party && sha256sum -c ./ogg-v${MY_OGG_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/ogg-v${MY_OGG_VERSION}.tar.gz \
&& cd libogg-${MY_OGG_VERSION} \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=ON \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
&& rm -r ogg-${MY_OGG_VERSION} \
&& rm -r libogg-${MY_OGG_VERSION} \
; fi
ARG VORBIS_VERSION
ENV MY_VORBIS_VERSION=${VORBIS_VERSION}
RUN if [ -f "/3rd_party/vorbis-v${MY_VORBIS_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/vorbis-v${MY_VORBIS_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./vorbis-v${MY_VORBIS_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/vorbis-v${MY_VORBIS_VERSION}.tar.gz \
&& cd vorbis-${MY_VORBIS_VERSION} \
&& /3rd_party/vorbis_patch.sh /3rd_party . \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& cmake .. \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
@@ -475,18 +601,21 @@ RUN if [ -f "/3rd_party/vorbis-v${MY_VORBIS_VERSION}.tar.gz" ]; then \
ARG FLAC_VERSION
ENV MY_FLAC_VERSION=${FLAC_VERSION}
RUN if [ -f "/3rd_party/flac-${MY_FLAC_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/flac-${MY_FLAC_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./flac-${MY_FLAC_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/flac-${MY_FLAC_VERSION}.tar.gz \
&& cd flac-${MY_FLAC_VERSION} \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& cmake .. \
-DBUILD_DOCS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_PROGRAMS=OFF \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=ON \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DBUILD_EXAMPLES=ON \
-DBUILD_PROGRAMS=ON \
-DBUILD_TESTING=OFF \
-DBUILD_DOCS=OFF \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DINSTALL_MANPAGES=OFF \
&& make -j${MY_NUM_JOBS} \
&& make install \
@@ -497,7 +626,8 @@ RUN if [ -f "/3rd_party/flac-${MY_FLAC_VERSION}.tar.gz" ]; then \
ARG SFML_VERSION
ENV MY_SFML_VERSION=${SFML_VERSION}
RUN if [ -f "/3rd_party/SFML-${MY_SFML_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/SFML-${MY_SFML_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./SFML-${MY_SFML_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/SFML-${MY_SFML_VERSION}.tar.gz \
&& cd SFML-${MY_SFML_VERSION} \
&& sed -i s/set_target_properties\(\$\{target\}\ PROPERTIES\ PREFIX\ \"\"\)// \
cmake/Macros.cmake \
@@ -505,10 +635,13 @@ RUN if [ -f "/3rd_party/SFML-${MY_SFML_VERSION}.tar.gz" ]; then \
cmake/Macros.cmake \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=ON \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_SYSTEM_PROCESSOR=AMD64 \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
@@ -518,14 +651,16 @@ RUN if [ -f "/3rd_party/SFML-${MY_SFML_VERSION}.tar.gz" ]; then \
ARG SPDLOG_VERSION
ENV MY_SPDLOG_VERSION=${SPDLOG_VERSION}
RUN if [ -f "/3rd_party/spdlog-${MY_SPDLOG_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/spdlog-${MY_SPDLOG_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./spdlog-${MY_SPDLOG_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/spdlog-${MY_SPDLOG_VERSION}.tar.gz \
&& cd spdlog-${MY_SPDLOG_VERSION} \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& cmake .. \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DSPDLOG_BUILD_SHARED=ON \
-DSPDLOG_BUILD_STATIC=ON \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DSPDLOG_BUILD_EXAMPLE=OFF \
-DSPDLOG_FMT_EXTERNAL=OFF \
-DSPDLOG_FMT_EXTERNAL_HO=OFF \
@@ -538,19 +673,22 @@ RUN if [ -f "/3rd_party/spdlog-${MY_SPDLOG_VERSION}.tar.gz" ]; then \
ARG CLI11_VERSION
ENV MY_CLI11_VERSION=${CLI11_VERSION}
RUN if [ -f "/3rd_party/CLI11-${MY_CLI11_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/CLI11-${MY_CLI11_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./CLI11-${MY_CLI11_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/CLI11-${MY_CLI11_VERSION}.tar.gz \
&& cd CLI11-${MY_CLI11_VERSION} \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCLI11_WARNINGS_AS_ERRORS=OFF \
-DCLI11_SINGLE_FILE=ON \
&& cmake .. \
-DCLI11_BUILD_DOCS=OFF \
-DCLI11_BUILD_TESTS=OFF \
-DCLI11_BUILD_EXAMPLES=OFF \
-DCLI11_BUILD_TESTS=OFF \
-DCLI11_INSTALL=ON \
-DCLI11_SINGLE_FILE=ON \
-DCLI11_WARNINGS_AS_ERRORS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
@@ -559,17 +697,25 @@ RUN if [ -f "/3rd_party/CLI11-${MY_CLI11_VERSION}.tar.gz" ]; then \
ARG CURL_VERSION
ENV MY_CURL_VERSION=${CURL_VERSION}
ARG CURL2_VERSION
ENV MY_CURL2_VERSION=${CURL2_VERSION}
RUN if [ -f "/3rd_party/curl-${MY_CURL_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/curl-${MY_CURL_VERSION}.tar.gz \
&& cd curl-${MY_CURL_VERSION} \
cd /3rd_party && sha256sum -c ./curl-${MY_CURL_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/curl-${MY_CURL_VERSION}.tar.gz \
&& cd curl-curl-${MY_CURL2_VERSION} \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& cmake .. \
-DBUILD_CURL_EXE=ON \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_LIBCURL_DOCS=OFF \
-DBUILD_MISC_DOCS=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_STATIC_LIBS=ON \
-DBUILD_TESTING=OFF \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DCURL_BROTLI=OFF \
-DCURL_CA_BUNDLE=./cacert.pem \
-DCURL_CA_FALLBACK=ON \
-DCURL_DISABLE_LDAP=ON \
@@ -577,6 +723,7 @@ RUN if [ -f "/3rd_party/curl-${MY_CURL_VERSION}.tar.gz" ]; then \
-DCURL_USE_LIBSSH2=OFF \
-DCURL_USE_OPENSSL=ON \
-DCURL_ZLIB=ON \
-DENABLE_CURL_MANUAL=OFF \
-DENABLE_THREADED_RESOLVER=ON \
-DOPENSSL_USE_STATIC_LIBS=ON \
-DUSE_LIBIDN2=OFF \
@@ -584,22 +731,29 @@ RUN if [ -f "/3rd_party/curl-${MY_CURL_VERSION}.tar.gz" ]; then \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
&& rm -r curl-${MY_CURL_VERSION} \
&& rm -r curl-curl-${MY_CURL2_VERSION} \
; fi
ARG CPP_HTTPLIB_VERSION
ENV MY_CPP_HTTPLIB_VERSION=${CPP_HTTPLIB_VERSION}
RUN if [ -f "/3rd_party/cpp-httplib-${MY_CPP_HTTPLIB_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/cpp-httplib-${MY_CPP_HTTPLIB_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./cpp-httplib-${MY_CPP_HTTPLIB_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/cpp-httplib-${MY_CPP_HTTPLIB_VERSION}.tar.gz \
&& cd cpp-httplib-${MY_CPP_HTTPLIB_VERSION} \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DHTTPLIB_REQUIRE_BROTLI=OFF \
-DHTTPLIB_REQUIRE_OPENSSL=ON \
-DHTTPLIB_REQUIRE_ZLIB=ON \
-DHTTPLIB_REQUIRE_BROTLI=OFF \
-DHTTPLIB_TEST=OFF \
-DHTTPLIB_USE_BROTLI_IF_AVAILABLE=OFF \
-DHTTPLIB_USE_OPENSSL_IF_AVAILABLE=YES \
-DHTTPLIB_USE_ZLIB_IF_AVAILABLE=ON \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
@@ -609,14 +763,17 @@ RUN if [ -f "/3rd_party/cpp-httplib-${MY_CPP_HTTPLIB_VERSION}.tar.gz" ]; then \
ARG FMT_VERSION
ENV MY_FMT_VERSION=${FMT_VERSION}
RUN if [ -f "/3rd_party/fmt-${MY_FMT_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/fmt-${MY_FMT_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./fmt-${MY_FMT_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/fmt-${MY_FMT_VERSION}.tar.gz \
&& cd fmt-${MY_FMT_VERSION} \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
&& cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=ON \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DFMT_DOC=OFF \
-DFMT_TEST=OFF \
&& make -j${MY_NUM_JOBS} \
@@ -628,13 +785,16 @@ RUN if [ -f "/3rd_party/fmt-${MY_FMT_VERSION}.tar.gz" ]; then \
ARG GTEST_VERSION
ENV MY_GTEST_VERSION=${GTEST_VERSION}
RUN if [ -f "/3rd_party/googletest-${MY_GTEST_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/googletest-${MY_GTEST_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./googletest-${MY_GTEST_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/googletest-${MY_GTEST_VERSION}.tar.gz \
&& cd googletest-${MY_GTEST_VERSION} \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
@@ -644,13 +804,16 @@ RUN if [ -f "/3rd_party/googletest-${MY_GTEST_VERSION}.tar.gz" ]; then \
ARG JSON_VERSION
ENV MY_JSON_VERSION=${JSON_VERSION}
RUN if [ -f "/3rd_party/json-${MY_JSON_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/json-${MY_JSON_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./json-${MY_JSON_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/json-${MY_JSON_VERSION}.tar.gz \
&& cd json-${MY_JSON_VERSION} \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DJSON_BuildTests=OFF \
-DJSON_Install=ON \
-DJSON_MultipleHeaders=OFF \
@@ -663,13 +826,17 @@ RUN if [ -f "/3rd_party/json-${MY_JSON_VERSION}.tar.gz" ]; then \
ARG LIBEVENT_VERSION
ENV MY_LIBEVENT_VERSION=${LIBEVENT_VERSION}
RUN if [ -f "/3rd_party/libevent-${MY_LIBEVENT_VERSION}-stable.tar.gz" ]; then \
tar xvzf /3rd_party/libevent-${MY_LIBEVENT_VERSION}-stable.tar.gz \
&& cd libevent-${MY_LIBEVENT_VERSION}-stable \
cd /3rd_party && sha256sum -c ./libevent-${MY_LIBEVENT_VERSION}-stable.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/libevent-${MY_LIBEVENT_VERSION}-stable.tar.gz \
&& cd libevent-release-${MY_LIBEVENT_VERSION}-stable \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_C_FLAGS="-include winsock2.h -include ws2tcpip.h -include iphlpapi.h" \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DEVENT__DISABLE_OPENSSL=ON \
-DEVENT__DISABLE_SAMPLES=ON \
-DEVENT__DISABLE_TESTS=ON \
@@ -677,17 +844,18 @@ RUN if [ -f "/3rd_party/libevent-${MY_LIBEVENT_VERSION}-stable.tar.gz" ]; then \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
&& rm -r libevent-${MY_LIBEVENT_VERSION}-stable \
&& rm -r libevent-release-${MY_LIBEVENT_VERSION}-stable \
; fi
ARG LIBSODIUM_VERSION
ENV MY_LIBSODIUM_VERSION=${LIBSODIUM_VERSION}
RUN if [ -f "/3rd_party/libsodium-${MY_LIBSODIUM_VERSION}-RELEASE.tar.gz" ]; then \
tar xvzf /3rd_party/libsodium-${MY_LIBSODIUM_VERSION}-RELEASE.tar.gz \
RUN if [ -f "/3rd_party/libsodium-${MY_LIBSODIUM_VERSION}.tar.gz" ]; then \
cd /3rd_party && sha256sum -c ./libsodium-${MY_LIBSODIUM_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/libsodium-${MY_LIBSODIUM_VERSION}.tar.gz \
&& cd libsodium-${MY_LIBSODIUM_VERSION}-RELEASE \
&& CFLAGS="-O3 -fomit-frame-pointer -m64 -mtune=generic" ./configure \
--enable-shared \
--enable-static \
--enable-shared=yes \
--enable-static=yes \
--host=${MY_MINGW_PREFIX} \
--prefix=${MY_MINGW_DIR} \
&& make -j${MY_NUM_JOBS} \
@@ -699,15 +867,19 @@ RUN if [ -f "/3rd_party/libsodium-${MY_LIBSODIUM_VERSION}-RELEASE.tar.gz" ]; the
ARG NUSPELL_VERSION
ENV MY_NUSPELL_VERSION=${NUSPELL_VERSION}
RUN if [ -f "/3rd_party/nuspell-v${MY_NUSPELL_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/nuspell-v${MY_NUSPELL_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./nuspell-v${MY_NUSPELL_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/nuspell-v${MY_NUSPELL_VERSION}.tar.gz \
&& cd nuspell-${MY_NUSPELL_VERSION} \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
&& cmake .. \
-DBUILD_DOCS=OFF \
-DBUILD_TESTING=OFF \
-DBUILD_TOOLS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
@@ -717,13 +889,16 @@ RUN if [ -f "/3rd_party/nuspell-v${MY_NUSPELL_VERSION}.tar.gz" ]; then \
ARG PUGIXML_VERSION
ENV MY_PUGIXML_VERSION=${PUGIXML_VERSION}
RUN if [ -f "/3rd_party/pugixml-${MY_PUGIXML_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/pugixml-${MY_PUGIXML_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./pugixml-${MY_PUGIXML_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/pugixml-${MY_PUGIXML_VERSION}.tar.gz \
&& cd pugixml-${MY_PUGIXML_VERSION} \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
@@ -733,19 +908,23 @@ RUN if [ -f "/3rd_party/pugixml-${MY_PUGIXML_VERSION}.tar.gz" ]; then \
ARG ROCKSDB_VERSION
ENV MY_ROCKSDB_VERSION=${ROCKSDB_VERSION}
RUN if [ -f "/3rd_party/rocksdb-${MY_ROCKSDB_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/rocksdb-${MY_ROCKSDB_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./rocksdb-${MY_ROCKSDB_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/rocksdb-${MY_ROCKSDB_VERSION}.tar.gz \
&& cd rocksdb-${MY_ROCKSDB_VERSION} \
&& echo -e "add_definitions(-include cstdint)">>CMakeLists.txt \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DFAIL_ON_WARNINGS=OFF \
-DPORTABLE=1 \
-DROCKSDB_INSTALL_ON_WINDOWS=ON \
-DWITH_BENCHMARK=OFF \
-DWITH_BENCHMARK_TOOLS=OFF \
-DWITH_BZ2=OFF \
-DWITH_CORE_TOOLS=OFF \
-DWITH_EXAMPLES=OFF \
-DWITH_GFLAGS=OFF \
@@ -764,7 +943,8 @@ RUN if [ -f "/3rd_party/rocksdb-${MY_ROCKSDB_VERSION}.tar.gz" ]; then \
ARG SECP256K1_VERSION
ENV MY_SECP256K1_VERSION=${SECP256K1_VERSION}
RUN if [ -f "/3rd_party/secp256k1-${MY_SECP256K1_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/secp256k1-${MY_SECP256K1_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./secp256k1-${MY_SECP256K1_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/secp256k1-${MY_SECP256K1_VERSION}.tar.gz \
&& cd secp256k1-${MY_SECP256K1_VERSION} \
&& ./autogen.sh && ./configure \
--host=${MY_MINGW_PREFIX} \
@@ -782,13 +962,16 @@ RUN if [ -f "/3rd_party/secp256k1-${MY_SECP256K1_VERSION}.tar.gz" ]; then \
ARG STDUUID_VERSION
ENV MY_STDUUID_VERSION=${STDUUID_VERSION}
RUN if [ -f "/3rd_party/stduuid-${MY_STDUUID_VERSION}.tar.gz" ]; then \
tar xvzf /3rd_party/stduuid-${MY_STDUUID_VERSION}.tar.gz \
cd /3rd_party && sha256sum -c ./stduuid-${MY_STDUUID_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/stduuid-${MY_STDUUID_VERSION}.tar.gz \
&& cd stduuid-${MY_STDUUID_VERSION} \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DUUID_BUILD_TESTS=OFF \
-DUUID_ENABLE_INSTALL=ON \
-DUUID_USING_CXX20_SPAN=ON \
@@ -799,16 +982,19 @@ RUN if [ -f "/3rd_party/stduuid-${MY_STDUUID_VERSION}.tar.gz" ]; then \
; fi
RUN if [ -f "/3rd_party/tiny-process-library.tar.gz" ]; then \
tar xvzf /3rd_party/tiny-process-library.tar.gz \
cd /3rd_party && sha256sum -c ./tiny-process-library.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/tiny-process-library.tar.gz \
&& cd tiny-process-library-master \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
&& cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=ON \
-DBUILD_TESTING=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
@@ -818,15 +1004,18 @@ RUN if [ -f "/3rd_party/tiny-process-library.tar.gz" ]; then \
ARG WXWIDGETS_VERSION
ENV MY_WXWIDGETS_VERSION=${WXWIDGETS_VERSION}
RUN if [ -f "/3rd_party/wxWidgets-${MY_WXWIDGETS_VERSION}.tar.bz2" ]; then \
tar xvjf /3rd_party/wxWidgets-${MY_WXWIDGETS_VERSION}.tar.bz2 \
cd /3rd_party && sha256sum -c ./wxWidgets-${MY_WXWIDGETS_VERSION}.tar.bz2.sha256 && cd - \
&& tar xvjf /3rd_party/wxWidgets-${MY_WXWIDGETS_VERSION}.tar.bz2 \
&& cd wxWidgets-${MY_WXWIDGETS_VERSION} \
&& mkdir _build \
&& cd _build \
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
&& cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DwxBUILD_MONOLITHIC=OFF \
-DwxBUILD_SHARED=ON \
&& make -j${MY_NUM_JOBS} \
@@ -835,6 +1024,165 @@ RUN if [ -f "/3rd_party/wxWidgets-${MY_WXWIDGETS_VERSION}.tar.bz2" ]; then \
&& rm -r wxWidgets-${MY_WXWIDGETS_VERSION} \
; fi
RUN (mv ${MY_MINGW_DIR}/lib/*.dll ${MY_MINGW_DIR}/bin || echo "no dll's found") \
ARG CXXOPTS_VERSION
ENV MY_CXXOPTS_VERSION=${CXXOPTS_VERSION}
RUN if [ -f "/3rd_party/cxxopts-v${MY_CXXOPTS_VERSION}.tar.gz" ]; then \
cd /3rd_party && sha256sum -c ./cxxopts-v${MY_CXXOPTS_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/cxxopts-v${MY_CXXOPTS_VERSION}.tar.gz \
&& cd cxxopts-${MY_CXXOPTS_VERSION} \
&& mkdir _build \
&& cd _build \
&& cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DCXXOPTS_BUILD_EXAMPLES=OFF \
-DCXXOPTS_BUILD_TESTS=OFF \
-DCXXOPTS_ENABLE_INSTALL=ON \
-DCXXOPTS_ENABLE_WARNINGS=OFF \
-DCXXOPTS_USE_UNICODE_HELP=ON \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
&& rm -r cxxopts-${MY_CXXOPTS_VERSION} \
; fi
ARG NANA_VERSION
ENV MY_NANA_VERSION=${NANA_VERSION}
RUN if [ -f "/3rd_party/nana-v${MY_NANA_VERSION}.tar.gz" ]; then \
cd /3rd_party && sha256sum -c ./nana-v${MY_NANA_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/nana-v${MY_NANA_VERSION}.tar.gz \
&& cd nana-${MY_NANA_VERSION} \
&& /3rd_party/nana_patch.sh /3rd_party . \
&& mkdir _build \
&& cd _build \
&& cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
-DNANA_CMAKE_ENABLE_AUDIO=OFF \
-DNANA_CMAKE_ENABLE_JPEG=ON \
-DNANA_CMAKE_ENABLE_PNG=ON \
-DNANA_CMAKE_INSTALL=ON \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
&& rm -r nana-${MY_NANA_VERSION} \
; fi
ARG SDL_VERSION
ENV MY_SDL_VERSION=${SDL_VERSION}
RUN if [ -f "/3rd_party/sdl-${MY_SDL_VERSION}.tar.gz" ]; then \
cd /3rd_party && sha256sum -c ./sdl-${MY_SDL_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/sdl-${MY_SDL_VERSION}.tar.gz \
&& cd SDL-release-${MY_SDL_VERSION} \
&& ./configure \
--host=${MY_MINGW_PREFIX} \
--enable-shared=yes \
--enable-static=yes \
--prefix=${MY_MINGW_DIR} \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
&& rm -r SDL-release-${MY_SDL_VERSION} \
; fi
ARG LIBTASN_VERSION
ENV MY_LIBTASN_VERSION=${LIBTASN_VERSION}
RUN if [ -f "/3rd_party/libtasn1-${MY_LIBTASN_VERSION}.tar.gz" ]; then \
cd /3rd_party && sha256sum -c ./libtasn1-${MY_LIBTASN_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/libtasn1-${MY_LIBTASN_VERSION}.tar.gz \
&& cd libtasn1-${MY_LIBTASN_VERSION} \
&& ./configure \
--disable-doc \
--enable-static=yes \
--enable-shared=no \
--host=${MY_MINGW_PREFIX} \
--prefix=${MY_MINGW_DIR} \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
&& rm -r libtasn1-${MY_LIBTASN_VERSION} \
&& echo -e \
"#!/bin/bash\n"\
"\n"\
"wine ${MY_MINGW_DIR}/bin/asn1Parser.exe \$@\n"\
> ${MY_MINGW_DIR}/bin/asn1Parser \
&& chmod +x ${MY_MINGW_DIR}/bin/asn1Parser \
; fi
ARG LIBICONV_VERSION
ENV MY_LIBICONV_VERSION=${LIBICONV_VERSION}
RUN if [ -f "/3rd_party/libiconv-${MY_LIBICONV_VERSION}.tar.gz" ]; then \
cd /3rd_party && sha256sum -c ./libiconv-${MY_LIBICONV_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/libiconv-${MY_LIBICONV_VERSION}.tar.gz \
&& cd libiconv-${MY_LIBICONV_VERSION} \
&& ./configure \
--enable-static=yes \
--enable-shared=no \
--host=${MY_MINGW_PREFIX} \
--prefix=${MY_MINGW_DIR} \
&& make -j${MY_NUM_JOBS} \
&& make install \
&& cd ${MY_WORKDIR} \
&& rm -r libiconv-${MY_LIBICONV_VERSION} \
; fi
ARG LIBDSM_VERSION
ENV MY_LIBDSM_VERSION=${LIBDSM_VERSION}
RUN if [ -f "/3rd_party/libdsm-${MY_LIBDSM_VERSION}.tar.gz" ]; then \
cd /3rd_party && sha256sum -c ./libdsm-${MY_LIBDSM_VERSION}.tar.gz.sha256 && cd - \
&& tar xvzf /3rd_party/libdsm-${MY_LIBDSM_VERSION}.tar.gz \
&& cd libdsm-${MY_LIBDSM_VERSION} \
&& /3rd_party/libdsm_patch.sh /3rd_party . \
&& meson setup \
--bindir=${MY_MINGW_DIR}/bin \
--cross-file ${MY_TOOLCHAIN_FILE_MESON} \
--prefix=${MY_MINGW_DIR} \
-Dbinaries=false \
-Ddefault_library=static \
_build \
&& meson compile \
-C _build \
&& meson install \
-C _build \
&& cd ${MY_WORKDIR} \
&& rm -r libdsm-${MY_LIBDSM_VERSION} \
; fi
ENV DISPLAY=:90
ENV WINEDEBUG=-all,err+all
ARG INNOSETUP_VERSION
ENV MY_INNOSETUP_VERSION=${INNOSETUP_VERSION}
RUN rm -rf /root/.wine; \
wine64 reg add 'HKEY_CURRENT_USER\Software\Wine' /v ShowDotFiles /d Y \
&& while [ ! -f /root/.wine/user.reg ]; do sleep 1; done; \
wine-x11-run wine64 /3rd_party/mingw64/innosetup-${MY_INNOSETUP_VERSION}.exe /SP- /VERYSILENT /ALLUSERS /SUPPRESSMSGBOXES /DOWNLOADISCRYPT=1
ARG UID=1000
ARG GID=1000
ARG USERNAME=myuser
RUN delgroup scanner || echo "no scanner group found"
RUN addgroup -g $GID $USERNAME && \
adduser -D -u $UID -G $USERNAME -h /home/$USERNAME $USERNAME
RUN rsync -av --progress /root/.wine/ /home/$USERNAME/.wine/ && \
chown -R $UID:$GID -R /home/$USERNAME/.wine/
RUN (cp ${MY_MINGW_DIR}/lib/*.dll ${MY_MINGW_DIR}/bin || echo "no dll's found") \
&& chmod 0777 -R ${MY_MINGW_DIR} \
&& rm -rf /3rd_party
&& rm -rf /3rd_party \
&& rm -rf /root/.wine
USER $USERNAME
WORKDIR /home/$USERNAME

BIN
icon.icns Normal file

Binary file not shown.

BIN
icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 KiB

12
post_build.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
CURRENT_DIR=$(dirname "$0")
CURRENT_DIR=$(realpath ${CURRENT_DIR})
rsync -av --progress ${CURRENT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}_test/test_input/ \
${PROJECT_BUILD_DIR}/build/test_input/
rsync -av --progress ${CURRENT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}_test/test_input/ \
${PROJECT_DIST_DIR}/test_input/
rsync -av --progress ${CURRENT_DIR}/icon.ico ${PROJECT_DIST_DIR}/icon.ico

View File

@@ -1,38 +1,20 @@
set(REPERTORY_MAJOR 2)
set(REPERTORY_MINOR 0)
set(REPERTORY_REV 2)
set(REPERTORY_RELEASE_NUM 0)
set(REPERTORY_RELEASE_ITER rc)
set(CMAKE_CXX_FLAGS "-include common.hpp ${CMAKE_CXX_FLAGS}")
set(PROJECT_VERSION ${REPERTORY_MAJOR}.${REPERTORY_MINOR}.${REPERTORY_REV}-${REPERTORY_RELEASE_ITER})
set(REPERTORY_VER_FILEVERSION ${REPERTORY_MAJOR},${REPERTORY_MINOR},${REPERTORY_REV},${REPERTORY_RELEASE_NUM})
set(REPERTORY_VER_FILEVERSION_STR ${REPERTORY_MAJOR}.${REPERTORY_MINOR}.${REPERTORY_REV}.${REPERTORY_RELEASE_NUM})
set(REPERTORY_VER_PRODUCTVERSION ${REPERTORY_MAJOR},${REPERTORY_MINOR},${REPERTORY_REV},${REPERTORY_RELEASE_NUM})
set(REPERTORY_VER_PRODUCTVERSION_STR ${REPERTORY_MAJOR}.${REPERTORY_MINOR}.${REPERTORY_REV}.${REPERTORY_RELEASE_NUM})
set(REPERTORY_VER_PRERELEASE VS_FF_PRERELEASE)
set(REPERTORY_VER_COMPANYNAME_STR "https://git.fifthgrid.com/blockstorage")
set(REPERTORY_VER_LEGALCOPYRIGHT_STR "Copyright <2018-2024> <MIT License> <https://git.fifthgrid.com/blockstorage/repertory>")
set(REPERTORY_VER_FILEDESCRIPTION_STR "Mount utility for Sia and S3")
option(REPERTORY_ENABLE_S3 "Enable S3 support" ON)
if (REPERTORY_ENABLE_S3)
add_definitions(-DREPERTORY_ENABLE_S3)
endif()
if (PROJECT_IS_MINGW)
if (PROJECT_IS_DARWIN)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.rc.in
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.rc
${CMAKE_SOURCE_DIR}/${PROJECT_NAME}/Info.plist.in
${CMAKE_SOURCE_DIR}/${PROJECT_NAME}/Info.plist
@ONLY
)
set(PROJECT_WINDOWS_VERSION_RC ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.rc)
endif()
set(CMAKE_CXX_FLAGS "-include common.hpp ${CMAKE_CXX_FLAGS}")
add_project_library(lib${PROJECT_NAME} "" "" "${PROJECT_ADDITIONAL_SOURCES}")
add_project_executable(${PROJECT_NAME} lib${PROJECT_NAME} lib${PROJECT_NAME})
if (PROJECT_IS_DARWIN)
set_target_properties(${PROJECT_NAME} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/Info.plist
)
endif()
add_project_test_executable(${PROJECT_NAME}_test lib${PROJECT_NAME} lib${PROJECT_NAME})

View File

@@ -1 +0,0 @@
set(PROJECT_NAME repertory)

169
repertory.iss.in Normal file
View File

@@ -0,0 +1,169 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "repertory"
#define MyAppVersion "@PROJECT_MAJOR_VERSION@.@PROJECT_MINOR_VERSION@.@PROJECT_REVISION_VERSION@-@PROJECT_RELEASE_ITER@_@PROJECT_GIT_REV@"
#define MyAppPublisher "BlockStorage"
#define MyAppURL "https://git.fifthgrid.com/BlockStorage/repertory"
#define MyAppExeName "repertory.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{BD165823-1DEF-4D23-87DC-3D7A9BB73A00}
AppName={#MyAppName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
AppVersion={#MyAppVersion}
ArchitecturesAllowed=x64compatible
ArchitecturesInstallIn64BitMode=x64compatible
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=repertory\LICENSE.md
OutputBaseFilename=repertory_{#MyAppVersion}_windows_@PROJECT_MARCH@_setup
PrivilegesRequired=admin
SolidCompression=yes
SetupIconFile=repertory\icon.ico
UninstallDisplayIcon={app}\icon.ico
WizardStyle=modern
[code]
const
SMTO_ABORTIFHUNG = $0002;
WM_SETTINGCHANGE = $001A;
type
LPARAM = LongWord;
LRESULT = LongWord;
WPARAM = LongWord;
function SendMessageTimeout(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: AnsiString;
fuFlags: UINT; uTimeout: UINT; out lpdwResult: DWORD): LRESULT;
external 'SendMessageTimeoutA@user32.dll stdcall';
procedure RefreshEnvironment();
var
EnvStr: AnsiString;
R: DWORD;
begin
EnvStr := 'Environment' + #0;
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0,
EnvStr, SMTO_ABORTIFHUNG, 5000, R);
end;
function NormalizeSemicolons(S: string): string;
begin
while Pos(';;', S) > 0 do
StringChange(S, ';;', ';');
Result := S;
end;
procedure AddAppToPath();
var
OldPath, NewPath, FinalPath: string;
begin
if not RegQueryStringValue(HKLM,
'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
'Path', OldPath)
then
OldPath := '';
NewPath := ExpandConstant('{app}');
if Pos(LowerCase(NewPath), LowerCase(OldPath)) = 0 then
begin
if (OldPath <> '') and (Copy(OldPath, Length(OldPath), 1) <> ';') then
OldPath := OldPath + ';';
FinalPath := NormalizeSemicolons(OldPath + NewPath + ';');
RegWriteExpandStringValue(HKLM,
'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
'Path', FinalPath);
RefreshEnvironment();
end;
end;
procedure RemoveAppFromPath();
var
OldPath, NewPath, Token, Remainder, FinalPath: string;
p: Integer;
begin
if not RegQueryStringValue(HKLM,
'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
'Path', OldPath) then
Exit;
NewPath := ExpandConstant('{app}');
Remainder := OldPath;
FinalPath := '';
while Length(Remainder) > 0 do
begin
p := Pos(';', Remainder);
if p = 0 then
begin
Token := Remainder;
Remainder := '';
end
else
begin
Token := Copy(Remainder, 1, p - 1);
Delete(Remainder, 1, p);
end;
Token := Trim(Token);
if (Token <> '') and (CompareText(Token, NewPath) <> 0) then
begin
if (FinalPath <> '') and (FinalPath[Length(FinalPath)] <> ';') then
FinalPath := FinalPath + ';';
FinalPath := FinalPath + Token;
end;
end;
while Pos(';;', FinalPath) > 0 do
StringChange(FinalPath, ';;', ';');
if (FinalPath <> '') and (FinalPath[Length(FinalPath)] = ';') then
Delete(FinalPath, Length(FinalPath), 1);
RegWriteExpandStringValue(HKLM,
'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
'Path', FinalPath);
RefreshEnvironment();
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
begin
AddAppToPath();
end;
end;
procedure DeinitializeUninstall();
begin
RemoveAppFromPath();
end;
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Components]
Name: "main"; Description: "Repertory Core"; Types: full compact custom; Flags: fixed
Name: "winfsp"; Description: "WinFSP v@WINFSP_VERSION@"; Types: full custom
[Files]
Source: "repertory\*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: main
Source: "3rd_party\winfsp-@WINFSP_VERSION@.msi"; DestDir: "{app}"; Flags: ignoreversion; Components: winfsp
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Parameters: "-ui --hidden"; IconFilename: "{app}\icon.ico"
Name: "{commonstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Parameters: "-ui --launch_only --hidden"; IconFilename: "{app}\icon.ico"
[Run]
Filename: "msiexec.exe"; WorkingDir: "{app}"; Parameters: "/a winfsp-@WINFSP_VERSION@.msi /norestart"; \
Flags: 64bit waituntilterminated; Components: winfsp

21
repertory/Info.plist.in Normal file
View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>@PROJECT_NAME@</string>
<key>CFBundleIdentifier</key>
<string>com.fifthgrid.blockstorage.@PROJECT_NAME@</string>
<key>CFBundleName</key>
<string>@PROJECT_NAME@</string>
<key>CFBundleVersion</key>
<string>@PROJECT_MAJOR_VERSION@.@PROJECT_MINOR_VERSION@.@PROJECT_REVISION_VERSION@-@PROJECT_RELEASE_ITER@_@PROJECT_GIT_REV@</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>LSUIElement</key>
<true/>
<key>CFBundleIconFile</key>
<string>@PROJECT_MACOS_ICNS_NAME@</string>
</dict>
</plist>

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,438 +19,244 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_APP_CONFIG_HPP_
#define INCLUDE_APP_CONFIG_HPP_
#ifndef REPERTORY_INCLUDE_APP_CONFIG_HPP_
#define REPERTORY_INCLUDE_APP_CONFIG_HPP_
#include "events/event_system.hpp"
#include "events/events.hpp"
#include "types/remote.hpp"
#include "types/repertory.hpp"
#include "utils/error_utils.hpp"
namespace repertory {
class app_config final {
public:
[[nodiscard]] static auto default_agent_name(const provider_type &prov)
-> std::string;
[[nodiscard]] static auto default_api_port(const provider_type &prov)
-> std::uint16_t;
[[nodiscard]] static auto default_data_directory(const provider_type &prov)
-> std::string;
[[nodiscard]] static auto default_remote_port(const provider_type &prov)
-> std::uint16_t;
[[nodiscard]] static auto default_rpc_port(const provider_type &prov)
-> std::uint16_t;
[[nodiscard]] static auto get_provider_api_password(const provider_type &prov)
-> std::string;
[[nodiscard]] static auto get_provider_display_name(const provider_type &prov)
-> std::string;
[[nodiscard]] static auto get_provider_name(const provider_type &prov)
-> std::string;
private:
static stop_type stop_requested;
public:
app_config(const provider_type &prov, const std::string &data_directory = "");
[[nodiscard]] static auto default_agent_name(provider_type prov)
-> std::string;
[[nodiscard]] static auto default_api_port(provider_type prov)
-> std::uint16_t;
[[nodiscard]] static auto default_data_directory(provider_type prov)
-> std::string;
[[nodiscard]] static auto default_remote_api_port(provider_type prov)
-> std::uint16_t;
[[nodiscard]] static auto get_provider_display_name(provider_type prov)
-> std::string;
[[nodiscard]] static auto get_provider_name(provider_type prov)
-> std::string;
[[nodiscard]] static auto get_root_data_directory() -> std::string;
public:
[[nodiscard]] static auto get_stop_requested() -> bool;
static void set_stop_requested();
public:
app_config(provider_type prov, std::string_view data_directory = "");
app_config() = delete;
app_config(app_config &&) = delete;
app_config(const app_config &) = delete;
~app_config() { save(); }
auto operator=(const app_config &) -> app_config & = delete;
auto operator=(app_config &&) -> app_config & = delete;
private:
provider_type prov_;
std::string api_auth_;
std::uint16_t api_port_;
std::string api_user_;
bool config_changed_;
std::string data_directory_;
std::uint8_t download_timeout_secs_;
bool enable_chunk_downloader_timeout_;
bool enable_comm_duration_events_;
bool enable_drive_events_;
bool enable_max_cache_size_;
#ifdef _WIN32
bool enable_mount_manager_;
#endif
bool enable_remote_mount_;
encrypt_config encrypt_config_;
event_level event_level_;
std::uint32_t eviction_delay_mins_;
bool eviction_uses_accessed_time_;
std::uint8_t high_freq_interval_secs_;
bool is_remote_mount_;
std::uint32_t low_freq_interval_secs_;
std::uint64_t max_cache_size_bytes_;
std::uint8_t max_upload_count_;
std::uint8_t min_download_timeout_secs_;
std::uint16_t online_check_retry_secs_;
std::uint16_t orphaned_file_retention_days_;
std::string preferred_download_type_;
std::uint8_t read_ahead_count_;
std::uint8_t remote_client_pool_size_;
std::string remote_host_name_or_ip_;
std::uint8_t remote_max_connections_;
std::uint16_t remote_port_;
std::uint16_t remote_receive_timeout_secs_;
std::uint16_t remote_send_timeout_secs_;
std::string remote_token_;
std::uint16_t retry_read_count_;
std::uint16_t ring_buffer_file_size_;
utils::atomic<std::string> api_password_;
std::atomic<std::uint16_t> api_port_;
utils::atomic<std::string> api_user_;
std::atomic<bool> config_changed_;
std::atomic<database_type> db_type_{database_type::rocksdb};
std::atomic<std::uint8_t> download_timeout_secs_;
std::atomic<bool> enable_download_timeout_;
std::atomic<bool> enable_drive_events_;
#if defined(_WIN32)
std::atomic<bool> enable_mount_manager_;
#endif // defined(_WIN32)
std::atomic<event_level> event_level_;
std::atomic<std::uint32_t> eviction_delay_mins_;
std::atomic<bool> eviction_uses_accessed_time_;
std::atomic<std::uint16_t> high_freq_interval_secs_;
std::atomic<std::uint16_t> low_freq_interval_secs_;
std::atomic<std::uint64_t> max_cache_size_bytes_;
std::atomic<std::uint8_t> max_upload_count_;
std::atomic<std::uint16_t> med_freq_interval_secs_;
std::atomic<std::uint16_t> online_check_retry_secs_;
std::atomic<download_type> preferred_download_type_;
std::atomic<std::uint16_t> retry_read_count_;
std::atomic<std::uint16_t> ring_buffer_file_size_;
std::atomic<std::uint16_t> task_wait_ms_;
private:
std::string cache_directory_;
host_config hc_;
s3_config s3_config_;
std::uint64_t version_ = REPERTORY_CONFIG_VERSION;
std::string data_directory_;
utils::atomic<encrypt_config> encrypt_config_;
utils::atomic<host_config> host_config_;
std::string log_directory_;
mutable std::recursive_mutex read_write_mutex_;
mutable std::recursive_mutex remote_mount_mutex_;
utils::atomic<remote::remote_config> remote_config_;
utils::atomic<remote::remote_mount> remote_mount_;
utils::atomic<s3_config> s3_config_;
utils::atomic<sia_config> sia_config_;
std::unordered_map<std::string, std::function<std::string()>>
value_get_lookup_;
std::unordered_map<std::string,
std::function<std::string(const std::string &)>>
value_set_lookup_;
std::uint64_t version_{REPERTORY_CONFIG_VERSION};
private:
[[nodiscard]] auto load() -> bool;
template <typename dest>
auto get_value(const json &json_document, const std::string &name, dest &dst,
bool &success_flag) -> bool {
constexpr const auto *function_name =
static_cast<const char *>(__FUNCTION__);
auto ret = false;
try {
if (json_document.find(name) != json_document.end()) {
dst = json_document[name].get<dest>();
ret = true;
} else {
success_flag = false;
}
} catch (const json::exception &ex) {
utils::error::raise_error(function_name, ex, "exception occurred");
success_flag = false;
ret = false;
}
return ret;
}
template <typename dest, typename source>
auto set_value(dest &dst, const source &src) -> bool {
auto ret = false;
recur_mutex_lock lock(read_write_mutex_);
if (dst != src) {
dst = src;
config_changed_ = true;
save();
ret = true;
}
return ret;
}
auto set_value(dest &dst, const source &src) -> bool;
public:
[[nodiscard]] auto get_api_auth() const -> std::string { return api_auth_; }
[[nodiscard]] auto get_api_password() const -> std::string;
[[nodiscard]] auto get_api_port() const -> std::uint16_t { return api_port_; }
[[nodiscard]] auto get_api_port() const -> std::uint16_t;
[[nodiscard]] auto get_api_user() const -> std::string { return api_user_; }
[[nodiscard]] auto get_api_user() const -> std::string;
[[nodiscard]] auto get_cache_directory() const -> std::string {
return cache_directory_;
}
[[nodiscard]] auto get_chunk_downloader_timeout_secs() const -> std::uint8_t {
return std::max(min_download_timeout_secs_, download_timeout_secs_);
}
[[nodiscard]] auto get_cache_directory() const -> std::string;
[[nodiscard]] auto get_config_file_path() const -> std::string;
[[nodiscard]] auto get_data_directory() const -> std::string {
return data_directory_;
}
[[nodiscard]] auto get_database_type() const -> database_type;
[[nodiscard]] auto get_enable_chunk_download_timeout() const -> bool {
return enable_chunk_downloader_timeout_;
}
[[nodiscard]] auto get_data_directory() const -> std::string;
[[nodiscard]] auto get_enable_comm_duration_events() const -> bool {
return enable_comm_duration_events_;
}
[[nodiscard]] auto get_download_timeout_secs() const -> std::uint8_t;
[[nodiscard]] auto get_enable_drive_events() const -> bool {
return enable_drive_events_;
}
[[nodiscard]] auto get_enable_download_timeout() const -> bool;
[[nodiscard]] auto get_encrypt_config() const -> encrypt_config {
return encrypt_config_;
}
[[nodiscard]] auto get_enable_drive_events() const -> bool;
#ifdef _WIN32
[[nodiscard]] auto get_enable_mount_manager() const -> bool {
return enable_mount_manager_;
}
#endif
[[nodiscard]] auto get_encrypt_config() const -> encrypt_config;
[[nodiscard]] auto get_enable_max_cache_size() const -> bool {
return enable_max_cache_size_;
}
#if defined(_WIN32)
[[nodiscard]] auto get_enable_mount_manager() const -> bool;
#endif // defined(_WIN32)
[[nodiscard]] auto get_enable_remote_mount() const -> bool {
return enable_remote_mount_;
}
[[nodiscard]] auto get_event_level() const -> event_level;
[[nodiscard]] auto get_event_level() const -> event_level {
return event_level_;
}
[[nodiscard]] auto get_eviction_delay_mins() const -> std::uint32_t;
[[nodiscard]] auto get_eviction_delay_mins() const -> std::uint32_t {
return eviction_delay_mins_;
}
[[nodiscard]] auto get_eviction_uses_accessed_time() const -> bool;
[[nodiscard]] auto get_eviction_uses_accessed_time() const -> bool {
return eviction_uses_accessed_time_;
}
[[nodiscard]] auto get_high_frequency_interval_secs() const -> std::uint16_t;
[[nodiscard]] auto get_high_frequency_interval_secs() const -> std::uint8_t {
return std::max(static_cast<std::uint8_t>(1U), high_freq_interval_secs_);
}
[[nodiscard]] auto get_host_config() const -> host_config { return hc_; }
[[nodiscard]] auto get_is_remote_mount() const -> bool {
return is_remote_mount_;
}
[[nodiscard]] auto get_host_config() const -> host_config;
[[nodiscard]] auto get_json() const -> json;
[[nodiscard]] auto get_log_directory() const -> std::string {
return log_directory_;
}
[[nodiscard]] auto get_log_directory() const -> std::string;
[[nodiscard]] auto get_low_frequency_interval_secs() const -> std::uint32_t {
return std::max(1U, low_freq_interval_secs_);
}
[[nodiscard]] auto get_low_frequency_interval_secs() const -> std::uint16_t;
[[nodiscard]] auto get_max_cache_size_bytes() const -> std::uint64_t;
[[nodiscard]] auto get_max_upload_count() const -> std::uint8_t {
return std::max(std::uint8_t(1U), max_upload_count_);
}
[[nodiscard]] auto get_max_upload_count() const -> std::uint8_t;
[[nodiscard]] auto get_online_check_retry_secs() const -> std::uint16_t {
return std::max(std::uint16_t(15U), online_check_retry_secs_);
}
[[nodiscard]] auto get_med_frequency_interval_secs() const -> std::uint16_t;
[[nodiscard]] auto get_orphaned_file_retention_days() const -> std::uint16_t {
return std::min(static_cast<std::uint16_t>(31U),
std::max(static_cast<std::uint16_t>(1U),
orphaned_file_retention_days_));
}
[[nodiscard]] auto get_online_check_retry_secs() const -> std::uint16_t;
[[nodiscard]] auto get_preferred_download_type() const -> download_type {
return utils::download_type_from_string(preferred_download_type_,
download_type::fallback);
}
[[nodiscard]] auto get_preferred_download_type() const -> download_type;
[[nodiscard]] auto get_provider_type() const -> provider_type {
return prov_;
}
[[nodiscard]] auto get_provider_type() const -> provider_type;
[[nodiscard]] auto get_read_ahead_count() const -> std::uint8_t {
return std::max(static_cast<std::uint8_t>(1U), read_ahead_count_);
}
[[nodiscard]] auto get_remote_config() const -> remote::remote_config;
[[nodiscard]] auto get_remote_client_pool_size() const -> std::uint8_t {
return std::max(static_cast<std::uint8_t>(5U), remote_client_pool_size_);
}
[[nodiscard]] auto get_remote_mount() const -> remote::remote_mount;
[[nodiscard]] auto get_remote_host_name_or_ip() const -> std::string {
return remote_host_name_or_ip_;
}
[[nodiscard]] auto get_retry_read_count() const -> std::uint16_t;
[[nodiscard]] auto get_remote_max_connections() const -> std::uint8_t {
return std::max(static_cast<std::uint8_t>(1U), remote_max_connections_);
}
[[nodiscard]] auto get_ring_buffer_file_size() const -> std::uint16_t;
[[nodiscard]] auto get_remote_port() const -> std::uint16_t {
return remote_port_;
}
[[nodiscard]] auto get_s3_config() const -> s3_config;
[[nodiscard]] auto get_remote_receive_timeout_secs() const -> std::uint16_t {
return remote_receive_timeout_secs_;
}
[[nodiscard]] auto get_sia_config() const -> sia_config;
[[nodiscard]] auto get_remote_send_timeout_secs() const -> std::uint16_t {
return remote_send_timeout_secs_;
}
[[nodiscard]] auto get_task_wait_ms() const -> std::uint16_t;
[[nodiscard]] auto get_remote_token() const -> std::string {
return remote_token_;
}
[[nodiscard]] auto get_value_by_name(const std::string &name) const
-> std::string;
[[nodiscard]] auto get_retry_read_count() const -> std::uint16_t {
return std::max(std::uint16_t(2), retry_read_count_);
}
[[nodiscard]] auto get_raw_value_by_name(const std::string &name) const
-> std::string;
[[nodiscard]] auto get_ring_buffer_file_size() const -> std::uint16_t {
return std::max(
static_cast<std::uint16_t>(64U),
std::min(static_cast<std::uint16_t>(1024U), ring_buffer_file_size_));
}
[[nodiscard]] auto get_s3_config() const -> s3_config { return s3_config_; }
[[nodiscard]] auto get_value_by_name(const std::string &name) -> std::string;
[[nodiscard]] auto get_version() const -> std::uint64_t { return version_; }
[[nodiscard]] auto get_version() const -> std::uint64_t;
void save();
void set_api_auth(const std::string &api_auth) {
set_value(api_auth_, api_auth);
}
void set_api_password(const std::string &value);
void set_api_port(std::uint16_t api_port) { set_value(api_port_, api_port); }
void set_api_port(std::uint16_t value);
void set_api_user(const std::string &api_user) {
set_value(api_user_, api_user);
}
void set_api_user(const std::string &value);
void set_chunk_downloader_timeout_secs(
std::uint8_t chunk_downloader_timeout_secs) {
set_value(download_timeout_secs_, chunk_downloader_timeout_secs);
}
void set_download_timeout_secs(std::uint8_t value);
void
set_enable_chunk_downloader_timeout(bool enable_chunk_downloader_timeout) {
set_value(enable_chunk_downloader_timeout_,
enable_chunk_downloader_timeout);
}
void set_database_type(const database_type &value);
void set_enable_comm_duration_events(bool enable_comm_duration_events) {
set_value(enable_comm_duration_events_, enable_comm_duration_events);
}
void set_enable_download_timeout(bool value);
void set_enable_drive_events(bool enable_drive_events) {
set_value(enable_drive_events_, enable_drive_events);
}
void set_enable_drive_events(bool value);
void set_enable_max_cache_size(bool enable_max_cache_size) {
set_value(enable_max_cache_size_, enable_max_cache_size);
}
#if defined(_WIN32)
void set_enable_mount_manager(bool value);
#endif // defined(_WIN32)
#ifdef _WIN32
void set_enable_mount_manager(bool enable_mount_manager) {
set_value(enable_mount_manager_, enable_mount_manager);
}
#endif
void set_event_level(const event_level &value);
void set_enable_remote_mount(bool enable_remote_mount);
void set_encrypt_config(encrypt_config value);
void set_event_level(const event_level &level) {
if (set_value(event_level_, level)) {
event_system::instance().raise<event_level_changed>(
event_level_to_string(level));
}
}
void set_eviction_delay_mins(std::uint32_t value);
void set_eviction_delay_mins(std::uint32_t eviction_delay_mins) {
set_value(eviction_delay_mins_, eviction_delay_mins);
}
void set_eviction_uses_accessed_time(bool value);
void set_eviction_uses_accessed_time(bool eviction_uses_accessed_time) {
set_value(eviction_uses_accessed_time_, eviction_uses_accessed_time);
}
void set_high_frequency_interval_secs(std::uint16_t value);
void
set_high_frequency_interval_secs(std::uint8_t high_frequency_interval_secs) {
set_value(high_freq_interval_secs_, high_frequency_interval_secs);
}
void set_host_config(host_config value);
#ifdef PROJECT_TESTING
void set_host_config(host_config hc) {
config_changed_ = true;
hc_ = std::move(hc);
save();
}
void set_low_frequency_interval_secs(std::uint16_t value);
void set_s3_config(s3_config s3) {
config_changed_ = true;
s3_config_ = std::move(s3);
save();
}
#endif
void set_max_cache_size_bytes(std::uint64_t value);
void set_is_remote_mount(bool is_remote_mount);
void set_max_upload_count(std::uint8_t value);
void
set_low_frequency_interval_secs(std::uint32_t low_frequency_interval_secs) {
set_value(low_freq_interval_secs_, low_frequency_interval_secs);
}
void set_med_frequency_interval_secs(std::uint16_t value);
void set_max_cache_size_bytes(std::uint64_t max_cache_size_bytes) {
set_value(max_cache_size_bytes_, max_cache_size_bytes);
}
void set_online_check_retry_secs(std::uint16_t value);
void set_max_upload_count(std::uint8_t max_upload_count) {
set_value(max_upload_count_, max_upload_count);
}
void set_preferred_download_type(const download_type &value);
void set_online_check_retry_secs(std::uint16_t online_check_retry_secs) {
set_value(online_check_retry_secs_, online_check_retry_secs);
}
void set_remote_config(remote::remote_config value);
void
set_orphaned_file_retention_days(std::uint16_t orphaned_file_retention_days) {
set_value(orphaned_file_retention_days_, orphaned_file_retention_days);
}
void set_remote_mount(remote::remote_mount value);
void set_preferred_download_type(const download_type &dt) {
set_value(preferred_download_type_, utils::download_type_to_string(dt));
}
void set_retry_read_count(std::uint16_t value);
void set_read_ahead_count(std::uint8_t read_ahead_count) {
set_value(read_ahead_count_, read_ahead_count);
}
void set_ring_buffer_file_size(std::uint16_t value);
void set_remote_client_pool_size(std::uint8_t remote_client_pool_size) {
set_value(remote_client_pool_size_, remote_client_pool_size);
}
void set_s3_config(s3_config value);
void set_ring_buffer_file_size(std::uint16_t ring_buffer_file_size) {
set_value(ring_buffer_file_size_, ring_buffer_file_size);
}
void set_sia_config(sia_config value);
void set_remote_host_name_or_ip(const std::string &remote_host_name_or_ip) {
set_value(remote_host_name_or_ip_, remote_host_name_or_ip);
}
void set_remote_max_connections(std::uint8_t remote_max_connections) {
set_value(remote_max_connections_, remote_max_connections);
}
void set_remote_port(std::uint16_t remote_port) {
set_value(remote_port_, remote_port);
}
void
set_remote_receive_timeout_secs(std::uint16_t remote_receive_timeout_secs) {
set_value(remote_receive_timeout_secs_, remote_receive_timeout_secs);
}
void set_remote_send_timeout_secs(std::uint16_t remote_send_timeout_secs) {
set_value(remote_send_timeout_secs_, remote_send_timeout_secs);
}
void set_remote_token(const std::string &remote_token) {
set_value(remote_token_, remote_token);
}
void set_retry_read_count(std::uint16_t retry_read_count) {
set_value(retry_read_count_, retry_read_count);
}
void set_task_wait_ms(std::uint16_t value);
[[nodiscard]] auto set_value_by_name(const std::string &name,
const std::string &value) -> std::string;
};
} // namespace repertory
#endif // INCLUDE_APP_CONFIG_HPP_
#endif // REPERTORY_INCLUDE_APP_CONFIG_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,15 +19,16 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_COMM_CURL_CURL_COMM_HPP_
#define INCLUDE_COMM_CURL_CURL_COMM_HPP_
#ifndef REPERTORY_INCLUDE_COMM_CURL_CURL_COMM_HPP_
#define REPERTORY_INCLUDE_COMM_CURL_CURL_COMM_HPP_
#include "app_config.hpp"
#include "comm/curl/curl_shared.hpp"
#include "comm/curl/multi_request.hpp"
#include "comm/i_http_comm.hpp"
#include "events/event_system.hpp"
#include "events/events.hpp"
#include "events/types/curl_error.hpp"
#include "utils/encryption.hpp"
#include "utils/utils.hpp"
namespace repertory {
class curl_comm final : public i_http_comm {
@@ -42,19 +43,22 @@ private:
using write_callback = size_t (*)(char *, size_t, size_t, void *);
struct read_write_info final {
repertory::data_buffer data{};
repertory::stop_type &stop_requested;
data_buffer data;
stop_type_callback stop_requested_cb;
};
static const write_callback write_data;
static const write_callback write_headers;
static constexpr std::uint8_t retry_request_count{5U};
private:
std::optional<host_config> host_config_;
std::optional<s3_config> s3_config_;
private:
bool use_s3_path_style_{false};
public:
[[nodiscard]] static auto create_curl() -> CURL *;
[[nodiscard]] static auto reset_curl(CURL *curl_handle) -> CURL *;
public:
[[nodiscard]] static auto construct_url(CURL *curl,
@@ -62,8 +66,7 @@ public:
const host_config &cfg)
-> std::string;
[[nodiscard]] static auto create_host_config(const s3_config &cfg,
bool use_s3_path_style)
[[nodiscard]] static auto create_host_config(const s3_config &cfg)
-> host_config;
[[nodiscard]] static auto url_encode(CURL *curl, const std::string &data,
@@ -90,34 +93,33 @@ public:
}
data_buffer data{};
const auto key =
utils::encryption::generate_key(request.decryption_token.value());
const auto result = utils::encryption::read_encrypted_range(
request.range.value(), key,
[&](std::vector<char> &ct, std::uint64_t start_offset,
std::uint64_t end_offset) -> api_error {
auto encrypted_request = request;
encrypted_request.decryption_token = std::nullopt;
encrypted_request.range = {{start_offset, end_offset}};
encrypted_request.response_handler = [&ct](const auto &encrypted_data,
long /*response_code*/) {
ct = encrypted_data;
};
encrypted_request.total_size = std::nullopt;
const auto key = utils::encryption::generate_key<utils::hash::hash_256_t>(
request.decryption_token.value());
if (not utils::encryption::read_encrypted_range(
request.range.value(), key,
[&](data_buffer &ct, std::uint64_t start_offset,
std::uint64_t end_offset) -> bool {
auto encrypted_request = request;
encrypted_request.decryption_token = std::nullopt;
encrypted_request.range = {{start_offset, end_offset}};
encrypted_request.response_handler =
[&ct](const auto &encrypted_data, long /*response_code*/) {
ct = encrypted_data;
};
encrypted_request.total_size = std::nullopt;
if (not make_request(cfg, encrypted_request, response_code,
stop_requested)) {
return api_error::comm_error;
}
if (not make_request(cfg, encrypted_request, response_code,
stop_requested)) {
return false;
}
if (response_code != 200) {
return api_error::comm_error;
}
if (response_code != http_error_codes::ok) {
return false;
}
return api_error::success;
},
request.total_size.value(), data);
if (result != api_error::success) {
return true;
},
request.total_size.value(), data)) {
return false;
}
@@ -132,86 +134,130 @@ public:
[[nodiscard]] static auto
make_request(const host_config &cfg, const request_type &request,
long &response_code, stop_type &stop_requested) -> bool {
if (request.decryption_token.has_value() &&
not request.decryption_token.value().empty()) {
return make_encrypted_request(cfg, request, response_code,
stop_requested);
}
response_code = 0;
auto *curl = utils::create_curl();
if (not request.set_method(curl, stop_requested)) {
return false;
}
if (not cfg.agent_string.empty()) {
curl_easy_setopt(curl, CURLOPT_USERAGENT, cfg.agent_string.c_str());
}
if (request.allow_timeout && cfg.timeout_ms) {
curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, cfg.timeout_ms);
}
std::string range_list{};
if (request.range.has_value()) {
range_list = std::to_string(request.range.value().begin) + '-' +
std::to_string(request.range.value().end);
curl_easy_setopt(curl, CURLOPT_RANGE, range_list.c_str());
}
if (request.response_headers.has_value()) {
curl_easy_setopt(curl, CURLOPT_HEADERDATA,
&request.response_headers.value());
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, write_headers);
}
read_write_info write_info{{}, stop_requested};
if (request.response_handler.has_value()) {
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &write_info);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
}
std::string parameters{};
for (const auto &param : request.query) {
parameters += (parameters.empty() ? '?' : '&') + param.first + '=' +
url_encode(curl, param.second, false);
}
if (not cfg.api_password.empty()) {
curl_easy_setopt(curl, CURLOPT_USERNAME, cfg.api_user.c_str());
curl_easy_setopt(curl, CURLOPT_PASSWORD, cfg.api_password.c_str());
} else if (not cfg.api_user.empty()) {
curl_easy_setopt(curl, CURLOPT_USERNAME, cfg.api_user.c_str());
}
if (request.aws_service.has_value()) {
curl_easy_setopt(curl, CURLOPT_AWS_SIGV4,
request.aws_service.value().c_str());
}
auto url = construct_url(curl, request.get_path(), cfg) + parameters;
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
multi_request curl_request(curl, stop_requested);
REPERTORY_USES_FUNCTION_NAME();
CURLcode curl_code{};
curl_request.get_result(curl_code, response_code);
if (curl_code != CURLE_OK) {
event_system::instance().raise<curl_error>(url, curl_code);
return false;
const auto do_request = [&]() -> bool {
if (request.decryption_token.has_value() &&
not request.decryption_token.value().empty()) {
return make_encrypted_request(cfg, request, response_code,
stop_requested);
}
response_code = 0;
auto *curl = create_curl();
if (not request.set_method(curl, stop_requested)) {
return false;
}
if (not cfg.agent_string.empty()) {
curl_easy_setopt(curl, CURLOPT_USERAGENT, cfg.agent_string.c_str());
}
if (request.allow_timeout && cfg.timeout_ms) {
curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, cfg.timeout_ms);
}
std::string range_list{};
if (request.range.has_value()) {
range_list = std::to_string(request.range.value().begin) + '-' +
std::to_string(request.range.value().end);
curl_easy_setopt(curl, CURLOPT_RANGE, range_list.c_str());
}
if (request.response_headers.has_value()) {
curl_easy_setopt(curl, CURLOPT_HEADERDATA,
&request.response_headers.value());
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, write_headers);
}
read_write_info write_info{
{},
[&stop_requested]() -> bool {
return stop_requested || app_config::get_stop_requested();
},
};
if (request.response_handler.has_value()) {
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &write_info);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
}
std::string parameters{};
for (const auto &param : request.query) {
parameters += (parameters.empty() ? '?' : '&') + param.first + '=' +
url_encode(curl, param.second, false);
}
if (not cfg.api_password.empty()) {
curl_easy_setopt(curl, CURLOPT_USERNAME, cfg.api_user.c_str());
curl_easy_setopt(curl, CURLOPT_PASSWORD, cfg.api_password.c_str());
} else if (not cfg.api_user.empty()) {
curl_easy_setopt(curl, CURLOPT_USERNAME, cfg.api_user.c_str());
}
if (request.aws_service.has_value()) {
curl_easy_setopt(curl, CURLOPT_AWS_SIGV4,
request.aws_service.value().c_str());
}
curl_slist *header_list{nullptr};
if (not request.headers.empty()) {
for (const auto &header : request.headers) {
header_list = curl_slist_append(
header_list,
fmt::format("{}: {}", header.first, header.second).c_str());
}
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, header_list);
}
curl_shared::set_share(curl);
auto url = construct_url(curl, request.get_path(), cfg) + parameters;
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
multi_request curl_request(curl, stop_requested);
curl_code = CURLE_OK;
curl_request.get_result(curl_code, response_code);
if (header_list != nullptr) {
curl_slist_free_all(header_list);
}
if (curl_code != CURLE_OK) {
event_system::instance().raise<curl_error>(curl_code, function_name,
request.get_type(), url);
return false;
}
if (request.response_handler.has_value()) {
request.response_handler.value()(write_info.data, response_code);
}
return true;
};
bool ret{false};
for (std::uint8_t retry = 0U; !ret && retry < retry_request_count;
++retry) {
ret = do_request();
if (ret) {
break;
}
if (curl_code == CURLE_COULDNT_RESOLVE_HOST) {
std::this_thread::sleep_for(1s);
continue;
}
break;
}
if (request.response_handler.has_value()) {
request.response_handler.value()(write_info.data, response_code);
}
return true;
return ret;
}
public:
void enable_s3_path_style(bool enable) override;
[[nodiscard]] auto make_request(const curl::requests::http_delete &del,
long &response_code,
stop_type &stop_requested) const
@@ -239,4 +285,4 @@ public:
};
} // namespace repertory
#endif // INCLUDE_COMM_CURL_CURL_COMM_HPP_
#endif // REPERTORY_INCLUDE_COMM_CURL_CURL_COMM_HPP_

View File

@@ -0,0 +1,67 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_COMM_CURL_CURL_SHARED_HPP_
#define REPERTORY_INCLUDE_COMM_CURL_CURL_SHARED_HPP_
namespace repertory {
class curl_shared final {
private:
struct curl_sh_deleter final {
void operator()(CURLSH *ptr) {
if (ptr != nullptr) {
curl_share_cleanup(ptr);
}
}
};
using curl_sh_t = std::unique_ptr<CURLSH, curl_sh_deleter>;
public:
curl_shared() = delete;
curl_shared(const curl_shared &) = delete;
curl_shared(curl_shared &&) = delete;
~curl_shared() = delete;
auto operator=(const curl_shared &) -> curl_shared & = delete;
auto operator=(curl_shared &&) -> curl_shared & = delete;
private:
static curl_sh_t cache_;
static std::recursive_mutex mtx_;
private:
static void lock_callback(CURL * /* curl */, curl_lock_data /* data */,
curl_lock_access /* access */, void * /* ptr */);
static void unlock_callback(CURL * /* curl */, curl_lock_data /* data */,
curl_lock_access /* access */, void * /* ptr */);
public:
static void cleanup();
[[nodiscard]] static auto init() -> bool;
static void set_share(CURL *curl);
};
} // namespace repertory
#endif // REPERTORY_INCLUDE_COMM_CURL_DNS_CACHE_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,8 +19,8 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_COMM_CURL_MULTI_REQUEST_HPP_
#define INCLUDE_COMM_CURL_MULTI_REQUEST_HPP_
#ifndef REPERTORY_INCLUDE_COMM_CURL_MULTI_REQUEST_HPP_
#define REPERTORY_INCLUDE_COMM_CURL_MULTI_REQUEST_HPP_
#include "types/repertory.hpp"
@@ -36,9 +36,12 @@ private:
stop_type &stop_requested_;
CURLM *multi_handle_;
private:
[[nodiscard]] auto get_stop_requested() const -> bool;
public:
void get_result(CURLcode &curl_code, long &http_code);
};
} // namespace repertory
#endif // INCLUDE_COMM_CURL_MULTI_REQUEST_HPP_
#endif // REPERTORY_INCLUDE_COMM_CURL_MULTI_REQUEST_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,14 +19,16 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_COMM_CURL_CURL_REQUESTS_HTTP_DELETE_HPP_
#define INCLUDE_COMM_CURL_CURL_REQUESTS_HTTP_DELETE_HPP_
#ifndef REPERTORY_INCLUDE_COMM_CURL_REQUESTS_HTTP_DELETE_HPP_
#define REPERTORY_INCLUDE_COMM_CURL_REQUESTS_HTTP_DELETE_HPP_
#include "comm/curl/requests/http_request_base.hpp"
namespace repertory::curl::requests {
struct http_delete final : http_request_base {
~http_delete() override = default;
[[nodiscard]] auto get_type() const -> std::string override {
return "delete";
}
[[nodiscard]] auto set_method(CURL *curl,
stop_type & /* stop_requested */) const
@@ -37,4 +39,4 @@ struct http_delete final : http_request_base {
};
} // namespace repertory::curl::requests
#endif // INCLUDE_COMM_CURL_CURL_REQUESTS_HTTP_DELETE_HPP_
#endif // REPERTORY_INCLUDE_COMM_CURL_REQUESTS_HTTP_DELETE_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,8 +19,8 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_COMM_CURL_CURL_REQUESTS_HTTP_GET_HPP_
#define INCLUDE_COMM_CURL_CURL_REQUESTS_HTTP_GET_HPP_
#ifndef REPERTORY_INCLUDE_COMM_CURL_REQUESTS_HTTP_GET_HPP_
#define REPERTORY_INCLUDE_COMM_CURL_REQUESTS_HTTP_GET_HPP_
#include "comm/curl/requests/http_request_base.hpp"
@@ -33,6 +33,8 @@ struct http_get final : http_request_base {
auto operator=(http_get &&) -> http_get & = default;
~http_get() override = default;
[[nodiscard]] auto get_type() const -> std::string override { return "get"; }
[[nodiscard]] auto set_method(CURL *curl,
stop_type & /*stop_requested*/) const
-> bool override {
@@ -42,4 +44,4 @@ struct http_get final : http_request_base {
};
} // namespace repertory::curl::requests
#endif // INCLUDE_COMM_CURL_CURL_REQUESTS_HTTP_GET_HPP_
#endif // REPERTORY_INCLUDE_COMM_CURL_REQUESTS_HTTP_GET_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,14 +19,14 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_COMM_CURL_CURL_REQUESTS_HTTP_HEAD_HPP_
#define INCLUDE_COMM_CURL_CURL_REQUESTS_HTTP_HEAD_HPP_
#ifndef REPERTORY_INCLUDE_COMM_CURL_REQUESTS_HTTP_HEAD_HPP_
#define REPERTORY_INCLUDE_COMM_CURL_REQUESTS_HTTP_HEAD_HPP_
#include "comm/curl/requests/http_request_base.hpp"
namespace repertory::curl::requests {
struct http_head final : http_request_base {
~http_head() override = default;
[[nodiscard]] auto get_type() const -> std::string override { return "head"; }
[[nodiscard]] auto set_method(CURL *curl,
stop_type & /* stop_requested */) const
@@ -38,4 +38,4 @@ struct http_head final : http_request_base {
};
} // namespace repertory::curl::requests
#endif // INCLUDE_COMM_CURL_CURL_REQUESTS_HTTP_HEAD_HPP_
#endif // REPERTORY_INCLUDE_COMM_CURL_REQUESTS_HTTP_HEAD_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,31 +19,24 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_COMM_CURL_CURL_REQUESTS_HTTP_POST_HPP_
#define INCLUDE_COMM_CURL_CURL_REQUESTS_HTTP_POST_HPP_
#ifndef REPERTORY_INCLUDE_COMM_CURL_REQUESTS_HTTP_POST_HPP_
#define REPERTORY_INCLUDE_COMM_CURL_REQUESTS_HTTP_POST_HPP_
#include "comm/curl/requests/http_request_base.hpp"
namespace repertory::curl::requests {
struct http_post final : http_request_base {
http_post() = default;
http_post(const http_post &) = default;
http_post(http_post &&) = default;
auto operator=(const http_post &) -> http_post & = default;
auto operator=(http_post &&) -> http_post & = default;
~http_post() override;
std::optional<nlohmann::json> json;
[[nodiscard]] auto get_type() const -> std::string override { return "post"; }
[[nodiscard]] auto set_method(CURL *curl,
stop_type & /*stop_requested*/) const
-> bool override;
private:
mutable curl_slist *headers{nullptr};
mutable std::optional<std::string> json_str;
};
} // namespace repertory::curl::requests
#endif // INCLUDE_COMM_CURL_CURL_REQUESTS_HTTP_POST_HPP_
#endif // REPERTORY_INCLUDE_COMM_CURL_REQUESTS_HTTP_POST_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,26 +19,19 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_COMM_CURL_CURL_REQUESTS_HTTP_PUT_FILE_HPP_
#define INCLUDE_COMM_CURL_CURL_REQUESTS_HTTP_PUT_FILE_HPP_
#ifndef REPERTORY_INCLUDE_COMM_CURL_REQUESTS_HTTP_PUT_FILE_HPP_
#define REPERTORY_INCLUDE_COMM_CURL_REQUESTS_HTTP_PUT_FILE_HPP_
#include "comm/curl/requests/http_request_base.hpp"
#include "utils/encrypting_reader.hpp"
namespace repertory::curl::requests {
struct http_put_file final : http_request_base {
http_put_file() = default;
http_put_file(const http_put_file &) = default;
http_put_file(http_put_file &&) = default;
auto operator=(const http_put_file &) -> http_put_file & = default;
auto operator=(http_put_file &&) -> http_put_file & = default;
~http_put_file() override = default;
std::shared_ptr<utils::encryption::encrypting_reader> reader;
std::string source_path;
[[nodiscard]] auto get_type() const -> std::string override { return "put"; }
[[nodiscard]] auto set_method(CURL *curl, stop_type &stop_requested) const
-> bool override;
@@ -47,4 +40,4 @@ private:
};
} // namespace repertory::curl::requests
#endif // INCLUDE_COMM_CURL_CURL_REQUESTS_HTTP_PUT_FILE_HPP_
#endif // REPERTORY_INCLUDE_COMM_CURL_REQUESTS_HTTP_PUT_FILE_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,36 +19,24 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_COMM_CURL_CURL_REQUESTS_HTTP_REQUEST_BASE_HPP_
#define INCLUDE_COMM_CURL_CURL_REQUESTS_HTTP_REQUEST_BASE_HPP_
#ifndef REPERTORY_INCLUDE_COMM_CURL_REQUESTS_HTTP_REQUEST_BASE_HPP_
#define REPERTORY_INCLUDE_COMM_CURL_REQUESTS_HTTP_REQUEST_BASE_HPP_
#include "types/repertory.hpp"
#include "utils/native_file.hpp"
#include "utils/file.hpp"
namespace repertory::curl::requests {
using read_callback = size_t (*)(char *, size_t, size_t, void *);
using response_callback =
using curl_response_callback =
std::function<void(const data_buffer &data, long response_code)>;
struct read_file_info final {
stop_type &stop_requested;
native_file::native_file_ptr nf{};
std::unique_ptr<utils::file::i_file> file{};
std::uint64_t offset{};
};
inline const auto read_file_data = static_cast<read_callback>(
[](char *buffer, size_t size, size_t nitems, void *instream) -> size_t {
auto *read_info = reinterpret_cast<read_file_info *>(instream);
std::size_t bytes_read{};
auto ret = read_info->nf->read_bytes(buffer, size * nitems,
read_info->offset, bytes_read);
if (ret) {
read_info->offset += bytes_read;
}
return ret && not read_info->stop_requested ? bytes_read
: CURL_READFUNC_ABORT;
});
[[nodiscard]] auto curl_file_reader(char *buffer, size_t size, size_t nitems,
void *instream) -> size_t;
struct http_request_base {
http_request_base() = default;
@@ -63,20 +51,22 @@ struct http_request_base {
bool allow_timeout{};
std::optional<std::string> aws_service;
std::optional<std::string> decryption_token{};
http_headers headers{};
mutable http_headers headers{};
std::string path{};
query_parameters query{};
http_query_parameters query{};
std::optional<http_range> range{};
std::optional<response_callback> response_handler;
std::optional<curl_response_callback> response_handler;
std::optional<http_headers> response_headers;
std::optional<std::uint64_t> total_size{};
[[nodiscard]] virtual auto get_path() const -> std::string { return path; }
[[nodiscard]] virtual auto get_type() const -> std::string = 0;
[[nodiscard]] virtual auto set_method(CURL *curl,
stop_type &stop_requested) const
-> bool = 0;
};
} // namespace repertory::curl::requests
#endif // INCLUDE_COMM_CURL_CURL_REQUESTS_HTTP_REQUEST_BASE_HPP_
#endif // REPERTORY_INCLUDE_COMM_CURL_REQUESTS_HTTP_REQUEST_BASE_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,8 +19,8 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_COMM_I_HTTP_COMM_HPP_
#define INCLUDE_COMM_I_HTTP_COMM_HPP_
#ifndef REPERTORY_INCLUDE_COMM_I_HTTP_COMM_HPP_
#define REPERTORY_INCLUDE_COMM_I_HTTP_COMM_HPP_
#include "comm/curl/requests/http_delete.hpp"
#include "comm/curl/requests/http_get.hpp"
@@ -34,8 +34,6 @@ struct i_http_comm {
INTERFACE_SETUP(i_http_comm);
public:
virtual void enable_s3_path_style(bool enable) = 0;
[[nodiscard]] virtual auto
make_request(const curl::requests::http_delete &del, long &response_code,
stop_type &stop_requested) const -> bool = 0;
@@ -62,4 +60,4 @@ public:
};
} // namespace repertory
#endif // INCLUDE_COMM_I_HTTP_COMM_HPP_
#endif // REPERTORY_INCLUDE_COMM_I_HTTP_COMM_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,8 +19,8 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_COMM_PACKET_CLIENT_POOL_HPP_
#define INCLUDE_COMM_PACKET_CLIENT_POOL_HPP_
#ifndef REPERTORY_INCLUDE_COMM_PACKET_CLIENT_POOL_HPP_
#define REPERTORY_INCLUDE_COMM_PACKET_CLIENT_POOL_HPP_
#include "comm/packet/packet.hpp"
#include "types/repertory.hpp"
@@ -94,7 +94,7 @@ private:
bool shutdown_ = false;
private:
static constexpr const auto min_pool_size = 10U;
static constexpr auto min_pool_size = 10U;
public:
void execute(const std::string &client_id, std::uint64_t thread_id,
@@ -107,4 +107,4 @@ public:
};
} // namespace repertory
#endif // INCLUDE_COMM_PACKET_CLIENT_POOL_HPP_
#endif // REPERTORY_INCLUDE_COMM_PACKET_CLIENT_POOL_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,8 +19,8 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_COMM_PACKET_PACKET_HPP_
#define INCLUDE_COMM_PACKET_PACKET_HPP_
#ifndef REPERTORY_INCLUDE_COMM_PACKET_PACKET_HPP_
#define REPERTORY_INCLUDE_COMM_PACKET_PACKET_HPP_
#include "types/remote.hpp"
#include "types/repertory.hpp"
@@ -52,8 +52,8 @@ public:
~packet() = default;
private:
data_buffer buffer_;
std::size_t decode_offset_ = 0U;
data_buffer buffer_{};
std::size_t decode_offset_{0U};
public:
[[nodiscard]] static auto decode_json(packet &response, json &json_data)
@@ -62,13 +62,13 @@ public:
public:
void clear();
[[nodiscard]] auto current_pointer() -> char * {
return (decode_offset_ < buffer_.size()) ? &buffer_[decode_offset_]
[[nodiscard]] auto current_pointer() -> unsigned char * {
return (decode_offset_ < buffer_.size()) ? &buffer_.at(decode_offset_)
: nullptr;
}
[[nodiscard]] auto current_pointer() const -> const char * {
return (decode_offset_ < buffer_.size()) ? &buffer_[decode_offset_]
[[nodiscard]] auto current_pointer() const -> const unsigned char * {
return (decode_offset_ < buffer_.size()) ? &buffer_.at(decode_offset_)
: nullptr;
}
@@ -110,19 +110,19 @@ public:
[[nodiscard]] auto decode(remote::file_info &val) -> error_type;
[[nodiscard]] auto decrypt(const std::string &token) -> error_type;
[[nodiscard]] auto decrypt(std::string_view token) -> error_type;
void encode(const void *buffer, std::size_t size, bool should_reserve = true);
void encode(const char *str) {
encode(std::string(str == nullptr ? "" : str));
encode(std::string{str == nullptr ? "" : str});
}
void encode(const std::string &str);
void encode(std::string_view str);
void encode(const wchar_t *str);
void encode(const std::wstring &str);
void encode(std::wstring_view str);
void encode(void *ptr) {
encode(static_cast<std::uint64_t>(reinterpret_cast<std::uintptr_t>(ptr)));
@@ -161,9 +161,9 @@ public:
void encode_top(const void *buffer, std::size_t size,
bool should_reserve = true);
void encode_top(const std::string &str);
void encode_top(std::string_view str);
void encode_top(const std::wstring &str);
void encode_top(std::wstring_view str);
void encode_top(void *ptr) {
encode_top(
@@ -200,13 +200,13 @@ public:
void encode_top(remote::file_info val);
void encrypt(const std::string &token);
void encrypt(std::string_view token);
[[nodiscard]] auto get_size() const -> std::uint32_t {
return static_cast<std::uint32_t>(buffer_.size());
}
void transfer_into(data_buffer &buffer);
void to_buffer(data_buffer &buffer);
public:
auto operator=(const data_buffer &buffer) noexcept -> packet &;
@@ -217,16 +217,15 @@ public:
auto operator=(packet &&pkt) noexcept -> packet &;
[[nodiscard]] auto operator[](std::size_t index) -> char & {
[[nodiscard]] auto operator[](std::size_t index) -> unsigned char & {
return buffer_[index];
}
[[nodiscard]] auto operator[](std::size_t index) const -> const char & {
[[nodiscard]] auto operator[](std::size_t index) const -> const
unsigned char & {
return buffer_.at(index);
}
};
using packet = packet;
} // namespace repertory
#endif // INCLUDE_COMM_PACKET_PACKET_HPP_
#endif // REPERTORY_INCLUDE_COMM_PACKET_PACKET_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,10 +19,11 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_COMM_PACKET_PACKET_CLIENT_HPP_
#define INCLUDE_COMM_PACKET_PACKET_CLIENT_HPP_
#ifndef REPERTORY_INCLUDE_COMM_PACKET_PACKET_CLIENT_HPP_
#define REPERTORY_INCLUDE_COMM_PACKET_PACKET_CLIENT_HPP_
#include "comm/packet/packet.hpp"
#include "types/remote.hpp"
using boost::asio::ip::tcp;
@@ -36,9 +37,7 @@ private:
};
public:
packet_client(std::string host_name_or_ip, std::uint8_t max_connections,
std::uint16_t port, std::uint16_t receive_timeout,
std::uint16_t send_timeout, std::string encryption_token);
packet_client(remote::remote_config cfg);
~packet_client();
@@ -49,12 +48,7 @@ public:
private:
boost::asio::io_context io_context_;
std::string host_name_or_ip_;
std::uint8_t max_connections_;
std::uint16_t port_;
std::uint16_t receive_timeout_;
std::uint16_t send_timeout_;
std::string encryption_token_;
remote::remote_config cfg_;
std::string unique_id_;
private:
@@ -75,22 +69,22 @@ private:
void put_client(std::shared_ptr<client> &cli);
[[nodiscard]] auto read_packet(client &cli, packet &response)
-> packet::error_type;
[[nodiscard]] auto read_packet(client &cli,
packet &response) const -> packet::error_type;
void resolve();
public:
[[nodiscard]] auto send(const std::string &method,
[[nodiscard]] auto send(std::string_view method,
std::uint32_t &service_flags) -> packet::error_type;
[[nodiscard]] auto send(const std::string &method, packet &request,
[[nodiscard]] auto send(std::string_view method, packet &request,
std::uint32_t &service_flags) -> packet::error_type;
[[nodiscard]] auto send(const std::string &method, packet &request,
packet &response, std::uint32_t &service_flags)
-> packet::error_type;
[[nodiscard]] auto send(std::string_view method, packet &request,
packet &response,
std::uint32_t &service_flags) -> packet::error_type;
};
} // namespace repertory
#endif // INCLUDE_COMM_PACKET_PACKET_CLIENT_HPP_
#endif // REPERTORY_INCLUDE_COMM_PACKET_PACKET_CLIENT_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,12 +19,11 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_COMM_PACKET_PACKET_SERVER_HPP_
#define INCLUDE_COMM_PACKET_PACKET_SERVER_HPP_
#ifndef REPERTORY_INCLUDE_COMM_PACKET_PACKET_SERVER_HPP_
#define REPERTORY_INCLUDE_COMM_PACKET_PACKET_SERVER_HPP_
#include "comm/packet/client_pool.hpp"
#include "types/repertory.hpp"
#include "utils/utils.hpp"
#include "utils/common.hpp"
using namespace boost::asio;
using boost::asio::ip::tcp;
@@ -53,8 +52,8 @@ public:
private:
struct connection {
connection(boost::asio::io_service &io_service, tcp::acceptor &acceptor_)
: socket(io_service), acceptor(acceptor_) {}
connection(io_context &ctx, tcp::acceptor &acceptor_)
: socket(ctx), acceptor(acceptor_) {}
tcp::socket socket;
tcp::acceptor &acceptor;
@@ -69,7 +68,7 @@ private:
std::string encryption_token_;
closed_callback closed_;
message_handler_callback message_handler_;
boost::asio::io_context io_context_;
io_context io_context_;
std::unique_ptr<std::thread> server_thread_;
std::vector<std::thread> service_threads_;
std::recursive_mutex connection_mutex_;
@@ -96,4 +95,4 @@ private:
};
} // namespace repertory
#endif // INCLUDE_COMM_PACKET_PACKET_SERVER_HPP_
#endif // REPERTORY_INCLUDE_COMM_PACKET_PACKET_SERVER_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,10 +19,10 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_COMMON_HPP_
#define INCLUDE_COMMON_HPP_
#ifndef REPERTORY_INCLUDE_COMMON_HPP_
#define REPERTORY_INCLUDE_COMMON_HPP_
#if defined(__GNUC__)
#if defined(__GNUC__) && !defined(PROJECT_IS_DARWIN)
// clang-format off
#define REPERTORY_IGNORE_WARNINGS_ENABLE() \
_Pragma("GCC diagnostic push") \
@@ -46,147 +46,40 @@
#endif // defined(__GNUC__)
// clang-format on
#ifdef __cplusplus
#if defined(__cplusplus)
REPERTORY_IGNORE_WARNINGS_ENABLE()
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
#include <shlwapi.h>
#include <shlobj.h>
#include <ciso646>
#include <direct.h>
#include <fcntl.h>
#include <io.h>
#include <time.h>
#else
#include <climits>
#include <dirent.h>
#include <fcntl.h>
#include <grp.h>
#include <libgen.h>
#include <pwd.h>
#include <sys/file.h>
#include <sys/stat.h>
#ifdef __linux__
#include <sys/statfs.h>
#endif
#include <unistd.h>
#ifdef HAS_SETXATTR
#include <sys/types.h>
#include <sys/xattr.h>
#endif
#ifdef __APPLE__
#include <libproc.h>
#include <sys/attr.h>
#include <sys/vnode.h>
#endif
#if __APPLE__
#include <sys/mount.h>
#include <sys/statvfs.h>
#endif
#endif
#include <algorithm>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <deque>
#include <filesystem>
#include <fstream>
#include <future>
#include <iomanip>
#include <iostream>
#include <limits>
#include <mutex>
#include <optional>
#include <random>
#include <sstream>
#include <string>
#include <string_view>
#include <thread>
#include <type_traits>
#include <unordered_map>
#include <vector>
#include "sodium.h"
template <typename data_type>
[[nodiscard]] inline auto repertory_rand() -> data_type {
data_type ret{};
randombytes_buf(&ret, sizeof(ret));
return ret;
}
#include "boost/archive/text_iarchive.hpp"
#include "boost/archive/text_oarchive.hpp"
#include "boost/asio.hpp"
#include "boost/asio/io_context.hpp"
#include "boost/bind/bind.hpp"
#include "boost/dynamic_bitset.hpp"
#include "boost/dynamic_bitset/serialization.hpp"
#include "boost/endian/conversion.hpp"
#include "boost/serialization/vector.hpp"
#include "curl/curl.h"
#include "curl/multi.h"
#include "json.hpp"
#include "sqlite3.h"
#include "uuid.h"
#ifdef _WIN32
#include <sddl.h>
#include "winfsp/winfsp.hpp"
#else
#if FUSE_USE_VERSION >= 30
#include <fuse.h>
#include <fuse_lowlevel.h>
#else
#include <fuse/fuse.h>
#endif
#endif
#include "pugixml.hpp"
#include "httplib.h"
#include "utils/config.hpp"
REPERTORY_IGNORE_WARNINGS_DISABLE()
using namespace std::chrono_literals;
using json = nlohmann::json;
#define REPERTORY "repertory"
#define REPERTORY_CONFIG_VERSION 0ull
#define REPERTORY_DATA_NAME "repertory2"
#define REPERTORY_MIN_REMOTE_VERSION "2.0.0"
#define REPERTORY_W L"repertory"
inline constexpr std::string_view REPERTORY{"repertory"};
inline constexpr std::string_view REPERTORY_DATA_NAME{"repertory2"};
inline constexpr std::wstring_view REPERTORY_W{L"repertory"};
inline constexpr std::uint64_t REPERTORY_CONFIG_VERSION{2ULL};
inline constexpr std::string_view REPERTORY_MIN_REMOTE_VERSION{"2.1.0"};
inline constexpr std::string_view RENTERD_MIN_VERSION{"2.0.0"};
#ifdef _WIN32
#define REPERTORY_INVALID_HANDLE INVALID_HANDLE_VALUE
#define REPERTORY_API_INVALID_HANDLE static_cast<std::uint64_t>(-1)
using native_handle = HANDLE;
#else
#define REPERTORY_INVALID_HANDLE (-1)
#define REPERTORY_API_INVALID_HANDLE REPERTORY_INVALID_HANDLE
using native_handle = int;
#endif
constexpr const auto NANOS_PER_SECOND = 1000000000L;
#define WINFSP_ALLOCATION_UNIT UINT64(4096U)
#ifdef _WIN32
#ifdef CreateDirectory
#if defined(_WIN32)
#if defined(CreateDirectory)
#undef CreateDirectory
#endif
#ifdef CreateFile
#if defined(CreateFile)
#undef CreateFile
#endif
#ifdef DeleteFile
#if defined(DeleteFile)
#undef DeleteFile
#endif
#ifdef RemoveDirectory
#if defined(RemoveDirectory)
#undef RemoveDirectory
#endif
@@ -255,8 +148,8 @@ constexpr const auto NANOS_PER_SECOND = 1000000000L;
#define SETATTR_WANTS_FLAGS(attr) ((attr)->valid & (1 << 31))
#endif // SETATTR_WANTS_FLAGS
#ifndef _WIN32
#ifdef __APPLE__
#if !defined(_WIN32)
#if defined(__APPLE__)
#define G_PREFIX "org"
#define G_KAUTH_FILESEC_XATTR G_PREFIX ".apple.system.Security"
#define A_PREFIX "com"
@@ -273,29 +166,7 @@ constexpr const auto NANOS_PER_SECOND = 1000000000L;
#endif
#endif
#ifndef fstat64
#define fstat64 fstat
#endif
#ifndef pread64
#define pread64 pread
#endif
#ifndef pwrite64
#define pwrite64 pwrite
#endif
#ifndef stat64
#define stat64 stat
#endif
#ifndef statfs64
#define statfs64 statfs
#endif
#define WINFSP_ALLOCATION_UNIT UINT64(4096U)
#ifdef _WIN32
#if defined(_WIN32)
#define UTIME_NOW ((1l << 30) - 1l)
#define UTIME_OMIT ((1l << 30) - 2l)
#define CONVERT_STATUS_NOT_IMPLEMENTED(e) e
@@ -303,6 +174,7 @@ constexpr const auto NANOS_PER_SECOND = 1000000000L;
using BOOLEAN = std::uint8_t;
using DWORD = std::uint32_t;
using HANDLE = void *;
using NTSTATUS = std::uint32_t;
using PUINT32 = std::uint32_t *;
using PVOID = void *;
using PWSTR = wchar_t *;
@@ -346,32 +218,34 @@ using WCHAR = wchar_t;
#define GENERIC_EXECUTE (0x20000000L)
#define GENERIC_ALL (0x10000000L)
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
#define INVALID_FILE_ATTRIBUTES static_cast<DWORD>(-1)
#define MAX_PATH 260
#define STATUS_SUCCESS std::int32_t(0)
#define STATUS_ACCESS_DENIED std::int32_t(0xC0000022L)
#define STATUS_DEVICE_BUSY std::int32_t(0x80000011L)
#define STATUS_DEVICE_INSUFFICIENT_RESOURCES std::int32_t(0xC0000468L)
#define STATUS_DIRECTORY_NOT_EMPTY std::int32_t(0xC0000101L)
#define STATUS_FILE_IS_A_DIRECTORY std::int32_t(0xC00000BAL)
#define STATUS_FILE_TOO_LARGE std::int32_t(0xC0000904L)
#define STATUS_INSUFFICIENT_RESOURCES std::int32_t(0xC000009AL)
#define STATUS_INTERNAL_ERROR std::int32_t(0xC00000E5L)
#define STATUS_INVALID_ADDRESS std::int32_t(0xC0000141L)
#define STATUS_INVALID_HANDLE std::int32_t(0xC0000006L)
#define STATUS_INVALID_IMAGE_FORMAT std::int32_t(0xC000007BL)
#define STATUS_INVALID_PARAMETER std::int32_t(0xC000000DL)
#define STATUS_NO_MEMORY std::int32_t(0xC0000017L)
#define STATUS_NOT_IMPLEMENTED std::int32_t(0xC0000002L)
#define STATUS_OBJECT_NAME_EXISTS std::int32_t(0x40000000L)
#define STATUS_OBJECT_NAME_NOT_FOUND std::int32_t(0xC0000034L)
#define STATUS_OBJECT_PATH_INVALID std::int32_t(0xC0000039L)
#define STATUS_UNEXPECTED_IO_ERROR std::int32_t(0xC00000E9L)
#define STATUS_ACCESS_DENIED std::uint32_t{0xC0000022L}
#define STATUS_DEVICE_BUSY std::uint32_t{0x80000011L}
#define STATUS_DEVICE_INSUFFICIENT_RESOURCES std::uint32_t{0xC0000468L}
#define STATUS_DIRECTORY_NOT_EMPTY std::uint32_t{0xC0000101L}
#define STATUS_END_OF_FILE std::uint32_t{0xC0000011L}
#define STATUS_FILE_IS_A_DIRECTORY std::uint32_t{0xC00000BAL}
#define STATUS_FILE_TOO_LARGE std::uint32_t{0xC0000904L}
#define STATUS_INSUFFICIENT_RESOURCES std::uint32_t{0xC000009AL}
#define STATUS_INTERNAL_ERROR std::uint32_t{0xC00000E5L}
#define STATUS_INVALID_ADDRESS std::uint32_t{0xC0000141L}
#define STATUS_INVALID_HANDLE std::uint32_t{0xC0000006L}
#define STATUS_INVALID_IMAGE_FORMAT std::uint32_t{0xC000007BL}
#define STATUS_INVALID_PARAMETER std::uint32_t{0xC000000DL}
#define STATUS_NOT_IMPLEMENTED std::uint32_t{0xC0000002L}
#define STATUS_NO_MEMORY std::uint32_t{0xC0000017L}
#define STATUS_OBJECT_NAME_COLLISION std::uint32_t{0xC0000035L}
#define STATUS_OBJECT_NAME_EXISTS std::uint32_t{0x40000000L}
#define STATUS_OBJECT_NAME_NOT_FOUND std::uint32_t{0xC0000034L}
#define STATUS_OBJECT_PATH_INVALID std::uint32_t{0xC0000039L}
#define STATUS_SUCCESS std::uint32_t{0U}
#define STATUS_UNEXPECTED_IO_ERROR std::uint32_t{0xC00000E9L}
#define CONVERT_STATUS_NOT_IMPLEMENTED(e) \
((std::int32_t(e) == STATUS_NOT_IMPLEMENTED) ? -ENOTSUP : e)
((std::uint32_t(e) == STATUS_NOT_IMPLEMENTED) ? -ENOTSUP : e)
namespace Fsp::FileSystemBase {
enum {
@@ -403,18 +277,11 @@ using FileInfo = FSP_FSCTL_FILE_INFO;
using namespace Fsp;
namespace {
template <class... Ts> struct overloaded : Ts... {
using Ts::operator()...;
};
template <class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
} // namespace
#define INTERFACE_SETUP(name) \
public: \
name(const name &) noexcept = delete; \
name &operator=(const name &) noexcept = delete; \
name &operator=(name &&) noexcept = delete; \
auto operator=(const name &) noexcept -> name & = delete; \
auto operator=(name &&) noexcept -> name & = delete; \
\
protected: \
name() = default; \
@@ -424,4 +291,4 @@ public: \
virtual ~name() = default
#endif // __cplusplus
#endif // INCLUDE_COMMON_HPP_
#endif // REPERTORY_INCLUDE_COMMON_HPP_

View File

@@ -1,247 +0,0 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_DATABASE_DB_COMMON_HPP_
#define INCLUDE_DATABASE_DB_COMMON_HPP_
#include "utils/error_utils.hpp"
namespace repertory::db {
using db_types_t = std::variant<std::int64_t, std::string>;
struct sqlite3_deleter {
void operator()(sqlite3 *db3) {
if (db3 != nullptr) {
sqlite3_close_v2(db3);
}
}
};
using db3_t = std::unique_ptr<sqlite3, sqlite3_deleter>;
struct sqlite3_statement_deleter {
void operator()(sqlite3_stmt *stmt) {
if (stmt != nullptr) {
sqlite3_finalize(stmt);
}
}
};
using db3_stmt_t = std::unique_ptr<sqlite3_stmt, sqlite3_statement_deleter>;
struct comp_data_t final {
std::string column_name;
std::string op_type;
db_types_t value;
};
class db_column final {
public:
db_column() noexcept = default;
db_column(const db_column &) = default;
db_column(db_column &&column) noexcept = default;
~db_column() = default;
auto operator=(const db_column &) -> db_column & = default;
auto operator=(db_column &&) -> db_column & = default;
db_column(std::int32_t index, std::string name, db_types_t value) noexcept
: index_(index), name_(std::move(name)), value_(std::move(value)) {}
private:
std::int32_t index_{};
std::string name_;
db_types_t value_;
public:
[[nodiscard]] auto get_index() const -> std::int32_t { return index_; }
[[nodiscard]] auto get_name() const -> std::string { return name_; }
template <typename data_type>
[[nodiscard]] auto get_value() const -> data_type {
return std::visit(
overloaded{
[](const data_type &value) -> data_type { return value; },
[](auto &&) -> data_type {
throw std::runtime_error("data type not supported");
},
},
value_);
}
[[nodiscard]] auto get_value_as_json() const -> nlohmann::json {
return std::visit(
overloaded{
[this](std::int64_t value) -> auto {
return nlohmann::json({{name_, value}});
},
[](auto &&value) -> auto { return nlohmann::json::parse(value); },
},
value_);
}
};
template <typename context_t> class db_row final {
public:
db_row(std::shared_ptr<context_t> context) {
auto column_count = sqlite3_column_count(context->stmt.get());
for (std::int32_t col = 0; col < column_count; col++) {
std::string name{sqlite3_column_name(context->stmt.get(), col)};
auto column_type = sqlite3_column_type(context->stmt.get(), col);
db_types_t value;
switch (column_type) {
case SQLITE_INTEGER: {
value = sqlite3_column_int64(context->stmt.get(), col);
} break;
case SQLITE_TEXT: {
const auto *text = reinterpret_cast<const char *>(
sqlite3_column_text(context->stmt.get(), col));
value = std::string(text == nullptr ? "" : text);
} break;
default:
throw std::runtime_error("column type not implemented|" + name + '|' +
std::to_string(column_type));
}
columns_[name] = db_column{col, name, value};
}
}
private:
std::map<std::string, db_column> columns_;
public:
[[nodiscard]] auto get_columns() const -> std::vector<db_column> {
std::vector<db_column> ret;
for (const auto &item : columns_) {
ret.push_back(item.second);
}
return ret;
}
[[nodiscard]] auto get_column(std::int32_t index) const -> db_column {
auto iter = std::find_if(columns_.begin(), columns_.end(),
[&index](auto &&col) -> bool {
return col.second.get_index() == index;
});
if (iter == columns_.end()) {
throw std::out_of_range("");
}
return iter->second;
}
[[nodiscard]] auto get_column(std::string name) const -> db_column {
return columns_.at(name);
}
};
template <typename context_t> struct db_result final {
db_result(std::shared_ptr<context_t> context, std::int32_t res)
: context_(std::move(context)), res_(res) {
constexpr const auto *function_name =
static_cast<const char *>(__FUNCTION__);
if (res == SQLITE_OK) {
set_res(sqlite3_step(context_->stmt.get()), function_name);
}
}
private:
std::shared_ptr<context_t> context_;
mutable std::int32_t res_;
private:
void set_res(std::int32_t res, std::string function) const {
if (res != SQLITE_OK && res != SQLITE_DONE && res != SQLITE_ROW) {
utils::error::raise_error(function, "failed to step|" +
std::to_string(res) + '|' +
sqlite3_errstr(res));
}
res_ = res;
}
public:
[[nodiscard]] auto ok() const -> bool {
return res_ == SQLITE_DONE || res_ == SQLITE_ROW;
}
[[nodiscard]] auto get_error() const -> std::int32_t { return res_; }
[[nodiscard]] auto get_error_str() const -> std::string {
return sqlite3_errstr(res_);
}
[[nodiscard]] auto get_row(std::optional<db_row<context_t>> &row) const
-> bool {
constexpr const auto *function_name =
static_cast<const char *>(__FUNCTION__);
row.reset();
if (has_row()) {
row = db_row{context_};
set_res(sqlite3_step(context_->stmt.get()), function_name);
return true;
}
return false;
}
[[nodiscard]] auto has_row() const -> bool { return res_ == SQLITE_ROW; }
void next_row() const {
constexpr const auto *function_name =
static_cast<const char *>(__FUNCTION__);
if (has_row()) {
set_res(sqlite3_step(context_->stmt.get()), function_name);
}
}
};
inline void set_journal_mode(sqlite3 &db3) {
sqlite3_exec(&db3, "PRAGMA journal_mode = WAL;PRAGMA synchronous = NORMAL;",
nullptr, nullptr, nullptr);
}
[[nodiscard]] inline auto execute_sql(sqlite3 &db3, const std::string &sql,
std::string &err) -> bool {
char *err_msg{nullptr};
auto res = sqlite3_exec(&db3, sql.c_str(), nullptr, nullptr, &err_msg);
if (err_msg != nullptr) {
err = err_msg;
sqlite3_free(err_msg);
err_msg = nullptr;
}
if (res != SQLITE_OK) {
err = "failed to execute sql|" + sql + "|" + std::to_string(res) + '|' +
(err.empty() ? sqlite3_errstr(res) : err);
return false;
}
return true;
}
} // namespace repertory::db
#endif // INCLUDE_DATABASE_DB_COMMON_HPP_

View File

@@ -1,125 +0,0 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_DATABASE_DB_SELECT_HPP_
#define INCLUDE_DATABASE_DB_SELECT_HPP_
#include "database/db_common.hpp"
#include "utils/error_utils.hpp"
namespace repertory::db {
class db_select final {
public:
struct context final {
context(sqlite3 &db3_, std::string table_name_)
: db3(db3_), table_name(std::move(table_name_)) {}
sqlite3 &db3;
std::string table_name;
std::vector<comp_data_t> ands{};
std::vector<std::string> columns{};
std::map<std::string, std::string> count_columns{};
bool delete_query{false};
std::optional<std::int32_t> limit;
std::optional<std::pair<std::string, bool>> order_by;
db3_stmt_t stmt{nullptr};
};
using row = db_row<context>;
public:
db_select(sqlite3 &db3, std::string table_name)
: context_(std::make_shared<context>(db3, table_name)) {}
db_select(std::shared_ptr<context> ctx) : context_(std::move(ctx)) {}
public:
struct db_where final {
db_where(std::shared_ptr<context> ctx, std::string column_name)
: context_(std::move(ctx)), column_name_(std::move(column_name)) {}
public:
struct db_where_next final {
db_where_next(std::shared_ptr<context> ctx) : context_(std::move(ctx)) {}
private:
std::shared_ptr<context> context_;
public:
[[nodiscard]] auto and_where(std::string column_name) const -> db_where {
return db_where{context_, column_name};
}
[[nodiscard]] auto dump() const -> std::string {
return db_select{context_}.dump();
}
[[nodiscard]] auto go() const -> db_result<context> {
return db_select{context_}.go();
}
[[nodiscard]] auto limit(std::int32_t value) const -> db_select {
return db_select{context_}.limit(value);
}
[[nodiscard]] auto order_by(std::string column_name, bool ascending) const
-> db_select {
return db_select{context_}.order_by(column_name, ascending);
}
};
private:
std::shared_ptr<context> context_;
std::string column_name_;
public:
[[nodiscard]] auto equals(db_types_t value) const -> db_where_next {
context_->ands.emplace_back(comp_data_t{column_name_, "=", value});
return db_where_next{context_};
}
};
private:
std::shared_ptr<context> context_;
public:
[[nodiscard]] auto column(std::string column_name) -> db_select &;
[[nodiscard]] auto count(std::string column_name, std::string as_column_name)
-> db_select &;
[[nodiscard]] auto delete_query() -> db_select &;
[[nodiscard]] auto dump() const -> std::string;
[[nodiscard]] auto go() const -> db_result<context>;
[[nodiscard]] auto limit(std::int32_t value) -> db_select &;
[[nodiscard]] auto order_by(std::string column_name, bool ascending)
-> db_select &;
[[nodiscard]] auto where(std::string column_name) const -> db_where;
};
} // namespace repertory::db
#endif // INCLUDE_DATABASE_DB_SELECT_HPP_

View File

@@ -1,36 +1,34 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "events/t_event_system.hpp"
#include "events/event.hpp"
namespace repertory {
template <typename event_type>
auto t_event_system<event_type>::instance() -> t_event_system<event_type> & {
return event_system_;
}
template <typename event_type>
t_event_system<event_type> t_event_system<event_type>::event_system_;
template class t_event_system<event>;
} // namespace repertory
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_DB_FILE_DB_HPP_
#define REPERTORY_INCLUDE_DB_FILE_DB_HPP_
#include "db/i_file_db.hpp"
namespace repertory {
class app_config;
[[nodiscard]] auto create_file_db(const app_config &cfg)
-> std::unique_ptr<i_file_db>;
} // namespace repertory
#endif // REPERTORY_INCLUDE_DB_FILE_DB_HPP_

View File

@@ -1,41 +1,34 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_DRIVES_FUSE_EVENTS_HPP_
#define INCLUDE_DRIVES_FUSE_EVENTS_HPP_
#include "events/event_system.hpp"
namespace repertory {
// clang-format off
E_SIMPLE3(fuse_event, debug, true,
std::string, function, func, E_STRING,
std::string, api_path, ap, E_STRING,
int, result, res, E_FROM_INT32
);
E_SIMPLE1(fuse_args_parsed, normal, true,
std::string, arguments, args, E_STRING
);
// clang-format on
} // namespace repertory
#endif // INCLUDE_DRIVES_FUSE_EVENTS_HPP_
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_DB_FILE_MGR_DB_HPP_
#define REPERTORY_INCLUDE_DB_FILE_MGR_DB_HPP_
#include "db/i_file_mgr_db.hpp"
namespace repertory {
class app_config;
[[nodiscard]] auto
create_file_mgr_db(const app_config &cfg) -> std::unique_ptr<i_file_mgr_db>;
} // namespace repertory
#endif // REPERTORY_INCLUDE_DB_FILE_MGR_DB_HPP_

View File

@@ -0,0 +1,100 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_DB_I_FILE_DB_HPP_
#define REPERTORY_INCLUDE_DB_I_FILE_DB_HPP_
#include "types/repertory.hpp"
namespace repertory {
class i_file_db {
INTERFACE_SETUP(i_file_db);
public:
struct file_info final {
std::string api_path;
bool directory{};
std::string source_path;
};
struct file_data final {
std::string api_path;
std::uint64_t file_size{};
std::vector<
std::array<unsigned char, crypto_aead_xchacha20poly1305_IETF_NPUBBYTES>>
iv_list{};
std::string source_path;
};
public:
[[nodiscard]] virtual auto add_directory(const std::string &api_path,
const std::string &source_path)
-> api_error = 0;
[[nodiscard]] virtual auto add_or_update_file(const file_data &data)
-> api_error = 0;
virtual void clear() = 0;
[[nodiscard]] virtual auto count() const -> std::uint64_t = 0;
virtual void enumerate_item_list(
std::function<void(const std::vector<i_file_db::file_info> &)> callback,
stop_type_callback stop_requested_cb) const = 0;
[[nodiscard]] virtual auto get_api_path(const std::string &source_path,
std::string &api_path) const
-> api_error = 0;
[[nodiscard]] virtual auto
get_directory_api_path(const std::string &source_path,
std::string &api_path) const -> api_error = 0;
[[nodiscard]] virtual auto
get_directory_source_path(const std::string &api_path,
std::string &source_path) const -> api_error = 0;
[[nodiscard]] virtual auto get_file_api_path(const std::string &source_path,
std::string &api_path) const
-> api_error = 0;
[[nodiscard]] virtual auto get_file_data(const std::string &api_path,
file_data &data) const
-> api_error = 0;
[[nodiscard]] virtual auto
get_file_source_path(const std::string &api_path,
std::string &source_path) const -> api_error = 0;
[[nodiscard]] virtual auto
get_item_list(stop_type_callback stop_requested_cb) const
-> std::vector<file_info> = 0;
[[nodiscard]] virtual auto get_source_path(const std::string &api_path,
std::string &source_path) const
-> api_error = 0;
[[nodiscard]] virtual auto remove_item(const std::string &api_path)
-> api_error = 0;
};
} // namespace repertory
#endif // REPERTORY_INCLUDE_DB_I_FILE_DB_HPP_

View File

@@ -0,0 +1,83 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_DB_I_FILE_MGR_DB_HPP_
#define REPERTORY_INCLUDE_DB_I_FILE_MGR_DB_HPP_
#include "types/repertory.hpp"
namespace repertory {
class i_file_mgr_db {
INTERFACE_SETUP(i_file_mgr_db);
public:
struct resume_entry final {
std::string api_path;
std::uint64_t chunk_size{};
boost::dynamic_bitset<> read_state;
std::string source_path;
};
struct upload_active_entry final {
std::string api_path;
std::string source_path;
};
using upload_entry = upload_active_entry;
public:
[[nodiscard]] virtual auto add_resume(const resume_entry &entry) -> bool = 0;
[[nodiscard]] virtual auto add_upload(const upload_entry &entry) -> bool = 0;
[[nodiscard]] virtual auto add_upload_active(const upload_active_entry &entry)
-> bool = 0;
virtual void clear() = 0;
[[nodiscard]] virtual auto get_next_upload() const
-> std::optional<upload_entry> = 0;
[[nodiscard]] virtual auto get_resume_list() const
-> std::vector<resume_entry> = 0;
[[nodiscard]] virtual auto get_upload(const std::string &api_path) const
-> std::optional<upload_entry> = 0;
[[nodiscard]] virtual auto get_upload_active_list() const
-> std::vector<upload_active_entry> = 0;
[[nodiscard]] virtual auto remove_resume(const std::string &api_path)
-> bool = 0;
[[nodiscard]] virtual auto remove_upload(const std::string &api_path)
-> bool = 0;
[[nodiscard]] virtual auto remove_upload_active(const std::string &api_path)
-> bool = 0;
[[nodiscard]] virtual auto rename_resume(const std::string &from_api_path,
const std::string &to_api_path)
-> bool = 0;
};
} // namespace repertory
#endif // REPERTORY_INCLUDE_DB_I_FILE_MGR_DB_HPP_

View File

@@ -0,0 +1,82 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_DB_I_META_DB_HPP_
#define REPERTORY_INCLUDE_DB_I_META_DB_HPP_
#include "types/repertory.hpp"
namespace repertory {
class i_meta_db {
INTERFACE_SETUP(i_meta_db);
public:
virtual void clear() = 0;
virtual void enumerate_api_path_list(
std::function<void(const std::vector<std::string> &)> callback,
stop_type_callback stop_requested_cb) const = 0;
[[nodiscard]] virtual auto get_api_path(const std::string &source_path,
std::string &api_path) const
-> api_error = 0;
[[nodiscard]] virtual auto get_api_path_list() const
-> std::vector<std::string> = 0;
[[nodiscard]] virtual auto get_item_meta(const std::string &api_path,
api_meta_map &meta) const
-> api_error = 0;
[[nodiscard]] virtual auto get_item_meta(const std::string &api_path,
const std::string &key,
std::string &value) const
-> api_error = 0;
[[nodiscard]] virtual auto get_pinned_files() const
-> std::vector<std::string> = 0;
[[nodiscard]] virtual auto get_total_item_count() const -> std::uint64_t = 0;
[[nodiscard]] virtual auto get_total_size() const -> std::uint64_t = 0;
virtual void remove_api_path(const std::string &api_path) = 0;
[[nodiscard]] virtual auto remove_item_meta(const std::string &api_path,
const std::string &key)
-> api_error = 0;
[[nodiscard]] virtual auto rename_item_meta(const std::string &from_api_path,
const std::string &to_api_path)
-> api_error = 0;
[[nodiscard]] virtual auto set_item_meta(const std::string &api_path,
const std::string &key,
const std::string &value)
-> api_error = 0;
[[nodiscard]] virtual auto set_item_meta(const std::string &api_path,
const api_meta_map &meta)
-> api_error = 0;
};
} // namespace repertory
#endif // REPERTORY_INCLUDE_DB_I_META_DB_HPP_

View File

@@ -0,0 +1,121 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_DB_IMPL_RDB_FILE_DB_HPP_
#define REPERTORY_INCLUDE_DB_IMPL_RDB_FILE_DB_HPP_
#include "db/i_file_db.hpp"
namespace repertory {
class app_config;
class rdb_file_db final : public i_file_db {
public:
rdb_file_db(const app_config &cfg);
~rdb_file_db() override;
rdb_file_db(const rdb_file_db &) = delete;
rdb_file_db(rdb_file_db &&) = delete;
auto operator=(const rdb_file_db &) -> rdb_file_db & = delete;
auto operator=(rdb_file_db &&) -> rdb_file_db & = delete;
private:
const app_config &cfg_;
private:
std::unique_ptr<rocksdb::TransactionDB> db_{nullptr};
rocksdb::ColumnFamilyHandle *directory_family_{};
rocksdb::ColumnFamilyHandle *file_family_{};
rocksdb::ColumnFamilyHandle *path_family_{};
rocksdb::ColumnFamilyHandle *source_family_{};
private:
void create_or_open(bool clear);
[[nodiscard]] auto create_iterator(rocksdb::ColumnFamilyHandle *family) const
-> std::shared_ptr<rocksdb::Iterator>;
[[nodiscard]] static auto
perform_action(std::string_view function_name,
std::function<rocksdb::Status()> action) -> api_error;
[[nodiscard]] auto perform_action(
std::string_view function_name,
std::function<rocksdb::Status(rocksdb::Transaction *txn)> action)
-> api_error;
[[nodiscard]] auto remove_item(const std::string &api_path,
const std::string &source_path,
rocksdb::Transaction *txn) -> rocksdb::Status;
public:
[[nodiscard]] auto add_directory(const std::string &api_path,
const std::string &source_path)
-> api_error override;
[[nodiscard]] auto add_or_update_file(const i_file_db::file_data &data)
-> api_error override;
void clear() override;
[[nodiscard]] auto count() const -> std::uint64_t override;
void enumerate_item_list(
std::function<void(const std::vector<i_file_db::file_info> &)> callback,
stop_type_callback stop_requested_cb) const override;
[[nodiscard]] auto get_api_path(const std::string &source_path,
std::string &api_path) const
-> api_error override;
[[nodiscard]] auto get_directory_api_path(const std::string &source_path,
std::string &api_path) const
-> api_error override;
[[nodiscard]] auto get_directory_source_path(const std::string &api_path,
std::string &source_path) const
-> api_error override;
[[nodiscard]] auto get_file_api_path(const std::string &source_path,
std::string &api_path) const
-> api_error override;
[[nodiscard]] auto get_file_data(const std::string &api_path,
i_file_db::file_data &data) const
-> api_error override;
[[nodiscard]] auto get_file_source_path(const std::string &api_path,
std::string &source_path) const
-> api_error override;
[[nodiscard]] auto get_item_list(stop_type_callback stop_requested_cb) const
-> std::vector<i_file_db::file_info> override;
[[nodiscard]] auto get_source_path(const std::string &api_path,
std::string &source_path) const
-> api_error override;
[[nodiscard]] auto remove_item(const std::string &api_path)
-> api_error override;
};
} // namespace repertory
#endif // REPERTORY_INCLUDE_DB_IMPL_RDB_FILE_DB_HPP_

View File

@@ -0,0 +1,109 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_DB_IMPL_RDB_FILE_MGR_DB_HPP_
#define REPERTORY_INCLUDE_DB_IMPL_RDB_FILE_MGR_DB_HPP_
#include "db/i_file_mgr_db.hpp"
namespace repertory {
class app_config;
class rdb_file_mgr_db final : public i_file_mgr_db {
public:
rdb_file_mgr_db(const app_config &cfg);
~rdb_file_mgr_db() override;
rdb_file_mgr_db(const rdb_file_mgr_db &) = delete;
rdb_file_mgr_db(rdb_file_mgr_db &&) = delete;
auto operator=(const rdb_file_mgr_db &) -> rdb_file_mgr_db & = delete;
auto operator=(rdb_file_mgr_db &&) -> rdb_file_mgr_db & = delete;
private:
const app_config &cfg_;
private:
std::unique_ptr<rocksdb::TransactionDB> db_{nullptr};
std::atomic<std::uint64_t> id_{0U};
rocksdb::ColumnFamilyHandle *resume_family_{};
rocksdb::ColumnFamilyHandle *upload_active_family_{};
rocksdb::ColumnFamilyHandle *upload_family_{};
private:
void create_or_open(bool clear);
[[nodiscard]] auto create_iterator(rocksdb::ColumnFamilyHandle *family) const
-> std::shared_ptr<rocksdb::Iterator>;
[[nodiscard]] static auto
perform_action(std::string_view function_name,
std::function<rocksdb::Status()> action) -> bool;
[[nodiscard]] auto perform_action(
std::string_view function_name,
std::function<rocksdb::Status(rocksdb::Transaction *txn)> action) -> bool;
[[nodiscard]] auto remove_resume(const std::string &api_path,
rocksdb::Transaction *txn)
-> rocksdb::Status;
[[nodiscard]] auto add_resume(const resume_entry &entry,
rocksdb::Transaction *txn) -> rocksdb::Status;
public:
[[nodiscard]] auto add_resume(const resume_entry &entry) -> bool override;
[[nodiscard]] auto add_upload(const upload_entry &entry) -> bool override;
[[nodiscard]] auto add_upload_active(const upload_active_entry &entry)
-> bool override;
void clear() override;
[[nodiscard]] auto get_next_upload() const
-> std::optional<upload_entry> override;
[[nodiscard]] auto get_resume_list() const
-> std::vector<resume_entry> override;
[[nodiscard]] auto get_upload(const std::string &api_path) const
-> std::optional<upload_entry> override;
[[nodiscard]] auto get_upload_active_list() const
-> std::vector<upload_active_entry> override;
[[nodiscard]] auto remove_resume(const std::string &api_path)
-> bool override;
[[nodiscard]] auto remove_upload(const std::string &api_path)
-> bool override;
[[nodiscard]] auto remove_upload_active(const std::string &api_path)
-> bool override;
[[nodiscard]] auto rename_resume(const std::string &from_api_path,
const std::string &to_api_path)
-> bool override;
};
} // namespace repertory
#endif // REPERTORY_INCLUDE_DB_IMPL_RDB_FILE_MGR_DB_HPP_

View File

@@ -0,0 +1,131 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_DB_IMPL_RDB_META_DB_HPP_
#define REPERTORY_INCLUDE_DB_IMPL_RDB_META_DB_HPP_
#include "db/i_meta_db.hpp"
#include "types/repertory.hpp"
namespace repertory {
class app_config;
class rdb_meta_db final : public i_meta_db {
public:
rdb_meta_db(const app_config &cfg);
~rdb_meta_db() override;
rdb_meta_db(const rdb_meta_db &) = delete;
rdb_meta_db(rdb_meta_db &&) = delete;
auto operator=(const rdb_meta_db &) -> rdb_meta_db & = delete;
auto operator=(rdb_meta_db &&) -> rdb_meta_db & = delete;
private:
const app_config &cfg_;
private:
std::unique_ptr<rocksdb::TransactionDB> db_{nullptr};
rocksdb::ColumnFamilyHandle *meta_family_{};
rocksdb::ColumnFamilyHandle *pinned_family_{};
rocksdb::ColumnFamilyHandle *size_family_{};
rocksdb::ColumnFamilyHandle *source_family_{};
private:
[[nodiscard]] auto create_iterator(rocksdb::ColumnFamilyHandle *family) const
-> std::shared_ptr<rocksdb::Iterator>;
void create_or_open(bool clear);
[[nodiscard]] auto get_item_meta_json(const std::string &api_path,
json &json_data) const -> api_error;
[[nodiscard]] static auto
perform_action(std::string_view function_name,
std::function<rocksdb::Status()> action) -> api_error;
[[nodiscard]] auto perform_action(
std::string_view function_name,
std::function<rocksdb::Status(rocksdb::Transaction *txn)> action)
-> api_error;
[[nodiscard]] auto remove_api_path(const std::string &api_path,
const std::string &source_path,
rocksdb::Transaction *txn)
-> rocksdb::Status;
[[nodiscard]] auto update_item_meta(const std::string &api_path,
json json_data,
rocksdb::Transaction *base_txn = nullptr,
rocksdb::Status *status = nullptr)
-> api_error;
public:
void clear() override;
void enumerate_api_path_list(
std::function<void(const std::vector<std::string> &)> callback,
stop_type_callback stop_requested_cb) const override;
[[nodiscard]] auto get_api_path(const std::string &source_path,
std::string &api_path) const
-> api_error override;
[[nodiscard]] auto get_api_path_list() const
-> std::vector<std::string> override;
[[nodiscard]] auto get_item_meta(const std::string &api_path,
api_meta_map &meta) const
-> api_error override;
[[nodiscard]] auto get_item_meta(const std::string &api_path,
const std::string &key,
std::string &value) const
-> api_error override;
[[nodiscard]] auto get_pinned_files() const
-> std::vector<std::string> override;
[[nodiscard]] auto get_total_item_count() const -> std::uint64_t override;
[[nodiscard]] auto get_total_size() const -> std::uint64_t override;
void remove_api_path(const std::string &api_path) override;
[[nodiscard]] auto remove_item_meta(const std::string &api_path,
const std::string &key)
-> api_error override;
[[nodiscard]] auto rename_item_meta(const std::string &from_api_path,
const std::string &to_api_path)
-> api_error override;
[[nodiscard]] auto set_item_meta(const std::string &api_path,
const std::string &key,
const std::string &value)
-> api_error override;
[[nodiscard]] auto set_item_meta(const std::string &api_path,
const api_meta_map &meta)
-> api_error override;
};
} // namespace repertory
#endif // REPERTORY_INCLUDE_DB_IMPL_RDB_META_DB_HPP_

View File

@@ -0,0 +1,96 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_DB_IMPL_SQLITE_FILE_DB_HPP_
#define REPERTORY_INCLUDE_DB_IMPL_SQLITE_FILE_DB_HPP_
#include "db/i_file_db.hpp"
#include "utils/db/sqlite/db_common.hpp"
namespace repertory {
class app_config;
class sqlite_file_db final : public i_file_db {
public:
sqlite_file_db(const app_config &cfg);
~sqlite_file_db() override;
sqlite_file_db(const sqlite_file_db &) = delete;
sqlite_file_db(sqlite_file_db &&) = delete;
auto operator=(const sqlite_file_db &) -> sqlite_file_db & = delete;
auto operator=(sqlite_file_db &&) -> sqlite_file_db & = delete;
private:
utils::db::sqlite::db3_t db_;
public:
[[nodiscard]] auto add_directory(const std::string &api_path,
const std::string &source_path)
-> api_error override;
[[nodiscard]] auto add_or_update_file(const i_file_db::file_data &data)
-> api_error override;
void clear() override;
[[nodiscard]] auto count() const -> std::uint64_t override;
void enumerate_item_list(
std::function<void(const std::vector<i_file_db::file_info> &)> callback,
stop_type_callback stop_requested_cb) const override;
[[nodiscard]] auto get_api_path(const std::string &source_path,
std::string &api_path) const
-> api_error override;
[[nodiscard]] auto get_directory_api_path(const std::string &source_path,
std::string &api_path) const
-> api_error override;
[[nodiscard]] auto get_directory_source_path(const std::string &api_path,
std::string &source_path) const
-> api_error override;
[[nodiscard]] auto get_file_api_path(const std::string &source_path,
std::string &api_path) const
-> api_error override;
[[nodiscard]] auto get_file_data(const std::string &api_path,
i_file_db::file_data &data) const
-> api_error override;
[[nodiscard]] auto get_file_source_path(const std::string &api_path,
std::string &source_path) const
-> api_error override;
[[nodiscard]] auto get_item_list(stop_type_callback stop_requested_cb) const
-> std::vector<i_file_db::file_info> override;
[[nodiscard]] auto get_source_path(const std::string &api_path,
std::string &source_path) const
-> api_error override;
[[nodiscard]] auto remove_item(const std::string &api_path)
-> api_error override;
};
} // namespace repertory
#endif // REPERTORY_INCLUDE_DB_IMPL_SQLITE_FILE_DB_HPP_

View File

@@ -0,0 +1,82 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_DB_IMPL_SQLITE_FILE_MGR_DB_HPP_
#define REPERTORY_INCLUDE_DB_IMPL_SQLITE_FILE_MGR_DB_HPP_
#include "db/i_file_mgr_db.hpp"
#include "utils/db/sqlite/db_common.hpp"
namespace repertory {
class app_config;
class sqlite_file_mgr_db final : public i_file_mgr_db {
public:
sqlite_file_mgr_db(const app_config &cfg);
~sqlite_file_mgr_db() override;
sqlite_file_mgr_db(const sqlite_file_mgr_db &) = delete;
sqlite_file_mgr_db(sqlite_file_mgr_db &&) = delete;
auto operator=(const sqlite_file_mgr_db &) -> sqlite_file_mgr_db & = delete;
auto operator=(sqlite_file_mgr_db &&) -> sqlite_file_mgr_db & = delete;
private:
utils::db::sqlite::db3_t db_;
public:
[[nodiscard]] auto add_resume(const resume_entry &entry) -> bool override;
[[nodiscard]] auto add_upload(const upload_entry &entry) -> bool override;
[[nodiscard]] auto add_upload_active(const upload_active_entry &entry)
-> bool override;
void clear() override;
[[nodiscard]] auto get_next_upload() const
-> std::optional<upload_entry> override;
[[nodiscard]] auto get_resume_list() const
-> std::vector<resume_entry> override;
[[nodiscard]] auto get_upload(const std::string &api_path) const
-> std::optional<upload_entry> override;
[[nodiscard]] auto get_upload_active_list() const
-> std::vector<upload_active_entry> override;
[[nodiscard]] auto remove_resume(const std::string &api_path)
-> bool override;
[[nodiscard]] auto remove_upload(const std::string &api_path)
-> bool override;
[[nodiscard]] auto remove_upload_active(const std::string &api_path)
-> bool override;
[[nodiscard]] auto rename_resume(const std::string &from_api_path,
const std::string &to_api_path)
-> bool override;
};
} // namespace repertory
#endif // REPERTORY_INCLUDE_DB_IMPL_SQLITE_FILE_MGR_DB_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,27 +19,28 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_PROVIDERS_META_DB_HPP_
#define INCLUDE_PROVIDERS_META_DB_HPP_
#ifndef REPERTORY_INCLUDE_DB_IMPL_SQLITE_META_DB_HPP_
#define REPERTORY_INCLUDE_DB_IMPL_SQLITE_META_DB_HPP_
#include "database/db_common.hpp"
#include "db/i_meta_db.hpp"
#include "types/repertory.hpp"
#include "utils/db/sqlite/db_common.hpp"
namespace repertory {
class app_config;
class meta_db final {
class sqlite_meta_db final : public i_meta_db {
public:
meta_db(const app_config &cfg);
~meta_db();
sqlite_meta_db(const app_config &cfg);
~sqlite_meta_db() override;
meta_db(const meta_db &) = delete;
meta_db(meta_db &&) = delete;
auto operator=(const meta_db &) -> meta_db & = delete;
auto operator=(meta_db &&) -> meta_db & = delete;
sqlite_meta_db(const sqlite_meta_db &) = delete;
sqlite_meta_db(sqlite_meta_db &&) = delete;
auto operator=(const sqlite_meta_db &) -> sqlite_meta_db & = delete;
auto operator=(sqlite_meta_db &&) -> sqlite_meta_db & = delete;
private:
db::db3_t db_;
utils::db::sqlite::db3_t db_;
constexpr static const auto table_name = "meta";
private:
@@ -47,38 +48,54 @@ private:
api_meta_map meta) -> api_error;
public:
[[nodiscard]] auto get_api_path(const std::string &source_path,
std::string &api_path) -> api_error;
void clear() override;
[[nodiscard]] auto get_api_path_list() -> std::vector<std::string>;
void enumerate_api_path_list(
std::function<void(const std::vector<std::string> &)> callback,
stop_type_callback stop_requested_cb) const override;
[[nodiscard]] auto get_api_path(const std::string &source_path,
std::string &api_path) const
-> api_error override;
[[nodiscard]] auto get_api_path_list() const
-> std::vector<std::string> override;
[[nodiscard]] auto get_item_meta(const std::string &api_path,
api_meta_map &meta) -> api_error;
api_meta_map &meta) const
-> api_error override;
[[nodiscard]] auto get_item_meta(const std::string &api_path,
const std::string &key,
std::string &value) const -> api_error;
std::string &value) const
-> api_error override;
[[nodiscard]] auto get_pinned_files() const -> std::vector<std::string>;
[[nodiscard]] auto get_pinned_files() const
-> std::vector<std::string> override;
[[nodiscard]] auto get_total_item_count() const -> std::uint64_t;
[[nodiscard]] auto get_total_item_count() const -> std::uint64_t override;
void remove_api_path(const std::string &api_path);
[[nodiscard]] auto get_total_size() const -> std::uint64_t override;
void remove_api_path(const std::string &api_path) override;
[[nodiscard]] auto remove_item_meta(const std::string &api_path,
const std::string &key) -> api_error;
const std::string &key)
-> api_error override;
[[nodiscard]] auto rename_item_meta(const std::string &from_api_path,
const std::string &to_api_path)
-> api_error;
-> api_error override;
[[nodiscard]] auto set_item_meta(const std::string &api_path,
const std::string &key,
const std::string &value) -> api_error;
const std::string &value)
-> api_error override;
[[nodiscard]] auto set_item_meta(const std::string &api_path,
const api_meta_map &meta) -> api_error;
const api_meta_map &meta)
-> api_error override;
};
} // namespace repertory
#endif // INCLUDE_PROVIDERS_META_DB_HPP_
#endif // REPERTORY_INCLUDE_DB_IMPL_SQLITE_META_DB_HPP_

View File

@@ -0,0 +1,34 @@
/*
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef REPERTORY_INCLUDE_DB_META_DB_HPP_
#define REPERTORY_INCLUDE_DB_META_DB_HPP_
#include "db/i_meta_db.hpp"
namespace repertory {
class app_config;
[[nodiscard]] auto create_meta_db(const app_config &cfg)
-> std::unique_ptr<i_meta_db>;
} // namespace repertory
#endif // REPERTORY_INCLUDE_DB_META_DB_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,28 +19,25 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_DRIVES_DIRECTORY_CACHE_HPP_
#define INCLUDE_DRIVES_DIRECTORY_CACHE_HPP_
#include "utils/single_thread_service_base.hpp"
#ifndef REPERTORY_INCLUDE_DRIVES_DIRECTORY_CACHE_HPP_
#define REPERTORY_INCLUDE_DRIVES_DIRECTORY_CACHE_HPP_
namespace repertory {
class directory_iterator;
class directory_cache final : public single_thread_service_base {
class directory_cache final {
public:
using execute_callback = std::function<void(directory_iterator &)>;
private:
struct open_directory {
directory_iterator *iterator{nullptr};
std::chrono::system_clock::time_point last_update{
std::chrono::system_clock::now()};
struct open_directory final {
std::shared_ptr<directory_iterator> iterator;
std::vector<std::uint64_t> handles;
};
public:
directory_cache() : single_thread_service_base("directory_cache") {}
~directory_cache() override = default;
directory_cache() = default;
~directory_cache() = default;
directory_cache(const directory_cache &) = delete;
directory_cache(directory_cache &&) = delete;
@@ -50,22 +47,22 @@ public:
private:
std::unordered_map<std::string, open_directory> directory_lookup_;
std::recursive_mutex directory_mutex_;
std::unique_ptr<std::thread> refresh_thread_;
protected:
void service_function() override;
public:
void execute_action(const std::string &api_path,
const execute_callback &execute);
[[nodiscard]] auto remove_directory(const std::string &api_path)
-> directory_iterator *;
[[nodiscard]] auto get_directory(std::uint64_t handle)
-> std::shared_ptr<directory_iterator>;
void remove_directory(directory_iterator *iterator);
auto remove_directory(const std::string &api_path)
-> std::shared_ptr<directory_iterator>;
void set_directory(const std::string &api_path, directory_iterator *iterator);
void remove_directory(std::uint64_t handle);
void set_directory(const std::string &api_path, std::uint64_t handle,
std::shared_ptr<directory_iterator> iterator);
};
} // namespace repertory
#endif // INCLUDE_DRIVES_DIRECTORY_CACHE_HPP_
#endif // REPERTORY_INCLUDE_DRIVES_DIRECTORY_CACHE_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,8 +19,8 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_DRIVES_DIRECTORY_ITERATOR_HPP_
#define INCLUDE_DRIVES_DIRECTORY_ITERATOR_HPP_
#ifndef REPERTORY_INCLUDE_DRIVES_DIRECTORY_ITERATOR_HPP_
#define REPERTORY_INCLUDE_DRIVES_DIRECTORY_ITERATOR_HPP_
#include "types/remote.hpp"
#include "types/repertory.hpp"
@@ -28,7 +28,7 @@
namespace repertory {
class directory_iterator final {
public:
#ifndef _WIN32
#if !defined(_WIN32)
using populate_stat_callback =
std::function<void(const std::string &, std::uint64_t,
const api_meta_map &, bool, struct stat *)>;
@@ -46,11 +46,11 @@ private:
directory_item_list items_;
public:
#ifndef _WIN32
#if !defined(_WIN32)
[[nodiscard]] auto fill_buffer(const remote::file_offset &offset,
fuse_fill_dir_t filler_function, void *buffer,
populate_stat_callback populate_stat) -> int;
#endif
#endif // !defined(_WIN32)
[[nodiscard]] auto get(std::size_t offset, std::string &item) -> int;
@@ -78,4 +78,4 @@ public:
};
} // namespace repertory
#endif // INCLUDE_DRIVES_DIRECTORY_ITERATOR_HPP_
#endif // REPERTORY_INCLUDE_DRIVES_DIRECTORY_ITERATOR_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,8 +19,8 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_DRIVES_EVICTION_HPP_
#define INCLUDE_DRIVES_EVICTION_HPP_
#ifndef REPERTORY_INCLUDE_DRIVES_EVICTION_HPP_
#define REPERTORY_INCLUDE_DRIVES_EVICTION_HPP_
#include "utils/single_thread_service_base.hpp"
@@ -31,18 +31,19 @@ class i_provider;
class eviction final : public single_thread_service_base {
public:
eviction(i_provider &provider, const app_config &config, i_file_manager &fm)
eviction(i_provider &provider, const app_config &config,
i_file_manager &file_mgr)
: single_thread_service_base("eviction"),
provider_(provider),
config_(config),
fm_(fm) {}
file_mgr_(file_mgr),
provider_(provider) {}
~eviction() override = default;
private:
i_provider &provider_;
const app_config &config_;
i_file_manager &fm_;
i_file_manager &file_mgr_;
i_provider &provider_;
private:
[[nodiscard]] auto check_minimum_requirements(const std::string &file_path)
@@ -55,4 +56,4 @@ protected:
};
} // namespace repertory
#endif // INCLUDE_DRIVES_EVICTION_HPP_
#endif // REPERTORY_INCLUDE_DRIVES_EVICTION_HPP_

View File

@@ -1,5 +1,5 @@
/*
Copyright <2018-2024> <scott.e.graves@protonmail.com>
Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,12 +19,12 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef INCLUDE_DRIVES_FUSE_FUSE_BASE_HPP_
#define INCLUDE_DRIVES_FUSE_FUSE_BASE_HPP_
#ifndef _WIN32
#ifndef REPERTORY_INCLUDE_DRIVES_FUSE_FUSE_BASE_HPP_
#define REPERTORY_INCLUDE_DRIVES_FUSE_FUSE_BASE_HPP_
#if !defined(_WIN32)
#include "events/event_system.hpp"
#include "utils/path_utils.hpp"
#include "types/repertory.hpp"
namespace repertory {
class app_config;
@@ -51,8 +51,12 @@ private:
std::string mount_location_;
protected:
bool atime_enabled_ = true;
bool console_enabled_ = false;
bool atime_enabled_{true};
bool console_enabled_{true};
bool foreground_{false};
#if defined(__APPLE__)
std::string label_;
#endif // defined(__APPLE__)
std::optional<gid_t> forced_gid_;
std::optional<uid_t> forced_uid_;
std::optional<mode_t> forced_umask_;
@@ -61,147 +65,150 @@ private:
static auto instance() -> fuse_base &;
private:
struct fuse_operations fuse_ops_ {};
struct fuse_operations fuse_ops_{};
private:
[[nodiscard]] auto execute_callback(
const std::string &function_name, const char *from, const char *to,
const std::function<api_error(const std::string &, const std::string &)>
&cb,
bool disable_logging = false) -> int;
[[nodiscard]] auto
execute_callback(const std::string &function_name, const char *path,
const std::function<api_error(const std::string &)> &cb,
execute_callback(std::string_view function_name, const char *from,
const char *to,
const std::function<api_error(std::string, std::string)> &cb,
bool disable_logging = false) -> int;
static void execute_void_callback(const std::string &function_name,
[[nodiscard]] auto
execute_callback(std::string_view function_name, const char *path,
const std::function<api_error(std::string)> &cb,
bool disable_logging = false) -> int;
static void execute_void_callback(std::string_view function_name,
const std::function<void()> &cb);
static auto execute_void_pointer_callback(const std::string &function_name,
static auto execute_void_pointer_callback(std::string_view function_name,
const std::function<void *()> &cb)
-> void *;
void raise_fuse_event(std::string function_name, const std::string &api_path,
int ret, bool disable_logging);
void raise_fuse_event(std::string_view function_name,
std::string_view api_path, int ret,
bool disable_logging);
private:
[[nodiscard]] static auto access_(const char *path, int mask) -> int;
#ifdef __APPLE__
#if defined(__APPLE__)
[[nodiscard]] static auto chflags_(const char *path, uint32_t flags) -> int;
#endif // __APPLE__
#endif // defined(__APPLE__)
#if FUSE_USE_VERSION >= 30
[[nodiscard]] static auto chmod_(const char *path, mode_t mode,
struct fuse_file_info *fi) -> int;
#else
struct fuse_file_info *f_info) -> int;
#else // FUSE_USE_VERSION < 30
[[nodiscard]] static auto chmod_(const char *path, mode_t mode) -> int;
#endif
#endif // FUSE_USE_VERSION >= 30
#if FUSE_USE_VERSION >= 30
[[nodiscard]] static auto chown_(const char *path, uid_t uid, gid_t gid,
struct fuse_file_info *fi) -> int;
#else
struct fuse_file_info *f_info) -> int;
#else // FUSE_USE_VERSION < 30
[[nodiscard]] static auto chown_(const char *path, uid_t uid, gid_t gid)
-> int;
#endif
#endif // FUSE_USE_VERSION >= 30
[[nodiscard]] static auto create_(const char *path, mode_t mode,
struct fuse_file_info *fi) -> int;
struct fuse_file_info *f_info) -> int;
static void destroy_(void *ptr);
[[nodiscard]] static auto fallocate_(const char *path, int mode, off_t offset,
off_t length, struct fuse_file_info *fi)
-> int;
off_t length,
struct fuse_file_info *f_info) -> int;
#if FUSE_USE_VERSION < 30
[[nodiscard]] static auto fgetattr_(const char *path, struct stat *st,
struct fuse_file_info *fi) -> int;
#endif
[[nodiscard]] static auto fgetattr_(const char *path, struct stat *u_stat,
struct fuse_file_info *f_info) -> int;
#endif // FUSE_USE_VERSION < 30
#ifdef __APPLE__
#if defined(__APPLE__)
[[nodiscard]] static auto fsetattr_x_(const char *path,
struct setattr_x *attr,
struct fuse_file_info *fi) -> int;
#endif // __APPLE__
struct fuse_file_info *f_info) -> int;
#endif // defined(__APPLE__)
[[nodiscard]] static auto fsync_(const char *path, int datasync,
struct fuse_file_info *fi) -> int;
struct fuse_file_info *f_info) -> int;
[[nodiscard]] static auto ftruncate_(const char *path, off_t size,
struct fuse_file_info *fi) -> int;
struct fuse_file_info *f_info) -> int;
#if FUSE_USE_VERSION >= 30
[[nodiscard]] static auto getattr_(const char *path, struct stat *st,
struct fuse_file_info *fi) -> int;
#else
[[nodiscard]] static auto getattr_(const char *path, struct stat *st) -> int;
#endif
[[nodiscard]] static auto getattr_(const char *path, struct stat *u_stat,
struct fuse_file_info *f_info) -> int;
#else // FUSE_USE_VERSION < 30
[[nodiscard]] static auto getattr_(const char *path, struct stat *u_stat)
-> int;
#endif // FUSE_USE_VERSION >= 30
#ifdef __APPLE__
#if defined(__APPLE__)
[[nodiscard]] static auto getxtimes_(const char *path,
struct timespec *bkuptime,
struct timespec *crtime) -> int;
#endif // __APPLE__
#endif // defined(__APPLE__)
#if FUSE_USE_VERSION >= 30
[[nodiscard]] static auto init_(struct fuse_conn_info *conn,
struct fuse_config *cfg) -> void *;
#else
#else // FUSE_USE_VERSION < 30
[[nodiscard]] static auto init_(struct fuse_conn_info *conn) -> void *;
#endif
#endif // FUSE_USE_VERSION >= 30
[[nodiscard]] static auto mkdir_(const char *path, mode_t mode) -> int;
[[nodiscard]] static auto open_(const char *path, struct fuse_file_info *fi)
-> int;
[[nodiscard]] static auto open_(const char *path,
struct fuse_file_info *f_info) -> int;
[[nodiscard]] static auto opendir_(const char *path,
struct fuse_file_info *fi) -> int;
struct fuse_file_info *f_info) -> int;
[[nodiscard]] static auto read_(const char *path, char *buffer,
size_t read_size, off_t read_offset,
struct fuse_file_info *fi) -> int;
struct fuse_file_info *f_info) -> int;
#if FUSE_USE_VERSION >= 30
[[nodiscard]] static auto readdir_(const char *path, void *buf,
fuse_fill_dir_t fuse_fill_dir,
off_t offset, struct fuse_file_info *fi,
off_t offset,
struct fuse_file_info *f_info,
fuse_readdir_flags flags) -> int;
#else
#else // FUSE_USE_VERSION < 30
[[nodiscard]] static auto readdir_(const char *path, void *buf,
fuse_fill_dir_t fuse_fill_dir,
off_t offset, struct fuse_file_info *fi)
-> int;
#endif
off_t offset,
struct fuse_file_info *f_info) -> int;
#endif // FUSE_USE_VERSION >= 30
[[nodiscard]] static auto release_(const char *path,
struct fuse_file_info *fi) -> int;
struct fuse_file_info *f_info) -> int;
[[nodiscard]] static auto releasedir_(const char *path,
struct fuse_file_info *fi) -> int;
struct fuse_file_info *f_info) -> int;
#if FUSE_USE_VERSION >= 30
[[nodiscard]] static auto rename_(const char *from, const char *to,
unsigned int flags) -> int;
#else
#else // FUSE_USE_VERSION < 30
[[nodiscard]] static auto rename_(const char *from, const char *to) -> int;
#endif
#endif // FUSE_USE_VERSION >= 30
[[nodiscard]] static auto rmdir_(const char *path) -> int;
#ifdef HAS_SETXATTR
#ifdef __APPLE__
#if defined(HAS_SETXATTR)
#if defined(__APPLE__)
[[nodiscard]] static auto getxattr_(const char *path, const char *name,
char *value, size_t size,
uint32_t position) -> int;
#else // __APPLE__
#else // !defined(__APPLE__)
[[nodiscard]] static auto getxattr_(const char *path, const char *name,
char *value, size_t size) -> int;
#endif // __APPLE__
#endif // defined(__APPLE__)
[[nodiscard]] static auto listxattr_(const char *path, char *buffer,
size_t size) -> int;
@@ -209,19 +216,19 @@ private:
[[nodiscard]] static auto removexattr_(const char *path, const char *name)
-> int;
#ifdef __APPLE__
#if defined(__APPLE__)
[[nodiscard]] static auto setxattr_(const char *path, const char *name,
const char *value, size_t size, int flags,
uint32_t position) -> int;
#else // __APPLE__
#else // !defined(__APPLE__)
[[nodiscard]] static auto setxattr_(const char *path, const char *name,
const char *value, size_t size, int flags)
-> int;
#endif // __APPLE__
#endif // HAS_SETXATTR
#endif // defined(__APPLE__)
#endif // defined(HAS_SETXATTR)
#ifdef __APPLE__
#if defined(__APPLE__)
[[nodiscard]] static auto setattr_x_(const char *path, struct setattr_x *attr)
-> int;
@@ -240,32 +247,32 @@ private:
[[nodiscard]] static auto statfs_x_(const char *path, struct statfs *stbuf)
-> int;
#else // __APPLE__
#else // !defined(__APPLE__)
[[nodiscard]] static auto statfs_(const char *path, struct statvfs *stbuf)
-> int;
#endif // __APPLE__
#endif // defined(__APPLE__)
#if FUSE_USE_VERSION >= 30
[[nodiscard]] static auto truncate_(const char *path, off_t size,
struct fuse_file_info *fi) -> int;
#else
struct fuse_file_info *f_info) -> int;
#else // FUSE_USE_VERSION < 30
[[nodiscard]] static auto truncate_(const char *path, off_t size) -> int;
#endif
#endif // FUSE_USE_VERSION >= 30
[[nodiscard]] static auto unlink_(const char *path) -> int;
#if FUSE_USE_VERSION >= 30
[[nodiscard]] static auto utimens_(const char *path,
const struct timespec tv[2],
struct fuse_file_info *fi) -> int;
#else
struct fuse_file_info *f_info) -> int;
#else // FUSE_USE_VERSION < 30
[[nodiscard]] static auto utimens_(const char *path,
const struct timespec tv[2]) -> int;
#endif
#endif // FUSE_USE_VERSION >= 30
[[nodiscard]] static auto write_(const char *path, const char *buffer,
size_t write_size, off_t write_offset,
struct fuse_file_info *fi) -> int;
struct fuse_file_info *f_info) -> int;
protected:
[[nodiscard]] virtual auto access_impl(std::string /*api_path*/, int /*mask*/)
@@ -273,44 +280,44 @@ protected:
return api_error::not_implemented;
}
#ifdef __APPLE__
#if defined(__APPLE__)
[[nodiscard]] virtual auto chflags_impl(std::string /*api_path*/,
uint32_t /*flags*/) -> api_error {
return api_error::not_implemented;
}
#endif // __APPLE__
#endif // defined(__APPLE__)
#if FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto chmod_impl(std::string /*api_path*/,
mode_t /*mode*/,
struct fuse_file_info * /*fi*/)
struct fuse_file_info * /*f_info*/)
-> api_error {
return api_error::not_implemented;
}
#else
#else // FUSE_USE_VERSION < 30
[[nodiscard]] virtual auto chmod_impl(std::string /*api_path*/,
mode_t /*mode*/) -> api_error {
return api_error::not_implemented;
}
#endif
#endif // FUSE_USE_VERSION >= 30
#if FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto chown_impl(std::string /*api_path*/, uid_t /*uid*/,
gid_t /*gid*/,
struct fuse_file_info * /*fi*/)
struct fuse_file_info * /*f_info*/)
-> api_error {
return api_error::not_implemented;
}
#else
#else // FUSE_USE_VERSION < 30
[[nodiscard]] virtual auto chown_impl(std::string /*api_path*/, uid_t /*uid*/,
gid_t /*gid*/) -> api_error {
return api_error::not_implemented;
}
#endif
#endif // FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto create_impl(std::string /*api_path*/,
mode_t /*mode*/,
struct fuse_file_info * /*fi*/)
struct fuse_file_info * /*f_info*/)
-> api_error {
return api_error::not_implemented;
}
@@ -319,30 +326,30 @@ protected:
[[nodiscard]] virtual auto
fallocate_impl(std::string /*api_path*/, int /*mode*/, off_t /*offset*/,
off_t /*length*/, struct fuse_file_info * /*fi*/)
off_t /*length*/, struct fuse_file_info * /*f_info*/)
-> api_error {
return api_error::not_implemented;
}
[[nodiscard]] virtual auto fgetattr_impl(std::string /*api_path*/,
struct stat * /*st*/,
struct fuse_file_info * /*fi*/)
struct stat * /*u_stat*/,
struct fuse_file_info * /*f_info*/)
-> api_error {
return api_error::not_implemented;
}
#ifdef __APPLE__
#if defined(__APPLE__)
[[nodiscard]] virtual auto fsetattr_x_impl(std::string /*api_path*/,
struct setattr_x * /*attr*/,
struct fuse_file_info * /*fi*/)
struct fuse_file_info * /*f_info*/)
-> api_error {
return api_error::not_implemented;
}
#endif // __APPLE__
#endif // defined(__APPLE__)
[[nodiscard]] virtual auto fsync_impl(std::string /*api_path*/,
int /*datasync*/,
struct fuse_file_info * /*fi*/)
struct fuse_file_info * /*f_info*/)
-> api_error {
return api_error::not_implemented;
}
@@ -350,41 +357,42 @@ protected:
#if FUSE_USE_VERSION < 30
[[nodiscard]] virtual auto ftruncate_impl(std::string /*api_path*/,
off_t /*size*/,
struct fuse_file_info * /*fi*/)
struct fuse_file_info * /*f_info*/)
-> api_error {
return api_error::not_implemented;
}
#endif
#endif // FUSE_USE_VERSION < 30
#if FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto getattr_impl(std::string /*api_path*/,
struct stat * /*st*/,
struct fuse_file_info * /*fi*/)
struct stat * /*u_stat*/,
struct fuse_file_info * /*f_info*/)
-> api_error {
return api_error::not_implemented;
}
#else
#else // FUSE_USE_VERSION < 30
[[nodiscard]] virtual auto getattr_impl(std::string /*api_path*/,
struct stat * /*st*/) -> api_error {
struct stat * /*u_stat*/)
-> api_error {
return api_error::not_implemented;
}
#endif
#endif // FUSE_USE_VERSION >= 30
#ifdef __APPLE__
#if defined(__APPLE__)
[[nodiscard]] virtual auto getxtimes_impl(std::string /*api_path*/,
struct timespec * /*bkuptime*/,
struct timespec * /*crtime*/)
-> api_error {
return api_error::not_implemented;
}
#endif // __APPLE__
#endif // defined(__APPLE__)
#if FUSE_USE_VERSION >= 30
virtual auto init_impl(struct fuse_conn_info *conn, struct fuse_config *cfg)
-> void *;
#else
#else // FUSE_USE_VERSION < 30
virtual auto init_impl(struct fuse_conn_info *conn) -> void *;
#endif
#endif // FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto mkdir_impl(std::string /*api_path*/,
mode_t /*mode*/) -> api_error {
@@ -392,20 +400,20 @@ protected:
}
[[nodiscard]] virtual auto open_impl(std::string /*api_path*/,
struct fuse_file_info * /*fi*/)
struct fuse_file_info * /*f_info*/)
-> api_error {
return api_error::not_implemented;
}
[[nodiscard]] virtual auto opendir_impl(std::string /*api_path*/,
struct fuse_file_info * /*fi*/)
struct fuse_file_info * /*f_info*/)
-> api_error {
return api_error::not_implemented;
}
[[nodiscard]] virtual auto
read_impl(std::string /*api_path*/, char * /*buffer*/, size_t /*read_size*/,
off_t /*read_offset*/, struct fuse_file_info * /*fi*/,
off_t /*read_offset*/, struct fuse_file_info * /*f_info*/,
std::size_t & /*bytes_read*/) -> api_error {
return api_error::not_implemented;
}
@@ -414,27 +422,27 @@ protected:
[[nodiscard]] virtual auto
readdir_impl(std::string /*api_path*/, void * /*buf*/,
fuse_fill_dir_t /*fuse_fill_dir*/, off_t /*offset*/,
struct fuse_file_info * /*fi*/, fuse_readdir_flags /*flags*/)
struct fuse_file_info * /*f_info*/, fuse_readdir_flags /*flags*/)
-> api_error {
return api_error::not_implemented;
}
#else
#else // FUSE_USE_VERSION < 30
[[nodiscard]] virtual auto
readdir_impl(std::string /*api_path*/, void * /*buf*/,
fuse_fill_dir_t /*fuse_fill_dir*/, off_t /*offset*/,
struct fuse_file_info * /*fi*/) -> api_error {
struct fuse_file_info * /*f_info*/) -> api_error {
return api_error::not_implemented;
}
#endif
#endif // FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto release_impl(std::string /*api_path*/,
struct fuse_file_info * /*fi*/)
struct fuse_file_info * /*f_info*/)
-> api_error {
return api_error::not_implemented;
}
[[nodiscard]] virtual auto releasedir_impl(std::string /*api_path*/,
struct fuse_file_info * /*fi*/)
struct fuse_file_info * /*f_info*/)
-> api_error {
return api_error::not_implemented;
}
@@ -445,34 +453,34 @@ protected:
unsigned int /*flags*/) -> api_error {
return api_error::not_implemented;
}
#else
#else // FUSE_USE_VERSION < 30
[[nodiscard]] virtual auto rename_impl(std::string /*from_api_path*/,
std::string /*to_api_path*/)
-> api_error {
return api_error::not_implemented;
}
#endif
#endif // FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto rmdir_impl(std::string /*api_path*/) -> api_error {
return api_error::not_implemented;
}
#ifdef HAS_SETXATTR
#ifdef __APPLE__
#if defined(HAS_SETXATTR)
#if defined(__APPLE__)
[[nodiscard]] virtual auto
getxattr_impl(std::string /*api_path*/, const char * /*name*/,
char * /*value*/, size_t /*size*/, uint32_t /*position*/,
int & /*attribute_size*/) -> api_error {
return api_error::not_implemented;
}
#else // __APPLE__
#else // !defined(__APPLE__)
[[nodiscard]] virtual auto
getxattr_impl(std::string /*api_path*/, const char * /*name*/,
char * /*value*/, size_t /*size*/, int & /*attribute_size*/)
-> api_error {
return api_error::not_implemented;
}
#endif // __APPLE__
#endif // defined(__APPLE__)
[[nodiscard]] virtual auto
listxattr_impl(std::string /*api_path*/, char * /*buffer*/, size_t /*size*/,
@@ -486,7 +494,7 @@ protected:
return api_error::not_implemented;
}
#ifdef __APPLE__
#if defined(__APPLE__)
[[nodiscard]] virtual auto setxattr_impl(std::string /*api_path*/,
const char * /*name*/,
const char * /*value*/,
@@ -494,17 +502,17 @@ protected:
uint32_t /*position*/) -> api_error {
return api_error::not_implemented;
}
#else // __APPLE__
#else // !defined (__APPLE__)
[[nodiscard]] virtual auto
setxattr_impl(std::string /*api_path*/, const char * /*name*/,
const char * /*value*/, size_t /*size*/, int /*flags*/)
-> api_error {
return api_error::not_implemented;
}
#endif // __APPLE__
#endif // HAS_SETXATTR
#endif // defined (__APPLE__)
#endif // defined(HAS_SETXATTR)
#ifdef __APPLE__
#if defined(__APPLE__)
[[nodiscard]] virtual auto setattr_x_impl(std::string /*api_path*/,
struct setattr_x * /*attr*/)
-> api_error {
@@ -539,27 +547,27 @@ protected:
-> api_error {
return api_error::not_implemented;
}
#else // __APPLE__
#else // !defined(__APPLE__)
[[nodiscard]] virtual auto statfs_impl(std::string /*api_path*/,
struct statvfs * /*stbuf*/)
-> api_error {
return api_error::not_implemented;
}
#endif // __APPLE__
#endif // defined(__APPLE__)
#if FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto truncate_impl(std::string /*api_path*/,
off_t /*size*/,
struct fuse_file_info * /*fi*/)
struct fuse_file_info * /*f_info*/)
-> api_error {
return api_error::not_implemented;
}
#else
#else // FUSE_USE_VERSION < 30
[[nodiscard]] virtual auto truncate_impl(std::string /*api_path*/,
off_t /*size*/) -> api_error {
return api_error::not_implemented;
}
#endif
#endif // FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto unlink_impl(std::string /*api_path*/)
-> api_error {
@@ -569,23 +577,23 @@ protected:
#if FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto utimens_impl(std::string /*api_path*/,
const struct timespec /*tv*/[2],
struct fuse_file_info * /*fi*/)
struct fuse_file_info * /*f_info*/)
-> api_error {
return api_error::not_implemented;
}
#else
#else // FUSE_USE_VERSION < 30
[[nodiscard]] virtual auto utimens_impl(std::string /*api_path*/,
const struct timespec /*tv*/[2])
-> api_error {
return api_error::not_implemented;
}
#endif
#endif // FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto
write_impl(std::string /*api_path*/, const char * /*buffer*/,
size_t /*write_size*/, off_t /*write_offset*/,
struct fuse_file_info * /*fi*/, std::size_t & /*bytes_written*/)
-> api_error {
struct fuse_file_info * /*f_info*/,
std::size_t & /*bytes_written*/) -> api_error {
return api_error::not_implemented;
}
@@ -603,15 +611,17 @@ public:
static void display_version_information(std::vector<const char *> args);
static auto unmount(const std::string &mount_location) -> int;
auto unmount(const std::string &mount_location) -> int;
[[nodiscard]] auto get_mount_location() const -> std::string {
return mount_location_;
}
[[nodiscard]] auto mount(std::vector<std::string> args) -> int;
[[nodiscard]] auto mount(std::vector<std::string> orig_args,
std::vector<std::string> args, provider_type prov,
std::string_view unique_id) -> int;
};
} // namespace repertory
#endif // _WIN32
#endif // INCLUDE_DRIVES_FUSE_FUSE_BASE_HPP_
#endif // !defined(_WIN32)
#endif // REPERTORY_INCLUDE_DRIVES_FUSE_FUSE_BASE_HPP_

Some files were not shown because too many files have changed in this diff Show More