diff --git a/CMakeLists.txt b/CMakeLists.txt index 52b5d3b..8242d02 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.16) -project(git_frontend CXX) +project(sago_web_git CXX) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -41,7 +41,7 @@ add_custom_command( # --- Application ---------------------------------------------------------- -add_executable(git_frontend +add_executable(sago_web_git src/main.cpp src/application.cpp src/git_repo.cpp @@ -50,16 +50,16 @@ add_executable(git_frontend src/util.cpp ${VIEWS_CPP}) -target_include_directories(git_frontend PRIVATE +target_include_directories(sago_web_git PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CPPCMS_INCLUDE_DIR} ${GIT2_INCLUDE_DIRS}) -target_link_libraries(git_frontend PRIVATE +target_link_libraries(sago_web_git PRIVATE ${CPPCMS_LIBRARY} ${BOOSTER_LIBRARY} ${GIT2_LIBRARIES} ZLIB::ZLIB pthread) -target_compile_options(git_frontend PRIVATE ${GIT2_CFLAGS_OTHER}) +target_compile_options(sago_web_git PRIVATE ${GIT2_CFLAGS_OTHER}) diff --git a/Dockerfile b/Dockerfile index 29cb70f..c363485 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,7 +51,7 @@ COPY --from=build /usr/local/lib/libcppcms.so* /usr/local/lib/ COPY --from=build /usr/local/lib/libbooster.so* /usr/local/lib/ RUN ldconfig -COPY --from=build /src/build/git_frontend /app/git_frontend +COPY --from=build /src/build/sago_web_git /app/sago_web_git COPY --from=build /src/static /app/static COPY --from=build /src/config.json /app/config.json @@ -62,9 +62,9 @@ ENV GIT_ROOT=/srv/git VOLUME ["/srv/git"] # Generated tag archives are cached here; mount a volume to persist them. -ENV GIT_CACHE_ROOT=/var/cache/git_frontend -VOLUME ["/var/cache/git_frontend"] +ENV GIT_CACHE_ROOT=/var/cache/sago_web_git +VOLUME ["/var/cache/sago_web_git"] EXPOSE 11000 -CMD ["/app/git_frontend", "-c", "/app/config.json"] +CMD ["/app/sago_web_git", "-c", "/app/config.json"] diff --git a/README.md b/README.md index 73bb746..7acb32f 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,8 @@ default branch HEAD. - `git.static_root` — directory containing the bundled CSS/JS assets. - `git.cache_root` — directory where generated tag archives are cached, created on demand. Overridden by the `GIT_CACHE_ROOT` environment variable; - when neither is set it defaults to `$XDG_CACHE_HOME/git_frontend` (or - `$HOME/.cache/git_frontend`, falling back to `/tmp/git_frontend`). + when neither is set it defaults to `$XDG_CACHE_HOME/sago_web_git` (or + `$HOME/.cache/sago_web_git`, falling back to `/tmp/sago_web_git`). - `git.github_enterprise_hosts` — comma- or space-separated hostnames to treat as GitHub (in addition to `github.com`) when showing clone instructions on a repository's page, e.g. `github.mycompany.com git.example.org`. Overridden by @@ -62,7 +62,7 @@ Requires CppCMS (with `cppcms_tmpl_cc`), libgit2, zlib, CMake and a C++17 compil ```sh cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake --build build -j -./build/git_frontend -c config.json +./build/sago_web_git -c config.json ``` Then open . diff --git a/src/application.cpp b/src/application.cpp index ba88b6f..4aa0ec1 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -21,18 +21,18 @@ constexpr int LOG_LIMIT = 200; const std::string SKIN = "git"; // Cache directory resolution order: GIT_CACHE_ROOT env (e.g. set by the -// Dockerfile), config key "git.cache_root", then XDG_CACHE_HOME/git_frontend, -// then $HOME/.cache/git_frontend, falling back to a temp directory. +// Dockerfile), config key "git.cache_root", then XDG_CACHE_HOME/sago_web_git, +// then $HOME/.cache/sago_web_git, falling back to a temp directory. std::string resolve_cache_root(const std::string &configured) { if (const char *env = std::getenv("GIT_CACHE_ROOT"); env && *env) return env; if (!configured.empty()) return configured; if (const char *xdg = std::getenv("XDG_CACHE_HOME"); xdg && *xdg) - return std::string(xdg) + "/git_frontend"; + return std::string(xdg) + "/sago_web_git"; if (const char *home = std::getenv("HOME"); home && *home) - return std::string(home) + "/.cache/git_frontend"; - return "/tmp/git_frontend"; + return std::string(home) + "/.cache/sago_web_git"; + return "/tmp/sago_web_git"; } // Splits a comma- or whitespace-separated host list into trimmed, non-empty