diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index 0f57a84a..00000000
--- a/.editorconfig
+++ /dev/null
@@ -1,39 +0,0 @@
-# editorconfig.org
-
-root = true
-
-[*]
-# Unix style files
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-
-[Makefile,Makefile.*]
-indent_style = tab
-indent_size = 4
-
-[*.cmd]
-indent_style = space
-indent_size = 2
-end_of_line = crlf
-
-[*.{h,cpp}]
-indent_style = tab
-indent_size = 4
-
-[*.rc]
-indent_style = space
-indent_size = 4
-
-[*.{md,markdown}]
-indent_style = space
-indent_size = 2
-trim_trailing_whitespace = false
-
-[*.yml]
-indent_style = space
-indent_size = 2
-
-[*.patch]
-trim_trailing_whitespace = false
diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index 488400a3..00000000
--- a/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-/build/build_mingw.cmd eol=crlf
\ No newline at end of file
diff --git a/.github/workflows/build-deb.yml b/.github/workflows/build-deb.yml
deleted file mode 100644
index 597dc211..00000000
--- a/.github/workflows/build-deb.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-name: Build Debian packages
-
-on:
- push:
- branches:
- - '*'
- paths:
- - .github/workflows/build-deb.yml
- - contrib/**
- - daemon/**
- - debian/**
- - i18n/**
- - libi2pd/**
- - libi2pd_client/**
- - Makefile
- - Makefile.linux
- tags:
- - '*'
- pull_request:
- branches:
- - '*'
-
-jobs:
- build:
- name: ${{ matrix.dist }}
- runs-on: ubuntu-latest
-
- strategy:
- fail-fast: false
- matrix:
- dist: ['buster', 'bullseye', 'bookworm']
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: Commit Hash
- id: commit
- uses: prompt/actions-commit-hash@v3.0.0
-
- - name: Build package
- uses: jtdor/build-deb-action@v1
- with:
- docker-image: debian:${{ matrix.dist }}-slim
- buildpackage-opts: --build=binary --no-sign
- before-build-hook: debchange --controlmaint --local "+${{ steps.commit.outputs.short }}~${{ matrix.dist }}" -b --distribution ${{ matrix.dist }} "CI build"
- extra-build-deps: devscripts git
-
- - name: Upload package
- uses: actions/upload-artifact@v4
- with:
- name: i2pd_${{ matrix.dist }}
- path: debian/artifacts/i2pd_*.deb
-
- - name: Upload debugging symbols
- uses: actions/upload-artifact@v4
- with:
- name: i2pd-dbgsym_${{ matrix.dist }}
- path: debian/artifacts/i2pd-dbgsym_*.deb
diff --git a/.github/workflows/build-freebsd.yml b/.github/workflows/build-freebsd.yml
deleted file mode 100644
index a4a7566a..00000000
--- a/.github/workflows/build-freebsd.yml
+++ /dev/null
@@ -1,50 +0,0 @@
-name: Build on FreeBSD
-
-on:
- push:
- branches:
- - '*'
- paths:
- - .github/workflows/build-freebsd.yml
- - build/CMakeLists.txt
- - build/cmake_modules/**
- - daemon/**
- - i18n/**
- - libi2pd/**
- - libi2pd_client/**
- - Makefile
- - Makefile.bsd
- tags:
- - '*'
- pull_request:
- branches:
- - '*'
-
-jobs:
- build:
- runs-on: ubuntu-latest
- name: with UPnP
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Test in FreeBSD
- id: test
- uses: vmactions/freebsd-vm@v1
- with:
- usesh: true
- mem: 2048
- sync: rsync
- copyback: true
- prepare: pkg install -y devel/cmake devel/gmake devel/boost-libs security/openssl net/miniupnpc
- run: |
- cd build
- cmake -DWITH_UPNP=ON -DCMAKE_BUILD_TYPE=Release .
- gmake -j2
-
- - name: Upload artifacts
- uses: actions/upload-artifact@v4
- with:
- name: i2pd-freebsd
- path: build/i2pd
diff --git a/.github/workflows/build-osx.yml b/.github/workflows/build-osx.yml
deleted file mode 100644
index 31f0b90d..00000000
--- a/.github/workflows/build-osx.yml
+++ /dev/null
@@ -1,45 +0,0 @@
-name: Build on OSX
-
-on:
- push:
- branches:
- - '*'
- paths:
- - .github/workflows/build-osx.yml
- - daemon/**
- - i18n/**
- - libi2pd/**
- - libi2pd_client/**
- - Makefile
- - Makefile.homebrew
- tags:
- - '*'
- pull_request:
- branches:
- - '*'
-
-jobs:
- build:
- name: With USE_UPNP=${{ matrix.with_upnp }}
- runs-on: macOS-latest
-
- strategy:
- fail-fast: true
- matrix:
- with_upnp: ['yes', 'no']
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Install required formulae
- run: |
- find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
- brew update
- brew install boost miniupnpc openssl@1.1
-
- - name: List installed formulae
- run: brew list
-
- - name: Build application
- run: make HOMEBREW=1 USE_UPNP=${{ matrix.with_upnp }} PREFIX=$GITHUB_WORKSPACE/output -j3
diff --git a/.github/workflows/build-windows-msvc.yml-disabled b/.github/workflows/build-windows-msvc.yml-disabled
deleted file mode 100644
index 922ebd0d..00000000
--- a/.github/workflows/build-windows-msvc.yml-disabled
+++ /dev/null
@@ -1,80 +0,0 @@
-name: Build on Windows with MSVC
-
-on:
- push:
- branches:
- - '*'
- paths:
- - .github/workflows/build-windows-msvc.yml
- - build/CMakeLists.txt
- - build/cmake_modules/**
- - daemon/**
- - i18n/**
- - libi2pd/**
- - libi2pd_client/**
- - Win32/**
- tags:
- - '*'
- pull_request:
- branches:
- - '*'
-
-jobs:
- build:
- name: Build
- runs-on: windows-latest
- env:
- boost_path: ${{ github.workspace }}\boost_1_83_0
- openssl_path: ${{ github.workspace }}\openssl_3_2_1
-
- strategy:
- fail-fast: false
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: Build and install zlib
- run: |
- powershell -Command "(Invoke-WebRequest -Uri https://raw.githubusercontent.com/r4sas/zlib.install/master/install.bat -OutFile install_zlib.bat)"
- powershell -Command "(Get-Content install_zlib.bat) | Set-Content install_zlib.bat" # fixing line endings
- set BUILD_TYPE=Debug
- ./install_zlib.bat
- set BUILD_TYPE=Release
- ./install_zlib.bat
- del install_zlib.bat
-
- - name: Install Boost
- run: |
- powershell -Command "(Start-BitsTransfer -Source https://sourceforge.net/projects/boost/files/boost-binaries/1.83.0/boost_1_83_0-msvc-14.3-64.exe/download -Destination boost_1_83_0-msvc-14.3-64.exe)"
- ./boost_1_83_0-msvc-14.3-64.exe /DIR="${{env.boost_path}}" /VERYSILENT /SUPPRESSMSGBOXES /SP-
-
- - name: Install OpenSSL
- run: |
- powershell -Command "(Start-BitsTransfer -Source https://slproweb.com/download/Win64OpenSSL-3_2_1.exe -Destination Win64OpenSSL-3_2_1.exe)"
- ./Win64OpenSSL-3_2_1.exe /DIR="${{env.openssl_path}}" /TASKS="copytobin" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-
-
- - name: Make copy of the OpenSSL libraries for CMake
- run: |
- dir ${{ github.workspace }}
- dir ${{env.openssl_path}}\lib\VC
- dir ${{env.openssl_path}}\lib\VC\x64\
- dir ${{env.openssl_path}}\lib\VC\x64\MTd\
- xcopy /s /y "${{env.openssl_path}}\lib\VC\x64\MTd" "${{env.openssl_path}}\lib"
-
- - name: Configure
- working-directory: build
- run: cmake -DBoost_ROOT="${{env.boost_path}}" -DOPENSSL_ROOT_DIR="${{env.openssl_path}}" -DWITH_STATIC=ON .
-
- - name: Build
- working-directory: build
- run: cmake --build . --config Debug -- -m
-
- - name: Upload artifacts
- uses: actions/upload-artifact@v4
- with:
- name: i2pd-msvc
- path: build/Debug/i2pd.*
-
diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml
deleted file mode 100644
index 6f10e62b..00000000
--- a/.github/workflows/build-windows.yml
+++ /dev/null
@@ -1,250 +0,0 @@
-name: Build on Windows
-
-on:
- push:
- branches:
- - '*'
- paths:
- - .github/workflows/build-windows.yml
- - build/CMakeLists.txt
- - build/cmake_modules/**
- - daemon/**
- - i18n/**
- - libi2pd/**
- - libi2pd_client/**
- - Win32/**
- - Makefile
- - Makefile.mingw
- tags:
- - '*'
- pull_request:
- branches:
- - '*'
-
-defaults:
- run:
- shell: msys2 {0}
-
-jobs:
- build:
- name: ${{ matrix.arch }}
- runs-on: windows-latest
-
- strategy:
- fail-fast: false
- matrix:
- include: [
- { msystem: UCRT64, arch: ucrt-x86_64, arch_short: x64-ucrt, compiler: gcc },
- { msystem: CLANG64, arch: clang-x86_64, arch_short: x64-clang, compiler: clang },
- { msystem: MINGW64, arch: x86_64, arch_short: x64, compiler: gcc },
- { msystem: MINGW32, arch: i686, arch_short: x86, compiler: gcc }
- ]
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: Setup MSYS2
- uses: msys2/setup-msys2@v2
- with:
- msystem: ${{ matrix.msystem }}
- install: base-devel git mingw-w64-${{ matrix.arch }}-${{ matrix.compiler }} mingw-w64-${{ matrix.arch }}-boost mingw-w64-${{ matrix.arch }}-openssl mingw-w64-${{ matrix.arch }}-miniupnpc
- update: true
-
- - name: Install additional clang packages
- if: ${{ matrix.msystem == 'CLANG64' }}
- run: pacman --noconfirm -S mingw-w64-${{ matrix.arch }}-gcc-compat
-
- - name: Build application
- run: |
- mkdir -p obj/Win32 obj/libi2pd obj/libi2pd_client obj/daemon
- make USE_UPNP=yes DEBUG=no USE_GIT_VERSION=yes -j3
-
- - name: Upload artifacts
- uses: actions/upload-artifact@v4
- with:
- name: i2pd-${{ matrix.arch_short }}.exe
- path: i2pd.exe
-
- build-cmake:
- name: CMake ${{ matrix.arch }}
- runs-on: windows-latest
-
- strategy:
- fail-fast: false
- matrix:
- include: [
- { msystem: UCRT64, arch: ucrt-x86_64, arch_short: x64-ucrt, compiler: gcc },
- { msystem: CLANG64, arch: clang-x86_64, arch_short: x64-clang, compiler: clang },
- { msystem: MINGW64, arch: x86_64, arch_short: x64, compiler: gcc },
- { msystem: MINGW32, arch: i686, arch_short: x86, compiler: gcc }
- ]
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: Setup MSYS2
- uses: msys2/setup-msys2@v2
- with:
- msystem: ${{ matrix.msystem }}
- install: base-devel git mingw-w64-${{ matrix.arch }}-cmake mingw-w64-${{ matrix.arch }}-ninja mingw-w64-${{ matrix.arch }}-${{ matrix.compiler }} mingw-w64-${{ matrix.arch }}-boost mingw-w64-${{ matrix.arch }}-openssl mingw-w64-${{ matrix.arch }}-miniupnpc
- update: true
-
- - name: Build application
- run: |
- cd build
- cmake -DWITH_GIT_VERSION=ON -DWITH_STATIC=ON -DWITH_UPNP=ON -DCMAKE_BUILD_TYPE=Release .
- cmake --build . -- -j3
-
- - name: Upload artifacts
- uses: actions/upload-artifact@v4
- with:
- name: i2pd-cmake-${{ matrix.arch_short }}.exe
- path: build/i2pd.exe
-
- build-xp:
- name: XP
- runs-on: windows-latest
-
- strategy:
- fail-fast: false
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: Setup MSYS2
- uses: msys2/setup-msys2@v2
- with:
- msystem: MINGW32
- install: base-devel git mingw-w64-i686-gcc mingw-w64-i686-boost mingw-w64-i686-openssl mingw-w64-i686-miniupnpc
- cache: true
- update: true
-
- - name: Clone MinGW packages repository and revert boost to 1.85.0
- run: |
- git clone https://github.com/msys2/MINGW-packages
- cd MINGW-packages
- git checkout 4cbb366edf2f268ac3146174b40ce38604646fc5 mingw-w64-boost
- cd mingw-w64-boost
- sed -i 's/boostorg.jfrog.io\/artifactory\/main/archives.boost.io/' PKGBUILD
-
- # headers
- - name: Get headers package version
- id: version-headers
- run: |
- echo "version=$(pacman -Si mingw-w64-i686-headers-git | grep -Po '^Version\s*: \K.+')" >> $GITHUB_OUTPUT
- - name: Cache headers package
- uses: actions/cache@v4
- id: cache-headers
- with:
- path: MINGW-packages/mingw-w64-headers-git/*.zst
- key: winxp-headers-${{ steps.version-headers.outputs.version }}
- - name: Build WinXP-capable headers package
- if: steps.cache-headers.outputs.cache-hit != 'true'
- run: |
- cd MINGW-packages/mingw-w64-headers-git
- sed -i 's/0x601/0x501/' PKGBUILD
- MINGW_ARCH=mingw32 makepkg-mingw -sCLf --noconfirm --nocheck
- - name: Install headers package
- run: pacman --noconfirm -U MINGW-packages/mingw-w64-headers-git/mingw-w64-i686-*-any.pkg.tar.zst
-
- # CRT
- - name: Get crt package version
- id: version-crt
- run: |
- echo "version=$(pacman -Si mingw-w64-i686-crt-git | grep -Po '^Version\s*: \K.+')" >> $GITHUB_OUTPUT
- - name: Cache crt package
- uses: actions/cache@v4
- id: cache-crt
- with:
- path: MINGW-packages/mingw-w64-crt-git/*.zst
- key: winxp-crt-${{ steps.version-crt.outputs.version }}
- - name: Build WinXP-capable crt package
- if: steps.cache-crt.outputs.cache-hit != 'true'
- run: |
- cd MINGW-packages/mingw-w64-crt-git
- MINGW_ARCH=mingw32 makepkg-mingw -sCLf --noconfirm --nocheck
- - name: Install crt package
- run: pacman --noconfirm -U MINGW-packages/mingw-w64-crt-git/mingw-w64-i686-*-any.pkg.tar.zst
-
- # winpthreads
- - name: Get winpthreads package version
- id: version-winpthreads
- run: |
- echo "version=$(pacman -Si mingw-w64-i686-winpthreads-git | grep -Po '^Version\s*: \K.+')" >> $GITHUB_OUTPUT
- - name: Cache winpthreads package
- uses: actions/cache@v4
- id: cache-winpthreads
- with:
- path: MINGW-packages/mingw-w64-winpthreads-git/*.zst
- key: winxp-winpthreads-${{ steps.version-winpthreads.outputs.version }}
- - name: Build WinXP-capable winpthreads package
- if: steps.cache-winpthreads.outputs.cache-hit != 'true'
- run: |
- cd MINGW-packages/mingw-w64-winpthreads-git
- MINGW_ARCH=mingw32 makepkg-mingw -sCLf --noconfirm --nocheck
- - name: Install winpthreads package
- run: pacman --noconfirm -U MINGW-packages/mingw-w64-winpthreads-git/mingw-w64-i686-*-any.pkg.tar.zst
-
- # OpenSSL
- - name: Get openssl package version
- id: version-openssl
- run: |
- echo "version=$(pacman -Si mingw-w64-i686-openssl | grep -Po '^Version\s*: \K.+')" >> $GITHUB_OUTPUT
- - name: Cache openssl package
- uses: actions/cache@v4
- id: cache-openssl
- with:
- path: MINGW-packages/mingw-w64-openssl/*.zst
- key: winxp-openssl-${{ steps.version-openssl.outputs.version }}
- - name: Build WinXP-capable openssl package
- if: steps.cache-openssl.outputs.cache-hit != 'true'
- run: |
- cd MINGW-packages/mingw-w64-openssl
- gpg --recv-keys D894E2CE8B3D79F5
- gpg --recv-keys 216094DFD0CB81EF
- MINGW_ARCH=mingw32 makepkg-mingw -sCLf --noconfirm --nocheck
- - name: Install openssl package
- run: pacman --noconfirm -U MINGW-packages/mingw-w64-openssl/mingw-w64-i686-*-any.pkg.tar.zst
-
- # Boost
- #- name: Get boost package version
- # id: version-boost
- # run: |
- # echo "version=$(pacman -Si mingw-w64-i686-boost | grep -Po '^Version\s*: \K.+')" >> $GITHUB_OUTPUT
- - name: Cache boost package
- uses: actions/cache@v4
- id: cache-boost
- with:
- path: MINGW-packages/mingw-w64-boost/*.zst
- key: winxp-boost-1.85.0+crt-${{ steps.version-headers.outputs.version }}+ossl-${{ steps.version-openssl.outputs.version }}
- # Rebuild package if packages above has changed
- - name: Build WinXP-capable boost package
- if: steps.cache-boost.outputs.cache-hit != 'true'
- run: |
- cd MINGW-packages/mingw-w64-boost
- MINGW_ARCH=mingw32 makepkg-mingw -sCLf --noconfirm --nocheck
- - name: Remove boost packages
- run: pacman --noconfirm -R mingw-w64-i686-boost mingw-w64-i686-boost-libs
- - name: Install boost package
- run: pacman --noconfirm -U MINGW-packages/mingw-w64-boost/mingw-w64-i686-*-any.pkg.tar.zst
-
- # Building i2pd
- - name: Build application
- run: |
- mkdir -p obj/Win32 obj/libi2pd obj/libi2pd_client obj/daemon
- make USE_UPNP=yes DEBUG=no USE_GIT_VERSION=yes USE_WINXP_FLAGS=yes -j3
-
- - name: Upload artifacts
- uses: actions/upload-artifact@v4
- with:
- name: i2pd-xp.exe
- path: i2pd.exe
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
deleted file mode 100644
index 0b65ec9d..00000000
--- a/.github/workflows/build.yml
+++ /dev/null
@@ -1,67 +0,0 @@
-name: Build on Ubuntu
-
-on:
- push:
- branches:
- - '*'
- paths:
- - .github/workflows/build.yml
- - build/CMakeLists.txt
- - build/cmake_modules/**
- - daemon/**
- - i18n/**
- - libi2pd/**
- - libi2pd_client/**
- - Makefile
- - Makefile.linux
- tags:
- - '*'
- pull_request:
- branches:
- - '*'
-
-jobs:
- build-make:
- name: Make with USE_UPNP=${{ matrix.with_upnp }}
- runs-on: ubuntu-latest
-
- strategy:
- fail-fast: true
- matrix:
- with_upnp: ['yes', 'no']
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: install packages
- run: |
- sudo apt-get update
- sudo apt-get install build-essential libboost-all-dev libminiupnpc-dev libssl-dev zlib1g-dev
-
- - name: build application
- run: make USE_UPNP=${{ matrix.with_upnp }} -j3
-
- build-cmake:
- name: CMake with -DWITH_UPNP=${{ matrix.with_upnp }}
- runs-on: ubuntu-latest
-
- strategy:
- fail-fast: true
- matrix:
- with_upnp: ['ON', 'OFF']
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: install packages
- run: |
- sudo apt-get update
- sudo apt-get install build-essential cmake libboost-all-dev libminiupnpc-dev libssl-dev zlib1g-dev
-
- - name: build application
- run: |
- cd build
- cmake -DWITH_UPNP=${{ matrix.with_upnp }} .
- make -j3
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
deleted file mode 100644
index c6d55664..00000000
--- a/.github/workflows/docker.yml
+++ /dev/null
@@ -1,140 +0,0 @@
-name: Build containers
-
-on:
- push:
- branches:
- - openssl
- - docker
- paths:
- - .github/workflows/docker.yml
- - contrib/docker/**
- - contrib/certificates/**
- - daemon/**
- - i18n/**
- - libi2pd/**
- - libi2pd_client/**
- - Makefile
- - Makefile.linux
- tags:
- - '*'
-
-jobs:
- build:
- name: Building container for ${{ matrix.platform }}
- runs-on: ubuntu-latest
- permissions:
- packages: write
- contents: read
-
- strategy:
- matrix:
- include: [
- { platform: 'linux/amd64', archname: 'amd64' },
- { platform: 'linux/386', archname: 'i386' },
- { platform: 'linux/arm64', archname: 'arm64' },
- { platform: 'linux/arm/v7', archname: 'armv7' },
- ]
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v3
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
-
- - name: Login to DockerHub
- uses: docker/login-action@v3
- with:
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
-
- - name: Login to GitHub Container registry
- uses: docker/login-action@v3
- with:
- registry: ghcr.io
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Build container for ${{ matrix.archname }}
- uses: docker/build-push-action@v5
- with:
- context: ./contrib/docker
- file: ./contrib/docker/Dockerfile
- platforms: ${{ matrix.platform }}
- push: true
- tags: |
- purplei2p/i2pd:latest-${{ matrix.archname }}
- ghcr.io/purplei2p/i2pd:latest-${{ matrix.archname }}
- provenance: false
-
- push:
- name: Pushing merged manifest
- runs-on: ubuntu-latest
-
- permissions:
- packages: write
- contents: read
-
- needs: build
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v3
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
-
- - name: Login to DockerHub
- uses: docker/login-action@v3
- with:
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
-
- - name: Login to GitHub Container registry
- uses: docker/login-action@v3
- with:
- registry: ghcr.io
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Create and push latest manifest image to Docker Hub
- if: ${{ !startsWith(github.ref, 'refs/tags/') }}
- uses: Noelware/docker-manifest-action@master
- with:
- inputs: purplei2p/i2pd:latest
- tags: purplei2p/i2pd:latest-amd64,purplei2p/i2pd:latest-i386,purplei2p/i2pd:latest-arm64,purplei2p/i2pd:latest-armv7
- push: true
-
- - name: Create and push latest manifest image to GHCR
- if: ${{ !startsWith(github.ref, 'refs/tags/') }}
- uses: Noelware/docker-manifest-action@master
- with:
- inputs: ghcr.io/purplei2p/i2pd:latest
- tags: ghcr.io/purplei2p/i2pd:latest-amd64,ghcr.io/purplei2p/i2pd:latest-i386,ghcr.io/purplei2p/i2pd:latest-arm64,ghcr.io/purplei2p/i2pd:latest-armv7
- push: true
-
- - name: Store release version to env
- if: ${{ startsWith(github.ref, 'refs/tags/') }}
- run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
-
- - name: Create and push release manifest to Docker Hub
- if: ${{ startsWith(github.ref, 'refs/tags/') }}
- uses: Noelware/docker-manifest-action@master
- with:
- inputs: purplei2p/i2pd:latest,purplei2p/i2pd:latest-release,purplei2p/i2pd:release-${{ env.RELEASE_VERSION }}
- tags: purplei2p/i2pd:latest-amd64,purplei2p/i2pd:latest-i386,purplei2p/i2pd:latest-arm64,purplei2p/i2pd:latest-armv7
- push: true
-
- - name: Create and push release manifest to GHCR
- if: ${{ startsWith(github.ref, 'refs/tags/') }}
- uses: Noelware/docker-manifest-action@master
- with:
- inputs: ghcr.io/purplei2p/i2pd:latest,ghcr.io/purplei2p/i2pd:latest-release,ghcr.io/purplei2p/i2pd:release-${{ env.RELEASE_VERSION }}
- tags: ghcr.io/purplei2p/i2pd:latest-amd64,ghcr.io/purplei2p/i2pd:latest-i386,ghcr.io/purplei2p/i2pd:latest-arm64,ghcr.io/purplei2p/i2pd:latest-armv7
- push: true
diff --git a/.gitignore b/.gitignore
index 75bd6abb..c2db70e0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,17 +3,11 @@
router.info
router.keys
i2p
+libi2pd.so
netDb
/i2pd
/libi2pd.a
/libi2pdclient.a
-/libi2pdlang.a
-/libi2pd.so
-/libi2pdclient.so
-/libi2pdlang.so
-/libi2pd.dll
-/libi2pdclient.dll
-/libi2pdlang.dll
*.exe
@@ -260,20 +254,13 @@ docs/generated
build/Makefile
# debian stuff
-debian/i2pd.1.gz
.pc/
# qt
-qt/i2pd_qt/*.autosave
+qt/i2pd_qt/*.ui.autosave
qt/i2pd_qt/*.ui.bk*
qt/i2pd_qt/*.ui_*
#unknown android stuff
android/libs/
-
-#various logs
-*LOGS/
-
-qt/build-*.sh*
-
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..c55f1885
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,54 @@
+language: cpp
+cache:
+ apt: true
+os:
+- linux
+#- osx
+dist: trusty
+sudo: required
+compiler:
+- g++
+- clang++
+env:
+ global:
+ - MAKEFLAGS="-j 2"
+ matrix:
+ - BUILD_TYPE=make UPNP=ON MAKE_UPNP=yes
+ - BUILD_TYPE=make UPNP=OFF MAKE_UPNP=no
+ - BUILD_TYPE=cmake UPNP=ON MAKE_UPNP=yes
+ - BUILD_TYPE=cmake UPNP=OFF MAKE_UPNP=no
+matrix:
+ exclude:
+ - os: osx
+ env: BUILD_TYPE=cmake UPNP=ON MAKE_UPNP=yes
+ - os: osx
+ env: BUILD_TYPE=cmake UPNP=OFF MAKE_UPNP=no
+ - os: linux
+ compiler: clang++
+ env: BUILD_TYPE=make UPNP=ON MAKE_UPNP=yes
+ - os: linux
+ compiler: clang++
+ env: BUILD_TYPE=make UPNP=OFF MAKE_UPNP=no
+addons:
+ apt:
+ packages:
+ - build-essential
+ - cmake
+ - g++
+ - clang
+ - libboost-chrono-dev
+ - libboost-date-time-dev
+ - libboost-filesystem-dev
+ - libboost-program-options-dev
+ - libboost-system-dev
+ - libboost-thread-dev
+ - libminiupnpc-dev
+ - libssl-dev
+before_install:
+- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
+- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install libressl miniupnpc ; fi
+- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated boost || brew upgrade boost ; fi
+script:
+- if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD_TYPE" == "cmake" ]]; then cd build && cmake -DCMAKE_BUILD_TYPE=Release -DWITH_UPNP=${UPNP} && make ; fi
+- if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD_TYPE" == "make" ]]; then make USE_UPNP=${MAKE_UPNP} ; fi
+- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make HOMEBREW=1 USE_UPNP=${MAKE_UPNP} ; fi
diff --git a/ChangeLog b/ChangeLog
index 23864c0e..08f78224 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,895 +1,10 @@
# for this file format description,
# see https://github.com/olivierlacan/keep-a-changelog
-## [2.56.0] - 2025-02-11
-### Added
-- Config params for shared local destination
-- AddressBook full addresses cache
-- Decline transit tunnel to duplicated router
-- Recreate tunnels in random order
-### Changed
-- Exclude disk operations from SSU2 and NTCP2 threads
-- Set minimal version for peer test to 0.9.62
-- Send ack requested flag after second SSU2 resend attempt
-- Shorter ECIESx25519 ack request interval for datagram and I2CP sessions
-- Don't change datagram routing path too often if unidirectional data stream
-- Reduce LeaseSet and local RouterInfo publishing confirmation intervals
-- Don't delete buffer of connected routers or if an update received
-- Smaller RouterInfo request timeout if sent directly
-- Persist local RouterInfo in separate thread
-- Don't recalculate and process ranges for every SSU2 Ack block
-- Reseeds list
-### Fixed
-- Termination deadlock if SAM session is active
-- Race condition at tunnel endpoint
-- Inbound tunnel build encryption
-
-## [2.55.0] - 2024-12-30
-### Added
-- Support boost 1.87
-- "i2p.streaming.maxConcurrentStreams" tunnel's param to limit number of simultaneous streams
-- Separate thread for tunnel build requests
-- Show next peer and connectivity on "Transit tunnels" page
-- Tunnel name for local destination thread
-- Throttle incoming ECIESx25519 sessions
-- Send tunnel data to transport session directly if possible
-- Publish 'R' cap for yggdrasil-only routers, and 'U' cap for routers through proxy
-- Random tunnel rejection when medium congestion
-- Save unreachable router's endpoint to use it next time without introducers
-- Recognize symmetric NAT from peer test message 7
-- Resend HolePunch and RelayResponse messages
-### Changed
-- Removed own implementation of AESNI and always use one from openssl
-- Renamed main thread to i2pd-daemon
-- Set i2p.streaming.profile=2 for shared local destination
-- Reduced LeaseSet and RouterInfo lookup timeouts
-- Cleanup ECIES sessions and tags more often
-- Check LeaseSet expiration time
-- Handle NTCP2 session handshakes in separate thread
-- Limit last decline time by 1.5 hours in router's profile
-- Don't handle RelayRequest and RelayIntro with same nonce twice
-- Increased hole punch expiration interval
-- Send peer test message 6 with delay if message 4 was received before message 5
-- Pre-calculate more x25519 keys for transports in runtime
-- Don't request LeaseSet for incoming stream
-- Terminate incoming stream right away if no remote LeaseSet
-- Handle choked, new RTO and window size calculation and resetting algorithm for streams
-### Fixed
-- Empty string in addressbook subscriptions
-- ECIESx25519 sessions without destination
-- Missing RouterInfo buffer in NetDb
-- Invalid I2PControl certificate
-- Routers disappear from NetDb when offline
-- Peer test message 6 sent to unknown endpoint
-- Race condition with LeaseSet update
-- Excessive CPU usage by streams
-- Crash on shutdown
-
-## [2.54.0] - 2024-10-06
-### Added
-- Maintain recently connected routers list to avoid false-positive peer test
-- Limited connectivity mode(through proxy)
-- "i2p.streaming.profile" tunnel's param to let tunnel select also low-bandwidth routers
-- Limit stream's inbound speed
-- Periodic ack requests in ratchets session
-- Set congestion cap G immediately if through proxy
-- Show tunnel's routers bandwidth caps in web console
-- Handle immediate ack requested flag in SSU2 data packets
-- Resend and ack peer test and relay messages
-- "senduseragent" HTTP proxy's param to pass through user's User-Agent
-### Changed
-- Exclude 'N' routers from high-bandwidth routers for client tunnels
-- C++11 support has been dropped, the minimal requirement is C++17 now, C++20 for some compilers
-- Removed dependency from boost::date_time and boost::filesystem
-- Set default i2cp.leaseSetEncType to 0,4 and to 4 for server tunnels
-- Handle i2cp.inboundlimit and i2cp.outboundlimit params in I2CP
-- Publish LeaseSet with new timestamp update if tunnel was replaced in the same second
-- Increase max number of generated tags to 800 per tagset
-- Routing path expiration by time instead num attempts
-- Save timestamp from epoch instead local time to profiles
-- Update introducer's iTag if session to introducer was replaced to new one
-- RTT, window size and number of NACKs calculation for streaming
-- Don't select same peer for tunnel too often
-- Use WinApi for data path UTF-8 conversion for Windows
-### Fixed
-- Jump link crash if address book is disabled
-- Race condition if connect through an introducer
-- "Date" header in I2PControl response
-- Incomplete response from web console
-- AEAD verification with LibreSSL
-- Number of generated tags and new keys for follow-on tagsets
-- Expired leases in LeaseSet
-- Attempts to send HolePunch to 0.0.0.0
-- Incorrect options size in quick ack streaming packet
-- Low bandwidth router appeared as first peer in high-bandwidth client tunnel
-
-## [2.53.1] - 2024-07-29
-### Changed
-- I2CP performance improvement
-### Fixed
-- 100% CPU usage after I2CP/SAM/BOB session termination
-- Incorrect client limits returned through I2CP
-- Build with LibreSSL
-
-## [2.53.0] - 2024-07-19
-### Added
-- New congestion control algorithm for streaming
-- Support miniupnp-2.2.8
-- Limit stream's outbound speed
-- Flood to next day closest floodfills before UTC midnight
-- Recognize duplicated routers and bypass them
-- Random SSU2 resend interval
-### Changed
-- Set minimal version to 0.9.69 for floodfills and 0.9.58 for client tunnels
-- Removed openssl 1.0.2 support
-- Move unsent I2NP messages to the new session if replaced
-- Use mt19937 RNG instead rand()
-- Update router's congestion caps before initial publishing
-- Don't try introducer with invalid address
-- Select newest introducers to publish
-- Don't request relay tag for every session if we have enough introducers
-- Update timestamp for non-reachable or hidden router
-- Reset streaming routing path if duplicated SYN received
-- Update LeaseSet if inbound tunnel failed
-- Reseeds list
-### Fixed
-- Crash when a destination gets terminated
-- Expired offline signature upon destination creation
-- Race condition between local RouterInfo buffer creation and sending it through the transports
-
-## [2.52.0] - 2024-05-12
-### Added
-- Separate threads for persisting RouterInfos and profiles to disk
-- Give preference to address with direct connection
-- Exclude addresses with incorrect static or intro key
-- Avoid two firewalled routers in the row in tunnel
-- Drop unsolicited database search replies
-### Changed
-- Increase number of hashes to 16 in exploratory lookup reply
-- Reduce number of a RouterInfo lookup attempts to 5
-- Reset stream RTO if outbound tunnel was changed
-- Insert previously excluded floodfill back when successfully connected
-- Increase maximum stream resend attempts to 9
-- Reply to exploratory lookups with only confirmed routers if low tunnel build rate
-- Don't accept too old RouterInfo
-- Build client tunnels through confirmed routers only if low tunnel build rate
-- Manage netDb requests more frequently
-- Don't reply with closer than us only floodfills for lookup
-### Fixed
-- Crash on router lookup if exploratory pool is not ready
-- Race condition in excluded peers for next lookup
-- Excessive number of lookups for same destination
-- Race condition with transport peers during shutdown
-- Corrupted RouterInfo files
-
-## [2.51.0] - 2024-04-06
-### Added
-- Non-blocking mode for UDP sockets
-- Set SSU2 socket buffer size based on bandwidth limit
-- Encrypted tunnel tests
-- Support for multiple UDP server tunnels on one destination
-- Publish medium congestion indication
-- Local domain sockets for SOCKS proxy upstream
-- Tunnel status "declined" in web console
-- SAM error reply "Incompatible crypto" if remote destination has incompatible crypto
-- Reduce amount of traffic by handling local message drops
-- Keep SSU2 socket open even if it fails to bind
-- Lower SSU2 resend traffic spikes
-- Expiration for messages in SSU2 send queue
-- Use EWMA for stream RTT estimation
-- Request choking delay if too many NACKs in stream
-- Allow 0ms latency for tunnel
-- Randomize tunnels selection for tests
-### Changed
-- Upstream SOCKS proxy from SOCKS4 to SOCKS5
-- Transit tunnels limit to 4 bytes. Default value to 10K
-- Reply CANT_REACH_PEER if connect to ourselves in SAM
-- Don't send already expired I2NP messages
-- Use monotonic timer to measure tunnel test latency
-- Standard NTCP2 frame doesn't exceed 16K
-- Always send request through tunnels in case of restricted routes
-- Don't delete connected routers from NetDb
-- Send lookup reply directly to reply tunnel gateway if possible
-- Reduce unreachable router ban interval to 8 minutes
-- Don't request banned routers / don't try to connect to unreachable router
-- Consider 'M' routers as low bandwidth
-- Limit minimal received SSU2 packet size to 40 bytes
-- Bob picks peer test session only if Charlie's address supports peer testing
-- Reject peer test msg 2 if peer testing is not supported
-- Don't request termination if SSU2 session was not established
-- Set maximum SSU2 queue size depending on RTT value
-- New streaming RTT calculation algorithm
-- Don't double initial RTO for streams when changing tunnels
-- Restore failed tunnel if test or data for inbound tunnel received
-- Don't fail last remaining tunnel in pool
-- Publish LeasetSet again if local destination was not ready or no tunnels
-- Make more attempts to pick high bandwidth hop for client tunnel
-- Reduced SSU2 session termination timeout to 165 seconds
-- Reseeds list
-### Fixed
-- ECIESx25519 symmetric key tagset early expiration
-- Encrypted LeaseSet lookup
-- Outbound tunnel build fails if it's endpoint is the same as reply tunnel gateway
-- I2PControl RouterManager returns invalid JSON when unknown params are passed
-- Mix of data between different UDP sessions on the same server
-- TARGET_OS_SIMULATOR check
-- Handling of "reservedrange" param
-- New NTCP2 session gets teminated upon termination of old one
-- New SSU2 session gets teminated upon termination of old one
-- Peer test to non-supporting router
-- Streaming ackThrough off 1 if number of NACKs exceeds 255
-- Race condition in ECIESx25519 tags table
-- Good tunnel becomes failed
-- Crash when packet comes to terminated stream
-- Stream hangs during LeaseSet update
-
-## [2.50.2] - 2024-01-06
-###Fixed
-- Crash with OpenSSL 3.2.0
-- False positive clock skew detection
-
-## [2.50.1] - 2023-12-23
-###Fixed
-- Support for new EdDSA usage behavior in OpenSSL 3.2.0
-
-## [2.50.0] - 2023-12-18
-### Added
-- Support of concurrent ACCEPTs on SAM 3.1
-- Haiku OS support
-- Low bandwidth and far routers can expire before 1 hour
-### Changed
-- Don't pick too active peer for first hop
-- Try peer test again if status is Unknown
-- Send peer tests with random delay
-- Reseeds list
-### Fixed
-- XSS vulnerability in addresshelper
-- Publishing NAT64 ipv6 addresses
-- Deadlock in AsyncSend callback
-
-## [2.49.0] - 2023-09-18
-### Added
-- Handle SOCK5 authorization with empty user/password
-- Drop incoming transport sessions from too old or from future routers
-- Memory pool for router profiles
-- Allow 0 hops in explicitPeers
-### Changed
-- Separate network and testing status
-- Remove AVX code
-- Improve NTCP2 transport session logging
-- Select router with ipv4 for tunnel endpoint
-- Consider all addresses non-published for U and H routers even if they have host/port
-- Don't pick completely unreachable routers for tunnels
-- Exclude SSU1 introducers from SSU2 addresses
-- Don't create paired inbound tunnel if length is different
-- Remove introducer from RouterInfo after 60 minutes
-- Reduce SSU2 keep alive interval and add keep alive interval variance
-- Don't pick too old sessions for introducer
-### Fixed
-- Version of the subnegotiation in user/password SOCKS5 response
-- Send keepalive for existing session with introducer
-- Buffer offset for EVP_EncryptFinal_ex() to include outlen
-- Termination block size processing for transport sessions
-- Crash if deleted BOB destination was shared between few BOB sessions
-- Introducers with zero tag
-- Padding for SSU2 path response
-
-## [2.48.0] - 2023-06-12
-### Added
-- Allow user/password authentication method for SOCK5 proxy
-- Publish reject all congestion cap 'G' if transit is not accepted
-- 'critical' log level
-- Print b32 on webconsole destination page
-- Webconsole button to drop a remote LeaseSet
-- limits.zombies param - minimum percentage of successfully created tunnels for routers cleanup
-- Recognize real routers if successfully connected or responded to tunnel build request
-### Changed
-- Bypass slow transport sessions for first hop selection
-- Limit AESNI inline asm to x86/x64
-- Create smaller I2NP packets if possible
-- Make router unreachable if AEAD tag verification fails in SessionCreated
-- Don't include a router to floodfills list until it's confirmed as real
-- Drop LeaseSet store request if not floodfill
-- Bypass medium congestion('D') routers for client tunnels
-- Publish encrypted RouterInfo through tunnels
-- Check if s is valid x25519 public key
-- Check if socket is open before sending data in SSU2
-### Fixed
-- Webconsole empty page if destination is not found
-- i2p.streaming.answerPings param
-- Reload tunnels
-- Address caps for unspecified ipv6 address
-- Incomplete HTTP headers in I2P tunnels
-- SSU2 socket network exceptions on Windows
-- Use of 'server' type tunnel port as inport (#1936)
-
-## [2.47.0] - 2023-03-11
-### Added
-- Congestion caps
-- SAM UDP port parameter
-- Support domain addresses for yggdrasil reseeds
-### Changed
-- DHT for floodfills instead plain list
-- Process router's messages in separate thread
-- Don't publish non-reachable router
-- Send and check target destination in first streaming SYN packet
-- Reseeds list
-### Fixed
-- Memory leak in windows network state detection
-- Reseed attempts from invalid address
-
-## [2.46.1] - 2023-02-20
-### Fixed
-- Race condition while getting router's peer profile
-- Creation of new router.info
-- Displaying LeaseSets in the webconsole
-- Crash when processing ACK request
-
-## [2.46.0] - 2023-02-15
-### Added
-- Limit number of acked SSU2 packets to 511
-- Localization to Swedish, Portuguese, Turkish, Polish
-- Periodically send Datetime block in NTCP2 and SSU2
-- Don't select random port from reserved
-- In memory table for peer profiles
-- Store if router was unreachable in it's peer profile
-- Show IPv6 addresses in square brackets in webconsole
-- Check referer when processing Addresshelper
-### Changed
-- Algorithm for tunnel creation success rate calculation
-- Drop incoming NTCP2 and SSU2 connection if published IP doesn't match actual endpoint
-- Exclude actually unreachable router from netdb for 2 hours
-- Select first hop from high bandwidth peers for client tunnels
-- Drop too long or too short LeaseSet
-- Delete router from netdb if became invalid after update
-- Terminate existing session if clock skew detected
-- Close previous UDP socket if open before reopening
-- Minimal version for floodfill is 0.9.51
-- Sort transports by endpoints in webconsole
-### Fixed
-- Deadlock during processing I2NP block with Garlic in ECIES encrypted message to router
-- Race condition with encrypted LeaseSets
-- HTTP query detection
-- Connection attempts to IPs from invalid ranges
-- Publish "0.0.0.0" in RouterInfo
-- Crash upon receiving PeerTest 7
-- Tunnels for closed SAM session socket
-- Missing NTCP2 address in RouterInfo if enabled back
-
-## [2.45.1] - 2023-01-11
-### Added
-- Full Cone NAT status error
-### Changed
-- Drop duplicated I2NP messages in SSU2
-- Set rejection code 30 if tunnel with id already exists
-- Network status is always OK if peer test msg 5 received
-### Fixed
-- UPnP crash if SSU2 or NTCP2 is disabled
-- Crash on termination for some platforms
-
-## [2.45.0] - 2023-01-03
-### Added
-- Test for Symmetric NAT with peer test msgs 6 and 7
-- Webconsole "No Descriptors" router error state
-- 1 and 15 seconds bandwidth calculation for i2pcontrol
-- Show non-zero send queue size for transports in web console
-- Compressible padding for I2P addresses
-- Localization to Czech
-- Don't accept incoming session from invalid/reserved addresses for NTCP2 and SSU2
-- Limit simultaneous tunnel build requests by 4 per pool
-### Changed
-- Removed SSU support
-- Reduced bandwidth calculation interval from 60 to 15 seconds
-- Increased default max transit tunnels number from 2500 to 5000 or 10000 for floodfill
-- Transit tunnels limit is doubled if floodfill mode is enabled
-- NTCP2 and SSU2 timestamps are rounded to seconds
-- Drop RouterInfos and LeaseSets with timestamp from future
-- Don't delete unreachable routers if tunnel creation success rate is too low
-- Refuse duplicated incoming pending NTCP2 session from same IP
-- Don't send SSU2 termination again if termination received block received
-- Handle standard network error for SSU2 without throwing an exception
-- Don't select overloaded peer for next tunnel
-- Remove "X-Requested-With" in HTTP Proxy for non-AJAX requests
-### Fixed
-- File descriptors leak
-- Random crash on AddressBook update
-- Crash if incorrect LeaseSet size
-- Spamming to log if no descriptors
-- ::1 address in RouterInfo
-- SSU2 network error handling (especially for Windows)
-- Race condition with pending outgoing SSU2 sessions
-- RTT self-reduction for long-live streams
-
-## [2.44.0] - 2022-11-20
-### Added
-- SSL connection for server I2P tunnels
-- Localization to Italian and Spanish
-- SSU2 through SOCKS5 UDP proxy
-- Reload tunnels through web console
-- SSU2 send immediate ack request flag
-- SSU2 send and verify path challenge
-- Configurable ssu2.mtu4 and ssu2.mtu6
-### Changed
-- SSU2 is enabled and SSU is disabled by default
-- Separate network status and error
-- Random selection between NTCP2 and SSU2 priority
-- Added notbob.i2p to jump services
-- Remove DoNotTrack flag from HTTP Request header
-- Skip addresshelper page if destination was not changed
-- SSU2 allow different ports from RelayReponse and HolePunch
-- SSU2 resend PeerTest msg 1 and msg 2
-- SSU2 Send Retry instead SessionCreated if clock skew detected
-### Fixed
-- Long HTTP headers for HTTP proxy and HTTP server tunnel
-- SSU2 resends and resend limits
-- Crash at startup if addressbook is disabled
-- NTCP2 ipv6 connection through SOCKS5 proxy
-- SSU2 SessionRequest with zero token
-- SSU2 MTU less than 1280
-- SSU2 port=1
-- Incorrect addresses from network interfaces
-- Definitions for Darwin PPC; do not use pthread_setname_np
-
-## [2.43.0] - 2022-08-22
-### Added
-- Complete SSU2 implementation
-- Localization to Chinese
-- Send RouterInfo update for long live sessions
-- Explicit ipv6 ranges of known tunnel brokers for MTU detection
-- Always send "Connection: close" and strip out Keep-Alive for server HTTP tunnel
-- Show ports for all transports in web console
-- Translation of webconsole site title
-- Support for Windows ProgramData path when running as service
-- Ability to turn off address book
-- Handle signals TSTP and CONT to stop and resume network
-### Changed
-- Case insensitive headers for server HTTP tunnel
-- Do not show 'Address registration' line if LeaseSet is encrypted
-- SSU2 transports have higher priority than SSU
-- Disable ElGamal precalculated table if no SSU
-- Deprecate limits.ntcpsoft, limits.ntcphard and limits.ntcpthreads config options
-- SSU2 is enabled and SSU is disabled by default for new installations
-### Fixed
-- Typo with Referer header name in HTTP proxy
-- Can't handle garlic message from an exploratory tunnel
-- Incorrect encryption key for exploratory lookup reply
-- Bound checks issues in LeaseSets code
-- MTU detection on Windows
-- Crash on stop of active server tunnel
-- Send datagram to wrong destination in SAM
-- Incorrect static key in RouterInfo if the keys were regenerated
-- Duplicated sessions in BOB
-
-## [2.42.1] - 2022-05-24
-### Fixed
-- Incorrect jump link in HTTP Proxy
-
-## [2.42.0] - 2022-05-22
-### Added
-- Preliminary SSU2 implementation
-- Tunnel length variance
-- Localization to French
-- Daily cleanup of obsolete peer profiles
-- Ordered jump services list in HTTP proxy
-- Win32 service
-- Show port for local non-published SSU addresses in web console
-### Changed
-- Maximum RouterInfo length increased to 3K
-- Skip unknown addresses in RouterInfo
-- Don't pick own router for peer test
-- Reseeds list
-- Internal numeric id for families
-- Use ipv6 preference only when netinet headers not used
-- Close stream if delete requested
-- Remove version from title in web console
-- Drop MESHNET build option
-- Set data path before initialization
-- Don't show registration block in web console if token is not provided
-### Fixed
-- Encrypted LeaseSet for EdDSA signature
-- Clients tunnels are not built if clock is not synced on start
-- Incorrect processing of i2cp.dontPublishLeaseSet param
-- UDP tunnels reload
-- Build for LibreSSL 3.5.2
-- Race condition in short tunnel build message
-- Race condition in local RouterInfo buffer allocation
-
-## [2.41.0] - 2022-02-20
-### Added
-- Clock syncronization through SSU
-- Drop routers older than 6 months on start
-- Localization to German
-- Don't send streaming ack too frequently
-- Select compatible outbound tunnel for I2CP messages
-- Restart webconsole's acceptor in case of exception
-### Changed
-- Use builtin bitswap for endian on windows
-- Send SessionCreated before connection close if clock skew
-- Try another floodfill for publishing if no compatible tunnels found
-- Reduce memory usage for RouterInfo structures
-- Avoid duplicated addresses in RouterInfo. Check presence of netId and version
-- Use TCP/IP sockets for I2CP on Android instead local sockets
-- Return uptime as integer in I2PControl
-- Reseed servers list/cerificates
-- Webconsole's dark style colors
-### Fixed
-- Attempt to use Yggdrasil on start on Android
-- Attempts to send peer tests to itself
-- Severe packets drop in SSU
-- Crash on tunnel tests
-- Loading addressbook subscriptions from config
-- Multiple I2CP session to the same destination
-- Build on Apple Silicon
-
-## [2.40.0] - 2021-11-29
-### Added
-- Keep alive parameter for client tunnels
-- Support openssl 3.0.0
-- Localization to Armenian
-- Show git commit info in version
-- Windows menu item for opening datadir
-- Reseed if too few floodfills
-- Don't publish old and replacing tunnel in LeaseSet
-- Webconsole light/dark theme depending on system settings (via CSS)
-### Changed
-- Set gzip compression to false by default
-- Build tunnel through ECIES routers only
-- Removed ElGamal support for tunnels
-- Moved webconsole resources to separate file
-- Pick tunnels with compatible transport with another tunnel of floodfill
-- Use common cleanup timer for all SSU sessions
-- Reduced memory usage
-- Reseed servers list
-- i18n code called from ClientContext
-### Fixed
-- Tunnels reload
-- Some typos in log messages
-- Cleanup relay requests table
-- Server tunnel is not published
-- Build on GNU/Hurd. Disable pthread_setname_np
-- Crash when incorrect sigtype used with blinding
-
-## [2.39.0] - 2021-08-23
-### Added
-- Short tunnel build messages
-- Localization. To: Russian, Ukrainian, Turkmen, Uzbek and Afrikaans
-- Custom CSS styles for webconsole
-- Avoid slow tunnels with more than 250 ms per hop
-- Process DELAY_REQUESTED streaming option
-- "certsdir" options for certificates location
-- Keep own RouterInfo in NetBb
-- Pick ECIES routers only for tunnels on non-x64
-- NTP sync through ipv6
-- Allow ipv6 addresses for UDP server tunnels
-### Changed
-- Rekey of all routers to ECIES
-- Better distribution for random tunnel's peer selection
-- Yggdrasil reseed for v0.4, added two more
-- Encryption type 0,4 by default for server tunnels
-- Handle i2cp.dontPublishLeaseSet param for all destinations
-- reg.i2p for subscriptions
-- LeaseSet type 3 by default
-- Don't allocate payload buffer for every single ECIESx25519 message
-- Prefer public ipv6 instead rfc4941
-- Optimal padding for one-time ECIESx25519 message
-- Don't send datetime block for one-time ECIESx25519 message with one-time key
-- Router with expired introducer is still valid
-- Don't disable floodfill if still reachable by ipv6
-- Set minimal version for floodfill to 0.9.38
-- Eliminate extra lookups for sequential fragments on tunnel endpoint
-- Consistent path for explicit peers
-- Always create new tunnel from exploratory pool
-- Don't try to connect to a router not reachable from us
-- Mark additional ipv6 addresses/nets as reserved (#1679)
-### Fixed
-- Zero-hop tunnels
-- Crash upon SAM session termination
-- Build with boost < 1.55.0
-- Address type for NTCP2 acceptors
-- Check of ipv4/ipv6 address
-- Request router to send to if not in NetDb
-- Count outbound traffic for zero-hop tunnels
-- URLdecode domain for registration string generator in webconsole
-
-## [2.38.0] - 2021-05-17
-### Added
-- Publish ipv6 introducers
-- Bind ipv6 or yggdrasil NTCP2 acceptor to specified address
-- Support .b32.i2p addresses and hostnames for SAM STREAM CREATE
-- ipv6 peer tests
-- Publish iexp param for introducers
-- Show ipv6 network status on the webconsole
-- EdDSA signing keys can also be blinded
-- Show router version on the webconsole
-### Changed
-- Rekey of all routers but floodfills to ECIES
-- Increased number of precalculated x25519 keys to 15
-- Don't publish LeaseSet without inbound tunnels
-- Reseed from compatible address(ipv4 or ipv6)
-- Recongnize v4 and v6 SSU addresses without host
-- Inbound tunnel gateway must be ipv4 compatible
-- Don't select next introducers from existing sessions
-- Set X bandwidth for floodfill by default
-### Fixed
-- Incoming ECIES-x25519 session doesn't send updated LeaseSet
-- Unique local address for server tunnels
-- Race condition for LeaseSet creation in I2CP
-- Relay tag for ipv6 introducer
-- Already expired introducers
-- Find connected router for first peer in tunnel
-- Failed outgoing ECIES-x25519 session's tagset stays forever
-- Yggdrasil address disappears if router becomes unreachable through ipv6
-- Ignore SSU address/introducers if port is not specified
-- Check identity and signature length for SSU SessionConfirmed
-
-## [2.37.0] - 2021-03-15
-### Added
-- Address registration line for reg.i2p and stats.i2p through the web console
-- "4" and "6" caps for addresses without published IP address
-- Mesh and Proxy network statuses
-- Symmetric NAT network status error
-- Bind server tunnel connection to specified address
-- lookuplocal BOB extended command
-- address4 and address6 parameters to bind outgoing connections to
-- Rekey of low-bandwidth routers to ECIES
-- Popup notification windows when unable to parse config for Windows
-### Changed
-- Floodfills with "U" cap are not ignored anymore
-- Check transports reachability between tunnel peers and between router and floodfill
-- NTCP2 and reseed HTTP proxy support authorization now
-- Show actual IP addresses for proxy connections
-- Publish and handle SSU addreses without host
-- Outbound tunnel endpoint must be ipv4 compatible
-- Logging optimization
-- Removed Windows service
-### Fixed
-- Incoming SSU session terminates after 5 seconds
-- Outgoing NTCP2 ipv4 session even if ipv4 is disabled
-- No incoming Yggdrasil connection if connected through NTCP2 proxy
-- Race condition between tunnel build and floodfill requests decryption for ECIES routers
-- Numeric bandwidth limitation
-- Yggdrasil for Android
-
-## [2.36.0] - 2021-02-15
-### Added
-- Encrypted lookup and publications to ECIES-x25519 floodfiils
-- Yggdrasil transports and reseeds
-- Dump addressbook in hosts.txt format
-- Request RouterInfo through exploratory tunnels if direct connection to fllodfill is not possible
-- Threads naming
-- Check if public x25519 key is valid
-- ECIES-X25519-AEAD-Ratchet for shared local destination
-- LeaseSet creation timeout for I2CP session
-- Resend RouterInfo after some interval for longer NTCP2 sessions
-- Select reachable router of inbound tunnel gateway
-- Reseed if no compatible routers in netdb
-- Refresh on swipe in Android webconsole
-### Changed
-- reg.i2p for default addressbook instead inr.i2p
-- ECIES-x25519 (crypto type 4) for new routers
-- Try to connect to all compatible addresses from peer's RouterInfo
-- Replace LeaseSet completely if store type changes
-- Try ECIES-X25519-AEAD-Ratchet tag before ElGamal
-- Don't detach ECIES-X25519-AEAD-Ratchet session from destination immediately
-- Viewport and styles on error in HTTP proxy
-- Don't create notification when Windows taskbar restarted
-- Cumulative SSU ACK bitfields
-- limit tunnel length to 8 hops
-- Limit tunnels quantity to 16
-### Fixed
-- Handling chunked HTTP response in addressbook
-- Missing ECIES-X25519-AEAD-Ratchet tags for multiple streams with the same destination
-- Correct NAME for NAMING REPLY in SAM
-- SSU crash on termination
-- Offline signature length for stream close packet
-- Don't send updated LeaseSet through a terminated session
-- Decryption of follow-on ECIES-X25519-AEAD-Ratchet NSR messages
-- Non-confirmed LeaseSet is resent too late for ECIES-X25519-AEAD-Ratchet session
-
-## [2.35.0] - 2020-11-30
-### Added
-- ECIES-x25519 routers
-- Random intro keys for SSU
-- Graceful shutdown timer for windows
-- Send queue for I2CP messages
-- Update DSA router keys to EdDSA
-- TCP_QUICKACK for NTCP2 sockets on Linux
-### Changed
-- Exclude floodfills with DSA signatures and < 0.9.28
-- Random intervals between tunnel tests and manage for tunnel pools
-- Don't replace an addressbook record by one with DSA signature
-- Publish RouterInfo after update
-- Create paired inbound tunnels if no inbound tunnels yet
-- Reseed servers list
-### Fixed
-- Transient signature length, if different from identity
-- Terminate I2CP session if destroyed
-- RouterInfo publishing confirmation
-- Check if ECIES-X25519-AEAD-Ratchet session expired before generating more tags
-- Correct block size for delivery type local for ECIES-X25519-AEAD-Ratchet
-
-## [2.34.0] - 2020-10-27
-### Added
-- Ping responses for streaming
-- STREAM FORWARD for SAM
-- Tunnels through ECIES-x25519 routers
-- Single thread for I2CP
-- Shared transient destination between proxies
-- Database lookups from ECIES destinations with ratchets response
-- Handle WebDAV HTTP methods
-- Don't try to connect or build tunnels if offline
-- Validate IP when trying connect to remote peer
-- Handle ICMP responses and WinAPI errors for SSU
-### Changed
-- Removed NTCP
-- Dropped gcc 4.7 support
-- Encyption type 0,4 by default for client tunnels
-- Stripped out some HTTP header for HTTP server response
-- HTTP 1.1 addressbook requests
-- Set LeaseSet type to 3 for ratchets if not specified
-- Handle SSU v4 and v6 messages in one thread
-- Eliminate DH keys thread
-### Fixed
-- Random crashes on I2CP session disconnect
-- Stream through racthets hangs if first SYN was not acked
-- Check "Last-Modified" instead "If-Modified-Since" for addressbook reponse
-- Trim behind ECIESx25519 tags
-- Few bugs with Android main activity
-- QT visual and layout issues
-
-## [2.33.0] - 2020-08-24
-### Added
-- Shared transient addresses
-- crypto.ratchet.inboundTags paramater
-- Multiple encryption keys through I2CP
-- Pre-calculated x25519 ephemeral keys
-- Change datagram routing path if nothing comes back in 10 seconds
-- Shared routing path for datagram session
-### Changed
-- UDP tunnels send mix of repliable and raw datagrams in bulk
-- Encrypt SSU packet again upon resend
-- Start new tunnel message if remaining buffer is too small
-- Use LeaseSet2 for ECIES-X25519-AEAD-Ratchet automatically
-- Save new ECIES-X25519-AEAD-Ratchet session with NSR tagset
-- Generate random padding lengths for ECIES-X25519-AEAD-Ratchet in bulk
-- Webconsole layout
-- Reseed servers list
-### Fixed
-- Don't connect through terminated SAM destination
-- Differentiate UDP server sessions by port
-- ECIES-X25519-AEAD-Ratchet through I2CP
-- Don't save invalid address to AddressBook
-- ECDSA signatures names in SAM
-- AppArmor profile
-
-## [2.32.1] - 2020-06-02
-### Added
-- Read explicit peers in tunnels config
-### Fixed
-- Generation of tags for detached sessions
-- Non-updating LeaseSet1
-- Start when deprecated websocket options present in i2pd.conf
-
-## [2.32.0] - 2020-05-25
-### Added
-- Multiple encryption types for local destinations
-- Next key and tagset for ECIES-X25519-AEAD-Ratchet
-- NTCP2 through SOCKS proxy
-- Throw error message if any port to bind is occupied
-- gzip parameter for UDP tunnels
-- Show ECIES-X25519-AEAD-Ratchet sessions and tags on the web console
-- Simplified implementation of gzip for no compression mode
-- Allow ECIES-X25519-AEAD-Ratchet session restart after 2 minutes
-- Added logrotate config for rpm package
-### Changed
-- Select peers for client tunnels among routers >= 0.9.36
-- Check ECIES flag for encrypted lookup reply
-- Streaming MTU size 1812 for ECIES-X25519-AEAD-Ratchet
-- Don't calculate checksum for Data message send through ECIES-X25519-AEAD-Ratchet
-- Catch network connectivity status for Windows
-- Stop as soon as no more transit tunnels during graceful shutdown for Android
-- RouterInfo gzip compression level depends on size
-- Send response to received datagram from ECIES-X25519-AEAD-Ratchet session
-- Update webconsole functional
-- Increased max transit tunnels limit
-- Reseeds list
-- Dropped windows support in cmake
-### Fixed
-- Correct timestamp check for LeaseSet2
-- Encrypted leaseset without authentication
-- Change SOCKS proxy connection response for clients without socks5h support (#1336)
-
-## [2.31.0] - 2020-04-10
-### Added
-- NTCP2 through HTTP proxy
-- Publish LeaseSet2 for I2CP destinations
-- Show status page on main activity for android
-- Handle ECIESFlag in DatabaseLookup at floodfill
-- C++17 features for eligible compilers
-### Changed
-- Droped Websockets and Lua support
-- Send DeliveryStatusMsg for LeaseSet for ECIES-X25519-AEAD-Ratchet
-- Keep sending new session reply until established for ECIES-X25519-AEAD-Ratchet
-- Updated SSU log messages
-- Reopen SSU socket on exception
-- Security hardening headers in web console
-- Various web console changes
-- Various QT changes
-### Fixed
-- NTCP2 socket descriptors leak
-- Race condition with router's identity in transport sessions
-- Not terminated streams remain forever
-
-## [2.30.0] - 2020-02-25
-### Added
-- Single threaded SAM
-- Experimental support of ECIES-X25519-AEAD-Ratchet crypto type
-### Changed
-- Minimal MTU size is 1280 for ipv6
-- Use unordered_map instead map for destination's sessions and tags list
-- Use std::shuffle instead std::random_shuffle
-- SAM is single threaded by default
-- Reseeds list
-### Fixed
-- Correct termination of streaming destination
-- Extra ',' in RouterInfo response in I2PControl
-- SAM crash on session termination
-- Storage for Android 10
-
-## [2.29.0] - 2019-10-21
-### Added
-- Client auth flag for b33 address
-### Changed
-- Remove incoming NTCP2 session from pending list when established
-- Handle errors for NTCP2 SessionConfrimed send
-### Fixed
-- Failure to start on Windows XP
-- SAM crash if invalid lookup address
-- Possible crash when UPnP enabled on shutdown
-
-## [2.28.0] - 2019-08-27
-### Added
-- RAW datagrams in SAM
-- Publishing encrypted LeaseSet2 with DH or PSH authentication
-- Ability to disable battery optimization for Android
-- Transport Network ID Check
-### Changed
-- Set and handle published encrypted flag for LeaseSet2
-### Fixed
-- ReceiveID changes in the same stream
-- "\r\n" command terminator in SAM
-- Addressbook lines with signatures
-
-## [2.27.0] - 2019-07-03
-### Added
-- Support of PSK and DH authentication for encrypted LeaseSet2
-### Changed
-- Uptime is based on monotonic timer
-### Fixed
-- BOB status command response
-- Correct NTCP2 port if NTCP is disabled
-- Flood encrypted LeaseSet2 with store hash
-
-## [2.26.0] - 2019-06-07
-### Added
-- HTTP method "PROPFIND"
-- Detection of external ipv6 address through the SSU
-- NTCP2 publishing depends on network status
-### Changed
-- ntcp is disabled by default, ntcp2 is published by default
-- Response to BOB's "list" command
-- ipv6 address is not longer NTCP's local endpoint's address
-- Reseeds list
-- HTTP_REFERER stripping in httpproxy (#823)
-### Fixed
-- Check and handle incorrect BOB input
-- Ignore introducers for NTCP or NTCP2 addresses
-- RouterInfo check from NTCP2
-
## [2.25.0] - 2019-05-09
### Added
- Create, publish and handle encrypted LeaseSet2
-- Support of b33 addresses
+- Support of b33 addresses
- RedDSA key blinding
- .b32.i2p addresses in jump links
- ntcp2.addressv6 parameter
@@ -921,7 +36,7 @@
- Correct SAM response for invalid key
- SAM crash on termination for Windows
- Race condition for publishing
-
+
## [2.23.0] - 2019-01-21
### Added
- Standard LeaseSet2 support
@@ -980,7 +95,7 @@
- NTCP2 is enabled by default
- Show lease's expiration time in readable format in the web console
### Fixed
-- Correct names for transports in the web console
+- Correct names for transports in the web console
## [2.19.0] - 2018-06-26
### Added
@@ -1144,7 +259,7 @@
### Added
- Datagram i2p tunnels
- Unique local addresses for server tunnels
-- Configurable list of reseed servers and initial addressbook
+- Configurable list of reseed servers and initial addressbook
- Configurable netid
- Initial iOS support
diff --git a/LICENSE b/LICENSE
index f59491f5..2cb10225 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2013-2025, The PurpleI2P Project
+Copyright (c) 2013-2015, The PurpleI2P Project
All rights reserved.
diff --git a/Makefile b/Makefile
index 0d4ca48c..3dfaaade 100644
--- a/Makefile
+++ b/Makefile
@@ -1,43 +1,24 @@
-.DEFAULT_GOAL := all
-
SYS := $(shell $(CXX) -dumpmachine)
-
-ifneq (, $(findstring darwin, $(SYS)))
- SHARED_SUFFIX = dylib
-else ifneq (, $(findstring mingw, $(SYS))$(findstring windows-gnu, $(SYS))$(findstring cygwin, $(SYS)))
- SHARED_SUFFIX = dll
-else
- SHARED_SUFFIX = so
-endif
-
-SHLIB := libi2pd.$(SHARED_SUFFIX)
+SHLIB := libi2pd.so
ARLIB := libi2pd.a
-SHLIB_LANG := libi2pdlang.$(SHARED_SUFFIX)
-ARLIB_LANG := libi2pdlang.a
-SHLIB_CLIENT := libi2pdclient.$(SHARED_SUFFIX)
+SHLIB_CLIENT := libi2pdclient.so
ARLIB_CLIENT := libi2pdclient.a
-SHLIB_WRAP := libi2pdwrapper.$(SHARED_SUFFIX)
-ARLIB_WRAP := libi2pdwrapper.a
I2PD := i2pd
+GREP := grep
+DEPS := obj/make.dep
LIB_SRC_DIR := libi2pd
LIB_CLIENT_SRC_DIR := libi2pd_client
-WRAP_SRC_DIR := libi2pd_wrapper
-LANG_SRC_DIR := i18n
DAEMON_SRC_DIR := daemon
-# import source files lists
include filelist.mk
-USE_STATIC := $(or $(USE_STATIC),no)
-USE_UPNP := $(or $(USE_UPNP),no)
-DEBUG := $(or $(DEBUG),yes)
-
-# for debugging purposes only, when commit hash needed in trunk builds in i2pd version string
-USE_GIT_VERSION := $(or $(USE_GIT_VERSION),no)
-
-# for MacOS only, waiting for "1", not "yes"
-HOMEBREW := $(or $(HOMEBREW),0)
+USE_AESNI := yes
+USE_AVX := yes
+USE_STATIC := no
+USE_MESHNET := no
+USE_UPNP := no
+DEBUG := yes
ifeq ($(DEBUG),yes)
CXX_DEBUG = -g
@@ -46,8 +27,8 @@ else
LD_DEBUG = -s
endif
-ifneq (, $(DESTDIR))
- PREFIX = $(DESTDIR)
+ifeq ($(WEBSOCKETS),1)
+ NEEDED_CXXFLAGS += -DWITH_EVENTS
endif
ifneq (, $(findstring darwin, $(SYS)))
@@ -57,57 +38,36 @@ ifneq (, $(findstring darwin, $(SYS)))
else
include Makefile.osx
endif
-else ifneq (, $(findstring mingw, $(SYS))$(findstring windows-gnu, $(SYS))$(findstring cygwin, $(SYS)))
- DAEMON_SRC += Win32/DaemonWin32.cpp Win32/Win32App.cpp Win32/Win32Service.cpp Win32/Win32NetState.cpp
- include Makefile.mingw
else ifneq (, $(findstring linux, $(SYS))$(findstring gnu, $(SYS)))
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
include Makefile.linux
else ifneq (, $(findstring freebsd, $(SYS))$(findstring openbsd, $(SYS)))
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
include Makefile.bsd
-else ifneq (, $(findstring haiku, $(SYS)))
- DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
- include Makefile.haiku
-else ifneq (, $(findstring solaris, $(SYS)))
- DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
- include Makefile.solaris
+else ifneq (, $(findstring mingw, $(SYS))$(findstring cygwin, $(SYS)))
+ DAEMON_SRC += Win32/DaemonWin32.cpp Win32/Win32Service.cpp Win32/Win32App.cpp
+ include Makefile.mingw
else # not supported
$(error Not supported platform)
endif
-INCFLAGS += -I$(LIB_SRC_DIR) -I$(LIB_CLIENT_SRC_DIR) -I$(LANG_SRC_DIR)
-DEFINES += -DOPENSSL_SUPPRESS_DEPRECATED
-NEEDED_CXXFLAGS += -MMD -MP
-
-ifeq ($(USE_GIT_VERSION),yes)
- GIT_VERSION := $(shell git describe --tags)
- DEFINES += -DGITVER=$(GIT_VERSION)
+ifeq ($(USE_MESHNET),yes)
+ NEEDED_CXXFLAGS += -DMESHNET
endif
-LIB_OBJS += $(patsubst %.cpp,obj/%.o,$(LIB_SRC))
-LIB_CLIENT_OBJS += $(patsubst %.cpp,obj/%.o,$(LIB_CLIENT_SRC))
-LANG_OBJS += $(patsubst %.cpp,obj/%.o,$(LANG_SRC))
-DAEMON_OBJS += $(patsubst %.cpp,obj/%.o,$(DAEMON_SRC))
-WRAP_LIB_OBJS += $(patsubst %.cpp,obj/%.o,$(WRAP_LIB_SRC))
-DEPS += $(LIB_OBJS:.o=.d) $(LIB_CLIENT_OBJS:.o=.d) $(LANG_OBJS:.o=.d) $(DAEMON_OBJS:.o=.d) $(WRAP_LIB_OBJS:.o=.d)
+NEEDED_CXXFLAGS += -I$(LIB_SRC_DIR) -I$(LIB_CLIENT_SRC_DIR)
-## Build all code (libi2pd, libi2pdclient, libi2pdlang), link it to .a and build binary
-all: $(ARLIB) $(ARLIB_CLIENT) $(ARLIB_LANG) $(I2PD)
+all: mk_obj_dir $(ARLIB) $(ARLIB_CLIENT) $(I2PD)
mk_obj_dir:
+ @mkdir -p obj
+ @mkdir -p obj/Win32
@mkdir -p obj/$(LIB_SRC_DIR)
@mkdir -p obj/$(LIB_CLIENT_SRC_DIR)
- @mkdir -p obj/$(LANG_SRC_DIR)
@mkdir -p obj/$(DAEMON_SRC_DIR)
- @mkdir -p obj/$(WRAP_SRC_DIR)
- @mkdir -p obj/Win32
-api: $(SHLIB) $(ARLIB)
-client: $(SHLIB_CLIENT) $(ARLIB_CLIENT)
-lang: $(SHLIB_LANG) $(ARLIB_LANG)
-api_client: api client lang
-wrapper: api_client $(SHLIB_WRAP) $(ARLIB_WRAP)
+api: mk_obj_dir $(SHLIB) $(ARLIB)
+api_client: mk_obj_dir $(SHLIB) $(ARLIB) $(SHLIB_CLIENT) $(ARLIB_CLIENT)
## NOTE: The NEEDED_CXXFLAGS are here so that CXXFLAGS can be specified at build time
## **without** overwriting the CXXFLAGS which we need in order to build.
@@ -116,53 +76,40 @@ wrapper: api_client $(SHLIB_WRAP) $(ARLIB_WRAP)
## -std=c++11. If you want to remove this variable please do so in a way that allows setting
## custom FLAGS to work at build-time.
-obj/%.o: %.cpp | mk_obj_dir
- $(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(DEFINES) $(INCFLAGS) -c -o $@ $<
+deps: mk_obj_dir
+ $(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) -MM *.cpp > $(DEPS)
+ @sed -i -e '/\.o:/ s/^/obj\//' $(DEPS)
+
+obj/%.o: %.cpp
+ $(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(CPU_FLAGS) -c -o $@ $<
# '-' is 'ignore if missing' on first run
-include $(DEPS)
-$(I2PD): $(DAEMON_OBJS) $(ARLIB) $(ARLIB_CLIENT) $(ARLIB_LANG)
- $(CXX) $(DEFINES) $(LDFLAGS) -o $@ $^ $(LDLIBS)
+DAEMON_OBJS += $(patsubst %.cpp,obj/%.o,$(DAEMON_SRC))
+$(I2PD): $(DAEMON_OBJS) $(ARLIB) $(ARLIB_CLIENT)
+ $(CXX) -o $@ $^ $(LDFLAGS) $(LDLIBS)
-$(SHLIB): $(LIB_OBJS)
+$(SHLIB): $(patsubst %.cpp,obj/%.o,$(LIB_SRC))
ifneq ($(USE_STATIC),yes)
- $(CXX) $(LDFLAGS) -shared -o $@ $^ $(LDLIBS)
+ $(CXX) $(LDFLAGS) $(LDLIBS) -shared -o $@ $^
endif
-$(SHLIB_CLIENT): $(LIB_CLIENT_OBJS) $(SHLIB) $(SHLIB_LANG)
-ifneq ($(USE_STATIC),yes)
- $(CXX) $(LDFLAGS) -shared -o $@ $^ $(LDLIBS) $(SHLIB) $(SHLIB_LANG)
-endif
+$(SHLIB_CLIENT): $(patsubst %.cpp,obj/%.o,$(LIB_CLIENT_SRC))
+ $(CXX) $(LDFLAGS) $(LDLIBS) -shared -o $@ $^
-$(SHLIB_WRAP): $(WRAP_LIB_OBJS)
-ifneq ($(USE_STATIC),yes)
- $(CXX) $(LDFLAGS) -shared -o $@ $^ $(LDLIBS)
-endif
-
-$(SHLIB_LANG): $(LANG_OBJS)
-ifneq ($(USE_STATIC),yes)
- $(CXX) $(LDFLAGS) -shared -o $@ $^ $(LDLIBS)
-endif
-
-$(ARLIB): $(LIB_OBJS)
+$(ARLIB): $(patsubst %.cpp,obj/%.o,$(LIB_SRC))
$(AR) -r $@ $^
-$(ARLIB_CLIENT): $(LIB_CLIENT_OBJS)
- $(AR) -r $@ $^
-
-$(ARLIB_WRAP): $(WRAP_LIB_OBJS)
- $(AR) -r $@ $^
-
-$(ARLIB_LANG): $(LANG_OBJS)
+$(ARLIB_CLIENT): $(patsubst %.cpp,obj/%.o,$(LIB_CLIENT_SRC))
$(AR) -r $@ $^
clean:
$(RM) -r obj
$(RM) -r docs/generated
- $(RM) $(I2PD) $(SHLIB) $(ARLIB) $(SHLIB_CLIENT) $(ARLIB_CLIENT) $(SHLIB_LANG) $(ARLIB_LANG) $(SHLIB_WRAP) $(ARLIB_WRAP)
+ $(RM) $(I2PD) $(SHLIB) $(ARLIB) $(SHLIB_CLIENT) $(ARLIB_CLIENT)
-strip: $(I2PD) $(SHLIB) $(SHLIB_CLIENT) $(SHLIB_LANG)
+strip: $(I2PD) $(SHLIB_CLIENT) $(SHLIB)
strip $^
LATEST_TAG=$(shell git describe --tags --abbrev=0 openssl)
@@ -180,13 +127,11 @@ doxygen:
.PHONY: all
.PHONY: clean
+.PHONY: deps
.PHONY: doxygen
.PHONY: dist
.PHONY: last-dist
.PHONY: api
.PHONY: api_client
-.PHONY: client
-.PHONY: lang
.PHONY: mk_obj_dir
.PHONY: install
-.PHONY: strip
diff --git a/Makefile.bsd b/Makefile.bsd
index 1c911802..39e5651a 100644
--- a/Makefile.bsd
+++ b/Makefile.bsd
@@ -1,22 +1,12 @@
CXX = clang++
CXXFLAGS ?= ${CXX_DEBUG} -Wall -Wextra -Wno-unused-parameter -pedantic -Wno-misleading-indentation
-DEFINES = -D_GLIBCXX_USE_NANOSLEEP=1
-INCFLAGS = -I/usr/include/ -I/usr/local/include/
-LDFLAGS = ${LD_DEBUG} -Wl,-rpath,/usr/local/lib -L/usr/local/lib
-LDLIBS = -lssl -lcrypto -lz -lpthread -lboost_system -lboost_program_options
-
## NOTE: NEEDED_CXXFLAGS is here so that custom CXXFLAGS can be specified at build time
## **without** overwriting the CXXFLAGS which we need in order to build.
## For example, when adding 'hardening flags' to the build
## (e.g. -fstack-protector-strong -Wformat -Werror=format-security), we do not want to remove
## -std=c++11. If you want to remove this variable please do so in a way that allows setting
## custom FLAGS to work at build-time.
-CXXVER := $(shell $(CXX) -dumpversion|cut -c 1-2)
-ifeq (${CXXVER}, "4.") # older clang always returned 4.2.1
- $(error Compiler too old)
-else ifeq (${CXXVER}, ${filter ${CXXVER},16 17 18 19}) # clang 16 - 19
- NEEDED_CXXFLAGS = -std=c++20
-else
- NEEDED_CXXFLAGS = -std=c++17
-endif
-
+NEEDED_CXXFLAGS = -std=c++11 -D_GLIBCXX_USE_NANOSLEEP=1
+INCFLAGS = -I/usr/include/ -I/usr/local/include/
+LDFLAGS = ${LD_DEBUG} -Wl,-rpath,/usr/local/lib -L/usr/local/lib
+LDLIBS = -lcrypto -lssl -lz -lboost_system -lboost_date_time -lboost_filesystem -lboost_program_options -lpthread
diff --git a/Makefile.haiku b/Makefile.haiku
deleted file mode 100644
index eb56a207..00000000
--- a/Makefile.haiku
+++ /dev/null
@@ -1,14 +0,0 @@
-ifeq ($(shell $(CXX) -dumpmachine | cut -c 1-4), i586)
-CXX = g++-x86
-else
-CXX = g++
-endif
-CXXFLAGS := -Wall -std=c++20
-INCFLAGS = -I/system/develop/headers
-DEFINES = -D_DEFAULT_SOURCE -D_GNU_SOURCE
-LDLIBS = -lbe -lbsd -lnetwork -lz -lssl -lcrypto -lboost_program_options -lpthread
-
-ifeq ($(USE_UPNP),yes)
- DEFINES += -DUSE_UPNP
- LDLIBS += -lminiupnpc
-endif
diff --git a/Makefile.homebrew b/Makefile.homebrew
index 706f9811..64301c02 100644
--- a/Makefile.homebrew
+++ b/Makefile.homebrew
@@ -1,49 +1,54 @@
# root directory holding homebrew
-BREWROOT = /opt/homebrew
+BREWROOT = /usr/local
BOOSTROOT = ${BREWROOT}/opt/boost
SSLROOT = ${BREWROOT}/opt/openssl@1.1
UPNPROOT = ${BREWROOT}/opt/miniupnpc
+CXXFLAGS = ${CXX_DEBUG} -Wall -std=c++11 -DMAC_OSX -Wno-overloaded-virtual
+INCFLAGS = -I${SSLROOT}/include -I${BOOSTROOT}/include
+LDFLAGS = ${LD_DEBUG}
-CXXFLAGS ?= ${CXX_DEBUG} -Wall -Wno-overloaded-virtual
-NEEDED_CXXFLAGS ?= -std=c++17
-INCFLAGS ?= -I${SSLROOT}/include -I${BOOSTROOT}/include
-LDFLAGS ?= ${LD_DEBUG}
-DEFINES += -DMAC_OSX
+ifndef TRAVIS
+ CXX = clang++
+endif
ifeq ($(USE_STATIC),yes)
- LDLIBS = -lz ${SSLROOT}/lib/libcrypto.a ${SSLROOT}/lib/libssl.a ${BOOSTROOT}/lib/libboost_system.a ${BOOSTROOT}/lib/libboost_filesystem.a ${BOOSTROOT}/lib/libboost_program_options.a
-ifeq ($(USE_UPNP),yes)
- LDLIBS += ${UPNPROOT}/lib/libminiupnpc.a
-endif
- LDLIBS += -lpthread -ldl
+ LDLIBS = -lz ${SSLROOT}/lib/libcrypto.a ${SSLROOT}/lib/libssl.a ${BOOSTROOT}/lib/libboost_system.a ${BOOSTROOT}/lib/libboost_date_time.a ${BOOSTROOT}/lib/libboost_filesystem.a ${BOOSTROOT}/lib/libboost_program_options.a -lpthread
else
LDFLAGS += -L${SSLROOT}/lib -L${BOOSTROOT}/lib
- LDLIBS = -lz -lssl -lcrypto -lboost_system -lboost_filesystem -lboost_program_options -lpthread
-ifeq ($(USE_UPNP),yes)
- LDFLAGS += -L${UPNPROOT}/lib
- LDLIBS += -lminiupnpc
-endif
+ LDLIBS = -lz -lcrypto -lssl -lboost_system -lboost_date_time -lboost_filesystem -lboost_program_options -lpthread
endif
ifeq ($(USE_UPNP),yes)
- DEFINES += -DUSE_UPNP
+ LDFLAGS += -ldl
+ CXXFLAGS += -DUSE_UPNP
INCFLAGS += -I${UPNPROOT}/include
+ ifeq ($(USE_STATIC),yes)
+ LDLIBS += ${UPNPROOT}/lib/libminiupnpc.a
+ else
+ LDFLAGS += -L${UPNPROOT}/lib
+ LDLIBS += -lminiupnpc
+ endif
+endif
+
+# OSX Notes
+# http://www.hutsby.net/2011/08/macs-with-aes-ni.html
+# Seems like all recent Mac's have AES-NI, after firmware upgrade 2.2
+# Found no good way to detect it from command line. TODO: Might be some osx sysinfo magic
+ifeq ($(USE_AESNI),yes)
+ CXXFLAGS += -maes
+endif
+ifeq ($(USE_AVX),1)
+ CXXFLAGS += -mavx
endif
install: all
- install -d ${PREFIX}/bin
- install -m 755 ${I2PD} ${PREFIX}/bin
- install -d ${PREFIX}/etc ${PREFIX}/etc/i2pd ${PREFIX}/etc/i2pd/tunnels.conf.d
+ install -d ${PREFIX}/bin ${PREFIX}/etc/i2pd ${PREFIX}/share/doc/i2pd ${PREFIX}/share/i2pd ${PREFIX}/share/man/man1 ${PREFIX}/var/lib/i2pd
+ install -m 755 ${I2PD} ${PREFIX}/bin/
install -m 644 contrib/i2pd.conf contrib/subscriptions.txt contrib/tunnels.conf ${PREFIX}/etc/i2pd
- install -d ${PREFIX}/share ${PREFIX}/share/doc ${PREFIX}/share/doc/i2pd
- install -m 644 ChangeLog LICENSE README.md contrib/i2pd.conf contrib/subscriptions.txt contrib/tunnels.conf ${PREFIX}/share/doc/i2pd
- install -d ${PREFIX}/share/i2pd
@cp -R contrib/certificates ${PREFIX}/share/i2pd/
- install -d ${PREFIX}/share/man ${PREFIX}/share/man/man1
- @gzip -kf debian/i2pd.1 && install debian/i2pd.1.gz ${PREFIX}/share/man/man1
- install -d ${PREFIX}/var ${PREFIX}/var/lib ${PREFIX}/var/lib/i2pd
- @ln -sf ${PREFIX}/share/i2pd/certificates ${PREFIX}/var/lib/i2pd/certificates
- @ln -sf ${PREFIX}/etc/i2pd/tunnels.conf.d ${PREFIX}/var/lib/i2pd/tunnels.d
+ install -m 644 ChangeLog LICENSE README.md contrib/i2pd.conf contrib/subscriptions.txt contrib/tunnels.conf ${PREFIX}/share/doc/i2pd
+ @gzip debian/i2pd.1 && install debian/i2pd.1.gz ${PREFIX}/share/man/man1
+ @ln -sf ${PREFIX}/share/i2pd/certificates ${PREFIX}/var/lib/i2pd/
@ln -sf ${PREFIX}/etc/i2pd/i2pd.conf ${PREFIX}/var/lib/i2pd/i2pd.conf
@ln -sf ${PREFIX}/etc/i2pd/subscriptions.txt ${PREFIX}/var/lib/i2pd/subscriptions.txt
- @ln -sf ${PREFIX}/etc/i2pd/tunnels.conf ${PREFIX}/var/lib/i2pd/tunnels.conf
+ @ln -sf ${PREFIX}/etc/i2pd/tunnels.conf ${PREFIX}/var/lib/i2pd/tunnels.conf
\ No newline at end of file
diff --git a/Makefile.linux b/Makefile.linux
index 4ea39e22..d1ccf143 100644
--- a/Makefile.linux
+++ b/Makefile.linux
@@ -1,5 +1,5 @@
# set defaults instead redefine
-CXXFLAGS ?= ${CXX_DEBUG} -Wall -Wextra -Wno-unused-parameter -pedantic -Wno-psabi
+CXXFLAGS ?= ${CXX_DEBUG} -Wall -Wextra -Wno-unused-parameter -pedantic -Wno-misleading-indentation
LDFLAGS ?= ${LD_DEBUG}
## NOTE: The NEEDED_CXXFLAGS are here so that custom CXXFLAGS can be specified at build time
@@ -9,17 +9,19 @@ LDFLAGS ?= ${LD_DEBUG}
## -std=c++11. If you want to remove this variable please do so in a way that allows setting
## custom FDLAGS to work at build-time.
-# detect proper flag for c++17 support by compilers
+# detect proper flag for c++11 support by compilers
CXXVER := $(shell $(CXX) -dumpversion)
ifeq ($(shell expr match $(CXX) 'clang'),5)
- NEEDED_CXXFLAGS += -std=c++17
-else ifeq ($(shell expr match ${CXXVER} "[8-9]"),1) # gcc 8 - 9
- NEEDED_CXXFLAGS += -std=c++17
- LDLIBS = -lboost_system -lstdc++fs
-else ifeq ($(shell expr match ${CXXVER} "1[0-2]"),2) # gcc 10 - 12
- NEEDED_CXXFLAGS += -std=c++17
-else ifeq ($(shell expr match ${CXXVER} "1[3-9]"),2) # gcc 13+
- NEEDED_CXXFLAGS += -std=c++20
+ NEEDED_CXXFLAGS += -std=c++11
+else ifeq ($(shell expr match ${CXXVER} "4\.[0-9][0-9]"),4) # gcc >= 4.10
+ NEEDED_CXXFLAGS += -std=c++11
+else ifeq ($(shell expr match ${CXXVER} "4\.[7-9]"),3) # >= 4.7
+ NEEDED_CXXFLAGS += -std=c++11 -D_GLIBCXX_USE_NANOSLEEP=1
+else ifeq ($(shell expr match ${CXXVER} "4\.6"),3) # = 4.6
+ NEEDED_CXXFLAGS += -std=c++0x
+else ifeq ($(shell expr match ${CXXVER} "[5-9]"),1) # gcc >= 5
+ NEEDED_CXXFLAGS += -std=c++11
+ LDLIBS = -latomic
else # not supported
$(error Compiler too old)
endif
@@ -30,41 +32,45 @@ ifeq ($(USE_STATIC),yes)
# NOTE: on glibc you will get this warning:
# Using 'getaddrinfo' in statically linked applications requires at runtime
# the shared libraries from the glibc version used for linking
- LIBDIR := /usr/lib/$(SYS)
+ LIBDIR := /usr/lib
+ LDLIBS += $(LIBDIR)/libboost_system.a
+ LDLIBS += $(LIBDIR)/libboost_date_time.a
+ LDLIBS += $(LIBDIR)/libboost_filesystem.a
LDLIBS += $(LIBDIR)/libboost_program_options.a
LDLIBS += $(LIBDIR)/libssl.a
LDLIBS += $(LIBDIR)/libcrypto.a
LDLIBS += $(LIBDIR)/libz.a
-ifeq ($(USE_UPNP),yes)
- LDLIBS += $(LIBDIR)/libminiupnpc.a
-endif
- LDLIBS += -lpthread -ldl
+ LDLIBS += -lpthread -static-libstdc++ -static-libgcc -lrt -ldl
+ USE_AESNI := no
else
- LDLIBS += -lssl -lcrypto -lz -lboost_program_options -lpthread -latomic
-ifeq ($(USE_UPNP),yes)
- LDLIBS += -lminiupnpc
-endif
+ LDLIBS += -lcrypto -lssl -lz -lboost_system -lboost_date_time -lboost_filesystem -lboost_program_options -lpthread
endif
# UPNP Support (miniupnpc 1.5 and higher)
ifeq ($(USE_UPNP),yes)
- DEFINES += -DUSE_UPNP
+ CXXFLAGS += -DUSE_UPNP
+ifeq ($(USE_STATIC),yes)
+ LDLIBS += $(LIBDIR)/libminiupnpc.a
+else
+ LDLIBS += -lminiupnpc
+endif
endif
-install: all
- install -d ${PREFIX}/bin
- install -m 755 ${I2PD} ${PREFIX}/bin
- install -d ${PREFIX}/etc ${PREFIX}/etc/i2pd ${PREFIX}/etc/i2pd/tunnels.conf.d
- install -m 644 contrib/i2pd.conf contrib/subscriptions.txt contrib/tunnels.conf ${PREFIX}/etc/i2pd
- install -d ${PREFIX}/share ${PREFIX}/share/doc ${PREFIX}/share/doc/i2pd
- install -m 644 ChangeLog LICENSE README.md contrib/i2pd.conf contrib/subscriptions.txt contrib/tunnels.conf ${PREFIX}/share/doc/i2pd
- install -d ${PREFIX}/share/i2pd
- @cp -R contrib/certificates ${PREFIX}/share/i2pd/
- install -d ${PREFIX}/share/man ${PREFIX}/share/man/man1
- @gzip -kf debian/i2pd.1 && install debian/i2pd.1.gz ${PREFIX}/share/man/man1
- install -d ${PREFIX}/var ${PREFIX}/var/lib ${PREFIX}/var/lib/i2pd
- @ln -sf ${PREFIX}/share/i2pd/certificates ${PREFIX}/var/lib/i2pd/certificates
- @ln -sf ${PREFIX}/etc/i2pd/tunnels.conf.d ${PREFIX}/var/lib/i2pd/tunnels.d
- @ln -sf ${PREFIX}/etc/i2pd/i2pd.conf ${PREFIX}/var/lib/i2pd/i2pd.conf
- @ln -sf ${PREFIX}/etc/i2pd/subscriptions.txt ${PREFIX}/var/lib/i2pd/subscriptions.txt
- @ln -sf ${PREFIX}/etc/i2pd/tunnels.conf ${PREFIX}/var/lib/i2pd/tunnels.conf
+ifeq ($(USE_AESNI),yes)
+#check if AES-NI is supported by CPU
+ifneq ($(shell $(GREP) -c aes /proc/cpuinfo),0)
+ machine := $(shell uname -m)
+ ifeq ($(machine), aarch64)
+ CXXFLAGS += -DARM64AES
+ else
+ CPU_FLAGS += -maes
+ endif
+endif
+endif
+
+ifeq ($(USE_AVX),yes)
+#check if AVX supported by CPU
+ifneq ($(shell $(GREP) -c avx /proc/cpuinfo),0)
+ CPU_FLAGS += -mavx
+endif
+endif
diff --git a/Makefile.mingw b/Makefile.mingw
index 32d60764..e2f9e857 100644
--- a/Makefile.mingw
+++ b/Makefile.mingw
@@ -1,50 +1,56 @@
-# Build application with GUI (tray, main window)
-USE_WIN32_APP := yes
-
+USE_WIN32_APP=yes
+CXX = g++
WINDRES = windres
+CXXFLAGS := ${CXX_DEBUG} -D_MT -DWIN32 -D_WINDOWS -DWIN32_LEAN_AND_MEAN
+NEEDED_CXXFLAGS = -std=c++11
+INCFLAGS = -Idaemon -I.
+LDFLAGS := ${LD_DEBUG} -Wl,-Bstatic -static-libgcc -static-libstdc++
-CXXFLAGS := $(CXX_DEBUG) -fPIC -msse
-INCFLAGS := -I$(DAEMON_SRC_DIR) -IWin32
-LDFLAGS := ${LD_DEBUG} -static -fPIC -msse
-
-NEEDED_CXXFLAGS += -std=c++20
-DEFINES += -DWIN32_LEAN_AND_MEAN
+# Boost libraries suffix
+BOOST_SUFFIX = -mt
# UPNP Support
ifeq ($(USE_UPNP),yes)
- DEFINES += -DUSE_UPNP -DMINIUPNP_STATICLIB
+ CXXFLAGS += -DUSE_UPNP -DMINIUPNP_STATICLIB
LDLIBS = -lminiupnpc
endif
-ifeq ($(USE_WINXP_FLAGS), yes)
- DEFINES += -DWINVER=0x0501 -D_WIN32_WINNT=0x0501
-endif
-
LDLIBS += \
- $(MINGW_PREFIX)/lib/libboost_filesystem-mt.a \
- $(MINGW_PREFIX)/lib/libboost_program_options-mt.a \
- $(MINGW_PREFIX)/lib/libssl.a \
- $(MINGW_PREFIX)/lib/libcrypto.a \
- $(MINGW_PREFIX)/lib/libz.a \
+ -lboost_system$(BOOST_SUFFIX) \
+ -lboost_date_time$(BOOST_SUFFIX) \
+ -lboost_filesystem$(BOOST_SUFFIX) \
+ -lboost_program_options$(BOOST_SUFFIX) \
+ -lssl \
+ -lcrypto \
+ -lz \
-lwsock32 \
-lws2_32 \
- -liphlpapi \
- -lcrypt32 \
-lgdi32 \
- -lole32 \
- -luuid \
+ -liphlpapi \
+ -lstdc++ \
-lpthread
ifeq ($(USE_WIN32_APP), yes)
- DEFINES += -DWIN32_APP
+ CXXFLAGS += -DWIN32_APP
LDFLAGS += -mwindows
DAEMON_RC += Win32/Resource.rc
DAEMON_OBJS += $(patsubst %.rc,obj/%.o,$(DAEMON_RC))
endif
+# don't change following line to ifeq ($(USE_AESNI),yes) !!!
+ifeq ($(USE_AESNI),1)
+ CPU_FLAGS += -maes
+else
+ CPU_FLAGS += -msse
+endif
+
+ifeq ($(USE_AVX),1)
+ CPU_FLAGS += -mavx
+endif
+
ifeq ($(USE_ASLR),yes)
LDFLAGS += -Wl,--nxcompat -Wl,--high-entropy-va -Wl,--dynamicbase,--export-all-symbols
endif
-obj/%.o : %.rc | mk_obj_dir
- $(WINDRES) $(DEFINES) $(INCFLAGS) --preprocessor-arg=-MMD --preprocessor-arg=-MP --preprocessor-arg=-MF$@.d -i $< -o $@
+obj/%.o : %.rc
+ $(WINDRES) -i $< -o $@
diff --git a/Makefile.osx b/Makefile.osx
index 52282307..d673d3ef 100644
--- a/Makefile.osx
+++ b/Makefile.osx
@@ -1,20 +1,17 @@
CXX = clang++
-CXXFLAGS := ${CXX_DEBUG} -Wall -std=c++17
+CXXFLAGS := ${CXX_DEBUG} -Wall -std=c++11 -DMAC_OSX
INCFLAGS = -I/usr/local/include
-DEFINES := -DMAC_OSX
LDFLAGS := -Wl,-rpath,/usr/local/lib -L/usr/local/lib
-LDFLAGS += -Wl,-dead_strip
-LDFLAGS += -Wl,-dead_strip_dylibs
ifeq ($(USE_STATIC),yes)
- LDLIBS = -lz /usr/local/lib/libssl.a /usr/local/lib/libcrypto.a /usr/local/lib/libboost_system.a /usr/local/lib/libboost_filesystem.a /usr/local/lib/libboost_program_options.a -lpthread
+ LDLIBS = -lz /usr/local/lib/libcrypto.a /usr/local/lib/libssl.a /usr/local/lib/libboost_system.a /usr/local/lib/libboost_date_time.a /usr/local/lib/libboost_filesystem.a /usr/local/lib/libboost_program_options.a -lpthread
else
- LDLIBS = -lz -lssl -lcrypto -lboost_system -lboost_filesystem -lboost_program_options -lpthread
+ LDLIBS = -lz -lcrypto -lssl -lboost_system -lboost_date_time -lboost_filesystem -lboost_program_options -lpthread
endif
ifeq ($(USE_UPNP),yes)
LDFLAGS += -ldl
- DEFINES += -DUSE_UPNP
+ CXXFLAGS += -DUSE_UPNP
ifeq ($(USE_STATIC),yes)
LDLIBS += /usr/local/lib/libminiupnpc.a
else
@@ -22,8 +19,12 @@ ifeq ($(USE_UPNP),yes)
endif
endif
-OSARCH = $(shell uname -p)
-
-ifneq ($(OSARCH),powerpc)
+ifeq ($(USE_AESNI),1)
+ CXXFLAGS += -maes
+else
CXXFLAGS += -msse
endif
+
+ifeq ($(USE_AVX),1)
+ CXXFLAGS += -mavx
+endif
diff --git a/Makefile.solaris b/Makefile.solaris
deleted file mode 100644
index 77d34114..00000000
--- a/Makefile.solaris
+++ /dev/null
@@ -1,9 +0,0 @@
-CXX = g++
-INCFLAGS = -I/usr/openssl/3/include
-CXXFLAGS := -Wall -std=c++20
-LDLIBS = -L/usr/openssl/3/lib/64 -lssl -lcrypto -lboost_program_options -lz -lpthread -lsocket
-
-ifeq ($(USE_UPNP),yes)
- DEFINES += -DUSE_UPNP
- LDLIBS += -lminiupnpc
-endif
\ No newline at end of file
diff --git a/README.md b/README.md
index ce25c8f2..540e3bed 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,5 @@
-[](https://github.com/PurpleI2P/i2pd/releases/latest)
-[](https://snapcraft.io/i2pd)
-[](https://github.com/PurpleI2P/i2pd/blob/openssl/LICENSE)
-[](https://repology.org/project/i2pd/versions)
-[](https://hub.docker.com/r/purplei2p/i2pd)
-[](https://crowdin.com/project/i2pd)
-
-*note: i2pd for Android can be found in [i2pd-android](https://github.com/PurpleI2P/i2pd-android) repository and with Qt GUI in [i2pd-qt](https://github.com/PurpleI2P/i2pd-qt) repository*
+
+
i2pd
====
@@ -56,8 +50,6 @@ Building
See [documentation](https://i2pd.readthedocs.io/en/latest/) for how to build
i2pd from source on your OS.
-note: i2pd with Qt GUI can be found in [i2pd-qt](https://github.com/PurpleI2P/i2pd-qt) repository and for android in [i2pd-android](https://github.com/PurpleI2P/i2pd-android) repository.
-
Build instructions:
@@ -69,15 +61,13 @@ Build instructions:
**Supported systems:**
-* GNU/Linux (Debian, Ubuntu, etc) - [](https://github.com/PurpleI2P/i2pd/actions/workflows/build.yml)
-* CentOS, Fedora, Mageia - [](https://copr.fedorainfracloud.org/coprs/supervillain/i2pd/package/i2pd-git/)
-* Alpine, ArchLinux, openSUSE, Gentoo, etc.
-* Windows - [](https://github.com/PurpleI2P/i2pd/actions/workflows/build-windows.yml)
-* Mac OS - [](https://github.com/PurpleI2P/i2pd/actions/workflows/build-osx.yml)
-* Docker image - [](https://github.com/PurpleI2P/i2pd/actions/workflows/docker.yml)
-* Snap - [](https://snapcraft.io/i2pd) [](https://snapcraft.io/i2pd)
-* FreeBSD - [](https://github.com/PurpleI2P/i2pd/actions/workflows/build-freebsd.yml)
-* Android - [](https://github.com/PurpleI2P/i2pd-android/actions/workflows/android.yml)
+* GNU/Linux - [](https://travis-ci.org/PurpleI2P/i2pd)
+* Windows - [](https://ci.appveyor.com/project/PurpleI2P/i2pd)
+* Mac OS X - [](https://travis-ci.org/PurpleI2P/i2pd)
+* CentOS / Fedora / Mageia - [](https://copr.fedorainfracloud.org/coprs/supervillain/i2pd/package/i2pd-git/)
+* Docker image - [](https://hub.docker.com/r/meeh/i2pd/builds/)
+* FreeBSD
+* Android
* iOS
Using i2pd
@@ -86,36 +76,15 @@ Using i2pd
See [documentation](https://i2pd.readthedocs.io/en/latest/user-guide/run/) and
[example config file](https://github.com/PurpleI2P/i2pd/blob/openssl/contrib/i2pd.conf).
-Localization
-------------
-
-You can help us with translation i2pd to your language using Crowdin platform!
-Translation project can be found [here](https://crowdin.com/project/i2pd).
-
-New languages can be requested on project's [discussion page](https://crowdin.com/project/i2pd/discussions).
-
-Current status: [](https://crowdin.com/project/i2pd)
-
Donations
---------
-**E-Mail**: ```i2porignal at yandex.com```
-
-**BTC**: ```3MDoGJW9TLMTCDGrR9bLgWXfm6sjmgy86f```
-
-**LTC**: ```LKQirrYrDeTuAPnpYq5y7LVKtywfkkHi59```
-
-**ETH**: ```0x9e5bac70d20d1079ceaa111127f4fb3bccce379d```
-
-**GST**: ```GbD2JSQHBHCKLa9WTHmigJRpyFgmBj4woG```
-
-**DASH**: ```Xw8YUrQpYzP9tZBmbjqxS3M97Q7v3vJKUF```
-
-**ZEC**: ```t1cTckLuXsr1dwVrK4NDzfhehss4NvMadAJ```
-
-**ANC**: ```AQJYweYYUqM1nVfLqfoSMpUMfzxvS4Xd7z```
-
-**XMR**: ```497pJc7X4xqKvcLBLpSUtRgWqMMyo24u4btCos3cak6gbMkpobgSU6492ztUcUBghyeHpYeczB55s38NpuHoH5WGNSPDRMH```
+BTC: 3MDoGJW9TLMTCDGrR9bLgWXfm6sjmgy86f
+LTC: LKQirrYrDeTuAPnpYq5y7LVKtywfkkHi59
+ETH: 0x9e5bac70d20d1079ceaa111127f4fb3bccce379d
+DASH: Xw8YUrQpYzP9tZBmbjqxS3M97Q7v3vJKUF
+ZEC: t1cTckLuXsr1dwVrK4NDzfhehss4NvMadAJ
+GST: GbD2JSQHBHCKLa9WTHmigJRpyFgmBj4woG
License
-------
diff --git a/Win32/DaemonWin32.cpp b/Win32/DaemonWin32.cpp
index 48f65c27..9fffe7fb 100644
--- a/Win32/DaemonWin32.cpp
+++ b/Win32/DaemonWin32.cpp
@@ -1,11 +1,3 @@
-/*
-* Copyright (c) 2013-2023, The PurpleI2P Project
-*
-* This file is part of Purple i2pd project and licensed under BSD3
-*
-* See full license text in LICENSE file at top of project tree
-*/
-
#include
\r\n";
}
static void SetLogLevel (const std::string& level)
{
- if (level == "none" || level == "critical" || level == "error" || level == "warn" || level == "info" || level == "debug")
+ if (level == "none" || level == "error" || level == "warn" || level == "info" || level == "debug")
i2p::log::Logger().SetLogLevel(level);
else {
- LogPrint(eLogError, "HTTPServer: Unknown loglevel set attempted");
+ LogPrint(eLogError, "HTTPServer: unknown loglevel set attempted");
return;
}
i2p::log::Logger().Reopen ();
@@ -165,244 +155,187 @@ namespace http {
static void ShowPageHead (std::stringstream& s)
{
- std::string webroot; i2p::config::GetOption("http.webroot", webroot);
-
- // Page language
- std::string currLang = i2p::client::context.GetLanguage ()->GetLanguage(); // get current used language
- auto it = i2p::i18n::languages.find(currLang);
- std::string langCode = it->second.ShortCode;
-
+ std::string webroot;
+ i2p::config::GetOption("http.webroot", webroot);
s <<
"\r\n"
- "\r\n"
+ "\r\n" /* TODO: Add support for locale */
" \r\n" /* TODO: Find something to parse html/template system. This is horrible. */
+#if (!defined(WIN32))
" \r\n"
- " \r\n"
+#else
+ " \r\n"
+#endif
" \r\n"
- "
\r\n";
+ s << "ERROR: " << string << "
\r\n";
}
- static void ShowNetworkStatus (std::stringstream& s, RouterStatus status, bool testing, RouterError error)
+ void ShowStatus (
+ std::stringstream& s,
+ bool includeHiddenContent,
+ i2p::http::OutputFormatEnum outputFormat)
{
- switch (status)
- {
- case eRouterStatusOK: s << tr("OK"); break;
- case eRouterStatusFirewalled: s << tr("Firewalled"); break;
- case eRouterStatusUnknown: s << tr("Unknown"); break;
- case eRouterStatusProxy: s << tr("Proxy"); break;
- case eRouterStatusMesh: s << tr("Mesh"); break;
- default: s << tr("Unknown");
- }
- if (testing)
- s << " (" << tr("Testing") << ")";
- if (error != eRouterErrorNone)
- {
- switch (error)
- {
- case eRouterErrorClockSkew:
- s << " - " << tr("Clock skew");
- break;
- case eRouterErrorOffline:
- s << " - " << tr("Offline");
- break;
- case eRouterErrorSymmetricNAT:
- s << " - " << tr("Symmetric NAT");
- break;
- case eRouterErrorFullConeNAT:
- s << " - " << tr("Full cone NAT");
- break;
- case eRouterErrorNoDescriptors:
- s << " - " << tr("No Descriptors");
- break;
- default: ;
- }
- }
- }
-
- void ShowStatus (std::stringstream& s, bool includeHiddenContent, i2p::http::OutputFormatEnum outputFormat)
- {
- s << "" << tr("Uptime") << ": ";
+ s << "Uptime: ";
ShowUptime(s, i2p::context.GetUptime ());
s << "
\r\n";
- s << "" << tr("Network status") << ": ";
- ShowNetworkStatus (s, i2p::context.GetStatus (), i2p::context.GetTesting(), i2p::context.GetError ());
- s << "
\r\n";
- if (i2p::context.SupportsV6 ())
+ s << "Network status: ";
+ switch (i2p::context.GetStatus ())
{
- s << "" << tr("Network status v6") << ": ";
- ShowNetworkStatus (s, i2p::context.GetStatusV6 (), i2p::context.GetTestingV6(), i2p::context.GetErrorV6 ());
- s << "
\r\n";
+ case eRouterStatusOK: s << "OK"; break;
+ case eRouterStatusTesting: s << "Testing"; break;
+ case eRouterStatusFirewalled: s << "Firewalled"; break;
+ case eRouterStatusError:
+ {
+ s << "Error";
+ switch (i2p::context.GetError ())
+ {
+ case eRouterErrorClockSkew:
+ s << "
Clock skew";
+ break;
+ default: ;
+ }
+ break;
+ }
+ default: s << "Unknown";
}
+ s << "
\r\n";
#if ((!defined(WIN32) && !defined(QT_GUI_LIB) && !defined(ANDROID)) || defined(ANDROID_BINARY))
if (auto remains = Daemon.gracefulShutdownInterval) {
- s << "" << tr("Stopping in") << ": ";
- ShowUptime(s, remains);
- s << "
\r\n";
- }
-#elif defined(WIN32_APP)
- if (i2p::win32::g_GracefulShutdownEndtime != 0) {
- uint16_t remains = (i2p::win32::g_GracefulShutdownEndtime - GetTickCount()) / 1000;
- s << "" << tr("Stopping in") << ": ";
- ShowUptime(s, remains);
+ s << "Stopping in: ";
+ s << remains << " seconds";
s << "
\r\n";
}
#endif
auto family = i2p::context.GetFamily ();
if (family.length () > 0)
- s << ""<< tr("Family") << ": " << family << "
\r\n";
- s << "" << tr("Tunnel creation success rate") << ": " << i2p::tunnel::tunnels.GetTunnelCreationSuccessRate () << "%
\r\n";
- bool isTotalTCSR;
- i2p::config::GetOption("http.showTotalTCSR", isTotalTCSR);
- if (isTotalTCSR) {
- s << "" << tr("Total tunnel creation success rate") << ": " << i2p::tunnel::tunnels.GetTotalTunnelCreationSuccessRate() << "%
\r\n";
- }
- s << "" << tr("Received") << ": ";
+ s << "Family: " << family << "
\r\n";
+ s << "Tunnel creation success rate: " << i2p::tunnel::tunnels.GetTunnelCreationSuccessRate () << "%
\r\n";
+ s << "Received: ";
ShowTraffic (s, i2p::transport::transports.GetTotalReceivedBytes ());
- s << " (" << tr(/* tr: Kibibyte/s */ "%.2f KiB/s", (double) i2p::transport::transports.GetInBandwidth15s () / 1024) << ")
\r\n";
- s << "" << tr("Sent") << ": ";
+ s << " (" << (double) i2p::transport::transports.GetInBandwidth () / 1024 << " KiB/s)
\r\n";
+ s << "Sent: ";
ShowTraffic (s, i2p::transport::transports.GetTotalSentBytes ());
- s << " (" << tr(/* tr: Kibibyte/s */ "%.2f KiB/s", (double) i2p::transport::transports.GetOutBandwidth15s () / 1024) << ")
\r\n";
- s << "" << tr("Transit") << ": ";
+ s << " (" << (double) i2p::transport::transports.GetOutBandwidth () / 1024 << " KiB/s)
\r\n";
+ s << "Transit: ";
ShowTraffic (s, i2p::transport::transports.GetTotalTransitTransmittedBytes ());
- s << " (" << tr(/* tr: Kibibyte/s */ "%.2f KiB/s", (double) i2p::transport::transports.GetTransitBandwidth15s () / 1024) << ")
\r\n";
- s << "" << tr("Data path") << ": " << i2p::fs::GetUTF8DataDir() << "
\r\n";
- s << " \r\n";
- if (outputFormat == OutputFormatEnum::forQtUi) {
- s << "
";
- }
- s << "" << tr("Routers") << ": " << i2p::data::netdb.GetNumRouters () << " ";
- s << "" << tr("Floodfills") << ": " << i2p::data::netdb.GetNumFloodfills () << " ";
- s << "" << tr("LeaseSets") << ": " << i2p::data::netdb.GetNumLeaseSets () << "
\r\n";
+ }
+ s << "\r\n
";
+ }
+ s << "Routers: " << i2p::data::netdb.GetNumRouters () << " ";
+ s << "Floodfills: " << i2p::data::netdb.GetNumFloodfills () << " ";
+ s << "LeaseSets: " << i2p::data::netdb.GetNumLeaseSets () << "
\r\n";
size_t clientTunnelCount = i2p::tunnel::tunnels.CountOutboundTunnels();
clientTunnelCount += i2p::tunnel::tunnels.CountInboundTunnels();
size_t transitTunnelCount = i2p::tunnel::tunnels.CountTransitTunnels();
- s << "" << tr("Client Tunnels") << ": " << std::to_string(clientTunnelCount) << " ";
- s << "" << tr("Transit Tunnels") << ": " << std::to_string(transitTunnelCount) << "
\r\n
\r\n";
+ s << "Client Tunnels: " << std::to_string(clientTunnelCount) << " ";
+ s << "Transit Tunnels: " << std::to_string(transitTunnelCount) << "
\r\n
\r\n";
- if (outputFormat==OutputFormatEnum::forWebConsole) {
- bool httpproxy = i2p::client::context.GetHttpProxy () ? true : false;
- bool socksproxy = i2p::client::context.GetSocksProxy () ? true : false;
- bool bob = i2p::client::context.GetBOBCommandChannel () ? true : false;
- bool sam = i2p::client::context.GetSAMBridge () ? true : false;
- bool i2cp = i2p::client::context.GetI2CPServer () ? true : false;
- bool i2pcontrol; i2p::config::GetOption("i2pcontrol.enabled", i2pcontrol);
- s << "
\r\n";
- }
+ if(outputFormat==OutputFormatEnum::forWebConsole) {
+ s << " \r\n";
- s << "" << "HTTP " << tr("Proxy") << " " << (httpproxy ? tr("Enabled") : tr("Disabled")) << " \r\n";
- s << "" << "SOCKS " << tr("Proxy") << " " << (socksproxy ? tr("Enabled") : tr("Disabled")) << " \r\n";
- s << "" << "BOB" << " " << (bob ? tr("Enabled") : tr("Disabled")) << " \r\n";
- s << "" << "SAM" << " " << (sam ? tr("Enabled") : tr("Disabled")) << " \r\n";
- s << "" << "I2CP" << " " << (i2cp ? tr("Enabled") : tr("Disabled")) << " \r\n";
- s << "" << "I2PControl" << " " << (i2pcontrol ? tr("Enabled") : tr("Disabled")) << "
\r\n";
+ }
}
void ShowLocalDestinations (std::stringstream& s)
{
std::string webroot; i2p::config::GetOption("http.webroot", webroot);
- s << "" << tr("Local Destinations") << ": \r\n";
+ s << "Service State \r\n";
+ s << "" << "HTTP Proxy" << " \r\n";
+ s << "" << "SOCKS Proxy" << " \r\n";
+ s << "" << "BOB" << " \r\n";
+ s << "" << "SAM" << " \r\n";
+ bool i2pcontrol; i2p::config::GetOption("i2pcontrol.enabled", i2pcontrol);
+ s << "" << "I2CP" << " \r\n";
+ s << "" << "I2PControl" << "
\r\n
\r\n
\r\n";
for (auto& it: i2p::client::context.GetDestinations ())
{
auto ident = it.second->GetIdentHash ();
- s << "\r\n" << std::endl;
+ s << "";
+ s << i2p::client::context.GetAddressBook ().ToAddress(ident) << "
\r\n" << std::endl;
}
- s << "
I2CP "<< tr("Local Destinations") << ":
\r\n
I2CP Local Destinations:
\r\n
\r\n";
for (auto& it: i2cpServer->GetSessions ())
{
auto dest = it.second->GetDestination ();
@@ -410,204 +343,86 @@ namespace http {
{
auto ident = dest->GetIdentHash ();
auto& name = dest->GetNickname ();
- s << "
\r\n" << std::endl;
}
}
- s << "
\r\n
\r\n
\r\n";
-
- s << "Base64:
\r\n
StreamID | " - << "" // Stream closing button column - << " | Destination | " - << "Sent | " - << "Received | " - << "Out | " - << "In | " - << "Buf | " - << "RTT | " - << "Window | " - << "Status | " - << "
---|
StreamID | "; + s << "Destination | "; + s << "Sent | "; + s << "Received | "; + s << "Out | "; + s << "In | "; + s << "Buf | "; + s << "RTT | "; + s << "Window | "; + s << "Status | "; + s << "
---|---|---|---|---|---|---|---|---|---|
" << it->GetRecvStreamID () << " | "; - if (it->GetRecvStreamID ()) { - s << "GetRecvStreamID () << "&token=" << token << "\" title=\"" << tr("Close stream") << "\"> ✘ | "; - } else { - s << ""; - } - s << " | " << streamDestShort << " | "; + s << "" << it->GetSendStreamID () << " | "; + s << "" << i2p::client::context.GetAddressBook ().ToAddress(it->GetRemoteIdentity ()) << " | "; s << "" << it->GetNumSentBytes () << " | "; s << "" << it->GetNumReceivedBytes () << " | "; s << "" << it->GetSendQueueSize () << " | "; @@ -618,313 +433,236 @@ namespace http { s << "" << (int)it->GetStatus () << " | "; s << "
⇒ | ID | ⇒ | " << tr("Amount") << " | " << tr("Next") << " | "; - for (const auto& it: i2p::tunnel::tunnels.GetTransitTunnels ()) - { - if (std::dynamic_pointer_cast||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
" << it->GetTunnelID () << " | ⇒ | ";
- else if (std::dynamic_pointer_cast⇒ | " << it->GetTunnelID () << " | ";
- else
- s << " | ⇒ | " << it->GetTunnelID () << " | ⇒ | ";
- ShowTraffic(s, it->GetNumTransmittedBytes ());
- s << " | " << it->GetNextPeerName () << " | |
" << tr("You will be redirected in %d seconds", COMMAND_REDIRECT_TIMEOUT) << "";
- redirect = std::to_string(COMMAND_REDIRECT_TIMEOUT) + "; url=" + webroot + "?page=local_destination&b32=" + b32;
- res.add_header("Refresh", redirect.c_str());
- return;
- }
- else if (cmd == HTTP_COMMAND_EXPIRELEASE)
- {
- std::string b32 = params["b32"];
- std::string lease = params["lease"];
-
- i2p::data::IdentHash ident, leaseident;
- ident.FromBase32 (b32);
- leaseident.FromBase32 (lease);
- auto dest = i2p::client::context.FindLocalDestination (ident);
-
- if (dest)
- {
- auto leaseset = dest->FindLeaseSet (leaseident);
- if (leaseset)
- {
- leaseset->ExpireLease ();
- s << "" << tr("SUCCESS") << ": " << tr("LeaseSet expiration time updated") << "
\r\n
\r\n";
- }
- else
- s << "" << tr("ERROR") << ": " << tr("LeaseSet is not found or already expired") << "
\r\n
\r\n";
- }
- else
- s << "" << tr("ERROR") << ": " << tr("Destination not found") << "
\r\n
\r\n";
-
- s << "" << tr("Return to destination page") << "
\r\n";
- s << "
" << tr("You will be redirected in %d seconds", COMMAND_REDIRECT_TIMEOUT) << "";
- redirect = std::to_string(COMMAND_REDIRECT_TIMEOUT) + "; url=" + webroot + "?page=local_destination&b32=" + b32;
- res.add_header("Refresh", redirect.c_str());
- return;
- }
- else if (cmd == HTTP_COMMAND_LIMITTRANSIT)
- {
- uint32_t limit = std::stoul(params["limit"], nullptr);
- if (limit > 0 && limit <= TRANSIT_TUNNELS_LIMIT)
- i2p::tunnel::tunnels.SetMaxNumTransitTunnels (limit);
- else {
- s << "" << tr("ERROR") << ": " << tr("Transit tunnels count must not exceed %d", TRANSIT_TUNNELS_LIMIT) << "\r\n
\r\n
\r\n";
- s << "" << tr("Back to commands list") << "\r\n
\r\n";
- s << "
" << tr("You will be redirected in %d seconds", COMMAND_REDIRECT_TIMEOUT) << "";
- res.add_header("Refresh", redirect.c_str());
- return;
- }
- }
- else if (cmd == HTTP_COMMAND_GET_REG_STRING)
- {
- std::string b32 = params["b32"];
- std::string name = i2p::http::UrlDecode(params["name"]);
-
- i2p::data::IdentHash ident;
- ident.FromBase32 (b32);
- auto dest = i2p::client::context.FindLocalDestination (ident);
-
- if (dest)
- {
- std::size_t pos;
- pos = name.find (".i2p");
- if (pos == (name.length () - 4))
- {
- pos = name.find (".b32.i2p");
- if (pos == std::string::npos)
- {
- auto signatureLen = dest->GetIdentity ()->GetSignatureLen ();
- uint8_t * signature = new uint8_t[signatureLen];
- std::stringstream out;
-
- out << name << "=" << dest->GetIdentity ()->ToBase64 ();
- dest->Sign ((uint8_t *)out.str ().c_str (), out.str ().length (), signature);
- auto sig = i2p::data::ByteStreamToBase64 (signature, signatureLen);
- out << "#!sig=" << sig;
- s << "" << tr("SUCCESS") << ":
\r\n
" << tr("You will be redirected in %d seconds", COMMAND_REDIRECT_TIMEOUT) << "";
+ std::string webroot; i2p::config::GetOption("http.webroot", webroot);
+ std::string redirect = "5; url=" + webroot + "?page=commands";
+ s << "SUCCESS: Command accepted
\r\n";
+ s << "Back to commands list
\r\n";
+ s << "
You will be redirected in 5 seconds";
res.add_header("Refresh", redirect.c_str());
}
void HTTPConnection::SendReply (HTTPRes& reply, std::string& content)
{
reply.add_header("X-Frame-Options", "SAMEORIGIN");
- reply.add_header("X-Content-Type-Options", "nosniff");
- reply.add_header("X-XSS-Protection", "1; mode=block");
reply.add_header("Content-Type", "text/html");
reply.body = content;
m_SendBuffer = reply.to_string();
- boost::asio::async_write (*m_Socket, boost::asio::buffer(m_SendBuffer), boost::asio::transfer_all (),
+ boost::asio::async_write (*m_Socket, boost::asio::buffer(m_SendBuffer),
std::bind (&HTTPConnection::Terminate, shared_from_this (), std::placeholders::_1));
}
HTTPServer::HTTPServer (const std::string& address, int port):
- m_IsRunning (false), m_Thread (nullptr), m_Work (m_Service.get_executor ()),
- m_Acceptor (m_Service, boost::asio::ip::tcp::endpoint (boost::asio::ip::make_address(address), port)),
+ m_IsRunning (false), m_Thread (nullptr), m_Work (m_Service),
+ m_Acceptor (m_Service, boost::asio::ip::tcp::endpoint (boost::asio::ip::address::from_string(address), port)),
m_Hostname(address)
{
}
@@ -1512,27 +1076,18 @@ namespace http {
pass[i] = alnum[random[i] % (sizeof(alnum) - 1)];
}
i2p::config::SetOption("http.pass", pass);
- LogPrint(eLogInfo, "HTTPServer: Password set to ", pass);
+ LogPrint(eLogInfo, "HTTPServer: password set to ", pass);
}
-
m_IsRunning = true;
- m_Thread.reset (new std::thread (std::bind (&HTTPServer::Run, this)));
+ m_Thread = std::unique_ptr