From 180561fcf325740f475213cbd226684025297d9e Mon Sep 17 00:00:00 2001 From: Ian Duncan <76043277+dr8co@users.noreply.github.com> Date: Wed, 21 Feb 2024 16:50:13 +0300 Subject: [PATCH 1/8] Add generated packages to .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 226d17a..a91432d 100644 --- a/.gitignore +++ b/.gitignore @@ -618,3 +618,5 @@ Network Trash Folder Temporary Items .apdisk +# Generated packages +Packages/ From 96ec1f1ded837869d695b227cdd916e9b9f769cc Mon Sep 17 00:00:00 2001 From: Ian Duncan <76043277+dr8co@users.noreply.github.com> Date: Wed, 21 Feb 2024 16:50:46 +0300 Subject: [PATCH 2/8] Rename LICENSE --- LICENSE.md => LICENSE | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LICENSE.md => LICENSE (100%) diff --git a/LICENSE.md b/LICENSE similarity index 100% rename from LICENSE.md rename to LICENSE From b4bdf901a0010539d27e47b17101f853c2917fe0 Mon Sep 17 00:00:00 2001 From: Ian Duncan <76043277+dr8co@users.noreply.github.com> Date: Wed, 21 Feb 2024 16:51:20 +0300 Subject: [PATCH 3/8] Update buildscript.sh with required package installations and dependencies --- scripts/buildscript.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/buildscript.sh b/scripts/buildscript.sh index 0cc96bf..d1e3909 100755 --- a/scripts/buildscript.sh +++ b/scripts/buildscript.sh @@ -5,7 +5,6 @@ set -e # This script is used to build the project on the Ubuntu Jammy (22.04) distribution. # It is not intended to be used on other distributions, and must be run from the project root. -REQUIRED_PACKAGES="ninja-build gcc-13 g++-13 clang-18 lldb-18 lld-18 libc++-18-dev libc++abi-18-dev clang-tools-18 libgcrypt20 openssl libreadline8 libsodium23 libsodium-dev" PARALLELISM_LEVEL=4 function check_root() { @@ -17,7 +16,7 @@ function check_root() { } function check_dependencies() { - for cmd in wget add-apt-repository cmake; do + for cmd in wget add-apt-repository; do if ! command -v $cmd &>/dev/null; then echo "$cmd could not be found" exit @@ -30,17 +29,26 @@ function install_dependencies() { add-apt-repository -y "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" add-apt-repository -y ppa:ubuntu-toolchain-r/ppa apt update - apt install -y "$REQUIRED_PACKAGES" + apt install -y unzip gcc-13 g++-13 clang-18 lldb-18 lld-18 libc++-18-dev libc++abi-18-dev clang-tools-18 libgcrypt20 openssl libreadline8 libsodium23 libsodium-dev # Install CMake 3.28.3 if dpkg -s "cmake" >/dev/null 2>&1; then apt remove -y --purge --auto-remove cmake - wget -qO- "https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local fi + + wget -qO- "https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local + + # Install Ninja 1.11 + if dpkg -s "ninja-build" >/dev/null 2>&1; then + apt remove -y --purge --auto-remove ninja-build + fi + + wget -q "https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-linux.zip" + unzip ninja-linux.zip -d /usr/local/bin } function build_blake3() { - ./install_blake3.sh clang-18 + ./install-blake3.sh clang-18 } function configure_cmake() { @@ -57,7 +65,9 @@ main() { check_dependencies cd "${0%/*}" || abort install_dependencies + echo "Ninja: $(ninja --version), CMake: $(cmake --version)" build_blake3 + cd .. || abort configure_cmake build_project } From bbac62eb85221f17c147221fb3e89798b7e46840 Mon Sep 17 00:00:00 2001 From: Ian Duncan <76043277+dr8co@users.noreply.github.com> Date: Wed, 21 Feb 2024 16:51:44 +0300 Subject: [PATCH 4/8] Update GitHub workflow Generate and sign packages, and also disable troublesome configs --- .github/workflows/cmake-multi-platform.yml | 156 +++++++++++++-------- 1 file changed, 101 insertions(+), 55 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index e3d3fec..126c44e 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -11,22 +11,26 @@ jobs: runs-on: ${{ matrix.os }} strategy: - fail-fast: true + fail-fast: false matrix: - os: [ubuntu-latest] # [ ubuntu-latest, macos-13 ] + os: [ ubuntu-latest, macos-13 ] build_type: [ Debug, Release ] - c_compiler: [clang] # [ gcc, clang ] + c_compiler: [ clang ] include: + - os: macos-13 + c_compiler: clang + cpp_compiler: clang++ + env: + LDFLAGS=: "-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib" + CPPFLAGS: "-I/usr/local/opt/llvm/include I/usr/local/opt/llvm/include/c++/v1" + LD_LIBRARY_PATH: "/usr/local/opt/llvm/lib" + DYLD_LIBRARY_PATH: "/usr/local/opt/llvm/lib" + # - os: macos-13 # c_compiler: gcc # cpp_compiler: g++-13 -# env: -# - LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib" -# - CPPFLAGS="-I/usr/local/opt/llvm/include" -# - LD_LIBRARY_PATH="/usr/local/opt/llvm/lib" -# - DYLD_LIBRARY_PATH="/usr/local/opt/llvm/lib" - +# # - os: ubuntu-latest # c_compiler: gcc # cpp_compiler: g++-13 @@ -36,20 +40,22 @@ jobs: cpp_compiler: clang++-17 # Don't include the following configurations in the matrix -# exclude: -# - os: macos-13 -# c_compiler: clang # LLVM Clang17+ required, and building it from the source will take longer + exclude: + - os: macos-13 + build_type: Debug steps: # Install dependencies: cmake, ninja, gcc, libgcrypt, openssl, readline, and libsodium -# - name: Install Dependencies -# if: matrix.os == 'macos-13' -# run: | -# brew update -# brew install cmake ninja gcc libgcrypt openssl@3 readline libsodium -# echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile + - name: Install Dependencies + if: matrix.os == 'macos-13' + run: | + brew update + brew install llvm cmake ninja gcc libgcrypt openssl@3 readline libsodium + echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile + echo 'export PATH="/usr/local/opt/gcc@13/bin:$PATH"' >> ~/.bash_profile + echo 'export PATH="/usr/local/opt/gcc@13/lib/gcc/13:$PATH"' >> ~/.bash_profile -# - name: Install Dependencies + # - name: Install Dependencies # if: matrix.os == 'ubuntu-latest' # run: | # wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc @@ -62,52 +68,92 @@ jobs: - uses: actions/checkout@v4 + - name: Set reusable strings + id: strings + shell: bash + run: | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + # Build project - name: Build PrivacyShield + if: matrix.os == 'ubuntu-latest' run: | sudo ./scripts/buildscript.sh -# OS=${{ matrix.os }} -# COMMAND="./scripts/install-blake3.sh ${{ matrix.c_compiler }}" -# if [ "$OS" == "macos-13" ]; then -# $COMMAND -# elif [ "$OS" == "ubuntu-latest" ]; then -# sudo $COMMAND -# fi -# -# - name: Set reusable strings -# id: strings -# shell: bash -# run: | -# echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" -# -# - name: Configure CMake -# run: > -# cmake -B ${{ steps.strings.outputs.build-output-dir }} -# -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -# -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -# -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -# -S ${{ github.workspace }} -G Ninja -# -# - name: Build -# run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} -j 4 + # OS=${{ matrix.os }} + # COMMAND="./scripts/install-blake3.sh ${{ matrix.c_compiler }}" + # if [ "$OS" == "macos-13" ]; then + # $COMMAND + # elif [ "$OS" == "ubuntu-latest" ]; then + # sudo $COMMAND + # fi + # + + - name: Install Blake3 + if: matrix.os == 'macos-13' + run: | + ./scripts/install-blake3.sh ${{ matrix.c_compiler }} + + - name: Configure CMake + if: matrix.os == 'macos-13' + run: > + export LDFLAGS="-L/usr/local/opt/gcc@13/lib/gcc/13 -Wl,-rpath,/usr/local/opt/gcc@13/lib/gcc/13"; + export CPPFLAGS="-I/usr/local/opt/gcc@13/include/c++/13 -I/usr/local/opt/gcc@13/include/c++/13/x86_64-apple-darwin22"; + export LD_LIBRARY_PATH="/usr/local/opt/gcc@13/lib/gcc/13"; + export DYLD_LIBRARY_PATH="/usr/local/opt/gcc@13/lib/gcc/13"; + + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++ + -DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang + -DCMAKE_CXX_FLAGS="-I/usr/local/opt/gcc@13/include/c++/13 -I/usr/local/opt/gcc@13/include/c++/13/x86_64-apple-darwin22 -L/usr/local/opt/gcc@13/lib/gcc/13 -Wl,-rpath,/usr/local/opt/gcc@13/lib/gcc/13 -stdlib=libstdc++" + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -S ${{ github.workspace }} -G Ninja + + - name: Build + if: matrix.os == 'macos-13' + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} -j 4 # # - name: Test # working-directory: ${{ steps.strings.outputs.build-output-dir }} # # Execute tests defined by the CMake configuration # run: ctest --build-config ${{ matrix.build_type }} # -# # Add execution permission to the binary and tar it -# - name: Package -# working-directory: ${{ steps.strings.outputs.build-output-dir }} -# run: | -# chmod +x privacyShield -# tar -czvf privacyShield.tar.gz privacyShield + - name: Package + if: matrix.os == 'macos-13' && matrix.build_type == 'Release' + working-directory: ${{ steps.strings.outputs.build-output-dir }} + run: | + cpack -G DragNDrop + + - name: Package + if: matrix.os == 'ubuntu-latest' && matrix.build_type == 'Release' + working-directory: ${{ steps.strings.outputs.build-output-dir }} + run: | + sudo cpack + sudo chown -R $USER:$USER "${{ github.workspace }}/Packages" + + - name: Import GPG Key + if: matrix.build_type == 'Release' + uses: crazy-max/ghaction-import-gpg@v6 + with: + gpg_private_key: ${{ secrets.GPG_SIGNING_KEY }} + passphrase: ${{ secrets.GPG_PASS }} + trust_level: 5 + + - name: Sign Package + if: matrix.build_type == 'Release' + working-directory: ${{ github.workspace }} + run: | + for file in Packages/*; do + gpg --batch --status-file ~/gpg_log.txt --passphrase ${{ secrets.GPG_PASS }} --default-key dr8co@duck.com \ + --pinentry-mode=loopback --detach-sign "$file" || (cat ~/gpg_log.txt && exit 1) + done # # # Upload the built artifacts -# - name: Upload Artifacts -# uses: actions/upload-artifact@v4 -# with: -# name: "${{ matrix.os }}-${{ matrix.build_type }}.tar.gz" -# path: "${{ steps.strings.outputs.build-output-dir }}/privacyShield.tar.gz" -# overwrite: true + - name: Upload Artifacts + if: matrix.build_type == 'Release' + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.os }}-${{ matrix.build_type }}" + path: "${{ github.workspace }}/Packages" + overwrite: true + if-no-files-found: 'warn' From 286f86a2d50b0e4d62bedffedd727aceb7459847 Mon Sep 17 00:00:00 2001 From: Ian Duncan <76043277+dr8co@users.noreply.github.com> Date: Wed, 21 Feb 2024 16:54:39 +0300 Subject: [PATCH 5/8] Add Packing module for generating packages --- CMakeLists.txt | 1 + CMakeModules/Packing.cmake | 79 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 CMakeModules/Packing.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 883403b..423232b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,3 +81,4 @@ install(TARGETS privacyShield DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) +include(Packing) diff --git a/CMakeModules/Packing.cmake b/CMakeModules/Packing.cmake new file mode 100644 index 0000000..2ed947a --- /dev/null +++ b/CMakeModules/Packing.cmake @@ -0,0 +1,79 @@ +# Privacy Shield: A Suite of Tools Designed to Facilitate Privacy Management. +# Copyright (C) 2024 Ian Duncan +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see https://www.gnu.org/licenses. +# +################################################################################# +# +# A CMake module to generate a package for Privacy Shield +# + +# Set the CPack variables +set(CPACK_PACKAGE_NAME "PrivacyShield") +set(CPACK_PACKAGE_VENDOR "Ian Duncan") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A suite of tools for privacy and security") +set(CPACK_PACKAGE_VERSION "2.0.0") +set(CPACK_PACKAGE_CONTACT "dr8co@duck.com") + +SET(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_SOURCE_DIR}/Packages") + +set(CPACK_SOURCE_IGNORE_FILES + /.git + /.idea + /.github + /.vscode + /.cache + /build + /cmake-build-* + /CMakeFiles + /CMakeScripts + /CMakeModules + /CMakeLists.txt.user + /CMakeCache.txt + /CTestTestfile.cmake + /Makefile + /Makefile.in + /CPackConfig.cmake + /CPackSourceConfig.cmake + /CPackSourceConfig.cmake + /CPack +) + +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") +set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") + +set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) +set(CPACK_RPM_FILE_NAME RPM-DEFAULT) + +# Set the type of installer you want to generate +set(CPACK_GENERATOR "DEB;RPM") + +# Strip the executable from debug symbols +set(CPACK_STRIP_FILES YES) + +# Set the package dependencies +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.35), libstdc++6 (>= 13.2.0), openssl (>= 3.0.0), libsodium23 (>= 1.0.18), libreadline8 (>= 8.0), libgcrypt20 (>= 1.10.0), libgcc-s1 (>= 13.2.0)") +set(CPACK_RPM_PACKAGE_REQUIRES "libc6 >= 2.35, libstdc++ >= 13.2.0, openssl >= 3.0.0, libsodium >= 1.0.18, readline >= 8.0, libgcrypt >= 1.10.0, libgcc >= 13.2.0") + +set(CPACK_RPM_PACKAGE_LICENSE "GPLv3") + +# Set the section of the package +set(CPACK_DEBIAN_PACKAGE_SECTION "utils") + +# Use the resource file for the license +set(CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE ON) + +set(CPACK_PACKAGE_CHECKSUM "SHA256") + +include(CPack) \ No newline at end of file From 2e3b76967fb12e1527db977debb867f1ddf8a00e Mon Sep 17 00:00:00 2001 From: Ian Duncan <76043277+dr8co@users.noreply.github.com> Date: Wed, 21 Feb 2024 16:55:43 +0300 Subject: [PATCH 6/8] Import Gpg_error target along Gcrypt --- CMakeModules/FindGcrypt.cmake | 50 ++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/CMakeModules/FindGcrypt.cmake b/CMakeModules/FindGcrypt.cmake index e39f7af..d932043 100644 --- a/CMakeModules/FindGcrypt.cmake +++ b/CMakeModules/FindGcrypt.cmake @@ -16,19 +16,26 @@ # ################################################################################# # -# A CMake module to find a local installation of Gcrypt +# A CMake module to find a local installation of Gcrypt and Gpg-error -# This module sets the following variables: +# This module sets the following variables for Gcrypt: # GCRYPT_FOUND - True if Gcrypt is found # GCRYPT_INCLUDE_DIR - Include directories for Gcrypt # GCRYPT_LIBRARIES - Linker flags for Gcrypt # GCRYPT_VERSION - Version of Gcrypt -# This module also provides the imported target Gcrypt::Gcrypt +# This module also sets the following variables for Gpg-error: +# GPG_ERROR_FOUND - True if Gpg-error is found +# GPG_ERROR_INCLUDE_DIR - Include directories for Gpg-error +# GPG_ERROR_LIBRARIES - Linker flags for Gpg-error +# GPG_ERROR_VERSION - Version of Gpg-error -# Find the pkg-config package for Gcrypt +# This module also provides the imported targets Gcrypt::Gcrypt and Gcrypt::Gpg_error + +# Find the pkg-config package for Gcrypt & Gpg-error find_package(PkgConfig REQUIRED) pkg_check_modules(GCRYPT REQUIRED libgcrypt) +pkg_check_modules(GPG_ERROR gpg-error) # Set the Gcrypt variables set(GCRYPT_FOUND TRUE) @@ -38,27 +45,50 @@ set(GCRYPT_VERSION ${GCRYPT_VERSION}) # Provide imported target for Gcrypt add_library(Gcrypt::Gcrypt UNKNOWN IMPORTED) + set_target_properties(Gcrypt::Gcrypt PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${GCRYPT_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${GCRYPT_LIBRARIES}" -) + INTERFACE_LINK_LIBRARIES "${GCRYPT_LIBRARIES}") + +# Set the Gpg-error variables +add_library(Gcrypt::Gpg_error UNKNOWN IMPORTED) +set_target_properties(Gcrypt::Gpg_error PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${GPG_ERROR_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${GPG_ERROR_LIBRARIES}") # Find the actual location of the Gcrypt library file find_library(GCRYPT_LIBRARY NAMES libgcrypt.so libgcrypt.dylib libgcrypt.a - HINTS ${GCRYPT_LIBRARY_DIRS} -) + HINTS ${GCRYPT_LIBRARY_DIRS}) + +# Find the actual location of the Gpg-error library file +find_library(GPG_ERROR_LIBRARY + NAMES libgpg-error.so libgpg-error.dylib libgpg-error.a + HINTS ${GPG_ERROR_LIBRARY_DIRS}) # Set the imported location dynamically if (GCRYPT_LIBRARY) set_target_properties(Gcrypt::Gcrypt PROPERTIES - IMPORTED_LOCATION "${GCRYPT_LIBRARY}" - ) + IMPORTED_LOCATION "${GCRYPT_LIBRARY}") else () message(FATAL_ERROR "Gcrypt library not found") endif () + +# Set the imported location dynamically +if (GPG_ERROR_LIBRARY) + set_target_properties(Gcrypt::Gpg_error PROPERTIES + IMPORTED_LOCATION "${GPG_ERROR_LIBRARY}") +else () + message(FATAL_ERROR "Gpg-error library not found") +endif () + # Print Gcrypt information message(STATUS "Found Gcrypt ${GCRYPT_VERSION}") message(STATUS "Gcrypt include directories: ${GCRYPT_INCLUDE_DIR}") message(STATUS "Gcrypt libraries: ${GCRYPT_LIBRARIES}") + +# Print Gpg-error information +message(STATUS "Found Gpg-error ${GPG_ERROR_VERSION}") +message(STATUS "Gpg-error include directories: ${GPG_ERROR_INCLUDE_DIR}") +message(STATUS "Gpg-error libraries: ${GPG_ERROR_LIBRARIES}") From f875def6973b3b2d68def340787dc3acfdb91f59 Mon Sep 17 00:00:00 2001 From: Ian Duncan <76043277+dr8co@users.noreply.github.com> Date: Wed, 21 Feb 2024 16:56:14 +0300 Subject: [PATCH 7/8] Update installation instructions and general documentation --- README.md | 89 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 70 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 43a3de5..a74b0ff 100644 --- a/README.md +++ b/README.md @@ -64,10 +64,15 @@ These tools include: * [File Shredder](#file-shredder) * [Browser Privacy Tracks Cleaner](#browser-privacy-tracks-cleaner) * [Duplicate File detector](#file-deduplicator) -* [Getting Started](#getting-started) +* [Building and Installation](#building-and-installation) * [Prerequisites](#prerequisites) - * [Installation/Building](#installationbuilding) + * [Building from Source](#building-from-source) + * [Installation](#installation) + * [Pre-built Packages](#pre-built-packages) + * [Manual Installation](#manual-installation) * [Uninstallation](#uninstallation) + * [Package Managers](#package-managers) + * [Manual](#manual) * [Usage](#usage) * [Command Line Interface](#command-line-interface) * [Contributing](#contributing) @@ -107,7 +112,7 @@ If you find any security vulnerabilities, please report them, or better yet, sub * **Safe** – Privacy Shield supports safe operations, with support for cancellation and error handling. * **Free** – Privacy Shield is free and open-source software, licensed under the GNU General Public License v3.0. -See [LICENSE](./LICENSE.md) for more information. +See [LICENSE](./LICENSE) for more information. * **No Ads**, **Tracking**, and **Telemetry** – Privacy Shield is free of all these things. @@ -317,7 +322,7 @@ BLAKE3 is a fast and secure hash function that is resistant to extension attacks The hashes are computed in parallel using multiple threads to speed up the process. -## Getting Started +## Building and Installation ### Prerequisites @@ -329,7 +334,7 @@ and [C++20 Modules](https://en.cppreference.com/w/cpp/language/modules) support. For this project, [GCC 14](https://gcc.gnu.org/gcc-14/) (or newer), or [LLVM Clang 17](https://clang.llvm.org/) (or newer) is required. * [CMake](https://cmake.org/) 3.28+ -* [Ninja](https://ninja-build.org/) 1.11+, or any other build system compatible with CMake and C++20 Modules. +* [Ninja](https://ninja-build.org/) 1.11+, or any other build system compatible with CMake and **C++20 Modules**. * [OpenSSL](https://www.openssl.org/) 3+ * [Sodium](https://libsodium.org/) 1.0.18+ * [GCrypt](https://gnupg.org/software/libgcrypt/index.html) 1.10+ @@ -353,7 +358,7 @@ GCC 14 is expected to support this feature as well. Also, a generator that supports C++20 Modules is required. [Ninja](https://ninja-build.org/) 1.11+ is recommended. -### IMPORTANT: A note on installing/building BLAKE3 +#### IMPORTANT: A note on installing/building BLAKE3 BLAKE3 is not available in the package repositories of most Linux distributions, so you will need to build it from the source and install it manually. @@ -365,7 +370,7 @@ Another option is to install BLAKE3 using a package manager, such as [Vcpkg](htt **Installing with the script is recommended, as it will also set up the required CMake module for BLAKE3 automatically.** -### Installation/Building +### Building from Source After installing the prerequisites, you can install Privacy Shield by following the steps below: @@ -373,44 +378,90 @@ After installing the prerequisites, you can install Privacy Shield by following # Clone the repository (or download the source code) git clone https://github.com/dr8co/PrivacyShield.git +# Build from the main branch +git checkout main + # Change directory to the project root cd PrivacyShield # Configure the project -cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-13 -G Ninja +cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++-18 -G Ninja # Build the project cmake --build build --config Release -j 4 # Install the program (optional) -cmake --install build --config Release # Might need sudo +cmake --install build # Might need sudo ``` -Remember to replace `g++-13` with your C++ compiler, and `4` with the number of CPU cores you have (for faster builds).\ +Remember to replace `clang++-18` with your C++ compiler, and `4` with the number of CPU cores you have (for faster builds).\ Also, replace `Ninja` with your build system if you are not using Ninja. -You can also install to a custom location by adding `-DCMAKE_INSTALL_PREFIX=/path/to/install` to the `configure` step. - -If you have installed Privacy Shield, you can run the program by typing `privacyShield` in your terminal -(if you've installed to a custom location, -you will need to add that installation location to your `PATH` environment variable) - -If not, you can run the compiled target directly: +You can then run the program from the build directory: ```bash # Assuming you are in the project root ./build/privacyShield ``` +### Installation + +#### Pre-built Packages + +You can download a package for your platform from the +[releases page](https://github.com/dr8co/PrivacyShield/releases). + +The package will contain the built executable, and you can install it using the package manager of your platform. + +For the macOS package, you can simply drag the .dmg file to your Applications folder. + +For the Linux package, you can install the .deb or .rpm file using the package manager of your distribution.\ +Internet connection might be required to install the dependencies. + +For instance, on Ubuntu, you can install the .deb file using the following command: + +```bash +sudo dpkg -i privacyshield_2.0.0_amd64.deb # Replace with the actual file path +# You can also use apt to install it: +sudo apt install ./privacyshield_2.0.0_amd64.deb # Replace with the actual file path +``` + +On RPM-based distributions like Fedora, you can install the .rpm file using the following command: + +```bash +sudo rpm -i privacyshield-2.0.0-1.x86_64.rpm # Replace with the actual file path +``` + +The packages can be verified using the [GnuPG](https://gnupg.org/) signature files provided. + +#### Manual Installation + +After building from the source, you can install the built executable to a custom location by adding +`-DCMAKE_INSTALL_PREFIX=/path/to/install` option to the configuration step when building from the source. + +The program can then be run by typing `privacyShield` in your terminal +(if you've installed to a custom location, you might need to add that installation location to your `PATH` +environment variable) + ### Uninstallation -If you have installed Privacy Shield, you can uninstall it by running the following command: +#### Package Managers + +The package manager used to install the package can be used to uninstall it. + +The specific commands to uninstall the package will depend on the package manager and the platform. + +#### Manual + +If you have installed Privacy Shield manually, you can uninstall it by running the following command: ```bash # From the project root, run: xargs rm -f < build/install_manifest.txt # Might need sudo ``` +Or, just remove everything listed in the `build/install_manifest.txt` file. + ## Usage ### Command Line Interface @@ -473,6 +524,6 @@ However, the feeling of empowered privacy protection is a strong possibility! [![GPLv3](./media/gpl-v3-logo.png)](https://www.gnu.org/licenses/gpl-3.0.en.html) -This project is licensed under the GNU GPLv3 License—see the [LICENSE](./LICENSE.md) file for details. +This project is licensed under the GNU GPLv3 License—see the [LICENSE](./LICENSE) file for details. All third party libraries are licensed under their respective licenses. From 20ffc45b8bc377e60080918a3c0bcf8f24f828be Mon Sep 17 00:00:00 2001 From: Ian Duncan <76043277+dr8co@users.noreply.github.com> Date: Wed, 21 Feb 2024 16:56:38 +0300 Subject: [PATCH 8/8] Update version to 2.0.0 and add project homepage URL --- CMakeLists.txt | 10 +++++++--- src/encryption/encryption.cppm | 16 ++++++++++++++++ src/main.cpp | 2 +- src/passwordManager/passwordManager.cppm | 16 ++++++++++++++++ src/utils/utils.cppm | 16 ++++++++++++++++ vcpkg.json | 2 +- 6 files changed, 57 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 423232b..2636b37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,10 +18,12 @@ cmake_minimum_required(VERSION 3.28) project(privacyShield - VERSION 1.0.0 + VERSION 2.0.0 DESCRIPTION "A suite of tools for privacy and security" LANGUAGES CXX) +set(CMAKE_PROJECT_HOMEPAGE_URL "https://shield.boujee.tech") + # C++23 support is required for this project set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -76,9 +78,11 @@ target_link_libraries(privacyShield PRIVATE Gcrypt::Gcrypt PRIVATE BLAKE3::blake3) -# Install the binary (optional) +# Install the binary (optional), with 0755 permissions +include(GNUInstallDirs) install(TARGETS privacyShield - DESTINATION bin + DESTINATION ${CMAKE_INSTALL_BINDIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) + include(Packing) diff --git a/src/encryption/encryption.cppm b/src/encryption/encryption.cppm index 1efdd6b..495c924 100644 --- a/src/encryption/encryption.cppm +++ b/src/encryption/encryption.cppm @@ -1,3 +1,19 @@ +// Privacy Shield: A Suite of Tools Designed to Facilitate Privacy Management. +// Copyright (C) 2024 Ian Duncan +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://www.gnu.org/licenses. + module; #include diff --git a/src/main.cpp b/src/main.cpp index 592fa55..a8259ba 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -97,7 +97,7 @@ int main(const int argc, const char **argv) { throw std::runtime_error("Failed to initialize libsodium."); // Display information about the program - printColor("\nPrivacy Shield 1.0.0\n", 'c'); + printColor("\nPrivacy Shield 2.0.0\n", 'c'); printColor("Copyright (C) 2024 Ian Duncan.\n", 'b'); printColor("This program comes with ", 'g'); diff --git a/src/passwordManager/passwordManager.cppm b/src/passwordManager/passwordManager.cppm index 3193967..c2b9bb1 100644 --- a/src/passwordManager/passwordManager.cppm +++ b/src/passwordManager/passwordManager.cppm @@ -1,3 +1,19 @@ +// Privacy Shield: A Suite of Tools Designed to Facilitate Privacy Management. +// Copyright (C) 2024 Ian Duncan +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://www.gnu.org/licenses. + module; #include diff --git a/src/utils/utils.cppm b/src/utils/utils.cppm index ec53502..f7bcff6 100644 --- a/src/utils/utils.cppm +++ b/src/utils/utils.cppm @@ -1,3 +1,19 @@ +// Privacy Shield: A Suite of Tools Designed to Facilitate Privacy Management. +// Copyright (C) 2024 Ian Duncan +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see https://www.gnu.org/licenses. + module; #include diff --git a/vcpkg.json b/vcpkg.json index 4f0d741..7215932 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,6 +1,6 @@ { "name": "privacyshield", - "version-string": "1.0.0", + "version-string": "2.0.0", "builtin-baseline": "7b5ca09708ae42dba9517d4e0a0c975d087f1061", "dependencies": [ {