From 98e64770fbc04cc360e65b4e10c8525dca8317f0 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sun, 22 Nov 2026 18:45:45 -0600 Subject: [PATCH] updated build system --- .cspell/words.txt | 2 + .gitignore | 3 +- cmake/hashes.cmake | 2 +- cmake/versions.cmake | 2 +- docker/aarch64/alpine | 47 ++++++- docker/{x86_64 => any}/flutter | 0 docker/x86_64/alpine | 47 ++++++- docker/x86_64/mingw64 | 34 ++++- post_build.sh | 8 +- pre_build.sh | 21 +++ project.cmake | 4 + repertory/librepertory/include/app_config.hpp | 3 + .../sia_indexd/sia_indexd_provider.hpp | 123 ++++++++++++++++++ .../librepertory/include/types/repertory.hpp | 32 +++++ repertory/librepertory/src/app_config.cpp | 24 +++- .../librepertory/src/providers/provider.cpp | 10 +- .../sia_indexd/sia_indexd_provider.cpp | 106 +++++++++++++++ .../librepertory/src/types/repertory.cpp | 10 ++ scripts/docker_common.sh | 6 + scripts/make_flutter.sh | 2 +- scripts/versions.sh | 2 +- support/3rd_party/icu_configure.sh | 2 +- .../3rd_party/mingw64/icu-release-78.3.tar.gz | 3 - .../mingw64/icu-release-78.3.tar.gz.sha256 | 1 - .../3rd_party/mingw64/icu-release-79.1.tar.gz | 3 + .../mingw64/icu-release-79.1.tar.gz.sha256 | 1 + 26 files changed, 472 insertions(+), 26 deletions(-) rename docker/{x86_64 => any}/flutter (100%) create mode 100755 pre_build.sh create mode 100644 repertory/librepertory/include/providers/sia_indexd/sia_indexd_provider.hpp create mode 100644 repertory/librepertory/src/providers/sia_indexd/sia_indexd_provider.cpp delete mode 100644 support/3rd_party/mingw64/icu-release-78.3.tar.gz delete mode 100644 support/3rd_party/mingw64/icu-release-78.3.tar.gz.sha256 create mode 100644 support/3rd_party/mingw64/icu-release-79.1.tar.gz create mode 100644 support/3rd_party/mingw64/icu-release-79.1.tar.gz.sha256 diff --git a/.cspell/words.txt b/.cspell/words.txt index 05e2307..68cca2f 100644 --- a/.cspell/words.txt +++ b/.cspell/words.txt @@ -15,6 +15,7 @@ binutils_version bitcoinsystem boost_asio_has_std_string_view bugprone +cabi cflags chrono clsid @@ -139,6 +140,7 @@ hwnd icudata icui18n icuuc +indexd inproc iostreams iphlpapi diff --git a/.gitignore b/.gitignore index 21af86f..28166cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .DS_Store .cache/ +.flutter-companion .vs/ Info.plist build*/ @@ -11,7 +12,7 @@ override.sh repertory.iss scripts/cleanup.cmd scripts/cleanup.sh +sia-sdk-rs/ support/Dockerfile version.cpp version.rc -.flutter-companion diff --git a/cmake/hashes.cmake b/cmake/hashes.cmake index 63b3db3..3339179 100644 --- a/cmake/hashes.cmake +++ b/cmake/hashes.cmake @@ -6,7 +6,7 @@ set(CURL_HASH 222c6b5c1f368ac63aed59bce2774eb5def9e8e67e46e800be182e684d2845a3) set(EXPAT_HASH 6e8ce7b52ebbaa423c59becc7cf1e6875c42e49228c062ac8123c10e700cec27) set(GCC_HASH 7294d65cc1a0558cb815af0ca8c7763d86f7a31199794ede3f630c0d1b0a5723) set(GTEST_HASH 6e3191c1455468b3fc35a417fb565c1c5071aee1b7e7f85e30cf48a98d37d8b5) -set(ICU_HASH f06bcab72736ee9d55689033b8198a178562354128cf38edb2afc2e67e3fd931) +set(ICU_HASH 195b1dbb083321cc097e8cf88eca73de34fb41418f091748f7b6a829a4d40f1d) set(INNOSETUP_HASH 0362a383ed217d4c4239b5933866dd96d3eb2102737da92f80f6057a4b40df2f) set(JSON_HASH 4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187) set(LIBSODIUM_HASH 5838bb0c3da6148c24ebe531d1ed1297de9a87aea77d426bcd99f289e681631c) diff --git a/cmake/versions.cmake b/cmake/versions.cmake index 237506c..ccc7df6 100644 --- a/cmake/versions.cmake +++ b/cmake/versions.cmake @@ -12,7 +12,7 @@ set(EXPAT2_VERSION 2_9_0) set(EXPAT_VERSION 2.9.0) set(GCC_VERSION 15.2.0) set(GTEST_VERSION 1.18.0) -set(ICU_VERSION 78.3) +set(ICU_VERSION 79.1) set(INNOSETUP2_VERSION 7_1_0) set(INNOSETUP_VERSION 7.1.0) set(JSON_VERSION 3.12.0) diff --git a/docker/aarch64/alpine b/docker/aarch64/alpine index 111e267..5d017e8 100644 --- a/docker/aarch64/alpine +++ b/docker/aarch64/alpine @@ -1,5 +1,5 @@ #comment -FROM arm64v8/alpine:3.24.2 +FROM arm64v8/alpine:3.24.4 MAINTAINER Scott E. Graves CMD bash @@ -16,6 +16,7 @@ RUN apk add \ boost-dev \ bzip2-static \ cmake \ + curl \ diffutils \ elfutils-dev \ file \ @@ -83,3 +84,47 @@ RUN apk add \ RUN ln -sf /usr/bin/aclocal-1.18 /usr/bin/aclocal-1.16 RUN ln -sf /usr/bin/automake-1.18 /usr/bin/automake-1.16 + +ARG ICU_VERSION +ENV MY_ICU_VERSION=${ICU_VERSION} +COPY ./3rd_party/mingw64/icu-release-${ICU_VERSION}.tar.gz ./3rd_party/mingw64/icu-release-${ICU_VERSION}.tar.gz.sha256 /tmp/ +RUN test -n "${MY_ICU_VERSION}" \ + && cd /tmp \ + && sha256sum -c ./icu-release-${MY_ICU_VERSION}.tar.gz.sha256 \ + && tar xzf ./icu-release-${MY_ICU_VERSION}.tar.gz \ + && cd icu-release-${MY_ICU_VERSION}/icu4c/source \ + && CXXFLAGS="-std=gnu++17" ./configure \ + --disable-samples \ + --disable-tests \ + --enable-shared \ + --enable-static \ + --prefix=/usr/local \ + && make \ + && make install \ + && cd /tmp \ + && rm -rf icu-release-${MY_ICU_VERSION} icu-release-${MY_ICU_VERSION}.tar.gz* + +ARG RUST_VERSION=stable + +ENV RUSTUP_HOME=/opt/rustup +ENV CARGO_HOME=/opt/cargo +ENV PATH="/opt/cargo/bin:${PATH}" + +RUN curl --proto '=https' --tlsv1.2 -fsSL \ + https://sh.rustup.rs -o /tmp/rustup-init.sh \ + && sh /tmp/rustup-init.sh \ + -y \ + --no-modify-path \ + --profile minimal \ + --default-toolchain "${RUST_VERSION}" \ + && rm /tmp/rustup-init.sh + +ARG GID +ARG UID +RUN chown -R "${UID}:${GID}" /opt/rustup +RUN chown -R "${UID}:${GID}" /opt/cargo + +RUN rustc --version \ + && cargo --version \ + && rustup target list --installed + diff --git a/docker/x86_64/flutter b/docker/any/flutter similarity index 100% rename from docker/x86_64/flutter rename to docker/any/flutter diff --git a/docker/x86_64/alpine b/docker/x86_64/alpine index 4c128fa..27977cd 100644 --- a/docker/x86_64/alpine +++ b/docker/x86_64/alpine @@ -1,5 +1,5 @@ #comment -FROM --platform=linux/amd64 alpine:3.24.2 +FROM --platform=linux/amd64 alpine:3.24.4 MAINTAINER Scott E. Graves CMD bash @@ -16,6 +16,7 @@ RUN apk add \ boost-dev \ bzip2-static \ cmake \ + curl \ diffutils \ elfutils-dev \ file \ @@ -83,3 +84,47 @@ RUN apk add \ RUN ln -sf /usr/bin/aclocal-1.18 /usr/bin/aclocal-1.16 RUN ln -sf /usr/bin/automake-1.18 /usr/bin/automake-1.16 + +ARG ICU_VERSION +ENV MY_ICU_VERSION=${ICU_VERSION} +COPY ./3rd_party/mingw64/icu-release-${ICU_VERSION}.tar.gz ./3rd_party/mingw64/icu-release-${ICU_VERSION}.tar.gz.sha256 /tmp/ +RUN test -n "${MY_ICU_VERSION}" \ + && cd /tmp \ + && sha256sum -c ./icu-release-${MY_ICU_VERSION}.tar.gz.sha256 \ + && tar xzf ./icu-release-${MY_ICU_VERSION}.tar.gz \ + && cd icu-release-${MY_ICU_VERSION}/icu4c/source \ + && CXXFLAGS="-std=gnu++17" ./configure \ + --disable-samples \ + --disable-tests \ + --enable-shared \ + --enable-static \ + --prefix=/usr/local \ + && make \ + && make install \ + && cd /tmp \ + && rm -rf icu-release-${MY_ICU_VERSION} icu-release-${MY_ICU_VERSION}.tar.gz* + +ARG RUST_VERSION=stable + +ENV RUSTUP_HOME=/opt/rustup +ENV CARGO_HOME=/opt/cargo +ENV PATH="/opt/cargo/bin:${PATH}" + +RUN curl --proto '=https' --tlsv1.2 -fsSL \ + https://sh.rustup.rs -o /tmp/rustup-init.sh \ + && sh /tmp/rustup-init.sh \ + -y \ + --no-modify-path \ + --profile minimal \ + --default-toolchain "${RUST_VERSION}" \ + && rm /tmp/rustup-init.sh + +ARG GID +ARG UID +RUN chown -R "${UID}:${GID}" /opt/rustup +RUN chown -R "${UID}:${GID}" /opt/cargo + +RUN rustc --version \ + && cargo --version \ + && rustup target list --installed + diff --git a/docker/x86_64/mingw64 b/docker/x86_64/mingw64 index 2f99846..27422af 100644 --- a/docker/x86_64/mingw64 +++ b/docker/x86_64/mingw64 @@ -1,5 +1,5 @@ #comment -FROM --platform=linux/amd64 alpine:3.24.2 +FROM --platform=linux/amd64 alpine:3.24.4 RUN apk update RUN apk upgrade @@ -11,6 +11,7 @@ RUN apk add \ binutils \ bison \ bzip2 \ + ca-certificates \ clang21-extra-tools \ cmake \ curl \ @@ -1193,6 +1194,37 @@ RUN (cp ${MY_MINGW_DIR}/lib/*.dll ${MY_MINGW_DIR}/bin || echo "no dll's found") && rm -rf /3rd_party \ && rm -rf /root/.wine +ARG RUST_VERSION=stable + +ENV RUSTUP_HOME=/opt/rustup +ENV CARGO_HOME=/opt/cargo +ENV PATH="/opt/cargo/bin:${PATH}" + +RUN curl --proto '=https' --tlsv1.2 -fsSL \ + https://sh.rustup.rs -o /tmp/rustup-init.sh \ + && sh /tmp/rustup-init.sh \ + -y \ + --no-modify-path \ + --profile minimal \ + --default-host x86_64-unknown-linux-musl \ + --default-toolchain "${RUST_VERSION}" \ + --target x86_64-pc-windows-gnu \ + && rm /tmp/rustup-init.sh + +ENV CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER="${MY_MINGW_PREFIX}-gcc" +ENV CC_x86_64_pc_windows_gnu="${MY_MINGW_PREFIX}-gcc" +ENV CXX_x86_64_pc_windows_gnu="${MY_MINGW_PREFIX}-g++" +ENV AR_x86_64_pc_windows_gnu="${MY_MINGW_PREFIX}-ar" + +RUN rustc --version \ + && cargo --version \ + && rustup target list --installed + +ARG GID +ARG UID +RUN chown -R "${UID}:${GID}" /opt/rustup +RUN chown -R "${UID}:${GID}" /opt/cargo + USER $USERNAME WORKDIR /home/$USERNAME diff --git a/post_build.sh b/post_build.sh index f9b107d..0819437 100755 --- a/post_build.sh +++ b/post_build.sh @@ -1,10 +1,10 @@ -#!/bin/bash +#!/usr/bin/env bash CURRENT_DIR=$(dirname "$0") -CURRENT_DIR=$(realpath ${CURRENT_DIR}) +CURRENT_DIR=$(realpath "${CURRENT_DIR}") -rsync -av --progress ${CURRENT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}_test/test_input/ \ - ${PROJECT_BUILD_DIR}/build/test_input/ +rsync -av --progress "${CURRENT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}_test/test_input/" \ + "${PROJECT_BUILD_DIR}/build/test_input/" rsync -av --progress ${CURRENT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}_test/test_input/ \ ${PROJECT_DIST_DIR}/test_input/ diff --git a/pre_build.sh b/pre_build.sh new file mode 100755 index 0000000..c9504d6 --- /dev/null +++ b/pre_build.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +CURRENT_DIR=$(dirname "$0") +CURRENT_DIR=$(realpath "${CURRENT_DIR}") + +pushd "${CURRENT_DIR}" +git clone https://github.com/SiaFoundation/sia-sdk-rs.git +pushd "sia-sdk-rs" +git pull + +if [ "${PROJECT_IS_MINGW}" == "1" ]; then + cargo build --locked --release \ + --target x86_64-pc-windows-gnu \ + -p sia_storage_cabi +else + cargo build --locked --release \ + -p sia_storage_cabi +fi + +popd +popd diff --git a/project.cmake b/project.cmake index cc4085d..47930d9 100644 --- a/project.cmake +++ b/project.cmake @@ -1,5 +1,9 @@ set(CMAKE_CXX_FLAGS "-include common.hpp ${CMAKE_CXX_FLAGS}") +include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/sia-sdk-rs/sia_storage_cabi/include) +link_directories(${CMAKE_CURRENT_SOURCE_DIR}/sia-sdk-rs/target/release) +link_libraries(sia_storage_cabi.a) + add_project_library(lib${PROJECT_NAME} "" "" "${PROJECT_ADDITIONAL_SOURCES}") add_project_executable(${PROJECT_NAME} lib${PROJECT_NAME} lib${PROJECT_NAME}) diff --git a/repertory/librepertory/include/app_config.hpp b/repertory/librepertory/include/app_config.hpp index 2049a24..579ae64 100644 --- a/repertory/librepertory/include/app_config.hpp +++ b/repertory/librepertory/include/app_config.hpp @@ -106,6 +106,7 @@ private: utils::atomic remote_mount_; utils::atomic s3_config_; utils::atomic sia_config_; + utils::atomic sia_indexd_config_; std::unordered_map> value_get_lookup_; std::unordered_map> @@ -187,6 +188,8 @@ public: [[nodiscard]] auto get_sia_config() const -> sia_config; + [[nodiscard]] auto get_sia_indexd_config() const -> sia_indexd_config; + [[nodiscard]] auto get_task_wait_ms() const -> std::uint16_t; [[nodiscard]] auto get_value_by_name(std::string_view name) const diff --git a/repertory/librepertory/include/providers/sia_indexd/sia_indexd_provider.hpp b/repertory/librepertory/include/providers/sia_indexd/sia_indexd_provider.hpp new file mode 100644 index 0000000..3b6c155 --- /dev/null +++ b/repertory/librepertory/include/providers/sia_indexd/sia_indexd_provider.hpp @@ -0,0 +1,123 @@ +/* + Copyright <2018-2026> + + 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_PROVIDERS_SIA_INDEXD_SIA_INDEXD_PROVIDER_HPP_ +#define REPERTORY_INCLUDE_PROVIDERS_SIA_INDEXD_SIA_INDEXD_PROVIDER_HPP_ + +#include "providers/base_provider.hpp" +#include "types/repertory.hpp" + +namespace repertory { +class app_config; +class i_file_manager; +struct i_http_comm; + +class sia_indexd_provider : public base_provider { +public: + static const constexpr auto type{provider_type::sia_indexd}; + +public: + sia_indexd_provider(app_config &config, i_http_comm &comm); + + ~sia_indexd_provider() override = default; + +public: + sia_indexd_provider(const sia_indexd_provider &) = delete; + sia_indexd_provider(sia_indexd_provider &&) = delete; + auto operator=(const sia_indexd_provider &) -> sia_indexd_provider & = delete; + auto operator=(sia_indexd_provider &&) -> sia_indexd_provider & = delete; + +private: + sia_indexd_config sia_indexd_config_; + +protected: + [[nodiscard]] auto create_directory_impl(std::string_view api_path, + api_meta_map &meta) + -> api_error override; + + [[nodiscard]] auto get_directory_items_impl(std::string_view api_path, + directory_item_list &list) const + -> api_error override; + + [[nodiscard]] auto remove_directory_impl(std::string_view api_path) + -> api_error override; + + [[nodiscard]] auto remove_file_impl(std::string_view api_path) + -> api_error override; + + [[nodiscard]] auto upload_file_impl(std::string_view api_path, + std::string_view source_path, + stop_type &stop_requested) + -> api_error override; + +public: + [[nodiscard]] auto check_version(std::string &required_version, + std::string &returned_version) const + -> bool override; + + [[nodiscard]] auto get_directory_item_count(std::string_view api_path) const + -> std::uint64_t override; + + [[nodiscard]] auto get_file(std::string_view api_path, api_file &file) const + -> api_error override; + + [[nodiscard]] auto get_file_list(api_file_list &list, + std::string &marker) const + -> api_error override; + + [[nodiscard]] auto get_provider_type() const -> provider_type override { + return type; + } + + [[nodiscard]] auto get_total_drive_space() const -> std::uint64_t override; + + [[nodiscard]] auto is_directory(std::string_view api_path, bool &exists) const + -> api_error override; + + [[nodiscard]] auto is_file(std::string_view api_path, bool &exists) const + -> api_error override; + + [[nodiscard]] auto is_online() const -> bool override; + + [[nodiscard]] auto is_rename_supported() const -> bool override { + return false; + } + + [[nodiscard]] auto read_file_bytes(std::string_view api_path, + std::size_t size, std::uint64_t offset, + data_buffer &buffer, + stop_type &stop_requested) + -> api_error override; + + [[nodiscard]] auto rename_file(std::string_view /*from_api_path*/, + std::string_view /*to_api_path*/) + -> api_error override { + return api_error::not_implemented; + } + + [[nodiscard]] auto start(api_item_added_callback api_item_added, + i_file_manager *mgr) -> bool override; + + void stop() override; +}; +} // namespace repertory + +#endif // REPERTORY_INCLUDE_PROVIDERS_SIA_INDEXD_SIA_INDEXD_PROVIDER_HPP_ diff --git a/repertory/librepertory/include/types/repertory.hpp b/repertory/librepertory/include/types/repertory.hpp index 96aa19d..06fa735 100644 --- a/repertory/librepertory/include/types/repertory.hpp +++ b/repertory/librepertory/include/types/repertory.hpp @@ -231,6 +231,7 @@ enum class provider_type : std::size_t { remote, s3, encrypt, + sia_indexd, unknown, }; @@ -392,6 +393,26 @@ struct sia_config final { } }; +struct sia_indexd_config final { + std::string bucket; + + auto operator==(const sia_indexd_config &cfg) const noexcept -> bool { + if (&cfg != this) { + return bucket == cfg.bucket; + } + + return true; + } + + auto operator!=(const sia_indexd_config &cfg) const noexcept -> bool { + if (&cfg != this) { + return not(cfg == *this); + } + + return false; + } +}; + using api_file_list = std::vector; using api_file_provider_callback = std::function; using api_item_added_callback = std::function; @@ -449,6 +470,7 @@ inline constexpr auto JSON_S3_CONFIG{"S3Config"}; inline constexpr auto JSON_SECRET_KEY{"SecretKey"}; inline constexpr auto JSON_SEND_TIMEOUT_MS{"SendTimeoutMs"}; inline constexpr auto JSON_SIA_CONFIG{"SiaConfig"}; +inline constexpr auto JSON_SIA_INDEXD_CONFIG{"SiaIndexdConfig"}; inline constexpr auto JSON_SIZE{"Size"}; inline constexpr auto JSON_TASK_WAIT_MS{"TaskWaitMs"}; inline constexpr auto JSON_TIMEOUT_MS{"TimeoutMs"}; @@ -579,6 +601,16 @@ template <> struct adl_serializer { } }; +template <> struct adl_serializer { + static void to_json(json &data, const repertory::sia_indexd_config &value) { + data[repertory::JSON_BUCKET] = value.bucket; + } + + static void from_json(const json &data, repertory::sia_indexd_config &value) { + data.at(repertory::JSON_BUCKET).get_to(value.bucket); + } +}; + template struct adl_serializer> { static void to_json(json &data, diff --git a/repertory/librepertory/src/app_config.cpp b/repertory/librepertory/src/app_config.cpp index 035f922..8e187c3 100644 --- a/repertory/librepertory/src/app_config.cpp +++ b/repertory/librepertory/src/app_config.cpp @@ -719,7 +719,7 @@ auto app_config::default_agent_name(provider_type prov) -> std::string { "", "", "", - }; + }; return PROVIDER_AGENT_NAMES.at(static_cast(prov)); } @@ -732,7 +732,7 @@ auto app_config::default_api_port(provider_type prov) -> std::uint16_t { 0U, 0U, 0U, - }; + }; return PROVIDER_API_PORTS.at(static_cast(prov)); } @@ -774,7 +774,7 @@ auto app_config::default_remote_api_port(provider_type prov) -> std::uint16_t { 20010U, 20100U, 20001U, - }; + }; return PROVIDER_REMOTE_PORTS.at(static_cast(prov)); } @@ -922,6 +922,11 @@ auto app_config::get_json() const -> json { ret.erase(JSON_REMOTE_CONFIG); ret.erase(JSON_S3_CONFIG); } break; + case provider_type::sia_indexd: { + ret.erase(JSON_ENCRYPT_CONFIG); + ret.erase(JSON_REMOTE_CONFIG); + ret.erase(JSON_S3_CONFIG); + } break; default: throw std::runtime_error( fmt::format("unsupported provider type|{}", get_provider_name(prov_))); @@ -967,8 +972,8 @@ auto app_config::get_provider_display_name(provider_type prov) -> std::string { static const std::array(provider_type::unknown) + 1U> PROVIDER_DISPLAY_NAMES = { - "Sia", "Remote", "S3", "Encrypt", "Unknown", - }; + "Sia", "Remote", "S3", "Encrypt", "Sia Indexd", "Unknown", + }; return PROVIDER_DISPLAY_NAMES.at(static_cast(prov)); } @@ -976,8 +981,8 @@ auto app_config::get_provider_name(provider_type prov) -> std::string { static const std::array(provider_type::unknown) + 1U> PROVIDER_NAMES = { - "sia", "remote", "s3", "encrypt", "unknown", - }; + "sia", "remote", "s3", "encrypt", "sia_indexd", "unknown", + }; return PROVIDER_NAMES.at(static_cast(prov)); } @@ -1005,6 +1010,10 @@ auto app_config::get_s3_config() const -> s3_config { return s3_config_; } auto app_config::get_sia_config() const -> sia_config { return sia_config_; } +auto app_config::get_sia_indexd_config() const -> sia_indexd_config { + return sia_indexd_config_; +} + auto app_config::get_task_wait_ms() const -> std::uint16_t { return std::max(min_task_wait_ms, task_wait_ms_.load()); } @@ -1095,6 +1104,7 @@ auto app_config::load() -> bool { found); get_value(json_document, JSON_S3_CONFIG, s3_config_, found); get_value(json_document, JSON_SIA_CONFIG, sia_config_, found); + get_value(json_document, JSON_SIA_INDEXD_CONFIG, sia_indexd_config_, found); get_value(json_document, JSON_TASK_WAIT_MS, task_wait_ms_, found); std::uint64_t version{}; diff --git a/repertory/librepertory/src/providers/provider.cpp b/repertory/librepertory/src/providers/provider.cpp index f991be3..058b5ed 100644 --- a/repertory/librepertory/src/providers/provider.cpp +++ b/repertory/librepertory/src/providers/provider.cpp @@ -27,6 +27,7 @@ #include "providers/encrypt/encrypt_provider.hpp" #include "providers/s3/s3_provider.hpp" #include "providers/sia/sia_provider.hpp" +#include "providers/sia_indexd/sia_indexd_provider.hpp" #include "types/startup_exception.hpp" namespace { @@ -42,8 +43,8 @@ inline void create_comm(std::unique_ptr &comm, const config_t &config) { } // namespace namespace repertory { -auto create_provider(provider_type prov, - app_config &config) -> std::unique_ptr { +auto create_provider(provider_type prov, app_config &config) + -> std::unique_ptr { static std::mutex mutex; mutex_lock lock(mutex); @@ -55,6 +56,11 @@ auto create_provider(provider_type prov, config.get_host_config()); return std::make_unique(config, *comm); } + case provider_type::sia_indexd: { + create_comm(comm, + config.get_host_config()); + return std::make_unique(config, *comm); + } case provider_type::s3: { create_comm(comm, config.get_s3_config()); diff --git a/repertory/librepertory/src/providers/sia_indexd/sia_indexd_provider.cpp b/repertory/librepertory/src/providers/sia_indexd/sia_indexd_provider.cpp new file mode 100644 index 0000000..1546165 --- /dev/null +++ b/repertory/librepertory/src/providers/sia_indexd/sia_indexd_provider.cpp @@ -0,0 +1,106 @@ +/* + Copyright <2018-2026> + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*/ +#include "providers/sia_indexd/sia_indexd_provider.hpp" + +namespace repertory { +sia_indexd_provider::sia_indexd_provider(app_config &config, i_http_comm &comm) + : base_provider(config, comm) {} + +auto sia_indexd_provider::create_directory_impl(std::string_view api_path, + api_meta_map &meta) + -> api_error { + return api_error::not_implemented; +} + +auto sia_indexd_provider::get_directory_items_impl( + std::string_view api_path, directory_item_list &list) const -> api_error { + return api_error::not_implemented; +} + +auto sia_indexd_provider::remove_directory_impl(std::string_view api_path) + -> api_error { + return api_error::not_implemented; +} + +auto sia_indexd_provider::remove_file_impl(std::string_view api_path) + -> api_error { + return api_error::not_implemented; +} + +auto sia_indexd_provider::upload_file_impl(std::string_view api_path, + std::string_view source_path, + stop_type &stop_requested) + -> api_error { + return api_error::not_implemented; +} + +auto sia_indexd_provider::check_version(std::string &required_version, + std::string &returned_version) const + -> bool { + return false; +} + +auto sia_indexd_provider::get_directory_item_count( + std::string_view api_path) const -> std::uint64_t { + return 0U; +} + +auto sia_indexd_provider::get_file(std::string_view api_path, + api_file &file) const -> api_error { + return api_error::not_implemented; +} + +auto sia_indexd_provider::get_file_list(api_file_list &list, + std::string &marker) const + -> api_error { + return api_error::not_implemented; +} + +auto sia_indexd_provider::get_total_drive_space() const -> std::uint64_t { + return 0U; +} + +auto sia_indexd_provider::is_directory(std::string_view api_path, + bool &exists) const -> api_error { + return api_error::not_implemented; +} + +auto sia_indexd_provider::is_file(std::string_view api_path, bool &exists) const + -> api_error { + return api_error::not_implemented; +} + +auto sia_indexd_provider::is_online() const -> bool { return false; } + +auto sia_indexd_provider::read_file_bytes( + std::string_view api_path, std::size_t size, std::uint64_t offset, + data_buffer &buffer, stop_type &stop_requested) -> api_error { + return api_error::not_implemented; +} + +auto sia_indexd_provider::start(api_item_added_callback api_item_added, + i_file_manager *mgr) -> bool { + return false; +} + +void sia_indexd_provider::stop() {} +} // namespace repertory diff --git a/repertory/librepertory/src/types/repertory.cpp b/repertory/librepertory/src/types/repertory.cpp index a467b5c..21add47 100644 --- a/repertory/librepertory/src/types/repertory.cpp +++ b/repertory/librepertory/src/types/repertory.cpp @@ -49,6 +49,12 @@ void clean_json_config(provider_type prov, nlohmann::json &data) { data[JSON_REMOTE_MOUNT][JSON_ENCRYPTION_TOKEN] = ""; data[JSON_HOST_CONFIG][JSON_API_PASSWORD] = ""; + break; + + case provider_type::sia_indexd: + data[JSON_REMOTE_MOUNT][JSON_ENCRYPTION_TOKEN] = ""; + data[JSON_HOST_CONFIG][JSON_API_PASSWORD] = ""; + break; default: return; @@ -264,6 +270,10 @@ auto provider_type_from_string(std::string_view type, return provider_type::sia; } + if (type_lower == "sia_indexd") { + return provider_type::sia_indexd; + } + if (type_lower == "unknown") { return provider_type::unknown; } diff --git a/scripts/docker_common.sh b/scripts/docker_common.sh index a16f5f2..93ca354 100755 --- a/scripts/docker_common.sh +++ b/scripts/docker_common.sh @@ -12,6 +12,12 @@ if [ "${DOCKER_NAME}" == "mingw64" ]; then else IS_MINGW=0 IS_UNIX=0 + if [ "${DOCKER_NAME}" == "alpine" ]; then + . "$(dirname "${BASH_SOURCE[0]}")/versions.sh" + if [ -n "${PROJECT_VERSIONS[ICU]}" ]; then + APP_VERSION_BUILD_ARGS="--build-arg ICU_VERSION=${PROJECT_VERSIONS[ICU]}" + fi + fi fi if [ "${DOCKER_CREATE_ONLY}" != "1" ]; then diff --git a/scripts/make_flutter.sh b/scripts/make_flutter.sh index 3b9973a..cac6c55 100755 --- a/scripts/make_flutter.sh +++ b/scripts/make_flutter.sh @@ -16,7 +16,7 @@ if [ -f "${PROJECT_SOURCE_DIR}/web/${PROJECT_NAME}/pubspec.yaml" ]; then --build-arg UID=$(id -u) \ --build-arg GID=$(id -g) \ -t ${FLUTTER_TAG_NAME} \ - -f "${PROJECT_SOURCE_DIR}/docker/x86_64/flutter" || exit 1 + -f "${PROJECT_SOURCE_DIR}/docker/any/flutter" || exit 1 docker run -td \ --name ${FLUTTER_CONTAINER_NAME} \ diff --git a/scripts/versions.sh b/scripts/versions.sh index 1e78f6f..4573e65 100755 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -15,7 +15,7 @@ PROJECT_VERSIONS[EXPAT]="2.9.0" PROJECT_VERSIONS[EXPAT2]="2_9_0" PROJECT_VERSIONS[GCC]="15.2.0" PROJECT_VERSIONS[GTEST]="1.18.0" -PROJECT_VERSIONS[ICU]="78.3" +PROJECT_VERSIONS[ICU]="79.1" PROJECT_VERSIONS[INNOSETUP]="7.1.0" PROJECT_VERSIONS[INNOSETUP2]="7_1_0" PROJECT_VERSIONS[JSON]="3.12.0" diff --git a/support/3rd_party/icu_configure.sh b/support/3rd_party/icu_configure.sh index b02196d..9892d13 100755 --- a/support/3rd_party/icu_configure.sh +++ b/support/3rd_party/icu_configure.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -if ([ "$(uname -m)" == "arm64" ] || [ "$(uname -m)" == "aarch64" ]) && +if ([ "$(uname -m)" == "arm64" ] || [ "$(uname -m)" == "aarch64" ]) && [ "${PROJECT_IS_ARM64}" == "0" ]; then HOST_CFG="--host=x86_64-apple-darwin" export CC="clang -arch x86_64" diff --git a/support/3rd_party/mingw64/icu-release-78.3.tar.gz b/support/3rd_party/mingw64/icu-release-78.3.tar.gz deleted file mode 100644 index 35260d5..0000000 --- a/support/3rd_party/mingw64/icu-release-78.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f06bcab72736ee9d55689033b8198a178562354128cf38edb2afc2e67e3fd931 -size 69206189 diff --git a/support/3rd_party/mingw64/icu-release-78.3.tar.gz.sha256 b/support/3rd_party/mingw64/icu-release-78.3.tar.gz.sha256 deleted file mode 100644 index 3d9a857..0000000 --- a/support/3rd_party/mingw64/icu-release-78.3.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -f06bcab72736ee9d55689033b8198a178562354128cf38edb2afc2e67e3fd931 icu-release-78.3.tar.gz diff --git a/support/3rd_party/mingw64/icu-release-79.1.tar.gz b/support/3rd_party/mingw64/icu-release-79.1.tar.gz new file mode 100644 index 0000000..f041766 --- /dev/null +++ b/support/3rd_party/mingw64/icu-release-79.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:195b1dbb083321cc097e8cf88eca73de34fb41418f091748f7b6a829a4d40f1d +size 69044151 diff --git a/support/3rd_party/mingw64/icu-release-79.1.tar.gz.sha256 b/support/3rd_party/mingw64/icu-release-79.1.tar.gz.sha256 new file mode 100644 index 0000000..6ba8419 --- /dev/null +++ b/support/3rd_party/mingw64/icu-release-79.1.tar.gz.sha256 @@ -0,0 +1 @@ +195b1dbb083321cc097e8cf88eca73de34fb41418f091748f7b6a829a4d40f1d icu-release-79.1.tar.gz