Compare commits
81 Commits
master
...
v2.1.0-rc-
Author | SHA1 | Date | |
---|---|---|---|
15579ef3cb | |||
d9dd2a59e7 | |||
d45d91340f | |||
039ff6ba42 | |||
81c6875382 | |||
1bbe078799 | |||
17082eb271 | |||
9e5e775c71 | |||
bf63bdb8ea | |||
a0c412bd66 | |||
d40ff7d14d | |||
85609be4b6 | |||
83fb6aaec3 | |||
22f546f14d | |||
54376ae84a | |||
2ac0f8fc52 | |||
bca7012d10 | |||
00b11da712 | |||
b438b1b1f1 | |||
b360335655 | |||
2cba8936c4 | |||
f8451c5514 | |||
462a9446bd | |||
a0a0d92169 | |||
7fb34c1b4a | |||
2ca345df8c | |||
2d53671fdf | |||
03b810ec75 | |||
3f4b88a2c6 | |||
0ad54c25a7 | |||
d97949cc3a | |||
b1a1824050 | |||
75fe994e95 | |||
9d020dd241 | |||
cbb2bfa73d | |||
0404950693 | |||
9948df0541 | |||
c53ab513a0 | |||
9e76f88c8f | |||
8da2a7d27a | |||
025a5a0db7 | |||
5fc391e5c0 | |||
5357486659 | |||
d8774ba7f7 | |||
1e7e304b43 | |||
17b7b09333 | |||
5f4b853764 | |||
6d0f2a6c36 | |||
ccdbf2efde | |||
e02eebba99 | |||
7d06fb5617 | |||
66053df28f | |||
6920db4c88 | |||
e37b2492e9 | |||
2435a765f0 | |||
f88e4181f1 | |||
5d2a1b0c17 | |||
1fff514e4e | |||
2f14e0f054 | |||
0c049a17f6 | |||
1390f96fdc | |||
1d7a3f5125 | |||
a9ebc52514 | |||
ca9eaf0249 | |||
7601746093 | |||
42f83170f7 | |||
9722cc06ff | |||
3d063a8ec2 | |||
b6719846bf | |||
9ed4187593 | |||
8c0bbe05ee | |||
c8b6d5053e | |||
4cf339cfc4 | |||
6fe23f270a | |||
c85fe76a48 | |||
4508b6d908 | |||
c74a70ce13 | |||
f5e88e44bf | |||
f11f92ba55 | |||
14d0173bd3 | |||
5b56c73528 |
@@ -148,6 +148,7 @@ libvlc
|
|||||||
linkflags
|
linkflags
|
||||||
localappdata
|
localappdata
|
||||||
lpbyte
|
lpbyte
|
||||||
|
lpthread
|
||||||
lptr
|
lptr
|
||||||
lpwstr
|
lpwstr
|
||||||
markdownlint
|
markdownlint
|
||||||
@@ -171,6 +172,7 @@ nuspell_version
|
|||||||
oleaut32
|
oleaut32
|
||||||
openal_version
|
openal_version
|
||||||
openssldir
|
openssldir
|
||||||
|
osxfuse
|
||||||
pistream
|
pistream
|
||||||
pkgconfig
|
pkgconfig
|
||||||
plarge_integer
|
plarge_integer
|
||||||
@@ -182,6 +184,7 @@ project_enable_libdsm
|
|||||||
project_enable_nana
|
project_enable_nana
|
||||||
propgrid
|
propgrid
|
||||||
psecurity_descriptor
|
psecurity_descriptor
|
||||||
|
pthreads
|
||||||
pugi
|
pugi
|
||||||
pugixml_project
|
pugixml_project
|
||||||
puint32
|
puint32
|
||||||
@@ -207,11 +210,14 @@ source_subdir
|
|||||||
spdlog
|
spdlog
|
||||||
spdlog_project
|
spdlog_project
|
||||||
st_ctim
|
st_ctim
|
||||||
|
startf_useshowwindow
|
||||||
|
startupinfoa
|
||||||
static-libgcc
|
static-libgcc
|
||||||
static-libstdc++
|
static-libstdc++
|
||||||
stbuf
|
stbuf
|
||||||
stduuid_project
|
stduuid_project
|
||||||
strequal
|
strequal
|
||||||
|
sw_shownoactivate
|
||||||
ularge_integer
|
ularge_integer
|
||||||
uring
|
uring
|
||||||
url
|
url
|
||||||
|
3
.gitattributes
vendored
3
.gitattributes
vendored
@@ -1,4 +1,5 @@
|
|||||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
*.msi filter=lfs diff=lfs merge=lfs -text
|
||||||
*.tar.gz 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
|
*.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
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,3 +11,4 @@ scripts/cleanup.sh
|
|||||||
version.rc
|
version.rc
|
||||||
version.cpp
|
version.cpp
|
||||||
override.sh
|
override.sh
|
||||||
|
repertory.iss
|
||||||
|
@@ -6,7 +6,7 @@ pipeline {
|
|||||||
environment {
|
environment {
|
||||||
DEVELOPER_PRIVATE_KEY = "/.ci/repertory/cert/developer.priv"
|
DEVELOPER_PRIVATE_KEY = "/.ci/repertory/cert/developer.priv"
|
||||||
DEVELOPER_PUBLIC_KEY = "/.ci/repertory/cert/developer.pub"
|
DEVELOPER_PUBLIC_KEY = "/.ci/repertory/cert/developer.pub"
|
||||||
PROJECT_TEST_CONFIG_DIR = "/.ci/repertory/test_config"
|
PROJECT_TEST_CONFIG_DIR = "/.ci/repertory/test"
|
||||||
}
|
}
|
||||||
|
|
||||||
options {
|
options {
|
||||||
@@ -48,6 +48,14 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stage('linux_x86_64_test') {
|
||||||
|
agent any
|
||||||
|
|
||||||
|
steps {
|
||||||
|
sh 'scripts/run_tests.sh'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stage('deliver') {
|
stage('deliver') {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
|
10
CHANGELOG.md
10
CHANGELOG.md
@@ -1,5 +1,13 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v2.1.0-rc
|
||||||
|
|
||||||
|
### Issues
|
||||||
|
|
||||||
|
* \#51 [ui] UI console window should close after launch
|
||||||
|
* \#53 Create Windows installer
|
||||||
|
* \#54 Remove 'default' as initial bucket name for Sia
|
||||||
|
|
||||||
## v2.0.7-release
|
## v2.0.7-release
|
||||||
|
|
||||||
### Issues
|
### Issues
|
||||||
@@ -8,7 +16,9 @@
|
|||||||
|
|
||||||
## v2.0.6-release
|
## v2.0.6-release
|
||||||
|
|
||||||
|
<!-- markdownlint-disable-next-line -->
|
||||||
### Issues
|
### Issues
|
||||||
|
|
||||||
* \#42 [bug] Remote mount directory listing on Windows connected to Linux is failing
|
* \#42 [bug] Remote mount directory listing on Windows connected to Linux is failing
|
||||||
* \#43 [bug] Directories are not importing properly for Sia
|
* \#43 [bug] Directories are not importing properly for Sia
|
||||||
* \#44 [bug] Windows-to-Linux remote mount ignores `CREATE_NEW`
|
* \#44 [bug] Windows-to-Linux remote mount ignores `CREATE_NEW`
|
||||||
|
@@ -51,6 +51,10 @@ if(PROJECT_IS_ARM64)
|
|||||||
add_definitions(-DPROJECT_IS_ARM64)
|
add_definitions(-DPROJECT_IS_ARM64)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(PROJECT_IS_DARWIN)
|
||||||
|
add_definitions(-DPROJECT_IS_DARWIN)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(PROJECT_IS_MINGW)
|
if(PROJECT_IS_MINGW)
|
||||||
option(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES "Enable path sizes of 32767 characters on Windows" OFF)
|
option(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES "Enable path sizes of 32767 characters on Windows" OFF)
|
||||||
if(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES)
|
if(PROJECT_ENABLE_WIN32_LONG_PATH_NAMES)
|
||||||
@@ -115,6 +119,14 @@ if(PROJECT_BUILD)
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.cpp
|
||||||
@ONLY
|
@ONLY
|
||||||
)
|
)
|
||||||
|
|
||||||
|
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()
|
else()
|
||||||
message(STATUS "-=[CMake Settings]=-")
|
message(STATUS "-=[CMake Settings]=-")
|
||||||
message(STATUS " C standard: ${CMAKE_C_STANDARD}")
|
message(STATUS " C standard: ${CMAKE_C_STANDARD}")
|
||||||
@@ -170,6 +182,7 @@ endif()
|
|||||||
-DPROJECT_INTERFACE=1
|
-DPROJECT_INTERFACE=1
|
||||||
-DPROJECT_IS_ALPINE=${PROJECT_IS_ALPINE}
|
-DPROJECT_IS_ALPINE=${PROJECT_IS_ALPINE}
|
||||||
-DPROJECT_IS_ARM64=${PROJECT_IS_ARM64}
|
-DPROJECT_IS_ARM64=${PROJECT_IS_ARM64}
|
||||||
|
-DPROJECT_IS_DARWIN=${PROJECT_IS_DARWIN}
|
||||||
-DPROJECT_IS_MINGW=${PROJECT_IS_MINGW}
|
-DPROJECT_IS_MINGW=${PROJECT_IS_MINGW}
|
||||||
-DPROJECT_IS_MINGW_UNIX=${PROJECT_IS_MINGW_UNIX}
|
-DPROJECT_IS_MINGW_UNIX=${PROJECT_IS_MINGW_UNIX}
|
||||||
-DPROJECT_MAJOR_VERSION=${PROJECT_MAJOR_VERSION}
|
-DPROJECT_MAJOR_VERSION=${PROJECT_MAJOR_VERSION}
|
||||||
|
24
README.md
24
README.md
@@ -89,14 +89,12 @@ username and password.
|
|||||||
* `--name, -na [name]`
|
* `--name, -na [name]`
|
||||||
* Identifies a unique configuration name to support multiple mounts.
|
* 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 can be set to any valid value allowed as a file name for your filesystem.
|
||||||
* For Sia, the bucket name will be set to the same value if it is empty in the configuration file.
|
* The `--name` option is required
|
||||||
* If the `--name` option is not specified, `default` will be used.
|
|
||||||
* For S3, the `--name` option is required and does not affect the bucket name.
|
|
||||||
|
|
||||||
* `-dc`
|
* `-dc`
|
||||||
* Display mount configuration
|
* Display mount configuration
|
||||||
* For Sia, `--name` is optional
|
* For Sia, the `--name` option is required
|
||||||
* For S3, the `-s3` option is required along with `--name`
|
* For S3, the `-s3` and `--name` options are required
|
||||||
|
|
||||||
### Sia
|
### Sia
|
||||||
|
|
||||||
@@ -104,12 +102,6 @@ username and password.
|
|||||||
|
|
||||||
* Required steps:
|
* Required steps:
|
||||||
* Set the appropriate bucket name and `renterd` API password in `repertory` configuration:
|
* Set the appropriate bucket name and `renterd` API password in `repertory` configuration:
|
||||||
* To use `default` as the bucket name and configuration name, you only need to set the `renterd` API password:
|
|
||||||
* `repertory -set HostConfig.ApiPassword '<my password>'`
|
|
||||||
* To specify a different bucket name while using `default` as the configuration name:
|
|
||||||
* `repertory -set HostConfig.ApiPassword '<my password>'`
|
|
||||||
* `repertory -set SiaConfig.Bucket '<my bucket>'`
|
|
||||||
* For all other configurations:
|
|
||||||
* `repertory --name '<my config name>' -set HostConfig.ApiPassword '<my password>'`
|
* `repertory --name '<my config name>' -set HostConfig.ApiPassword '<my password>'`
|
||||||
* `repertory --name '<my config name>' -set SiaConfig.Bucket '<my bucket name>'`
|
* `repertory --name '<my config name>' -set SiaConfig.Bucket '<my bucket name>'`
|
||||||
|
|
||||||
@@ -131,7 +123,7 @@ username and password.
|
|||||||
* `repertory -dc`
|
* `repertory -dc`
|
||||||
* `repertory --name '<my config name>' -dc`
|
* `repertory --name '<my config name>' -dc`
|
||||||
* Example:
|
* Example:
|
||||||
* `repertory --name default -dc`
|
* `repertory --name my_bucket -dc`
|
||||||
|
|
||||||
#### Sia Mounting
|
#### Sia Mounting
|
||||||
|
|
||||||
@@ -139,13 +131,13 @@ username and password.
|
|||||||
* `repertory /mnt/location`
|
* `repertory /mnt/location`
|
||||||
* `repertory --name '<my config name>' /mnt/location`
|
* `repertory --name '<my config name>' /mnt/location`
|
||||||
* Example:
|
* Example:
|
||||||
* `repertory --name default /mnt/location`
|
* `repertory --name my_bucket /mnt/location`
|
||||||
|
|
||||||
* Windows:
|
* Windows:
|
||||||
* `repertory t:`
|
* `repertory t:`
|
||||||
* `repertory --name '<my config name>' t:`
|
* `repertory --name '<my config name>' t:`
|
||||||
* Example:
|
* Example:
|
||||||
* `repertory --name default t:`
|
* `repertory --name my_bucket t:`
|
||||||
|
|
||||||
#### Sia Configuration File
|
#### Sia Configuration File
|
||||||
|
|
||||||
@@ -187,7 +179,7 @@ username and password.
|
|||||||
"RetryReadCount": 6,
|
"RetryReadCount": 6,
|
||||||
"RingBufferFileSize": 512,
|
"RingBufferFileSize": 512,
|
||||||
"SiaConfig": {
|
"SiaConfig": {
|
||||||
"Bucket": "default"
|
"Bucket": "my_bucket"
|
||||||
},
|
},
|
||||||
"TaskWaitMs": 100,
|
"TaskWaitMs": 100,
|
||||||
"Version": 1
|
"Version": 1
|
||||||
@@ -453,7 +445,7 @@ in the `dist/` directory
|
|||||||
* [spdlog](https://github.com/gabime/spdlog)
|
* [spdlog](https://github.com/gabime/spdlog)
|
||||||
* [SQLite](https://www.sqlite.org)
|
* [SQLite](https://www.sqlite.org)
|
||||||
* [stduuid](https://github.com/mariusbancila/stduuid)
|
* [stduuid](https://github.com/mariusbancila/stduuid)
|
||||||
* [Storj](https://storj.io/)
|
* [Storj](https://www.storj.io/)
|
||||||
* [WinFSP - FUSE for Windows](https://github.com/billziss-gh/winfsp)
|
* [WinFSP - FUSE for Windows](https://github.com/billziss-gh/winfsp)
|
||||||
* [zlib](https://zlib.net/)
|
* [zlib](https://zlib.net/)
|
||||||
|
|
||||||
|
@@ -35,13 +35,9 @@ list(APPEND PROJECT_CXXFLAGS_LIST
|
|||||||
-Wcast-align
|
-Wcast-align
|
||||||
-Wconversion
|
-Wconversion
|
||||||
-Wdouble-promotion
|
-Wdouble-promotion
|
||||||
-Wduplicated-branches
|
|
||||||
-Wduplicated-cond
|
|
||||||
-Wextra
|
-Wextra
|
||||||
-Wformat=2
|
-Wformat=2
|
||||||
-Wlogical-op
|
|
||||||
-Wmisleading-indentation
|
-Wmisleading-indentation
|
||||||
-Wno-useless-cast
|
|
||||||
-Wnon-virtual-dtor
|
-Wnon-virtual-dtor
|
||||||
-Wnull-dereference
|
-Wnull-dereference
|
||||||
-Wold-style-cast
|
-Wold-style-cast
|
||||||
@@ -52,6 +48,15 @@ list(APPEND PROJECT_CXXFLAGS_LIST
|
|||||||
-Wunused
|
-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
|
list(APPEND PROJECT_CFLAGS_LIST
|
||||||
${PROJECT_COMMON_FLAG_LIST}
|
${PROJECT_COMMON_FLAG_LIST}
|
||||||
-std=c${CMAKE_C_STANDARD}
|
-std=c${CMAKE_C_STANDARD}
|
||||||
@@ -62,7 +67,7 @@ list(APPEND PROJECT_CXXFLAGS_LIST
|
|||||||
-std=gnu++${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
|
list(APPEND PROJECT_CMAKE_EXE_LINKER_FLAGS
|
||||||
-static-libgcc
|
-static-libgcc
|
||||||
-static-libstdc++
|
-static-libstdc++
|
||||||
@@ -89,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(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
|
list(APPEND PROJECT_EXTERNAL_CMAKE_FLAGS
|
||||||
-DCMAKE_BUILD_TYPE=${PROJECT_CMAKE_BUILD_TYPE}
|
-DCMAKE_BUILD_TYPE=${PROJECT_CMAKE_BUILD_TYPE}
|
||||||
-DCMAKE_COLOR_MAKEFILE=${CMAKE_COLOR_MAKEFILE}
|
-DCMAKE_COLOR_MAKEFILE=${CMAKE_COLOR_MAKEFILE}
|
||||||
|
@@ -7,6 +7,7 @@ set(EXPAT_HASH 85372797ff0673a8fc4a6be16466bb5a0ca28c0dcf3c6f7ac1686b4a3ba2aabb)
|
|||||||
set(GCC_HASH 51b9919ea69c980d7a381db95d4be27edf73b21254eb13d752a08003b4d013b1)
|
set(GCC_HASH 51b9919ea69c980d7a381db95d4be27edf73b21254eb13d752a08003b4d013b1)
|
||||||
set(GTEST_HASH 65fab701d9829d38cb77c14acdc431d2108bfdbf8979e40eb8ae567edf10b27c)
|
set(GTEST_HASH 65fab701d9829d38cb77c14acdc431d2108bfdbf8979e40eb8ae567edf10b27c)
|
||||||
set(ICU_HASH a2c443404f00098e9e90acf29dc318e049d2dc78d9ae5f46efb261934a730ce2)
|
set(ICU_HASH a2c443404f00098e9e90acf29dc318e049d2dc78d9ae5f46efb261934a730ce2)
|
||||||
|
set(INNOSETUP_HASH f3c42116542c4cc57263c5ba6c4feabfc49fe771f2f98a79d2f7628b8762723b)
|
||||||
set(JSON_HASH 4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187)
|
set(JSON_HASH 4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187)
|
||||||
set(LIBSODIUM_HASH 8e5aeca07a723a27bbecc3beef14b0068d37e7fc0e97f51b3f1c82d2a58005c1)
|
set(LIBSODIUM_HASH 8e5aeca07a723a27bbecc3beef14b0068d37e7fc0e97f51b3f1c82d2a58005c1)
|
||||||
set(MINGW_HASH 5afe822af5c4edbf67daaf45eec61d538f49eef6b19524de64897c6b95828caf)
|
set(MINGW_HASH 5afe822af5c4edbf67daaf45eec61d538f49eef6b19524de64897c6b95828caf)
|
||||||
@@ -17,4 +18,5 @@ set(ROCKSDB_HASH afccfab496556904900afacf7d99887f1d50cb893e5d2288bd502db233adaca
|
|||||||
set(SPDLOG_HASH 15a04e69c222eb6c01094b5c7ff8a249b36bb22788d72519646fb85feb267e67)
|
set(SPDLOG_HASH 15a04e69c222eb6c01094b5c7ff8a249b36bb22788d72519646fb85feb267e67)
|
||||||
set(SQLITE_HASH 9ad6d16cbc1df7cd55c8b55127c82a9bca5e9f287818de6dc87e04e73599d754)
|
set(SQLITE_HASH 9ad6d16cbc1df7cd55c8b55127c82a9bca5e9f287818de6dc87e04e73599d754)
|
||||||
set(STDUUID_HASH b1176597e789531c38481acbbed2a6894ad419aab0979c10410d59eb0ebf40d3)
|
set(STDUUID_HASH b1176597e789531c38481acbbed2a6894ad419aab0979c10410d59eb0ebf40d3)
|
||||||
|
set(WINFSP_HASH 073a70e00f77423e34bed98b86e600def93393ba5822204fac57a29324db9f7a)
|
||||||
set(ZLIB_HASH 17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c)
|
set(ZLIB_HASH 17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c)
|
||||||
|
@@ -59,7 +59,7 @@ if(PROJECT_BUILD)
|
|||||||
winspool
|
winspool
|
||||||
ws2_32
|
ws2_32
|
||||||
)
|
)
|
||||||
else()
|
elseif(NOT PROJECT_IS_DARWIN)
|
||||||
link_libraries(
|
link_libraries(
|
||||||
uring
|
uring
|
||||||
)
|
)
|
||||||
|
@@ -39,6 +39,14 @@ if(PROJECT_ENABLE_BOOST)
|
|||||||
wserialization
|
wserialization
|
||||||
)
|
)
|
||||||
else()
|
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}
|
find_package(Boost ${BOOST_MAJOR_VERSION}.${BOOST_MINOR_VERSION}.${BOOST_PATCH_VERSION}
|
||||||
REQUIRED
|
REQUIRED
|
||||||
COMPONENTS
|
COMPONENTS
|
||||||
|
@@ -19,6 +19,13 @@ if(PROJECT_ENABLE_FUSE AND NOT PROJECT_IS_MINGW)
|
|||||||
link_libraries(fuse)
|
link_libraries(fuse)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
|
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()
|
else()
|
||||||
pkg_check_modules(LIBFUSE3 fuse3>=3.0.0)
|
pkg_check_modules(LIBFUSE3 fuse3>=3.0.0)
|
||||||
if(LIBFUSE3_FOUND)
|
if(LIBFUSE3_FOUND)
|
||||||
@@ -35,3 +42,4 @@ if(PROJECT_ENABLE_FUSE AND NOT PROJECT_IS_MINGW)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
@@ -15,6 +15,12 @@ if(PROJECT_ENABLE_OPENSSL)
|
|||||||
elseif(NOT PROJECT_IS_MINGW)
|
elseif(NOT PROJECT_IS_MINGW)
|
||||||
if(PROJECT_IS_MINGW)
|
if(PROJECT_IS_MINGW)
|
||||||
set(OPENSSL_COMPILE_TYPE mingw64)
|
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)
|
elseif(PROJECT_IS_ARM64)
|
||||||
set(OPENSSL_COMPILE_TYPE linux-aarch64)
|
set(OPENSSL_COMPILE_TYPE linux-aarch64)
|
||||||
else()
|
else()
|
||||||
|
@@ -2,10 +2,6 @@ if(MSVC)
|
|||||||
message(FATAL_ERROR "MSVC will not be supported")
|
message(FATAL_ERROR "MSVC will not be supported")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX AND APPLE)
|
|
||||||
message(FATAL_ERROR "Apple is not currently supported")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||||
message(FATAL_ERROR "FreeBSD is not currently supported")
|
message(FATAL_ERROR "FreeBSD is not currently supported")
|
||||||
endif()
|
endif()
|
||||||
|
@@ -13,6 +13,7 @@ set(EXPAT_VERSION 2.7.1)
|
|||||||
set(GCC_VERSION 15.1.0)
|
set(GCC_VERSION 15.1.0)
|
||||||
set(GTEST_VERSION 1.17.0)
|
set(GTEST_VERSION 1.17.0)
|
||||||
set(ICU_VERSION 76-1)
|
set(ICU_VERSION 76-1)
|
||||||
|
set(INNOSETUP_VERSION 6.4.3)
|
||||||
set(JSON_VERSION 3.12.0)
|
set(JSON_VERSION 3.12.0)
|
||||||
set(LIBSODIUM_VERSION 1.0.20)
|
set(LIBSODIUM_VERSION 1.0.20)
|
||||||
set(MINGW_VERSION 13.0.0)
|
set(MINGW_VERSION 13.0.0)
|
||||||
@@ -24,4 +25,6 @@ set(SPDLOG_VERSION 1.15.3)
|
|||||||
set(SQLITE2_VERSION 3.50.3)
|
set(SQLITE2_VERSION 3.50.3)
|
||||||
set(SQLITE_VERSION 3500300)
|
set(SQLITE_VERSION 3500300)
|
||||||
set(STDUUID_VERSION 1.2.3)
|
set(STDUUID_VERSION 1.2.3)
|
||||||
|
set(WINFSP2_VERSION 2.1)
|
||||||
|
set(WINFSP_VERSION 2.1.25156)
|
||||||
set(ZLIB_VERSION 1.3.1)
|
set(ZLIB_VERSION 1.3.1)
|
||||||
|
@@ -9,10 +9,10 @@ PROJECT_COPYRIGHT="Copyright <2018-2025> <MIT License> <${PROJECT_URL}>"
|
|||||||
PROJECT_DESC="Mount utility for Sia and S3"
|
PROJECT_DESC="Mount utility for Sia and S3"
|
||||||
|
|
||||||
PROJECT_MAJOR_VERSION=2
|
PROJECT_MAJOR_VERSION=2
|
||||||
PROJECT_MINOR_VERSION=0
|
PROJECT_MINOR_VERSION=1
|
||||||
PROJECT_REVISION_VERSION=7
|
PROJECT_REVISION_VERSION=0
|
||||||
PROJECT_RELEASE_NUM=1
|
PROJECT_RELEASE_NUM=0
|
||||||
PROJECT_RELEASE_ITER=release
|
PROJECT_RELEASE_ITER=rc
|
||||||
|
|
||||||
PROJECT_APP_LIST=(${PROJECT_NAME})
|
PROJECT_APP_LIST=(${PROJECT_NAME})
|
||||||
|
|
||||||
|
@@ -12,6 +12,7 @@ RUN apk add \
|
|||||||
bzip2 \
|
bzip2 \
|
||||||
clang17-extra-tools \
|
clang17-extra-tools \
|
||||||
cmake \
|
cmake \
|
||||||
|
curl \
|
||||||
file \
|
file \
|
||||||
flex \
|
flex \
|
||||||
g++ \
|
g++ \
|
||||||
@@ -43,6 +44,7 @@ RUN apk add \
|
|||||||
ruby \
|
ruby \
|
||||||
texinfo \
|
texinfo \
|
||||||
unzip \
|
unzip \
|
||||||
|
xvfb \
|
||||||
wget \
|
wget \
|
||||||
wine \
|
wine \
|
||||||
xz \
|
xz \
|
||||||
@@ -102,6 +104,39 @@ RUN echo -e \
|
|||||||
"system = 'windows'\n"\
|
"system = 'windows'\n"\
|
||||||
> ${MY_TOOLCHAIN_FILE_MESON}
|
> ${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" ]
|
SHELL [ "/bin/bash", "-c" ]
|
||||||
|
|
||||||
RUN mkdir -p \
|
RUN mkdir -p \
|
||||||
@@ -799,6 +834,7 @@ RUN if [ -f "/3rd_party/libevent-${MY_LIBEVENT_VERSION}-stable.tar.gz" ]; then \
|
|||||||
&& cmake .. \
|
&& cmake .. \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
-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_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||||
-DEVENT__DISABLE_OPENSSL=ON \
|
-DEVENT__DISABLE_OPENSSL=ON \
|
||||||
@@ -1119,6 +1155,31 @@ RUN if [ -f "/3rd_party/libdsm-${MY_LIBDSM_VERSION}.tar.gz" ]; then \
|
|||||||
&& rm -r libdsm-${MY_LIBDSM_VERSION} \
|
&& rm -r libdsm-${MY_LIBDSM_VERSION} \
|
||||||
; fi
|
; 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 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 (mv ${MY_MINGW_DIR}/lib/*.dll ${MY_MINGW_DIR}/bin || echo "no dll's found") \
|
RUN (mv ${MY_MINGW_DIR}/lib/*.dll ${MY_MINGW_DIR}/bin || echo "no dll's found") \
|
||||||
&& chmod 0777 -R ${MY_MINGW_DIR} \
|
&& chmod 0777 -R ${MY_MINGW_DIR} \
|
||||||
&& rm -rf /3rd_party
|
&& rm -rf /3rd_party \
|
||||||
|
&& rm -rf /root/.wine
|
||||||
|
|
||||||
|
USER $USERNAME
|
||||||
|
WORKDIR /home/$USERNAME
|
||||||
|
|
||||||
|
@@ -8,3 +8,5 @@ rsync -av --progress ${CURRENT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}_test/test_in
|
|||||||
|
|
||||||
rsync -av --progress ${CURRENT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}_test/test_input/ \
|
rsync -av --progress ${CURRENT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}_test/test_input/ \
|
||||||
${PROJECT_DIST_DIR}/test_input/
|
${PROJECT_DIST_DIR}/test_input/
|
||||||
|
|
||||||
|
rsync -av --progress ${CURRENT_DIR}/icon.ico ${PROJECT_DIST_DIR}/icon.ico
|
||||||
|
169
repertory.iss.in
Normal file
169
repertory.iss.in
Normal 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
|
@@ -22,7 +22,7 @@
|
|||||||
#ifndef REPERTORY_INCLUDE_COMMON_HPP_
|
#ifndef REPERTORY_INCLUDE_COMMON_HPP_
|
||||||
#define REPERTORY_INCLUDE_COMMON_HPP_
|
#define REPERTORY_INCLUDE_COMMON_HPP_
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__) && !defined(PROJECT_IS_DARWIN)
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#define REPERTORY_IGNORE_WARNINGS_ENABLE() \
|
#define REPERTORY_IGNORE_WARNINGS_ENABLE() \
|
||||||
_Pragma("GCC diagnostic push") \
|
_Pragma("GCC diagnostic push") \
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
namespace repertory {
|
namespace repertory {
|
||||||
class app_config;
|
class app_config;
|
||||||
class i_file_manager;
|
class i_file_manager;
|
||||||
class i_http_comm;
|
struct i_http_comm;
|
||||||
|
|
||||||
class base_provider : public i_provider {
|
class base_provider : public i_provider {
|
||||||
private:
|
private:
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
namespace repertory {
|
namespace repertory {
|
||||||
class app_config;
|
class app_config;
|
||||||
class i_file_manager;
|
class i_file_manager;
|
||||||
class i_http_comm;
|
struct i_http_comm;
|
||||||
struct head_object_result;
|
struct head_object_result;
|
||||||
|
|
||||||
class s3_provider final : public base_provider {
|
class s3_provider final : public base_provider {
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
namespace repertory {
|
namespace repertory {
|
||||||
class app_config;
|
class app_config;
|
||||||
class i_file_manager;
|
class i_file_manager;
|
||||||
class i_http_comm;
|
struct i_http_comm;
|
||||||
|
|
||||||
class sia_provider : public base_provider {
|
class sia_provider : public base_provider {
|
||||||
public:
|
public:
|
||||||
|
@@ -286,7 +286,8 @@ enum class exit_code : std::int32_t {
|
|||||||
init_failed = -18,
|
init_failed = -18,
|
||||||
ui_mount_failed = -19,
|
ui_mount_failed = -19,
|
||||||
exception = -20,
|
exception = -20,
|
||||||
provider_offline = -21
|
provider_offline = -21,
|
||||||
|
ui_failed = -22
|
||||||
};
|
};
|
||||||
|
|
||||||
enum http_error_codes : std::int32_t {
|
enum http_error_codes : std::int32_t {
|
||||||
|
@@ -42,6 +42,7 @@ inline const option get_directory_items_option = {"-gdi",
|
|||||||
inline const option get_pinned_files_option = {"-gpf", "--get_pinned_files"};
|
inline const option get_pinned_files_option = {"-gpf", "--get_pinned_files"};
|
||||||
inline const option help_option = {"-h", "--help"};
|
inline const option help_option = {"-h", "--help"};
|
||||||
inline const option hidden_option = {"-hidden", "--hidden"};
|
inline const option hidden_option = {"-hidden", "--hidden"};
|
||||||
|
inline const option launch_only_option = {"-lo", "--launch_only"};
|
||||||
inline const option open_files_option = {"-of", "--open_files"};
|
inline const option open_files_option = {"-of", "--open_files"};
|
||||||
inline const option pin_file_option = {"-pf", "--pin_file"};
|
inline const option pin_file_option = {"-pf", "--pin_file"};
|
||||||
inline const option pinned_status_option = {"-ps", "--pinned_status"};
|
inline const option pinned_status_option = {"-ps", "--pinned_status"};
|
||||||
@@ -71,6 +72,7 @@ inline const std::vector<option> option_list = {
|
|||||||
get_pinned_files_option,
|
get_pinned_files_option,
|
||||||
help_option,
|
help_option,
|
||||||
hidden_option,
|
hidden_option,
|
||||||
|
launch_only_option,
|
||||||
open_files_option,
|
open_files_option,
|
||||||
password_option,
|
password_option,
|
||||||
pin_file_option,
|
pin_file_option,
|
||||||
|
@@ -98,7 +98,7 @@ private:
|
|||||||
std::condition_variable notify_;
|
std::condition_variable notify_;
|
||||||
std::mutex start_stop_mutex_;
|
std::mutex start_stop_mutex_;
|
||||||
stop_type stop_requested_{false};
|
stop_type stop_requested_{false};
|
||||||
std::vector<std::unique_ptr<std::jthread>> task_threads_;
|
std::vector<std::unique_ptr<std::thread>> task_threads_;
|
||||||
std::deque<scheduled_task> tasks_;
|
std::deque<scheduled_task> tasks_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
#include <memory>
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
|
|
||||||
#include "drives/fuse/remotefuse/remote_fuse_drive.hpp"
|
#include "drives/fuse/remotefuse/remote_fuse_drive.hpp"
|
||||||
|
@@ -50,8 +50,17 @@
|
|||||||
#endif // defined(PROJECT_ENABLE_CURL)
|
#endif // defined(PROJECT_ENABLE_CURL)
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
#if defined(PROJECT_ENABLE_CURL)
|
||||||
bool curl_initialized{false};
|
bool curl_initialized{false};
|
||||||
|
#endif // defined(PROJECT_ENABLE_CURL)
|
||||||
|
|
||||||
|
#if defined(PROJECT_ENABLE_SPDLOG)
|
||||||
|
bool spdlog_initialized{false};
|
||||||
|
#endif // defined(PROJECT_ENABLE_SPDLOG)
|
||||||
|
|
||||||
|
#if defined(PROJECT_ENABLE_SQLITE)
|
||||||
bool sqlite3_initialized{false};
|
bool sqlite3_initialized{false};
|
||||||
|
#endif // defined(PROJECT_ENABLE_SQLITE)
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
namespace repertory {
|
namespace repertory {
|
||||||
@@ -72,9 +81,12 @@ auto project_initialize() -> bool {
|
|||||||
}
|
}
|
||||||
#endif // defined(PROJECT_REQUIRE_ALPINE) && !defined (PROJECT_IS_MINGW)
|
#endif // defined(PROJECT_REQUIRE_ALPINE) && !defined (PROJECT_IS_MINGW)
|
||||||
|
|
||||||
|
#if defined(PROJECT_ENABLE_SPDLOG)
|
||||||
spdlog::drop_all();
|
spdlog::drop_all();
|
||||||
spdlog::flush_every(std::chrono::seconds(5));
|
spdlog::flush_every(std::chrono::seconds(5));
|
||||||
spdlog::set_pattern("%Y-%m-%d|%T.%e|%^%l%$|%v");
|
spdlog::set_pattern("%Y-%m-%d|%T.%e|%^%l%$|%v");
|
||||||
|
spdlog_initialized = true;
|
||||||
|
#endif // defined(PROJECT_ENABLE_SPDLOG)
|
||||||
|
|
||||||
#if defined(PROJECT_ENABLE_LIBSODIUM)
|
#if defined(PROJECT_ENABLE_LIBSODIUM)
|
||||||
if (sodium_init() == -1) {
|
if (sodium_init() == -1) {
|
||||||
@@ -116,15 +128,22 @@ void project_cleanup() {
|
|||||||
#if defined(PROJECT_ENABLE_CURL)
|
#if defined(PROJECT_ENABLE_CURL)
|
||||||
if (curl_initialized) {
|
if (curl_initialized) {
|
||||||
curl_shared::cleanup();
|
curl_shared::cleanup();
|
||||||
|
curl_initialized = false;
|
||||||
}
|
}
|
||||||
#endif // defined(PROJECT_ENABLE_CURL)
|
#endif // defined(PROJECT_ENABLE_CURL)
|
||||||
|
|
||||||
#if defined(PROJECT_ENABLE_SQLITE)
|
#if defined(PROJECT_ENABLE_SQLITE)
|
||||||
if (sqlite3_initialized) {
|
if (sqlite3_initialized) {
|
||||||
sqlite3_shutdown();
|
sqlite3_shutdown();
|
||||||
|
sqlite3_initialized = false;
|
||||||
}
|
}
|
||||||
#endif // defined(PROJECT_ENABLE_SQLITE)
|
#endif // defined(PROJECT_ENABLE_SQLITE)
|
||||||
|
|
||||||
|
#if defined(PROJECT_ENABLE_SPDLOG)
|
||||||
|
if (spdlog_initialized) {
|
||||||
spdlog::shutdown();
|
spdlog::shutdown();
|
||||||
|
spdlog_initialized = false;
|
||||||
|
}
|
||||||
|
#endif // defined(PROJECT_ENABLE_SPDLOG)
|
||||||
}
|
}
|
||||||
} // namespace repertory
|
} // namespace repertory
|
||||||
|
@@ -41,13 +41,6 @@
|
|||||||
#include "utils/utils.hpp"
|
#include "utils/utils.hpp"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
[[nodiscard]] auto get_bucket(const repertory::sia_config &cfg) -> std::string {
|
|
||||||
if (cfg.bucket.empty()) {
|
|
||||||
return "default";
|
|
||||||
}
|
|
||||||
return cfg.bucket;
|
|
||||||
}
|
|
||||||
|
|
||||||
[[nodiscard]] auto get_last_modified(const nlohmann::json &obj)
|
[[nodiscard]] auto get_last_modified(const nlohmann::json &obj)
|
||||||
-> std::uint64_t {
|
-> std::uint64_t {
|
||||||
try {
|
try {
|
||||||
@@ -119,7 +112,7 @@ auto sia_provider::create_directory_impl(const std::string &api_path,
|
|||||||
curl::requests::http_put_file put_file{};
|
curl::requests::http_put_file put_file{};
|
||||||
put_file.allow_timeout = true;
|
put_file.allow_timeout = true;
|
||||||
put_file.path = "/api/worker/object" + api_path + "/";
|
put_file.path = "/api/worker/object" + api_path + "/";
|
||||||
put_file.query["bucket"] = get_bucket(get_sia_config());
|
put_file.query["bucket"] = get_sia_config().bucket;
|
||||||
|
|
||||||
std::string error_data;
|
std::string error_data;
|
||||||
put_file.response_handler = [&error_data](auto &&data, long response_code) {
|
put_file.response_handler = [&error_data](auto &&data, long response_code) {
|
||||||
@@ -363,7 +356,7 @@ auto sia_provider::get_object_info(const std::string &api_path,
|
|||||||
curl::requests::http_get get{};
|
curl::requests::http_get get{};
|
||||||
get.allow_timeout = true;
|
get.allow_timeout = true;
|
||||||
get.path = "/api/bus/object" + api_path;
|
get.path = "/api/bus/object" + api_path;
|
||||||
get.query["bucket"] = get_bucket(get_sia_config());
|
get.query["bucket"] = get_sia_config().bucket;
|
||||||
get.query["onlymetadata"] = "true";
|
get.query["onlymetadata"] = "true";
|
||||||
|
|
||||||
std::string error_data;
|
std::string error_data;
|
||||||
@@ -413,7 +406,7 @@ auto sia_provider::get_object_list(const std::string &api_path,
|
|||||||
curl::requests::http_get get{};
|
curl::requests::http_get get{};
|
||||||
get.allow_timeout = true;
|
get.allow_timeout = true;
|
||||||
get.path = "/api/bus/objects" + api_path + "/";
|
get.path = "/api/bus/objects" + api_path + "/";
|
||||||
get.query["bucket"] = get_bucket(get_sia_config());
|
get.query["bucket"] = get_sia_config().bucket;
|
||||||
if (marker.has_value()) {
|
if (marker.has_value()) {
|
||||||
get.query["limit"] = "1000";
|
get.query["limit"] = "1000";
|
||||||
get.query["marker"] = marker.value();
|
get.query["marker"] = marker.value();
|
||||||
@@ -464,7 +457,7 @@ auto sia_provider::get_total_drive_space() const -> std::uint64_t {
|
|||||||
curl::requests::http_get get{};
|
curl::requests::http_get get{};
|
||||||
get.allow_timeout = true;
|
get.allow_timeout = true;
|
||||||
get.path = "/api/bus/autopilot";
|
get.path = "/api/bus/autopilot";
|
||||||
get.query["bucket"] = get_bucket(get_sia_config());
|
get.query["bucket"] = get_sia_config().bucket;
|
||||||
|
|
||||||
json config_data;
|
json config_data;
|
||||||
std::string error_data;
|
std::string error_data;
|
||||||
@@ -581,7 +574,7 @@ auto sia_provider::is_online() const -> bool {
|
|||||||
curl::requests::http_get get{};
|
curl::requests::http_get get{};
|
||||||
get.allow_timeout = true;
|
get.allow_timeout = true;
|
||||||
get.path = "/api/bus/consensus/state";
|
get.path = "/api/bus/consensus/state";
|
||||||
get.query["bucket"] = get_bucket(get_sia_config());
|
get.query["bucket"] = get_sia_config().bucket;
|
||||||
|
|
||||||
std::string error_data;
|
std::string error_data;
|
||||||
json state_data;
|
json state_data;
|
||||||
@@ -675,7 +668,7 @@ auto sia_provider::read_file_bytes(const std::string &api_path,
|
|||||||
try {
|
try {
|
||||||
curl::requests::http_get get{};
|
curl::requests::http_get get{};
|
||||||
get.path = "/api/worker/object" + api_path;
|
get.path = "/api/worker/object" + api_path;
|
||||||
get.query["bucket"] = get_bucket(get_sia_config());
|
get.query["bucket"] = get_sia_config().bucket;
|
||||||
get.headers["accept"] = "application/octet-stream";
|
get.headers["accept"] = "application/octet-stream";
|
||||||
get.range = {{
|
get.range = {{
|
||||||
offset,
|
offset,
|
||||||
@@ -741,7 +734,7 @@ auto sia_provider::remove_directory_impl(const std::string &api_path)
|
|||||||
curl::requests::http_delete del{};
|
curl::requests::http_delete del{};
|
||||||
del.allow_timeout = true;
|
del.allow_timeout = true;
|
||||||
del.path = "/api/bus/object" + api_path + "/";
|
del.path = "/api/bus/object" + api_path + "/";
|
||||||
del.query["bucket"] = get_bucket(get_sia_config());
|
del.query["bucket"] = get_sia_config().bucket;
|
||||||
|
|
||||||
std::string error_data;
|
std::string error_data;
|
||||||
del.response_handler = [&error_data](auto &&data, long response_code) {
|
del.response_handler = [&error_data](auto &&data, long response_code) {
|
||||||
@@ -777,7 +770,7 @@ auto sia_provider::remove_file_impl(const std::string &api_path) -> api_error {
|
|||||||
curl::requests::http_delete del{};
|
curl::requests::http_delete del{};
|
||||||
del.allow_timeout = true;
|
del.allow_timeout = true;
|
||||||
del.path = "/api/bus/object" + api_path;
|
del.path = "/api/bus/object" + api_path;
|
||||||
del.query["bucket"] = get_bucket(get_sia_config());
|
del.query["bucket"] = get_sia_config().bucket;
|
||||||
|
|
||||||
std::string error_data;
|
std::string error_data;
|
||||||
del.response_handler = [&error_data](auto &&data, long response_code) {
|
del.response_handler = [&error_data](auto &&data, long response_code) {
|
||||||
@@ -815,7 +808,7 @@ auto sia_provider::rename_file(const std::string &from_api_path,
|
|||||||
try {
|
try {
|
||||||
curl::requests::http_post post{};
|
curl::requests::http_post post{};
|
||||||
post.json = nlohmann::json({
|
post.json = nlohmann::json({
|
||||||
{"bucket", get_bucket(get_sia_config())},
|
{"bucket", get_sia_config().bucket},
|
||||||
{"from", from_api_path},
|
{"from", from_api_path},
|
||||||
{"to", to_api_path},
|
{"to", to_api_path},
|
||||||
{"mode", "single"},
|
{"mode", "single"},
|
||||||
@@ -889,7 +882,7 @@ auto sia_provider::upload_file_impl(const std::string &api_path,
|
|||||||
|
|
||||||
curl::requests::http_put_file put_file{};
|
curl::requests::http_put_file put_file{};
|
||||||
put_file.path = "/api/worker/object" + api_path;
|
put_file.path = "/api/worker/object" + api_path;
|
||||||
put_file.query["bucket"] = get_bucket(get_sia_config());
|
put_file.query["bucket"] = get_sia_config().bucket;
|
||||||
put_file.headers["content-type"] = "application/octet-stream";
|
put_file.headers["content-type"] = "application/octet-stream";
|
||||||
put_file.source_path = source_path;
|
put_file.source_path = source_path;
|
||||||
|
|
||||||
|
@@ -86,8 +86,9 @@ void tasks::start(app_config *config) {
|
|||||||
|
|
||||||
for (std::uint32_t idx = 0U; idx < std::thread::hardware_concurrency() * 2U;
|
for (std::uint32_t idx = 0U; idx < std::thread::hardware_concurrency() * 2U;
|
||||||
++idx) {
|
++idx) {
|
||||||
task_threads_.emplace_back(
|
auto thread{std::make_unique<std::thread>([this]() { task_thread(); })};
|
||||||
std::make_unique<std::jthread>([this]() { task_thread(); }));
|
thread->detach();
|
||||||
|
task_threads_.emplace_back(std::move(thread));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +101,7 @@ void tasks::stop() {
|
|||||||
stop_requested_ = true;
|
stop_requested_ = true;
|
||||||
|
|
||||||
unique_mutex_lock lock(mutex_);
|
unique_mutex_lock lock(mutex_);
|
||||||
std::vector<std::unique_ptr<std::jthread>> threads;
|
std::vector<std::unique_ptr<std::thread>> threads;
|
||||||
std::swap(threads, task_threads_);
|
std::swap(threads, task_threads_);
|
||||||
|
|
||||||
std::deque<scheduled_task> task_list;
|
std::deque<scheduled_task> task_list;
|
||||||
|
@@ -118,10 +118,10 @@ auto to_api_error(int err) -> api_error {
|
|||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
case EBADMSG:
|
case EBADMSG:
|
||||||
return api_error::download_failed;
|
return api_error::download_failed;
|
||||||
#else
|
#else // !defined(__APPLE__)
|
||||||
case EREMOTEIO:
|
case EREMOTEIO:
|
||||||
return api_error::download_failed;
|
return api_error::download_failed;
|
||||||
#endif
|
#endif // defined(__APPLE__)
|
||||||
case EIO:
|
case EIO:
|
||||||
return api_error::error;
|
return api_error::error;
|
||||||
case EEXIST:
|
case EEXIST:
|
||||||
@@ -130,8 +130,6 @@ auto to_api_error(int err) -> api_error {
|
|||||||
return api_error::file_in_use;
|
return api_error::file_in_use;
|
||||||
case EINVAL:
|
case EINVAL:
|
||||||
return api_error::invalid_operation;
|
return api_error::invalid_operation;
|
||||||
case ENAMETOOLONG:
|
|
||||||
return api_error::name_too_long;
|
|
||||||
case ENOENT:
|
case ENOENT:
|
||||||
return api_error::item_not_found;
|
return api_error::item_not_found;
|
||||||
case ENOMEM:
|
case ENOMEM:
|
||||||
@@ -151,17 +149,19 @@ auto to_api_error(int err) -> api_error {
|
|||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
case ENOATTR:
|
case ENOATTR:
|
||||||
return api_error::xattr_not_found;
|
return api_error::xattr_not_found;
|
||||||
#else
|
#else // !defined(__APPLE__)
|
||||||
case ENODATA:
|
case ENODATA:
|
||||||
return api_error::xattr_not_found;
|
return api_error::xattr_not_found;
|
||||||
#endif
|
#endif // defined(__APPLE__)
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
case ENAMETOOLONG:
|
case ENAMETOOLONG:
|
||||||
return api_error::xattr_too_big;
|
return api_error::xattr_too_big;
|
||||||
#else
|
#else // !defined(__APPLE__)
|
||||||
|
case ENAMETOOLONG:
|
||||||
|
return api_error::name_too_long;
|
||||||
case E2BIG:
|
case E2BIG:
|
||||||
return api_error::xattr_too_big;
|
return api_error::xattr_too_big;
|
||||||
#endif
|
#endif // defined(__APPLE__)
|
||||||
default:
|
default:
|
||||||
return api_error::error;
|
return api_error::error;
|
||||||
}
|
}
|
||||||
|
@@ -37,7 +37,6 @@
|
|||||||
#include "cli/set.hpp"
|
#include "cli/set.hpp"
|
||||||
#include "cli/status.hpp"
|
#include "cli/status.hpp"
|
||||||
#include "cli/test.hpp"
|
#include "cli/test.hpp"
|
||||||
#include "cli/ui.hpp"
|
|
||||||
#include "cli/unmount.hpp"
|
#include "cli/unmount.hpp"
|
||||||
#include "cli/unpin_file.hpp"
|
#include "cli/unpin_file.hpp"
|
||||||
#include "utils/cli_utils.hpp"
|
#include "utils/cli_utils.hpp"
|
||||||
@@ -73,7 +72,6 @@ inline const std::unordered_map<utils::cli::option, action, option_hasher>
|
|||||||
{utils::cli::options::set_option, cli::actions::set},
|
{utils::cli::options::set_option, cli::actions::set},
|
||||||
{utils::cli::options::status_option, cli::actions::status},
|
{utils::cli::options::status_option, cli::actions::status},
|
||||||
{utils::cli::options::test_option, cli::actions::test},
|
{utils::cli::options::test_option, cli::actions::test},
|
||||||
{utils::cli::options::ui_option, cli::actions::ui},
|
|
||||||
{utils::cli::options::unmount_option, cli::actions::unmount},
|
{utils::cli::options::unmount_option, cli::actions::unmount},
|
||||||
{utils::cli::options::unpin_file_option, cli::actions::unpin_file},
|
{utils::cli::options::unpin_file_option, cli::actions::unpin_file},
|
||||||
};
|
};
|
||||||
|
@@ -1,58 +0,0 @@
|
|||||||
/*
|
|
||||||
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_CLI_UI_HPP_
|
|
||||||
#define REPERTORY_INCLUDE_CLI_UI_HPP_
|
|
||||||
|
|
||||||
#include "cli/common.hpp"
|
|
||||||
#include "ui/handlers.hpp"
|
|
||||||
#include "ui/mgmt_app_config.hpp"
|
|
||||||
|
|
||||||
namespace repertory::cli::actions {
|
|
||||||
[[nodiscard]] inline auto
|
|
||||||
ui(std::vector<const char *> args, const std::string & /*data_directory*/,
|
|
||||||
const provider_type & /* prov */, const std::string & /* unique_id */,
|
|
||||||
std::string /* user */, std::string /* password */) -> exit_code {
|
|
||||||
|
|
||||||
ui::mgmt_app_config config{};
|
|
||||||
|
|
||||||
std::string data;
|
|
||||||
auto res = utils::cli::parse_string_option(
|
|
||||||
args, utils::cli::options::ui_port_option, data);
|
|
||||||
if (res == exit_code::success && not data.empty()) {
|
|
||||||
config.set_api_port(utils::string::to_uint16(data));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (not utils::file::change_to_process_directory()) {
|
|
||||||
return exit_code::ui_mount_failed;
|
|
||||||
}
|
|
||||||
|
|
||||||
httplib::Server server;
|
|
||||||
if (not server.set_mount_point("/ui", "./web")) {
|
|
||||||
return exit_code::ui_mount_failed;
|
|
||||||
}
|
|
||||||
|
|
||||||
ui::handlers handlers(&config, &server);
|
|
||||||
return exit_code::success;
|
|
||||||
}
|
|
||||||
} // namespace repertory::cli::actions
|
|
||||||
|
|
||||||
#endif // REPERTORY_INCLUDE_CLI_UI_HPP_
|
|
@@ -27,7 +27,11 @@
|
|||||||
namespace repertory::ui {
|
namespace repertory::ui {
|
||||||
class mgmt_app_config final {
|
class mgmt_app_config final {
|
||||||
public:
|
public:
|
||||||
mgmt_app_config();
|
mgmt_app_config(bool hidden, bool launch_only);
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::atomic<bool> hidden_{false};
|
||||||
|
std::atomic<bool> launch_only_{false};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
atomic<std::string> api_password_{"repertory"};
|
atomic<std::string> api_password_{"repertory"};
|
||||||
@@ -52,6 +56,10 @@ public:
|
|||||||
|
|
||||||
[[nodiscard]] auto get_api_user() const -> std::string { return api_user_; }
|
[[nodiscard]] auto get_api_user() const -> std::string { return api_user_; }
|
||||||
|
|
||||||
|
[[nodiscard]] auto get_hidden() const -> bool { return hidden_; }
|
||||||
|
|
||||||
|
[[nodiscard]] auto get_launch_only() const -> bool { return launch_only_; }
|
||||||
|
|
||||||
[[nodiscard]] auto get_mount_location(provider_type prov,
|
[[nodiscard]] auto get_mount_location(provider_type prov,
|
||||||
std::string_view name) const
|
std::string_view name) const
|
||||||
-> std::string;
|
-> std::string;
|
||||||
@@ -62,6 +70,10 @@ public:
|
|||||||
|
|
||||||
void set_api_user(std::string_view api_user);
|
void set_api_user(std::string_view api_user);
|
||||||
|
|
||||||
|
void set_hidden(bool hidden);
|
||||||
|
|
||||||
|
void set_launch_only(bool launch_only);
|
||||||
|
|
||||||
void set_mount_location(provider_type prov, std::string_view name,
|
void set_mount_location(provider_type prov, std::string_view name,
|
||||||
std::string_view location);
|
std::string_view location);
|
||||||
};
|
};
|
||||||
|
@@ -26,6 +26,8 @@
|
|||||||
#include "cli/actions.hpp"
|
#include "cli/actions.hpp"
|
||||||
#include "initialize.hpp"
|
#include "initialize.hpp"
|
||||||
#include "types/repertory.hpp"
|
#include "types/repertory.hpp"
|
||||||
|
#include "ui/handlers.hpp"
|
||||||
|
#include "ui/mgmt_app_config.hpp"
|
||||||
#include "utils/cli_utils.hpp"
|
#include "utils/cli_utils.hpp"
|
||||||
#include "utils/polling.hpp"
|
#include "utils/polling.hpp"
|
||||||
|
|
||||||
@@ -37,7 +39,6 @@ auto main(int argc, char **argv) -> int {
|
|||||||
#endif // defined(PROJECT_ENABLE_BACKWARD_CPP)
|
#endif // defined(PROJECT_ENABLE_BACKWARD_CPP)
|
||||||
|
|
||||||
if (not repertory::project_initialize()) {
|
if (not repertory::project_initialize()) {
|
||||||
std::cerr << "fatal: failed to initialize repertory" << std::endl;
|
|
||||||
repertory::project_cleanup();
|
repertory::project_cleanup();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -52,6 +53,31 @@ auto main(int argc, char **argv) -> int {
|
|||||||
args.push_back("-h");
|
args.push_back("-h");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ret{0};
|
||||||
|
if (utils::cli::has_option(args, utils::cli::options::ui_option)) {
|
||||||
|
ui::mgmt_app_config config{
|
||||||
|
utils::cli::has_option(args, utils::cli::options::hidden_option),
|
||||||
|
utils::cli::has_option(args, utils::cli::options::launch_only_option),
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string data;
|
||||||
|
auto res = utils::cli::parse_string_option(
|
||||||
|
args, utils::cli::options::ui_port_option, data);
|
||||||
|
if (res == exit_code::success && not data.empty()) {
|
||||||
|
config.set_api_port(utils::string::to_uint16(data));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (not utils::file::change_to_process_directory()) {
|
||||||
|
ret = static_cast<std::int32_t>(exit_code::ui_failed);
|
||||||
|
} else {
|
||||||
|
httplib::Server server;
|
||||||
|
if (not server.set_mount_point("/ui", "./web")) {
|
||||||
|
ret = static_cast<std::int32_t>(exit_code::ui_failed);
|
||||||
|
} else {
|
||||||
|
ui::handlers handlers(&config, &server);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
auto prov = utils::cli::get_provider_type_from_args(args);
|
auto prov = utils::cli::get_provider_type_from_args(args);
|
||||||
|
|
||||||
std::string data_directory;
|
std::string data_directory;
|
||||||
@@ -95,7 +121,8 @@ auto main(int argc, char **argv) -> int {
|
|||||||
? utils::path::combine(
|
? utils::path::combine(
|
||||||
app_config::default_data_directory(prov),
|
app_config::default_data_directory(prov),
|
||||||
{
|
{
|
||||||
utils::string::replace_copy(unique_id, ':', '_'),
|
utils::string::replace_copy(unique_id, ':',
|
||||||
|
'_'),
|
||||||
})
|
})
|
||||||
: utils::path::absolute(data_directory);
|
: utils::path::absolute(data_directory);
|
||||||
} catch (const std::exception &e) {
|
} catch (const std::exception &e) {
|
||||||
@@ -114,22 +141,18 @@ auto main(int argc, char **argv) -> int {
|
|||||||
if (res == exit_code::success) {
|
if (res == exit_code::success) {
|
||||||
unique_id = utils::string::trim(data);
|
unique_id = utils::string::trim(data);
|
||||||
if (unique_id.empty()) {
|
if (unique_id.empty()) {
|
||||||
if (prov == provider_type::sia) {
|
|
||||||
unique_id = "default";
|
|
||||||
} else {
|
|
||||||
std::cerr << "Configuration name for '"
|
std::cerr << "Configuration name for '"
|
||||||
<< app_config::get_provider_display_name(prov)
|
<< app_config::get_provider_display_name(prov)
|
||||||
<< "' was not provided" << std::endl;
|
<< "' was not provided" << std::endl;
|
||||||
res = exit_code::invalid_syntax;
|
res = exit_code::invalid_syntax;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (res == exit_code::success) {
|
if (res == exit_code::success) {
|
||||||
data_directory =
|
data_directory =
|
||||||
data_directory.empty()
|
data_directory.empty()
|
||||||
? utils::path::combine(app_config::default_data_directory(prov),
|
? utils::path::combine(
|
||||||
{unique_id})
|
app_config::default_data_directory(prov), {unique_id})
|
||||||
: utils::path::absolute(data_directory);
|
: utils::path::absolute(data_directory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,8 +173,8 @@ auto main(int argc, char **argv) -> int {
|
|||||||
idx++) {
|
idx++) {
|
||||||
try {
|
try {
|
||||||
res = cli::actions::perform_action(
|
res = cli::actions::perform_action(
|
||||||
utils::cli::options::option_list[idx], args, data_directory, prov,
|
utils::cli::options::option_list[idx], args, data_directory,
|
||||||
unique_id, user, password);
|
prov, unique_id, user, password);
|
||||||
} catch (const std::exception &ex) {
|
} catch (const std::exception &ex) {
|
||||||
res = exit_code::exception;
|
res = exit_code::exception;
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
@@ -166,11 +189,10 @@ auto main(int argc, char **argv) -> int {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ret =
|
ret = ((res == exit_code::mount_result) ? mount_result
|
||||||
((res == exit_code::mount_result) ? mount_result
|
|
||||||
: static_cast<std::int32_t>(res));
|
: static_cast<std::int32_t>(res));
|
||||||
|
}
|
||||||
|
|
||||||
repertory::project_cleanup();
|
repertory::project_cleanup();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@@ -114,6 +114,43 @@ handlers::handlers(mgmt_app_config *config, httplib::Server *server)
|
|||||||
server_(server) {
|
server_(server) {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
if (config_->get_hidden()) {
|
||||||
|
::ShowWindow(::GetConsoleWindow(), SW_HIDE);
|
||||||
|
}
|
||||||
|
#endif // defined(_WIN32)
|
||||||
|
|
||||||
|
if (not config_->get_launch_only()) {
|
||||||
|
#if defined(_WIN32)
|
||||||
|
system(
|
||||||
|
fmt::format(
|
||||||
|
R"(start "Repertory Management Portal" "http://127.0.0.1:{}/ui")",
|
||||||
|
config_->get_api_port())
|
||||||
|
.c_str());
|
||||||
|
#elif defined(__linux__)
|
||||||
|
system(fmt::format(R"(xdg-open "http://127.0.0.1:{}/ui")",
|
||||||
|
config_->get_api_port())
|
||||||
|
.c_str());
|
||||||
|
#else // error
|
||||||
|
system(
|
||||||
|
fmt::format(R"(open "http://127.0.0.1:{}/ui")", config_->get_api_port())
|
||||||
|
.c_str());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
std::uint16_t port{};
|
||||||
|
if (not utils::get_next_available_port(config_->get_api_port(), port)) {
|
||||||
|
fmt::println("failed to detect if port is available|{}",
|
||||||
|
config_->get_api_port());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (port != config_->get_api_port()) {
|
||||||
|
fmt::println("failed to listen on port|{}|next available|{}",
|
||||||
|
config_->get_api_port(), port);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
server_->set_socket_options([](auto &&sock) {
|
server_->set_socket_options([](auto &&sock) {
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
int enable{1};
|
int enable{1};
|
||||||
@@ -228,32 +265,6 @@ handlers::handlers(mgmt_app_config *config, httplib::Server *server)
|
|||||||
handle_put_settings(req, res);
|
handle_put_settings(req, res);
|
||||||
});
|
});
|
||||||
|
|
||||||
#if defined(_WIN32)
|
|
||||||
system(fmt::format(
|
|
||||||
R"(start "Repertory Management Portal" "http://127.0.0.1:{}/ui")",
|
|
||||||
config_->get_api_port())
|
|
||||||
.c_str());
|
|
||||||
#elif defined(__linux__)
|
|
||||||
system(fmt::format(R"(xdg-open "http://127.0.0.1:{}/ui")",
|
|
||||||
config_->get_api_port())
|
|
||||||
.c_str());
|
|
||||||
#else // error
|
|
||||||
build fails here
|
|
||||||
#endif
|
|
||||||
|
|
||||||
std::uint16_t port{};
|
|
||||||
if (not utils::get_next_available_port(config_->get_api_port(), port)) {
|
|
||||||
fmt::println("failed to detect if port is available|{}",
|
|
||||||
config_->get_api_port());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (port != config_->get_api_port()) {
|
|
||||||
fmt::println("failed to listen on port|{}|next available|{}",
|
|
||||||
config_->get_api_port(), port);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::atomic<httplib::Server *> this_server{server_};
|
static std::atomic<httplib::Server *> this_server{server_};
|
||||||
static const auto quit_handler = [](int /* sig */) {
|
static const auto quit_handler = [](int /* sig */) {
|
||||||
auto *ptr = this_server.load();
|
auto *ptr = this_server.load();
|
||||||
|
@@ -72,7 +72,8 @@ namespace {
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
namespace repertory::ui {
|
namespace repertory::ui {
|
||||||
mgmt_app_config::mgmt_app_config() {
|
mgmt_app_config::mgmt_app_config(bool hidden, bool launch_only)
|
||||||
|
: hidden_(hidden), launch_only_(launch_only) {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
auto config_file =
|
auto config_file =
|
||||||
@@ -174,6 +175,12 @@ void mgmt_app_config::set_api_user(std::string_view api_user) {
|
|||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mgmt_app_config::set_hidden(bool hidden) { hidden_ = hidden; }
|
||||||
|
|
||||||
|
void mgmt_app_config::set_launch_only(bool launch_only) {
|
||||||
|
launch_only_ = launch_only;
|
||||||
|
}
|
||||||
|
|
||||||
void mgmt_app_config::set_mount_location(provider_type prov,
|
void mgmt_app_config::set_mount_location(provider_type prov,
|
||||||
std::string_view name,
|
std::string_view name,
|
||||||
std::string_view location) {
|
std::string_view location) {
|
||||||
|
@@ -427,15 +427,11 @@ std::string fuse_test<provider_t>::mount_location;
|
|||||||
template <typename provider_t>
|
template <typename provider_t>
|
||||||
std::string fuse_test<provider_t>::mount_location2;
|
std::string fuse_test<provider_t>::mount_location2;
|
||||||
|
|
||||||
#if defined(__linux__)
|
|
||||||
using fuse_provider_types =
|
using fuse_provider_types =
|
||||||
::testing::Types<local_s3, remote_s3, local_sia, remote_sia>;
|
::testing::Types<local_s3, remote_s3, local_sia, remote_sia>;
|
||||||
// using fuse_provider_types =
|
// using fuse_provider_types =
|
||||||
// ::testing::Types<local_s3, remote_s3, local_sia, remote_sia,
|
// ::testing::Types<local_s3, remote_s3, local_sia, remote_sia,
|
||||||
// remote_linux_to_winfsp>;
|
// remote_linux_to_winfsp>;
|
||||||
#else // !defined(__linux__)
|
|
||||||
build fails here
|
|
||||||
#endif // defined(_WIN32)
|
|
||||||
} // namespace repertory
|
} // namespace repertory
|
||||||
|
|
||||||
#endif // !defined(_WIN32)
|
#endif // !defined(_WIN32)
|
||||||
|
@@ -874,6 +874,7 @@ TEST(providers_test, sia_provider) {
|
|||||||
provider_type::sia,
|
provider_type::sia,
|
||||||
utils::path::combine(test::get_test_config_dir(), {"sia"}));
|
utils::path::combine(test::get_test_config_dir(), {"sia"}));
|
||||||
cfg.set_host_config(src_cfg.get_host_config());
|
cfg.set_host_config(src_cfg.get_host_config());
|
||||||
|
cfg.set_sia_config(src_cfg.get_sia_config());
|
||||||
}
|
}
|
||||||
|
|
||||||
curl_comm comm{cfg.get_host_config()};
|
curl_comm comm{cfg.get_host_config()};
|
||||||
|
@@ -62,11 +62,30 @@ if [ "${PROJECT_PRIVATE_KEY}" != "" ] && [ ! -f "./${PROJECT_OUT_FILE}.sig" ]; t
|
|||||||
error_exit "failed to find file: ${PROJECT_OUT_FILE}.sig" 1
|
error_exit "failed to find file: ${PROJECT_OUT_FILE}.sig" 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp -f ./${PROJECT_OUT_FILE} ${DEST_DIR} || error_exit "failed to deliver file: ${PROJECT_OUT_FILE}" 1
|
cp -f ./${PROJECT_OUT_FILE} ${DEST_DIR} ||
|
||||||
cp -f ./${PROJECT_OUT_FILE}.sha256 ${DEST_DIR} || error_exit "failed to deliver file: ${PROJECT_OUT_FILE}.sha256" 1
|
error_exit "failed to deliver file: ${PROJECT_OUT_FILE}" 1
|
||||||
|
|
||||||
|
cp -f ./${PROJECT_OUT_FILE}.sha256 ${DEST_DIR} ||
|
||||||
|
error_exit "failed to deliver file: ${PROJECT_OUT_FILE}.sha256" 1
|
||||||
|
|
||||||
if [ "${PROJECT_PRIVATE_KEY}" != "" ]; then
|
if [ "${PROJECT_PRIVATE_KEY}" != "" ]; then
|
||||||
cp -f ./${PROJECT_OUT_FILE}.sig ${DEST_DIR} || error_exit "failed to deliver file: ${PROJECT_OUT_FILE}.sig" 1
|
cp -f ./${PROJECT_OUT_FILE}.sig ${DEST_DIR} ||
|
||||||
|
error_exit "failed to deliver file: ${PROJECT_OUT_FILE}.sig" 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${PROJECT_IS_MINGW}" == "1" ] && [ -f "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}_setup.exe" ]; then
|
||||||
|
cp -f "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}_setup.exe" ${DEST_DIR} ||
|
||||||
|
error_exit "failed to deliver file: ${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}" 1
|
||||||
|
|
||||||
|
cp -f "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}_setup.exe.sha256" ${DEST_DIR} ||
|
||||||
|
error_exit "failed to deliver file: ${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}.sha256" 1
|
||||||
|
|
||||||
|
if [ "${PROJECT_PRIVATE_KEY}" != "" ]; then
|
||||||
|
cp -f "${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}_setup.exe.sig" ${DEST_DIR} ||
|
||||||
|
error_exit "failed to deliver file: ${PROJECT_DIST_DIR}/${PROJECT_FILE_PART}.sig" 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
error_exit "delivered ${PROJECT_FILE_PART}" 0
|
error_exit "delivered ${PROJECT_FILE_PART}" 0
|
||||||
|
@@ -26,10 +26,16 @@ if [ "${PROJECT_BUILD_ARCH}" == "aarch64" ]; then
|
|||||||
docker build ${APP_VERSION_BUILD_ARGS} \
|
docker build ${APP_VERSION_BUILD_ARGS} \
|
||||||
--platform linux/arm64 \
|
--platform linux/arm64 \
|
||||||
--build-arg NUM_JOBS=${NUM_JOBS} \
|
--build-arg NUM_JOBS=${NUM_JOBS} \
|
||||||
|
--build-arg UID=$(id -u) \
|
||||||
|
--build-arg GID=$(id -g) \
|
||||||
|
--build-arg USERNAME=$(id -un) \
|
||||||
-t ${DOCKER_TAG} . || exit 1
|
-t ${DOCKER_TAG} . || exit 1
|
||||||
else
|
else
|
||||||
docker build ${APP_VERSION_BUILD_ARGS} \
|
docker build ${APP_VERSION_BUILD_ARGS} \
|
||||||
--build-arg NUM_JOBS=${NUM_JOBS} \
|
--build-arg NUM_JOBS=${NUM_JOBS} \
|
||||||
|
--build-arg UID=$(id -u) \
|
||||||
|
--build-arg GID=$(id -g) \
|
||||||
|
--build-arg USERNAME=$(id -un) \
|
||||||
-t ${DOCKER_TAG} . || exit 1
|
-t ${DOCKER_TAG} . || exit 1
|
||||||
fi
|
fi
|
||||||
rm Dockerfile
|
rm Dockerfile
|
||||||
|
@@ -55,6 +55,15 @@ PROJECT_MINGW64_COPY_DEPENDENCIES=()
|
|||||||
PROJECT_MSYS2_PACKAGE_LIST=()
|
PROJECT_MSYS2_PACKAGE_LIST=()
|
||||||
PROJECT_REQUIRE_ALPINE=OFF
|
PROJECT_REQUIRE_ALPINE=OFF
|
||||||
PROJECT_STATIC_LINK=OFF
|
PROJECT_STATIC_LINK=OFF
|
||||||
|
PROJECT_IS_DARWIN=0
|
||||||
|
|
||||||
|
if [ "$(uname -s)" == "Darwin" ]; then
|
||||||
|
PROJECT_IS_DARWIN=1
|
||||||
|
if [ "$(uname -m)" == "arm64" ]; then
|
||||||
|
PROJECT_IS_ARM64=1
|
||||||
|
PROJECT_BUILD_ARCH="aarch64"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${PROJECT_BUILD_ARCH}" == "" ]; then
|
if [ "${PROJECT_BUILD_ARCH}" == "" ]; then
|
||||||
PROJECT_BUILD_ARCH=x86_64
|
PROJECT_BUILD_ARCH=x86_64
|
||||||
@@ -173,7 +182,11 @@ if [ "${PROJECT_STATIC_LINK}" == "ON" ]; then
|
|||||||
PROJECT_BUILD_SHARED_LIBS=OFF
|
PROJECT_BUILD_SHARED_LIBS=OFF
|
||||||
PROJECT_ENABLE_BACKWARD_CPP=OFF
|
PROJECT_ENABLE_BACKWARD_CPP=OFF
|
||||||
PROJECT_LINK_TYPE=static
|
PROJECT_LINK_TYPE=static
|
||||||
|
if [ "${PROJECT_IS_DARWIN}" == "0" ]; then
|
||||||
PROJECT_REQUIRE_ALPINE=ON
|
PROJECT_REQUIRE_ALPINE=ON
|
||||||
|
else
|
||||||
|
PROJECT_REQUIRE_ALPINE=OFF
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
PROJECT_BUILD_SHARED_LIBS=ON
|
PROJECT_BUILD_SHARED_LIBS=ON
|
||||||
PROJECT_LINK_TYPE=shared
|
PROJECT_LINK_TYPE=shared
|
||||||
@@ -186,6 +199,9 @@ PROJECT_DIST_DIR=${PROJECT_SOURCE_DIR}/dist/${PROJECT_CMAKE_BUILD_TYPE_LOWER}/${
|
|||||||
if [ "${PROJECT_IS_MINGW}" == "1" ]; then
|
if [ "${PROJECT_IS_MINGW}" == "1" ]; then
|
||||||
PROJECT_DIST_DIR=${PROJECT_DIST_DIR}/win32
|
PROJECT_DIST_DIR=${PROJECT_DIST_DIR}/win32
|
||||||
PROJECT_BUILD_DIR=${PROJECT_BUILD_DIR}/win32
|
PROJECT_BUILD_DIR=${PROJECT_BUILD_DIR}/win32
|
||||||
|
elif [ "${PROJECT_IS_DARWIN}" == "1" ]; then
|
||||||
|
PROJECT_DIST_DIR=${PROJECT_DIST_DIR}/darwin
|
||||||
|
PROJECT_BUILD_DIR=${PROJECT_BUILD_DIR}/darwin
|
||||||
else
|
else
|
||||||
PROJECT_DIST_DIR=${PROJECT_DIST_DIR}/linux
|
PROJECT_DIST_DIR=${PROJECT_DIST_DIR}/linux
|
||||||
PROJECT_BUILD_DIR=${PROJECT_BUILD_DIR}/linux
|
PROJECT_BUILD_DIR=${PROJECT_BUILD_DIR}/linux
|
||||||
@@ -247,6 +263,7 @@ PROJECT_CMAKE_OPTS="-DPROJECT_EXTERNAL_BUILD_ROOT=${PROJECT_EXTERNAL_BUILD_ROOT}
|
|||||||
PROJECT_CMAKE_OPTS="-DPROJECT_GIT_REV=${PROJECT_GIT_REV} ${PROJECT_CMAKE_OPTS}"
|
PROJECT_CMAKE_OPTS="-DPROJECT_GIT_REV=${PROJECT_GIT_REV} ${PROJECT_CMAKE_OPTS}"
|
||||||
PROJECT_CMAKE_OPTS="-DPROJECT_IS_ALPINE=${PROJECT_IS_ALPINE} ${PROJECT_CMAKE_OPTS}"
|
PROJECT_CMAKE_OPTS="-DPROJECT_IS_ALPINE=${PROJECT_IS_ALPINE} ${PROJECT_CMAKE_OPTS}"
|
||||||
PROJECT_CMAKE_OPTS="-DPROJECT_IS_ARM64=${PROJECT_IS_ARM64} ${PROJECT_CMAKE_OPTS}"
|
PROJECT_CMAKE_OPTS="-DPROJECT_IS_ARM64=${PROJECT_IS_ARM64} ${PROJECT_CMAKE_OPTS}"
|
||||||
|
PROJECT_CMAKE_OPTS="-DPROJECT_IS_DARWIN=${PROJECT_IS_DARWIN} ${PROJECT_CMAKE_OPTS}"
|
||||||
PROJECT_CMAKE_OPTS="-DPROJECT_IS_MINGW=${PROJECT_IS_MINGW} ${PROJECT_CMAKE_OPTS}"
|
PROJECT_CMAKE_OPTS="-DPROJECT_IS_MINGW=${PROJECT_IS_MINGW} ${PROJECT_CMAKE_OPTS}"
|
||||||
PROJECT_CMAKE_OPTS="-DPROJECT_IS_MINGW_UNIX=${PROJECT_IS_MINGW_UNIX} ${PROJECT_CMAKE_OPTS}"
|
PROJECT_CMAKE_OPTS="-DPROJECT_IS_MINGW_UNIX=${PROJECT_IS_MINGW_UNIX} ${PROJECT_CMAKE_OPTS}"
|
||||||
PROJECT_CMAKE_OPTS="-DPROJECT_MAJOR_VERSION=${PROJECT_MAJOR_VERSION} ${PROJECT_CMAKE_OPTS}"
|
PROJECT_CMAKE_OPTS="-DPROJECT_MAJOR_VERSION=${PROJECT_MAJOR_VERSION} ${PROJECT_CMAKE_OPTS}"
|
||||||
@@ -277,6 +294,8 @@ PATH="${PROJECT_EXTERNAL_BUILD_ROOT}/bin:${PATH}"
|
|||||||
|
|
||||||
if [ "${PROJECT_IS_MINGW}" == "1" ]; then
|
if [ "${PROJECT_IS_MINGW}" == "1" ]; then
|
||||||
PROJECT_OS=windows
|
PROJECT_OS=windows
|
||||||
|
elif [ "${PROJECT_IS_DARWIN}" == "1" ]; then
|
||||||
|
PROJECT_OS=darwin
|
||||||
else
|
else
|
||||||
PROJECT_OS=linux
|
PROJECT_OS=linux
|
||||||
fi
|
fi
|
||||||
@@ -292,6 +311,8 @@ if [ "${PROJECT_IS_MINGW}" == "1" ] && [ "${PROJECT_IS_MINGW_UNIX}" != "1" ]; th
|
|||||||
MSYS=winsymlinks:nativestrict
|
MSYS=winsymlinks:nativestrict
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
PROJECT_ENABLE_INNOSETUP=1
|
||||||
|
|
||||||
export MSYS
|
export MSYS
|
||||||
export NUM_JOBS
|
export NUM_JOBS
|
||||||
export OPENSSL_ROOT_DIR
|
export OPENSSL_ROOT_DIR
|
||||||
@@ -319,6 +340,7 @@ export PROJECT_FLUTTER_BASE_HREF
|
|||||||
export PROJECT_GIT_REV
|
export PROJECT_GIT_REV
|
||||||
export PROJECT_IS_ALPINE
|
export PROJECT_IS_ALPINE
|
||||||
export PROJECT_IS_ARM64
|
export PROJECT_IS_ARM64
|
||||||
|
export PROJECT_IS_DARWIN
|
||||||
export PROJECT_IS_MINGW
|
export PROJECT_IS_MINGW
|
||||||
export PROJECT_IS_MINGW_UNIX
|
export PROJECT_IS_MINGW_UNIX
|
||||||
export PROJECT_LINK_TYPE
|
export PROJECT_LINK_TYPE
|
||||||
@@ -371,6 +393,7 @@ echo " File part: ${PROJECT_FILE_PART}"
|
|||||||
echo " Flutter base href: ${PROJECT_FLUTTER_BASE_HREF}"
|
echo " Flutter base href: ${PROJECT_FLUTTER_BASE_HREF}"
|
||||||
echo " Is ARM64: ${PROJECT_IS_ARM64}"
|
echo " Is ARM64: ${PROJECT_IS_ARM64}"
|
||||||
echo " Is Alpine: ${PROJECT_IS_ALPINE}"
|
echo " Is Alpine: ${PROJECT_IS_ALPINE}"
|
||||||
|
echo " Is Darwin: ${PROJECT_IS_DARWIN}"
|
||||||
echo " Is MINGW on Unix: ${PROJECT_IS_MINGW_UNIX}"
|
echo " Is MINGW on Unix: ${PROJECT_IS_MINGW_UNIX}"
|
||||||
echo " Is MINGW: ${PROJECT_IS_MINGW}"
|
echo " Is MINGW: ${PROJECT_IS_MINGW}"
|
||||||
echo " Job count: ${NUM_JOBS}"
|
echo " Job count: ${NUM_JOBS}"
|
||||||
|
@@ -26,6 +26,7 @@ PROJECT_CLEANUP[EXPAT]="3rd_party/mingw64/expat-*"
|
|||||||
PROJECT_CLEANUP[GCC]="3rd_party/mingw64/gcc-*"
|
PROJECT_CLEANUP[GCC]="3rd_party/mingw64/gcc-*"
|
||||||
PROJECT_CLEANUP[ICU]="3rd_party/mingw64/icu-release-*"
|
PROJECT_CLEANUP[ICU]="3rd_party/mingw64/icu-release-*"
|
||||||
PROJECT_CLEANUP[JSON]="3rd_party/json-*"
|
PROJECT_CLEANUP[JSON]="3rd_party/json-*"
|
||||||
|
PROJECT_CLEANUP[INNOSETUP]="3rd_party/mingw64/innosetup-*"
|
||||||
PROJECT_CLEANUP[LIBBITCOIN_SYSTEM_ON]="3rd_party/boost_${PROJECT_VERSIONS[BOOST_MAJOR]}_${PROJECT_VERSIONS[BOOST_MINOR]}_*"
|
PROJECT_CLEANUP[LIBBITCOIN_SYSTEM_ON]="3rd_party/boost_${PROJECT_VERSIONS[BOOST_MAJOR]}_${PROJECT_VERSIONS[BOOST_MINOR]}_*"
|
||||||
PROJECT_CLEANUP[LIBSODIUM]="3rd_party/libsodium-*:3rd_party/libsodium*"
|
PROJECT_CLEANUP[LIBSODIUM]="3rd_party/libsodium-*:3rd_party/libsodium*"
|
||||||
PROJECT_CLEANUP[MINGW]="3rd_party/mingw64/mingw-w64-*"
|
PROJECT_CLEANUP[MINGW]="3rd_party/mingw64/mingw-w64-*"
|
||||||
@@ -52,6 +53,8 @@ PROJECT_DOWNLOADS[GCC]="https://mirrorservice.org/sites/sourceware.org/pub/gcc/r
|
|||||||
PROJECT_DOWNLOADS[GTEST]="https://github.com/google/googletest/archive/refs/tags/v${PROJECT_VERSIONS[GTEST]}.tar.gz;googletest-${PROJECT_VERSIONS[GTEST]}.tar.gz;3rd_party"
|
PROJECT_DOWNLOADS[GTEST]="https://github.com/google/googletest/archive/refs/tags/v${PROJECT_VERSIONS[GTEST]}.tar.gz;googletest-${PROJECT_VERSIONS[GTEST]}.tar.gz;3rd_party"
|
||||||
PROJECT_DOWNLOADS[ICU]="https://github.com/unicode-org/icu/archive/refs/tags/release-${PROJECT_VERSIONS[ICU]}.tar.gz;icu-release-${PROJECT_VERSIONS[ICU]}.tar.gz;3rd_party/mingw64"
|
PROJECT_DOWNLOADS[ICU]="https://github.com/unicode-org/icu/archive/refs/tags/release-${PROJECT_VERSIONS[ICU]}.tar.gz;icu-release-${PROJECT_VERSIONS[ICU]}.tar.gz;3rd_party/mingw64"
|
||||||
PROJECT_DOWNLOADS[JSON]="https://github.com/nlohmann/json/archive/refs/tags/v${PROJECT_VERSIONS[JSON]}.tar.gz;json-${PROJECT_VERSIONS[JSON]}.tar.gz;3rd_party"
|
PROJECT_DOWNLOADS[JSON]="https://github.com/nlohmann/json/archive/refs/tags/v${PROJECT_VERSIONS[JSON]}.tar.gz;json-${PROJECT_VERSIONS[JSON]}.tar.gz;3rd_party"
|
||||||
|
PROJECT_DOWNLOADS[INNOSETUP]="https://files.jrsoftware.org/is/6/innosetup-${PROJECT_VERSIONS[INNOSETUP]}.exe;innosetup-${PROJECT_VERSIONS[INNOSETUP]}.exe;3rd_party/mingw64"
|
||||||
|
PROJECT_DOWNLOADS[WINFSP]="https://github.com/winfsp/winfsp/releases/download/v${PROJECT_VERSIONS[WINFSP2]}/winfsp-${PROJECT_VERSIONS[WINFSP]}.msi;winfsp-${PROJECT_VERSIONS[WINFSP]}.msi;3rd_party"
|
||||||
PROJECT_DOWNLOADS[LIBSODIUM]="https://github.com/jedisct1/libsodium/archive/refs/tags/${PROJECT_VERSIONS[LIBSODIUM]}-RELEASE.tar.gz;libsodium-${PROJECT_VERSIONS[LIBSODIUM]}.tar.gz;3rd_party"
|
PROJECT_DOWNLOADS[LIBSODIUM]="https://github.com/jedisct1/libsodium/archive/refs/tags/${PROJECT_VERSIONS[LIBSODIUM]}-RELEASE.tar.gz;libsodium-${PROJECT_VERSIONS[LIBSODIUM]}.tar.gz;3rd_party"
|
||||||
PROJECT_DOWNLOADS[MINGW]="https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/mingw-w64-v${PROJECT_VERSIONS[MINGW]}.tar.bz2;;mingw-w64-v${PROJECT_VERSIONS[MINGW]}.tar.bz2;3rd_party/mingw64"
|
PROJECT_DOWNLOADS[MINGW]="https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/mingw-w64-v${PROJECT_VERSIONS[MINGW]}.tar.bz2;;mingw-w64-v${PROJECT_VERSIONS[MINGW]}.tar.bz2;3rd_party/mingw64"
|
||||||
PROJECT_DOWNLOADS[OPENSSL]="https://github.com/openssl/openssl/releases/download/openssl-${PROJECT_VERSIONS[OPENSSL]}/openssl-${PROJECT_VERSIONS[OPENSSL]}.tar.gz;openssl-${PROJECT_VERSIONS[OPENSSL]}.tar.gz;3rd_party"
|
PROJECT_DOWNLOADS[OPENSSL]="https://github.com/openssl/openssl/releases/download/openssl-${PROJECT_VERSIONS[OPENSSL]}/openssl-${PROJECT_VERSIONS[OPENSSL]}.tar.gz;openssl-${PROJECT_VERSIONS[OPENSSL]}.tar.gz;3rd_party"
|
||||||
|
@@ -43,6 +43,10 @@ make -j${CMAKE_BUILD_PARALLEL_LEVEL} || exit 1
|
|||||||
popd
|
popd
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
if [ -f "${PROJECT_SOURCE_DIR}/LICENSE.md" ]; then
|
||||||
|
rsync -av --progress "${PROJECT_SOURCE_DIR}/LICENSE.md" "${PROJECT_DIST_DIR}/"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${PROJECT_IS_MINGW}" != "1" ] && [ "${PROJECT_REQUIRE_ALPINE}" == "ON" ]; then
|
if [ "${PROJECT_IS_MINGW}" != "1" ] && [ "${PROJECT_REQUIRE_ALPINE}" == "ON" ]; then
|
||||||
rsync -av --progress /usr/share/icu/74.2/ "${PROJECT_DIST_DIR}/icu/"
|
rsync -av --progress /usr/share/icu/74.2/ "${PROJECT_DIST_DIR}/icu/"
|
||||||
fi
|
fi
|
||||||
|
@@ -5,7 +5,7 @@ PROJECT_SCRIPTS_DIR=$(dirname "${PROJECT_SCRIPTS_DIR}")
|
|||||||
. "${PROJECT_SCRIPTS_DIR}/env.sh" "$1" "$2" "$3" "$4" "$5"
|
. "${PROJECT_SCRIPTS_DIR}/env.sh" "$1" "$2" "$3" "$4" "$5"
|
||||||
|
|
||||||
if [ -f "${PROJECT_SOURCE_DIR}/web/${PROJECT_NAME}/pubspec.yaml" ]; then
|
if [ -f "${PROJECT_SOURCE_DIR}/web/${PROJECT_NAME}/pubspec.yaml" ]; then
|
||||||
if [ "${PROJECT_IS_MINGW}" == "0" ] || [ "${PROJECT_IS_MINGW_UNIX}" == "1" ]; then
|
if [[ "${PROJECT_IS_DARWIN}" == "0" && ("${PROJECT_IS_MINGW}" == "0" || "${PROJECT_IS_MINGW_UNIX}" == "1") ]]; then
|
||||||
FLUTTER_CONTAINER_NAME="${PROJECT_NAME}_flutter"
|
FLUTTER_CONTAINER_NAME="${PROJECT_NAME}_flutter"
|
||||||
FLUTTER_TAG_NAME="${PROJECT_NAME}:flutter"
|
FLUTTER_TAG_NAME="${PROJECT_NAME}:flutter"
|
||||||
|
|
||||||
|
@@ -35,6 +35,16 @@ fi
|
|||||||
if [ -f "${PROJECT_OUT_FILE}.sig" ]; then
|
if [ -f "${PROJECT_OUT_FILE}.sig" ]; then
|
||||||
rm -f "${PROJECT_OUT_FILE}.sig" || error_exit "failed to delete file: ${PROJECT_OUT_FILE}.sig" 1
|
rm -f "${PROJECT_OUT_FILE}.sig" || error_exit "failed to delete file: ${PROJECT_OUT_FILE}.sig" 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f "${PROJECT_FILE_PART}_setup.exe" ]; then
|
||||||
|
rm -f "${PROJECT_FILE_PART}_setup.exe" || error_exit "failed to delete file: ${PROJECT_FILE_PART}_setup.exe" 1
|
||||||
|
fi
|
||||||
|
if [ -f "${PROJECT_FILE_PART}_setup.exe.sha256" ]; then
|
||||||
|
rm -f "${PROJECT_FILE_PART}_setup.exe.sha256" || error_exit "failed to delete file: ${PROJECT_FILE_PART}_setup.exe.sha256" 1
|
||||||
|
fi
|
||||||
|
if [ -f "${PROJECT_FILE_PART}_setup.exe.sig" ]; then
|
||||||
|
rm -f "${PROJECT_FILE_PART}_setup.exe.sig" || error_exit "failed to delete file: ${PROJECT_FILE_PART}_setup.exe.sig" 1
|
||||||
|
fi
|
||||||
popd
|
popd
|
||||||
|
|
||||||
rsync -av --progress ${PROJECT_DIST_DIR}/ ${TEMP_DIR}/${PROJECT_NAME}/ || error_exit "failed to rsync" 1
|
rsync -av --progress ${PROJECT_DIST_DIR}/ ${TEMP_DIR}/${PROJECT_NAME}/ || error_exit "failed to rsync" 1
|
||||||
@@ -63,4 +73,23 @@ tar cvzf "${PROJECT_OUT_FILE}" -C ${TEMP_DIR} . || error_exit "failed to create
|
|||||||
create_file_validations "${PROJECT_OUT_FILE}"
|
create_file_validations "${PROJECT_OUT_FILE}"
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
if [ "${PROJECT_IS_MINGW}" == "1" ] && [ -f "${PROJECT_DIST_DIR}/../${PROJECT_NAME}.iss" ]; then
|
||||||
|
cp -f "${PROJECT_DIST_DIR}/../${PROJECT_NAME}.iss" "${TEMP_DIR}/${PROJECT_NAME}.iss"
|
||||||
|
rsync -av --progress --delete ${PROJECT_SOURCE_DIR}/support/3rd_party/*.msi ${TEMP_DIR}/3rd_party/
|
||||||
|
|
||||||
|
pushd "${TEMP_DIR}"
|
||||||
|
if [ "${PROJECT_IS_MINGW_UNIX}" == "1" ]; then
|
||||||
|
wine64 "c:/Program Files (x86)/Inno Setup 6/iscc.exe" "${PROJECT_NAME}.iss" || exit 1
|
||||||
|
else
|
||||||
|
iscc "${PROJECT_NAME}.iss" || exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
pushd "Output"
|
||||||
|
create_file_validations "${PROJECT_FILE_PART}_setup.exe"
|
||||||
|
cp -f * "${PROJECT_DIST_DIR}/"
|
||||||
|
popd
|
||||||
|
|
||||||
|
popd
|
||||||
|
fi
|
||||||
|
|
||||||
error_exit "created package ${PROJECT_FILE_PART}" 0
|
error_exit "created package ${PROJECT_FILE_PART}" 0
|
||||||
|
@@ -11,7 +11,7 @@ fi
|
|||||||
|
|
||||||
"${PROJECT_SOURCE_DIR}/scripts/make_flutter.sh" "${PROJECT_BUILD_ARCH}" "${PROJECT_CMAKE_BUILD_TYPE}" "${PROJECT_BUILD_CLEAN}" 0 0 || exit 1
|
"${PROJECT_SOURCE_DIR}/scripts/make_flutter.sh" "${PROJECT_BUILD_ARCH}" "${PROJECT_CMAKE_BUILD_TYPE}" "${PROJECT_BUILD_CLEAN}" 0 0 || exit 1
|
||||||
|
|
||||||
if [ "${PROJECT_REQUIRE_ALPINE}" == "ON" ] || [ "${PROJECT_IS_ARM64}" == "1" ]; then
|
if [[ "${PROJECT_IS_DARWIN}" == "0" && ("${PROJECT_REQUIRE_ALPINE}" == "ON" || "${PROJECT_IS_ARM64}" == "1") ]]; then
|
||||||
DOCKER_NAME=alpine
|
DOCKER_NAME=alpine
|
||||||
DOCKER_CONTAINER=${PROJECT_NAME}_${DOCKER_NAME}_${PROJECT_BUILD_ARCH}
|
DOCKER_CONTAINER=${PROJECT_NAME}_${DOCKER_NAME}_${PROJECT_BUILD_ARCH}
|
||||||
DOCKER_TAG=${PROJECT_NAME}:${DOCKER_NAME}
|
DOCKER_TAG=${PROJECT_NAME}:${DOCKER_NAME}
|
||||||
|
@@ -16,6 +16,7 @@ PROJECT_VERSIONS[EXPAT2]="2_7_1"
|
|||||||
PROJECT_VERSIONS[GCC]="15.1.0"
|
PROJECT_VERSIONS[GCC]="15.1.0"
|
||||||
PROJECT_VERSIONS[GTEST]="1.17.0"
|
PROJECT_VERSIONS[GTEST]="1.17.0"
|
||||||
PROJECT_VERSIONS[ICU]="76-1"
|
PROJECT_VERSIONS[ICU]="76-1"
|
||||||
|
PROJECT_VERSIONS[INNOSETUP]="6.4.3"
|
||||||
PROJECT_VERSIONS[JSON]="3.12.0"
|
PROJECT_VERSIONS[JSON]="3.12.0"
|
||||||
PROJECT_VERSIONS[LIBSODIUM]="1.0.20"
|
PROJECT_VERSIONS[LIBSODIUM]="1.0.20"
|
||||||
PROJECT_VERSIONS[MINGW]="13.0.0"
|
PROJECT_VERSIONS[MINGW]="13.0.0"
|
||||||
@@ -27,5 +28,7 @@ PROJECT_VERSIONS[SPDLOG]="1.15.3"
|
|||||||
PROJECT_VERSIONS[SQLITE]="3500300"
|
PROJECT_VERSIONS[SQLITE]="3500300"
|
||||||
PROJECT_VERSIONS[SQLITE2]="3.50.3"
|
PROJECT_VERSIONS[SQLITE2]="3.50.3"
|
||||||
PROJECT_VERSIONS[STDUUID]="1.2.3"
|
PROJECT_VERSIONS[STDUUID]="1.2.3"
|
||||||
|
PROJECT_VERSIONS[WINFSP]="2.1.25156"
|
||||||
|
PROJECT_VERSIONS[WINFSP2]="2.1"
|
||||||
PROJECT_VERSIONS[ZLIB]="1.3.1"
|
PROJECT_VERSIONS[ZLIB]="1.3.1"
|
||||||
export PROJECT_VERSIONS
|
export PROJECT_VERSIONS
|
||||||
|
2
support/3rd_party/json-3.12.0.tar.gz.sha256
vendored
2
support/3rd_party/json-3.12.0.tar.gz.sha256
vendored
@@ -1 +1 @@
|
|||||||
4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187 json-3.12.0.tar.gz
|
4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187 *json-3.12.0.tar.gz
|
||||||
|
BIN
support/3rd_party/mingw64/innosetup-6.4.3.exe
vendored
Normal file
BIN
support/3rd_party/mingw64/innosetup-6.4.3.exe
vendored
Normal file
Binary file not shown.
1
support/3rd_party/mingw64/innosetup-6.4.3.exe.sha256
vendored
Normal file
1
support/3rd_party/mingw64/innosetup-6.4.3.exe.sha256
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
f3c42116542c4cc57263c5ba6c4feabfc49fe771f2f98a79d2f7628b8762723b *innosetup-6.4.3.exe
|
BIN
support/3rd_party/winfsp-2.1.25156.msi
(Stored with Git LFS)
vendored
Normal file
BIN
support/3rd_party/winfsp-2.1.25156.msi
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
1
support/3rd_party/winfsp-2.1.25156.msi.sha256
vendored
Normal file
1
support/3rd_party/winfsp-2.1.25156.msi.sha256
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
073a70e00f77423e34bed98b86e600def93393ba5822204fac57a29324db9f7a *winfsp-2.1.25156.msi
|
@@ -55,7 +55,8 @@ auto change_to_process_directory() -> bool {
|
|||||||
std::string path;
|
std::string path;
|
||||||
path.resize(PATH_MAX + 1);
|
path.resize(PATH_MAX + 1);
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
proc_pidpath(getpid(), path.c_str(), path.size());
|
auto res =proc_pidpath(getpid(), reinterpret_cast<void *>(path.data()),
|
||||||
|
static_cast<uint32_t>(path.size()));
|
||||||
#else // !defined(__APPLE__)
|
#else // !defined(__APPLE__)
|
||||||
auto res = readlink("/proc/self/exe", path.data(), path.size());
|
auto res = readlink("/proc/self/exe", path.data(), path.size());
|
||||||
if (res == -1) {
|
if (res == -1) {
|
||||||
@@ -148,7 +149,7 @@ auto get_free_drive_space(std::string_view path)
|
|||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
struct statvfs st{};
|
struct statvfs st{};
|
||||||
if (statvfs(path.c_str(), &st) != 0) {
|
if (statvfs(std::string{path}.c_str(), &st) != 0) {
|
||||||
throw utils::error::create_exception(
|
throw utils::error::create_exception(
|
||||||
function_name, {
|
function_name, {
|
||||||
"failed to get free disk space",
|
"failed to get free disk space",
|
||||||
@@ -240,6 +241,20 @@ auto get_times(std::string_view path) -> std::optional<file_times> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
ret.accessed = static_cast<std::uint64_t>(st.st_atimespec.tv_nsec) +
|
||||||
|
static_cast<std::uint64_t>(st.st_atimespec.tv_sec) *
|
||||||
|
utils::time::NANOS_PER_SECOND;
|
||||||
|
ret.created = static_cast<std::uint64_t>(st.st_ctimespec.tv_nsec) +
|
||||||
|
static_cast<std::uint64_t>(st.st_ctimespec.tv_sec) *
|
||||||
|
utils::time::NANOS_PER_SECOND;
|
||||||
|
ret.modified = static_cast<std::uint64_t>(st.st_mtimespec.tv_nsec) +
|
||||||
|
static_cast<std::uint64_t>(st.st_mtimespec.tv_sec) *
|
||||||
|
utils::time::NANOS_PER_SECOND;
|
||||||
|
ret.written = static_cast<std::uint64_t>(st.st_mtimespec.tv_nsec) +
|
||||||
|
static_cast<std::uint64_t>(st.st_mtimespec.tv_sec) *
|
||||||
|
utils::time::NANOS_PER_SECOND;
|
||||||
|
#else // !defined(__APPLE__)
|
||||||
ret.accessed = static_cast<std::uint64_t>(st.st_atim.tv_nsec) +
|
ret.accessed = static_cast<std::uint64_t>(st.st_atim.tv_nsec) +
|
||||||
static_cast<std::uint64_t>(st.st_atim.tv_sec) *
|
static_cast<std::uint64_t>(st.st_atim.tv_sec) *
|
||||||
utils::time::NANOS_PER_SECOND;
|
utils::time::NANOS_PER_SECOND;
|
||||||
@@ -252,7 +267,7 @@ auto get_times(std::string_view path) -> std::optional<file_times> {
|
|||||||
ret.written = static_cast<std::uint64_t>(st.st_mtim.tv_nsec) +
|
ret.written = static_cast<std::uint64_t>(st.st_mtim.tv_nsec) +
|
||||||
static_cast<std::uint64_t>(st.st_mtim.tv_sec) *
|
static_cast<std::uint64_t>(st.st_mtim.tv_sec) *
|
||||||
utils::time::NANOS_PER_SECOND;
|
utils::time::NANOS_PER_SECOND;
|
||||||
|
#endif // defined(__APPLE__)
|
||||||
#endif // defined(_WIN32)
|
#endif // defined(_WIN32)
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@@ -305,7 +320,7 @@ auto get_total_drive_space(std::string_view path)
|
|||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
struct statvfs st{};
|
struct statvfs st{};
|
||||||
if (statvfs(path.c_str(), &st) != 0) {
|
if (statvfs(std::string{path}.c_str(), &st) != 0) {
|
||||||
throw utils::error::create_exception(
|
throw utils::error::create_exception(
|
||||||
function_name, {
|
function_name, {
|
||||||
"failed to get total disk space",
|
"failed to get total disk space",
|
||||||
@@ -498,8 +513,7 @@ auto write_json_file(std::wstring_view path, const nlohmann::json &data)
|
|||||||
#endif // defined(PROJECT_ENABLE_JSON)
|
#endif // defined(PROJECT_ENABLE_JSON)
|
||||||
|
|
||||||
#if defined(PROJECT_ENABLE_LIBDSM)
|
#if defined(PROJECT_ENABLE_LIBDSM)
|
||||||
static constexpr auto validate_smb_path =
|
static constexpr auto validate_smb_path = [](std::string_view path) -> bool {
|
||||||
[](std::string_view path) -> bool {
|
|
||||||
return (not utils::string::begins_with(path, "///") &&
|
return (not utils::string::begins_with(path, "///") &&
|
||||||
utils::string::begins_with(path, "//") &&
|
utils::string::begins_with(path, "//") &&
|
||||||
// not utils::string::contains(path, " ") &&
|
// not utils::string::contains(path, " ") &&
|
||||||
|
@@ -25,11 +25,15 @@
|
|||||||
#include "utils/collection.hpp"
|
#include "utils/collection.hpp"
|
||||||
|
|
||||||
namespace repertory::utils {
|
namespace repertory::utils {
|
||||||
#if !defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
|
auto convert_to_uint64(pthread_t thread) -> std::uint64_t {
|
||||||
|
return reinterpret_cast<std::uintptr_t>(thread);
|
||||||
|
}
|
||||||
|
#else // defined(__APPLE__)
|
||||||
auto convert_to_uint64(const pthread_t &thread) -> std::uint64_t {
|
auto convert_to_uint64(const pthread_t &thread) -> std::uint64_t {
|
||||||
return static_cast<std::uint64_t>(thread);
|
return static_cast<std::uint64_t>(thread);
|
||||||
}
|
}
|
||||||
#endif // !defined(__APPLE__)
|
#endif // defined(__APPLE__)
|
||||||
|
|
||||||
auto get_last_error_code() -> int { return errno; }
|
auto get_last_error_code() -> int { return errno; }
|
||||||
|
|
||||||
|
@@ -100,7 +100,7 @@ Map<String, dynamic> createDefaultSettings(String mountType) {
|
|||||||
'ApiPort': 9980,
|
'ApiPort': 9980,
|
||||||
'HostNameOrIp': 'localhost',
|
'HostNameOrIp': 'localhost',
|
||||||
},
|
},
|
||||||
'SiaConfig': {'Bucket': 'default'},
|
'SiaConfig': {'Bucket': ''},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -212,7 +212,7 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
|||||||
if (_mountType == 'Remote') {
|
if (_mountType == 'Remote') {
|
||||||
_mountNameController.text = 'remote';
|
_mountNameController.text = 'remote';
|
||||||
} else if (changed) {
|
} else if (changed) {
|
||||||
_mountNameController.text = mountType == 'Sia' ? 'default' : '';
|
_mountNameController.text = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
_mount = (_mountNameController.text.isEmpty)
|
_mount = (_mountNameController.text.isEmpty)
|
||||||
|
@@ -50,7 +50,7 @@ dev_dependencies:
|
|||||||
# activated in the `analysis_options.yaml` file located at the root of your
|
# activated in the `analysis_options.yaml` file located at the root of your
|
||||||
# package. See that file for information about deactivating specific lint
|
# package. See that file for information about deactivating specific lint
|
||||||
# rules and activating additional ones.
|
# rules and activating additional ones.
|
||||||
flutter_lints: ^5.0.0
|
flutter_lints: ^6.0.0
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
Reference in New Issue
Block a user