Compare commits
192 Commits
v2.0.3-rc
...
47f5b82b4e
Author | SHA1 | Date | |
---|---|---|---|
47f5b82b4e | |||
ebee5ec857 | |||
bfe7b8915d | |||
8547fb7d43 | |||
4f2ff33226 | |||
600b658109 | |||
374eb67f6b | |||
7848dcebe4 | |||
a34443ed94 | |||
ff985e724d | |||
1ee478ca71 | |||
807a6e90f8 | |||
694d4d4662 | |||
ebdc4877a8 | |||
993356dec6 | |||
dea69815ef | |||
5da7b6a51a | |||
ad5a1cd5ff | |||
33e9208190 | |||
3d25364540 | |||
b00d219f34 | |||
f1a0b6add1 | |||
3b4767290b | |||
eb26f59059 | |||
efcb319d8c | |||
52e7f675fc | |||
78e9c95054 | |||
8fa3ccf97c | |||
1311d665b5 | |||
62e45894b8 | |||
094aec0afb | |||
3b46a48078 | |||
8c53a07d64 | |||
03485935b7 | |||
4b3582cbb0 | |||
8272ec2f8a | |||
7309ca477a | |||
e8ef11cef4 | |||
80b77daa8a | |||
cb75efd96f | |||
631a1bc914 | |||
5064ec3f9a | |||
7c072f98dd | |||
d732bfb224 | |||
4241adb4d3 | |||
e1c35624f6 | |||
9b75618fb3 | |||
6464c01d8b | |||
58db36d628 | |||
f39c6550f2 | |||
400c97cebd | |||
a2ad258b7c | |||
c4b4fe83fb | |||
262fccf9a6 | |||
50898488f0 | |||
1acb3311b1 | |||
3fd3f85cc9 | |||
cbbd586347 | |||
57a591c51e | |||
29fb395758 | |||
b3f87e2828 | |||
7e06f810ea | |||
02e568b77a | |||
8b2bafc9f3 | |||
97e5f17049 | |||
124dc62250 | |||
5da4d4e940 | |||
b507643d23 | |||
1e25fb57f1 | |||
4d8e59f97f | |||
881778e485 | |||
3efb2b817f | |||
21d02534e5 | |||
1b11e500f3 | |||
f57bbdbb50 | |||
1c65f51ef4 | |||
f44bb6bcfc | |||
57d9884510 | |||
5da036e979 | |||
daa8b9df24 | |||
fe2a1b96b2 | |||
be678e8f9c | |||
b5ae3e4ed1 | |||
89a2d5866a | |||
5264d17ae8 | |||
1718464c60 | |||
85756ddd8c | |||
e8240948b7 | |||
77088e6608 | |||
ddbebef850 | |||
7cf636b8ed | |||
754dfc49db | |||
63b2d0e741 | |||
96ac72ae21 | |||
0bbf6b5942 | |||
74ef36956d | |||
bbe065819c | |||
3493054f1a | |||
743281497c | |||
eaa6a6f92e | |||
a25dd8178e | |||
71463bfee4 | |||
270df62dbe | |||
5bd7ded7d9 | |||
b5048a422f | |||
c27528fe73 | |||
c3978562d5 | |||
637892cff1 | |||
998a3d9d83 | |||
8ed8822625 | |||
196abaebcc | |||
653e8000ff | |||
ea362211aa | |||
a4a9d069d3 | |||
9cb7f9accf | |||
4e5454efb5 | |||
a8c3f31298 | |||
f3093c27cd | |||
4526a9d860 | |||
a1ada5aa8c | |||
1ae8b8b793 | |||
f44cc99a82 | |||
75657bec58 | |||
4fef036f10 | |||
ecb9783f4e | |||
bdf85908ca | |||
9cb3cdabb0 | |||
6cf082dfa7 | |||
1a140d4dfd | |||
1cc8571a04 | |||
cf8c631938 | |||
4cba2a16f9 | |||
7c5f074d5a | |||
a251cf6abf | |||
31f7a47889 | |||
23de2af98d | |||
2446f024ef | |||
45ddd528b2 | |||
36908f7da9 | |||
1a11d55782 | |||
e344eddbcb | |||
09da7a29a9 | |||
5b5ac0937c | |||
c69818fed6 | |||
81712e7a99 | |||
75d2d39e7c | |||
ccc4a30ad5 | |||
a9bb12015a | |||
474f90ee33 | |||
ae7d5fe284 | |||
bf700b9d59 | |||
0d4b3f5e7e | |||
67076458f0 | |||
a8479eefd1 | |||
e1eda99a72 | |||
ed4a4f0742 | |||
84e89d3b83 | |||
5e3efde376 | |||
f28e17f3e5 | |||
699ecafc22 | |||
247cc301ea | |||
bc43338127 | |||
4e86f2a7de | |||
b9fe2746e3 | |||
4fe9d09f0a | |||
777db300e1 | |||
62a303e856 | |||
ae573af89d | |||
0c41a3309e | |||
4cb3e22308 | |||
9d7d36922f | |||
3190c5f133 | |||
5fadb796d1 | |||
4a213e5ca5 | |||
9fea962563 | |||
ac6c333df3 | |||
4bbff47b6f | |||
f01daa4296 | |||
96c2f8ee1e | |||
9eb3e7a22d | |||
3c2c783683 | |||
2e24f9bb44 | |||
6bb3351cb8 | |||
6086a0ea12 | |||
b4b688d3b9 | |||
43bf3c0cb2 | |||
26897c256b | |||
a788563db6 | |||
9fb1c747a6 | |||
5982978879 | |||
5ca4584416 | |||
3eca1af971 |
@ -128,7 +128,6 @@ libcurl
|
|||||||
libdsm
|
libdsm
|
||||||
libevent
|
libevent
|
||||||
libexample
|
libexample
|
||||||
libexpat
|
|
||||||
libfuse3
|
libfuse3
|
||||||
libgmock
|
libgmock
|
||||||
libgtest
|
libgtest
|
||||||
@ -141,12 +140,10 @@ libuuid
|
|||||||
libuuid_include_dirs
|
libuuid_include_dirs
|
||||||
libvlc
|
libvlc
|
||||||
linkflags
|
linkflags
|
||||||
localappdata
|
|
||||||
lptr
|
lptr
|
||||||
lpwstr
|
lpwstr
|
||||||
markdownlint
|
markdownlint
|
||||||
mbig
|
mbig
|
||||||
minio
|
|
||||||
msvc
|
msvc
|
||||||
msvcr120
|
msvcr120
|
||||||
msys2
|
msys2
|
||||||
@ -203,7 +200,6 @@ stduuid_project
|
|||||||
strequal
|
strequal
|
||||||
ularge_integer
|
ularge_integer
|
||||||
uring
|
uring
|
||||||
url
|
|
||||||
userenv
|
userenv
|
||||||
utimens_impl
|
utimens_impl
|
||||||
utimensat
|
utimensat
|
||||||
|
@ -4,6 +4,10 @@
|
|||||||
|
|
||||||
### Issues
|
### Issues
|
||||||
|
|
||||||
|
* ~~\#12 \[Unit Test\] Complete all providers unit tests~~
|
||||||
|
* ~~\#20 Add support to evict open files~~
|
||||||
|
* ~~\#21 \[Unit Test \] Complete WinFSP unit tests~~
|
||||||
|
* ~~\#22 \[Unit Test\] Complete FUSE unit tests~~
|
||||||
* \#28 \[bug\] Address slow directory responses in S3 mounts for deeply nested directories
|
* \#28 \[bug\] Address slow directory responses in S3 mounts for deeply nested directories
|
||||||
* \#29 \[bug\] S3 error responses are not being logged
|
* \#29 \[bug\] S3 error responses are not being logged
|
||||||
* \#30 \[bug\] Sia provider error responses are not logged
|
* \#30 \[bug\] Sia provider error responses are not logged
|
||||||
@ -12,7 +16,6 @@
|
|||||||
### Changes from v2.0.2-rc
|
### Changes from v2.0.2-rc
|
||||||
|
|
||||||
* Always use direct for read-only providers
|
* Always use direct for read-only providers
|
||||||
* Fixed externally removed files not being processed during cleanup
|
|
||||||
* Fixed http headers not being added for requests
|
* Fixed http headers not being added for requests
|
||||||
* Fixed incorrect `stat` values for remote mounts
|
* Fixed incorrect `stat` values for remote mounts
|
||||||
* Fixed invalid directory nullptr error on remote mounts
|
* Fixed invalid directory nullptr error on remote mounts
|
||||||
|
@ -3,10 +3,6 @@ cmake_minimum_required(VERSION 3.27)
|
|||||||
cmake_policy(SET CMP0135 NEW)
|
cmake_policy(SET CMP0135 NEW)
|
||||||
cmake_policy(SET CMP0144 NEW)
|
cmake_policy(SET CMP0144 NEW)
|
||||||
|
|
||||||
if (NOT PROJECT_INTERFACE)
|
|
||||||
message(FATAL_ERROR "Project must be compiled via 'make_win32.cmd'/'make_win32.sh' or 'make_unix.sh' build scripts. Invoking 'cmake' directly is not supported.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
project(${PROJECT_NAME}
|
project(${PROJECT_NAME}
|
||||||
DESCRIPTION ${PROJECT_DESC}
|
DESCRIPTION ${PROJECT_DESC}
|
||||||
HOMEPAGE_URL ${PROJECT_URL}
|
HOMEPAGE_URL ${PROJECT_URL}
|
||||||
@ -162,7 +158,6 @@ endif()
|
|||||||
-DPROJECT_FUSE=${PROJECT_FUSE}
|
-DPROJECT_FUSE=${PROJECT_FUSE}
|
||||||
-DPROJECT_FUSE_INCLUDE_DIRS=${PROJECT_FUSE_INCLUDE_DIRS}
|
-DPROJECT_FUSE_INCLUDE_DIRS=${PROJECT_FUSE_INCLUDE_DIRS}
|
||||||
-DPROJECT_GIT_REV=${PROJECT_GIT_REV}
|
-DPROJECT_GIT_REV=${PROJECT_GIT_REV}
|
||||||
-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_MINGW=${PROJECT_IS_MINGW}
|
-DPROJECT_IS_MINGW=${PROJECT_IS_MINGW}
|
||||||
|
126
README.md
126
README.md
@ -1,22 +1,23 @@
|
|||||||
# Repertory
|
# Repertory
|
||||||
|
|
||||||
Repertory allows you to mount S3 and Sia via FUSE on Linux or via WinFSP
|
Repertory allows you to mount AWS S3 and Sia via FUSE on Linux ~~/OS X~~ or via WinFSP
|
||||||
on Windows.
|
on Windows.
|
||||||
|
|
||||||
## Details and Features
|
## Details and Features
|
||||||
|
|
||||||
* Optimized for [Plex Media Server](https://www.plex.tv/)
|
* Optimized for [Plex Media Server](https://www.plex.tv/)
|
||||||
* Single application to mount S3 and/or Sia
|
* Single application to mount AWS S3 and/or Sia
|
||||||
* Remote mounting of Repertory instances on Linux and Windows
|
* Remote mounting of Repertory instances on Linux ~~, OS X~~ and Windows
|
||||||
* Securely share your mounts over TCP/IP via `XChaCha20-Poly1305` with other systems on your network or over the internet.
|
* Securely share your mounts over TCP/IP (`XChaCha20-Poly1305` stream cipher)
|
||||||
* Cross-platform support (Linux 64-bit, Linux arm64/aarch64, Windows 64-bit)
|
* Cross-platform support (Linux 64-bit, Linux arm64/aarch64, ~~OS X,~~ Windows 64-bit)
|
||||||
* Optionally encrypt file names and file data via `XChaCha20-Poly1305` in S3 mounts
|
|
||||||
|
|
||||||
## Minimum Requirements
|
## Minimum Requirements
|
||||||
|
|
||||||
* [Sia renterd](https://github.com/SiaFoundation/renterd/releases) v0.4.0+ for Sia support
|
* [Sia renterd](https://github.com/SiaFoundation/renterd/releases) v0.4.0+ for Sia support
|
||||||
* Only 64-bit operating systems are supported
|
* Only 64-bit operating systems are supported
|
||||||
* By default, Linux requires `fusermount3`; otherwise, `repertory` must be manually compiled with `libfuse2` support
|
* By default, Linux requires `fusermount3`; otherwise, `repertory` must be manually compiled with `libfuse2` support
|
||||||
|
* ~~OS X requires the following dependency to be installed:~~
|
||||||
|
* ~~[FUSE for macOS v4.5.0](https://github.com/osxfuse/osxfuse/releases/download/macfuse-4.5.0/macfuse-4.5.0.dmg)~~
|
||||||
* Windows requires the following dependencies to be installed:
|
* Windows requires the following dependencies to be installed:
|
||||||
* [WinFSP 2023](https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-2.0.23075.msi)
|
* [WinFSP 2023](https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-2.0.23075.msi)
|
||||||
|
|
||||||
@ -24,103 +25,47 @@ on Windows.
|
|||||||
|
|
||||||
* Linux `arm64/aarch64`
|
* Linux `arm64/aarch64`
|
||||||
* Linux `amd64`
|
* Linux `amd64`
|
||||||
|
* ~~OS X Mojave and above~~
|
||||||
* Windows 64-bit 10, 11
|
* Windows 64-bit 10, 11
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Sia
|
|
||||||
|
|
||||||
* Initial Configuration
|
|
||||||
* Sia steps:
|
|
||||||
* Set the appropriate bucket name and `renterd` API password in `repertory` configuration:
|
|
||||||
* To use `default` as the bucket name and configuration name:
|
|
||||||
* `repertory -set HostConfig.ApiPassword '<my password>'`
|
|
||||||
* To use a different bucket name with `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 SiaConfig.Bucket '<my bucket name>'`
|
|
||||||
* To verify/view all configuration options:
|
|
||||||
* `repertory -dc`
|
|
||||||
* `repertory --name '<my config name>' -dc`
|
|
||||||
* Example:
|
|
||||||
* `repertory --name default -dc`
|
|
||||||
* Mounting on Linux:
|
|
||||||
* `repertory /mnt/location`
|
|
||||||
* `repertory --name '<my config name>' /mnt/location`
|
|
||||||
* Example:
|
|
||||||
* `repertory --name default /mnt/location`
|
|
||||||
* Mounting on Windows:
|
|
||||||
* `repertory t:`
|
|
||||||
* `repertory --name '<my config name>' t:`
|
|
||||||
* Example:
|
|
||||||
* `repertory --name default t:`
|
|
||||||
|
|
||||||
### S3
|
|
||||||
|
|
||||||
* Initial Configuration
|
|
||||||
* S3 steps:
|
|
||||||
* Set the appropriate base URL:
|
|
||||||
* `repertory -s3 --name '<my config name>' -set S3Config.URL '<my url>'`
|
|
||||||
* Example:
|
|
||||||
* `repertory -s3 --name minio -set S3Config.URL 'http://localhost:9000'`
|
|
||||||
* Set the appropriate bucket name:
|
|
||||||
* `repertory -s3 --name '<my config name>' -set S3Config.Bucket '<my bucket name>'`
|
|
||||||
* Set the appropriate access key:
|
|
||||||
* `repertory -s3 --name '<my config name>' -set S3Config.AccessKey '<my access key>'`
|
|
||||||
* Set the appropriate secret key:
|
|
||||||
* `repertory -s3 --name '<my config name>' -set S3Config.SecretKey '<my secret key>'`
|
|
||||||
* For Sia and most local S3 gateway instances, enable path style URL's:
|
|
||||||
* `repertory -s3 --name '<my config name>' -set S3Config.UsePathStyle true`
|
|
||||||
* Optional steps:
|
|
||||||
* Set an appropriate region. Default is set to `any`:
|
|
||||||
* `repertory -s3 --name '<my config name>' -set S3Config.Region '<my region>'`
|
|
||||||
* Enable encrypted file names and file data. Set a strong, random encryption token and be sure to store it in a secure backup location:
|
|
||||||
* `repertory -s3 --name '<my config name>' -set S3Config.EncryptionToken '<my strong password>'`
|
|
||||||
* To verify/view all configuration options:
|
|
||||||
* `repertory -s3 --name '<my config name>' -dc`
|
|
||||||
* Example:
|
|
||||||
* `repertory -s3 --name minio -dc`
|
|
||||||
* Mounting on Linux:
|
|
||||||
* `repertory -s3 --name '<my config name>' /mnt/location`
|
|
||||||
* Example:
|
|
||||||
* `repertory -s3 --name minio /mnt/location`
|
|
||||||
* Mounting on Windows:
|
|
||||||
* `repertory -s3 --name '<my config name>' t:`
|
|
||||||
* Example:
|
|
||||||
* `repertory -s3 --name minio t:`
|
|
||||||
|
|
||||||
### Notable Options
|
### Notable Options
|
||||||
|
|
||||||
|
* `-dc`
|
||||||
|
* Display mount configuration.
|
||||||
|
* For Sia, `--name` is optional
|
||||||
|
* For S3, the `-s3` option is required along with `--name`
|
||||||
* `--help`
|
* `--help`
|
||||||
* Display all mount utility options
|
* Display all mount utility options.
|
||||||
* `--name, -na [name]`
|
* `--name, -na [name]`
|
||||||
* 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.
|
* For Sia, the bucket name will be set to the same value if it is empty in the configuration file.
|
||||||
* If the `--name` option is not specified, `default` will be used.
|
* 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.
|
* For S3, the `--name` option is required and does not affect the bucket name.
|
||||||
* `-dc`
|
* `-set SiaConfig.Bucket`
|
||||||
* Display mount configuration
|
* Set Sia bucket name for the mount.
|
||||||
* For Sia, `--name` is optional
|
* Can be used in combination with `--name` to target a unique configuration.
|
||||||
* For S3, the `-s3` option is required along with `--name`
|
* `-set S3Config.Bucket`
|
||||||
|
* S3 bucket name for the mount.
|
||||||
|
* Must be used in combination with `--name` to target a unique configuration.
|
||||||
|
* Must be used in combination with `-s3`.
|
||||||
|
|
||||||
### Data Directories
|
### Sia
|
||||||
|
|
||||||
* Linux
|
* Linux
|
||||||
* `~/.local/repertory2`
|
* `repertory /mnt/location`
|
||||||
|
* `repertory --name default /mnt/location`
|
||||||
* Windows
|
* Windows
|
||||||
* `%LOCALAPPDATA%\repertory2`
|
* `repertory.exe t:`
|
||||||
* Example:
|
* `repertory.exe --name default t:`
|
||||||
* `C:\Users\Tom\AppData\Local\repertory2`
|
|
||||||
* IMPORTANT:
|
|
||||||
* It is highly recommended to exclude this folder from any anti-virus/anti-malware applications as severe performance issues may arise.
|
|
||||||
* Excluding the mounted drive letter is also highly recommended.
|
|
||||||
|
|
||||||
## Remote Mounting
|
### S3
|
||||||
|
|
||||||
`Repertory` allows local mounts to be shared with other computers on your network.
|
* Linux
|
||||||
This option is referred to as remote mounting. Instructions TBD.
|
* `repertory --name storj -s3 /mnt/location`
|
||||||
|
* Windows
|
||||||
|
* `repertory.exe --name storj -s3 t:`
|
||||||
|
|
||||||
## Compiling
|
## Compiling
|
||||||
|
|
||||||
@ -149,26 +94,17 @@ This option is referred to as remote mounting. Instructions TBD.
|
|||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
* [binutils](https://www.gnu.org/software/binutils/)
|
|
||||||
* [boost c++ libraries](https://www.boost.org/)
|
* [boost c++ libraries](https://www.boost.org/)
|
||||||
* [cpp-httplib](https://github.com/yhirose/cpp-httplib)
|
* [cpp-httplib](https://github.com/yhirose/cpp-httplib)
|
||||||
* [curl](https://curl.haxx.se/)
|
* [curl](https://curl.haxx.se/)
|
||||||
* [docker](https://www.docker.com/)
|
* ~~[FUSE for macOS](https://osxfuse.github.io/)~~
|
||||||
* [Google Test](https://github.com/google/googletest)
|
* [Google Test](https://github.com/google/googletest)
|
||||||
* [ICU](https://icu.unicode.org/)
|
|
||||||
* [JSON for Modern C++](https://github.com/nlohmann/json)
|
* [JSON for Modern C++](https://github.com/nlohmann/json)
|
||||||
* [libexpat](https://github.com/libexpat/libexpat)
|
|
||||||
* [libfuse](https://github.com/libfuse/libfuse)
|
* [libfuse](https://github.com/libfuse/libfuse)
|
||||||
* [libsodium](https://doc.libsodium.org/)
|
* [libsodium](https://doc.libsodium.org/)
|
||||||
* [mingw-w64](https://www.mingw-w64.org/)
|
|
||||||
* [MSYS2](https://www.msys2.org)
|
|
||||||
* [OpenSSL](https://www.openssl.org/)
|
* [OpenSSL](https://www.openssl.org/)
|
||||||
* [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/)
|
|
||||||
* [pugixml](https://pugixml.org/)
|
|
||||||
* [RocksDB](https://rocksdb.org)
|
|
||||||
* [ScPrime](https://scpri.me/)
|
* [ScPrime](https://scpri.me/)
|
||||||
* [Sia Decentralized Cloud Storage](https://sia.tech/)
|
* [Sia Decentralized Cloud Storage](https://sia.tech/)
|
||||||
* [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://storj.io/)
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
set(BINUTILS_VERSION 2.43)
|
set(BINUTILS_VERSION 2.43)
|
||||||
set(BOOST_MAJOR_VERSION 1)
|
|
||||||
set(BOOST_MINOR_VERSION 87)
|
|
||||||
set(BOOST_PATCH_VERSION 0)
|
|
||||||
set(BOOST2_MAJOR_VERSION 1)
|
set(BOOST2_MAJOR_VERSION 1)
|
||||||
set(BOOST2_MINOR_VERSION 76)
|
set(BOOST2_MINOR_VERSION 76)
|
||||||
set(BOOST2_PATCH_VERSION 0)
|
set(BOOST2_PATCH_VERSION 0)
|
||||||
|
set(BOOST_MAJOR_VERSION 1)
|
||||||
|
set(BOOST_MINOR_VERSION 87)
|
||||||
|
set(BOOST_PATCH_VERSION 0)
|
||||||
set(CPP_HTTPLIB_VERSION 0.18.1)
|
set(CPP_HTTPLIB_VERSION 0.18.1)
|
||||||
set(CURL_VERSION 8.11.0)
|
|
||||||
set(CURL2_VERSION 8_11_0)
|
set(CURL2_VERSION 8_11_0)
|
||||||
set(EXPAT_VERSION 2.6.4)
|
set(CURL_VERSION 8.11.0)
|
||||||
set(EXPAT2_VERSION 2_6_4)
|
set(EXPAT2_VERSION 2_6_4)
|
||||||
|
set(EXPAT_VERSION 2.6.4)
|
||||||
set(GCC_VERSION 14.2.0)
|
set(GCC_VERSION 14.2.0)
|
||||||
set(GTEST_VERSION 1.15.2)
|
set(GTEST_VERSION 1.15.2)
|
||||||
set(ICU_VERSION 76-1)
|
set(ICU_VERSION 76-1)
|
||||||
@ -22,7 +22,7 @@ set(PKG_CONFIG_VERSION 0.29.2)
|
|||||||
set(PUGIXML_VERSION 1.14)
|
set(PUGIXML_VERSION 1.14)
|
||||||
set(ROCKSDB_VERSION 9.7.4)
|
set(ROCKSDB_VERSION 9.7.4)
|
||||||
set(SPDLOG_VERSION 1.15.0)
|
set(SPDLOG_VERSION 1.15.0)
|
||||||
set(SQLITE_VERSION 3460100)
|
|
||||||
set(SQLITE2_VERSION 3.46.1)
|
set(SQLITE2_VERSION 3.46.1)
|
||||||
|
set(SQLITE_VERSION 3460100)
|
||||||
set(STDUUID_VERSION 1.2.3)
|
set(STDUUID_VERSION 1.2.3)
|
||||||
set(ZLIB_VERSION 1.3.1)
|
set(ZLIB_VERSION 1.3.1)
|
||||||
|
@ -43,8 +43,7 @@ constexpr const auto max_orphaned_file_retention_days{std::uint16_t(31U)};
|
|||||||
constexpr const auto max_ring_buffer_file_size{std::uint16_t(1024U)};
|
constexpr const auto max_ring_buffer_file_size{std::uint16_t(1024U)};
|
||||||
constexpr const auto max_s3_object_name_length{1024U};
|
constexpr const auto max_s3_object_name_length{1024U};
|
||||||
constexpr const auto min_cache_size_bytes{
|
constexpr const auto min_cache_size_bytes{
|
||||||
std::uint64_t(100UL * 1024UL * 1024UL),
|
std::uint64_t(100UL * 1024UL * 1024UL)};
|
||||||
};
|
|
||||||
constexpr const auto min_download_timeout_secs{std::uint8_t(5U)};
|
constexpr const auto min_download_timeout_secs{std::uint8_t(5U)};
|
||||||
constexpr const auto min_online_check_retry_secs{std::uint16_t(15U)};
|
constexpr const auto min_online_check_retry_secs{std::uint16_t(15U)};
|
||||||
constexpr const auto min_orphaned_file_retention_days{std::uint16_t(1U)};
|
constexpr const auto min_orphaned_file_retention_days{std::uint16_t(1U)};
|
||||||
|
@ -191,10 +191,6 @@ void rdb_file_db::enumerate_item_list(
|
|||||||
list.clear();
|
list.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not list.empty()) {
|
|
||||||
callback(list);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto rdb_file_db::get_api_path(const std::string &source_path,
|
auto rdb_file_db::get_api_path(const std::string &source_path,
|
||||||
@ -207,8 +203,9 @@ auto rdb_file_db::get_api_path(const std::string &source_path,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
auto rdb_file_db::get_directory_api_path(
|
auto rdb_file_db::get_directory_api_path(const std::string &source_path,
|
||||||
const std::string &source_path, std::string &api_path) const -> api_error {
|
std::string &api_path) const
|
||||||
|
-> api_error {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
auto result = perform_action(function_name, [&]() -> rocksdb::Status {
|
auto result = perform_action(function_name, [&]() -> rocksdb::Status {
|
||||||
@ -231,8 +228,9 @@ auto rdb_file_db::get_directory_api_path(
|
|||||||
: result;
|
: result;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto rdb_file_db::get_directory_source_path(
|
auto rdb_file_db::get_directory_source_path(const std::string &api_path,
|
||||||
const std::string &api_path, std::string &source_path) const -> api_error {
|
std::string &source_path) const
|
||||||
|
-> api_error {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
auto result = perform_action(function_name, [&]() -> rocksdb::Status {
|
auto result = perform_action(function_name, [&]() -> rocksdb::Status {
|
||||||
@ -293,8 +291,9 @@ auto rdb_file_db::get_file_data(const std::string &api_path,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto rdb_file_db::get_file_source_path(
|
auto rdb_file_db::get_file_source_path(const std::string &api_path,
|
||||||
const std::string &api_path, std::string &source_path) const -> api_error {
|
std::string &source_path) const
|
||||||
|
-> api_error {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
auto result = perform_action(function_name, [&]() -> rocksdb::Status {
|
auto result = perform_action(function_name, [&]() -> rocksdb::Status {
|
||||||
|
@ -81,10 +81,6 @@ void rdb_meta_db::enumerate_api_path_list(
|
|||||||
callback(list);
|
callback(list);
|
||||||
list.clear();
|
list.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not list.empty()) {
|
|
||||||
callback(list);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto rdb_meta_db::get_api_path(const std::string &source_path,
|
auto rdb_meta_db::get_api_path(const std::string &source_path,
|
||||||
@ -318,9 +314,10 @@ void rdb_meta_db::remove_api_path(const std::string &api_path) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto rdb_meta_db::remove_api_path(
|
auto rdb_meta_db::remove_api_path(const std::string &api_path,
|
||||||
const std::string &api_path, const std::string &source_path,
|
const std::string &source_path,
|
||||||
rocksdb::Transaction *txn) -> rocksdb::Status {
|
rocksdb::Transaction *txn)
|
||||||
|
-> rocksdb::Status {
|
||||||
auto txn_res = txn->Delete(pinned_family_, api_path);
|
auto txn_res = txn->Delete(pinned_family_, api_path);
|
||||||
if (not txn_res.ok()) {
|
if (not txn_res.ok()) {
|
||||||
return txn_res;
|
return txn_res;
|
||||||
|
@ -65,8 +65,9 @@ sqlite_file_db::sqlite_file_db(const app_config &cfg) {
|
|||||||
|
|
||||||
sqlite_file_db::~sqlite_file_db() { db_.reset(); }
|
sqlite_file_db::~sqlite_file_db() { db_.reset(); }
|
||||||
|
|
||||||
auto sqlite_file_db::add_directory(
|
auto sqlite_file_db::add_directory(const std::string &api_path,
|
||||||
const std::string &api_path, const std::string &source_path) -> api_error {
|
const std::string &source_path)
|
||||||
|
-> api_error {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
auto result = utils::db::sqlite::db_insert{*db_, file_table}
|
auto result = utils::db::sqlite::db_insert{*db_, file_table}
|
||||||
@ -157,10 +158,6 @@ void sqlite_file_db::enumerate_item_list(
|
|||||||
list.clear();
|
list.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not list.empty()) {
|
|
||||||
callback(list);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto sqlite_file_db::get_api_path(const std::string &source_path,
|
auto sqlite_file_db::get_api_path(const std::string &source_path,
|
||||||
@ -182,8 +179,9 @@ auto sqlite_file_db::get_api_path(const std::string &source_path,
|
|||||||
return api_error::item_not_found;
|
return api_error::item_not_found;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto sqlite_file_db::get_directory_api_path(
|
auto sqlite_file_db::get_directory_api_path(const std::string &source_path,
|
||||||
const std::string &source_path, std::string &api_path) const -> api_error {
|
std::string &api_path) const
|
||||||
|
-> api_error {
|
||||||
auto result = utils::db::sqlite::db_select{*db_, file_table}
|
auto result = utils::db::sqlite::db_select{*db_, file_table}
|
||||||
.column("api_path")
|
.column("api_path")
|
||||||
.where("source_path")
|
.where("source_path")
|
||||||
@ -204,8 +202,9 @@ auto sqlite_file_db::get_directory_api_path(
|
|||||||
return api_error::directory_not_found;
|
return api_error::directory_not_found;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto sqlite_file_db::get_directory_source_path(
|
auto sqlite_file_db::get_directory_source_path(const std::string &api_path,
|
||||||
const std::string &api_path, std::string &source_path) const -> api_error {
|
std::string &source_path) const
|
||||||
|
-> api_error {
|
||||||
auto result = utils::db::sqlite::db_select{*db_, file_table}
|
auto result = utils::db::sqlite::db_select{*db_, file_table}
|
||||||
.column("source_path")
|
.column("source_path")
|
||||||
.where("api_path")
|
.where("api_path")
|
||||||
@ -226,8 +225,9 @@ auto sqlite_file_db::get_directory_source_path(
|
|||||||
return api_error::directory_not_found;
|
return api_error::directory_not_found;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto sqlite_file_db::get_file_api_path(
|
auto sqlite_file_db::get_file_api_path(const std::string &source_path,
|
||||||
const std::string &source_path, std::string &api_path) const -> api_error {
|
std::string &api_path) const
|
||||||
|
-> api_error {
|
||||||
auto result = utils::db::sqlite::db_select{*db_, file_table}
|
auto result = utils::db::sqlite::db_select{*db_, file_table}
|
||||||
.column("api_path")
|
.column("api_path")
|
||||||
.where("source_path")
|
.where("source_path")
|
||||||
@ -286,8 +286,9 @@ auto sqlite_file_db::get_file_data(const std::string &api_path,
|
|||||||
return api_error::item_not_found;
|
return api_error::item_not_found;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto sqlite_file_db::get_file_source_path(
|
auto sqlite_file_db::get_file_source_path(const std::string &api_path,
|
||||||
const std::string &api_path, std::string &source_path) const -> api_error {
|
std::string &source_path) const
|
||||||
|
-> api_error {
|
||||||
auto result = utils::db::sqlite::db_select{*db_, file_table}
|
auto result = utils::db::sqlite::db_select{*db_, file_table}
|
||||||
.column("source_path")
|
.column("source_path")
|
||||||
.where("api_path")
|
.where("api_path")
|
||||||
@ -329,8 +330,9 @@ auto sqlite_file_db::get_item_list(stop_type_callback stop_requested_cb) const
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto sqlite_file_db::get_source_path(
|
auto sqlite_file_db::get_source_path(const std::string &api_path,
|
||||||
const std::string &api_path, std::string &source_path) const -> api_error {
|
std::string &source_path) const
|
||||||
|
-> api_error {
|
||||||
auto result = utils::db::sqlite::db_select{*db_, file_table}
|
auto result = utils::db::sqlite::db_select{*db_, file_table}
|
||||||
.column("source_path")
|
.column("source_path")
|
||||||
.where("api_path")
|
.where("api_path")
|
||||||
|
@ -95,10 +95,6 @@ void sqlite_meta_db::enumerate_api_path_list(
|
|||||||
list.clear();
|
list.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not list.empty()) {
|
|
||||||
callback(list);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto sqlite_meta_db::get_api_path(const std::string &source_path,
|
auto sqlite_meta_db::get_api_path(const std::string &source_path,
|
||||||
|
@ -85,8 +85,8 @@ auto fuse_drive::chown_impl(std::string api_path, uid_t uid, gid_t gid,
|
|||||||
struct fuse_file_info * /*file_info*/)
|
struct fuse_file_info * /*file_info*/)
|
||||||
-> api_error {
|
-> api_error {
|
||||||
#else
|
#else
|
||||||
auto fuse_drive::chown_impl(std::string api_path, uid_t uid,
|
auto fuse_drive::chown_impl(std::string api_path, uid_t uid, gid_t gid)
|
||||||
gid_t gid) -> api_error {
|
-> api_error {
|
||||||
#endif
|
#endif
|
||||||
return check_and_perform(
|
return check_and_perform(
|
||||||
api_path, X_OK, [&](api_meta_map &meta) -> api_error {
|
api_path, X_OK, [&](api_meta_map &meta) -> api_error {
|
||||||
@ -494,8 +494,8 @@ auto fuse_drive::getattr_impl(std::string api_path, struct stat *unix_st,
|
|||||||
struct fuse_file_info * /*file_info*/)
|
struct fuse_file_info * /*file_info*/)
|
||||||
-> api_error {
|
-> api_error {
|
||||||
#else
|
#else
|
||||||
auto fuse_drive::getattr_impl(std::string api_path,
|
auto fuse_drive::getattr_impl(std::string api_path, struct stat *unix_st)
|
||||||
struct stat *unix_st) -> api_error {
|
-> api_error {
|
||||||
#endif
|
#endif
|
||||||
auto parent = utils::path::get_parent_api_path(api_path);
|
auto parent = utils::path::get_parent_api_path(api_path);
|
||||||
|
|
||||||
@ -561,8 +561,8 @@ auto fuse_drive::getxtimes_impl(std::string api_path, struct timespec *bkuptime,
|
|||||||
#endif // __APPLE__
|
#endif // __APPLE__
|
||||||
|
|
||||||
#if FUSE_USE_VERSION >= 30
|
#if FUSE_USE_VERSION >= 30
|
||||||
auto fuse_drive::init_impl(struct fuse_conn_info *conn,
|
auto fuse_drive::init_impl(struct fuse_conn_info *conn, struct fuse_config *cfg)
|
||||||
struct fuse_config *cfg) -> void * {
|
-> void * {
|
||||||
#else
|
#else
|
||||||
void *fuse_drive::init_impl(struct fuse_conn_info *conn) {
|
void *fuse_drive::init_impl(struct fuse_conn_info *conn) {
|
||||||
#endif
|
#endif
|
||||||
@ -666,17 +666,13 @@ auto fuse_drive::mkdir_impl(std::string api_path, mode_t mode) -> api_error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void fuse_drive::notify_fuse_main_exit(int &ret) {
|
void fuse_drive::notify_fuse_main_exit(int &ret) {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
if (was_mounted_) {
|
||||||
|
event_system::instance().raise<drive_mount_result>(
|
||||||
if (not was_mounted_) {
|
function_name, get_mount_location(), std::to_string(ret));
|
||||||
return;
|
event_system::instance().stop();
|
||||||
|
logging_consumer_.reset();
|
||||||
|
console_consumer_.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
event_system::instance().raise<drive_mount_result>(
|
|
||||||
function_name, get_mount_location(), std::to_string(ret));
|
|
||||||
event_system::instance().stop();
|
|
||||||
logging_consumer_.reset();
|
|
||||||
console_consumer_.reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto fuse_drive::open_impl(std::string api_path,
|
auto fuse_drive::open_impl(std::string api_path,
|
||||||
@ -804,8 +800,9 @@ auto fuse_drive::release_impl(std::string /*api_path*/,
|
|||||||
return api_error::success;
|
return api_error::success;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto fuse_drive::releasedir_impl(
|
auto fuse_drive::releasedir_impl(std::string /*api_path*/,
|
||||||
std::string /*api_path*/, struct fuse_file_info *file_info) -> api_error {
|
struct fuse_file_info *file_info)
|
||||||
|
-> api_error {
|
||||||
auto iter = directory_cache_->get_directory(file_info->fh);
|
auto iter = directory_cache_->get_directory(file_info->fh);
|
||||||
if (iter == nullptr) {
|
if (iter == nullptr) {
|
||||||
return api_error::invalid_handle;
|
return api_error::invalid_handle;
|
||||||
@ -823,8 +820,8 @@ auto fuse_drive::rename_directory(const std::string &from_api_path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto fuse_drive::rename_file(const std::string &from_api_path,
|
auto fuse_drive::rename_file(const std::string &from_api_path,
|
||||||
const std::string &to_api_path,
|
const std::string &to_api_path, bool overwrite)
|
||||||
bool overwrite) -> int {
|
-> int {
|
||||||
auto res = fm_->rename_file(from_api_path, to_api_path, overwrite);
|
auto res = fm_->rename_file(from_api_path, to_api_path, overwrite);
|
||||||
errno = std::abs(utils::from_api_error(res));
|
errno = std::abs(utils::from_api_error(res));
|
||||||
return (res == api_error::success) ? 0 : -1;
|
return (res == api_error::success) ? 0 : -1;
|
||||||
@ -834,8 +831,8 @@ auto fuse_drive::rename_file(const std::string &from_api_path,
|
|||||||
auto fuse_drive::rename_impl(std::string from_api_path, std::string to_api_path,
|
auto fuse_drive::rename_impl(std::string from_api_path, std::string to_api_path,
|
||||||
unsigned int /*flags*/) -> api_error {
|
unsigned int /*flags*/) -> api_error {
|
||||||
#else
|
#else
|
||||||
auto fuse_drive::rename_impl(std::string from_api_path,
|
auto fuse_drive::rename_impl(std::string from_api_path, std::string to_api_path)
|
||||||
std::string to_api_path) -> api_error {
|
-> api_error {
|
||||||
#endif
|
#endif
|
||||||
auto res = check_parent_access(to_api_path, W_OK | X_OK);
|
auto res = check_parent_access(to_api_path, W_OK | X_OK);
|
||||||
if (res != api_error::success) {
|
if (res != api_error::success) {
|
||||||
@ -937,15 +934,15 @@ auto fuse_drive::getxattr_impl(std::string api_path, const char *name,
|
|||||||
}
|
}
|
||||||
#else // __APPLE__
|
#else // __APPLE__
|
||||||
auto fuse_drive::getxattr_impl(std::string api_path, const char *name,
|
auto fuse_drive::getxattr_impl(std::string api_path, const char *name,
|
||||||
char *value, size_t size,
|
char *value, size_t size, int &attribute_size)
|
||||||
int &attribute_size) -> api_error {
|
-> api_error {
|
||||||
return getxattr_common(api_path, name, value, size, attribute_size, nullptr);
|
return getxattr_common(api_path, name, value, size, attribute_size, nullptr);
|
||||||
}
|
}
|
||||||
#endif // __APPLE__
|
#endif // __APPLE__
|
||||||
|
|
||||||
auto fuse_drive::listxattr_impl(std::string api_path, char *buffer, size_t size,
|
auto fuse_drive::listxattr_impl(std::string api_path, char *buffer, size_t size,
|
||||||
int &required_size,
|
int &required_size, bool &return_size)
|
||||||
bool &return_size) -> api_error {
|
-> api_error {
|
||||||
auto check_size = (size == 0);
|
auto check_size = (size == 0);
|
||||||
|
|
||||||
auto res = check_parent_access(api_path, X_OK);
|
auto res = check_parent_access(api_path, X_OK);
|
||||||
@ -985,8 +982,8 @@ auto fuse_drive::listxattr_impl(std::string api_path, char *buffer, size_t size,
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto fuse_drive::removexattr_impl(std::string api_path,
|
auto fuse_drive::removexattr_impl(std::string api_path, const char *name)
|
||||||
const char *name) -> api_error {
|
-> api_error {
|
||||||
std::string attribute_name;
|
std::string attribute_name;
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
auto res = parse_xattr_parameters(name, 0, attribute_name, api_path);
|
auto res = parse_xattr_parameters(name, 0, attribute_name, api_path);
|
||||||
@ -1014,8 +1011,8 @@ auto fuse_drive::setxattr_impl(std::string api_path, const char *name,
|
|||||||
uint32_t position) -> api_error {
|
uint32_t position) -> api_error {
|
||||||
#else // __APPLE__
|
#else // __APPLE__
|
||||||
auto fuse_drive::setxattr_impl(std::string api_path, const char *name,
|
auto fuse_drive::setxattr_impl(std::string api_path, const char *name,
|
||||||
const char *value, size_t size,
|
const char *value, size_t size, int flags)
|
||||||
int flags) -> api_error {
|
-> api_error {
|
||||||
#endif
|
#endif
|
||||||
std::string attribute_name;
|
std::string attribute_name;
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
@ -1093,8 +1090,8 @@ void fuse_drive::set_item_meta(const std::string &api_path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
auto fuse_drive::setattr_x_impl(std::string api_path,
|
auto fuse_drive::setattr_x_impl(std::string api_path, struct setattr_x *attr)
|
||||||
struct setattr_x *attr) -> api_error {
|
-> api_error {
|
||||||
bool exists{};
|
bool exists{};
|
||||||
auto res = provider_.is_file(api_path, exists);
|
auto res = provider_.is_file(api_path, exists);
|
||||||
if (res != api_error::success) {
|
if (res != api_error::success) {
|
||||||
@ -1148,7 +1145,7 @@ auto fuse_drive::setattr_x_impl(std::string api_path,
|
|||||||
ts[0].tv_sec = attr->acctime.tv_sec;
|
ts[0].tv_sec = attr->acctime.tv_sec;
|
||||||
ts[0].tv_nsec = attr->acctime.tv_nsec;
|
ts[0].tv_nsec = attr->acctime.tv_nsec;
|
||||||
} else {
|
} else {
|
||||||
struct timeval tv {};
|
struct timeval tv{};
|
||||||
gettimeofday(&tv, NULL);
|
gettimeofday(&tv, NULL);
|
||||||
ts[0].tv_sec = tv.tv_sec;
|
ts[0].tv_sec = tv.tv_sec;
|
||||||
ts[0].tv_nsec = tv.tv_usec * 1000;
|
ts[0].tv_nsec = tv.tv_usec * 1000;
|
||||||
@ -1193,8 +1190,9 @@ auto fuse_drive::setattr_x_impl(std::string api_path,
|
|||||||
return api_error::success;
|
return api_error::success;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto fuse_drive::setbkuptime_impl(
|
auto fuse_drive::setbkuptime_impl(std::string api_path,
|
||||||
std::string api_path, const struct timespec *bkuptime) -> api_error {
|
const struct timespec *bkuptime)
|
||||||
|
-> api_error {
|
||||||
return check_and_perform(
|
return check_and_perform(
|
||||||
api_path, X_OK, [&](api_meta_map &meta) -> api_error {
|
api_path, X_OK, [&](api_meta_map &meta) -> api_error {
|
||||||
auto nanos = bkuptime->tv_nsec +
|
auto nanos = bkuptime->tv_nsec +
|
||||||
@ -1230,8 +1228,8 @@ auto fuse_drive::setvolname_impl(const char * /*volname*/) -> api_error {
|
|||||||
return api_error::success;
|
return api_error::success;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto fuse_drive::statfs_x_impl(std::string /*api_path*/,
|
auto fuse_drive::statfs_x_impl(std::string /*api_path*/, struct statfs *stbuf)
|
||||||
struct statfs *stbuf) -> api_error {
|
-> api_error {
|
||||||
if (statfs(&config_.get_cache_directory()[0], stbuf) != 0) {
|
if (statfs(&config_.get_cache_directory()[0], stbuf) != 0) {
|
||||||
return api_error::os_error;
|
return api_error::os_error;
|
||||||
}
|
}
|
||||||
@ -1256,8 +1254,8 @@ auto fuse_drive::statfs_x_impl(std::string /*api_path*/,
|
|||||||
return api_error::success;
|
return api_error::success;
|
||||||
}
|
}
|
||||||
#else // __APPLE__
|
#else // __APPLE__
|
||||||
auto fuse_drive::statfs_impl(std::string /*api_path*/,
|
auto fuse_drive::statfs_impl(std::string /*api_path*/, struct statvfs *stbuf)
|
||||||
struct statvfs *stbuf) -> api_error {
|
-> api_error {
|
||||||
if (statvfs(config_.get_cache_directory().data(), stbuf) != 0) {
|
if (statvfs(config_.get_cache_directory().data(), stbuf) != 0) {
|
||||||
return api_error::os_error;
|
return api_error::os_error;
|
||||||
}
|
}
|
||||||
@ -1341,8 +1339,8 @@ auto fuse_drive::utimens_impl(std::string api_path, const struct timespec tv[2],
|
|||||||
struct fuse_file_info * /*file_info*/)
|
struct fuse_file_info * /*file_info*/)
|
||||||
-> api_error {
|
-> api_error {
|
||||||
#else
|
#else
|
||||||
auto fuse_drive::utimens_impl(std::string api_path,
|
auto fuse_drive::utimens_impl(std::string api_path, const struct timespec tv[2])
|
||||||
const struct timespec tv[2]) -> api_error {
|
-> api_error {
|
||||||
#endif
|
#endif
|
||||||
api_meta_map meta;
|
api_meta_map meta;
|
||||||
auto res = provider_.get_item_meta(api_path, meta);
|
auto res = provider_.get_item_meta(api_path, meta);
|
||||||
|
@ -26,8 +26,6 @@
|
|||||||
#include "platform/platform.hpp"
|
#include "platform/platform.hpp"
|
||||||
#include "providers/i_provider.hpp"
|
#include "providers/i_provider.hpp"
|
||||||
#include "utils/common.hpp"
|
#include "utils/common.hpp"
|
||||||
#include "utils/path.hpp"
|
|
||||||
#include "utils/string.hpp"
|
|
||||||
#include "utils/time.hpp"
|
#include "utils/time.hpp"
|
||||||
|
|
||||||
namespace repertory {
|
namespace repertory {
|
||||||
@ -35,8 +33,8 @@ auto fuse_drive_base::access_impl(std::string api_path, int mask) -> api_error {
|
|||||||
return check_access(api_path, mask);
|
return check_access(api_path, mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto fuse_drive_base::check_access(const std::string &api_path,
|
auto fuse_drive_base::check_access(const std::string &api_path, int mask) const
|
||||||
int mask) const -> api_error {
|
-> api_error {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
api_meta_map meta;
|
api_meta_map meta;
|
||||||
@ -137,8 +135,9 @@ auto fuse_drive_base::check_and_perform(
|
|||||||
return action(meta);
|
return action(meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto fuse_drive_base::check_open_flags(
|
auto fuse_drive_base::check_open_flags(int flags, int mask,
|
||||||
int flags, int mask, const api_error &fail_error) -> api_error {
|
const api_error &fail_error)
|
||||||
|
-> api_error {
|
||||||
return (((flags & mask) == 0) ? api_error::success : fail_error);
|
return (((flags & mask) == 0) ? api_error::success : fail_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,8 +194,8 @@ auto fuse_drive_base::check_parent_access(const std::string &api_path,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto fuse_drive_base::check_readable(int flags,
|
auto fuse_drive_base::check_readable(int flags, const api_error &fail_error)
|
||||||
const api_error &fail_error) -> api_error {
|
-> api_error {
|
||||||
auto mode = (flags & O_ACCMODE);
|
auto mode = (flags & O_ACCMODE);
|
||||||
return ((mode == O_WRONLY) ? fail_error : api_error::success);
|
return ((mode == O_WRONLY) ? fail_error : api_error::success);
|
||||||
}
|
}
|
||||||
@ -254,13 +253,16 @@ auto fuse_drive_base::get_uid_from_meta(const api_meta_map &meta) -> uid_t {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
auto fuse_drive_base::parse_xattr_parameters(
|
auto fuse_drive_base::parse_xattr_parameters(const char *name,
|
||||||
const char *name, const uint32_t &position, std::string &attribute_name,
|
const uint32_t &position,
|
||||||
const std::string &api_path) -> api_error {
|
std::string &attribute_name,
|
||||||
|
const std::string &api_path)
|
||||||
|
-> api_error {
|
||||||
#else // !defined(__APPLE__)
|
#else // !defined(__APPLE__)
|
||||||
auto fuse_drive_base::parse_xattr_parameters(
|
auto fuse_drive_base::parse_xattr_parameters(const char *name,
|
||||||
const char *name, std::string &attribute_name,
|
std::string &attribute_name,
|
||||||
const std::string &api_path) -> api_error {
|
const std::string &api_path)
|
||||||
|
-> api_error {
|
||||||
#endif // defined(__APPLE__)
|
#endif // defined(__APPLE__)
|
||||||
auto res = api_path.empty() ? api_error::bad_address : api_error::success;
|
auto res = api_path.empty() ? api_error::bad_address : api_error::success;
|
||||||
if (res != api_error::success) {
|
if (res != api_error::success) {
|
||||||
@ -293,9 +295,11 @@ auto fuse_drive_base::parse_xattr_parameters(
|
|||||||
std::string &attribute_name, const std::string &api_path) -> api_error {
|
std::string &attribute_name, const std::string &api_path) -> api_error {
|
||||||
auto res = parse_xattr_parameters(name, position, attribute_name, api_path);
|
auto res = parse_xattr_parameters(name, position, attribute_name, api_path);
|
||||||
#else // !defined(__APPLE__)
|
#else // !defined(__APPLE__)
|
||||||
auto fuse_drive_base::parse_xattr_parameters(
|
auto fuse_drive_base::parse_xattr_parameters(const char *name,
|
||||||
const char *name, const char *value, size_t size,
|
const char *value, size_t size,
|
||||||
std::string &attribute_name, const std::string &api_path) -> api_error {
|
std::string &attribute_name,
|
||||||
|
const std::string &api_path)
|
||||||
|
-> api_error {
|
||||||
auto res = parse_xattr_parameters(name, attribute_name, api_path);
|
auto res = parse_xattr_parameters(name, attribute_name, api_path);
|
||||||
#endif // defined(__APPLE__)
|
#endif // defined(__APPLE__)
|
||||||
if (res != api_error::success) {
|
if (res != api_error::success) {
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
*/
|
*/
|
||||||
#include "file_manager/open_file.hpp"
|
#include "file_manager/open_file.hpp"
|
||||||
|
|
||||||
#include "app_config.hpp"
|
|
||||||
#include "events/event_system.hpp"
|
#include "events/event_system.hpp"
|
||||||
#include "events/types/download_begin.hpp"
|
#include "events/types/download_begin.hpp"
|
||||||
#include "events/types/download_end.hpp"
|
#include "events/types/download_end.hpp"
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
*/
|
*/
|
||||||
#include "file_manager/ring_buffer_base.hpp"
|
#include "file_manager/ring_buffer_base.hpp"
|
||||||
|
|
||||||
#include "app_config.hpp"
|
|
||||||
#include "events/event_system.hpp"
|
#include "events/event_system.hpp"
|
||||||
#include "events/types/download_begin.hpp"
|
#include "events/types/download_begin.hpp"
|
||||||
#include "events/types/download_end.hpp"
|
#include "events/types/download_end.hpp"
|
||||||
|
@ -41,13 +41,13 @@
|
|||||||
#include "file_manager/cache_size_mgr.hpp"
|
#include "file_manager/cache_size_mgr.hpp"
|
||||||
#include "file_manager/i_file_manager.hpp"
|
#include "file_manager/i_file_manager.hpp"
|
||||||
#include "platform/platform.hpp"
|
#include "platform/platform.hpp"
|
||||||
#include "utils/config.hpp"
|
|
||||||
#include "utils/error_utils.hpp"
|
#include "utils/error_utils.hpp"
|
||||||
#include "utils/file_utils.hpp"
|
#include "utils/file_utils.hpp"
|
||||||
#include "utils/path.hpp"
|
#include "utils/path.hpp"
|
||||||
#include "utils/polling.hpp"
|
#include "utils/polling.hpp"
|
||||||
#include "utils/tasks.hpp"
|
#include "utils/tasks.hpp"
|
||||||
#include "utils/time.hpp"
|
#include "utils/time.hpp"
|
||||||
|
#include <utils/config.hpp>
|
||||||
|
|
||||||
namespace repertory {
|
namespace repertory {
|
||||||
void base_provider::add_all_items(stop_type &stop_requested) {
|
void base_provider::add_all_items(stop_type &stop_requested) {
|
||||||
@ -69,8 +69,8 @@ void base_provider::add_all_items(stop_type &stop_requested) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto base_provider::create_api_file(std::string path, std::string key,
|
auto base_provider::create_api_file(std::string path, std::string key,
|
||||||
std::uint64_t size,
|
std::uint64_t size, std::uint64_t file_time)
|
||||||
std::uint64_t file_time) -> api_file {
|
-> api_file {
|
||||||
api_file file{};
|
api_file file{};
|
||||||
file.api_path = utils::path::create_api_path(path);
|
file.api_path = utils::path::create_api_path(path);
|
||||||
file.api_parent = utils::path::get_parent_api_path(file.api_path);
|
file.api_parent = utils::path::get_parent_api_path(file.api_path);
|
||||||
@ -102,8 +102,8 @@ auto base_provider::create_api_file(std::string path, std::uint64_t size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto base_provider::create_directory_clone_source_meta(
|
auto base_provider::create_directory_clone_source_meta(
|
||||||
const std::string &source_api_path,
|
const std::string &source_api_path, const std::string &api_path)
|
||||||
const std::string &api_path) -> api_error {
|
-> api_error {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
bool exists{};
|
bool exists{};
|
||||||
@ -201,8 +201,8 @@ auto base_provider::create_directory(const std::string &api_path,
|
|||||||
return api_error::error;
|
return api_error::error;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto base_provider::create_file(const std::string &api_path,
|
auto base_provider::create_file(const std::string &api_path, api_meta_map &meta)
|
||||||
api_meta_map &meta) -> api_error {
|
-> api_error {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -259,8 +259,9 @@ auto base_provider::create_file(const std::string &api_path,
|
|||||||
return api_error::error;
|
return api_error::error;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto base_provider::get_api_path_from_source(
|
auto base_provider::get_api_path_from_source(const std::string &source_path,
|
||||||
const std::string &source_path, std::string &api_path) const -> api_error {
|
std::string &api_path) const
|
||||||
|
-> api_error {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
if (source_path.empty()) {
|
if (source_path.empty()) {
|
||||||
@ -273,8 +274,9 @@ auto base_provider::get_api_path_from_source(
|
|||||||
return db3_->get_api_path(source_path, api_path);
|
return db3_->get_api_path(source_path, api_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto base_provider::get_directory_items(
|
auto base_provider::get_directory_items(const std::string &api_path,
|
||||||
const std::string &api_path, directory_item_list &list) const -> api_error {
|
directory_item_list &list) const
|
||||||
|
-> api_error {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -342,9 +344,10 @@ auto base_provider::get_file_size(const std::string &api_path,
|
|||||||
return api_error::success;
|
return api_error::success;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto base_provider::get_filesystem_item(
|
auto base_provider::get_filesystem_item(const std::string &api_path,
|
||||||
const std::string &api_path, bool directory,
|
bool directory,
|
||||||
filesystem_item &fsi) const -> api_error {
|
filesystem_item &fsi) const
|
||||||
|
-> api_error {
|
||||||
bool exists{};
|
bool exists{};
|
||||||
auto res = is_directory(api_path, exists);
|
auto res = is_directory(api_path, exists);
|
||||||
if (res != api_error::success) {
|
if (res != api_error::success) {
|
||||||
@ -377,9 +380,10 @@ auto base_provider::get_filesystem_item(
|
|||||||
return api_error::success;
|
return api_error::success;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto base_provider::get_filesystem_item_and_file(
|
auto base_provider::get_filesystem_item_and_file(const std::string &api_path,
|
||||||
const std::string &api_path, api_file &file,
|
api_file &file,
|
||||||
filesystem_item &fsi) const -> api_error {
|
filesystem_item &fsi) const
|
||||||
|
-> api_error {
|
||||||
auto res = get_file(api_path, file);
|
auto res = get_file(api_path, file);
|
||||||
if (res != api_error::success) {
|
if (res != api_error::success) {
|
||||||
return res;
|
return res;
|
||||||
@ -498,9 +502,6 @@ void base_provider::process_removed_files(std::deque<removed_item> removed_list,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (not utils::file::file{item.source_path}.exists()) {
|
if (not utils::file::file{item.source_path}.exists()) {
|
||||||
db3_->remove_api_path(item.api_path);
|
|
||||||
event_system::instance().raise<file_removed_externally>(
|
|
||||||
item.api_path, function_name, item.source_path);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -549,8 +550,6 @@ void base_provider::process_removed_files(std::deque<removed_item> removed_list,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void base_provider::process_removed_items(stop_type &stop_requested) {
|
void base_provider::process_removed_items(stop_type &stop_requested) {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
|
||||||
|
|
||||||
const auto get_stop_requested = [&stop_requested]() -> bool {
|
const auto get_stop_requested = [&stop_requested]() -> bool {
|
||||||
return stop_requested || app_config::get_stop_requested();
|
return stop_requested || app_config::get_stop_requested();
|
||||||
};
|
};
|
||||||
@ -566,8 +565,7 @@ void base_provider::process_removed_items(stop_type &stop_requested) {
|
|||||||
tasks::instance().schedule({
|
tasks::instance().schedule({
|
||||||
[this, api_path](auto &&task_stopped) {
|
[this, api_path](auto &&task_stopped) {
|
||||||
api_meta_map meta{};
|
api_meta_map meta{};
|
||||||
auto result = get_item_meta(api_path, meta);
|
if (get_item_meta(api_path, meta) != api_error::success) {
|
||||||
if (result != api_error::success) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -615,8 +613,6 @@ void base_provider::process_removed_items(stop_type &stop_requested) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void base_provider::remove_deleted_items(stop_type &stop_requested) {
|
void base_provider::remove_deleted_items(stop_type &stop_requested) {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
|
||||||
|
|
||||||
const auto get_stop_requested = [&stop_requested]() -> bool {
|
const auto get_stop_requested = [&stop_requested]() -> bool {
|
||||||
return stop_requested || app_config::get_stop_requested();
|
return stop_requested || app_config::get_stop_requested();
|
||||||
};
|
};
|
||||||
|
@ -84,7 +84,7 @@ void tasks::start(app_config *config) {
|
|||||||
stop_requested_ = false;
|
stop_requested_ = false;
|
||||||
tasks_.clear();
|
tasks_.clear();
|
||||||
|
|
||||||
for (std::uint32_t idx = 0U; idx < std::thread::hardware_concurrency() * 2U;
|
for (std::uint32_t idx = 0U; idx < std::thread::hardware_concurrency();
|
||||||
++idx) {
|
++idx) {
|
||||||
task_threads_.emplace_back(
|
task_threads_.emplace_back(
|
||||||
std::make_unique<std::jthread>([this]() { task_thread(); }));
|
std::make_unique<std::jthread>([this]() { task_thread(); }));
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
namespace repertory::cli::actions {
|
namespace repertory::cli::actions {
|
||||||
template <typename drive> inline void version(std::vector<const char *> args) {
|
template <typename drive> inline void version(std::vector<const char *> args) {
|
||||||
std::cout << "Repertory core version: " << project_get_version() << std::endl;
|
std::cout << "Repertory core version: " << project_get_version() << std::endl;
|
||||||
std::cout << "Repertory git revision: " << project_get_git_rev() << std::endl;
|
std::cout << "Repertory Git revision: " << project_get_git_rev() << std::endl;
|
||||||
drive::display_version_information(args);
|
drive::display_version_information(args);
|
||||||
}
|
}
|
||||||
} // namespace repertory::cli::actions
|
} // namespace repertory::cli::actions
|
||||||
|
@ -41,7 +41,7 @@ using repertory_drive = repertory::winfsp_drive;
|
|||||||
using remote_client = repertory::remote_winfsp::remote_client;
|
using remote_client = repertory::remote_winfsp::remote_client;
|
||||||
using remote_drive = repertory::remote_winfsp::remote_winfsp_drive;
|
using remote_drive = repertory::remote_winfsp::remote_winfsp_drive;
|
||||||
using remote_instance = repertory::remote_winfsp::i_remote_instance;
|
using remote_instance = repertory::remote_winfsp::i_remote_instance;
|
||||||
#else // !defined(_WIN32)
|
#else
|
||||||
#include "drives/fuse/fuse_drive.hpp"
|
#include "drives/fuse/fuse_drive.hpp"
|
||||||
#include "drives/fuse/remotefuse/remote_client.hpp"
|
#include "drives/fuse/remotefuse/remote_client.hpp"
|
||||||
#include "drives/fuse/remotefuse/remote_fuse_drive.hpp"
|
#include "drives/fuse/remotefuse/remote_fuse_drive.hpp"
|
||||||
@ -50,7 +50,7 @@ using repertory_drive = repertory::fuse_drive;
|
|||||||
using remote_client = repertory::remote_fuse::remote_client;
|
using remote_client = repertory::remote_fuse::remote_client;
|
||||||
using remote_drive = repertory::remote_fuse::remote_fuse_drive;
|
using remote_drive = repertory::remote_fuse::remote_fuse_drive;
|
||||||
using remote_instance = repertory::remote_fuse::i_remote_instance;
|
using remote_instance = repertory::remote_fuse::i_remote_instance;
|
||||||
#endif // defined(_WIN32)
|
#endif
|
||||||
|
|
||||||
namespace repertory::cli::actions {
|
namespace repertory::cli::actions {
|
||||||
[[nodiscard]] inline auto
|
[[nodiscard]] inline auto
|
||||||
@ -77,8 +77,7 @@ mount(std::vector<const char *> args, std::string data_directory,
|
|||||||
config.set_remote_config(cfg);
|
config.set_remote_config(cfg);
|
||||||
} else if (prov == provider_type::sia &&
|
} else if (prov == provider_type::sia &&
|
||||||
config.get_sia_config().bucket.empty()) {
|
config.get_sia_config().bucket.empty()) {
|
||||||
[[maybe_unused]] auto bucket =
|
config.set_value_by_name("SiaConfig.Bucket", unique_id);
|
||||||
config.set_value_by_name("SiaConfig.Bucket", unique_id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "Generated " << app_config::get_provider_display_name(prov)
|
std::cout << "Generated " << app_config::get_provider_display_name(prov)
|
||||||
@ -158,8 +157,7 @@ mount(std::vector<const char *> args, std::string data_directory,
|
|||||||
} else {
|
} else {
|
||||||
if (prov == provider_type::sia &&
|
if (prov == provider_type::sia &&
|
||||||
config.get_sia_config().bucket.empty()) {
|
config.get_sia_config().bucket.empty()) {
|
||||||
[[maybe_unused]] auto bucket =
|
config.set_value_by_name("SiaConfig.Bucket", unique_id);
|
||||||
config.set_value_by_name("SiaConfig.Bucket", unique_id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -339,30 +339,4 @@ TYPED_TEST(file_db_test, item_not_found_is_returned_for_non_existing_api_path) {
|
|||||||
this->file_db->get_source_path("/file", source_path));
|
this->file_db->get_source_path("/file", source_path));
|
||||||
EXPECT_TRUE(source_path.empty());
|
EXPECT_TRUE(source_path.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
TYPED_TEST(file_db_test, can_enumerate_item_list) {
|
|
||||||
this->file_db->clear();
|
|
||||||
|
|
||||||
EXPECT_EQ(api_error::success,
|
|
||||||
this->file_db->add_directory("/", std::filesystem::current_path().string()));
|
|
||||||
EXPECT_EQ(api_error::success, this->file_db->add_or_update_file({
|
|
||||||
"/file",
|
|
||||||
0U,
|
|
||||||
{},
|
|
||||||
"c:\\test\\file.txt",
|
|
||||||
}));
|
|
||||||
|
|
||||||
auto call_count{0U};
|
|
||||||
const auto get_stop_requested = []() -> bool { return false; };
|
|
||||||
|
|
||||||
this->file_db->enumerate_item_list(
|
|
||||||
[&call_count](auto &&list) {
|
|
||||||
EXPECT_EQ(std::size_t(2U), list.size());
|
|
||||||
++call_count;
|
|
||||||
},
|
|
||||||
get_stop_requested);
|
|
||||||
|
|
||||||
EXPECT_EQ(std::size_t(1U), call_count);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace repertory
|
} // namespace repertory
|
||||||
|
@ -615,35 +615,4 @@ TYPED_TEST(meta_db_test, check_set_item_meta_file_defaults) {
|
|||||||
EXPECT_EQ(0U, utils::string::to_uint64(meta[META_SIZE]));
|
EXPECT_EQ(0U, utils::string::to_uint64(meta[META_SIZE]));
|
||||||
EXPECT_TRUE(meta[META_SOURCE].empty());
|
EXPECT_TRUE(meta[META_SOURCE].empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
TYPED_TEST(meta_db_test, can_enumerate_api_path_list) {
|
|
||||||
this->meta_db->clear();
|
|
||||||
|
|
||||||
auto test_dir = create_test_file();
|
|
||||||
EXPECT_EQ(api_error::success,
|
|
||||||
this->meta_db->set_item_meta(
|
|
||||||
test_dir, {
|
|
||||||
{META_DIRECTORY, utils::string::from_bool(true)},
|
|
||||||
}));
|
|
||||||
|
|
||||||
auto test_file = create_test_file();
|
|
||||||
EXPECT_EQ(
|
|
||||||
api_error::success,
|
|
||||||
this->meta_db->set_item_meta(
|
|
||||||
test_file, {
|
|
||||||
{META_DIRECTORY, utils::string::from_bool(false)},
|
|
||||||
}));
|
|
||||||
|
|
||||||
auto call_count{0U};
|
|
||||||
const auto get_stop_requested = []() -> bool { return false; };
|
|
||||||
|
|
||||||
this->meta_db->enumerate_api_path_list(
|
|
||||||
[&call_count](auto &&list) {
|
|
||||||
EXPECT_EQ(std::size_t(2U), list.size());
|
|
||||||
++call_count;
|
|
||||||
},
|
|
||||||
get_stop_requested);
|
|
||||||
|
|
||||||
EXPECT_EQ(std::size_t(1U), call_count);
|
|
||||||
}
|
|
||||||
} // namespace repertory
|
} // namespace repertory
|
||||||
|
@ -23,7 +23,6 @@ cmake "${PROJECT_SOURCE_DIR}" \
|
|||||||
-DPROJECT_COMPANY_NAME="${PROJECT_COMPANY_NAME}" \
|
-DPROJECT_COMPANY_NAME="${PROJECT_COMPANY_NAME}" \
|
||||||
-DPROJECT_COPYRIGHT="${PROJECT_COPYRIGHT}" \
|
-DPROJECT_COPYRIGHT="${PROJECT_COPYRIGHT}" \
|
||||||
-DPROJECT_DESC="${PROJECT_DESC}" \
|
-DPROJECT_DESC="${PROJECT_DESC}" \
|
||||||
-DPROJECT_INTERFACE=1 \
|
|
||||||
-DPROJECT_URL="${PROJECT_URL}" \
|
-DPROJECT_URL="${PROJECT_URL}" \
|
||||||
${PROJECT_CMAKE_OPTS} || exit 1
|
${PROJECT_CMAKE_OPTS} || exit 1
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user