mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-20 16:06:36 +02:00
Compare commits
No commits in common. "openssl" and "2.41.0" have entirely different histories.
268 changed files with 14937 additions and 28771 deletions
|
@ -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
|
|
61
.github/workflows/build-deb.yml
vendored
61
.github/workflows/build-deb.yml
vendored
|
@ -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
|
|
37
.github/workflows/build-freebsd.yml
vendored
37
.github/workflows/build-freebsd.yml
vendored
|
@ -1,50 +1,21 @@
|
||||||
name: Build on FreeBSD
|
name: Build on FreeBSD
|
||||||
|
|
||||||
on:
|
on: [push, pull_request]
|
||||||
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:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: macos-10.15
|
||||||
name: with UPnP
|
name: with UPnP
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Test in FreeBSD
|
- name: Test in FreeBSD
|
||||||
id: test
|
id: test
|
||||||
uses: vmactions/freebsd-vm@v1
|
uses: vmactions/freebsd-vm@v0.1.5
|
||||||
with:
|
with:
|
||||||
usesh: true
|
usesh: true
|
||||||
mem: 2048
|
mem: 2048
|
||||||
sync: rsync
|
|
||||||
copyback: true
|
|
||||||
prepare: pkg install -y devel/cmake devel/gmake devel/boost-libs security/openssl net/miniupnpc
|
prepare: pkg install -y devel/cmake devel/gmake devel/boost-libs security/openssl net/miniupnpc
|
||||||
run: |
|
run: |
|
||||||
cd build
|
cd build
|
||||||
cmake -DWITH_UPNP=ON -DCMAKE_BUILD_TYPE=Release .
|
cmake -DWITH_UPNP=ON -DCMAKE_BUILD_TYPE=Release .
|
||||||
gmake -j2
|
gmake -j2
|
||||||
|
|
||||||
- name: Upload artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: i2pd-freebsd
|
|
||||||
path: build/i2pd
|
|
||||||
|
|
33
.github/workflows/build-osx.yml
vendored
33
.github/workflows/build-osx.yml
vendored
|
@ -1,45 +1,20 @@
|
||||||
name: Build on OSX
|
name: Build on OSX
|
||||||
|
|
||||||
on:
|
on: [push, pull_request]
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- '*'
|
|
||||||
paths:
|
|
||||||
- .github/workflows/build-osx.yml
|
|
||||||
- daemon/**
|
|
||||||
- i18n/**
|
|
||||||
- libi2pd/**
|
|
||||||
- libi2pd_client/**
|
|
||||||
- Makefile
|
|
||||||
- Makefile.homebrew
|
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- '*'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: With USE_UPNP=${{ matrix.with_upnp }}
|
name: With USE_UPNP=${{ matrix.with_upnp }}
|
||||||
runs-on: macOS-latest
|
runs-on: macOS-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
with_upnp: ['yes', 'no']
|
with_upnp: ['yes', 'no']
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v4
|
- name: install packages
|
||||||
|
|
||||||
- name: Install required formulae
|
|
||||||
run: |
|
run: |
|
||||||
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
|
|
||||||
brew update
|
brew update
|
||||||
brew install boost miniupnpc openssl@1.1
|
brew install boost miniupnpc openssl@1.1
|
||||||
|
- name: build application
|
||||||
- name: List installed formulae
|
|
||||||
run: brew list
|
|
||||||
|
|
||||||
- name: Build application
|
|
||||||
run: make HOMEBREW=1 USE_UPNP=${{ matrix.with_upnp }} PREFIX=$GITHUB_WORKSPACE/output -j3
|
run: make HOMEBREW=1 USE_UPNP=${{ matrix.with_upnp }} PREFIX=$GITHUB_WORKSPACE/output -j3
|
||||||
|
|
|
@ -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.*
|
|
||||||
|
|
231
.github/workflows/build-windows.yml
vendored
231
.github/workflows/build-windows.yml
vendored
|
@ -1,25 +1,6 @@
|
||||||
name: Build on Windows
|
name: Build on Windows
|
||||||
|
|
||||||
on:
|
on: [push, pull_request]
|
||||||
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:
|
defaults:
|
||||||
run:
|
run:
|
||||||
|
@ -27,224 +8,30 @@ defaults:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: ${{ matrix.arch }}
|
name: Building using ${{ matrix.arch }} toolchain
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
include: [
|
include: [
|
||||||
{ msystem: UCRT64, arch: ucrt-x86_64, arch_short: x64-ucrt, compiler: gcc },
|
{ msystem: UCRT64, arch: ucrt-x86_64, arch_short: x64-ucrt },
|
||||||
{ msystem: CLANG64, arch: clang-x86_64, arch_short: x64-clang, compiler: clang },
|
{ msystem: MINGW64, arch: x86_64, arch_short: x64 },
|
||||||
{ msystem: MINGW64, arch: x86_64, arch_short: x64, compiler: gcc },
|
{ msystem: MINGW32, arch: i686, arch_short: x86 }
|
||||||
{ msystem: MINGW32, arch: i686, arch_short: x86, compiler: gcc }
|
|
||||||
]
|
]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup MSYS2
|
- name: Setup MSYS2
|
||||||
uses: msys2/setup-msys2@v2
|
uses: msys2/setup-msys2@v2
|
||||||
with:
|
with:
|
||||||
msystem: ${{ matrix.msystem }}
|
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
|
install: base-devel mingw-w64-${{ matrix.arch }}-gcc mingw-w64-${{ matrix.arch }}-boost mingw-w64-${{ matrix.arch }}-openssl mingw-w64-${{ matrix.arch }}-miniupnpc
|
||||||
update: true
|
update: true
|
||||||
|
|
||||||
- name: Install additional clang packages
|
|
||||||
if: ${{ matrix.msystem == 'CLANG64' }}
|
|
||||||
run: pacman --noconfirm -S mingw-w64-${{ matrix.arch }}-gcc-compat
|
|
||||||
|
|
||||||
- name: Build application
|
- name: Build application
|
||||||
run: |
|
run: |
|
||||||
mkdir -p obj/Win32 obj/libi2pd obj/libi2pd_client obj/daemon
|
mkdir -p obj/Win32 obj/libi2pd obj/libi2pd_client obj/daemon
|
||||||
make USE_UPNP=yes DEBUG=no USE_GIT_VERSION=yes -j3
|
make USE_UPNP=yes DEBUG=no USE_GIT_VERSION=yes -j3
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: i2pd-${{ matrix.arch_short }}.exe
|
name: i2pd-${{ matrix.arch_short }}.exe
|
||||||
path: i2pd.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
|
|
||||||
|
|
93
.github/workflows/build.yml
vendored
93
.github/workflows/build.yml
vendored
|
@ -1,67 +1,88 @@
|
||||||
name: Build on Ubuntu
|
name: Build on Ubuntu
|
||||||
|
|
||||||
on:
|
on: [push, pull_request]
|
||||||
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:
|
jobs:
|
||||||
build-make:
|
build-make:
|
||||||
name: Make with USE_UPNP=${{ matrix.with_upnp }}
|
name: Make with USE_UPNP=${{ matrix.with_upnp }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-18.04
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
with_upnp: ['yes', 'no']
|
with_upnp: ['yes', 'no']
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: install packages
|
- name: install packages
|
||||||
run: |
|
run: |
|
||||||
|
sudo add-apt-repository ppa:mhier/libboost-latest
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install build-essential libboost-all-dev libminiupnpc-dev libssl-dev zlib1g-dev
|
sudo apt-get install build-essential libboost1.74-dev libminiupnpc-dev libssl-dev zlib1g-dev
|
||||||
|
|
||||||
- name: build application
|
- name: build application
|
||||||
run: make USE_UPNP=${{ matrix.with_upnp }} -j3
|
run: make USE_UPNP=${{ matrix.with_upnp }} -j3
|
||||||
|
|
||||||
build-cmake:
|
build-cmake:
|
||||||
name: CMake with -DWITH_UPNP=${{ matrix.with_upnp }}
|
name: CMake with -DWITH_UPNP=${{ matrix.with_upnp }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-18.04
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
with_upnp: ['ON', 'OFF']
|
with_upnp: ['ON', 'OFF']
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: install packages
|
- name: install packages
|
||||||
run: |
|
run: |
|
||||||
|
sudo add-apt-repository ppa:mhier/libboost-latest
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install build-essential cmake libboost-all-dev libminiupnpc-dev libssl-dev zlib1g-dev
|
sudo apt-get install build-essential cmake libboost1.74-dev libminiupnpc-dev libssl-dev zlib1g-dev
|
||||||
|
|
||||||
- name: build application
|
- name: build application
|
||||||
run: |
|
run: |
|
||||||
cd build
|
cd build
|
||||||
cmake -DWITH_UPNP=${{ matrix.with_upnp }} .
|
cmake -DWITH_UPNP=${{ matrix.with_upnp }} .
|
||||||
make -j3
|
make -j3
|
||||||
|
build-deb-stretch:
|
||||||
|
name: Build package for stretch
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: change debian changelog
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install devscripts
|
||||||
|
debchange -v "`git describe --tags`-stretch" -b -M --distribution stretch "trunk build"
|
||||||
|
- uses: singingwolfboy/build-dpkg-stretch@v1
|
||||||
|
id: build
|
||||||
|
with:
|
||||||
|
args: --unsigned-source --unsigned-changes -b
|
||||||
|
- uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: ${{ steps.build.outputs.filename }}
|
||||||
|
path: ${{ steps.build.outputs.filename }}
|
||||||
|
- uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: ${{ steps.build.outputs.filename-dbgsym }}
|
||||||
|
path: ${{ steps.build.outputs.filename-dbgsym }}
|
||||||
|
build-deb-buster:
|
||||||
|
name: Build package for buster
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: change debian changelog
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install devscripts
|
||||||
|
debchange -v "`git describe --tags`-buster" -b -M --distribution buster "trunk build"
|
||||||
|
- uses: singingwolfboy/build-dpkg-buster@v1
|
||||||
|
id: build
|
||||||
|
with:
|
||||||
|
args: --unsigned-source --unsigned-changes -b
|
||||||
|
- uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: ${{ steps.build.outputs.filename }}
|
||||||
|
path: ${{ steps.build.outputs.filename }}
|
||||||
|
- uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: ${{ steps.build.outputs.filename-dbgsym }}
|
||||||
|
path: ${{ steps.build.outputs.filename-dbgsym }}
|
||||||
|
|
125
.github/workflows/docker.yml
vendored
125
.github/workflows/docker.yml
vendored
|
@ -1,140 +1,63 @@
|
||||||
name: Build containers
|
name: Build containers
|
||||||
|
|
||||||
on:
|
on: [push]
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- openssl
|
|
||||||
- docker
|
|
||||||
paths:
|
|
||||||
- .github/workflows/docker.yml
|
|
||||||
- contrib/docker/**
|
|
||||||
- contrib/certificates/**
|
|
||||||
- daemon/**
|
|
||||||
- i18n/**
|
|
||||||
- libi2pd/**
|
|
||||||
- libi2pd_client/**
|
|
||||||
- Makefile
|
|
||||||
- Makefile.linux
|
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
docker:
|
||||||
name: Building container for ${{ matrix.platform }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
contents: read
|
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:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Login to GitHub Container registry
|
- name: Login to GitHub Container registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build container for ${{ matrix.archname }}
|
- name: Build and push trunk container
|
||||||
uses: docker/build-push-action@v5
|
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
context: ./contrib/docker
|
context: ./contrib/docker
|
||||||
file: ./contrib/docker/Dockerfile
|
file: ./contrib/docker/Dockerfile
|
||||||
platforms: ${{ matrix.platform }}
|
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
purplei2p/i2pd:latest-${{ matrix.archname }}
|
purplei2p/i2pd:latest
|
||||||
ghcr.io/purplei2p/i2pd:latest-${{ matrix.archname }}
|
ghcr.io/purplei2p/i2pd:latest
|
||||||
provenance: false
|
|
||||||
|
|
||||||
push:
|
- name: Set env
|
||||||
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/') }}
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||||
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
|
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Create and push release manifest to Docker Hub
|
- name: Build and push release container
|
||||||
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||||
uses: Noelware/docker-manifest-action@master
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
inputs: purplei2p/i2pd:latest,purplei2p/i2pd:latest-release,purplei2p/i2pd:release-${{ env.RELEASE_VERSION }}
|
context: ./contrib/docker
|
||||||
tags: purplei2p/i2pd:latest-amd64,purplei2p/i2pd:latest-i386,purplei2p/i2pd:latest-arm64,purplei2p/i2pd:latest-armv7
|
file: ./contrib/docker/Dockerfile
|
||||||
push: true
|
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7
|
||||||
|
|
||||||
- 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
|
push: true
|
||||||
|
tags: |
|
||||||
|
purplei2p/i2pd:latest
|
||||||
|
purplei2p/i2pd:release-${{ env.RELEASE_VERSION }}
|
||||||
|
ghcr.io/purplei2p/i2pd:latest
|
||||||
|
ghcr.io/purplei2p/i2pd:release-${{ env.RELEASE_VERSION }}
|
||||||
|
|
493
ChangeLog
493
ChangeLog
|
@ -1,499 +1,6 @@
|
||||||
# for this file format description,
|
# for this file format description,
|
||||||
# see https://github.com/olivierlacan/keep-a-changelog
|
# 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
|
## [2.41.0] - 2022-02-20
|
||||||
### Added
|
### Added
|
||||||
- Clock syncronization through SSU
|
- Clock syncronization through SSU
|
||||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,4 +1,4 @@
|
||||||
Copyright (c) 2013-2025, The PurpleI2P Project
|
Copyright (c) 2013-2020, The PurpleI2P Project
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
|
38
Makefile
38
Makefile
|
@ -4,7 +4,7 @@ SYS := $(shell $(CXX) -dumpmachine)
|
||||||
|
|
||||||
ifneq (, $(findstring darwin, $(SYS)))
|
ifneq (, $(findstring darwin, $(SYS)))
|
||||||
SHARED_SUFFIX = dylib
|
SHARED_SUFFIX = dylib
|
||||||
else ifneq (, $(findstring mingw, $(SYS))$(findstring windows-gnu, $(SYS))$(findstring cygwin, $(SYS)))
|
else ifneq (, $(findstring mingw, $(SYS))$(findstring cygwin, $(SYS)))
|
||||||
SHARED_SUFFIX = dll
|
SHARED_SUFFIX = dll
|
||||||
else
|
else
|
||||||
SHARED_SUFFIX = so
|
SHARED_SUFFIX = so
|
||||||
|
@ -29,7 +29,9 @@ DAEMON_SRC_DIR := daemon
|
||||||
# import source files lists
|
# import source files lists
|
||||||
include filelist.mk
|
include filelist.mk
|
||||||
|
|
||||||
|
USE_AESNI := $(or $(USE_AESNI),yes)
|
||||||
USE_STATIC := $(or $(USE_STATIC),no)
|
USE_STATIC := $(or $(USE_STATIC),no)
|
||||||
|
USE_MESHNET := $(or $(USE_MESHNET),no)
|
||||||
USE_UPNP := $(or $(USE_UPNP),no)
|
USE_UPNP := $(or $(USE_UPNP),no)
|
||||||
DEBUG := $(or $(DEBUG),yes)
|
DEBUG := $(or $(DEBUG),yes)
|
||||||
|
|
||||||
|
@ -46,10 +48,6 @@ else
|
||||||
LD_DEBUG = -s
|
LD_DEBUG = -s
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (, $(DESTDIR))
|
|
||||||
PREFIX = $(DESTDIR)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq (, $(findstring darwin, $(SYS)))
|
ifneq (, $(findstring darwin, $(SYS)))
|
||||||
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
|
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
|
||||||
ifeq ($(HOMEBREW),1)
|
ifeq ($(HOMEBREW),1)
|
||||||
|
@ -57,34 +55,30 @@ ifneq (, $(findstring darwin, $(SYS)))
|
||||||
else
|
else
|
||||||
include Makefile.osx
|
include Makefile.osx
|
||||||
endif
|
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)))
|
else ifneq (, $(findstring linux, $(SYS))$(findstring gnu, $(SYS)))
|
||||||
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
|
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
|
||||||
include Makefile.linux
|
include Makefile.linux
|
||||||
else ifneq (, $(findstring freebsd, $(SYS))$(findstring openbsd, $(SYS)))
|
else ifneq (, $(findstring freebsd, $(SYS))$(findstring openbsd, $(SYS)))
|
||||||
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
|
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
|
||||||
include Makefile.bsd
|
include Makefile.bsd
|
||||||
else ifneq (, $(findstring haiku, $(SYS)))
|
else ifneq (, $(findstring mingw, $(SYS))$(findstring cygwin, $(SYS)))
|
||||||
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
|
DAEMON_SRC += Win32/DaemonWin32.cpp Win32/Win32App.cpp Win32/Win32NetState.cpp
|
||||||
include Makefile.haiku
|
include Makefile.mingw
|
||||||
else ifneq (, $(findstring solaris, $(SYS)))
|
|
||||||
DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp
|
|
||||||
include Makefile.solaris
|
|
||||||
else # not supported
|
else # not supported
|
||||||
$(error Not supported platform)
|
$(error Not supported platform)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
INCFLAGS += -I$(LIB_SRC_DIR) -I$(LIB_CLIENT_SRC_DIR) -I$(LANG_SRC_DIR)
|
ifeq ($(USE_MESHNET),yes)
|
||||||
DEFINES += -DOPENSSL_SUPPRESS_DEPRECATED
|
NEEDED_CXXFLAGS += -DMESHNET
|
||||||
NEEDED_CXXFLAGS += -MMD -MP
|
endif
|
||||||
|
|
||||||
ifeq ($(USE_GIT_VERSION),yes)
|
ifeq ($(USE_GIT_VERSION),yes)
|
||||||
GIT_VERSION := $(shell git describe --tags)
|
GIT_VERSION := $(shell git describe --tags)
|
||||||
DEFINES += -DGITVER=$(GIT_VERSION)
|
NEEDED_CXXFLAGS += -DGITVER=\"$(GIT_VERSION)\"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
NEEDED_CXXFLAGS += -MMD -MP -I$(LIB_SRC_DIR) -I$(LIB_CLIENT_SRC_DIR) -I$(LANG_SRC_DIR)
|
||||||
|
|
||||||
LIB_OBJS += $(patsubst %.cpp,obj/%.o,$(LIB_SRC))
|
LIB_OBJS += $(patsubst %.cpp,obj/%.o,$(LIB_SRC))
|
||||||
LIB_CLIENT_OBJS += $(patsubst %.cpp,obj/%.o,$(LIB_CLIENT_SRC))
|
LIB_CLIENT_OBJS += $(patsubst %.cpp,obj/%.o,$(LIB_CLIENT_SRC))
|
||||||
LANG_OBJS += $(patsubst %.cpp,obj/%.o,$(LANG_SRC))
|
LANG_OBJS += $(patsubst %.cpp,obj/%.o,$(LANG_SRC))
|
||||||
|
@ -117,17 +111,17 @@ wrapper: api_client $(SHLIB_WRAP) $(ARLIB_WRAP)
|
||||||
## custom FLAGS to work at build-time.
|
## custom FLAGS to work at build-time.
|
||||||
|
|
||||||
obj/%.o: %.cpp | mk_obj_dir
|
obj/%.o: %.cpp | mk_obj_dir
|
||||||
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(DEFINES) $(INCFLAGS) -c -o $@ $<
|
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
# '-' is 'ignore if missing' on first run
|
# '-' is 'ignore if missing' on first run
|
||||||
-include $(DEPS)
|
-include $(DEPS)
|
||||||
|
|
||||||
$(I2PD): $(DAEMON_OBJS) $(ARLIB) $(ARLIB_CLIENT) $(ARLIB_LANG)
|
$(I2PD): $(DAEMON_OBJS) $(ARLIB) $(ARLIB_CLIENT) $(ARLIB_LANG)
|
||||||
$(CXX) $(DEFINES) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
$(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS)
|
||||||
|
|
||||||
$(SHLIB): $(LIB_OBJS)
|
$(SHLIB): $(LIB_OBJS) $(SHLIB_LANG)
|
||||||
ifneq ($(USE_STATIC),yes)
|
ifneq ($(USE_STATIC),yes)
|
||||||
$(CXX) $(LDFLAGS) -shared -o $@ $^ $(LDLIBS)
|
$(CXX) $(LDFLAGS) -shared -o $@ $^ $(LDLIBS) $(SHLIB_LANG)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(SHLIB_CLIENT): $(LIB_CLIENT_OBJS) $(SHLIB) $(SHLIB_LANG)
|
$(SHLIB_CLIENT): $(LIB_CLIENT_OBJS) $(SHLIB) $(SHLIB_LANG)
|
||||||
|
|
18
Makefile.bsd
18
Makefile.bsd
|
@ -1,22 +1,12 @@
|
||||||
CXX = clang++
|
CXX = clang++
|
||||||
CXXFLAGS ?= ${CXX_DEBUG} -Wall -Wextra -Wno-unused-parameter -pedantic -Wno-misleading-indentation
|
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
|
## 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.
|
## **without** overwriting the CXXFLAGS which we need in order to build.
|
||||||
## For example, when adding 'hardening flags' to the 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
|
## (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
|
## -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.
|
## custom FLAGS to work at build-time.
|
||||||
CXXVER := $(shell $(CXX) -dumpversion|cut -c 1-2)
|
NEEDED_CXXFLAGS = -std=c++11 -D_GLIBCXX_USE_NANOSLEEP=1
|
||||||
ifeq (${CXXVER}, "4.") # older clang always returned 4.2.1
|
INCFLAGS = -I/usr/include/ -I/usr/local/include/
|
||||||
$(error Compiler too old)
|
LDFLAGS = ${LD_DEBUG} -Wl,-rpath,/usr/local/lib -L/usr/local/lib
|
||||||
else ifeq (${CXXVER}, ${filter ${CXXVER},16 17 18 19}) # clang 16 - 19
|
LDLIBS = -lcrypto -lssl -lz -lboost_system -lboost_date_time -lboost_filesystem -lboost_program_options -lpthread
|
||||||
NEEDED_CXXFLAGS = -std=c++20
|
|
||||||
else
|
|
||||||
NEEDED_CXXFLAGS = -std=c++17
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
|
@ -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
|
|
|
@ -1,49 +1,51 @@
|
||||||
# root directory holding homebrew
|
# root directory holding homebrew
|
||||||
BREWROOT = /opt/homebrew
|
BREWROOT = /usr/local
|
||||||
BOOSTROOT = ${BREWROOT}/opt/boost
|
BOOSTROOT = ${BREWROOT}/opt/boost
|
||||||
SSLROOT = ${BREWROOT}/opt/openssl@1.1
|
SSLROOT = ${BREWROOT}/opt/openssl@1.1
|
||||||
UPNPROOT = ${BREWROOT}/opt/miniupnpc
|
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
|
ifndef TRAVIS
|
||||||
NEEDED_CXXFLAGS ?= -std=c++17
|
CXX = clang++
|
||||||
INCFLAGS ?= -I${SSLROOT}/include -I${BOOSTROOT}/include
|
endif
|
||||||
LDFLAGS ?= ${LD_DEBUG}
|
|
||||||
DEFINES += -DMAC_OSX
|
|
||||||
|
|
||||||
ifeq ($(USE_STATIC),yes)
|
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
|
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
|
||||||
ifeq ($(USE_UPNP),yes)
|
|
||||||
LDLIBS += ${UPNPROOT}/lib/libminiupnpc.a
|
|
||||||
endif
|
|
||||||
LDLIBS += -lpthread -ldl
|
|
||||||
else
|
else
|
||||||
LDFLAGS += -L${SSLROOT}/lib -L${BOOSTROOT}/lib
|
LDFLAGS += -L${SSLROOT}/lib -L${BOOSTROOT}/lib
|
||||||
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)
|
ifeq ($(USE_UPNP),yes)
|
||||||
|
LDFLAGS += -ldl
|
||||||
|
CXXFLAGS += -DUSE_UPNP
|
||||||
|
INCFLAGS += -I${UPNPROOT}/include
|
||||||
|
ifeq ($(USE_STATIC),yes)
|
||||||
|
LDLIBS += ${UPNPROOT}/lib/libminiupnpc.a
|
||||||
|
else
|
||||||
LDFLAGS += -L${UPNPROOT}/lib
|
LDFLAGS += -L${UPNPROOT}/lib
|
||||||
LDLIBS += -lminiupnpc
|
LDLIBS += -lminiupnpc
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(USE_UPNP),yes)
|
# OSX Notes
|
||||||
DEFINES += -DUSE_UPNP
|
# http://www.hutsby.net/2011/08/macs-with-aes-ni.html
|
||||||
INCFLAGS += -I${UPNPROOT}/include
|
# 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 += -D__AES__ -maes
|
||||||
endif
|
endif
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
install -d ${PREFIX}/bin
|
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 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 -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/
|
@cp -R contrib/certificates ${PREFIX}/share/i2pd/
|
||||||
install -d ${PREFIX}/share/man ${PREFIX}/share/man/man1
|
install -m 644 ChangeLog LICENSE README.md contrib/i2pd.conf contrib/subscriptions.txt contrib/tunnels.conf ${PREFIX}/share/doc/i2pd
|
||||||
@gzip -kf debian/i2pd.1 && install debian/i2pd.1.gz ${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/
|
||||||
@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/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/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
|
||||||
|
|
|
@ -9,17 +9,20 @@ LDFLAGS ?= ${LD_DEBUG}
|
||||||
## -std=c++11. If you want to remove this variable please do so in a way that allows setting
|
## -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.
|
## 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)
|
CXXVER := $(shell $(CXX) -dumpversion)
|
||||||
ifeq ($(shell expr match $(CXX) 'clang'),5)
|
ifeq ($(shell expr match $(CXX) 'clang'),5)
|
||||||
|
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\.[8-9]"),3) # gcc 4.8 - 4.9
|
||||||
|
NEEDED_CXXFLAGS += -std=c++11 -D_GLIBCXX_USE_NANOSLEEP=1
|
||||||
|
else ifeq ($(shell expr match ${CXXVER} "[5-6]"),1) # gcc 5 - 6
|
||||||
|
NEEDED_CXXFLAGS += -std=c++11
|
||||||
|
LDLIBS = -latomic
|
||||||
|
else ifeq ($(shell expr match ${CXXVER} "[1,7-9]"),1) # gcc >= 7
|
||||||
NEEDED_CXXFLAGS += -std=c++17
|
NEEDED_CXXFLAGS += -std=c++17
|
||||||
else ifeq ($(shell expr match ${CXXVER} "[8-9]"),1) # gcc 8 - 9
|
LDLIBS = -latomic
|
||||||
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
|
|
||||||
else # not supported
|
else # not supported
|
||||||
$(error Compiler too old)
|
$(error Compiler too old)
|
||||||
endif
|
endif
|
||||||
|
@ -31,6 +34,9 @@ ifeq ($(USE_STATIC),yes)
|
||||||
# Using 'getaddrinfo' in statically linked applications requires at runtime
|
# Using 'getaddrinfo' in statically linked applications requires at runtime
|
||||||
# the shared libraries from the glibc version used for linking
|
# the shared libraries from the glibc version used for linking
|
||||||
LIBDIR := /usr/lib/$(SYS)
|
LIBDIR := /usr/lib/$(SYS)
|
||||||
|
LDLIBS += $(LIBDIR)/libboost_system.a
|
||||||
|
LDLIBS += $(LIBDIR)/libboost_date_time.a
|
||||||
|
LDLIBS += $(LIBDIR)/libboost_filesystem.a
|
||||||
LDLIBS += $(LIBDIR)/libboost_program_options.a
|
LDLIBS += $(LIBDIR)/libboost_program_options.a
|
||||||
LDLIBS += $(LIBDIR)/libssl.a
|
LDLIBS += $(LIBDIR)/libssl.a
|
||||||
LDLIBS += $(LIBDIR)/libcrypto.a
|
LDLIBS += $(LIBDIR)/libcrypto.a
|
||||||
|
@ -40,7 +46,7 @@ ifeq ($(USE_UPNP),yes)
|
||||||
endif
|
endif
|
||||||
LDLIBS += -lpthread -ldl
|
LDLIBS += -lpthread -ldl
|
||||||
else
|
else
|
||||||
LDLIBS += -lssl -lcrypto -lz -lboost_program_options -lpthread -latomic
|
LDLIBS += -lcrypto -lssl -lz -lboost_system -lboost_date_time -lboost_filesystem -lboost_program_options -lpthread
|
||||||
ifeq ($(USE_UPNP),yes)
|
ifeq ($(USE_UPNP),yes)
|
||||||
LDLIBS += -lminiupnpc
|
LDLIBS += -lminiupnpc
|
||||||
endif
|
endif
|
||||||
|
@ -48,23 +54,11 @@ endif
|
||||||
|
|
||||||
# UPNP Support (miniupnpc 1.5 and higher)
|
# UPNP Support (miniupnpc 1.5 and higher)
|
||||||
ifeq ($(USE_UPNP),yes)
|
ifeq ($(USE_UPNP),yes)
|
||||||
DEFINES += -DUSE_UPNP
|
NEEDED_CXXFLAGS += -DUSE_UPNP
|
||||||
endif
|
endif
|
||||||
|
|
||||||
install: all
|
ifeq ($(USE_AESNI),yes)
|
||||||
install -d ${PREFIX}/bin
|
ifneq (, $(findstring i386, $(SYS))$(findstring i686, $(SYS))$(findstring x86_64, $(SYS))) # only x86-based CPU supports that
|
||||||
install -m 755 ${I2PD} ${PREFIX}/bin
|
NEEDED_CXXFLAGS += -D__AES__ -maes
|
||||||
install -d ${PREFIX}/etc ${PREFIX}/etc/i2pd ${PREFIX}/etc/i2pd/tunnels.conf.d
|
endif
|
||||||
install -m 644 contrib/i2pd.conf contrib/subscriptions.txt contrib/tunnels.conf ${PREFIX}/etc/i2pd
|
endif
|
||||||
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
|
|
||||||
|
|
|
@ -3,48 +3,63 @@ USE_WIN32_APP := yes
|
||||||
|
|
||||||
WINDRES = windres
|
WINDRES = windres
|
||||||
|
|
||||||
CXXFLAGS := $(CXX_DEBUG) -fPIC -msse
|
CXXFLAGS := $(CXX_DEBUG) -DWIN32_LEAN_AND_MEAN -fPIC -msse
|
||||||
INCFLAGS := -I$(DAEMON_SRC_DIR) -IWin32
|
INCFLAGS = -I$(DAEMON_SRC_DIR) -IWin32
|
||||||
LDFLAGS := ${LD_DEBUG} -static -fPIC -msse
|
LDFLAGS := ${LD_DEBUG} -static
|
||||||
|
|
||||||
NEEDED_CXXFLAGS += -std=c++20
|
# detect proper flag for c++11 support by compilers
|
||||||
DEFINES += -DWIN32_LEAN_AND_MEAN
|
CXXVER := $(shell $(CXX) -dumpversion)
|
||||||
|
ifeq ($(shell expr match ${CXXVER} "[4]\.[7-9]\|4\.1[0-9]\|[5-6]"),4) # gcc 4.7 - 6
|
||||||
|
NEEDED_CXXFLAGS += -std=c++11
|
||||||
|
else ifeq ($(shell expr match ${CXXVER} "[1,7-9]"),1) # gcc >= 7
|
||||||
|
NEEDED_CXXFLAGS += -std=c++17
|
||||||
|
else # not supported
|
||||||
|
$(error Compiler too old)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Boost libraries suffix
|
||||||
|
BOOST_SUFFIX = -mt
|
||||||
|
|
||||||
# UPNP Support
|
# UPNP Support
|
||||||
ifeq ($(USE_UPNP),yes)
|
ifeq ($(USE_UPNP),yes)
|
||||||
DEFINES += -DUSE_UPNP -DMINIUPNP_STATICLIB
|
CXXFLAGS += -DUSE_UPNP -DMINIUPNP_STATICLIB
|
||||||
LDLIBS = -lminiupnpc
|
LDLIBS = -lminiupnpc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(USE_WINXP_FLAGS), yes)
|
|
||||||
DEFINES += -DWINVER=0x0501 -D_WIN32_WINNT=0x0501
|
|
||||||
endif
|
|
||||||
|
|
||||||
LDLIBS += \
|
LDLIBS += \
|
||||||
$(MINGW_PREFIX)/lib/libboost_filesystem-mt.a \
|
-lboost_system$(BOOST_SUFFIX) \
|
||||||
$(MINGW_PREFIX)/lib/libboost_program_options-mt.a \
|
-lboost_date_time$(BOOST_SUFFIX) \
|
||||||
$(MINGW_PREFIX)/lib/libssl.a \
|
-lboost_filesystem$(BOOST_SUFFIX) \
|
||||||
$(MINGW_PREFIX)/lib/libcrypto.a \
|
-lboost_program_options$(BOOST_SUFFIX) \
|
||||||
$(MINGW_PREFIX)/lib/libz.a \
|
-lssl \
|
||||||
|
-lcrypto \
|
||||||
|
-lz \
|
||||||
-lwsock32 \
|
-lwsock32 \
|
||||||
-lws2_32 \
|
-lws2_32 \
|
||||||
-liphlpapi \
|
|
||||||
-lcrypt32 \
|
|
||||||
-lgdi32 \
|
-lgdi32 \
|
||||||
|
-liphlpapi \
|
||||||
-lole32 \
|
-lole32 \
|
||||||
-luuid \
|
-luuid \
|
||||||
-lpthread
|
-lpthread
|
||||||
|
|
||||||
ifeq ($(USE_WIN32_APP), yes)
|
ifeq ($(USE_WIN32_APP), yes)
|
||||||
DEFINES += -DWIN32_APP
|
NEEDED_CXXFLAGS += -DWIN32_APP
|
||||||
LDFLAGS += -mwindows
|
LDFLAGS += -mwindows
|
||||||
DAEMON_RC += Win32/Resource.rc
|
DAEMON_RC += Win32/Resource.rc
|
||||||
DAEMON_OBJS += $(patsubst %.rc,obj/%.o,$(DAEMON_RC))
|
DAEMON_OBJS += $(patsubst %.rc,obj/%.o,$(DAEMON_RC))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_WINXP_FLAGS), yes)
|
||||||
|
NEEDED_CXXFLAGS += -DWINVER=0x0501 -D_WIN32_WINNT=0x0501
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_AESNI),yes)
|
||||||
|
NEEDED_CXXFLAGS += -D__AES__ -maes
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(USE_ASLR),yes)
|
ifeq ($(USE_ASLR),yes)
|
||||||
LDFLAGS += -Wl,--nxcompat -Wl,--high-entropy-va -Wl,--dynamicbase,--export-all-symbols
|
LDFLAGS += -Wl,--nxcompat -Wl,--high-entropy-va -Wl,--dynamicbase,--export-all-symbols
|
||||||
endif
|
endif
|
||||||
|
|
||||||
obj/%.o : %.rc | mk_obj_dir
|
obj/%.o : %.rc | mk_obj_dir
|
||||||
$(WINDRES) $(DEFINES) $(INCFLAGS) --preprocessor-arg=-MMD --preprocessor-arg=-MP --preprocessor-arg=-MF$@.d -i $< -o $@
|
$(WINDRES) -i $< -o $@
|
||||||
|
|
16
Makefile.osx
16
Makefile.osx
|
@ -1,20 +1,20 @@
|
||||||
CXX = clang++
|
CXX = clang++
|
||||||
CXXFLAGS := ${CXX_DEBUG} -Wall -std=c++17
|
CXXFLAGS := ${CXX_DEBUG} -Wall -std=c++11 -DMAC_OSX
|
||||||
INCFLAGS = -I/usr/local/include
|
INCFLAGS = -I/usr/local/include
|
||||||
DEFINES := -DMAC_OSX
|
|
||||||
LDFLAGS := -Wl,-rpath,/usr/local/lib -L/usr/local/lib
|
LDFLAGS := -Wl,-rpath,/usr/local/lib -L/usr/local/lib
|
||||||
LDFLAGS += -Wl,-dead_strip
|
LDFLAGS += -Wl,-dead_strip
|
||||||
LDFLAGS += -Wl,-dead_strip_dylibs
|
LDFLAGS += -Wl,-dead_strip_dylibs
|
||||||
|
LDFLAGS += -Wl,-bind_at_load
|
||||||
|
|
||||||
ifeq ($(USE_STATIC),yes)
|
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
|
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
|
endif
|
||||||
|
|
||||||
ifeq ($(USE_UPNP),yes)
|
ifeq ($(USE_UPNP),yes)
|
||||||
LDFLAGS += -ldl
|
LDFLAGS += -ldl
|
||||||
DEFINES += -DUSE_UPNP
|
CXXFLAGS += -DUSE_UPNP
|
||||||
ifeq ($(USE_STATIC),yes)
|
ifeq ($(USE_STATIC),yes)
|
||||||
LDLIBS += /usr/local/lib/libminiupnpc.a
|
LDLIBS += /usr/local/lib/libminiupnpc.a
|
||||||
else
|
else
|
||||||
|
@ -22,8 +22,8 @@ ifeq ($(USE_UPNP),yes)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
OSARCH = $(shell uname -p)
|
ifeq ($(USE_AESNI),yes)
|
||||||
|
CXXFLAGS += -D__AES__ -maes
|
||||||
ifneq ($(OSARCH),powerpc)
|
else
|
||||||
CXXFLAGS += -msse
|
CXXFLAGS += -msse
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -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
|
|
34
README.md
34
README.md
|
@ -69,12 +69,12 @@ Build instructions:
|
||||||
|
|
||||||
**Supported systems:**
|
**Supported systems:**
|
||||||
|
|
||||||
* GNU/Linux (Debian, Ubuntu, etc) - [](https://github.com/PurpleI2P/i2pd/actions/workflows/build.yml)
|
* GNU/Linux - [](https://github.com/PurpleI2P/i2pd/actions/workflows/build.yml)
|
||||||
* CentOS, Fedora, Mageia - [](https://copr.fedorainfracloud.org/coprs/supervillain/i2pd/package/i2pd-git/)
|
* CentOS / Fedora / Mageia - [](https://copr.fedorainfracloud.org/coprs/supervillain/i2pd/package/i2pd-git/)
|
||||||
* Alpine, ArchLinux, openSUSE, Gentoo, etc.
|
* Alpine, ArchLinux, openSUSE, Gentoo, Debian, Ubuntu, etc.
|
||||||
* Windows - [](https://github.com/PurpleI2P/i2pd/actions/workflows/build-windows.yml)
|
* Windows - [](https://github.com/PurpleI2P/i2pd/actions/workflows/build-windows.yml)
|
||||||
* Mac OS - [](https://github.com/PurpleI2P/i2pd/actions/workflows/build-osx.yml)
|
* Mac OS X - [](https://github.com/PurpleI2P/i2pd/actions/workflows/build-osx.yml)
|
||||||
* Docker image - [](https://github.com/PurpleI2P/i2pd/actions/workflows/docker.yml)
|
* Docker image - [](https://hub.docker.com/r/purplei2p/i2pd/builds/) [](https://github.com/PurpleI2P/i2pd/actions/workflows/docker.yml)
|
||||||
* Snap - [](https://snapcraft.io/i2pd) [](https://snapcraft.io/i2pd)
|
* Snap - [](https://snapcraft.io/i2pd) [](https://snapcraft.io/i2pd)
|
||||||
* FreeBSD - [](https://github.com/PurpleI2P/i2pd/actions/workflows/build-freebsd.yml)
|
* FreeBSD - [](https://github.com/PurpleI2P/i2pd/actions/workflows/build-freebsd.yml)
|
||||||
* Android - [](https://github.com/PurpleI2P/i2pd-android/actions/workflows/android.yml)
|
* Android - [](https://github.com/PurpleI2P/i2pd-android/actions/workflows/android.yml)
|
||||||
|
@ -99,23 +99,13 @@ Current status: [](http
|
||||||
Donations
|
Donations
|
||||||
---------
|
---------
|
||||||
|
|
||||||
**E-Mail**: ```i2porignal at yandex.com```
|
BTC: 3MDoGJW9TLMTCDGrR9bLgWXfm6sjmgy86f
|
||||||
|
LTC: LKQirrYrDeTuAPnpYq5y7LVKtywfkkHi59
|
||||||
**BTC**: ```3MDoGJW9TLMTCDGrR9bLgWXfm6sjmgy86f```
|
ETH: 0x9e5bac70d20d1079ceaa111127f4fb3bccce379d
|
||||||
|
DASH: Xw8YUrQpYzP9tZBmbjqxS3M97Q7v3vJKUF
|
||||||
**LTC**: ```LKQirrYrDeTuAPnpYq5y7LVKtywfkkHi59```
|
ZEC: t1cTckLuXsr1dwVrK4NDzfhehss4NvMadAJ
|
||||||
|
GST: GbD2JSQHBHCKLa9WTHmigJRpyFgmBj4woG
|
||||||
**ETH**: ```0x9e5bac70d20d1079ceaa111127f4fb3bccce379d```
|
XMR: 497pJc7X4xqKvcLBLpSUtRgWqMMyo24u4btCos3cak6gbMkpobgSU6492ztUcUBghyeHpYeczB55s38NpuHoH5WGNSPDRMH
|
||||||
|
|
||||||
**GST**: ```GbD2JSQHBHCKLa9WTHmigJRpyFgmBj4woG```
|
|
||||||
|
|
||||||
**DASH**: ```Xw8YUrQpYzP9tZBmbjqxS3M97Q7v3vJKUF```
|
|
||||||
|
|
||||||
**ZEC**: ```t1cTckLuXsr1dwVrK4NDzfhehss4NvMadAJ```
|
|
||||||
|
|
||||||
**ANC**: ```AQJYweYYUqM1nVfLqfoSMpUMfzxvS4Xd7z```
|
|
||||||
|
|
||||||
**XMR**: ```497pJc7X4xqKvcLBLpSUtRgWqMMyo24u4btCos3cak6gbMkpobgSU6492ztUcUBghyeHpYeczB55s38NpuHoH5WGNSPDRMH```
|
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2023, The PurpleI2P Project
|
* Copyright (c) 2013-2020, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
|
@ -14,7 +14,6 @@
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include "Win32Service.h"
|
|
||||||
#ifdef WIN32_APP
|
#ifdef WIN32_APP
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "Win32App.h"
|
#include "Win32App.h"
|
||||||
|
@ -29,7 +28,7 @@ namespace util
|
||||||
setlocale(LC_CTYPE, "");
|
setlocale(LC_CTYPE, "");
|
||||||
SetConsoleCP(1251);
|
SetConsoleCP(1251);
|
||||||
SetConsoleOutputCP(1251);
|
SetConsoleOutputCP(1251);
|
||||||
//setlocale(LC_ALL, "Russian");
|
setlocale(LC_ALL, "Russian");
|
||||||
setlocale(LC_TIME, "C");
|
setlocale(LC_TIME, "C");
|
||||||
|
|
||||||
i2p::log::SetThrowFunction ([](const std::string& s)
|
i2p::log::SetThrowFunction ([](const std::string& s)
|
||||||
|
@ -40,19 +39,6 @@ namespace util
|
||||||
|
|
||||||
if (!Daemon_Singleton::init(argc, argv))
|
if (!Daemon_Singleton::init(argc, argv))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (isDaemon)
|
|
||||||
{
|
|
||||||
LogPrint(eLogDebug, "Daemon: running as service");
|
|
||||||
I2PService service((PSTR)SERVICE_NAME);
|
|
||||||
if (!I2PService::Run(service))
|
|
||||||
{
|
|
||||||
LogPrint(eLogCritical, "Daemon: Service failed to run w/err 0x%08lx\n", GetLastError());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,10 +47,10 @@ namespace util
|
||||||
setlocale(LC_CTYPE, "");
|
setlocale(LC_CTYPE, "");
|
||||||
SetConsoleCP(1251);
|
SetConsoleCP(1251);
|
||||||
SetConsoleOutputCP(1251);
|
SetConsoleOutputCP(1251);
|
||||||
//setlocale(LC_ALL, "Russian");
|
setlocale(LC_ALL, "Russian");
|
||||||
setlocale(LC_TIME, "C");
|
setlocale(LC_TIME, "C");
|
||||||
#ifdef WIN32_APP
|
#ifdef WIN32_APP
|
||||||
if (!i2p::win32::StartWin32App (isDaemon)) return false;
|
if (!i2p::win32::StartWin32App ()) return false;
|
||||||
#endif
|
#endif
|
||||||
bool ret = Daemon_Singleton::start();
|
bool ret = Daemon_Singleton::start();
|
||||||
if (ret && i2p::log::Logger().GetLogType() == eLogFile)
|
if (ret && i2p::log::Logger().GetLogType() == eLogFile)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#error this file is not editable by Microsoft Visual C++
|
#error this file is not editable by Microsoft Visual C++
|
||||||
#endif //APSTUDIO_INVOKED
|
#endif //APSTUDIO_INVOKED
|
||||||
|
|
||||||
#include "version.h"
|
#include "../libi2pd/version.h"
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION I2PD_VERSION_MAJOR,I2PD_VERSION_MINOR,I2PD_VERSION_MICRO,I2PD_VERSION_PATCH
|
FILEVERSION I2PD_VERSION_MAJOR,I2PD_VERSION_MINOR,I2PD_VERSION_MICRO,I2PD_VERSION_PATCH
|
||||||
|
@ -25,7 +25,7 @@ BEGIN
|
||||||
VALUE "FileDescription", "C++ I2P daemon"
|
VALUE "FileDescription", "C++ I2P daemon"
|
||||||
VALUE "FileVersion", I2PD_VERSION
|
VALUE "FileVersion", I2PD_VERSION
|
||||||
VALUE "InternalName", CODENAME
|
VALUE "InternalName", CODENAME
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2013-2023, The PurpleI2P Project"
|
VALUE "LegalCopyright", "Copyright (C) 2013-2022, The PurpleI2P Project"
|
||||||
VALUE "OriginalFilename", "i2pd"
|
VALUE "OriginalFilename", "i2pd"
|
||||||
VALUE "ProductName", "Purple I2P"
|
VALUE "ProductName", "Purple I2P"
|
||||||
VALUE "ProductVersion", I2P_VERSION
|
VALUE "ProductVersion", I2P_VERSION
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2024, The PurpleI2P Project
|
* Copyright (c) 2013-2020, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
|
@ -45,7 +45,6 @@ namespace i2p
|
||||||
namespace win32
|
namespace win32
|
||||||
{
|
{
|
||||||
DWORD g_GracefulShutdownEndtime = 0;
|
DWORD g_GracefulShutdownEndtime = 0;
|
||||||
bool g_isWinService;
|
|
||||||
|
|
||||||
static void ShowPopupMenu (HWND hWnd, POINT *curpos, int wDefaultItem)
|
static void ShowPopupMenu (HWND hWnd, POINT *curpos, int wDefaultItem)
|
||||||
{
|
{
|
||||||
|
@ -145,40 +144,35 @@ namespace win32
|
||||||
s << bytes << " Bytes\n";
|
s << bytes << " Bytes\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShowNetworkStatus (std::stringstream& s, RouterStatus status, bool testing, RouterError error)
|
static void ShowNetworkStatus (std::stringstream& s, RouterStatus status)
|
||||||
{
|
{
|
||||||
switch (status)
|
switch (status)
|
||||||
{
|
{
|
||||||
case eRouterStatusOK: s << "OK"; break;
|
case eRouterStatusOK: s << "OK"; break;
|
||||||
|
case eRouterStatusTesting: s << "Test"; break;
|
||||||
case eRouterStatusFirewalled: s << "FW"; break;
|
case eRouterStatusFirewalled: s << "FW"; break;
|
||||||
case eRouterStatusUnknown: s << "Unk"; break;
|
case eRouterStatusUnknown: s << "Unk"; break;
|
||||||
case eRouterStatusProxy: s << "Proxy"; break;
|
case eRouterStatusProxy: s << "Proxy"; break;
|
||||||
case eRouterStatusMesh: s << "Mesh"; break;
|
case eRouterStatusMesh: s << "Mesh"; break;
|
||||||
default: s << "Unk";
|
case eRouterStatusError:
|
||||||
};
|
|
||||||
if (testing)
|
|
||||||
s << " (Test)";
|
|
||||||
if (error != eRouterErrorNone)
|
|
||||||
{
|
{
|
||||||
switch (error)
|
s << "Err";
|
||||||
|
switch (i2p::context.GetError ())
|
||||||
{
|
{
|
||||||
case eRouterErrorClockSkew:
|
case eRouterErrorClockSkew:
|
||||||
s << " - " << tr("Clock skew");
|
s << " - Clock skew";
|
||||||
break;
|
break;
|
||||||
case eRouterErrorOffline:
|
case eRouterErrorOffline:
|
||||||
s << " - " << tr("Offline");
|
s << " - Offline";
|
||||||
break;
|
break;
|
||||||
case eRouterErrorSymmetricNAT:
|
case eRouterErrorSymmetricNAT:
|
||||||
s << " - " << tr("Symmetric NAT");
|
s << " - Symmetric NAT";
|
||||||
break;
|
|
||||||
case eRouterErrorFullConeNAT:
|
|
||||||
s << " - " << tr("Full cone NAT");
|
|
||||||
break;
|
|
||||||
case eRouterErrorNoDescriptors:
|
|
||||||
s << " - " << tr("No Descriptors");
|
|
||||||
break;
|
break;
|
||||||
default: ;
|
default: ;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: s << "Unk";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,11 +180,11 @@ namespace win32
|
||||||
{
|
{
|
||||||
s << "\n";
|
s << "\n";
|
||||||
s << "Status: ";
|
s << "Status: ";
|
||||||
ShowNetworkStatus (s, i2p::context.GetStatus (), i2p::context.GetTesting(), i2p::context.GetError ());
|
ShowNetworkStatus (s, i2p::context.GetStatus ());
|
||||||
if (i2p::context.SupportsV6 ())
|
if (i2p::context.SupportsV6 ())
|
||||||
{
|
{
|
||||||
s << " / ";
|
s << " / ";
|
||||||
ShowNetworkStatus (s, i2p::context.GetStatusV6 (), i2p::context.GetTestingV6(), i2p::context.GetErrorV6 ());
|
ShowNetworkStatus (s, i2p::context.GetStatusV6 ());
|
||||||
}
|
}
|
||||||
s << "; ";
|
s << "; ";
|
||||||
s << "Success Rate: " << i2p::tunnel::tunnels.GetTunnelCreationSuccessRate() << "%\n";
|
s << "Success Rate: " << i2p::tunnel::tunnels.GetTunnelCreationSuccessRate() << "%\n";
|
||||||
|
@ -313,7 +307,7 @@ namespace win32
|
||||||
}
|
}
|
||||||
case ID_DATADIR:
|
case ID_DATADIR:
|
||||||
{
|
{
|
||||||
std::string datadir(i2p::fs::GetDataDir());
|
std::string datadir(i2p::fs::GetUTF8DataDir());
|
||||||
ShellExecute(NULL, "explore", datadir.c_str(), NULL, NULL, SW_SHOWNORMAL);
|
ShellExecute(NULL, "explore", datadir.c_str(), NULL, NULL, SW_SHOWNORMAL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -355,7 +349,6 @@ namespace win32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[[fallthrough]];
|
|
||||||
}
|
}
|
||||||
case WM_TRAYICON:
|
case WM_TRAYICON:
|
||||||
{
|
{
|
||||||
|
@ -425,9 +418,8 @@ namespace win32
|
||||||
return DefWindowProc( hWnd, uMsg, wParam, lParam);
|
return DefWindowProc( hWnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StartWin32App (bool isWinService)
|
bool StartWin32App ()
|
||||||
{
|
{
|
||||||
g_isWinService = isWinService;
|
|
||||||
if (FindWindow (I2PD_WIN32_CLASSNAME, TEXT("i2pd")))
|
if (FindWindow (I2PD_WIN32_CLASSNAME, TEXT("i2pd")))
|
||||||
{
|
{
|
||||||
MessageBox(NULL, TEXT("I2Pd is running already"), TEXT("Warning"), MB_OK);
|
MessageBox(NULL, TEXT("I2Pd is running already"), TEXT("Warning"), MB_OK);
|
||||||
|
@ -456,8 +448,6 @@ namespace win32
|
||||||
MessageBox(NULL, "Failed to create main window", TEXT("Warning!"), MB_ICONERROR | MB_OK | MB_TOPMOST);
|
MessageBox(NULL, "Failed to create main window", TEXT("Warning!"), MB_ICONERROR | MB_OK | MB_TOPMOST);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// COM requires message loop to work, which is not implemented in service mode
|
|
||||||
if (!g_isWinService)
|
|
||||||
SubscribeToEvents();
|
SubscribeToEvents();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -478,8 +468,7 @@ namespace win32
|
||||||
HWND hWnd = FindWindow (I2PD_WIN32_CLASSNAME, TEXT("i2pd"));
|
HWND hWnd = FindWindow (I2PD_WIN32_CLASSNAME, TEXT("i2pd"));
|
||||||
if (hWnd)
|
if (hWnd)
|
||||||
PostMessage (hWnd, WM_COMMAND, MAKEWPARAM(ID_EXIT, 0), 0);
|
PostMessage (hWnd, WM_COMMAND, MAKEWPARAM(ID_EXIT, 0), 0);
|
||||||
else if(!g_isWinService)
|
// UnSubscribeFromEvents(); // TODO: understand why unsubscribing crashes app
|
||||||
UnSubscribeFromEvents();
|
|
||||||
UnregisterClass (I2PD_WIN32_CLASSNAME, GetModuleHandle(NULL));
|
UnregisterClass (I2PD_WIN32_CLASSNAME, GetModuleHandle(NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace win32
|
||||||
{
|
{
|
||||||
extern DWORD g_GracefulShutdownEndtime;
|
extern DWORD g_GracefulShutdownEndtime;
|
||||||
|
|
||||||
bool StartWin32App (bool isWinService);
|
bool StartWin32App ();
|
||||||
void StopWin32App ();
|
void StopWin32App ();
|
||||||
int RunWin32App ();
|
int RunWin32App ();
|
||||||
bool GracefulShutdown ();
|
bool GracefulShutdown ();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2024, The PurpleI2P Project
|
* Copyright (c) 2013-2020, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
|
@ -15,7 +15,6 @@ IUnknown *pUnknown = nullptr;
|
||||||
INetworkListManager *pNetworkListManager = nullptr;
|
INetworkListManager *pNetworkListManager = nullptr;
|
||||||
IConnectionPointContainer *pCPContainer = nullptr;
|
IConnectionPointContainer *pCPContainer = nullptr;
|
||||||
IConnectionPoint *pConnectPoint = nullptr;
|
IConnectionPoint *pConnectPoint = nullptr;
|
||||||
CNetworkListManagerEvent *pNetEvent = nullptr;
|
|
||||||
DWORD Cookie = 0;
|
DWORD Cookie = 0;
|
||||||
|
|
||||||
void SubscribeToEvents()
|
void SubscribeToEvents()
|
||||||
|
@ -30,11 +29,7 @@ void SubscribeToEvents()
|
||||||
if (SUCCEEDED(Result))
|
if (SUCCEEDED(Result))
|
||||||
{
|
{
|
||||||
VARIANT_BOOL IsConnect = VARIANT_FALSE;
|
VARIANT_BOOL IsConnect = VARIANT_FALSE;
|
||||||
#if defined(_MSC_VER)
|
|
||||||
Result = pNetworkListManager->get_IsConnectedToInternet(&IsConnect);
|
|
||||||
#else
|
|
||||||
Result = pNetworkListManager->IsConnectedToInternet(&IsConnect);
|
Result = pNetworkListManager->IsConnectedToInternet(&IsConnect);
|
||||||
#endif
|
|
||||||
if (SUCCEEDED(Result)) {
|
if (SUCCEEDED(Result)) {
|
||||||
i2p::transport::transports.SetOnline (true);
|
i2p::transport::transports.SetOnline (true);
|
||||||
LogPrint(eLogInfo, "NetState: Current state: ", IsConnect == VARIANT_TRUE ? "connected" : "disconnected");
|
LogPrint(eLogInfo, "NetState: Current state: ", IsConnect == VARIANT_TRUE ? "connected" : "disconnected");
|
||||||
|
@ -46,8 +41,8 @@ void SubscribeToEvents()
|
||||||
Result = pCPContainer->FindConnectionPoint(IID_INetworkListManagerEvents, &pConnectPoint);
|
Result = pCPContainer->FindConnectionPoint(IID_INetworkListManagerEvents, &pConnectPoint);
|
||||||
if(SUCCEEDED(Result))
|
if(SUCCEEDED(Result))
|
||||||
{
|
{
|
||||||
pNetEvent = new CNetworkListManagerEvent;
|
CNetworkListManagerEvent *NetEvent = new CNetworkListManagerEvent;
|
||||||
Result = pConnectPoint->Advise((IUnknown *)pNetEvent, &Cookie);
|
Result = pConnectPoint->Advise((IUnknown *)NetEvent, &Cookie);
|
||||||
if (SUCCEEDED(Result))
|
if (SUCCEEDED(Result))
|
||||||
LogPrint(eLogInfo, "NetState: Successfully subscribed to NetworkListManagerEvent messages");
|
LogPrint(eLogInfo, "NetState: Successfully subscribed to NetworkListManagerEvent messages");
|
||||||
else
|
else
|
||||||
|
@ -64,7 +59,6 @@ void SubscribeToEvents()
|
||||||
|
|
||||||
void UnSubscribeFromEvents()
|
void UnSubscribeFromEvents()
|
||||||
{
|
{
|
||||||
LogPrint(eLogInfo, "NetState: Unsubscribing from NetworkListManagerEvents");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (pConnectPoint) {
|
if (pConnectPoint) {
|
||||||
|
@ -72,25 +66,14 @@ void UnSubscribeFromEvents()
|
||||||
pConnectPoint->Release();
|
pConnectPoint->Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pNetEvent)
|
|
||||||
{
|
|
||||||
pNetEvent->Release();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pCPContainer)
|
if (pCPContainer)
|
||||||
{
|
|
||||||
pCPContainer->Release();
|
pCPContainer->Release();
|
||||||
}
|
|
||||||
|
|
||||||
if (pNetworkListManager)
|
if (pNetworkListManager)
|
||||||
{
|
|
||||||
pNetworkListManager->Release();
|
pNetworkListManager->Release();
|
||||||
}
|
|
||||||
|
|
||||||
if (pUnknown)
|
if (pUnknown)
|
||||||
{
|
|
||||||
pUnknown->Release();
|
pUnknown->Release();
|
||||||
}
|
|
||||||
|
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2024, The PurpleI2P Project
|
* Copyright (c) 2013-2020, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "Transports.h"
|
#include "Transports.h"
|
||||||
|
|
||||||
class CNetworkListManagerEvent final : public INetworkListManagerEvents
|
class CNetworkListManagerEvent : public INetworkListManagerEvents
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CNetworkListManagerEvent() : m_ref(1) { }
|
CNetworkListManagerEvent() : m_ref(1) { }
|
||||||
|
@ -23,15 +23,17 @@ public:
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject)
|
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject)
|
||||||
{
|
{
|
||||||
|
HRESULT Result = S_OK;
|
||||||
if (IsEqualIID(riid, IID_IUnknown)) {
|
if (IsEqualIID(riid, IID_IUnknown)) {
|
||||||
*ppvObject = (IUnknown *)this;
|
*ppvObject = (IUnknown *)this;
|
||||||
} else if (IsEqualIID(riid ,IID_INetworkListManagerEvents)) {
|
} else if (IsEqualIID(riid ,IID_INetworkListManagerEvents)) {
|
||||||
*ppvObject = (INetworkListManagerEvents *)this;
|
*ppvObject = (INetworkListManagerEvents *)this;
|
||||||
} else {
|
} else {
|
||||||
return E_NOINTERFACE;
|
Result = E_NOINTERFACE;
|
||||||
}
|
}
|
||||||
AddRef();
|
AddRef();
|
||||||
return S_OK;
|
|
||||||
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG STDMETHODCALLTYPE AddRef()
|
ULONG STDMETHODCALLTYPE AddRef()
|
||||||
|
|
|
@ -1,283 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2022, 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 "Win32Service.h"
|
|
||||||
#include <assert.h>
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
#include "Daemon.h"
|
|
||||||
#include "Log.h"
|
|
||||||
|
|
||||||
I2PService *I2PService::s_service = NULL;
|
|
||||||
|
|
||||||
BOOL I2PService::isService()
|
|
||||||
{
|
|
||||||
BOOL bIsService = FALSE;
|
|
||||||
HWINSTA hWinStation = GetProcessWindowStation();
|
|
||||||
if (hWinStation != NULL)
|
|
||||||
{
|
|
||||||
USEROBJECTFLAGS uof = { FALSE, FALSE, 0 };
|
|
||||||
if (GetUserObjectInformation(hWinStation, UOI_FLAGS, &uof, sizeof(USEROBJECTFLAGS), NULL) && ((uof.dwFlags & WSF_VISIBLE) == 0))
|
|
||||||
{
|
|
||||||
bIsService = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return bIsService;
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL I2PService::Run(I2PService &service)
|
|
||||||
{
|
|
||||||
s_service = &service;
|
|
||||||
SERVICE_TABLE_ENTRY serviceTable[] =
|
|
||||||
{
|
|
||||||
{ service.m_name, ServiceMain },
|
|
||||||
{ NULL, NULL }
|
|
||||||
};
|
|
||||||
return StartServiceCtrlDispatcher(serviceTable);
|
|
||||||
}
|
|
||||||
|
|
||||||
void WINAPI I2PService::ServiceMain(DWORD dwArgc, PSTR *pszArgv)
|
|
||||||
{
|
|
||||||
assert(s_service != NULL);
|
|
||||||
s_service->m_statusHandle = RegisterServiceCtrlHandler(
|
|
||||||
s_service->m_name, ServiceCtrlHandler);
|
|
||||||
if (s_service->m_statusHandle == NULL)
|
|
||||||
{
|
|
||||||
throw GetLastError();
|
|
||||||
}
|
|
||||||
s_service->Start(dwArgc, pszArgv);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void WINAPI I2PService::ServiceCtrlHandler(DWORD dwCtrl)
|
|
||||||
{
|
|
||||||
switch (dwCtrl)
|
|
||||||
{
|
|
||||||
case SERVICE_CONTROL_STOP: s_service->Stop(); break;
|
|
||||||
case SERVICE_CONTROL_PAUSE: s_service->Pause(); break;
|
|
||||||
case SERVICE_CONTROL_CONTINUE: s_service->Continue(); break;
|
|
||||||
case SERVICE_CONTROL_SHUTDOWN: s_service->Shutdown(); break;
|
|
||||||
case SERVICE_CONTROL_INTERROGATE: break;
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
I2PService::I2PService(PSTR pszServiceName,
|
|
||||||
BOOL fCanStop,
|
|
||||||
BOOL fCanShutdown,
|
|
||||||
BOOL fCanPauseContinue)
|
|
||||||
{
|
|
||||||
m_name = (pszServiceName == NULL) ? (PSTR)"" : pszServiceName;
|
|
||||||
m_statusHandle = NULL;
|
|
||||||
m_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
|
|
||||||
m_status.dwCurrentState = SERVICE_START_PENDING;
|
|
||||||
|
|
||||||
DWORD dwControlsAccepted = 0;
|
|
||||||
if (fCanStop)
|
|
||||||
dwControlsAccepted |= SERVICE_ACCEPT_STOP;
|
|
||||||
if (fCanShutdown)
|
|
||||||
dwControlsAccepted |= SERVICE_ACCEPT_SHUTDOWN;
|
|
||||||
if (fCanPauseContinue)
|
|
||||||
dwControlsAccepted |= SERVICE_ACCEPT_PAUSE_CONTINUE;
|
|
||||||
|
|
||||||
m_status.dwControlsAccepted = dwControlsAccepted;
|
|
||||||
m_status.dwWin32ExitCode = NO_ERROR;
|
|
||||||
m_status.dwServiceSpecificExitCode = 0;
|
|
||||||
m_status.dwCheckPoint = 0;
|
|
||||||
m_status.dwWaitHint = 0;
|
|
||||||
m_fStopping = FALSE;
|
|
||||||
// Create a manual-reset event that is not signaled at first to indicate
|
|
||||||
// the stopped signal of the service.
|
|
||||||
m_hStoppedEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
|
||||||
if (m_hStoppedEvent == NULL)
|
|
||||||
{
|
|
||||||
throw GetLastError();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
I2PService::~I2PService(void)
|
|
||||||
{
|
|
||||||
if (m_hStoppedEvent)
|
|
||||||
{
|
|
||||||
CloseHandle(m_hStoppedEvent);
|
|
||||||
m_hStoppedEvent = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PService::Start(DWORD dwArgc, PSTR *pszArgv)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
SetServiceStatus(SERVICE_START_PENDING);
|
|
||||||
OnStart(dwArgc, pszArgv);
|
|
||||||
SetServiceStatus(SERVICE_RUNNING);
|
|
||||||
}
|
|
||||||
catch (DWORD dwError)
|
|
||||||
{
|
|
||||||
LogPrint(eLogCritical, "Win32Service: Start error: ", dwError);
|
|
||||||
SetServiceStatus(SERVICE_STOPPED, dwError);
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
LogPrint(eLogCritical, "Win32Service: failed to start: ", EVENTLOG_ERROR_TYPE);
|
|
||||||
SetServiceStatus(SERVICE_STOPPED);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PService::OnStart(DWORD dwArgc, PSTR *pszArgv)
|
|
||||||
{
|
|
||||||
LogPrint(eLogInfo, "Win32Service: in OnStart (", EVENTLOG_INFORMATION_TYPE, ")");
|
|
||||||
Daemon.start();
|
|
||||||
_worker = new std::thread(std::bind(&I2PService::WorkerThread, this));
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PService::WorkerThread()
|
|
||||||
{
|
|
||||||
while (!m_fStopping)
|
|
||||||
{
|
|
||||||
::Sleep(1000); // Simulate some lengthy operations.
|
|
||||||
}
|
|
||||||
// Signal the stopped event.
|
|
||||||
SetEvent(m_hStoppedEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PService::Stop()
|
|
||||||
{
|
|
||||||
DWORD dwOriginalState = m_status.dwCurrentState;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
SetServiceStatus(SERVICE_STOP_PENDING);
|
|
||||||
OnStop();
|
|
||||||
SetServiceStatus(SERVICE_STOPPED);
|
|
||||||
}
|
|
||||||
catch (DWORD dwError)
|
|
||||||
{
|
|
||||||
LogPrint(eLogInfo, "Win32Service: Stop error: ", dwError);
|
|
||||||
SetServiceStatus(dwOriginalState);
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
LogPrint(eLogCritical, "Win32Service: Failed to stop: ", EVENTLOG_ERROR_TYPE);
|
|
||||||
SetServiceStatus(dwOriginalState);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PService::OnStop()
|
|
||||||
{
|
|
||||||
// Log a service stop message to the Application log.
|
|
||||||
LogPrint(eLogInfo, "Win32Service: in OnStop (", EVENTLOG_INFORMATION_TYPE, ")");
|
|
||||||
Daemon.stop();
|
|
||||||
m_fStopping = TRUE;
|
|
||||||
if (WaitForSingleObject(m_hStoppedEvent, INFINITE) != WAIT_OBJECT_0)
|
|
||||||
{
|
|
||||||
throw GetLastError();
|
|
||||||
}
|
|
||||||
_worker->join();
|
|
||||||
delete _worker;
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PService::Pause()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
SetServiceStatus(SERVICE_PAUSE_PENDING);
|
|
||||||
OnPause();
|
|
||||||
SetServiceStatus(SERVICE_PAUSED);
|
|
||||||
}
|
|
||||||
catch (DWORD dwError)
|
|
||||||
{
|
|
||||||
LogPrint(eLogCritical, "Win32Service: Pause error: ", dwError);
|
|
||||||
SetServiceStatus(SERVICE_RUNNING);
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
LogPrint(eLogCritical, "Win32Service: Failed to pause: ", EVENTLOG_ERROR_TYPE);
|
|
||||||
SetServiceStatus(SERVICE_RUNNING);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PService::OnPause()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PService::Continue()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
SetServiceStatus(SERVICE_CONTINUE_PENDING);
|
|
||||||
OnContinue();
|
|
||||||
SetServiceStatus(SERVICE_RUNNING);
|
|
||||||
}
|
|
||||||
catch (DWORD dwError)
|
|
||||||
{
|
|
||||||
LogPrint(eLogCritical, "Win32Service: Continue error: ", dwError);
|
|
||||||
SetServiceStatus(SERVICE_PAUSED);
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
LogPrint(eLogCritical, "Win32Service: Failed to resume: ", EVENTLOG_ERROR_TYPE);
|
|
||||||
SetServiceStatus(SERVICE_PAUSED);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PService::OnContinue()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PService::Shutdown()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
OnShutdown();
|
|
||||||
SetServiceStatus(SERVICE_STOPPED);
|
|
||||||
}
|
|
||||||
catch (DWORD dwError)
|
|
||||||
{
|
|
||||||
LogPrint(eLogCritical, "Win32Service: Shutdown error: ", dwError);
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
LogPrint(eLogCritical, "Win32Service: Failed to shut down: ", EVENTLOG_ERROR_TYPE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PService::OnShutdown()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PService::SetServiceStatus(DWORD dwCurrentState,
|
|
||||||
DWORD dwWin32ExitCode,
|
|
||||||
DWORD dwWaitHint)
|
|
||||||
{
|
|
||||||
static DWORD dwCheckPoint = 1;
|
|
||||||
m_status.dwCurrentState = dwCurrentState;
|
|
||||||
m_status.dwWin32ExitCode = dwWin32ExitCode;
|
|
||||||
m_status.dwWaitHint = dwWaitHint;
|
|
||||||
m_status.dwCheckPoint =
|
|
||||||
((dwCurrentState == SERVICE_RUNNING) ||
|
|
||||||
(dwCurrentState == SERVICE_STOPPED)) ?
|
|
||||||
0 : dwCheckPoint++;
|
|
||||||
|
|
||||||
::SetServiceStatus(m_statusHandle, &m_status);
|
|
||||||
}
|
|
||||||
|
|
||||||
//*****************************************************************************
|
|
||||||
|
|
||||||
void FreeHandles(SC_HANDLE schSCManager, SC_HANDLE schService)
|
|
||||||
{
|
|
||||||
if (schSCManager)
|
|
||||||
{
|
|
||||||
CloseServiceHandle(schSCManager);
|
|
||||||
schSCManager = NULL;
|
|
||||||
}
|
|
||||||
if (schService)
|
|
||||||
{
|
|
||||||
CloseServiceHandle(schService);
|
|
||||||
schService = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,63 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2022, 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
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef WIN_32_SERVICE_H__
|
|
||||||
#define WIN_32_SERVICE_H__
|
|
||||||
|
|
||||||
#include <thread>
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
#define SERVICE_NAME "i2pdService"
|
|
||||||
|
|
||||||
class I2PService
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
I2PService(PSTR pszServiceName,
|
|
||||||
BOOL fCanStop = TRUE,
|
|
||||||
BOOL fCanShutdown = TRUE,
|
|
||||||
BOOL fCanPauseContinue = FALSE);
|
|
||||||
|
|
||||||
virtual ~I2PService(void);
|
|
||||||
|
|
||||||
static BOOL isService();
|
|
||||||
static BOOL Run(I2PService &service);
|
|
||||||
void Stop();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
virtual void OnStart(DWORD dwArgc, PSTR *pszArgv);
|
|
||||||
virtual void OnStop();
|
|
||||||
virtual void OnPause();
|
|
||||||
virtual void OnContinue();
|
|
||||||
virtual void OnShutdown();
|
|
||||||
void SetServiceStatus(DWORD dwCurrentState,
|
|
||||||
DWORD dwWin32ExitCode = NO_ERROR,
|
|
||||||
DWORD dwWaitHint = 0);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
static void WINAPI ServiceMain(DWORD dwArgc, LPSTR *lpszArgv);
|
|
||||||
static void WINAPI ServiceCtrlHandler(DWORD dwCtrl);
|
|
||||||
void WorkerThread();
|
|
||||||
void Start(DWORD dwArgc, PSTR *pszArgv);
|
|
||||||
void Pause();
|
|
||||||
void Continue();
|
|
||||||
void Shutdown();
|
|
||||||
static I2PService* s_service;
|
|
||||||
PSTR m_name;
|
|
||||||
SERVICE_STATUS m_status;
|
|
||||||
SERVICE_STATUS_HANDLE m_statusHandle;
|
|
||||||
|
|
||||||
BOOL m_fStopping;
|
|
||||||
HANDLE m_hStoppedEvent;
|
|
||||||
|
|
||||||
std::thread* _worker;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // WIN_32_SERVICE_H__
|
|
BIN
Win32/mask.bmp
Normal file
BIN
Win32/mask.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
14
build/.gitignore
vendored
14
build/.gitignore
vendored
|
@ -1,13 +1,6 @@
|
||||||
# Various generated files
|
# Various generated files
|
||||||
/CMakeFiles/
|
/CMakeFiles/
|
||||||
/Testing/
|
|
||||||
/tests/
|
|
||||||
/.ninja_*
|
|
||||||
/arch.c
|
|
||||||
/build.ninja
|
|
||||||
/i2pd
|
/i2pd
|
||||||
/i2pd.exe
|
|
||||||
/i2pd.exe.debug
|
|
||||||
/libi2pd.a
|
/libi2pd.a
|
||||||
/libi2pdclient.a
|
/libi2pdclient.a
|
||||||
/libi2pdlang.a
|
/libi2pdlang.a
|
||||||
|
@ -15,13 +8,8 @@
|
||||||
/CMakeCache.txt
|
/CMakeCache.txt
|
||||||
/CPackConfig.cmake
|
/CPackConfig.cmake
|
||||||
/CPackSourceConfig.cmake
|
/CPackSourceConfig.cmake
|
||||||
/CTestTestfile.cmake
|
|
||||||
/install_manifest.txt
|
/install_manifest.txt
|
||||||
/Makefile
|
/arch.c
|
||||||
# windows build script
|
# windows build script
|
||||||
i2pd*.zip
|
i2pd*.zip
|
||||||
build*.log
|
build*.log
|
||||||
# MVS project files
|
|
||||||
*.vcxproj
|
|
||||||
*.vcxproj.filters
|
|
||||||
*.sln
|
|
||||||
|
|
|
@ -1,64 +1,47 @@
|
||||||
cmake_minimum_required(VERSION 3.7)
|
cmake_minimum_required(VERSION 3.7)
|
||||||
|
cmake_policy(VERSION 3.7)
|
||||||
if(${CMAKE_VERSION} VERSION_LESS 3.22)
|
project("i2pd")
|
||||||
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
|
|
||||||
else()
|
|
||||||
cmake_policy(VERSION 3.22)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# for debugging
|
# for debugging
|
||||||
#set(CMAKE_VERBOSE_MAKEFILE on)
|
#set(CMAKE_VERBOSE_MAKEFILE on)
|
||||||
|
|
||||||
# paths
|
# Win32 build with cmake is not supported
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
|
if(WIN32 OR MSVC OR MSYS OR MINGW)
|
||||||
set(CMAKE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
|
message(SEND_ERROR "cmake build for windows is not supported. Please use MSYS2 with makefiles in project root.")
|
||||||
|
endif()
|
||||||
set(LIBI2PD_SRC_DIR ${CMAKE_SOURCE_DIR}/libi2pd)
|
|
||||||
set(LIBI2PD_CLIENT_SRC_DIR ${CMAKE_SOURCE_DIR}/libi2pd_client)
|
|
||||||
set(LANG_SRC_DIR ${CMAKE_SOURCE_DIR}/i18n)
|
|
||||||
set(DAEMON_SRC_DIR ${CMAKE_SOURCE_DIR}/daemon)
|
|
||||||
|
|
||||||
include(Version)
|
|
||||||
set_version("${LIBI2PD_SRC_DIR}/version.h" PROJECT_VERSION)
|
|
||||||
|
|
||||||
project(
|
|
||||||
i2pd
|
|
||||||
VERSION ${PROJECT_VERSION}
|
|
||||||
HOMEPAGE_URL "https://i2pd.website/"
|
|
||||||
LANGUAGES C CXX
|
|
||||||
)
|
|
||||||
|
|
||||||
# configurable options
|
# configurable options
|
||||||
|
option(WITH_AESNI "Use AES-NI instructions set" ON)
|
||||||
option(WITH_HARDENING "Use hardening compiler flags" OFF)
|
option(WITH_HARDENING "Use hardening compiler flags" OFF)
|
||||||
option(WITH_LIBRARY "Build library" ON)
|
option(WITH_LIBRARY "Build library" ON)
|
||||||
option(WITH_BINARY "Build binary" ON)
|
option(WITH_BINARY "Build binary" ON)
|
||||||
option(WITH_STATIC "Static build" OFF)
|
option(WITH_STATIC "Static build" OFF)
|
||||||
option(WITH_UPNP "Include support for UPnP client" OFF)
|
option(WITH_UPNP "Include support for UPnP client" OFF)
|
||||||
option(WITH_GIT_VERSION "Use git commit info as version" OFF)
|
option(WITH_MESHNET "Build for cjdns test network" OFF)
|
||||||
option(WITH_ADDRSANITIZER "Build with address sanitizer unix only" OFF)
|
option(WITH_ADDRSANITIZER "Build with address sanitizer unix only" OFF)
|
||||||
option(WITH_THREADSANITIZER "Build with thread sanitizer unix only" OFF)
|
option(WITH_THREADSANITIZER "Build with thread sanitizer unix only" OFF)
|
||||||
option(BUILD_TESTING "Build tests" OFF)
|
|
||||||
|
|
||||||
IF(BUILD_TESTING)
|
# paths
|
||||||
enable_testing()
|
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
|
||||||
ENDIF()
|
set(CMAKE_SOURCE_DIR "..")
|
||||||
|
|
||||||
#Handle paths nicely
|
#Handle paths nicely
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
# Architecture
|
# architecture
|
||||||
include(TargetArch)
|
include(TargetArch)
|
||||||
target_architecture(ARCHITECTURE)
|
target_architecture(ARCHITECTURE)
|
||||||
|
|
||||||
include(CheckAtomic)
|
set(LIBI2PD_SRC_DIR ../libi2pd)
|
||||||
|
set(LIBI2PD_CLIENT_SRC_DIR ../libi2pd_client)
|
||||||
if(WITH_STATIC)
|
set(LANG_SRC_DIR ../i18n)
|
||||||
if(MSVC)
|
set(DAEMON_SRC_DIR ../daemon)
|
||||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include_directories(${LIBI2PD_SRC_DIR})
|
include_directories(${LIBI2PD_SRC_DIR})
|
||||||
|
include_directories(${LIBI2PD_CLIENT_SRC_DIR})
|
||||||
|
include_directories(${LANG_SRC_DIR})
|
||||||
|
include_directories(${DAEMON_SRC_DIR})
|
||||||
|
|
||||||
FILE(GLOB LIBI2PD_SRC ${LIBI2PD_SRC_DIR}/*.cpp)
|
FILE(GLOB LIBI2PD_SRC ${LIBI2PD_SRC_DIR}/*.cpp)
|
||||||
add_library(libi2pd ${LIBI2PD_SRC})
|
add_library(libi2pd ${LIBI2PD_SRC})
|
||||||
set_target_properties(libi2pd PROPERTIES PREFIX "")
|
set_target_properties(libi2pd PROPERTIES PREFIX "")
|
||||||
|
@ -69,9 +52,11 @@ if(WITH_LIBRARY)
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
COMPONENT Libraries)
|
COMPONENT Libraries)
|
||||||
|
# TODO Make libi2pd available to 3rd party projects via CMake as imported target
|
||||||
|
# FIXME This pulls stdafx
|
||||||
|
# install(EXPORT libi2pd DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include_directories(${LIBI2PD_CLIENT_SRC_DIR})
|
|
||||||
FILE(GLOB CLIENT_SRC ${LIBI2PD_CLIENT_SRC_DIR}/*.cpp)
|
FILE(GLOB CLIENT_SRC ${LIBI2PD_CLIENT_SRC_DIR}/*.cpp)
|
||||||
add_library(libi2pdclient ${CLIENT_SRC})
|
add_library(libi2pdclient ${CLIENT_SRC})
|
||||||
set_target_properties(libi2pdclient PROPERTIES PREFIX "")
|
set_target_properties(libi2pdclient PROPERTIES PREFIX "")
|
||||||
|
@ -84,7 +69,6 @@ if(WITH_LIBRARY)
|
||||||
COMPONENT Libraries)
|
COMPONENT Libraries)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include_directories(${LANG_SRC_DIR})
|
|
||||||
FILE(GLOB LANG_SRC ${LANG_SRC_DIR}/*.cpp)
|
FILE(GLOB LANG_SRC ${LANG_SRC_DIR}/*.cpp)
|
||||||
add_library(libi2pdlang ${LANG_SRC})
|
add_library(libi2pdlang ${LANG_SRC})
|
||||||
set_target_properties(libi2pdlang PROPERTIES PREFIX "")
|
set_target_properties(libi2pdlang PROPERTIES PREFIX "")
|
||||||
|
@ -97,64 +81,43 @@ if(WITH_LIBRARY)
|
||||||
COMPONENT Libraries)
|
COMPONENT Libraries)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include_directories(${DAEMON_SRC_DIR})
|
|
||||||
|
|
||||||
set(DAEMON_SRC
|
set(DAEMON_SRC
|
||||||
"${DAEMON_SRC_DIR}/Daemon.cpp"
|
"${DAEMON_SRC_DIR}/Daemon.cpp"
|
||||||
"${DAEMON_SRC_DIR}/HTTPServer.cpp"
|
"${DAEMON_SRC_DIR}/HTTPServer.cpp"
|
||||||
"${DAEMON_SRC_DIR}/I2PControl.cpp"
|
"${DAEMON_SRC_DIR}/I2PControl.cpp"
|
||||||
"${DAEMON_SRC_DIR}/I2PControlHandlers.cpp"
|
|
||||||
"${DAEMON_SRC_DIR}/i2pd.cpp"
|
"${DAEMON_SRC_DIR}/i2pd.cpp"
|
||||||
"${DAEMON_SRC_DIR}/UPnP.cpp"
|
"${DAEMON_SRC_DIR}/UPnP.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(WIN32)
|
if(WITH_MESHNET)
|
||||||
set(WIN32_SRC_DIR ${CMAKE_SOURCE_DIR}/Win32)
|
add_definitions(-DMESHNET)
|
||||||
include_directories(${WIN32_SRC_DIR})
|
|
||||||
|
|
||||||
list(APPEND DAEMON_SRC
|
|
||||||
"${WIN32_SRC_DIR}/DaemonWin32.cpp"
|
|
||||||
"${WIN32_SRC_DIR}/Win32App.cpp"
|
|
||||||
"${WIN32_SRC_DIR}/Win32Service.cpp"
|
|
||||||
"${WIN32_SRC_DIR}/Win32NetState.cpp"
|
|
||||||
)
|
|
||||||
|
|
||||||
file(GLOB WIN32_RC ${WIN32_SRC_DIR}/*.rc)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWIN32_APP -DWIN32_LEAN_AND_MEAN -DNOMINMAX")
|
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_UPNP)
|
if(WITH_UPNP)
|
||||||
add_definitions(-DUSE_UPNP)
|
add_definitions(-DUSE_UPNP)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_GIT_VERSION)
|
|
||||||
include(GetGitRevisionDescription)
|
|
||||||
git_describe(GIT_VERSION)
|
|
||||||
add_definitions(-DGITVER=${GIT_VERSION})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
add_definitions(-DMAC_OSX)
|
add_definitions(-DMAC_OSX)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(HAIKU)
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Winvalid-pch -Wno-unused-parameter")
|
||||||
add_definitions(-D_DEFAULT_SOURCE -D_GNU_SOURCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(MSVC)
|
|
||||||
add_definitions(-DWINVER=0x0600)
|
|
||||||
add_definitions(-D_WIN32_WINNT=0x0600)
|
|
||||||
else()
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Winvalid-pch -Wno-unused-parameter -Wno-uninitialized")
|
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pedantic")
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pedantic")
|
||||||
# TODO: The following is incompatible with static build and enabled hardening for OpenWRT.
|
# TODO: The following is incompatible with static build and enabled hardening for OpenWRT.
|
||||||
# Multiple definitions of __stack_chk_fail(libssp & libc)
|
# Multiple definitions of __stack_chk_fail(libssp & libc)
|
||||||
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -flto -s -ffunction-sections -fdata-sections")
|
||||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -flto -s")
|
|
||||||
endif()
|
|
||||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -ffunction-sections -fdata-sections")
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "-Wl,--gc-sections") # -flto is added from above
|
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "-Wl,--gc-sections") # -flto is added from above
|
||||||
|
|
||||||
|
# check for c++17 & c++11 support
|
||||||
|
include(CheckCXXCompilerFlag)
|
||||||
|
CHECK_CXX_COMPILER_FLAG("-std=c++17" CXX17_SUPPORTED)
|
||||||
|
CHECK_CXX_COMPILER_FLAG("-std=c++11" CXX11_SUPPORTED)
|
||||||
|
if(CXX17_SUPPORTED)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
|
||||||
|
elseif(CXX11_SUPPORTED)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
|
else()
|
||||||
|
message(SEND_ERROR "C++17 nor C++11 standard not seems to be supported by compiler. Too old version?")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
@ -184,6 +147,13 @@ if(UNIX)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Note: AES-NI and AVX is available on x86-based CPU's.
|
||||||
|
# Here also ARM64 implementation, but currently we don't support it.
|
||||||
|
if(WITH_AESNI AND (ARCHITECTURE MATCHES "x86_64" OR ARCHITECTURE MATCHES "i386"))
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes")
|
||||||
|
add_definitions(-D__AES__)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WITH_ADDRSANITIZER)
|
if(WITH_ADDRSANITIZER)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
||||||
|
@ -198,52 +168,27 @@ if(WITH_THREADSANITIZER)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0) # gcc 8-9
|
|
||||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "stdc++fs")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Use std::atomic instead of GCC builtins on macOS PowerPC:
|
|
||||||
# For more information refer to: https://github.com/PurpleI2P/i2pd/issues/1726#issuecomment-1306335111
|
|
||||||
# This has been fixed in Boost 1.81, nevertheless we retain the setting for the sake of compatibility.
|
|
||||||
if(APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
|
|
||||||
add_definitions(-DBOOST_SP_USE_STD_ATOMIC)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# libraries
|
# libraries
|
||||||
|
# TODO: once CMake 3.1+ becomes mainstream, see e.g. http://stackoverflow.com/a/29871891/673826
|
||||||
|
# use imported Threads::Threads instead
|
||||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||||
|
if(IOS)
|
||||||
|
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
|
||||||
|
set(CMAKE_HAVE_THREADS_LIBRARY 1)
|
||||||
|
set(CMAKE_USE_WIN32_THREADS_INIT 0)
|
||||||
|
set(CMAKE_USE_PTHREADS_INIT 1)
|
||||||
|
else()
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
|
endif()
|
||||||
|
if(THREADS_HAVE_PTHREAD_ARG) # compile time flag
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WITH_STATIC)
|
if(WITH_STATIC)
|
||||||
if(NOT MSVC)
|
|
||||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(Boost_USE_STATIC_LIBS ON)
|
set(Boost_USE_STATIC_LIBS ON)
|
||||||
if(MSVC)
|
|
||||||
set(Boost_USE_STATIC_RUNTIME ON)
|
set(Boost_USE_STATIC_RUNTIME ON)
|
||||||
else()
|
|
||||||
set(Boost_USE_STATIC_RUNTIME OFF)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(MSVC)
|
|
||||||
set(OPENSSL_MSVC_STATIC_RT ON)
|
|
||||||
endif()
|
|
||||||
set(OPENSSL_USE_STATIC_LIBS ON)
|
|
||||||
|
|
||||||
set(ZLIB_USE_STATIC_LIBS ON)
|
|
||||||
if(MSVC)
|
|
||||||
set(ZLIB_NAMES zlibstatic zlibstat)
|
|
||||||
else()
|
|
||||||
set(ZLIB_NAMES libz zlibstatic zlibstat zlib z)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WITH_UPNP)
|
|
||||||
set(MINIUPNPC_USE_STATIC_LIBS ON)
|
|
||||||
add_definitions(-DMINIUPNP_STATICLIB)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(BUILD_SHARED_LIBS OFF)
|
set(BUILD_SHARED_LIBS OFF)
|
||||||
|
|
||||||
if(${CMAKE_CXX_COMPILER} MATCHES ".*-openwrt-.*")
|
if(${CMAKE_CXX_COMPILER} MATCHES ".*-openwrt-.*")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
||||||
# set(CMAKE_THREAD_LIBS_INIT "gcc_eh -Wl,--whole-archive -lpthread -Wl,--no-whole-archive")
|
# set(CMAKE_THREAD_LIBS_INIT "gcc_eh -Wl,--whole-archive -lpthread -Wl,--no-whole-archive")
|
||||||
|
@ -253,28 +198,24 @@ else()
|
||||||
# TODO: Consider separate compilation for LIBI2PD_SRC for library.
|
# TODO: Consider separate compilation for LIBI2PD_SRC for library.
|
||||||
# No need in -fPIC overhead for binary if not interested in library
|
# No need in -fPIC overhead for binary if not interested in library
|
||||||
# HINT: revert c266cff CMakeLists.txt: compilation speed up
|
# HINT: revert c266cff CMakeLists.txt: compilation speed up
|
||||||
if(NOT MSVC)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
|
||||||
endif()
|
add_definitions(-DBOOST_SYSTEM_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_DATE_TIME_DYN_LINK -DBOOST_REGEX_DYN_LINK)
|
||||||
add_definitions(-DBOOST_ATOMIC_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK)
|
|
||||||
if(WIN32)
|
|
||||||
set(Boost_USE_STATIC_LIBS OFF)
|
|
||||||
set(Boost_USE_STATIC_RUNTIME OFF)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Boost REQUIRED COMPONENTS system filesystem program_options)
|
target_link_libraries(libi2pdclient libi2pd libi2pdlang)
|
||||||
if(NOT DEFINED Boost_FOUND)
|
|
||||||
|
find_package(Boost COMPONENTS system filesystem program_options date_time REQUIRED)
|
||||||
|
if(NOT DEFINED Boost_INCLUDE_DIRS)
|
||||||
message(SEND_ERROR "Boost is not found, or your boost version was below 1.46. Please download Boost!")
|
message(SEND_ERROR "Boost is not found, or your boost version was below 1.46. Please download Boost!")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(OpenSSL REQUIRED)
|
find_package(OpenSSL REQUIRED)
|
||||||
if(NOT DEFINED OPENSSL_FOUND)
|
if(NOT DEFINED OPENSSL_INCLUDE_DIR)
|
||||||
message(SEND_ERROR "Could not find OpenSSL. Please download and install it first!")
|
message(SEND_ERROR "Could not find OpenSSL. Please download and install it first!")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(OPENSSL_VERSION VERSION_GREATER_EQUAL "3.0.0")
|
if(OPENSSL_VERSION VERSION_GREATER_EQUAL "3.0.0")
|
||||||
add_definitions(-DOPENSSL_SUPPRESS_DEPRECATED)
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_UPNP)
|
if(WITH_UPNP)
|
||||||
|
@ -291,29 +232,17 @@ if(ZLIB_FOUND)
|
||||||
link_directories(${ZLIB_ROOT}/lib)
|
link_directories(${ZLIB_ROOT}/lib)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# C++ standard to use, based on compiler and version of boost
|
|
||||||
if(NOT MSVC)
|
|
||||||
# check for c++20 & c++17 support
|
|
||||||
include(CheckCXXCompilerFlag)
|
|
||||||
|
|
||||||
if(Boost_VERSION VERSION_GREATER_EQUAL "1.83") # min boost version for c++20
|
|
||||||
CHECK_CXX_COMPILER_FLAG("-std=c++20" CXX20_SUPPORTED)
|
|
||||||
endif()
|
|
||||||
CHECK_CXX_COMPILER_FLAG("-std=c++17" CXX17_SUPPORTED)
|
|
||||||
|
|
||||||
|
|
||||||
if(CXX20_SUPPORTED)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20")
|
|
||||||
elseif(CXX17_SUPPORTED)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
|
|
||||||
else()
|
|
||||||
message(SEND_ERROR "C++20 nor C++17 standard not seems to be supported by compiler. Too old version?")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# load includes
|
# load includes
|
||||||
include_directories(SYSTEM ${Boost_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
|
include_directories(SYSTEM ${Boost_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
|
||||||
|
|
||||||
|
# warn if for meshnet
|
||||||
|
if(WITH_MESHNET)
|
||||||
|
message(STATUS "Building for testnet")
|
||||||
|
message(WARNING "This build will NOT work on mainline i2p")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(CheckAtomic)
|
||||||
|
|
||||||
# show summary
|
# show summary
|
||||||
message(STATUS "---------------------------------------")
|
message(STATUS "---------------------------------------")
|
||||||
message(STATUS "Build type : ${CMAKE_BUILD_TYPE}")
|
message(STATUS "Build type : ${CMAKE_BUILD_TYPE}")
|
||||||
|
@ -321,72 +250,53 @@ message(STATUS "Compiler vendor : ${CMAKE_CXX_COMPILER_ID}")
|
||||||
message(STATUS "Compiler version : ${CMAKE_CXX_COMPILER_VERSION}")
|
message(STATUS "Compiler version : ${CMAKE_CXX_COMPILER_VERSION}")
|
||||||
message(STATUS "Compiler path : ${CMAKE_CXX_COMPILER}")
|
message(STATUS "Compiler path : ${CMAKE_CXX_COMPILER}")
|
||||||
message(STATUS "Architecture : ${ARCHITECTURE}")
|
message(STATUS "Architecture : ${ARCHITECTURE}")
|
||||||
message(STATUS "Compiler flags : ${CMAKE_CXX_FLAGS}")
|
|
||||||
message(STATUS "Install prefix: : ${CMAKE_INSTALL_PREFIX}")
|
message(STATUS "Install prefix: : ${CMAKE_INSTALL_PREFIX}")
|
||||||
message(STATUS "Options:")
|
message(STATUS "Options:")
|
||||||
|
message(STATUS " AESNI : ${WITH_AESNI}")
|
||||||
message(STATUS " HARDENING : ${WITH_HARDENING}")
|
message(STATUS " HARDENING : ${WITH_HARDENING}")
|
||||||
message(STATUS " LIBRARY : ${WITH_LIBRARY}")
|
message(STATUS " LIBRARY : ${WITH_LIBRARY}")
|
||||||
message(STATUS " BINARY : ${WITH_BINARY}")
|
message(STATUS " BINARY : ${WITH_BINARY}")
|
||||||
message(STATUS " STATIC BUILD : ${WITH_STATIC}")
|
message(STATUS " STATIC BUILD : ${WITH_STATIC}")
|
||||||
message(STATUS " UPnP : ${WITH_UPNP}")
|
message(STATUS " UPnP : ${WITH_UPNP}")
|
||||||
if(WITH_GIT_VERSION)
|
message(STATUS " MESHNET : ${WITH_MESHNET}")
|
||||||
message(STATUS " GIT VERSION : ${WITH_GIT_VERSION} (${GIT_VERSION})")
|
|
||||||
else()
|
|
||||||
message(STATUS " GIT VERSION : ${WITH_GIT_VERSION}")
|
|
||||||
endif()
|
|
||||||
message(STATUS " ADDRSANITIZER : ${WITH_ADDRSANITIZER}")
|
message(STATUS " ADDRSANITIZER : ${WITH_ADDRSANITIZER}")
|
||||||
message(STATUS " THREADSANITIZER : ${WITH_THREADSANITIZER}")
|
message(STATUS " THREADSANITIZER : ${WITH_THREADSANITIZER}")
|
||||||
message(STATUS "---------------------------------------")
|
message(STATUS "---------------------------------------")
|
||||||
|
|
||||||
if(WITH_BINARY)
|
if(WITH_MESHNET)
|
||||||
if(WIN32)
|
message(STATUS "WARNING: Using the MESHNET option will make it impossible to use the application with the main network!!!")
|
||||||
add_executable("${PROJECT_NAME}" WIN32 ${DAEMON_SRC} ${WIN32_RC})
|
|
||||||
else()
|
|
||||||
add_executable("${PROJECT_NAME}" ${DAEMON_SRC})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WITH_BINARY)
|
||||||
list(APPEND MINGW_EXTRA "wsock32" "ws2_32" "iphlpapi")
|
add_executable("${PROJECT_NAME}" ${DAEMON_SRC})
|
||||||
# OpenSSL may require Crypt32 library on MSVC build, which is not added by CMake lesser than 3.21
|
|
||||||
if(MSVC AND ${CMAKE_VERSION} VERSION_LESS 3.21)
|
|
||||||
list(APPEND MINGW_EXTRA "crypt32")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WITH_STATIC)
|
if(WITH_STATIC)
|
||||||
if(NOT MSVC)
|
|
||||||
set_target_properties("${PROJECT_NAME}" PROPERTIES LINK_FLAGS "-static")
|
set_target_properties("${PROJECT_NAME}" PROPERTIES LINK_FLAGS "-static")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WITH_HARDENING AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
if(WITH_HARDENING AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
set_target_properties("${PROJECT_NAME}" PROPERTIES LINK_FLAGS "-z relro -z now")
|
set_target_properties("${PROJECT_NAME}" PROPERTIES LINK_FLAGS "-z relro -z now")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WITH_UPNP)
|
||||||
|
set(UPNP_LIB ${MINIUPNPC_LIBRARY})
|
||||||
|
endif()
|
||||||
|
|
||||||
# FindBoost pulls pthread for thread which is broken for static linking at least on Ubuntu 15.04
|
# FindBoost pulls pthread for thread which is broken for static linking at least on Ubuntu 15.04
|
||||||
list(GET Boost_LIBRARIES -1 LAST_Boost_LIBRARIES)
|
list(GET Boost_LIBRARIES -1 LAST_Boost_LIBRARIES)
|
||||||
if(${LAST_Boost_LIBRARIES} MATCHES ".*pthread.*")
|
if(${LAST_Boost_LIBRARIES} MATCHES ".*pthread.*")
|
||||||
list(REMOVE_AT Boost_LIBRARIES -1)
|
list(REMOVE_AT Boost_LIBRARIES -1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# synchronization library is incompatible with Windows 7
|
|
||||||
if(WIN32)
|
|
||||||
get_target_property(BOOSTFSLIBS Boost::filesystem INTERFACE_LINK_LIBRARIES)
|
|
||||||
list(REMOVE_ITEM BOOSTFSLIBS synchronization)
|
|
||||||
set_target_properties(Boost::filesystem PROPERTIES INTERFACE_LINK_LIBRARIES "${BOOSTFSLIBS}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WITH_STATIC)
|
if(WITH_STATIC)
|
||||||
set(DL_LIB ${CMAKE_DL_LIBS})
|
set(DL_LIB ${CMAKE_DL_LIBS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries("${PROJECT_NAME}" libi2pd libi2pdclient libi2pdlang ${Boost_LIBRARIES} OpenSSL::SSL OpenSSL::Crypto ${MINIUPNPC_LIBRARY} ZLIB::ZLIB Threads::Threads ${MINGW_EXTRA} ${DL_LIB} ${CMAKE_REQUIRED_LIBRARIES})
|
target_link_libraries(libi2pd ${Boost_LIBRARIES} ${ZLIB_LIBRARY})
|
||||||
|
target_link_libraries("${PROJECT_NAME}" libi2pd libi2pdclient libi2pdlang ${DL_LIB} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${UPNP_LIB} ${ZLIB_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${DL_LIB} ${CMAKE_REQUIRED_LIBRARIES})
|
||||||
|
|
||||||
install(TARGETS "${PROJECT_NAME}" RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime)
|
install(TARGETS "${PROJECT_NAME}" RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime)
|
||||||
set(APPS "\${CMAKE_INSTALL_PREFIX}/bin/${PROJECT_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
|
set(APPS "\${CMAKE_INSTALL_PREFIX}/bin/${PROJECT_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
|
||||||
set(DIRS "${Boost_LIBRARY_DIR};${OPENSSL_INCLUDE_DIR}/../bin;${ZLIB_INCLUDE_DIR}/../bin;/mingw32/bin")
|
set(DIRS "${Boost_LIBRARY_DIR};${OPENSSL_INCLUDE_DIR}/../bin;${ZLIB_INCLUDE_DIR}/../bin;/mingw32/bin")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
|
||||||
add_subdirectory(${CMAKE_SOURCE_DIR}/tests ${CMAKE_CURRENT_BINARY_DIR}/tests)
|
|
||||||
endif()
|
|
||||||
|
|
|
@ -52,8 +52,9 @@ REM converting configuration files to DOS format (make usable in Windows Notepad
|
||||||
%xSH% "unix2dos contrib/i2pd.conf contrib/tunnels.conf contrib/tunnels.d/* contrib/webconsole/style.css" >> build\build.log 2>&1
|
%xSH% "unix2dos contrib/i2pd.conf contrib/tunnels.conf contrib/tunnels.d/* contrib/webconsole/style.css" >> build\build.log 2>&1
|
||||||
|
|
||||||
REM Prepare binary signing command if signing key and password provided
|
REM Prepare binary signing command if signing key and password provided
|
||||||
if defined SIGN (
|
if defined SIGNKEY (
|
||||||
echo Signing enabled
|
if defined SIGNPASS (
|
||||||
|
echo Signing options found
|
||||||
|
|
||||||
for %%X in (signtool.exe) do (set xSIGNTOOL=%%~$PATH:X)
|
for %%X in (signtool.exe) do (set xSIGNTOOL=%%~$PATH:X)
|
||||||
if not defined xSIGNTOOL (
|
if not defined xSIGNTOOL (
|
||||||
|
@ -65,15 +66,8 @@ if defined SIGN (
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined SIGNKEY (
|
set "xSIGNOPTS=sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /f ^"%SIGNKEY%^" /p ^"%SIGNPASS%^""
|
||||||
set "xSIGNKEYOPTS=/f ^"%SIGNKEY%^""
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined SIGNPASS (
|
|
||||||
set "xSIGNPASSOPTS=/p ^"%SIGNPASS%^""
|
|
||||||
)
|
|
||||||
|
|
||||||
set "xSIGNOPTS=sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 %xSIGNKEYOPTS% %xSIGNPASSOPTS%"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
REM starting building
|
REM starting building
|
||||||
|
|
|
@ -1,23 +1,18 @@
|
||||||
# atomic builtins are required for threading support.
|
# atomic builtins are required for threading support.
|
||||||
|
|
||||||
INCLUDE(CheckCXXSourceCompiles)
|
INCLUDE(CheckCXXSourceCompiles)
|
||||||
INCLUDE(CheckLibraryExists)
|
|
||||||
|
|
||||||
# Sometimes linking against libatomic is required for atomic ops, if
|
# Sometimes linking against libatomic is required for atomic ops, if
|
||||||
# the platform doesn't support lock-free atomics.
|
# the platform doesn't support lock-free atomics.
|
||||||
|
|
||||||
function(check_working_cxx_atomics varname)
|
function(check_working_cxx_atomics varname)
|
||||||
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
||||||
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++17")
|
set(CMAKE_REQUIRED_FLAGS "-std=c++11")
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
std::atomic<int> x;
|
std::atomic<int> x;
|
||||||
std::atomic<short> y;
|
|
||||||
std::atomic<char> z;
|
|
||||||
int main() {
|
int main() {
|
||||||
++z;
|
return x;
|
||||||
++y;
|
|
||||||
return ++x;
|
|
||||||
}
|
}
|
||||||
" ${varname})
|
" ${varname})
|
||||||
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
|
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
|
||||||
|
@ -25,14 +20,13 @@ endfunction(check_working_cxx_atomics)
|
||||||
|
|
||||||
function(check_working_cxx_atomics64 varname)
|
function(check_working_cxx_atomics64 varname)
|
||||||
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
||||||
set(CMAKE_REQUIRED_FLAGS "-std=c++17 ${CMAKE_REQUIRED_FLAGS}")
|
set(CMAKE_REQUIRED_FLAGS "-std=c++11 ${CMAKE_REQUIRED_FLAGS}")
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
std::atomic<uint64_t> x (0);
|
std::atomic<uint64_t> x (0);
|
||||||
int main() {
|
int main() {
|
||||||
uint64_t i = x.load(std::memory_order_relaxed);
|
uint64_t i = x.load(std::memory_order_relaxed);
|
||||||
(void)i;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
" ${varname})
|
" ${varname})
|
||||||
|
@ -40,10 +34,9 @@ int main() {
|
||||||
endfunction(check_working_cxx_atomics64)
|
endfunction(check_working_cxx_atomics64)
|
||||||
|
|
||||||
|
|
||||||
# Check for (non-64-bit) atomic operations.
|
# This isn't necessary on MSVC, so avoid command-line switch annoyance
|
||||||
if(MSVC)
|
# by only running on GCC-like hosts.
|
||||||
set(HAVE_CXX_ATOMICS_WITHOUT_LIB True)
|
if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
|
||||||
else()
|
|
||||||
# First check if atomics work without the library.
|
# First check if atomics work without the library.
|
||||||
check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITHOUT_LIB)
|
check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITHOUT_LIB)
|
||||||
# If not, check if the library exists, and atomics work with it.
|
# If not, check if the library exists, and atomics work with it.
|
||||||
|
@ -65,8 +58,9 @@ endif()
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set(HAVE_CXX_ATOMICS64_WITHOUT_LIB True)
|
set(HAVE_CXX_ATOMICS64_WITHOUT_LIB True)
|
||||||
else()
|
else()
|
||||||
# First check if atomics work without the library.
|
|
||||||
check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITHOUT_LIB)
|
check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITHOUT_LIB)
|
||||||
|
endif()
|
||||||
|
|
||||||
# If not, check if the library exists, and atomics work with it.
|
# If not, check if the library exists, and atomics work with it.
|
||||||
if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
|
if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
|
||||||
check_library_exists(atomic __atomic_load_8 "" HAVE_CXX_LIBATOMICS64)
|
check_library_exists(atomic __atomic_load_8 "" HAVE_CXX_LIBATOMICS64)
|
||||||
|
@ -74,11 +68,10 @@ else()
|
||||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
|
list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
|
||||||
check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITH_LIB)
|
check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITH_LIB)
|
||||||
if (NOT HAVE_CXX_ATOMICS64_WITH_LIB)
|
if (NOT HAVE_CXX_ATOMICS64_WITH_LIB)
|
||||||
message(FATAL_ERROR "Host compiler must support 64-bit std::atomic!")
|
message(FATAL_ERROR "Host compiler must support std::atomic!")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Host compiler appears to require libatomic for 64-bit operations, but cannot find it.")
|
message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.")
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -87,6 +80,7 @@ endif()
|
||||||
## assumes C++11 <atomic> works.
|
## assumes C++11 <atomic> works.
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
#include <Intrin.h> /* Workaround for PR19898. */
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
int main() {
|
int main() {
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
# - Try to find the CHECK libraries
|
|
||||||
# Once done this will define
|
|
||||||
#
|
|
||||||
# CHECK_FOUND - system has check
|
|
||||||
# CHECK_INCLUDE_DIRS - the check include directory
|
|
||||||
# CHECK_LIBRARIES - check library
|
|
||||||
#
|
|
||||||
# Copyright (c) 2007 Daniel Gollub <gollub@b1-systems.de>
|
|
||||||
# Copyright (c) 2007-2009 Bjoern Ricks <bjoern.ricks@gmail.com>
|
|
||||||
#
|
|
||||||
# Redistribution and use is allowed according to the terms of the New
|
|
||||||
# BSD license.
|
|
||||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
||||||
|
|
||||||
|
|
||||||
INCLUDE( FindPkgConfig )
|
|
||||||
|
|
||||||
IF ( Check_FIND_REQUIRED )
|
|
||||||
SET( _pkgconfig_REQUIRED "REQUIRED" )
|
|
||||||
ELSE( Check_FIND_REQUIRED )
|
|
||||||
SET( _pkgconfig_REQUIRED "" )
|
|
||||||
ENDIF ( Check_FIND_REQUIRED )
|
|
||||||
|
|
||||||
IF ( CHECK_MIN_VERSION )
|
|
||||||
PKG_SEARCH_MODULE( CHECK ${_pkgconfig_REQUIRED} check>=${CHECK_MIN_VERSION} )
|
|
||||||
ELSE ( CHECK_MIN_VERSION )
|
|
||||||
PKG_SEARCH_MODULE( CHECK ${_pkgconfig_REQUIRED} check )
|
|
||||||
ENDIF ( CHECK_MIN_VERSION )
|
|
||||||
|
|
||||||
# Look for CHECK include dir and libraries
|
|
||||||
IF( NOT CHECK_FOUND AND NOT PKG_CONFIG_FOUND )
|
|
||||||
|
|
||||||
FIND_PATH( CHECK_INCLUDE_DIRS check.h )
|
|
||||||
|
|
||||||
FIND_LIBRARY( CHECK_LIBRARIES NAMES check )
|
|
||||||
|
|
||||||
IF ( CHECK_INCLUDE_DIRS AND CHECK_LIBRARIES )
|
|
||||||
SET( CHECK_FOUND 1 )
|
|
||||||
IF ( NOT Check_FIND_QUIETLY )
|
|
||||||
MESSAGE ( STATUS "Found CHECK: ${CHECK_LIBRARIES}" )
|
|
||||||
ENDIF ( NOT Check_FIND_QUIETLY )
|
|
||||||
ELSE ( CHECK_INCLUDE_DIRS AND CHECK_LIBRARIES )
|
|
||||||
IF ( Check_FIND_REQUIRED )
|
|
||||||
MESSAGE( FATAL_ERROR "Could NOT find CHECK" )
|
|
||||||
ELSE ( Check_FIND_REQUIRED )
|
|
||||||
IF ( NOT Check_FIND_QUIETLY )
|
|
||||||
MESSAGE( STATUS "Could NOT find CHECK" )
|
|
||||||
ENDIF ( NOT Check_FIND_QUIETLY )
|
|
||||||
ENDIF ( Check_FIND_REQUIRED )
|
|
||||||
ENDIF ( CHECK_INCLUDE_DIRS AND CHECK_LIBRARIES )
|
|
||||||
ENDIF( NOT CHECK_FOUND AND NOT PKG_CONFIG_FOUND )
|
|
||||||
|
|
||||||
# Hide advanced variables from CMake GUIs
|
|
||||||
MARK_AS_ADVANCED( CHECK_INCLUDE_DIRS CHECK_LIBRARIES )
|
|
||||||
|
|
|
@ -1,284 +0,0 @@
|
||||||
# - Returns a version string from Git
|
|
||||||
#
|
|
||||||
# These functions force a re-configure on each git commit so that you can
|
|
||||||
# trust the values of the variables in your build system.
|
|
||||||
#
|
|
||||||
# get_git_head_revision(<refspecvar> <hashvar> [ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR])
|
|
||||||
#
|
|
||||||
# Returns the refspec and sha hash of the current head revision
|
|
||||||
#
|
|
||||||
# git_describe(<var> [<additional arguments to git describe> ...])
|
|
||||||
#
|
|
||||||
# Returns the results of git describe on the source tree, and adjusting
|
|
||||||
# the output so that it tests false if an error occurs.
|
|
||||||
#
|
|
||||||
# git_describe_working_tree(<var> [<additional arguments to git describe> ...])
|
|
||||||
#
|
|
||||||
# Returns the results of git describe on the working tree (--dirty option),
|
|
||||||
# and adjusting the output so that it tests false if an error occurs.
|
|
||||||
#
|
|
||||||
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
|
|
||||||
#
|
|
||||||
# Returns the results of git describe --exact-match on the source tree,
|
|
||||||
# and adjusting the output so that it tests false if there was no exact
|
|
||||||
# matching tag.
|
|
||||||
#
|
|
||||||
# git_local_changes(<var>)
|
|
||||||
#
|
|
||||||
# Returns either "CLEAN" or "DIRTY" with respect to uncommitted changes.
|
|
||||||
# Uses the return code of "git diff-index --quiet HEAD --".
|
|
||||||
# Does not regard untracked files.
|
|
||||||
#
|
|
||||||
# Requires CMake 2.6 or newer (uses the 'function' command)
|
|
||||||
#
|
|
||||||
# Original Author:
|
|
||||||
# 2009-2020 Ryan Pavlik <ryan.pavlik@gmail.com> <abiryan@ryand.net>
|
|
||||||
# http://academic.cleardefinition.com
|
|
||||||
#
|
|
||||||
# Copyright 2009-2013, Iowa State University.
|
|
||||||
# Copyright 2013-2020, Ryan Pavlik
|
|
||||||
# Copyright 2013-2020, Contributors
|
|
||||||
# SPDX-License-Identifier: BSL-1.0
|
|
||||||
# Distributed under the Boost Software License, Version 1.0.
|
|
||||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
# http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
if(__get_git_revision_description)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
set(__get_git_revision_description YES)
|
|
||||||
|
|
||||||
# We must run the following at "include" time, not at function call time,
|
|
||||||
# to find the path to this module rather than the path to a calling list file
|
|
||||||
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
|
|
||||||
|
|
||||||
# Function _git_find_closest_git_dir finds the next closest .git directory
|
|
||||||
# that is part of any directory in the path defined by _start_dir.
|
|
||||||
# The result is returned in the parent scope variable whose name is passed
|
|
||||||
# as variable _git_dir_var. If no .git directory can be found, the
|
|
||||||
# function returns an empty string via _git_dir_var.
|
|
||||||
#
|
|
||||||
# Example: Given a path C:/bla/foo/bar and assuming C:/bla/.git exists and
|
|
||||||
# neither foo nor bar contain a file/directory .git. This will return
|
|
||||||
# C:/bla/.git
|
|
||||||
#
|
|
||||||
function(_git_find_closest_git_dir _start_dir _git_dir_var)
|
|
||||||
set(cur_dir "${_start_dir}")
|
|
||||||
set(git_dir "${_start_dir}/.git")
|
|
||||||
while(NOT EXISTS "${git_dir}")
|
|
||||||
# .git dir not found, search parent directories
|
|
||||||
set(git_previous_parent "${cur_dir}")
|
|
||||||
get_filename_component(cur_dir "${cur_dir}" DIRECTORY)
|
|
||||||
if(cur_dir STREQUAL git_previous_parent)
|
|
||||||
# We have reached the root directory, we are not in git
|
|
||||||
set(${_git_dir_var}
|
|
||||||
""
|
|
||||||
PARENT_SCOPE)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
set(git_dir "${cur_dir}/.git")
|
|
||||||
endwhile()
|
|
||||||
set(${_git_dir_var}
|
|
||||||
"${git_dir}"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(get_git_head_revision _refspecvar _hashvar)
|
|
||||||
_git_find_closest_git_dir("${CMAKE_CURRENT_SOURCE_DIR}" GIT_DIR)
|
|
||||||
|
|
||||||
if("${ARGN}" STREQUAL "ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR")
|
|
||||||
set(ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR TRUE)
|
|
||||||
else()
|
|
||||||
set(ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR FALSE)
|
|
||||||
endif()
|
|
||||||
if(NOT "${GIT_DIR}" STREQUAL "")
|
|
||||||
file(RELATIVE_PATH _relative_to_source_dir "${CMAKE_SOURCE_DIR}"
|
|
||||||
"${GIT_DIR}")
|
|
||||||
if("${_relative_to_source_dir}" MATCHES "[.][.]" AND NOT ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR)
|
|
||||||
# We've gone above the CMake root dir.
|
|
||||||
set(GIT_DIR "")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if("${GIT_DIR}" STREQUAL "")
|
|
||||||
set(${_refspecvar}
|
|
||||||
"GITDIR-NOTFOUND"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
set(${_hashvar}
|
|
||||||
"GITDIR-NOTFOUND"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Check if the current source dir is a git submodule or a worktree.
|
|
||||||
# In both cases .git is a file instead of a directory.
|
|
||||||
#
|
|
||||||
if(NOT IS_DIRECTORY ${GIT_DIR})
|
|
||||||
# The following git command will return a non empty string that
|
|
||||||
# points to the super project working tree if the current
|
|
||||||
# source dir is inside a git submodule.
|
|
||||||
# Otherwise the command will return an empty string.
|
|
||||||
#
|
|
||||||
execute_process(
|
|
||||||
COMMAND "${GIT_EXECUTABLE}" rev-parse
|
|
||||||
--show-superproject-working-tree
|
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
||||||
OUTPUT_VARIABLE out
|
|
||||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
||||||
if(NOT "${out}" STREQUAL "")
|
|
||||||
# If out is empty, GIT_DIR/CMAKE_CURRENT_SOURCE_DIR is in a submodule
|
|
||||||
file(READ ${GIT_DIR} submodule)
|
|
||||||
string(REGEX REPLACE "gitdir: (.*)$" "\\1" GIT_DIR_RELATIVE
|
|
||||||
${submodule})
|
|
||||||
string(STRIP ${GIT_DIR_RELATIVE} GIT_DIR_RELATIVE)
|
|
||||||
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
|
|
||||||
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE}
|
|
||||||
ABSOLUTE)
|
|
||||||
set(HEAD_SOURCE_FILE "${GIT_DIR}/HEAD")
|
|
||||||
else()
|
|
||||||
# GIT_DIR/CMAKE_CURRENT_SOURCE_DIR is in a worktree
|
|
||||||
file(READ ${GIT_DIR} worktree_ref)
|
|
||||||
# The .git directory contains a path to the worktree information directory
|
|
||||||
# inside the parent git repo of the worktree.
|
|
||||||
#
|
|
||||||
string(REGEX REPLACE "gitdir: (.*)$" "\\1" git_worktree_dir
|
|
||||||
${worktree_ref})
|
|
||||||
string(STRIP ${git_worktree_dir} git_worktree_dir)
|
|
||||||
_git_find_closest_git_dir("${git_worktree_dir}" GIT_DIR)
|
|
||||||
set(HEAD_SOURCE_FILE "${git_worktree_dir}/HEAD")
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
set(HEAD_SOURCE_FILE "${GIT_DIR}/HEAD")
|
|
||||||
endif()
|
|
||||||
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
|
|
||||||
if(NOT EXISTS "${GIT_DATA}")
|
|
||||||
file(MAKE_DIRECTORY "${GIT_DATA}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT EXISTS "${HEAD_SOURCE_FILE}")
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
set(HEAD_FILE "${GIT_DATA}/HEAD")
|
|
||||||
configure_file("${HEAD_SOURCE_FILE}" "${HEAD_FILE}" COPYONLY)
|
|
||||||
|
|
||||||
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
|
|
||||||
"${GIT_DATA}/grabRef.cmake" @ONLY)
|
|
||||||
include("${GIT_DATA}/grabRef.cmake")
|
|
||||||
|
|
||||||
set(${_refspecvar}
|
|
||||||
"${HEAD_REF}"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
set(${_hashvar}
|
|
||||||
"${HEAD_HASH}"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(git_describe _var)
|
|
||||||
if(NOT GIT_FOUND)
|
|
||||||
find_package(Git QUIET)
|
|
||||||
endif()
|
|
||||||
get_git_head_revision(refspec hash)
|
|
||||||
if(NOT GIT_FOUND)
|
|
||||||
set(${_var}
|
|
||||||
"GIT-NOTFOUND"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
if(NOT hash)
|
|
||||||
set(${_var}
|
|
||||||
"HEAD-HASH-NOTFOUND"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# TODO sanitize
|
|
||||||
#if((${ARGN}" MATCHES "&&") OR
|
|
||||||
# (ARGN MATCHES "||") OR
|
|
||||||
# (ARGN MATCHES "\\;"))
|
|
||||||
# message("Please report the following error to the project!")
|
|
||||||
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
|
|
||||||
#endif()
|
|
||||||
|
|
||||||
#message(STATUS "Arguments to execute_process: ${ARGN}")
|
|
||||||
|
|
||||||
execute_process(
|
|
||||||
COMMAND "${GIT_EXECUTABLE}" describe --tags --always ${hash} ${ARGN}
|
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
||||||
RESULT_VARIABLE res
|
|
||||||
OUTPUT_VARIABLE out
|
|
||||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
||||||
if(NOT res EQUAL 0)
|
|
||||||
set(out "${out}-${res}-NOTFOUND")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(${_var}
|
|
||||||
"${out}"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(git_describe_working_tree _var)
|
|
||||||
if(NOT GIT_FOUND)
|
|
||||||
find_package(Git QUIET)
|
|
||||||
endif()
|
|
||||||
if(NOT GIT_FOUND)
|
|
||||||
set(${_var}
|
|
||||||
"GIT-NOTFOUND"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
execute_process(
|
|
||||||
COMMAND "${GIT_EXECUTABLE}" describe --dirty ${ARGN}
|
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
||||||
RESULT_VARIABLE res
|
|
||||||
OUTPUT_VARIABLE out
|
|
||||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
||||||
if(NOT res EQUAL 0)
|
|
||||||
set(out "${out}-${res}-NOTFOUND")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(${_var}
|
|
||||||
"${out}"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(git_get_exact_tag _var)
|
|
||||||
git_describe(out --exact-match ${ARGN})
|
|
||||||
set(${_var}
|
|
||||||
"${out}"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(git_local_changes _var)
|
|
||||||
if(NOT GIT_FOUND)
|
|
||||||
find_package(Git QUIET)
|
|
||||||
endif()
|
|
||||||
get_git_head_revision(refspec hash)
|
|
||||||
if(NOT GIT_FOUND)
|
|
||||||
set(${_var}
|
|
||||||
"GIT-NOTFOUND"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
if(NOT hash)
|
|
||||||
set(${_var}
|
|
||||||
"HEAD-HASH-NOTFOUND"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
execute_process(
|
|
||||||
COMMAND "${GIT_EXECUTABLE}" diff-index --quiet HEAD --
|
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
||||||
RESULT_VARIABLE res
|
|
||||||
OUTPUT_VARIABLE out
|
|
||||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
||||||
if(res EQUAL 0)
|
|
||||||
set(${_var}
|
|
||||||
"CLEAN"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
else()
|
|
||||||
set(${_var}
|
|
||||||
"DIRTY"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
|
@ -1,43 +0,0 @@
|
||||||
#
|
|
||||||
# Internal file for GetGitRevisionDescription.cmake
|
|
||||||
#
|
|
||||||
# Requires CMake 2.6 or newer (uses the 'function' command)
|
|
||||||
#
|
|
||||||
# Original Author:
|
|
||||||
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
|
||||||
# http://academic.cleardefinition.com
|
|
||||||
# Iowa State University HCI Graduate Program/VRAC
|
|
||||||
#
|
|
||||||
# Copyright 2009-2012, Iowa State University
|
|
||||||
# Copyright 2011-2015, Contributors
|
|
||||||
# Distributed under the Boost Software License, Version 1.0.
|
|
||||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
# http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
# SPDX-License-Identifier: BSL-1.0
|
|
||||||
|
|
||||||
set(HEAD_HASH)
|
|
||||||
|
|
||||||
file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
|
|
||||||
|
|
||||||
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
|
|
||||||
if(HEAD_CONTENTS MATCHES "ref")
|
|
||||||
# named branch
|
|
||||||
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
|
|
||||||
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
|
|
||||||
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
|
||||||
else()
|
|
||||||
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
|
|
||||||
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
|
|
||||||
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
|
|
||||||
set(HEAD_HASH "${CMAKE_MATCH_1}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
# detached HEAD
|
|
||||||
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT HEAD_HASH)
|
|
||||||
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
|
|
||||||
string(STRIP "${HEAD_HASH}" HEAD_HASH)
|
|
||||||
endif()
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (c) 2017-2023, The PurpleI2P Project
|
# Copyright (c) 2017-2022, The PurpleI2P Project
|
||||||
# This file is part of Purple i2pd project and licensed under BSD3
|
# This file is part of Purple i2pd project and licensed under BSD3
|
||||||
# See full license text in LICENSE file at top of project tree
|
# See full license text in LICENSE file at top of project tree
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ set(archdetect_c_code "
|
||||||
|| defined(_M_ARM64) \\
|
|| defined(_M_ARM64) \\
|
||||||
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 8)
|
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 8)
|
||||||
#error cmake_ARCH arm64
|
#error cmake_ARCH arm64
|
||||||
#elif defined(__ARM_ARCH_7__) \\
|
#if defined(__ARM_ARCH_7__) \\
|
||||||
|| defined(__ARM_ARCH_7A__) \\
|
|| defined(__ARM_ARCH_7A__) \\
|
||||||
|| defined(__ARM_ARCH_7R__) \\
|
|| defined(__ARM_ARCH_7R__) \\
|
||||||
|| defined(__ARM_ARCH_7M__) \\
|
|| defined(__ARM_ARCH_7M__) \\
|
||||||
|
@ -61,7 +61,7 @@ set(archdetect_c_code "
|
||||||
#else
|
#else
|
||||||
#error cmake_ARCH mips
|
#error cmake_ARCH mips
|
||||||
#endif
|
#endif
|
||||||
#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) || defined(__POWERPC__) \\
|
#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) \\
|
||||||
|| defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) \\
|
|| defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) \\
|
||||||
|| defined(_M_MPPC) || defined(_M_PPC)
|
|| defined(_M_MPPC) || defined(_M_PPC)
|
||||||
#if defined(__ppc64__) || defined(__powerpc64__) || defined(__64BIT__)
|
#if defined(__ppc64__) || defined(__powerpc64__) || defined(__64BIT__)
|
||||||
|
@ -83,13 +83,13 @@ function(target_architecture output_var)
|
||||||
# First let's normalize the order of the values
|
# First let's normalize the order of the values
|
||||||
|
|
||||||
# Note that it's not possible to compile PowerPC applications if you are using
|
# Note that it's not possible to compile PowerPC applications if you are using
|
||||||
# the OS X SDK version 10.7 or later - you'll need 10.4/10.5/10.6 for that, so we
|
# the OS X SDK version 10.6 or later - you'll need 10.4/10.5 for that, so we
|
||||||
# disable it by default. Also, ppc64 is not supported in 10.6.
|
# disable it by default
|
||||||
# See this page for more information:
|
# See this page for more information:
|
||||||
# http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4
|
# http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4
|
||||||
|
|
||||||
# Architecture defaults to i386 or ppc on OS X 10.5 and earlier, depending on the CPU type detected at runtime.
|
# Architecture defaults to i386 or ppc on OS X 10.5 and earlier, depending on the CPU type detected at runtime.
|
||||||
# On OS X 10.6+ the default is x86_64 if the CPU supports it, i386 otherwise; 10.6 also supports ppc.
|
# On OS X 10.6+ the default is x86_64 if the CPU supports it, i386 otherwise.
|
||||||
|
|
||||||
foreach(osx_arch ${CMAKE_OSX_ARCHITECTURES})
|
foreach(osx_arch ${CMAKE_OSX_ARCHITECTURES})
|
||||||
if("${osx_arch}" STREQUAL "ppc" AND ppc_support)
|
if("${osx_arch}" STREQUAL "ppc" AND ppc_support)
|
||||||
|
@ -133,11 +133,11 @@ function(target_architecture output_var)
|
||||||
enable_language(C)
|
enable_language(C)
|
||||||
|
|
||||||
# Detect the architecture in a rather creative way...
|
# Detect the architecture in a rather creative way...
|
||||||
# This compiles a small C program which is a series of ifdefs that selects
|
# This compiles a small C program which is a series of ifdefs that selects a
|
||||||
# a particular #error preprocessor directive whose message string contains
|
# particular #error preprocessor directive whose message string contains the
|
||||||
# the target architecture. The program will always fail to compile (both because
|
# target architecture. The program will always fail to compile (both because
|
||||||
# file is not a valid C program, and obviously because of the presence of
|
# file is not a valid C program, and obviously because of the presence of the
|
||||||
# the #error preprocessor directives... but by exploiting the preprocessor in this
|
# #error preprocessor directives... but by exploiting the preprocessor in this
|
||||||
# way, we can detect the correct target architecture even when cross-compiling,
|
# way, we can detect the correct target architecture even when cross-compiling,
|
||||||
# since the program itself never needs to be run (only the compiler/preprocessor)
|
# since the program itself never needs to be run (only the compiler/preprocessor)
|
||||||
try_run(
|
try_run(
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
# read version
|
|
||||||
|
|
||||||
function(set_version version_file output_var)
|
|
||||||
file(READ "${version_file}" version_data)
|
|
||||||
|
|
||||||
string(REGEX MATCH "I2PD_VERSION_MAJOR ([0-9]*)" _ ${version_data})
|
|
||||||
set(version_major ${CMAKE_MATCH_1})
|
|
||||||
|
|
||||||
string(REGEX MATCH "I2PD_VERSION_MINOR ([0-9]*)" _ ${version_data})
|
|
||||||
set(version_minor ${CMAKE_MATCH_1})
|
|
||||||
|
|
||||||
string(REGEX MATCH "I2PD_VERSION_MICRO ([0-9]*)" _ ${version_data})
|
|
||||||
set(version_micro ${CMAKE_MATCH_1})
|
|
||||||
|
|
||||||
set(${output_var} "${version_major}.${version_minor}.${version_micro}" PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
|
@ -24,7 +24,7 @@ ExtraDiskSpaceRequired=15
|
||||||
|
|
||||||
AppID={{621A23E0-3CF4-4BD6-97BC-4835EA5206A2}
|
AppID={{621A23E0-3CF4-4BD6-97BC-4835EA5206A2}
|
||||||
AppVerName={#I2Pd_AppName}
|
AppVerName={#I2Pd_AppName}
|
||||||
AppCopyright=Copyright (c) 2013-2024, The PurpleI2P Project
|
AppCopyright=Copyright (c) 2013-2022, The PurpleI2P Project
|
||||||
AppPublisherURL=http://i2pd.website/
|
AppPublisherURL=http://i2pd.website/
|
||||||
AppSupportURL=https://github.com/PurpleI2P/i2pd/issues
|
AppSupportURL=https://github.com/PurpleI2P/i2pd/issues
|
||||||
AppUpdatesURL=https://github.com/PurpleI2P/i2pd/releases
|
AppUpdatesURL=https://github.com/PurpleI2P/i2pd/releases
|
||||||
|
|
18
contrib/android_binary_only/.gitignore
vendored
Normal file
18
contrib/android_binary_only/.gitignore
vendored
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
gen
|
||||||
|
tests
|
||||||
|
bin
|
||||||
|
libs
|
||||||
|
log*
|
||||||
|
obj
|
||||||
|
.gradle
|
||||||
|
.idea
|
||||||
|
.externalNativeBuild
|
||||||
|
ant.properties
|
||||||
|
local.properties
|
||||||
|
build.sh
|
||||||
|
android.iml
|
||||||
|
build
|
||||||
|
gradle
|
||||||
|
gradlew
|
||||||
|
gradlew.bat
|
||||||
|
|
74
contrib/android_binary_only/jni/Android.mk
Normal file
74
contrib/android_binary_only/jni/Android.mk
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := i2pd
|
||||||
|
LOCAL_CPP_FEATURES := rtti exceptions
|
||||||
|
LOCAL_C_INCLUDES += $(IFADDRS_PATH) $(LIB_SRC_PATH) $(LIB_CLIENT_SRC_PATH) $(DAEMON_SRC_PATH)
|
||||||
|
LOCAL_STATIC_LIBRARIES := \
|
||||||
|
boost_system \
|
||||||
|
boost_date_time \
|
||||||
|
boost_filesystem \
|
||||||
|
boost_program_options \
|
||||||
|
crypto ssl \
|
||||||
|
miniupnpc
|
||||||
|
LOCAL_LDLIBS := -lz
|
||||||
|
|
||||||
|
LOCAL_SRC_FILES := $(IFADDRS_PATH)/ifaddrs.c \
|
||||||
|
$(wildcard $(LIB_SRC_PATH)/*.cpp)\
|
||||||
|
$(wildcard $(LIB_CLIENT_SRC_PATH)/*.cpp)\
|
||||||
|
$(DAEMON_SRC_PATH)/UnixDaemon.cpp \
|
||||||
|
$(DAEMON_SRC_PATH)/Daemon.cpp \
|
||||||
|
$(DAEMON_SRC_PATH)/UPnP.cpp \
|
||||||
|
$(DAEMON_SRC_PATH)/HTTPServer.cpp \
|
||||||
|
$(DAEMON_SRC_PATH)/I2PControl.cpp \
|
||||||
|
$(DAEMON_SRC_PATH)/i2pd.cpp
|
||||||
|
include $(BUILD_EXECUTABLE)
|
||||||
|
|
||||||
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := boost_system
|
||||||
|
LOCAL_SRC_FILES := $(BOOST_PATH)/boost-1_72_0/$(TARGET_ARCH_ABI)/lib/libboost_system.a
|
||||||
|
LOCAL_EXPORT_C_INCLUDES := $(BOOST_PATH)/boost-1_72_0/include
|
||||||
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := boost_date_time
|
||||||
|
LOCAL_SRC_FILES := $(BOOST_PATH)/boost-1_72_0/$(TARGET_ARCH_ABI)/lib/libboost_date_time.a
|
||||||
|
LOCAL_EXPORT_C_INCLUDES := $(BOOST_PATH)/boost-1_72_0/include
|
||||||
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := boost_filesystem
|
||||||
|
LOCAL_SRC_FILES := $(BOOST_PATH)/boost-1_72_0/$(TARGET_ARCH_ABI)/lib/libboost_filesystem.a
|
||||||
|
LOCAL_EXPORT_C_INCLUDES := $(BOOST_PATH)/boost-1_72_0/include
|
||||||
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := boost_program_options
|
||||||
|
LOCAL_SRC_FILES := $(BOOST_PATH)/boost-1_72_0/$(TARGET_ARCH_ABI)/lib/libboost_program_options.a
|
||||||
|
LOCAL_EXPORT_C_INCLUDES := $(BOOST_PATH)/boost-1_72_0/include
|
||||||
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := crypto
|
||||||
|
LOCAL_SRC_FILES := $(OPENSSL_PATH)/openssl-1.1.1a-clang/$(TARGET_ARCH_ABI)/lib/libcrypto.a
|
||||||
|
LOCAL_EXPORT_C_INCLUDES := $(OPENSSL_PATH)/openssl-1.1.1a-clang/include
|
||||||
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := ssl
|
||||||
|
LOCAL_SRC_FILES := $(OPENSSL_PATH)/openssl-1.1.1a-clang/$(TARGET_ARCH_ABI)/lib/libssl.a
|
||||||
|
LOCAL_EXPORT_C_INCLUDES := $(OPENSSL_PATH)/openssl-1.1.1a-clang/include
|
||||||
|
LOCAL_STATIC_LIBRARIES := crypto
|
||||||
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := miniupnpc
|
||||||
|
LOCAL_SRC_FILES := $(MINIUPNP_PATH)/miniupnpc-2.1/$(TARGET_ARCH_ABI)/lib/libminiupnpc.a
|
||||||
|
LOCAL_EXPORT_C_INCLUDES := $(MINIUPNP_PATH)/miniupnpc-2.1/include
|
||||||
|
include $(PREBUILT_STATIC_LIBRARY)
|
40
contrib/android_binary_only/jni/Application.mk
Normal file
40
contrib/android_binary_only/jni/Application.mk
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
APP_ABI := all
|
||||||
|
#APP_ABI += x86
|
||||||
|
#APP_ABI += x86_64
|
||||||
|
#APP_ABI += armeabi-v7a
|
||||||
|
#APP_ABI += arm64-v8a
|
||||||
|
#can be android-3 but will fail for x86 since arch-x86 is not present at ndkroot/platforms/android-3/ . libz is taken from there.
|
||||||
|
APP_PLATFORM := android-14
|
||||||
|
|
||||||
|
NDK_TOOLCHAIN_VERSION := clang
|
||||||
|
APP_STL := c++_static
|
||||||
|
|
||||||
|
# Enable c++17 extensions in source code
|
||||||
|
APP_CPPFLAGS += -std=c++17 -fvisibility=default -fPIE
|
||||||
|
|
||||||
|
APP_CPPFLAGS += -DANDROID_BINARY -DANDROID -D__ANDROID__ -DUSE_UPNP
|
||||||
|
APP_LDFLAGS += -rdynamic -fPIE -pie
|
||||||
|
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
||||||
|
APP_CPPFLAGS += -DANDROID_ARM7A
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Forcing debug optimization. Use `ndk-build NDK_DEBUG=1` instead.
|
||||||
|
#APP_OPTIM := debug
|
||||||
|
|
||||||
|
# git clone https://github.com/PurpleI2P/Boost-for-Android-Prebuilt.git -b boost-1_72_0
|
||||||
|
# git clone https://github.com/PurpleI2P/OpenSSL-for-Android-Prebuilt.git
|
||||||
|
# git clone https://github.com/PurpleI2P/MiniUPnP-for-Android-Prebuilt.git
|
||||||
|
# git clone https://github.com/PurpleI2P/android-ifaddrs.git
|
||||||
|
# change to your own
|
||||||
|
I2PD_LIBS_PATH = /path/to/libraries
|
||||||
|
BOOST_PATH = $(I2PD_LIBS_PATH)/Boost-for-Android-Prebuilt
|
||||||
|
OPENSSL_PATH = $(I2PD_LIBS_PATH)/OpenSSL-for-Android-Prebuilt
|
||||||
|
MINIUPNP_PATH = $(I2PD_LIBS_PATH)/MiniUPnP-for-Android-Prebuilt
|
||||||
|
IFADDRS_PATH = $(I2PD_LIBS_PATH)/android-ifaddrs
|
||||||
|
|
||||||
|
# don't change me
|
||||||
|
I2PD_SRC_PATH = $(PWD)/../..
|
||||||
|
|
||||||
|
LIB_SRC_PATH = $(I2PD_SRC_PATH)/libi2pd
|
||||||
|
LIB_CLIENT_SRC_PATH = $(I2PD_SRC_PATH)/libi2pd_client
|
||||||
|
DAEMON_SRC_PATH = $(I2PD_SRC_PATH)/daemon
|
2
contrib/android_binary_pack/.gitignore
vendored
Normal file
2
contrib/android_binary_pack/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
archive
|
||||||
|
i2pd_*_android_binary.zip
|
48
contrib/android_binary_pack/build-archive
Executable file
48
contrib/android_binary_pack/build-archive
Executable file
|
@ -0,0 +1,48 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright (c) 2013-2020, 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
|
||||||
|
|
||||||
|
GITDESC=$(git describe --tags)
|
||||||
|
|
||||||
|
declare -A ABILIST=(
|
||||||
|
["armeabi-v7a"]="armv7l"
|
||||||
|
["arm64-v8a"]="aarch64"
|
||||||
|
["x86"]="x86"
|
||||||
|
["x86_64"]="x86_64"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Remove old files and archives
|
||||||
|
if [ -d archive ]; then
|
||||||
|
rm -r archive
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f ../i2pd_*_android_binary.zip ]; then
|
||||||
|
rm i2pd_*_android_binary.zip
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Prepare files for package
|
||||||
|
mkdir archive
|
||||||
|
|
||||||
|
for ABI in "${!ABILIST[@]}"; do
|
||||||
|
if [ -f ../android_binary_only/libs/${ABI}/i2pd ]; then
|
||||||
|
cp ../android_binary_only/libs/${ABI}/i2pd archive/i2pd-${ABILIST[$ABI]}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
cp i2pd archive/i2pd
|
||||||
|
cp -rH ../android/assets/certificates archive/
|
||||||
|
cp -rH ../android/assets/tunnels.conf.d archive/
|
||||||
|
cp -H ../android/assets/i2pd.conf archive/
|
||||||
|
cp -H ../android/assets/tunnels.conf archive/
|
||||||
|
|
||||||
|
# Compress files
|
||||||
|
cd archive
|
||||||
|
zip -r6 ../i2pd_${GITDESC}_android_binary.zip .
|
||||||
|
|
||||||
|
# Remove temporary folder
|
||||||
|
cd ..
|
||||||
|
rm -r archive
|
33
contrib/android_binary_pack/i2pd
Executable file
33
contrib/android_binary_pack/i2pd
Executable file
|
@ -0,0 +1,33 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Copyright (c) 2013-2020, 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
|
||||||
|
#
|
||||||
|
# That script written for use with Termux.
|
||||||
|
|
||||||
|
# https://stackoverflow.com/a/246128
|
||||||
|
SOURCE="${0}"
|
||||||
|
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||||
|
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
|
||||||
|
SOURCE="$(readlink "$SOURCE")"
|
||||||
|
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||||
|
done
|
||||||
|
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
|
||||||
|
|
||||||
|
arch=$(uname -m)
|
||||||
|
|
||||||
|
screenfind=$(which screen)
|
||||||
|
if [ -z $screenfind ]; then
|
||||||
|
echo "Can't find 'screen' installed. That script needs it!";
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z i2pd-$arch ]; then
|
||||||
|
echo "Can't find i2pd binary for your archtecture.";
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
screen -AmdS i2pd ./i2pd-$arch --datadir=$DIR
|
|
@ -1,42 +0,0 @@
|
||||||
# _________________________________________
|
|
||||||
# / Copy this file to the right location \
|
|
||||||
# | then load with: |
|
|
||||||
# | |
|
|
||||||
# | apparmor_parser -r -W |
|
|
||||||
# | /etc/apparmor.d/docker-i2pd |
|
|
||||||
# | |
|
|
||||||
# | docker run --security-opt |
|
|
||||||
# | "apparmor=docker-i2pd" ... |
|
|
||||||
# | purplei2p/i2pd |
|
|
||||||
# | |
|
|
||||||
# \ And "aa-status" to verify it's loaded. /
|
|
||||||
# -----------------------------------------
|
|
||||||
# \ ^__^
|
|
||||||
# \ (oo)\_______
|
|
||||||
# (__)\ )\/\
|
|
||||||
# ||----w |
|
|
||||||
# || ||
|
|
||||||
|
|
||||||
#include <tunables/global>
|
|
||||||
|
|
||||||
profile docker-i2pd flags=(attach_disconnected,mediate_deleted) {
|
|
||||||
#include <abstractions/base>
|
|
||||||
#include <abstractions/openssl>
|
|
||||||
#include <abstractions/nameservice>
|
|
||||||
|
|
||||||
/bin/busybox ix,
|
|
||||||
/usr/local/bin/i2pd ix,
|
|
||||||
/entrypoint.sh ixr,
|
|
||||||
|
|
||||||
/i2pd_certificates/** r,
|
|
||||||
|
|
||||||
/home/i2pd/data/** rw,
|
|
||||||
|
|
||||||
/home/i2pd/data/i2pd.pid k,
|
|
||||||
|
|
||||||
deny /home/i2pd/data/i2pd.conf w,
|
|
||||||
deny /home/i2pd/data/tunnels.conf w,
|
|
||||||
deny /home/i2pd/data/tunnels.d/** w,
|
|
||||||
deny /home/i2pd/data/certificates/** w,
|
|
||||||
deny /home/i2pd/data/i2pd.log r,
|
|
||||||
}
|
|
|
@ -4,7 +4,7 @@
|
||||||
#
|
#
|
||||||
#include <tunables/global>
|
#include <tunables/global>
|
||||||
|
|
||||||
profile i2pd /{usr/,}bin/i2pd {
|
profile i2pd /{usr/,}sbin/i2pd {
|
||||||
#include <abstractions/base>
|
#include <abstractions/base>
|
||||||
#include <abstractions/openssl>
|
#include <abstractions/openssl>
|
||||||
#include <abstractions/nameservice>
|
#include <abstractions/nameservice>
|
||||||
|
@ -14,12 +14,12 @@ profile i2pd /{usr/,}bin/i2pd {
|
||||||
/var/lib/i2pd/** rw,
|
/var/lib/i2pd/** rw,
|
||||||
/var/log/i2pd/i2pd.log w,
|
/var/log/i2pd/i2pd.log w,
|
||||||
/{var/,}run/i2pd/i2pd.pid rwk,
|
/{var/,}run/i2pd/i2pd.pid rwk,
|
||||||
/{usr/,}bin/i2pd mr,
|
/{usr/,}sbin/i2pd mr,
|
||||||
@{system_share_dirs}/i2pd/** r,
|
@{system_share_dirs}/i2pd/** r,
|
||||||
|
|
||||||
# user homedir (if started not by init.d or systemd)
|
# user homedir (if started not by init.d or systemd)
|
||||||
owner @{HOME}/.i2pd/ rw,
|
owner @{HOME}/.i2pd/ rw,
|
||||||
owner @{HOME}/.i2pd/** rwk,
|
owner @{HOME}/.i2pd/** rwk,
|
||||||
|
|
||||||
#include if exists <local/usr.bin.i2pd>
|
#include if exists <local/usr.sbin.i2pd>
|
||||||
}
|
}
|
|
@ -1,14 +0,0 @@
|
||||||
-----BEGIN CERTIFICATE-----
|
|
||||||
MIICKDCCAc6gAwIBAgIUcPHZXtYSqGNRCD6z8gp79WUFtI0wCgYIKoZIzj0EAwIw
|
|
||||||
gZMxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEPMA0GA1UEBwwGQXVzdGlu
|
|
||||||
MRgwFgYDVQQKDA9TdG9ybXlDbG91ZCBJbmMxIzAhBgNVBAMMGnN0b3JteWNsb3Vk
|
|
||||||
LmZhbWlseS5pMnAubmV0MSQwIgYJKoZIhvcNAQkBFhVhZG1pbkBzdG9ybXljbG91
|
|
||||||
ZC5vcmcwHhcNMjIwMzE5MTU1MjU2WhcNMzIwMzE2MTU1MjU2WjCBkzELMAkGA1UE
|
|
||||||
BhMCVVMxDjAMBgNVBAgMBVRleGFzMQ8wDQYDVQQHDAZBdXN0aW4xGDAWBgNVBAoM
|
|
||||||
D1N0b3JteUNsb3VkIEluYzEjMCEGA1UEAwwac3Rvcm15Y2xvdWQuZmFtaWx5Lmky
|
|
||||||
cC5uZXQxJDAiBgkqhkiG9w0BCQEWFWFkbWluQHN0b3JteWNsb3VkLm9yZzBZMBMG
|
|
||||||
ByqGSM49AgEGCCqGSM49AwEHA0IABFUli0hvJEmowNjJVjbKEIWBJhqe973S4VdL
|
|
||||||
cJuA5yY3dC4Y998abWEox7/Y1BhnBbpJuiodA341bXKkLMXQy/kwCgYIKoZIzj0E
|
|
||||||
AwIDSAAwRQIgD12F/TfY3iV1/WDF7BSKgbD5g2MfELUIy1dtUlJQuJUCIQD69mZw
|
|
||||||
V1Z9j2x0ZsuirS3i6AMfVyTDj0RFS3U1jeHzIQ==
|
|
||||||
-----END CERTIFICATE-----
|
|
|
@ -1,34 +0,0 @@
|
||||||
-----BEGIN CERTIFICATE-----
|
|
||||||
MIIF1zCCA7+gAwIBAgIRAMDqFR09Xuj8ZUu+oetSvAEwDQYJKoZIhvcNAQELBQAw
|
|
||||||
dTELMAkGA1UEBhMCWFgxCzAJBgNVBAcTAlhYMQswCQYDVQQJEwJYWDEeMBwGA1UE
|
|
||||||
ChMVSTJQIEFub255bW91cyBOZXR3b3JrMQwwCgYDVQQLEwNJMlAxHjAcBgNVBAMM
|
|
||||||
FWFkbWluQHN0b3JteWNsb3VkLm9yZzAeFw0yNDAxMjUxNDE1MzBaFw0zNDAxMjUx
|
|
||||||
NDE1MzBaMHUxCzAJBgNVBAYTAlhYMQswCQYDVQQHEwJYWDELMAkGA1UECRMCWFgx
|
|
||||||
HjAcBgNVBAoTFUkyUCBBbm9ueW1vdXMgTmV0d29yazEMMAoGA1UECxMDSTJQMR4w
|
|
||||||
HAYDVQQDDBVhZG1pbkBzdG9ybXljbG91ZC5vcmcwggIiMA0GCSqGSIb3DQEBAQUA
|
|
||||||
A4ICDwAwggIKAoICAQDbGX+GikPzQXr9zvkrhfO9g0l49KHLNQhUKYqd6T+PfnGo
|
|
||||||
Fm0d3ZZVVQZ045vWgroOXDGGZZWxUIlb2inRaR2DF1TxN3pPYt59RgY9ZQ9+TL7o
|
|
||||||
isY91krCRygY8EcAmHIjlfZQ9dBVcL7CfyT0MYZA5Efee9+NDHSewTfQP9T2faIE
|
|
||||||
83Fcyd93a2mIHYjKUbJnojng/wgsy8srbsEuuTok4MIQmDj+B5nz+za2FgI0/ydh
|
|
||||||
srlMt4aGJF4/DIem9z9d0zBCOkwrmtFIzjNF1mOSA8ES4m5YnKA/y9rZlRidLPGu
|
|
||||||
prbXhPVnqHeOnHMz2QCw1wbVo504kl0bMqyEz2tVWsO9ep7iZoQs2xkFAEaegYNT
|
|
||||||
QLUpwVGlyuq3wXXwopFRffOSimGSazICwWI6j+K0pOtgefNJaWrqKYvtkj1SbK2L
|
|
||||||
LBNUIENz6VnB7KPRckuX6zxC8PpOiBK9BcftfO+xAz/wC6qq3riBPw30KKSym0nC
|
|
||||||
Zp5KciDn4Phtw9PGq8Bkl8SyWl0jtFnfTB1tzJkisf2qKcNHaFTEe2JW763YLbh/
|
|
||||||
AU+8X8evFu40qLgvOgKoyy5DLy6i8zetX+3t9K0Fxt9+Vzzq6lm5V/RS8iIPPn+M
|
|
||||||
q1/3Z5kD0KQBG9h/Gl8BH+lB71ZxPAOZ3SMu8DJZcxBLVmDWqQPCr5CKnoz0swID
|
|
||||||
AQABo2IwYDAOBgNVHQ8BAf8EBAMCAoQwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsG
|
|
||||||
AQUFBwMBMA8GA1UdEwEB/wQFMAMBAf8wHgYDVR0OBBcEFWFkbWluQHN0b3JteWNs
|
|
||||||
b3VkLm9yZzANBgkqhkiG9w0BAQsFAAOCAgEARWOJ69vTHMneSXYscha+4Ytjg0RM
|
|
||||||
faewJNEGj8qy/Qvh9si2bWYNPRK6BlbHFS7pRYBLAnhaeLBGVv1CCR6GUMMe74zQ
|
|
||||||
UuMeAoWU6qMDmB3GfYoZJh8sIxpwHqyJeTdeccRbZ4sX4F6u3IHPXYiU/AgbYqH7
|
|
||||||
pYXQg2lCjXZYaDFAlEf5SlYUDOhhXe5kR8Edhlrsu32/JzA1DQK0JjxKCBp+DQmA
|
|
||||||
ltdOpQtAg03fHP4ssdj7VvjIDl28iIlATwBvHrdNm7T0tYWn6TWhvxbRqvfTxfaH
|
|
||||||
MvxnPdIJwNP4/9TyQkwjwHb1h+ucho3CnxI/AxspdOvT1ElMhP6Ce6rcS9pk11Rl
|
|
||||||
x0ChsqpWwDg7KYpg0qZFSKCTBp4zBq9xoMJ6BQcgMfyl736WbsCzFTEyfifp8beg
|
|
||||||
NxUa/Qk7w7cuSPGyMIKNOmOR7FLlFbtocy8sXVsUQdqnp/edelufdNe39U9uNtY6
|
|
||||||
yoXI9//Tc6NgOwy2Oyia0slZ5qHRkB7e4USXMRzJ3p4q9eCVKjAJs81Utp7O2U+9
|
|
||||||
vhbhwWP8CAnNTT1E5WS6EKtfrdqF7wjkV+noPGLDGmrXi01J1fSMAjMfVO+7/LOL
|
|
||||||
UN+G4ybKWnEhhOO27yidN8Xx6UrCS23DBlPPQAeA74dTsTExiOxf1o1EXzcQiMyO
|
|
||||||
LAj3/Ojbi1xkWhI=
|
|
||||||
-----END CERTIFICATE-----
|
|
|
@ -1,34 +0,0 @@
|
||||||
-----BEGIN CERTIFICATE-----
|
|
||||||
MIIF2TCCA8GgAwIBAgIQIHQPtSoFU+cUpYD8PZaWZjANBgkqhkiG9w0BAQsFADB2
|
|
||||||
MQswCQYDVQQGEwJYWDELMAkGA1UEBxMCWFgxCzAJBgNVBAkTAlhYMR4wHAYDVQQK
|
|
||||||
ExVJMlAgQW5vbnltb3VzIE5ldHdvcmsxDDAKBgNVBAsTA0kyUDEfMB0GA1UEAwwW
|
|
||||||
YXJuYXZiaGF0dDI4OEBtYWlsLmkycDAeFw0yMzAxMjUxODUzNDFaFw0zMzAxMjUx
|
|
||||||
ODUzNDFaMHYxCzAJBgNVBAYTAlhYMQswCQYDVQQHEwJYWDELMAkGA1UECRMCWFgx
|
|
||||||
HjAcBgNVBAoTFUkyUCBBbm9ueW1vdXMgTmV0d29yazEMMAoGA1UECxMDSTJQMR8w
|
|
||||||
HQYDVQQDDBZhcm5hdmJoYXR0Mjg4QG1haWwuaTJwMIICIjANBgkqhkiG9w0BAQEF
|
|
||||||
AAOCAg8AMIICCgKCAgEAtwG73sC0jYd3fgEzZh0SveAdUd5yD35nINJRrdPSrSwY
|
|
||||||
n3i1qGe3fNLj877PvUDU+qiHH0fFZfyFkXTaq3TUp1u4YkmvaoPHy6FZlojB08lK
|
|
||||||
FBm+iJ1hifQ7MFmvIKUGv+cjlN6xSoQ0U6B2QOy6iZnBgFZ/7jbRY4iZOIj7VJtY
|
|
||||||
aodeHfy0bWe447VJovbkUi7NJPFZQS65LMcAIWcWTxrC0Gj8SmdxL3a5+hxpmmg0
|
|
||||||
+KCQvWQDdxAQjsc16sgUCdUc6cWYO4yw9H6fgdq9GJX+LnXR9OB58GsAjjlLlFoI
|
|
||||||
CZxdARDpoqcIj6AoKIanALf8yfbIyrqqJE47cuaqV9bht5MWKnXbwHplEkT4ZNkh
|
|
||||||
PnRDia7B5HY3uwbt39CBm264PEWXvWG2sozTWKQqBjmMN2cj/NFDUEqKv6BggMY1
|
|
||||||
HcqxWFKRcgKCtRvrmTmfp5l0/ou+OtUaFUg0a6Qhtb93Hj10vK6wZzidBqj0ggzB
|
|
||||||
eJDI95b89u8JgzRoOBriuMKTc91WTkOvBLkB3dgUbUpx2p8KHjvf/pppBH9u0oxp
|
|
||||||
qJFFK840DbnJydEvjKezeVe5Ax6YRSRxyEdKzRoWdvKVxb3qBBKMdCKTYEPxHPBu
|
|
||||||
JMEQVUCXJMti++1KEiQGhcfWvLyT7OewbcIZNk9XWNrxlKcGrTp9AOwaaNC5m1kC
|
|
||||||
AwEAAaNjMGEwDgYDVR0PAQH/BAQDAgKEMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggr
|
|
||||||
BgEFBQcDATAPBgNVHRMBAf8EBTADAQH/MB8GA1UdDgQYBBZhcm5hdmJoYXR0Mjg4
|
|
||||||
QG1haWwuaTJwMA0GCSqGSIb3DQEBCwUAA4ICAQAHiK0ld/1PF9DIhutD660/bzBg
|
|
||||||
mF2Z76hcBqDZ8tnQai/u/RXYrH9wso9BYyrVsvk3fr6tpGT49Ian0MVpPOxMoTU2
|
|
||||||
oBEmQlYrfclQLFsOLmA0y2r1ggXzIrt69jB710Vhwdnz09oOE8rS4E2T5oDD8Wvy
|
|
||||||
Kony+AarRceqtkOlzyquc42KjzdrbHsosF7G2iGhNI6t+T3BfWJ+Q+d5sj3OIh6e
|
|
||||||
gSfvHL44E4vZt6dtofRN3MAZ60kNLF5YWyaUo3Snv9Lso1IwIz3AVr5ehv+8sFL/
|
|
||||||
KxaXdkZ5Yn2YUX7p1t4VQd+eXVPYjf1befg4PvrwSkylu3Jpee3fllZSKXeSVx9x
|
|
||||||
jpJiq5vIakqk22pnWb1Vn7xzSW1vtEG7QLjobOr1WrcGiwdv+HKiWcXJXDzKoWXs
|
|
||||||
h3VEfr51Kap8cIJv+D6lJIG9IcIhiQ6CXWBmtjWJvbdVwFBy1/3Fhaou9liHi+gK
|
|
||||||
4Yh5a5OGCzc7xjtpGaTmoLEz7NzDNOdd/r840qRDOh70izzmFZd5Gwq4hoVcPJcS
|
|
||||||
EAySwtgqK0/4d0zDd2Wg9ASJV9DnDf8QuSmHZgZ9Efs47XcWz9TvkWUS1E66AJsN
|
|
||||||
mmI1NDQ3mv3dv5+WPq+dqqYFsnx3xWL1g5Z3buk0opeuXMzoHwM7UfN8h7Q1M5+t
|
|
||||||
+XBgkaYA4iEwYKqlCQ==
|
|
||||||
-----END CERTIFICATE-----
|
|
32
contrib/certificates/reseed/hiduser0_at_mail.i2p.crt
Normal file
32
contrib/certificates/reseed/hiduser0_at_mail.i2p.crt
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIFgTCCA2mgAwIBAgIETWAY1DANBgkqhkiG9w0BAQ0FADBxMQswCQYDVQQGEwJY
|
||||||
|
WDELMAkGA1UECAwCWFgxCzAJBgNVBAcMAlhYMR4wHAYDVQQKDBVJMlAgQW5vbnlt
|
||||||
|
b3VzIE5ldHdvcmsxDDAKBgNVBAsMA0kyUDEaMBgGA1UEAwwRaGlkdXNlcjBAbWFp
|
||||||
|
bC5pMnAwHhcNMjExMjEzMTU0MDI3WhcNMzExMjExMTU0MDI3WjBxMQswCQYDVQQG
|
||||||
|
EwJYWDELMAkGA1UECAwCWFgxCzAJBgNVBAcMAlhYMR4wHAYDVQQKDBVJMlAgQW5v
|
||||||
|
bnltb3VzIE5ldHdvcmsxDDAKBgNVBAsMA0kyUDEaMBgGA1UEAwwRaGlkdXNlcjBA
|
||||||
|
bWFpbC5pMnAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDXnjJ8UQ0f
|
||||||
|
lHHpfPMiHofBPSuL4sbOJY6fOXwPhSg/h6THh9DS/ZWmJXQ3qRD0glDVtv4/Dr/9
|
||||||
|
ldGQ5eltF9iCFXCQlMEy2HjQrBKq0nsl7RpYK12cyMaod0kkzCUk9ITLi9CmHM3Z
|
||||||
|
gQZcmG8TWjFEpDR+idx/QkQt2pcO4vzWlDit3Vh4ivnbX5jGQHbsVjQEMQWxr+pX
|
||||||
|
dsS+YQpjZ6RBmrooGTPO8QDOOeYLAn0lCjmffc/kzIH9E/p4/O0rOpyhVYbdxUD1
|
||||||
|
5wkqN9l4yrtxmORG/PudnRQQ0r4TUq8vsxfGY0Euo9IbhgXF2Parel1ZhDxB1WZV
|
||||||
|
VwWtgLIh9jGA1UMa8SYKnEfp8LWNZ3b3mUUnZb3kMrLk6jGYRWNsHmamhd4mC7AZ
|
||||||
|
qf/8lOkEIw3bPd3YguCDRVcLui5BwIEZmqXg8uoESxfO/sW3pBrN/8M7MkTex9kN
|
||||||
|
vjitGDDXvenK27qmNgZxbBlX72yTSfys7XTYTLnxZC8AwdAo2Wz9Z6HhGiPonf2h
|
||||||
|
vZkc9ZxuE0jFIrsbJra4X7iyjXgi4vV4ARNg/9Ft6F4/OIbECgeDcBQqq4TlT2bZ
|
||||||
|
EfWVrBbqXoj5vNsLigIkd+AyUNwPYEcB5IFSiiOh98pC7BH3pg0m8U5YBjxe1i+9
|
||||||
|
EQOOG0Qtx+JigXZHu6bGE0Twy9zy+UzoKQIDAQABoyEwHzAdBgNVHQ4EFgQUGK1b
|
||||||
|
0DkL6aLalcfBc/Uj/SF08C0wDQYJKoZIhvcNAQENBQADggIBAMpXM82bJDpH1TlH
|
||||||
|
TvhU3Z7nfZdvEhOQfujaFUYiuNripuEKcFGn948+DvAG0FUN+uNlJoqOVs8D7InD
|
||||||
|
gWlA9zpqw5Cl5Hij/Wns9QbXuAHJeA23fVUoaM2A6v9ifcIQ1A+rDuRQAo6/64KW
|
||||||
|
ChTg2e99RBpfGOyqgeh7tLLe0lPPekVpKHFuXabokaKRDuBcVHcUL4tWXe3dcyqa
|
||||||
|
Ej/PJrrS+nWL0EGZ4q80CEd2LPuDzPxNGCJt/R7ZfadENWajcgcXGceh1QBzozrB
|
||||||
|
SL/Ya6wF9SrsB7V/r5wX0LM4ZdDaLWbtmUe5Op0h/ZMH25Sa8xAXVz+O9L6sWSoO
|
||||||
|
FaiYTOvAiyyPz+nsxKa3xYryDHno7eKSt+hGOcaurhxbdZaEFY/CegEc73tCt9xK
|
||||||
|
e9qF8O/WkDLmixuErw3f5en4IfzGR7p3lJAwW/8WD8C6HS39h/eE7dVZNaWgtQnZ
|
||||||
|
SgGjgZMTJqTcQ3aZmfuCZefxGFok8w6AIkdbnd1pdMBRjYu8aXgl2hQSB9ZADDE9
|
||||||
|
R5d3rXi0PkSFLIvsNjVa5KXrZk/tB0Hpfmepq7CufBqjP/LG9TieRoXzLYUKFF74
|
||||||
|
QRwjP+y7AJ+VDUTpY1NV1P+k+2raubU2bOnLF3zL5DtyoyieGPhyeMMvp0fRIxdg
|
||||||
|
bSl5VHgPXHNM8mcnndMAuzvl7jEK
|
||||||
|
-----END CERTIFICATE-----
|
|
@ -1,34 +0,0 @@
|
||||||
-----BEGIN CERTIFICATE-----
|
|
||||||
MIIFzTCCA7WgAwIBAgIQeUqFi0fHNQopg6BZlBLhVzANBgkqhkiG9w0BAQsFADBy
|
|
||||||
MQswCQYDVQQGEwJYWDELMAkGA1UEBxMCWFgxCzAJBgNVBAkTAlhYMR4wHAYDVQQK
|
|
||||||
ExVJMlAgQW5vbnltb3VzIE5ldHdvcmsxDDAKBgNVBAsTA0kyUDEbMBkGA1UEAwwS
|
|
||||||
aTJwLXJlc2VlZEBtazE2LmRlMB4XDTIyMDIwNTE3MzkzM1oXDTMyMDIwNTE3Mzkz
|
|
||||||
M1owcjELMAkGA1UEBhMCWFgxCzAJBgNVBAcTAlhYMQswCQYDVQQJEwJYWDEeMBwG
|
|
||||||
A1UEChMVSTJQIEFub255bW91cyBOZXR3b3JrMQwwCgYDVQQLEwNJMlAxGzAZBgNV
|
|
||||||
BAMMEmkycC1yZXNlZWRAbWsxNi5kZTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCC
|
|
||||||
AgoCggIBAMYxs2D2xpN/8blGawvAlU9DemHIxApOEwaLNfh8aAvqEdB41NTqcx4U
|
|
||||||
H8VchSormCfkCvezuMHO+K2HX7ihEZ1v6tbr6aX6hY9UZUyDDYsKmJoB1oKEhddv
|
|
||||||
5UYfcWPE2eSykdFsWgTQD6Z+cRQWHEoCzb7qc+Jrw6KcnHMD0VrmBrEQPzTBxMHW
|
|
||||||
4HC97PVkSLJTDArnS6ZiX4IbWRPw/mbpJT6EoVZo8J/it0pdn/X4KodEXDcnEMSe
|
|
||||||
VRulfZH/nSmOOvKhoHPckmgz/u66BlnuSYXEIB0KfDIcAlSYiPDxGnAemTozJYXA
|
|
||||||
UVMeFMs+YE5wiPgzzu+vpC31xtZLq0gyaCfgEi1P9j2ES/8pH3Gw6W2OH4kBx+jO
|
|
||||||
TBsfI+ph6qFZ3WWT23MRVyl3ATuI/GHdczTxD9JaOn74lLI+Hnu8wXnyztVWkTMB
|
|
||||||
4sAnzjdeHkvNDyQ10vSaN0HnGfg6zuAuUSqFQujFF8Vg8ZCcsh8GouWfzYDvi9mj
|
|
||||||
9pfxx8v6UCC719I4J9CgFjWnn2Hqez3fO8fFulY61VPyCCZp4gKWbI2SIQP/n5gz
|
|
||||||
ecYJRrJoem+rYfEQ/fwxROsvm3fCO4D6dt7ILRuX286GDIw2qSvP1zZVAioMwSj3
|
|
||||||
9CAjKLwD/BhTRiMOlpaVv6IWqjtevbiaIKvbHTnoxvkGsDqe3gJhAgMBAAGjXzBd
|
|
||||||
MA4GA1UdDwEB/wQEAwIChDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEw
|
|
||||||
DwYDVR0TAQH/BAUwAwEB/zAbBgNVHQ4EFAQSaTJwLXJlc2VlZEBtazE2LmRlMA0G
|
|
||||||
CSqGSIb3DQEBCwUAA4ICAQAb+x6XpJdjpVYw2bvWIUbatQJwq0YaEW5W61xGLgIG
|
|
||||||
a37oll3YZbSY9Vk+N1cE0f61L3ya4Ioz6zlH/MO2zUG/dEk8vqdgIPUYJvyF7wwF
|
|
||||||
w3/G4VMaDKOJx4bAZNmaiRFGYNhCOhCnZx6uZGrLNIJ2Dc+mflrGmGwYphtXVV3e
|
|
||||||
Iv+ki3gSRgfXuMfKi4B5bLPnz7XDe4TSmwZZSRac4ly4KqmZUyntqbilRxaGTej3
|
|
||||||
VYJ1tac8yppyk5N3VopMQNmBarNZG16wSOTD7CtKgn382jgRW8cR7BMeqhORivp0
|
|
||||||
ZnPJFhzh4uthdlPdXXo6lxfvZjfiwlDPytvEu2QBz3urTgopGqRLcTBnLucWg9li
|
|
||||||
OSy9z7hNEnIN3iIJJAwI1wBdDa7K0h3PFBbIUa7X2ybn81VeNSfO25Lo8YTZEKsc
|
|
||||||
wcThJrNV6qOQv8rM/7aXugi6+VzPlCR+18iKRbebCnlqGR2dT1zFtj3negtOkrjo
|
|
||||||
LH4H6VUr3q2Ie56IubS2hUKiUkDm0ckP3Vum35GGntyEAzl6uyog0hJFOJb3aq30
|
|
||||||
YQLzyVEOz8NnA+32oMRzJJdDxQ7pqG5fgq7EF4d++YSgEfdVXxvfgXQ6m3jAyC7Z
|
|
||||||
p/gX4rlxNsjeGU3Ds51wkmhH4IB1aSQr52PE6RaBhhh3SmADEv6S/3eGvE4F4MN5
|
|
||||||
2Q==
|
|
||||||
-----END CERTIFICATE-----
|
|
|
@ -1,33 +1,33 @@
|
||||||
-----BEGIN CERTIFICATE-----
|
-----BEGIN CERTIFICATE-----
|
||||||
MIIFvjCCA6agAwIBAgIQBnsUOmOu2oZZIwHBmQc1BDANBgkqhkiG9w0BAQsFADBt
|
MIIFvjCCA6agAwIBAgIQIDtv8tGMh0FyB2w5XjfZxTANBgkqhkiG9w0BAQsFADBt
|
||||||
MQswCQYDVQQGEwJYWDELMAkGA1UEBxMCWFgxCzAJBgNVBAkTAlhYMR4wHAYDVQQK
|
MQswCQYDVQQGEwJYWDELMAkGA1UEBxMCWFgxCzAJBgNVBAkTAlhYMR4wHAYDVQQK
|
||||||
ExVJMlAgQW5vbnltb3VzIE5ldHdvcmsxDDAKBgNVBAsTA0kyUDEWMBQGA1UEAwwN
|
ExVJMlAgQW5vbnltb3VzIE5ldHdvcmsxDDAKBgNVBAsTA0kyUDEWMBQGA1UEAwwN
|
||||||
aWdvckBub3ZnLm5ldDAeFw0yMzAxMjgxNDM4MzFaFw0zMzAxMjgxNDM4MzFaMG0x
|
aWdvckBub3ZnLm5ldDAeFw0xNzA3MjQxODI4NThaFw0yNzA3MjQxODI4NThaMG0x
|
||||||
CzAJBgNVBAYTAlhYMQswCQYDVQQHEwJYWDELMAkGA1UECRMCWFgxHjAcBgNVBAoT
|
CzAJBgNVBAYTAlhYMQswCQYDVQQHEwJYWDELMAkGA1UECRMCWFgxHjAcBgNVBAoT
|
||||||
FUkyUCBBbm9ueW1vdXMgTmV0d29yazEMMAoGA1UECxMDSTJQMRYwFAYDVQQDDA1p
|
FUkyUCBBbm9ueW1vdXMgTmV0d29yazEMMAoGA1UECxMDSTJQMRYwFAYDVQQDDA1p
|
||||||
Z29yQG5vdmcubmV0MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAvLkf
|
Z29yQG5vdmcubmV0MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxst4
|
||||||
bM3uiYfp9m0vgdoftyXtk2/9bHf3u5iaM0WfoJIsw1iizo/mxJl+Iy7SxLC16nV0
|
cam3YibBtQHGPCPX13uRQti56U3XZytSZntaKrUFmJxjt41Q/mOy3KYo+lBvhfDF
|
||||||
v5FpncVv+Z8x9dgoAYVuLq9zKfsAbpj6kuxAqw6vJMlD1TiIL3nSODV9BJLk47X5
|
x3tWKjgP9LJOJ28zvddFhZVNxqZRjcnAoPuSOVCw88g01D9OAasKF11hCfdxZP6h
|
||||||
tmvoOSj9BgvemYThTE3nj+DbuJRW5q90KyBV/LdLrQJX3k5R3FFL5tTad2LKFNZ4
|
vGm8WCnjD8KPcYFxJC4HJUiFeProAwuTzEAESTRk4CAQe3Ie91JspuqoLUc5Qxlm
|
||||||
vEOcYwwx6mvrkJ2lly6bAQUCtfc648Jyq+NO3Rba1fmn7gcP9zXXc5KYsj/ovyY2
|
w5QpjnjfZY4kaVHmZDKGIZDgNIt5v85bu4pWwZ6O+o90xQqjxvjyz/xccIec3sHw
|
||||||
OaocSF5wMhzBuPxO+M2HqbYLMAkc6/GesGds8Rm8wofuhJoI5YtqJuLKZm6nQXSc
|
MHJ8h8ZKMokCKEJTaRWBvdeNXki7nf3gUy/3GjYQlzo0Nxk/Hw4svPcA+eL0AYiy
|
||||||
fx6PKgbKcTIUWNFMsxyfghz9hpbg0rkvC7PtfAjtV0yaDtUum1eZeNEx1HbRWN2n
|
Jn83bIB5VToW2zYUdV4u3qHeAhEg8Y7HI0kKcSUGm9AQXzbzP8YCHxi0sbb0GAJy
|
||||||
TQNCVuv0yaKC41qxqzhEybkdjL9JlgUh7VuskaCelB0lz+kgYjGu8ezOa0ua2iKq
|
f1Xf3XzoPfT64giD8ReUHhwKpyMB6uvG/NfWSZAzeAO/NT7DAwXpKIVQdkVdqy8b
|
||||||
4FC/1MbPulxN8NOt4pmbGqqoxmCdShp38wdnOBM3DsAS9f0JaQZd4CDyY4DCSfVn
|
mvHvjf9/kWKOirA2Nygf3r79Vbg2mqbYC/b63XI9hheU689+O7qyhTEhNz+11X0d
|
||||||
xPdWk31+VXVt3Ixh1EUqZWYTRSsZApkCyYzkiZ/qPGG6FR9Hq2SuhC5o4P44k7eo
|
Zax7UPrLrwOeB9TNfEnztsmrHNdv2n+KcOO2o11Wvz2nHP9g+dgwoZSD1ZEpFzWP
|
||||||
6wwBWD8a5RjsZhvr05E5yBrKXh/PjLwmtG73QC+ouR54/5xtedvdTwNS94FnNctX
|
0sD5knKLwAL/64qLlAQ1feqW7hMr80IADcKjLSODkIDIIGm0ksXqEzTjz1JzbRDq
|
||||||
FT6QGZnRwCkhPaRe1oQMzP+88pGoCfO33GBAuwUCAwEAAaNaMFgwDgYDVR0PAQH/
|
jUjq7EAlkw3G69rv1gHxIntllJRQidAqecyWHOMCAwEAAaNaMFgwDgYDVR0PAQH/
|
||||||
BAQDAgKEMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATAPBgNVHRMBAf8E
|
BAQDAgKEMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATAPBgNVHRMBAf8E
|
||||||
BTADAQH/MBYGA1UdDgQPBA1pZ29yQG5vdmcubmV0MA0GCSqGSIb3DQEBCwUAA4IC
|
BTADAQH/MBYGA1UdDgQPBA1pZ29yQG5vdmcubmV0MA0GCSqGSIb3DQEBCwUAA4IC
|
||||||
AQCteAb5/bqhHr/i5CJbDzlofprXFC826c19GxQ/9Hw0kA52l0J9Q8Vz8Vy7VQyP
|
AQADyPaec28qc1HQtAV5dscJr47k92RTfvan+GEgIwyQDHZQm38eyTb05xipQCdk
|
||||||
QNa8MCv6FeNy8a/wXp6cafyFsBtvehVQO8lFlpCgMEl2Bma43+GaCwkrM6bFNXeW
|
5ruUDFXLB5qXXFJKUbQM6IpaktmWDJqk4Zn+1nGbtFEbKgrF55pd63+NQer5QW9o
|
||||||
iQ9h4e1KjsUZ8cQDNEcamiJ80+xbMhBrj5bAZwKmZs8MoGEMyXKEZmcmwA+/fy1c
|
3+dGj0eZJa3HX5EBkd2r7j2LFuB6uxv3r/xiTeHaaflCnsmyDLfb7axvYhyEzHQS
|
||||||
cx4izsOsmRXmEHXsvB9ydJHZZeKW8+r0DAtgPslwXuXHG6MuBQo7dKCqn+iMxHXV
|
AUi1bR+ln+dXewdtuojqc1+YmVGDgzWZK2T0oOz2E21CpZUDiP3wv9QfMaotLEal
|
||||||
Jxriq3yvNffdGx4maSLJrjQ1ealt/UMzql7huVSItnVFWoYf7GAELXNJ/PmqVyaK
|
zECnbhS++q889inN3GB4kIoN6WpPpeYtTV+/r7FLv9+KUOV1s2z6mxIqC5wBFhZs
|
||||||
q11LQ8W/Aud6s/bblaJrFJnK8PbPpaw4RvHoWVLYaZYmQnV2msWs5EuESBlEADbv
|
0Sr1kVo8hB/EW/YYhDp99LoAOjIO6nn1h+qttfzBYr6C16j+8lGK2A12REJ4LiUQ
|
||||||
UklQXLMc2f9HKWPA5678nvYPrmu8IL5pMkAxgGRqmd+7vCz4lU9M5z3HObU+WRBt
|
cQI/0zTjt2C8Ns6ueNzMLQN1Mvmlg1Z8wIB7Az7jsIbY2zFJ0M5qR5VJveTj33K4
|
||||||
qEMYyXywV8o3tbmnlDS5S5Xxf+tLZn1cxz3ZrmcHPHDbLBNdvszF3CTJH/R2sQvD
|
4WSbC/zMWOBYHTVBvGmc6JGhu5ZUTZ+mWP7QfimGu+tdhvtrybFjE9ROIE/4yFr6
|
||||||
bizvYJM+p5F+GWM5mt6w0HrOut5MRlpOws/NRrkbijuVA/A45nzTtKplIFYE3qe8
|
GkxEyt0UY87TeKXJ/3KygvkMwdvqGWiZhItb807iy99+cySujtbGfF2ZXYGjBXVW
|
||||||
q5SAbwYLc8cJcZCN3PxtWwbEv81V33abMt5QcjnWGLH5t2+1Z2KLCgKLSCQTxM8s
|
dJOVRbyGQkHh6lrWHQM4ntBv4x+5QA+OAan5PBF3tcDx1vefPx+asYslbOXpzII5
|
||||||
zBPHtUe8qtSQaElnNLILYbtJ1w67dPnGYTphHihC+CXjBg==
|
qhvoQxuRs6j5jsVFG6RdsKNeQAt87Mb2u2zK2ZakMdyD1w==
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
|
|
|
@ -1,5 +1,2 @@
|
||||||
This forder contain files required for building debian packages.
|
This forder contain systemd unit files.
|
||||||
|
To use systemd daemon control, place files from this directory to debian folder before building package.
|
||||||
The trunk repository is contains the packaging files for the latest stable version of Debian (if we not forgot to update them).
|
|
||||||
|
|
||||||
Files in subdirectories contains fixes to make possible to build package on specific versions of Debian/Ubuntu. They are used when building the release package.
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
11
|
|
|
@ -1,18 +0,0 @@
|
||||||
Source: i2pd
|
|
||||||
Section: net
|
|
||||||
Priority: optional
|
|
||||||
Maintainer: r4sas <r4sas@i2pmail.org>
|
|
||||||
Build-Depends: debhelper (>= 11~), libboost-system-dev (>= 1.46), libboost-date-time-dev (>= 1.46), libboost-filesystem-dev (>= 1.46), libboost-program-options-dev (>= 1.46), libminiupnpc-dev, libssl-dev, zlib1g-dev
|
|
||||||
Standards-Version: 4.2.0
|
|
||||||
Homepage: http://i2pd.website/
|
|
||||||
Vcs-Git: git://github.com/PurpleI2P/i2pd.git
|
|
||||||
Vcs-Browser: https://github.com/PurpleI2P/i2pd
|
|
||||||
|
|
||||||
Package: i2pd
|
|
||||||
Architecture: any
|
|
||||||
Pre-Depends: ${misc:Pre-Depends}, adduser
|
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base,
|
|
||||||
Description: Full-featured C++ implementation of I2P client.
|
|
||||||
I2P (Invisible Internet Protocol) is a universal anonymous network layer. All
|
|
||||||
communications over I2P are anonymous and end-to-end encrypted, participants
|
|
||||||
don't reveal their real IP addresses.
|
|
|
@ -1 +0,0 @@
|
||||||
9
|
|
|
@ -1,18 +0,0 @@
|
||||||
Source: i2pd
|
|
||||||
Section: net
|
|
||||||
Priority: optional
|
|
||||||
Maintainer: r4sas <r4sas@i2pmail.org>
|
|
||||||
Build-Depends: debhelper (>= 9), libboost-system-dev (>= 1.46), libboost-date-time-dev (>= 1.46), libboost-filesystem-dev (>= 1.46), libboost-program-options-dev (>= 1.46), libminiupnpc-dev, libssl-dev, zlib1g-dev
|
|
||||||
Standards-Version: 3.9.8
|
|
||||||
Homepage: http://i2pd.website/
|
|
||||||
Vcs-Git: git://github.com/PurpleI2P/i2pd.git
|
|
||||||
Vcs-Browser: https://github.com/PurpleI2P/i2pd
|
|
||||||
|
|
||||||
Package: i2pd
|
|
||||||
Architecture: any
|
|
||||||
Pre-Depends: ${misc:Pre-Depends}, adduser
|
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base,
|
|
||||||
Description: Full-featured C++ implementation of I2P client.
|
|
||||||
I2P (Invisible Internet Protocol) is a universal anonymous network layer. All
|
|
||||||
communications over I2P are anonymous and end-to-end encrypted, participants
|
|
||||||
don't reveal their real IP addresses.
|
|
|
@ -1,17 +0,0 @@
|
||||||
Description: Enable UPnP usage in package
|
|
||||||
Author: r4sas <r4sas@i2pmail.org>
|
|
||||||
|
|
||||||
Reviewed-By: r4sas <r4sas@i2pmail.org>
|
|
||||||
Last-Update: 2024-12-30
|
|
||||||
|
|
||||||
--- i2pd.orig/Makefile
|
|
||||||
+++ i2pd/Makefile
|
|
||||||
@@ -31,7 +31,7 @@ # import source files lists
|
|
||||||
include filelist.mk
|
|
||||||
|
|
||||||
USE_STATIC := $(or $(USE_STATIC),no)
|
|
||||||
-USE_UPNP := $(or $(USE_UPNP),no)
|
|
||||||
+USE_UPNP := $(or $(USE_UPNP),yes)
|
|
||||||
DEBUG := $(or $(DEBUG),yes)
|
|
||||||
|
|
||||||
# for debugging purposes only, when commit hash needed in trunk builds in i2pd version string
|
|
|
@ -1,19 +0,0 @@
|
||||||
Description: Disable LogsDirectory and LogsDirectoryMode options in service
|
|
||||||
Author: r4sas <r4sas@i2pmail.org>
|
|
||||||
|
|
||||||
Reviewed-By: r4sas <r4sas@i2pmail.org>
|
|
||||||
Last-Update: 2024-07-19
|
|
||||||
|
|
||||||
--- a/contrib/i2pd.service
|
|
||||||
+++ b/contrib/i2pd.service
|
|
||||||
@@ -8,8 +8,8 @@ User=i2pd
|
|
||||||
Group=i2pd
|
|
||||||
RuntimeDirectory=i2pd
|
|
||||||
RuntimeDirectoryMode=0700
|
|
||||||
-LogsDirectory=i2pd
|
|
||||||
-LogsDirectoryMode=0700
|
|
||||||
+#LogsDirectory=i2pd
|
|
||||||
+#LogsDirectoryMode=0700
|
|
||||||
Type=forking
|
|
||||||
ExecStart=/usr/bin/i2pd --conf=/etc/i2pd/i2pd.conf --tunconf=/etc/i2pd/tunnels.conf --tunnelsdir=/etc/i2pd/tunnels.conf.d --pidfile=/run/i2pd/i2pd.pid --logfile=/var/log/i2pd/i2pd.log --daemon --service
|
|
||||||
ExecReload=/bin/sh -c "kill -HUP $MAINPID"
|
|
|
@ -1,2 +0,0 @@
|
||||||
01-upnp.patch
|
|
||||||
02-service.patch
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/usr/bin/make -f
|
|
||||||
#export DH_VERBOSE=1
|
|
||||||
|
|
||||||
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
|
|
||||||
|
|
||||||
include /usr/share/dpkg/architecture.mk
|
|
||||||
|
|
||||||
ifeq ($(DEB_HOST_ARCH),i386)
|
|
||||||
export DEB_BUILD_OPTIONS=parallel=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
export DEB_CXXFLAGS_MAINT_APPEND=-Wall -pedantic
|
|
||||||
export DEB_LDFLAGS_MAINT_APPEND=
|
|
||||||
|
|
||||||
%:
|
|
||||||
dh $@ --parallel
|
|
||||||
|
|
||||||
override_dh_auto_install:
|
|
|
@ -1 +0,0 @@
|
||||||
9
|
|
|
@ -1,18 +0,0 @@
|
||||||
Source: i2pd
|
|
||||||
Section: net
|
|
||||||
Priority: optional
|
|
||||||
Maintainer: r4sas <r4sas@i2pmail.org>
|
|
||||||
Build-Depends: debhelper (>= 9), libboost-system-dev (>= 1.46), libboost-date-time-dev (>= 1.46), libboost-filesystem-dev (>= 1.46), libboost-program-options-dev (>= 1.46), libminiupnpc-dev, libssl-dev, zlib1g-dev
|
|
||||||
Standards-Version: 3.9.8
|
|
||||||
Homepage: http://i2pd.website/
|
|
||||||
Vcs-Git: git://github.com/PurpleI2P/i2pd.git
|
|
||||||
Vcs-Browser: https://github.com/PurpleI2P/i2pd
|
|
||||||
|
|
||||||
Package: i2pd
|
|
||||||
Architecture: any
|
|
||||||
Pre-Depends: ${misc:Pre-Depends}, adduser
|
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base,
|
|
||||||
Description: Full-featured C++ implementation of I2P client.
|
|
||||||
I2P (Invisible Internet Protocol) is a universal anonymous network layer. All
|
|
||||||
communications over I2P are anonymous and end-to-end encrypted, participants
|
|
||||||
don't reveal their real IP addresses.
|
|
|
@ -1,19 +0,0 @@
|
||||||
Description: Disable LogsDirectory and LogsDirectoryMode options in service
|
|
||||||
Author: r4sas <r4sas@i2pmail.org>
|
|
||||||
|
|
||||||
Reviewed-By: r4sas <r4sas@i2pmail.org>
|
|
||||||
Last-Update: 2024-07-19
|
|
||||||
|
|
||||||
--- a/contrib/i2pd.service
|
|
||||||
+++ b/contrib/i2pd.service
|
|
||||||
@@ -8,8 +8,8 @@ User=i2pd
|
|
||||||
Group=i2pd
|
|
||||||
RuntimeDirectory=i2pd
|
|
||||||
RuntimeDirectoryMode=0700
|
|
||||||
-LogsDirectory=i2pd
|
|
||||||
-LogsDirectoryMode=0700
|
|
||||||
+#LogsDirectory=i2pd
|
|
||||||
+#LogsDirectoryMode=0700
|
|
||||||
Type=forking
|
|
||||||
ExecStart=/usr/bin/i2pd --conf=/etc/i2pd/i2pd.conf --tunconf=/etc/i2pd/tunnels.conf --tunnelsdir=/etc/i2pd/tunnels.conf.d --pidfile=/run/i2pd/i2pd.pid --logfile=/var/log/i2pd/i2pd.log --daemon --service
|
|
||||||
ExecReload=/bin/sh -c "kill -HUP $MAINPID"
|
|
|
@ -1,2 +0,0 @@
|
||||||
01-upnp.patch
|
|
||||||
02-service.patch
|
|
|
@ -1,13 +0,0 @@
|
||||||
#!/usr/bin/make -f
|
|
||||||
#export DH_VERBOSE=1
|
|
||||||
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
|
||||||
|
|
||||||
include /usr/share/dpkg/architecture.mk
|
|
||||||
|
|
||||||
export DEB_CXXFLAGS_MAINT_APPEND = -Wall -pedantic
|
|
||||||
export DEB_LDFLAGS_MAINT_APPEND =
|
|
||||||
|
|
||||||
%:
|
|
||||||
dh $@ --parallel
|
|
||||||
|
|
||||||
override_dh_auto_install:
|
|
|
@ -1,8 +0,0 @@
|
||||||
type = bgprocess
|
|
||||||
run-as = i2pd
|
|
||||||
command = /usr/bin/i2pd --conf=/var/lib/i2pd/i2pd.conf --pidfile=/var/lib/i2pd/i2pd.pid --daemon --service
|
|
||||||
smooth-recovery = true
|
|
||||||
depends-on = ntpd
|
|
||||||
# uncomment if you want to use i2pd with yggdrasil
|
|
||||||
# depends-on = yggdrasil
|
|
||||||
pid-file = /var/lib/i2pd/i2pd.pid
|
|
|
@ -1,18 +1,5 @@
|
||||||
#
|
|
||||||
# Copyright (c) 2017-2022, 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
|
|
||||||
#
|
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
LABEL authors="Mikal Villa <mikal@sigterm.no>, Darknet Villain <supervillain@riseup.net>"
|
LABEL authors "Mikal Villa <mikal@sigterm.no>, Darknet Villain <supervillain@riseup.net>"
|
||||||
LABEL maintainer="R4SAS <r4sas@i2pmail.org>"
|
|
||||||
|
|
||||||
LABEL org.opencontainers.image.source=https://github.com/PurpleI2P/i2pd
|
|
||||||
LABEL org.opencontainers.image.documentation=https://i2pd.readthedocs.io/en/latest/
|
|
||||||
LABEL org.opencontainers.image.licenses=BSD3
|
|
||||||
|
|
||||||
# Expose git branch, tag and URL variables as arguments
|
# Expose git branch, tag and URL variables as arguments
|
||||||
ARG GIT_BRANCH="openssl"
|
ARG GIT_BRANCH="openssl"
|
||||||
|
@ -24,28 +11,27 @@ ENV REPO_URL=${REPO_URL}
|
||||||
|
|
||||||
ENV I2PD_HOME="/home/i2pd"
|
ENV I2PD_HOME="/home/i2pd"
|
||||||
ENV DATA_DIR="${I2PD_HOME}/data"
|
ENV DATA_DIR="${I2PD_HOME}/data"
|
||||||
ENV DEFAULT_ARGS=" --datadir=$DATA_DIR"
|
ENV DEFAULT_ARGS=" --datadir=$DATA_DIR --reseed.verify=true --upnp.enabled=false --http.enabled=true --http.address=0.0.0.0 --httpproxy.enabled=true --httpproxy.address=0.0.0.0 --socksproxy.enabled=true --socksproxy.address=0.0.0.0 --sam.enabled=true --sam.address=0.0.0.0"
|
||||||
|
|
||||||
RUN mkdir -p "$I2PD_HOME" "$DATA_DIR" \
|
RUN mkdir -p "$I2PD_HOME" "$DATA_DIR" \
|
||||||
&& adduser -S -h "$I2PD_HOME" i2pd \
|
&& adduser -S -h "$I2PD_HOME" i2pd \
|
||||||
&& chown -R i2pd:nobody "$I2PD_HOME"
|
&& chown -R i2pd:nobody "$I2PD_HOME"
|
||||||
|
|
||||||
|
#
|
||||||
# 1. Building binary
|
|
||||||
# Each RUN is a layer, adding the dependencies and building i2pd in one layer takes around 8-900Mb, so to keep the
|
# Each RUN is a layer, adding the dependencies and building i2pd in one layer takes around 8-900Mb, so to keep the
|
||||||
# image under 20mb we need to remove all the build dependencies in the same "RUN" / layer.
|
# image under 20mb we need to remove all the build dependencies in the same "RUN" / layer.
|
||||||
#
|
#
|
||||||
|
|
||||||
# 1. install deps, clone and build.
|
# 1. install deps, clone and build.
|
||||||
# 2. strip binaries.
|
# 2. strip binaries.
|
||||||
# 3. Purge all dependencies and other unrelated packages, including build directory.
|
# 3. Purge all dependencies and other unrelated packages, including build directory.
|
||||||
|
|
||||||
RUN apk update \
|
RUN apk update \
|
||||||
&& apk --no-cache --virtual build-dependendencies add make gcc g++ libtool zlib-dev boost-dev build-base openssl-dev openssl miniupnpc-dev git \
|
&& apk --no-cache --virtual build-dependendencies add make gcc g++ libtool zlib-dev boost-dev build-base openssl-dev openssl miniupnpc-dev git \
|
||||||
&& mkdir -p /tmp/build \
|
&& mkdir -p /tmp/build \
|
||||||
&& cd /tmp/build && git clone -b ${GIT_BRANCH} ${REPO_URL} \
|
&& cd /tmp/build && git clone -b ${GIT_BRANCH} ${REPO_URL} \
|
||||||
&& cd i2pd \
|
&& cd i2pd \
|
||||||
&& if [ -n "${GIT_TAG}" ]; then git checkout tags/${GIT_TAG}; fi \
|
&& if [ -n "${GIT_TAG}" ]; then git checkout tags/${GIT_TAG}; fi \
|
||||||
&& make -j$(nproc) USE_UPNP=yes \
|
&& make USE_UPNP=yes \
|
||||||
&& cp -R contrib/certificates /i2pd_certificates \
|
&& cp -R contrib/certificates /i2pd_certificates \
|
||||||
&& mkdir -p /usr/local/bin \
|
&& mkdir -p /usr/local/bin \
|
||||||
&& mv i2pd /usr/local/bin \
|
&& mv i2pd /usr/local/bin \
|
||||||
|
@ -59,9 +45,6 @@ RUN apk update \
|
||||||
# 2. Adding required libraries to run i2pd to ensure it will run.
|
# 2. Adding required libraries to run i2pd to ensure it will run.
|
||||||
RUN apk --no-cache add boost-filesystem boost-system boost-program_options boost-date_time boost-thread boost-iostreams openssl miniupnpc musl-utils libstdc++
|
RUN apk --no-cache add boost-filesystem boost-system boost-program_options boost-date_time boost-thread boost-iostreams openssl miniupnpc musl-utils libstdc++
|
||||||
|
|
||||||
# 3. Copy preconfigured config file and entrypoint
|
|
||||||
COPY i2pd-docker.conf "$DATA_DIR/i2pd.conf"
|
|
||||||
RUN chown i2pd:nobody "$DATA_DIR/i2pd.conf"
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod a+x /entrypoint.sh
|
RUN chmod a+x /entrypoint.sh
|
||||||
|
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
## Preconfigured i2pd configuration file for a Docker container
|
|
||||||
## See https://i2pd.readthedocs.io/en/latest/user-guide/configuration/
|
|
||||||
## for more options you can use in this file.
|
|
||||||
|
|
||||||
## Note that for exposing ports outside of container you need to bind all services to 0.0.0.0
|
|
||||||
|
|
||||||
log = file
|
|
||||||
loglevel = none
|
|
||||||
|
|
||||||
ipv4 = true
|
|
||||||
ipv6 = false
|
|
||||||
|
|
||||||
# bandwidth = L
|
|
||||||
# notransit = false
|
|
||||||
# floodfill = false
|
|
||||||
|
|
||||||
[ntcp2]
|
|
||||||
enabled = true
|
|
||||||
published = true
|
|
||||||
|
|
||||||
[ssu2]
|
|
||||||
enabled = true
|
|
||||||
published = true
|
|
||||||
|
|
||||||
[http]
|
|
||||||
enabled = true
|
|
||||||
address = 0.0.0.0
|
|
||||||
port = 7070
|
|
||||||
|
|
||||||
[httpproxy]
|
|
||||||
enabled = true
|
|
||||||
address = 0.0.0.0
|
|
||||||
port = 4444
|
|
||||||
|
|
||||||
[socksproxy]
|
|
||||||
enabled = true
|
|
||||||
address = 0.0.0.0
|
|
||||||
port = 4447
|
|
||||||
|
|
||||||
[sam]
|
|
||||||
enabled = true
|
|
||||||
address = 0.0.0.0
|
|
||||||
port = 7656
|
|
||||||
|
|
||||||
[upnp]
|
|
||||||
enabled = false
|
|
||||||
|
|
||||||
[reseed]
|
|
||||||
verify = true
|
|
||||||
|
|
||||||
[limits]
|
|
||||||
# transittunnels = 2500
|
|
File diff suppressed because it is too large
Load diff
|
@ -2,20 +2,15 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
```
|
```
|
||||||
xgettext --omit-header -ctr: -ktr -kntr:1,2 daemon/HTTPServer.cpp libi2pd_client/HTTPProxy.cpp
|
xgettext --omit-header -ctr: -ktr -ktr:1,2 daemon/HTTPServer.cpp libi2pd_client/HTTPProxy.cpp
|
||||||
```
|
```
|
||||||
|
|
||||||
Regex for transforming gettext translations to our format:
|
Regex for transforming gettext translations to our format:
|
||||||
---
|
---
|
||||||
|
|
||||||
```
|
```
|
||||||
in: ^(\"|#[:.,]|msgctxt)(.*)$\n
|
in: msgid\ \"(.*)\"\nmsgid_plural\ \"(.*)\"\nmsgstr\[0\]\ \"(.*)\"\nmsgstr\[1\]\ \"(.*)\"\n(msgstr\[2\]\ \"(.*)\"\n)?(msgstr\[3\]\ \"(.*)\"\n)?(msgstr\[4\]\ \"(.*)\"\n)?(msgstr\[5\]\ \"(.*)\"\n)?
|
||||||
out: <to empty line>
|
out: #{"$2", {"$3", "$4", "$6", "$8", "$10"}},\n
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
in: msgid\ \"(.*)\"\nmsgid_plural\ \"(.*)\"\nmsgstr\[0\]\ \"(.*)\"\n(msgstr\[1\]\ \"(.*)\"\n)?(msgstr\[2\]\ \"(.*)\"\n)?(msgstr\[3\]\ \"(.*)\"\n)?(msgstr\[4\]\ \"(.*)\"\n)?(msgstr\[5\]\ \"(.*)\"\n)?
|
|
||||||
out: #{"$2", {"$3", "$5", "$7", "$9", "$11"}},\n
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -23,6 +18,10 @@ in: msgid\ \"(.*)\"\nmsgstr\ \"(.*)\"\n
|
||||||
out: {"$1", "$2"},\n
|
out: {"$1", "$2"},\n
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
in: ^#[:.](.*)$\n
|
||||||
|
out: <to empty line>
|
||||||
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
in: \n\n
|
in: \n\n
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
## Default: ~/.i2pd/certificates or /var/lib/i2pd/certificates
|
## Default: ~/.i2pd/certificates or /var/lib/i2pd/certificates
|
||||||
# certsdir = /var/lib/i2pd/certificates
|
# certsdir = /var/lib/i2pd/certificates
|
||||||
|
|
||||||
## Where to write pidfile (default: /run/i2pd.pid, not used in Windows)
|
## Where to write pidfile (default: i2pd.pid, not used in Windows)
|
||||||
# pidfile = /run/i2pd.pid
|
# pidfile = /run/i2pd.pid
|
||||||
|
|
||||||
## Logging configuration section
|
## Logging configuration section
|
||||||
|
@ -31,16 +31,15 @@
|
||||||
## * file - log entries to a file
|
## * file - log entries to a file
|
||||||
## * syslog - use syslog, see man 3 syslog
|
## * syslog - use syslog, see man 3 syslog
|
||||||
# log = file
|
# log = file
|
||||||
## Path to logfile (default: autodetect)
|
## Path to logfile (default - autodetect)
|
||||||
# logfile = /var/log/i2pd/i2pd.log
|
# logfile = /var/log/i2pd/i2pd.log
|
||||||
## Log messages above this level (debug, info, *warn, error, critical, none)
|
## Log messages above this level (debug, info, *warn, error, none)
|
||||||
## If you set it to none, logging will be disabled
|
## If you set it to none, logging will be disabled
|
||||||
# loglevel = warn
|
# loglevel = warn
|
||||||
## Write full CLF-formatted date and time to log (default: write only time)
|
## Write full CLF-formatted date and time to log (default: write only time)
|
||||||
# logclftime = true
|
# logclftime = true
|
||||||
|
|
||||||
## Daemon mode. Router will go to background after start. Ignored on Windows
|
## Daemon mode. Router will go to background after start. Ignored on Windows
|
||||||
## (default: true)
|
|
||||||
# daemon = true
|
# daemon = true
|
||||||
|
|
||||||
## Specify a family, router belongs to (default - none)
|
## Specify a family, router belongs to (default - none)
|
||||||
|
@ -71,97 +70,74 @@
|
||||||
## don't just uncomment this
|
## don't just uncomment this
|
||||||
# port = 4567
|
# port = 4567
|
||||||
|
|
||||||
## Enable communication through ipv4 (default: true)
|
## Enable communication through ipv4
|
||||||
ipv4 = true
|
ipv4 = true
|
||||||
## Enable communication through ipv6 (default: false)
|
## Enable communication through ipv6
|
||||||
ipv6 = false
|
ipv6 = false
|
||||||
|
|
||||||
|
## Enable SSU transport (default = true)
|
||||||
|
# ssu = true
|
||||||
|
|
||||||
## Bandwidth configuration
|
## Bandwidth configuration
|
||||||
## L limit bandwidth to 32 KB/sec, O - to 256 KB/sec, P - to 2048 KB/sec,
|
## L limit bandwidth to 32KBs/sec, O - to 256KBs/sec, P - to 2048KBs/sec,
|
||||||
## X - unlimited
|
## X - unlimited
|
||||||
## Default is L (regular node) and X if floodfill mode enabled.
|
## Default is L (regular node) and X if floodfill mode enabled. If you want to
|
||||||
## If you want to share more bandwidth without floodfill mode, uncomment
|
## share more bandwidth without floodfill mode, uncomment that line and adjust
|
||||||
## that line and adjust value to your possibilities. Value can be set to
|
## value to your possibilities
|
||||||
## integer in kilobytes, it will apply that limit and flag will be used
|
|
||||||
## from next upper limit (example: if you set 4096 flag will be X, but real
|
|
||||||
## limit will be 4096 KB/s). Same can be done when floodfill mode is used,
|
|
||||||
## but keep in mind that low values may be negatively evaluated by Java
|
|
||||||
## router algorithms.
|
|
||||||
# bandwidth = L
|
# bandwidth = L
|
||||||
## Max % of bandwidth limit for transit. 0-100 (default: 100)
|
## Max % of bandwidth limit for transit. 0-100. 100 by default
|
||||||
# share = 100
|
# share = 100
|
||||||
|
|
||||||
## Router will not accept transit tunnels, disabling transit traffic completely
|
## Router will not accept transit tunnels, disabling transit traffic completely
|
||||||
## (default: false)
|
## (default = false)
|
||||||
# notransit = true
|
# notransit = true
|
||||||
|
|
||||||
## Router will be floodfill (default: false)
|
## Router will be floodfill
|
||||||
## Note: that mode uses much more network connections and CPU!
|
## Note: that mode uses much more network connections and CPU!
|
||||||
# floodfill = true
|
# floodfill = true
|
||||||
|
|
||||||
[ntcp2]
|
|
||||||
## Enable NTCP2 transport (default: true)
|
|
||||||
# enabled = true
|
|
||||||
## Publish address in RouterInfo (default: true)
|
|
||||||
# published = true
|
|
||||||
## Port for incoming connections (default is global port option value)
|
|
||||||
# port = 4567
|
|
||||||
|
|
||||||
[ssu2]
|
|
||||||
## Enable SSU2 transport (default: true)
|
|
||||||
# enabled = true
|
|
||||||
## Publish address in RouterInfo (default: true)
|
|
||||||
# published = true
|
|
||||||
## Port for incoming connections (default is global port option value)
|
|
||||||
# port = 4567
|
|
||||||
|
|
||||||
[http]
|
[http]
|
||||||
## Web Console settings
|
## Web Console settings
|
||||||
## Enable the Web Console (default: true)
|
## Uncomment and set to 'false' to disable Web Console
|
||||||
# enabled = true
|
# enabled = true
|
||||||
## Address and port service will listen on (default: 127.0.0.1:7070)
|
## Address and port service will listen on
|
||||||
# address = 127.0.0.1
|
address = 127.0.0.1
|
||||||
# port = 7070
|
port = 7070
|
||||||
## Path to web console (default: /)
|
## Path to web console, default "/"
|
||||||
# webroot = /
|
# webroot = /
|
||||||
## Enable Web Console authentication (default: false)
|
## Uncomment following lines to enable Web Console authentication
|
||||||
## You should not use Web Console via public networks without additional encryption.
|
|
||||||
## HTTP authentication is not encryption layer!
|
|
||||||
# auth = true
|
# auth = true
|
||||||
# user = i2pd
|
# user = i2pd
|
||||||
# pass = changeme
|
# pass = changeme
|
||||||
## Select webconsole language
|
## Select webconsole language
|
||||||
## Currently supported english (default), afrikaans, armenian, chinese, czech, french,
|
## Currently supported english (default), afrikaans, armenian, german, russian,
|
||||||
## german, italian, polish, portuguese, russian, spanish, turkish, turkmen, ukrainian
|
## turkmen, ukrainian and uzbek languages
|
||||||
## and uzbek languages
|
|
||||||
# lang = english
|
# lang = english
|
||||||
|
|
||||||
[httpproxy]
|
[httpproxy]
|
||||||
## Enable the HTTP proxy (default: true)
|
## Uncomment and set to 'false' to disable HTTP Proxy
|
||||||
# enabled = true
|
# enabled = true
|
||||||
## Address and port service will listen on (default: 127.0.0.1:4444)
|
## Address and port service will listen on
|
||||||
# address = 127.0.0.1
|
address = 127.0.0.1
|
||||||
# port = 4444
|
port = 4444
|
||||||
## Optional keys file for proxy local destination (default: http-proxy-keys.dat)
|
## Optional keys file for proxy local destination
|
||||||
# keys = http-proxy-keys.dat
|
# keys = http-proxy-keys.dat
|
||||||
## Enable address helper for adding .i2p domains with "jump URLs" (default: true)
|
## Enable address helper for adding .i2p domains with "jump URLs" (default: true)
|
||||||
## You should disable this feature if your i2pd HTTP Proxy is public,
|
|
||||||
## because anyone could spoof the short domain via addresshelper and forward other users to phishing links
|
|
||||||
# addresshelper = true
|
# addresshelper = true
|
||||||
## Address of a proxy server inside I2P, which is used to visit regular Internet
|
## Address of a proxy server inside I2P, which is used to visit regular Internet
|
||||||
# outproxy = http://false.i2p
|
# outproxy = http://false.i2p
|
||||||
## httpproxy section also accepts I2CP parameters, like "inbound.length" etc.
|
## httpproxy section also accepts I2CP parameters, like "inbound.length" etc.
|
||||||
|
|
||||||
[socksproxy]
|
[socksproxy]
|
||||||
## Enable the SOCKS proxy (default: true)
|
## Uncomment and set to 'false' to disable SOCKS Proxy
|
||||||
# enabled = true
|
# enabled = true
|
||||||
## Address and port service will listen on (default: 127.0.0.1:4447)
|
## Address and port service will listen on
|
||||||
# address = 127.0.0.1
|
address = 127.0.0.1
|
||||||
# port = 4447
|
port = 4447
|
||||||
## Optional keys file for proxy local destination (default: socks-proxy-keys.dat)
|
## Optional keys file for proxy local destination
|
||||||
# keys = socks-proxy-keys.dat
|
# keys = socks-proxy-keys.dat
|
||||||
## Socks outproxy. Example below is set to use Tor for all connections except i2p
|
## Socks outproxy. Example below is set to use Tor for all connections except i2p
|
||||||
## Enable using of SOCKS outproxy (works only with SOCKS4, default: false)
|
## Uncomment and set to 'true' to enable using of SOCKS outproxy
|
||||||
# outproxy.enabled = false
|
# outproxy.enabled = false
|
||||||
## Address and port of outproxy
|
## Address and port of outproxy
|
||||||
# outproxy = 127.0.0.1
|
# outproxy = 127.0.0.1
|
||||||
|
@ -169,34 +145,33 @@ ipv6 = false
|
||||||
## socksproxy section also accepts I2CP parameters, like "inbound.length" etc.
|
## socksproxy section also accepts I2CP parameters, like "inbound.length" etc.
|
||||||
|
|
||||||
[sam]
|
[sam]
|
||||||
## Enable the SAM bridge (default: true)
|
## Comment or set to 'false' to disable SAM Bridge
|
||||||
# enabled = false
|
enabled = true
|
||||||
## Address and ports service will listen on (default: 127.0.0.1:7656, udp: 7655)
|
## Address and port service will listen on
|
||||||
# address = 127.0.0.1
|
# address = 127.0.0.1
|
||||||
# port = 7656
|
# port = 7656
|
||||||
# portudp = 7655
|
|
||||||
|
|
||||||
[bob]
|
[bob]
|
||||||
## Enable the BOB command channel (default: false)
|
## Uncomment and set to 'true' to enable BOB command channel
|
||||||
# enabled = false
|
# enabled = false
|
||||||
## Address and port service will listen on (default: 127.0.0.1:2827)
|
## Address and port service will listen on
|
||||||
# address = 127.0.0.1
|
# address = 127.0.0.1
|
||||||
# port = 2827
|
# port = 2827
|
||||||
|
|
||||||
[i2cp]
|
[i2cp]
|
||||||
## Enable the I2CP protocol (default: false)
|
## Uncomment and set to 'true' to enable I2CP protocol
|
||||||
# enabled = false
|
# enabled = false
|
||||||
## Address and port service will listen on (default: 127.0.0.1:7654)
|
## Address and port service will listen on
|
||||||
# address = 127.0.0.1
|
# address = 127.0.0.1
|
||||||
# port = 7654
|
# port = 7654
|
||||||
|
|
||||||
[i2pcontrol]
|
[i2pcontrol]
|
||||||
## Enable the I2PControl protocol (default: false)
|
## Uncomment and set to 'true' to enable I2PControl protocol
|
||||||
# enabled = false
|
# enabled = false
|
||||||
## Address and port service will listen on (default: 127.0.0.1:7650)
|
## Address and port service will listen on
|
||||||
# address = 127.0.0.1
|
# address = 127.0.0.1
|
||||||
# port = 7650
|
# port = 7650
|
||||||
## Authentication password (default: itoopie)
|
## Authentication password. "itoopie" by default
|
||||||
# password = itoopie
|
# password = itoopie
|
||||||
|
|
||||||
[precomputation]
|
[precomputation]
|
||||||
|
@ -207,11 +182,11 @@ ipv6 = false
|
||||||
[upnp]
|
[upnp]
|
||||||
## Enable or disable UPnP: automatic port forwarding (enabled by default in WINDOWS, ANDROID)
|
## Enable or disable UPnP: automatic port forwarding (enabled by default in WINDOWS, ANDROID)
|
||||||
# enabled = false
|
# enabled = false
|
||||||
## Name i2pd appears in UPnP forwardings list (default: I2Pd)
|
## Name i2pd appears in UPnP forwardings list (default = I2Pd)
|
||||||
# name = I2Pd
|
# name = I2Pd
|
||||||
|
|
||||||
[meshnets]
|
[meshnets]
|
||||||
## Enable connectivity over the Yggdrasil network (default: false)
|
## Enable connectivity over the Yggdrasil network
|
||||||
# yggdrasil = false
|
# yggdrasil = false
|
||||||
## You can bind address from your Yggdrasil subnet 300::/64
|
## You can bind address from your Yggdrasil subnet 300::/64
|
||||||
## The address must first be added to the network interface
|
## The address must first be added to the network interface
|
||||||
|
@ -219,13 +194,13 @@ ipv6 = false
|
||||||
|
|
||||||
[reseed]
|
[reseed]
|
||||||
## Options for bootstrapping into I2P network, aka reseeding
|
## Options for bootstrapping into I2P network, aka reseeding
|
||||||
## Enable reseed data verification (default: true)
|
## Enable or disable reseed data verification.
|
||||||
verify = true
|
verify = true
|
||||||
## URLs to request reseed data from, separated by comma
|
## URLs to request reseed data from, separated by comma
|
||||||
## Default: "mainline" I2P Network reseeds
|
## Default: "mainline" I2P Network reseeds
|
||||||
# urls = https://reseed.i2p-projekt.de/,https://i2p.mooo.com/netDb/,https://netdb.i2p2.no/
|
# urls = https://reseed.i2p-projekt.de/,https://i2p.mooo.com/netDb/,https://netdb.i2p2.no/
|
||||||
## Reseed URLs through the Yggdrasil, separated by comma
|
## Reseed URLs through the Yggdrasil, separated by comma
|
||||||
# yggurls = http://[324:71e:281a:9ed3::ace]:7070/
|
# yggurls = http://[324:9de3:fea4:f6ac::ace]:7070/
|
||||||
## Path to local reseed data file (.su3) for manual reseeding
|
## Path to local reseed data file (.su3) for manual reseeding
|
||||||
# file = /path/to/i2pseeds.su3
|
# file = /path/to/i2pseeds.su3
|
||||||
## or HTTPS URL to reseed from
|
## or HTTPS URL to reseed from
|
||||||
|
@ -235,7 +210,7 @@ verify = true
|
||||||
## If you run i2pd behind a proxy server, set proxy server for reseeding here
|
## If you run i2pd behind a proxy server, set proxy server for reseeding here
|
||||||
## Should be http://address:port or socks://address:port
|
## Should be http://address:port or socks://address:port
|
||||||
# proxy = http://127.0.0.1:8118
|
# proxy = http://127.0.0.1:8118
|
||||||
## Minimum number of known routers, below which i2pd triggers reseeding (default: 25)
|
## Minimum number of known routers, below which i2pd triggers reseeding. 25 by default
|
||||||
# threshold = 25
|
# threshold = 25
|
||||||
|
|
||||||
[addressbook]
|
[addressbook]
|
||||||
|
@ -243,25 +218,24 @@ verify = true
|
||||||
## Default: reg.i2p at "mainline" I2P Network
|
## Default: reg.i2p at "mainline" I2P Network
|
||||||
# defaulturl = http://shx5vqsw7usdaunyzr2qmes2fq37oumybpudrd4jjj4e4vk4uusa.b32.i2p/hosts.txt
|
# defaulturl = http://shx5vqsw7usdaunyzr2qmes2fq37oumybpudrd4jjj4e4vk4uusa.b32.i2p/hosts.txt
|
||||||
## Optional subscriptions URLs, separated by comma
|
## Optional subscriptions URLs, separated by comma
|
||||||
# subscriptions = http://reg.i2p/hosts.txt,http://identiguy.i2p/hosts.txt,http://stats.i2p/cgi-bin/newhosts.txt
|
# subscriptions = http://reg.i2p/hosts.txt,http://identiguy.i2p/hosts.txt,http://stats.i2p/cgi-bin/newhosts.txt,http://rus.i2p/hosts.txt
|
||||||
|
|
||||||
[limits]
|
[limits]
|
||||||
## Maximum active transit sessions (default: 5000)
|
## Maximum active transit sessions (default:2500)
|
||||||
## This value is doubled if floodfill mode is enabled!
|
# transittunnels = 2500
|
||||||
# transittunnels = 5000
|
|
||||||
## Limit number of open file descriptors (0 - use system limit)
|
## Limit number of open file descriptors (0 - use system limit)
|
||||||
# openfiles = 0
|
# openfiles = 0
|
||||||
## Maximum size of corefile in Kb (0 - use system limit)
|
## Maximum size of corefile in Kb (0 - use system limit)
|
||||||
# coresize = 0
|
# coresize = 0
|
||||||
|
|
||||||
[trust]
|
[trust]
|
||||||
## Enable explicit trust options. (default: false)
|
## Enable explicit trust options. false by default
|
||||||
# enabled = true
|
# enabled = true
|
||||||
## Make direct I2P connections only to routers in specified Family.
|
## Make direct I2P connections only to routers in specified Family.
|
||||||
# family = MyFamily
|
# family = MyFamily
|
||||||
## Make direct I2P connections only to routers specified here. Comma separated list of base64 identities.
|
## Make direct I2P connections only to routers specified here. Comma separated list of base64 identities.
|
||||||
# routers =
|
# routers =
|
||||||
## Should we hide our router from other routers? (default: false)
|
## Should we hide our router from other routers? false by default
|
||||||
# hidden = true
|
# hidden = true
|
||||||
|
|
||||||
[exploratory]
|
[exploratory]
|
||||||
|
@ -277,3 +251,11 @@ verify = true
|
||||||
## Save full addresses on disk (default: true)
|
## Save full addresses on disk (default: true)
|
||||||
# addressbook = true
|
# addressbook = true
|
||||||
|
|
||||||
|
[cpuext]
|
||||||
|
## Use CPU AES-NI instructions set when work with cryptography when available (default: true)
|
||||||
|
# aesni = true
|
||||||
|
## Use CPU AVX instructions set when work with cryptography when available (default: true)
|
||||||
|
# avx = true
|
||||||
|
## Force usage of CPU instructions set, even if they not found
|
||||||
|
## DO NOT TOUCH that option if you really don't know what are you doing!
|
||||||
|
# force = false
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=I2P Router written in C++
|
Description=I2P Router written in C++
|
||||||
Documentation=man:i2pd(1) https://i2pd.readthedocs.io/en/latest/
|
Documentation=man:i2pd(1) https://i2pd.readthedocs.io/en/latest/
|
||||||
Wants=network.target
|
After=network.target
|
||||||
After=network.target network-online.target
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=i2pd
|
User=i2pd
|
||||||
|
@ -12,7 +11,7 @@ RuntimeDirectoryMode=0700
|
||||||
LogsDirectory=i2pd
|
LogsDirectory=i2pd
|
||||||
LogsDirectoryMode=0700
|
LogsDirectoryMode=0700
|
||||||
Type=forking
|
Type=forking
|
||||||
ExecStart=/usr/bin/i2pd --conf=/etc/i2pd/i2pd.conf --tunconf=/etc/i2pd/tunnels.conf --tunnelsdir=/etc/i2pd/tunnels.conf.d --pidfile=/run/i2pd/i2pd.pid --logfile=/var/log/i2pd/i2pd.log --daemon --service
|
ExecStart=/usr/sbin/i2pd --conf=/etc/i2pd/i2pd.conf --tunconf=/etc/i2pd/tunnels.conf --tunnelsdir=/etc/i2pd/tunnels.conf.d --pidfile=/run/i2pd/i2pd.pid --logfile=/var/log/i2pd/i2pd.log --daemon --service
|
||||||
ExecReload=/bin/sh -c "kill -HUP $MAINPID"
|
ExecReload=/bin/sh -c "kill -HUP $MAINPID"
|
||||||
PIDFile=/run/i2pd/i2pd.pid
|
PIDFile=/run/i2pd/i2pd.pid
|
||||||
### Uncomment, if auto restart needed
|
### Uncomment, if auto restart needed
|
||||||
|
@ -30,7 +29,7 @@ SendSIGKILL=yes
|
||||||
#TimeoutStopSec=10m
|
#TimeoutStopSec=10m
|
||||||
|
|
||||||
# If you have problems with hanging i2pd, you can try increase this
|
# If you have problems with hanging i2pd, you can try increase this
|
||||||
LimitNOFILE=8192
|
LimitNOFILE=4096
|
||||||
# To enable write of coredump uncomment this
|
# To enable write of coredump uncomment this
|
||||||
#LimitCORE=infinity
|
#LimitCORE=infinity
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ tunconf="/etc/i2pd/tunnels.conf"
|
||||||
tundir="/etc/i2pd/tunnels.conf.d"
|
tundir="/etc/i2pd/tunnels.conf.d"
|
||||||
|
|
||||||
name="i2pd"
|
name="i2pd"
|
||||||
command="/usr/bin/i2pd"
|
command="/usr/sbin/i2pd"
|
||||||
command_args="--service --daemon --log=file --logfile=$logfile --conf=$mainconf --tunconf=$tunconf --tunnelsdir=$tundir --pidfile=$pidfile"
|
command_args="--service --daemon --log=file --logfile=$logfile --conf=$mainconf --tunconf=$tunconf --tunnelsdir=$tundir --pidfile=$pidfile"
|
||||||
description="i2p router written in C++"
|
description="i2p router written in C++"
|
||||||
required_dirs="/var/lib/i2pd"
|
required_dirs="/var/lib/i2pd"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
%define git_hash %(git rev-parse HEAD | cut -c -7)
|
%define git_hash %(git rev-parse HEAD | cut -c -7)
|
||||||
|
|
||||||
Name: i2pd-git
|
Name: i2pd-git
|
||||||
Version: 2.56.0
|
Version: 2.41.0
|
||||||
Release: git%{git_hash}%{?dist}
|
Release: git%{git_hash}%{?dist}
|
||||||
Summary: I2P router written in C++
|
Summary: I2P router written in C++
|
||||||
Conflicts: i2pd
|
Conflicts: i2pd
|
||||||
|
@ -24,19 +24,13 @@ BuildRequires: openssl-devel
|
||||||
BuildRequires: miniupnpc-devel
|
BuildRequires: miniupnpc-devel
|
||||||
BuildRequires: systemd-units
|
BuildRequires: systemd-units
|
||||||
|
|
||||||
%if 0%{?fedora} == 41
|
|
||||||
BuildRequires: openssl-devel-engine
|
|
||||||
%endif
|
|
||||||
|
|
||||||
Requires: logrotate
|
Requires: logrotate
|
||||||
Requires: systemd
|
Requires: systemd
|
||||||
Requires(pre): %{_sbindir}/useradd %{_sbindir}/groupadd
|
Requires(pre): %{_sbindir}/useradd %{_sbindir}/groupadd
|
||||||
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
C++ implementation of I2P.
|
C++ implementation of I2P.
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n i2pd-openssl
|
%setup -q -n i2pd-openssl
|
||||||
|
|
||||||
|
@ -62,42 +56,46 @@ cd build
|
||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if 0%{?rhel} == 9 || 0%{?fedora} >= 35 || 0%{?eln}
|
|
||||||
|
%if 0%{?fedora} >= 35
|
||||||
pushd redhat-linux-build
|
pushd redhat-linux-build
|
||||||
%else
|
%else
|
||||||
%if 0%{?fedora} >= 33
|
%if 0%{?fedora} >= 33
|
||||||
pushd %{_target_platform}
|
pushd %{_target_platform}
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%if 0%{?mageia} > 7
|
%if 0%{?mageia} > 7
|
||||||
pushd build
|
pushd build
|
||||||
%endif
|
%endif
|
||||||
%endif
|
|
||||||
|
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
%if 0%{?rhel} == 9 || 0%{?fedora} >= 33 || 0%{?mageia} > 7
|
%if 0%{?fedora} >= 33
|
||||||
popd
|
popd
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if 0%{?mageia} > 7
|
||||||
|
popd
|
||||||
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
pushd build
|
pushd build
|
||||||
|
|
||||||
%if 0%{?rhel} == 9 || 0%{?fedora} >= 35 || 0%{?eln}
|
%if 0%{?fedora} >= 35
|
||||||
pushd redhat-linux-build
|
pushd redhat-linux-build
|
||||||
%else
|
%else
|
||||||
%if 0%{?fedora} >= 33
|
%if 0%{?fedora} >= 33
|
||||||
pushd %{_target_platform}
|
pushd %{_target_platform}
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%if 0%{?mageia}
|
%if 0%{?mageia}
|
||||||
pushd build
|
pushd build
|
||||||
%endif
|
%endif
|
||||||
%endif
|
|
||||||
|
|
||||||
chrpath -d i2pd
|
chrpath -d i2pd
|
||||||
%{__install} -D -m 755 i2pd %{buildroot}%{_bindir}/i2pd
|
%{__install} -D -m 755 i2pd %{buildroot}%{_sbindir}/i2pd
|
||||||
%{__install} -d -m 755 %{buildroot}%{_datadir}/i2pd
|
%{__install} -d -m 755 %{buildroot}%{_datadir}/i2pd
|
||||||
%{__install} -d -m 700 %{buildroot}%{_sharedstatedir}/i2pd
|
%{__install} -d -m 700 %{buildroot}%{_sharedstatedir}/i2pd
|
||||||
%{__install} -d -m 700 %{buildroot}%{_localstatedir}/log/i2pd
|
%{__install} -d -m 700 %{buildroot}%{_localstatedir}/log/i2pd
|
||||||
|
@ -133,7 +131,7 @@ getent passwd i2pd >/dev/null || \
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc LICENSE README.md contrib/i2pd.conf contrib/subscriptions.txt contrib/tunnels.conf contrib/tunnels.d
|
%doc LICENSE README.md contrib/i2pd.conf contrib/subscriptions.txt contrib/tunnels.conf contrib/tunnels.d
|
||||||
%{_bindir}/i2pd
|
%{_sbindir}/i2pd
|
||||||
%config(noreplace) %{_sysconfdir}/i2pd/*.conf
|
%config(noreplace) %{_sysconfdir}/i2pd/*.conf
|
||||||
%config(noreplace) %{_sysconfdir}/i2pd/tunnels.conf.d/*.conf
|
%config(noreplace) %{_sysconfdir}/i2pd/tunnels.conf.d/*.conf
|
||||||
%config %{_sysconfdir}/i2pd/subscriptions.txt
|
%config %{_sysconfdir}/i2pd/subscriptions.txt
|
||||||
|
@ -148,69 +146,6 @@ getent passwd i2pd >/dev/null || \
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Feb 11 2025 orignal <orignal@i2pmail.org> - 2.56.0
|
|
||||||
- update to 2.56.0
|
|
||||||
|
|
||||||
* Mon Dec 30 2024 orignal <orignal@i2pmail.org> - 2.55.0
|
|
||||||
- update to 2.55.0
|
|
||||||
|
|
||||||
* Sun Oct 6 2024 orignal <orignal@i2pmail.org> - 2.54.0
|
|
||||||
- update to 2.54.0
|
|
||||||
|
|
||||||
* Tue Jul 30 2024 orignal <orignal@i2pmail.org> - 2.53.1
|
|
||||||
- update to 2.53.1
|
|
||||||
|
|
||||||
* Fri Jul 19 2024 orignal <orignal@i2pmail.org> - 2.53.0
|
|
||||||
- update to 2.53.0
|
|
||||||
|
|
||||||
* Sun May 12 2024 orignal <orignal@i2pmail.org> - 2.52.0
|
|
||||||
- update to 2.52.0
|
|
||||||
|
|
||||||
* Sat Apr 06 2024 orignal <orignal@i2pmail.org> - 2.51.0
|
|
||||||
- update to 2.51.0
|
|
||||||
|
|
||||||
* Sat Jan 06 2024 orignal <orignal@i2pmail.org> - 2.50.2
|
|
||||||
- update to 2.50.2
|
|
||||||
|
|
||||||
* Sat Dec 23 2023 r4sas <r4sas@i2pmail.org> - 2.50.1
|
|
||||||
- update to 2.50.1
|
|
||||||
|
|
||||||
* Mon Dec 18 2023 orignal <orignal@i2pmail.org> - 2.50.0
|
|
||||||
- update to 2.50.0
|
|
||||||
|
|
||||||
* Mon Sep 18 2023 orignal <orignal@i2pmail.org> - 2.49.0
|
|
||||||
- update to 2.49.0
|
|
||||||
|
|
||||||
* Mon Jun 12 2023 orignal <orignal@i2pmail.org> - 2.48.0
|
|
||||||
- update to 2.48.0
|
|
||||||
|
|
||||||
* Sat Mar 11 2023 orignal <orignal@i2pmail.org> - 2.47.0
|
|
||||||
- update to 2.47.0
|
|
||||||
|
|
||||||
* Mon Feb 20 2023 r4sas <r4sas@i2pmail.org> - 2.46.1
|
|
||||||
- update to 2.46.1
|
|
||||||
|
|
||||||
* Wed Feb 15 2023 orignal <orignal@i2pmail.org> - 2.46.0
|
|
||||||
- update to 2.46.0
|
|
||||||
|
|
||||||
* Wed Jan 11 2023 orignal <orignal@i2pmail.org> - 2.45.1
|
|
||||||
- update to 2.45.1
|
|
||||||
|
|
||||||
* Tue Jan 3 2023 orignal <orignal@i2pmail.org> - 2.45.0
|
|
||||||
- update to 2.45.0
|
|
||||||
|
|
||||||
* Sun Nov 20 2022 orignal <orignal@i2pmail.org> - 2.44.0
|
|
||||||
- update to 2.44.0
|
|
||||||
|
|
||||||
* Mon Aug 22 2022 orignal <orignal@i2pmail.org> - 2.43.0
|
|
||||||
- update to 2.43.0
|
|
||||||
|
|
||||||
* Tue May 24 2022 r4sas <r4sas@i2pmail.org> - 2.42.1
|
|
||||||
- update to 2.42.1
|
|
||||||
|
|
||||||
* Sun May 22 2022 orignal <orignal@i2pmail.org> - 2.42.0
|
|
||||||
- update to 2.42.0
|
|
||||||
|
|
||||||
* Sun Feb 20 2022 r4sas <r4sas@i2pmail.org> - 2.41.0
|
* Sun Feb 20 2022 r4sas <r4sas@i2pmail.org> - 2.41.0
|
||||||
- update to 2.41.0
|
- update to 2.41.0
|
||||||
- fixed build on Fedora Copr over openssl trunk code
|
- fixed build on Fedora Copr over openssl trunk code
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Name: i2pd
|
Name: i2pd
|
||||||
Version: 2.56.0
|
Version: 2.41.0
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: I2P router written in C++
|
Summary: I2P router written in C++
|
||||||
Conflicts: i2pd-git
|
Conflicts: i2pd-git
|
||||||
|
@ -22,19 +22,13 @@ BuildRequires: openssl-devel
|
||||||
BuildRequires: miniupnpc-devel
|
BuildRequires: miniupnpc-devel
|
||||||
BuildRequires: systemd-units
|
BuildRequires: systemd-units
|
||||||
|
|
||||||
%if 0%{?fedora} == 41
|
|
||||||
BuildRequires: openssl-devel-engine
|
|
||||||
%endif
|
|
||||||
|
|
||||||
Requires: logrotate
|
Requires: logrotate
|
||||||
Requires: systemd
|
Requires: systemd
|
||||||
Requires(pre): %{_sbindir}/useradd %{_sbindir}/groupadd
|
Requires(pre): %{_sbindir}/useradd %{_sbindir}/groupadd
|
||||||
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
C++ implementation of I2P.
|
C++ implementation of I2P.
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
|
||||||
|
@ -60,42 +54,45 @@ cd build
|
||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if 0%{?rhel} == 9 || 0%{?fedora} >= 35 || 0%{?eln}
|
%if 0%{?fedora} >= 35
|
||||||
pushd redhat-linux-build
|
pushd redhat-linux-build
|
||||||
%else
|
%else
|
||||||
%if 0%{?fedora} >= 33
|
%if 0%{?fedora} >= 33
|
||||||
pushd %{_target_platform}
|
pushd %{_target_platform}
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%if 0%{?mageia} > 7
|
%if 0%{?mageia} > 7
|
||||||
pushd build
|
pushd build
|
||||||
%endif
|
%endif
|
||||||
%endif
|
|
||||||
|
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
%if 0%{?rhel} == 9 || 0%{?fedora} >= 33 || 0%{?mageia} > 7
|
%if 0%{?fedora} >= 33
|
||||||
popd
|
popd
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if 0%{?mageia} > 7
|
||||||
|
popd
|
||||||
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
pushd build
|
pushd build
|
||||||
|
|
||||||
%if 0%{?rhel} == 9 || 0%{?fedora} >= 35 || 0%{?eln}
|
%if 0%{?fedora} >= 35
|
||||||
pushd redhat-linux-build
|
pushd redhat-linux-build
|
||||||
%else
|
%else
|
||||||
%if 0%{?fedora} >= 33
|
%if 0%{?fedora} >= 33
|
||||||
pushd %{_target_platform}
|
pushd %{_target_platform}
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%if 0%{?mageia}
|
%if 0%{?mageia}
|
||||||
pushd build
|
pushd build
|
||||||
%endif
|
%endif
|
||||||
%endif
|
|
||||||
|
|
||||||
chrpath -d i2pd
|
chrpath -d i2pd
|
||||||
%{__install} -D -m 755 i2pd %{buildroot}%{_bindir}/i2pd
|
%{__install} -D -m 755 i2pd %{buildroot}%{_sbindir}/i2pd
|
||||||
%{__install} -d -m 755 %{buildroot}%{_datadir}/i2pd
|
%{__install} -d -m 755 %{buildroot}%{_datadir}/i2pd
|
||||||
%{__install} -d -m 700 %{buildroot}%{_sharedstatedir}/i2pd
|
%{__install} -d -m 700 %{buildroot}%{_sharedstatedir}/i2pd
|
||||||
%{__install} -d -m 700 %{buildroot}%{_localstatedir}/log/i2pd
|
%{__install} -d -m 700 %{buildroot}%{_localstatedir}/log/i2pd
|
||||||
|
@ -131,7 +128,7 @@ getent passwd i2pd >/dev/null || \
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc LICENSE README.md contrib/i2pd.conf contrib/subscriptions.txt contrib/tunnels.conf contrib/tunnels.d
|
%doc LICENSE README.md contrib/i2pd.conf contrib/subscriptions.txt contrib/tunnels.conf contrib/tunnels.d
|
||||||
%{_bindir}/i2pd
|
%{_sbindir}/i2pd
|
||||||
%config(noreplace) %{_sysconfdir}/i2pd/*.conf
|
%config(noreplace) %{_sysconfdir}/i2pd/*.conf
|
||||||
%config(noreplace) %{_sysconfdir}/i2pd/tunnels.conf.d/*.conf
|
%config(noreplace) %{_sysconfdir}/i2pd/tunnels.conf.d/*.conf
|
||||||
%config %{_sysconfdir}/i2pd/subscriptions.txt
|
%config %{_sysconfdir}/i2pd/subscriptions.txt
|
||||||
|
@ -146,69 +143,6 @@ getent passwd i2pd >/dev/null || \
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Feb 11 2025 orignal <orignal@i2pmail.org> - 2.56.0
|
|
||||||
- update to 2.56.0
|
|
||||||
|
|
||||||
* Mon Dec 30 2024 orignal <orignal@i2pmail.org> - 2.55.0
|
|
||||||
- update to 2.55.0
|
|
||||||
|
|
||||||
* Sun Oct 6 2024 orignal <orignal@i2pmail.org> - 2.54.0
|
|
||||||
- update to 2.54.0
|
|
||||||
|
|
||||||
* Tue Jul 30 2024 orignal <orignal@i2pmail.org> - 2.53.1
|
|
||||||
- update to 2.53.1
|
|
||||||
|
|
||||||
* Fri Jul 19 2024 orignal <orignal@i2pmail.org> - 2.53.0
|
|
||||||
- update to 2.53.0
|
|
||||||
|
|
||||||
* Sun May 12 2024 orignal <orignal@i2pmail.org> - 2.52.0
|
|
||||||
- update to 2.52.0
|
|
||||||
|
|
||||||
* Sat Apr 06 2024 orignal <orignal@i2pmail.org> - 2.51.0
|
|
||||||
- update to 2.51.0
|
|
||||||
|
|
||||||
* Sat Jan 06 2024 orignal <orignal@i2pmail.org> - 2.50.2
|
|
||||||
- update to 2.50.2
|
|
||||||
|
|
||||||
* Sat Dec 23 2023 r4sas <r4sas@i2pmail.org> - 2.50.1
|
|
||||||
- update to 2.50.1
|
|
||||||
|
|
||||||
* Mon Dec 18 2023 orignal <orignal@i2pmail.org> - 2.50.0
|
|
||||||
- update to 2.50.0
|
|
||||||
|
|
||||||
* Mon Sep 18 2023 orignal <orignal@i2pmail.org> - 2.49.0
|
|
||||||
- update to 2.49.0
|
|
||||||
|
|
||||||
* Mon Jun 12 2023 orignal <orignal@i2pmail.org> - 2.48.0
|
|
||||||
- update to 2.48.0
|
|
||||||
|
|
||||||
* Sat Mar 11 2023 orignal <orignal@i2pmail.org> - 2.47.0
|
|
||||||
- update to 2.47.0
|
|
||||||
|
|
||||||
* Mon Feb 20 2023 r4sas <r4sas@i2pmail.org> - 2.46.1
|
|
||||||
- update to 2.46.1
|
|
||||||
|
|
||||||
* Wed Feb 15 2023 orignal <orignal@i2pmail.org> - 2.46.0
|
|
||||||
- update to 2.46.0
|
|
||||||
|
|
||||||
* Wed Jan 11 2023 orignal <orignal@i2pmail.org> - 2.45.1
|
|
||||||
- update to 2.45.1
|
|
||||||
|
|
||||||
* Tue Jan 3 2023 orignal <orignal@i2pmail.org> - 2.45.0
|
|
||||||
- update to 2.45.0
|
|
||||||
|
|
||||||
* Sun Nov 20 2022 orignal <orignal@i2pmail.org> - 2.44.0
|
|
||||||
- update to 2.44.0
|
|
||||||
|
|
||||||
* Mon Aug 22 2022 orignal <orignal@i2pmail.org> - 2.43.0
|
|
||||||
- update to 2.43.0
|
|
||||||
|
|
||||||
* Tue May 24 2022 r4sas <r4sas@i2pmail.org> - 2.42.1
|
|
||||||
- update to 2.42.1
|
|
||||||
|
|
||||||
* Sun May 22 2022 orignal <orignal@i2pmail.org> - 2.42.0
|
|
||||||
- update to 2.42.0
|
|
||||||
|
|
||||||
* Sun Feb 20 2022 r4sas <r4sas@i2pmail.org> - 2.41.0
|
* Sun Feb 20 2022 r4sas <r4sas@i2pmail.org> - 2.41.0
|
||||||
- update to 2.41.0
|
- update to 2.41.0
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ port = 6668
|
||||||
destination = irc.ilita.i2p
|
destination = irc.ilita.i2p
|
||||||
destinationport = 6667
|
destinationport = 6667
|
||||||
keys = irc-keys.dat
|
keys = irc-keys.dat
|
||||||
i2p.streaming.profile=2
|
|
||||||
|
|
||||||
#[IRC-IRC2P]
|
#[IRC-IRC2P]
|
||||||
#type = client
|
#type = client
|
||||||
|
|
|
@ -8,4 +8,4 @@ env LOGFILE="/var/log/i2pd/i2pd.log"
|
||||||
|
|
||||||
expect fork
|
expect fork
|
||||||
|
|
||||||
exec /usr/bin/i2pd --daemon --service --log=file --logfile=$LOGFILE
|
exec /usr/sbin/i2pd --daemon --service --log=file --logfile=$LOGFILE
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2021-2023, The PurpleI2P Project
|
* Copyright (c) 2021-2022, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
|
@ -43,7 +43,7 @@ a, .slide label {
|
||||||
color: var(--main-link-color);
|
color: var(--main-link-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
a:hover, a.button.selected, .slide label:hover, button[type=submit]:hover {
|
a:hover, .slide label:hover, button[type=submit]:hover {
|
||||||
color: var(--main-link-hover-color);
|
color: var(--main-link-hover-color);
|
||||||
background: var(--main-link-color);
|
background: var(--main-link-color);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2024, The PurpleI2P Project
|
* Copyright (c) 2013-2020, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
|
@ -31,6 +31,7 @@
|
||||||
#include "Crypto.h"
|
#include "Crypto.h"
|
||||||
#include "UPnP.h"
|
#include "UPnP.h"
|
||||||
#include "Timestamp.h"
|
#include "Timestamp.h"
|
||||||
|
#include "util.h"
|
||||||
#include "I18N.h"
|
#include "I18N.h"
|
||||||
|
|
||||||
namespace i2p
|
namespace i2p
|
||||||
|
@ -57,16 +58,12 @@ namespace util
|
||||||
bool Daemon_Singleton::IsService () const
|
bool Daemon_Singleton::IsService () const
|
||||||
{
|
{
|
||||||
bool service = false;
|
bool service = false;
|
||||||
|
#ifndef _WIN32
|
||||||
i2p::config::GetOption("service", service);
|
i2p::config::GetOption("service", service);
|
||||||
|
#endif
|
||||||
return service;
|
return service;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Daemon_Singleton::setDataDir(std::string path)
|
|
||||||
{
|
|
||||||
if (path != "")
|
|
||||||
DaemonDataDir = path;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Daemon_Singleton::init(int argc, char* argv[]) {
|
bool Daemon_Singleton::init(int argc, char* argv[]) {
|
||||||
return init(argc, argv, nullptr);
|
return init(argc, argv, nullptr);
|
||||||
}
|
}
|
||||||
|
@ -77,13 +74,7 @@ namespace util
|
||||||
i2p::config::ParseCmdline(argc, argv);
|
i2p::config::ParseCmdline(argc, argv);
|
||||||
|
|
||||||
std::string config; i2p::config::GetOption("conf", config);
|
std::string config; i2p::config::GetOption("conf", config);
|
||||||
std::string datadir;
|
std::string datadir; i2p::config::GetOption("datadir", datadir);
|
||||||
if(DaemonDataDir != "") {
|
|
||||||
datadir = DaemonDataDir;
|
|
||||||
} else {
|
|
||||||
i2p::config::GetOption("datadir", datadir);
|
|
||||||
}
|
|
||||||
|
|
||||||
i2p::fs::DetectDataDir(datadir, IsService());
|
i2p::fs::DetectDataDir(datadir, IsService());
|
||||||
i2p::fs::Init();
|
i2p::fs::Init();
|
||||||
|
|
||||||
|
@ -149,44 +140,131 @@ namespace util
|
||||||
LogPrint(eLogDebug, "FS: Certificates directory: ", certsdir);
|
LogPrint(eLogDebug, "FS: Certificates directory: ", certsdir);
|
||||||
|
|
||||||
bool precomputation; i2p::config::GetOption("precomputation.elgamal", precomputation);
|
bool precomputation; i2p::config::GetOption("precomputation.elgamal", precomputation);
|
||||||
bool ssu; i2p::config::GetOption("ssu", ssu);
|
bool aesni; i2p::config::GetOption("cpuext.aesni", aesni);
|
||||||
if (!ssu && i2p::config::IsDefault ("precomputation.elgamal"))
|
bool avx; i2p::config::GetOption("cpuext.avx", avx);
|
||||||
precomputation = false; // we don't elgamal table if no ssu, unless it's specified explicitly
|
bool forceCpuExt; i2p::config::GetOption("cpuext.force", forceCpuExt);
|
||||||
i2p::crypto::InitCrypto (precomputation);
|
i2p::crypto::InitCrypto (precomputation, aesni, avx, forceCpuExt);
|
||||||
|
|
||||||
i2p::transport::InitAddressFromIface (); // get address4/6 from interfaces
|
|
||||||
|
|
||||||
int netID; i2p::config::GetOption("netid", netID);
|
int netID; i2p::config::GetOption("netid", netID);
|
||||||
i2p::context.SetNetID (netID);
|
i2p::context.SetNetID (netID);
|
||||||
|
|
||||||
bool checkReserved; i2p::config::GetOption("reservedrange", checkReserved);
|
|
||||||
i2p::transport::transports.SetCheckReserved(checkReserved);
|
|
||||||
|
|
||||||
i2p::context.Init ();
|
i2p::context.Init ();
|
||||||
|
|
||||||
i2p::transport::InitTransports ();
|
bool ipv6; i2p::config::GetOption("ipv6", ipv6);
|
||||||
|
bool ipv4; i2p::config::GetOption("ipv4", ipv4);
|
||||||
|
#ifdef MESHNET
|
||||||
|
// manual override for meshnet
|
||||||
|
ipv4 = false;
|
||||||
|
ipv6 = true;
|
||||||
|
#endif
|
||||||
|
// ifname -> address
|
||||||
|
std::string ifname; i2p::config::GetOption("ifname", ifname);
|
||||||
|
if (ipv4 && i2p::config::IsDefault ("address4"))
|
||||||
|
{
|
||||||
|
std::string ifname4; i2p::config::GetOption("ifname4", ifname4);
|
||||||
|
if (!ifname4.empty ())
|
||||||
|
i2p::config::SetOption ("address4", i2p::util::net::GetInterfaceAddress(ifname4, false).to_string ()); // v4
|
||||||
|
else if (!ifname.empty ())
|
||||||
|
i2p::config::SetOption ("address4", i2p::util::net::GetInterfaceAddress(ifname, false).to_string ()); // v4
|
||||||
|
}
|
||||||
|
if (ipv6 && i2p::config::IsDefault ("address6"))
|
||||||
|
{
|
||||||
|
std::string ifname6; i2p::config::GetOption("ifname6", ifname6);
|
||||||
|
if (!ifname6.empty ())
|
||||||
|
i2p::config::SetOption ("address6", i2p::util::net::GetInterfaceAddress(ifname6, true).to_string ()); // v6
|
||||||
|
else if (!ifname.empty ())
|
||||||
|
i2p::config::SetOption ("address6", i2p::util::net::GetInterfaceAddress(ifname, true).to_string ()); // v6
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ygg; i2p::config::GetOption("meshnets.yggdrasil", ygg);
|
||||||
|
boost::asio::ip::address_v6 yggaddr;
|
||||||
|
if (ygg)
|
||||||
|
{
|
||||||
|
std::string yggaddress; i2p::config::GetOption ("meshnets.yggaddress", yggaddress);
|
||||||
|
if (!yggaddress.empty ())
|
||||||
|
{
|
||||||
|
yggaddr = boost::asio::ip::address_v6::from_string (yggaddress);
|
||||||
|
if (yggaddr.is_unspecified () || !i2p::util::net::IsYggdrasilAddress (yggaddr) ||
|
||||||
|
!i2p::util::net::IsLocalAddress (yggaddr))
|
||||||
|
{
|
||||||
|
LogPrint(eLogWarning, "Daemon: Can't find Yggdrasil address ", yggaddress);
|
||||||
|
ygg = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
yggaddr = i2p::util::net::GetYggdrasilAddress ();
|
||||||
|
if (yggaddr.is_unspecified ())
|
||||||
|
{
|
||||||
|
LogPrint(eLogWarning, "Daemon: Yggdrasil is not running. Disabled");
|
||||||
|
ygg = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t port; i2p::config::GetOption("port", port);
|
||||||
|
if (!i2p::config::IsDefault("port"))
|
||||||
|
{
|
||||||
|
LogPrint(eLogInfo, "Daemon: Accepting incoming connections at port ", port);
|
||||||
|
i2p::context.UpdatePort (port);
|
||||||
|
}
|
||||||
|
i2p::context.SetSupportsV6 (ipv6);
|
||||||
|
i2p::context.SetSupportsV4 (ipv4);
|
||||||
|
i2p::context.SetSupportsMesh (ygg, yggaddr);
|
||||||
|
|
||||||
|
i2p::context.RemoveNTCPAddress (!ipv6); // TODO: remove later
|
||||||
|
bool ntcp2; i2p::config::GetOption("ntcp2.enabled", ntcp2);
|
||||||
|
if (ntcp2)
|
||||||
|
{
|
||||||
|
bool published; i2p::config::GetOption("ntcp2.published", published);
|
||||||
|
if (published)
|
||||||
|
{
|
||||||
|
std::string ntcp2proxy; i2p::config::GetOption("ntcp2.proxy", ntcp2proxy);
|
||||||
|
if (!ntcp2proxy.empty ()) published = false;
|
||||||
|
}
|
||||||
|
if (published)
|
||||||
|
{
|
||||||
|
uint16_t ntcp2port; i2p::config::GetOption("ntcp2.port", ntcp2port);
|
||||||
|
if (!ntcp2port) ntcp2port = port; // use standard port
|
||||||
|
i2p::context.PublishNTCP2Address (ntcp2port, true, ipv4, ipv6, false); // publish
|
||||||
|
if (ipv6)
|
||||||
|
{
|
||||||
|
std::string ipv6Addr; i2p::config::GetOption("ntcp2.addressv6", ipv6Addr);
|
||||||
|
auto addr = boost::asio::ip::address_v6::from_string (ipv6Addr);
|
||||||
|
if (!addr.is_unspecified () && addr != boost::asio::ip::address_v6::any ())
|
||||||
|
i2p::context.UpdateNTCP2V6Address (addr); // set ipv6 address if configured
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
i2p::context.PublishNTCP2Address (port, false, ipv4, ipv6, false); // unpublish
|
||||||
|
}
|
||||||
|
if (ygg)
|
||||||
|
{
|
||||||
|
i2p::context.PublishNTCP2Address (port, true, false, false, true);
|
||||||
|
i2p::context.UpdateNTCP2V6Address (yggaddr);
|
||||||
|
if (!ipv4 && !ipv6)
|
||||||
|
i2p::context.SetStatus (eRouterStatusMesh);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool transit; i2p::config::GetOption("notransit", transit);
|
||||||
|
i2p::context.SetAcceptsTunnels (!transit);
|
||||||
|
uint16_t transitTunnels; i2p::config::GetOption("limits.transittunnels", transitTunnels);
|
||||||
|
SetMaxNumTransitTunnels (transitTunnels);
|
||||||
|
|
||||||
bool isFloodfill; i2p::config::GetOption("floodfill", isFloodfill);
|
bool isFloodfill; i2p::config::GetOption("floodfill", isFloodfill);
|
||||||
if (isFloodfill)
|
if (isFloodfill) {
|
||||||
{
|
|
||||||
LogPrint(eLogInfo, "Daemon: Router configured as floodfill");
|
LogPrint(eLogInfo, "Daemon: Router configured as floodfill");
|
||||||
i2p::context.SetFloodfill (true);
|
i2p::context.SetFloodfill (true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
i2p::context.SetFloodfill (false);
|
i2p::context.SetFloodfill (false);
|
||||||
|
}
|
||||||
bool transit; i2p::config::GetOption("notransit", transit);
|
|
||||||
i2p::context.SetAcceptsTunnels (!transit);
|
|
||||||
uint32_t transitTunnels; i2p::config::GetOption("limits.transittunnels", transitTunnels);
|
|
||||||
if (isFloodfill && i2p::config::IsDefault ("limits.transittunnels"))
|
|
||||||
transitTunnels *= 2; // double default number of transit tunnels for floodfill
|
|
||||||
i2p::tunnel::tunnels.SetMaxNumTransitTunnels (transitTunnels);
|
|
||||||
|
|
||||||
/* this section also honors 'floodfill' flag, if set above */
|
/* this section also honors 'floodfill' flag, if set above */
|
||||||
std::string bandwidth; i2p::config::GetOption("bandwidth", bandwidth);
|
std::string bandwidth; i2p::config::GetOption("bandwidth", bandwidth);
|
||||||
if (bandwidth.length () > 0)
|
if (bandwidth.length () > 0)
|
||||||
{
|
{
|
||||||
if (bandwidth.length () == 1 && ((bandwidth[0] >= 'K' && bandwidth[0] <= 'P') || bandwidth[0] == 'X' ))
|
if (bandwidth[0] >= 'K' && bandwidth[0] <= 'X')
|
||||||
{
|
{
|
||||||
i2p::context.SetBandwidth (bandwidth[0]);
|
i2p::context.SetBandwidth (bandwidth[0]);
|
||||||
LogPrint(eLogInfo, "Daemon: Bandwidth set to ", i2p::context.GetBandwidthLimit (), "KBps");
|
LogPrint(eLogInfo, "Daemon: Bandwidth set to ", i2p::context.GetBandwidthLimit (), "KBps");
|
||||||
|
@ -270,7 +348,7 @@ namespace util
|
||||||
if (hidden)
|
if (hidden)
|
||||||
{
|
{
|
||||||
LogPrint(eLogInfo, "Daemon: Hidden mode enabled");
|
LogPrint(eLogInfo, "Daemon: Hidden mode enabled");
|
||||||
i2p::context.SetHidden(true);
|
i2p::data::netdb.SetHidden(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string httpLang; i2p::config::GetOption("http.lang", httpLang);
|
std::string httpLang; i2p::config::GetOption("http.lang", httpLang);
|
||||||
|
@ -299,17 +377,19 @@ namespace util
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ntcp2; i2p::config::GetOption("ntcp2.enabled", ntcp2);
|
bool ntcp2; i2p::config::GetOption("ntcp2.enabled", ntcp2);
|
||||||
bool ssu2; i2p::config::GetOption("ssu2.enabled", ssu2);
|
bool ssu; i2p::config::GetOption("ssu", ssu);
|
||||||
|
bool checkInReserved; i2p::config::GetOption("reservedrange", checkInReserved);
|
||||||
LogPrint(eLogInfo, "Daemon: Starting Transports");
|
LogPrint(eLogInfo, "Daemon: Starting Transports");
|
||||||
if(!ssu2) LogPrint(eLogInfo, "Daemon: SSU2 disabled");
|
if(!ssu) LogPrint(eLogInfo, "Daemon: SSU disabled");
|
||||||
if(!ntcp2) LogPrint(eLogInfo, "Daemon: NTCP2 disabled");
|
if(!ntcp2) LogPrint(eLogInfo, "Daemon: NTCP2 disabled");
|
||||||
|
|
||||||
i2p::transport::transports.Start(ntcp2, ssu2);
|
i2p::transport::transports.SetCheckReserved(checkInReserved);
|
||||||
if (i2p::transport::transports.IsBoundSSU2() || i2p::transport::transports.IsBoundNTCP2())
|
i2p::transport::transports.Start(ntcp2, ssu);
|
||||||
|
if (i2p::transport::transports.IsBoundSSU() || i2p::transport::transports.IsBoundNTCP2())
|
||||||
LogPrint(eLogInfo, "Daemon: Transports started");
|
LogPrint(eLogInfo, "Daemon: Transports started");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LogPrint(eLogCritical, "Daemon: Failed to start Transports");
|
LogPrint(eLogError, "Daemon: Failed to start Transports");
|
||||||
/** shut down netdb right away */
|
/** shut down netdb right away */
|
||||||
i2p::transport::transports.Stop();
|
i2p::transport::transports.Stop();
|
||||||
i2p::data::netdb.Stop();
|
i2p::data::netdb.Stop();
|
||||||
|
@ -328,17 +408,15 @@ namespace util
|
||||||
}
|
}
|
||||||
catch (std::exception& ex)
|
catch (std::exception& ex)
|
||||||
{
|
{
|
||||||
LogPrint (eLogCritical, "Daemon: Failed to start Webconsole: ", ex.what ());
|
LogPrint (eLogError, "Daemon: Failed to start Webconsole: ", ex.what ());
|
||||||
ThrowFatal ("Unable to start webconsole at ", httpAddr, ":", httpPort, ": ", ex.what ());
|
ThrowFatal ("Unable to start webconsole at ", httpAddr, ":", httpPort, ": ", ex.what ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LogPrint(eLogInfo, "Daemon: Starting Tunnels");
|
LogPrint(eLogInfo, "Daemon: Starting Tunnels");
|
||||||
i2p::tunnel::tunnels.Start();
|
i2p::tunnel::tunnels.Start();
|
||||||
|
|
||||||
LogPrint(eLogInfo, "Daemon: Starting Router context");
|
|
||||||
i2p::context.Start();
|
|
||||||
|
|
||||||
LogPrint(eLogInfo, "Daemon: Starting Client");
|
LogPrint(eLogInfo, "Daemon: Starting Client");
|
||||||
i2p::client::context.Start ();
|
i2p::client::context.Start ();
|
||||||
|
|
||||||
|
@ -355,7 +433,7 @@ namespace util
|
||||||
}
|
}
|
||||||
catch (std::exception& ex)
|
catch (std::exception& ex)
|
||||||
{
|
{
|
||||||
LogPrint (eLogCritical, "Daemon: Failed to start I2PControl: ", ex.what ());
|
LogPrint (eLogError, "Daemon: Failed to start I2PControl: ", ex.what ());
|
||||||
ThrowFatal ("Unable to start I2PControl service at ", i2pcpAddr, ":", i2pcpPort, ": ", ex.what ());
|
ThrowFatal ("Unable to start I2PControl service at ", i2pcpAddr, ":", i2pcpPort, ": ", ex.what ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -367,8 +445,6 @@ namespace util
|
||||||
LogPrint(eLogInfo, "Daemon: Shutting down");
|
LogPrint(eLogInfo, "Daemon: Shutting down");
|
||||||
LogPrint(eLogInfo, "Daemon: Stopping Client");
|
LogPrint(eLogInfo, "Daemon: Stopping Client");
|
||||||
i2p::client::context.Stop();
|
i2p::client::context.Stop();
|
||||||
LogPrint(eLogInfo, "Daemon: Stopping Router context");
|
|
||||||
i2p::context.Stop();
|
|
||||||
LogPrint(eLogInfo, "Daemon: Stopping Tunnels");
|
LogPrint(eLogInfo, "Daemon: Stopping Tunnels");
|
||||||
i2p::tunnel::tunnels.Stop();
|
i2p::tunnel::tunnels.Stop();
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,6 @@ namespace util
|
||||||
virtual bool stop();
|
virtual bool stop();
|
||||||
virtual void run () {};
|
virtual void run () {};
|
||||||
|
|
||||||
virtual void setDataDir (std::string path);
|
|
||||||
|
|
||||||
bool isDaemon;
|
bool isDaemon;
|
||||||
bool running;
|
bool running;
|
||||||
|
|
||||||
|
@ -43,10 +41,6 @@ namespace util
|
||||||
// d-pointer for httpServer, httpProxy, etc.
|
// d-pointer for httpServer, httpProxy, etc.
|
||||||
class Daemon_Singleton_Private;
|
class Daemon_Singleton_Private;
|
||||||
Daemon_Singleton_Private &d;
|
Daemon_Singleton_Private &d;
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
std::string DaemonDataDir;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(QT_GUI_LIB) // check if QT
|
#if defined(QT_GUI_LIB) // check if QT
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2025, The PurpleI2P Project
|
* Copyright (c) 2013-2022, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
|
@ -80,14 +80,15 @@ namespace http {
|
||||||
const char HTTP_COMMAND_SHUTDOWN_CANCEL[] = "shutdown_cancel";
|
const char HTTP_COMMAND_SHUTDOWN_CANCEL[] = "shutdown_cancel";
|
||||||
const char HTTP_COMMAND_SHUTDOWN_NOW[] = "terminate";
|
const char HTTP_COMMAND_SHUTDOWN_NOW[] = "terminate";
|
||||||
const char HTTP_COMMAND_RUN_PEER_TEST[] = "run_peer_test";
|
const char HTTP_COMMAND_RUN_PEER_TEST[] = "run_peer_test";
|
||||||
const char HTTP_COMMAND_RELOAD_TUNNELS_CONFIG[] = "reload_tunnels_config";
|
const char HTTP_COMMAND_RELOAD_CONFIG[] = "reload_config";
|
||||||
const char HTTP_COMMAND_LOGLEVEL[] = "set_loglevel";
|
const char HTTP_COMMAND_LOGLEVEL[] = "set_loglevel";
|
||||||
const char HTTP_COMMAND_KILLSTREAM[] = "closestream";
|
const char HTTP_COMMAND_KILLSTREAM[] = "closestream";
|
||||||
const char HTTP_COMMAND_LIMITTRANSIT[] = "limittransit";
|
const char HTTP_COMMAND_LIMITTRANSIT[] = "limittransit";
|
||||||
const char HTTP_COMMAND_GET_REG_STRING[] = "get_reg_string";
|
const char HTTP_COMMAND_GET_REG_STRING[] = "get_reg_string";
|
||||||
const char HTTP_COMMAND_SETLANGUAGE[] = "setlanguage";
|
const char HTTP_COMMAND_SETLANGUAGE[] = "setlanguage";
|
||||||
const char HTTP_COMMAND_RELOAD_CSS[] = "reload_css";
|
const char HTTP_COMMAND_RELOAD_CSS[] = "reload_css";
|
||||||
const char HTTP_COMMAND_EXPIRELEASE[] = "expirelease";
|
const char HTTP_PARAM_SAM_SESSION_ID[] = "id";
|
||||||
|
const char HTTP_PARAM_ADDRESS[] = "address";
|
||||||
|
|
||||||
static std::string ConvertTime (uint64_t time)
|
static std::string ConvertTime (uint64_t time)
|
||||||
{
|
{
|
||||||
|
@ -104,18 +105,18 @@ namespace http {
|
||||||
int num;
|
int num;
|
||||||
|
|
||||||
if ((num = seconds / 86400) > 0) {
|
if ((num = seconds / 86400) > 0) {
|
||||||
s << ntr("%d day", "%d days", num, num) << ", ";
|
s << num << " " << tr("day", "days", num) << ", ";
|
||||||
seconds -= num * 86400;
|
seconds -= num * 86400;
|
||||||
}
|
}
|
||||||
if ((num = seconds / 3600) > 0) {
|
if ((num = seconds / 3600) > 0) {
|
||||||
s << ntr("%d hour", "%d hours", num, num) << ", ";
|
s << num << " " << tr("hour", "hours", num) << ", ";
|
||||||
seconds -= num * 3600;
|
seconds -= num * 3600;
|
||||||
}
|
}
|
||||||
if ((num = seconds / 60) > 0) {
|
if ((num = seconds / 60) > 0) {
|
||||||
s << ntr("%d minute", "%d minutes", num, num) << ", ";
|
s << num << " " << tr("minute", "minutes", num) << ", ";
|
||||||
seconds -= num * 60;
|
seconds -= num * 60;
|
||||||
}
|
}
|
||||||
s << ntr("%d second", "%d seconds", seconds, seconds);
|
s << seconds << " " << tr("second", "seconds", seconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShowTraffic (std::stringstream& s, uint64_t bytes)
|
static void ShowTraffic (std::stringstream& s, uint64_t bytes)
|
||||||
|
@ -123,38 +124,40 @@ namespace http {
|
||||||
s << std::fixed << std::setprecision(2);
|
s << std::fixed << std::setprecision(2);
|
||||||
auto numKBytes = (double) bytes / 1024;
|
auto numKBytes = (double) bytes / 1024;
|
||||||
if (numKBytes < 1024)
|
if (numKBytes < 1024)
|
||||||
s << tr(/* tr: Kibibyte */ "%.2f KiB", numKBytes);
|
s << numKBytes << " " << tr(/* tr: Kibibit */ "KiB");
|
||||||
else if (numKBytes < 1024 * 1024)
|
else if (numKBytes < 1024 * 1024)
|
||||||
s << tr(/* tr: Mebibyte */ "%.2f MiB", numKBytes / 1024);
|
s << numKBytes / 1024 << " " << tr(/* tr: Mebibit */ "MiB");
|
||||||
else
|
else
|
||||||
s << tr(/* tr: Gibibyte */ "%.2f GiB", numKBytes / 1024 / 1024);
|
s << numKBytes / 1024 / 1024 << " " << tr(/* tr: Gibibit */ "GiB");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShowTunnelDetails (std::stringstream& s, enum i2p::tunnel::TunnelState eState, bool explr, int bytes)
|
static void ShowTunnelDetails (std::stringstream& s, enum i2p::tunnel::TunnelState eState, bool explr, int bytes)
|
||||||
{
|
{
|
||||||
std::string state;
|
std::string state, stateText;
|
||||||
std::string_view stateText;
|
switch (eState) {
|
||||||
switch (eState)
|
|
||||||
{
|
|
||||||
case i2p::tunnel::eTunnelStateBuildReplyReceived :
|
case i2p::tunnel::eTunnelStateBuildReplyReceived :
|
||||||
case i2p::tunnel::eTunnelStatePending : state = "building"; break;
|
case i2p::tunnel::eTunnelStatePending : state = "building"; break;
|
||||||
case i2p::tunnel::eTunnelStateBuildFailed : state = "failed"; stateText = "declined"; break;
|
case i2p::tunnel::eTunnelStateBuildFailed :
|
||||||
case i2p::tunnel::eTunnelStateTestFailed : state = "failed"; stateText = "test failed"; break;
|
case i2p::tunnel::eTunnelStateTestFailed :
|
||||||
case i2p::tunnel::eTunnelStateFailed : state = "failed"; break;
|
case i2p::tunnel::eTunnelStateFailed : state = "failed"; break;
|
||||||
case i2p::tunnel::eTunnelStateExpiring : state = "expiring"; break;
|
case i2p::tunnel::eTunnelStateExpiring : state = "expiring"; break;
|
||||||
case i2p::tunnel::eTunnelStateEstablished : state = "established"; break;
|
case i2p::tunnel::eTunnelStateEstablished : state = "established"; break;
|
||||||
default: state = "unknown"; break;
|
default: state = "unknown"; break;
|
||||||
}
|
}
|
||||||
if (stateText.empty ()) stateText = tr(state);
|
|
||||||
|
|
||||||
s << "<span class=\"tunnel " << state << "\"> " << stateText << ((explr) ? " (" + std::string(tr("exploratory")) + ")" : "") << "</span>, "; // TODO:
|
if (state == "building") stateText = tr("building");
|
||||||
ShowTraffic(s, bytes);
|
else if (state == "failed") stateText = tr("failed");
|
||||||
s << "\r\n";
|
else if (state == "expiring") stateText = tr("expiring");
|
||||||
|
else if (state == "established") stateText = tr("established");
|
||||||
|
else stateText = tr("unknown");
|
||||||
|
|
||||||
|
s << "<span class=\"tunnel " << state << "\"> " << stateText << ((explr) ? " (" + tr("exploratory") + ")" : "") << "</span>, ";
|
||||||
|
s << " " << (int) (bytes / 1024) << " " << tr(/* tr: Kibibit */ "KiB") << "\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SetLogLevel (const std::string& level)
|
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);
|
i2p::log::Logger().SetLogLevel(level);
|
||||||
else {
|
else {
|
||||||
LogPrint(eLogError, "HTTPServer: Unknown loglevel set attempted");
|
LogPrint(eLogError, "HTTPServer: Unknown loglevel set attempted");
|
||||||
|
@ -179,7 +182,7 @@ namespace http {
|
||||||
" <meta charset=\"UTF-8\">\r\n"
|
" <meta charset=\"UTF-8\">\r\n"
|
||||||
" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n"
|
" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n"
|
||||||
" <link rel=\"shortcut icon\" href=\"" << itoopieFavicon << "\">\r\n"
|
" <link rel=\"shortcut icon\" href=\"" << itoopieFavicon << "\">\r\n"
|
||||||
" <title>" << tr(/* tr: Webconsole page title */ "Purple I2P Webconsole") << "</title>\r\n";
|
" <title>Purple I2P " VERSION " Webconsole</title>\r\n";
|
||||||
GetStyles(s);
|
GetStyles(s);
|
||||||
s <<
|
s <<
|
||||||
"</head>\r\n"
|
"</head>\r\n"
|
||||||
|
@ -193,10 +196,8 @@ namespace http {
|
||||||
if (i2p::context.IsFloodfill ())
|
if (i2p::context.IsFloodfill ())
|
||||||
s << " <a href=\"" << webroot << "?page=" << HTTP_PAGE_LEASESETS << "\">" << tr("LeaseSets") << "</a><br>\r\n";
|
s << " <a href=\"" << webroot << "?page=" << HTTP_PAGE_LEASESETS << "\">" << tr("LeaseSets") << "</a><br>\r\n";
|
||||||
s <<
|
s <<
|
||||||
" <a href=\"" << webroot << "?page=" << HTTP_PAGE_TUNNELS << "\">" << tr("Tunnels") << "</a><br>\r\n";
|
" <a href=\"" << webroot << "?page=" << HTTP_PAGE_TUNNELS << "\">" << tr("Tunnels") << "</a><br>\r\n"
|
||||||
if (i2p::context.AcceptsTunnels () || i2p::tunnel::tunnels.CountTransitTunnels())
|
" <a href=\"" << webroot << "?page=" << HTTP_PAGE_TRANSIT_TUNNELS << "\">" << tr("Transit Tunnels") << "</a><br>\r\n"
|
||||||
s << " <a href=\"" << webroot << "?page=" << HTTP_PAGE_TRANSIT_TUNNELS << "\">" << tr("Transit Tunnels") << "</a><br>\r\n";
|
|
||||||
s <<
|
|
||||||
" <a href=\"" << webroot << "?page=" << HTTP_PAGE_TRANSPORTS << "\">" << tr ("Transports") << "</a><br>\r\n"
|
" <a href=\"" << webroot << "?page=" << HTTP_PAGE_TRANSPORTS << "\">" << tr ("Transports") << "</a><br>\r\n"
|
||||||
" <a href=\"" << webroot << "?page=" << HTTP_PAGE_I2P_TUNNELS << "\">" << tr("I2P tunnels") << "</a><br>\r\n";
|
" <a href=\"" << webroot << "?page=" << HTTP_PAGE_I2P_TUNNELS << "\">" << tr("I2P tunnels") << "</a><br>\r\n";
|
||||||
if (i2p::client::context.GetSAMBridge ())
|
if (i2p::client::context.GetSAMBridge ())
|
||||||
|
@ -214,27 +215,25 @@ namespace http {
|
||||||
"</html>\r\n";
|
"</html>\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShowError(std::stringstream& s, std::string_view string)
|
static void ShowError(std::stringstream& s, const std::string& string)
|
||||||
{
|
{
|
||||||
s << "<b>" << tr("ERROR") << ":</b> " << string << "<br>\r\n";
|
s << "<b>" << tr("ERROR") << ":</b> " << string << "<br>\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShowNetworkStatus (std::stringstream& s, RouterStatus status, bool testing, RouterError error)
|
static void ShowNetworkStatus (std::stringstream& s, RouterStatus status)
|
||||||
{
|
{
|
||||||
switch (status)
|
switch (status)
|
||||||
{
|
{
|
||||||
case eRouterStatusOK: s << tr("OK"); break;
|
case eRouterStatusOK: s << tr("OK"); break;
|
||||||
|
case eRouterStatusTesting: s << tr("Testing"); break;
|
||||||
case eRouterStatusFirewalled: s << tr("Firewalled"); break;
|
case eRouterStatusFirewalled: s << tr("Firewalled"); break;
|
||||||
case eRouterStatusUnknown: s << tr("Unknown"); break;
|
case eRouterStatusUnknown: s << tr("Unknown"); break;
|
||||||
case eRouterStatusProxy: s << tr("Proxy"); break;
|
case eRouterStatusProxy: s << tr("Proxy"); break;
|
||||||
case eRouterStatusMesh: s << tr("Mesh"); break;
|
case eRouterStatusMesh: s << tr("Mesh"); break;
|
||||||
default: s << tr("Unknown");
|
case eRouterStatusError:
|
||||||
}
|
|
||||||
if (testing)
|
|
||||||
s << " (" << tr("Testing") << ")";
|
|
||||||
if (error != eRouterErrorNone)
|
|
||||||
{
|
{
|
||||||
switch (error)
|
s << tr("Error");
|
||||||
|
switch (i2p::context.GetError ())
|
||||||
{
|
{
|
||||||
case eRouterErrorClockSkew:
|
case eRouterErrorClockSkew:
|
||||||
s << " - " << tr("Clock skew");
|
s << " - " << tr("Clock skew");
|
||||||
|
@ -245,14 +244,11 @@ namespace http {
|
||||||
case eRouterErrorSymmetricNAT:
|
case eRouterErrorSymmetricNAT:
|
||||||
s << " - " << tr("Symmetric NAT");
|
s << " - " << tr("Symmetric NAT");
|
||||||
break;
|
break;
|
||||||
case eRouterErrorFullConeNAT:
|
|
||||||
s << " - " << tr("Full cone NAT");
|
|
||||||
break;
|
|
||||||
case eRouterErrorNoDescriptors:
|
|
||||||
s << " - " << tr("No Descriptors");
|
|
||||||
break;
|
|
||||||
default: ;
|
default: ;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: s << tr("Unknown");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,12 +258,12 @@ namespace http {
|
||||||
ShowUptime(s, i2p::context.GetUptime ());
|
ShowUptime(s, i2p::context.GetUptime ());
|
||||||
s << "<br>\r\n";
|
s << "<br>\r\n";
|
||||||
s << "<b>" << tr("Network status") << ":</b> ";
|
s << "<b>" << tr("Network status") << ":</b> ";
|
||||||
ShowNetworkStatus (s, i2p::context.GetStatus (), i2p::context.GetTesting(), i2p::context.GetError ());
|
ShowNetworkStatus (s, i2p::context.GetStatus ());
|
||||||
s << "<br>\r\n";
|
s << "<br>\r\n";
|
||||||
if (i2p::context.SupportsV6 ())
|
if (i2p::context.SupportsV6 ())
|
||||||
{
|
{
|
||||||
s << "<b>" << tr("Network status v6") << ":</b> ";
|
s << "<b>" << tr("Network status v6") << ":</b> ";
|
||||||
ShowNetworkStatus (s, i2p::context.GetStatusV6 (), i2p::context.GetTestingV6(), i2p::context.GetErrorV6 ());
|
ShowNetworkStatus (s, i2p::context.GetStatusV6 ());
|
||||||
s << "<br>\r\n";
|
s << "<br>\r\n";
|
||||||
}
|
}
|
||||||
#if ((!defined(WIN32) && !defined(QT_GUI_LIB) && !defined(ANDROID)) || defined(ANDROID_BINARY))
|
#if ((!defined(WIN32) && !defined(QT_GUI_LIB) && !defined(ANDROID)) || defined(ANDROID_BINARY))
|
||||||
|
@ -288,69 +284,59 @@ namespace http {
|
||||||
if (family.length () > 0)
|
if (family.length () > 0)
|
||||||
s << "<b>"<< tr("Family") << ":</b> " << family << "<br>\r\n";
|
s << "<b>"<< tr("Family") << ":</b> " << family << "<br>\r\n";
|
||||||
s << "<b>" << tr("Tunnel creation success rate") << ":</b> " << i2p::tunnel::tunnels.GetTunnelCreationSuccessRate () << "%<br>\r\n";
|
s << "<b>" << tr("Tunnel creation success rate") << ":</b> " << i2p::tunnel::tunnels.GetTunnelCreationSuccessRate () << "%<br>\r\n";
|
||||||
bool isTotalTCSR;
|
|
||||||
i2p::config::GetOption("http.showTotalTCSR", isTotalTCSR);
|
|
||||||
if (isTotalTCSR) {
|
|
||||||
s << "<b>" << tr("Total tunnel creation success rate") << ":</b> " << i2p::tunnel::tunnels.GetTotalTunnelCreationSuccessRate() << "%<br/>\r\n";
|
|
||||||
}
|
|
||||||
s << "<b>" << tr("Received") << ":</b> ";
|
s << "<b>" << tr("Received") << ":</b> ";
|
||||||
ShowTraffic (s, i2p::transport::transports.GetTotalReceivedBytes ());
|
ShowTraffic (s, i2p::transport::transports.GetTotalReceivedBytes ());
|
||||||
s << " (" << tr(/* tr: Kibibyte/s */ "%.2f KiB/s", (double) i2p::transport::transports.GetInBandwidth15s () / 1024) << ")<br>\r\n";
|
s << " (" << (double) i2p::transport::transports.GetInBandwidth () / 1024 << " " << tr(/* tr: Kibibit/s */ "KiB/s") << ")<br>\r\n";
|
||||||
s << "<b>" << tr("Sent") << ":</b> ";
|
s << "<b>" << tr("Sent") << ":</b> ";
|
||||||
ShowTraffic (s, i2p::transport::transports.GetTotalSentBytes ());
|
ShowTraffic (s, i2p::transport::transports.GetTotalSentBytes ());
|
||||||
s << " (" << tr(/* tr: Kibibyte/s */ "%.2f KiB/s", (double) i2p::transport::transports.GetOutBandwidth15s () / 1024) << ")<br>\r\n";
|
s << " (" << (double) i2p::transport::transports.GetOutBandwidth () / 1024 << " " << tr(/* tr: Kibibit/s */ "KiB/s") << ")<br>\r\n";
|
||||||
s << "<b>" << tr("Transit") << ":</b> ";
|
s << "<b>" << tr("Transit") << ":</b> ";
|
||||||
ShowTraffic (s, i2p::transport::transports.GetTotalTransitTransmittedBytes ());
|
ShowTraffic (s, i2p::transport::transports.GetTotalTransitTransmittedBytes ());
|
||||||
s << " (" << tr(/* tr: Kibibyte/s */ "%.2f KiB/s", (double) i2p::transport::transports.GetTransitBandwidth15s () / 1024) << ")<br>\r\n";
|
s << " (" << (double) i2p::transport::transports.GetTransitBandwidth () / 1024 << " " << tr(/* tr: Kibibit/s */ "KiB/s") << ")<br>\r\n";
|
||||||
s << "<b>" << tr("Data path") << ":</b> " << i2p::fs::GetUTF8DataDir() << "<br>\r\n";
|
s << "<b>" << tr("Data path") << ":</b> " << i2p::fs::GetUTF8DataDir() << "<br>\r\n";
|
||||||
s << "<div class='slide'>";
|
s << "<div class='slide'>";
|
||||||
if((outputFormat == OutputFormatEnum::forWebConsole) || !includeHiddenContent) {
|
if((outputFormat == OutputFormatEnum::forWebConsole) || !includeHiddenContent) {
|
||||||
s << "<label for=\"slide-info\">" << tr("Hidden content. Press on text to see.") << "</label>\r\n<input type=\"checkbox\" id=\"slide-info\" />\r\n<div class=\"slidecontent\">\r\n";
|
s << "<label for=\"slide-info\">" << tr("Hidden content. Press on text to see.") << "</label>\r\n<input type=\"checkbox\" id=\"slide-info\" />\r\n<div class=\"slidecontent\">\r\n";
|
||||||
}
|
}
|
||||||
if (includeHiddenContent)
|
if(includeHiddenContent) {
|
||||||
{
|
|
||||||
s << "<b>" << tr("Router Ident") << ":</b> " << i2p::context.GetRouterInfo().GetIdentHashBase64() << "<br>\r\n";
|
s << "<b>" << tr("Router Ident") << ":</b> " << i2p::context.GetRouterInfo().GetIdentHashBase64() << "<br>\r\n";
|
||||||
if (!i2p::context.GetRouterInfo().GetProperty("family").empty())
|
if (!i2p::context.GetRouterInfo().GetProperty("family").empty())
|
||||||
s << "<b>" << tr("Router Family") << ":</b> " << i2p::context.GetRouterInfo().GetProperty("family") << "<br>\r\n";
|
s << "<b>" << tr("Router Family") << ":</b> " << i2p::context.GetRouterInfo().GetProperty("family") << "<br>\r\n";
|
||||||
s << "<b>" << tr("Router Caps") << ":</b> " << i2p::context.GetRouterInfo().GetProperty("caps") << "<br>\r\n";
|
s << "<b>" << tr("Router Caps") << ":</b> " << i2p::context.GetRouterInfo().GetProperty("caps") << "<br>\r\n";
|
||||||
s << "<b>" << tr("Version") << ":</b> " VERSION "<br>\r\n";
|
s << "<b>" << tr("Version") << ":</b> " VERSION "<br>\r\n";
|
||||||
s << "<b>"<< tr("Our external address") << ":</b>" << "<br>\r\n<table class=\"extaddr\"><tbody>\r\n";
|
s << "<b>"<< tr("Our external address") << ":</b>" << "<br>\r\n<table class=\"extaddr\"><tbody>\r\n";
|
||||||
auto addresses = i2p::context.GetRouterInfo().GetAddresses ();
|
for (const auto& address : i2p::context.GetRouterInfo().GetAddresses())
|
||||||
if (addresses)
|
|
||||||
{
|
{
|
||||||
for (const auto& address : *addresses)
|
s << "<tr>\r\n";
|
||||||
|
if (address->IsNTCP2 () && !address->IsPublishedNTCP2 ())
|
||||||
{
|
{
|
||||||
if (!address) continue;
|
s << "<td>NTCP2";
|
||||||
s << "<tr>\r\n<td>";
|
if (address->host.is_v6 ()) s << "v6";
|
||||||
|
s << "</td><td>" << tr("supported") << "</td>\r\n</tr>\r\n";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
switch (address->transportStyle)
|
switch (address->transportStyle)
|
||||||
{
|
{
|
||||||
case i2p::data::RouterInfo::eTransportNTCP2:
|
case i2p::data::RouterInfo::eTransportNTCP:
|
||||||
s << "NTCP2";
|
|
||||||
break;
|
|
||||||
case i2p::data::RouterInfo::eTransportSSU2:
|
|
||||||
s << "SSU2";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
s << tr("Unknown");
|
|
||||||
}
|
|
||||||
bool v6 = address->IsV6 ();
|
|
||||||
if (v6)
|
|
||||||
{
|
{
|
||||||
if (address->IsV4 ()) s << "v4";
|
s << "<td>NTCP";
|
||||||
|
if (address->IsPublishedNTCP2 ()) s << "2";
|
||||||
|
if (address->host.is_v6 ()) s << "v6";
|
||||||
|
s << "</td>\r\n";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case i2p::data::RouterInfo::eTransportSSU:
|
||||||
|
{
|
||||||
|
s << "<td>SSU";
|
||||||
|
if (address->host.is_v6 ())
|
||||||
s << "v6";
|
s << "v6";
|
||||||
}
|
|
||||||
s << "</td>\r\n";
|
|
||||||
if (address->published)
|
|
||||||
s << "<td>" << (v6 ? "[" : "") << address->host.to_string() << (v6 ? "]:" : ":") << address->port << "</td>\r\n";
|
|
||||||
else
|
|
||||||
{
|
|
||||||
s << "<td>" << tr(/* tr: Shown when router doesn't publish itself and have "Firewalled" state */ "supported");
|
|
||||||
if (address->port)
|
|
||||||
s << " :" << address->port;
|
|
||||||
s << "</td>\r\n";
|
s << "</td>\r\n";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
s << "</tr>\r\n";
|
default:
|
||||||
|
s << "<td>" << tr("Unknown") << "</td>\r\n";
|
||||||
}
|
}
|
||||||
|
s << "<td>" << address->host.to_string() << ":" << address->port << "</td>\r\n</tr>\r\n";
|
||||||
}
|
}
|
||||||
s << "</tbody></table>\r\n";
|
s << "</tbody></table>\r\n";
|
||||||
}
|
}
|
||||||
|
@ -418,23 +404,10 @@ namespace http {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ShowHop(std::stringstream& s, const i2p::data::IdentityEx& ident)
|
|
||||||
{
|
|
||||||
auto identHash = ident.GetIdentHash();
|
|
||||||
auto router = i2p::data::netdb.FindRouter(identHash);
|
|
||||||
s << i2p::data::GetIdentHashAbbreviation(identHash);
|
|
||||||
if (router)
|
|
||||||
s << "<small style=\"color:gray\"> " << router->GetBandwidthCap() << "</small>";
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ShowLeaseSetDestination (std::stringstream& s, std::shared_ptr<const i2p::client::LeaseSetDestination> dest, uint32_t token)
|
static void ShowLeaseSetDestination (std::stringstream& s, std::shared_ptr<const i2p::client::LeaseSetDestination> dest, uint32_t token)
|
||||||
{
|
{
|
||||||
s << "<b>Base32:</b><br>\r\n<textarea readonly cols=\"80\" rows=\"1\">";
|
|
||||||
s << dest->GetIdentHash ().ToBase32 () << "</textarea><br>\r\n<br>\r\n";
|
|
||||||
|
|
||||||
s << "<b>Base64:</b><br>\r\n<textarea readonly cols=\"80\" rows=\"8\">";
|
s << "<b>Base64:</b><br>\r\n<textarea readonly cols=\"80\" rows=\"8\">";
|
||||||
s << dest->GetIdentity ()->ToBase64 () << "</textarea><br>\r\n<br>\r\n";
|
s << dest->GetIdentity ()->ToBase64 () << "</textarea><br>\r\n<br>\r\n";
|
||||||
|
|
||||||
if (dest->IsEncryptedLeaseSet ())
|
if (dest->IsEncryptedLeaseSet ())
|
||||||
{
|
{
|
||||||
i2p::data::BlindedPublicKey blinded (dest->GetIdentity (), dest->IsPerClientAuth ());
|
i2p::data::BlindedPublicKey blinded (dest->GetIdentity (), dest->IsPerClientAuth ());
|
||||||
|
@ -443,14 +416,15 @@ namespace http {
|
||||||
s << "</div>\r\n</div>\r\n";
|
s << "</div>\r\n</div>\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dest->IsPublic() && token && !dest->IsEncryptedLeaseSet ())
|
if(dest->IsPublic())
|
||||||
{
|
{
|
||||||
std::string webroot; i2p::config::GetOption("http.webroot", webroot);
|
std::string webroot; i2p::config::GetOption("http.webroot", webroot);
|
||||||
|
auto base32 = dest->GetIdentHash ().ToBase32 ();
|
||||||
s << "<div class='slide'><label for='slide-regaddr'><b>" << tr("Address registration line") << "</b></label>\r\n<input type=\"checkbox\" id=\"slide-regaddr\" />\r\n<div class=\"slidecontent\">\r\n"
|
s << "<div class='slide'><label for='slide-regaddr'><b>" << tr("Address registration line") << "</b></label>\r\n<input type=\"checkbox\" id=\"slide-regaddr\" />\r\n<div class=\"slidecontent\">\r\n"
|
||||||
"<form method=\"get\" action=\"" << webroot << "\">\r\n"
|
"<form method=\"get\" action=\"" << webroot << "\">\r\n"
|
||||||
" <input type=\"hidden\" name=\"cmd\" value=\"" << HTTP_COMMAND_GET_REG_STRING << "\">\r\n"
|
" <input type=\"hidden\" name=\"cmd\" value=\"" << HTTP_COMMAND_GET_REG_STRING << "\">\r\n"
|
||||||
" <input type=\"hidden\" name=\"token\" value=\"" << token << "\">\r\n"
|
" <input type=\"hidden\" name=\"token\" value=\"" << token << "\">\r\n"
|
||||||
" <input type=\"hidden\" name=\"b32\" value=\"" << dest->GetIdentHash ().ToBase32 () << "\">\r\n"
|
" <input type=\"hidden\" name=\"b32\" value=\"" << base32 << "\">\r\n"
|
||||||
" <b>" << tr("Domain") << ":</b>\r\n<input type=\"text\" maxlength=\"67\" name=\"name\" placeholder=\"domain.i2p\" required>\r\n"
|
" <b>" << tr("Domain") << ":</b>\r\n<input type=\"text\" maxlength=\"67\" name=\"name\" placeholder=\"domain.i2p\" required>\r\n"
|
||||||
" <button type=\"submit\">" << tr("Generate") << "</button>\r\n"
|
" <button type=\"submit\">" << tr("Generate") << "</button>\r\n"
|
||||||
"</form>\r\n<small>" << tr("<b>Note:</b> result string can be used only for registering 2LD domains (example.i2p). For registering subdomains please use i2pd-tools.") << "</small>\r\n</div>\r\n</div>\r\n<br>\r\n";
|
"</form>\r\n<small>" << tr("<b>Note:</b> result string can be used only for registering 2LD domains (example.i2p). For registering subdomains please use i2pd-tools.") << "</small>\r\n</div>\r\n</div>\r\n<br>\r\n";
|
||||||
|
@ -459,23 +433,9 @@ namespace http {
|
||||||
if(dest->GetNumRemoteLeaseSets())
|
if(dest->GetNumRemoteLeaseSets())
|
||||||
{
|
{
|
||||||
s << "<div class='slide'><label for='slide-lease'><b>" << tr("LeaseSets") << ":</b> <i>" << dest->GetNumRemoteLeaseSets ()
|
s << "<div class='slide'><label for='slide-lease'><b>" << tr("LeaseSets") << ":</b> <i>" << dest->GetNumRemoteLeaseSets ()
|
||||||
<< "</i></label>\r\n<input type=\"checkbox\" id=\"slide-lease\" />\r\n<div class=\"slidecontent\">\r\n"
|
<< "</i></label>\r\n<input type=\"checkbox\" id=\"slide-lease\" />\r\n<div class=\"slidecontent\">\r\n<table><thead><th>"<< tr("Address") << "</th><th>" << tr("Type") << "</th><th>" << tr("EncType") << "</th></thead><tbody class=\"tableitem\">";
|
||||||
<< "<table><thead>"
|
|
||||||
<< "<th>" << tr("Address") << "</th>"
|
|
||||||
<< "<th style=\"width:5px;\"> </th>" // LeaseSet expiration button column
|
|
||||||
<< "<th>" << tr("Type") << "</th>"
|
|
||||||
<< "<th>" << tr("EncType") << "</th>"
|
|
||||||
<< "</thead><tbody class=\"tableitem\">";
|
|
||||||
for(auto& it: dest->GetLeaseSets ())
|
for(auto& it: dest->GetLeaseSets ())
|
||||||
{
|
s << "<tr><td>" << it.first.ToBase32 () << "</td><td>" << (int)it.second->GetStoreType () << "</td><td>" << (int)it.second->GetEncryptionType () <<"</td></tr>\r\n";
|
||||||
s << "<tr>"
|
|
||||||
<< "<td>" << it.first.ToBase32 () << "</td>"
|
|
||||||
<< "<td><a class=\"button\" href=\"/?cmd=" << HTTP_COMMAND_EXPIRELEASE<< "&b32=" << dest->GetIdentHash ().ToBase32 ()
|
|
||||||
<< "&lease=" << it.first.ToBase32 () << "&token=" << token << "\" title=\"" << tr("Expire LeaseSet") << "\"> ✘ </a></td>"
|
|
||||||
<< "<td>" << (int)it.second->GetStoreType () << "</td>"
|
|
||||||
<< "<td>" << (int)it.second->GetEncryptionType () <<"</td>"
|
|
||||||
<< "</tr>\r\n";
|
|
||||||
}
|
|
||||||
s << "</tbody></table>\r\n</div>\r\n</div>\r\n<br>\r\n";
|
s << "</tbody></table>\r\n</div>\r\n</div>\r\n<br>\r\n";
|
||||||
} else
|
} else
|
||||||
s << "<b>" << tr("LeaseSets") << ":</b> <i>0</i><br>\r\n<br>\r\n";
|
s << "<b>" << tr("LeaseSets") << ":</b> <i>0</i><br>\r\n<br>\r\n";
|
||||||
|
@ -486,21 +446,9 @@ namespace http {
|
||||||
s << "<b>" << tr("Inbound tunnels") << ":</b><br>\r\n<div class=\"list\">\r\n";
|
s << "<b>" << tr("Inbound tunnels") << ":</b><br>\r\n<div class=\"list\">\r\n";
|
||||||
for (auto & it : pool->GetInboundTunnels ()) {
|
for (auto & it : pool->GetInboundTunnels ()) {
|
||||||
s << "<div class=\"listitem\">";
|
s << "<div class=\"listitem\">";
|
||||||
// for each tunnel hop if not zero-hop
|
it->Print(s);
|
||||||
if (it->GetNumHops ())
|
|
||||||
{
|
|
||||||
it->VisitTunnelHops(
|
|
||||||
[&s](std::shared_ptr<const i2p::data::IdentityEx> hopIdent)
|
|
||||||
{
|
|
||||||
s << "⇒ ";
|
|
||||||
ShowHop(s, *hopIdent);
|
|
||||||
s << " ";
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
s << "⇒ " << it->GetTunnelID () << ":me";
|
|
||||||
if(it->LatencyIsKnown())
|
if(it->LatencyIsKnown())
|
||||||
s << " ( " << tr(/* tr: Milliseconds */ "%dms", it->GetMeanLatency()) << " )";
|
s << " ( " << it->GetMeanLatency() << tr(/* tr: Milliseconds */ "ms") << " )";
|
||||||
ShowTunnelDetails(s, it->GetState (), false, it->GetNumReceivedBytes ());
|
ShowTunnelDetails(s, it->GetState (), false, it->GetNumReceivedBytes ());
|
||||||
s << "</div>\r\n";
|
s << "</div>\r\n";
|
||||||
}
|
}
|
||||||
|
@ -508,40 +456,24 @@ namespace http {
|
||||||
s << "<b>" << tr("Outbound tunnels") << ":</b><br>\r\n<div class=\"list\">\r\n";
|
s << "<b>" << tr("Outbound tunnels") << ":</b><br>\r\n<div class=\"list\">\r\n";
|
||||||
for (auto & it : pool->GetOutboundTunnels ()) {
|
for (auto & it : pool->GetOutboundTunnels ()) {
|
||||||
s << "<div class=\"listitem\">";
|
s << "<div class=\"listitem\">";
|
||||||
s << it->GetTunnelID () << ":me ⇒";
|
it->Print(s);
|
||||||
// for each tunnel hop if not zero-hop
|
|
||||||
if (it->GetNumHops ())
|
|
||||||
{
|
|
||||||
it->VisitTunnelHops(
|
|
||||||
[&s](std::shared_ptr<const i2p::data::IdentityEx> hopIdent)
|
|
||||||
{
|
|
||||||
s << " ";
|
|
||||||
ShowHop(s, *hopIdent);
|
|
||||||
s << " ⇒";
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if(it->LatencyIsKnown())
|
if(it->LatencyIsKnown())
|
||||||
s << " ( " << tr("%dms", it->GetMeanLatency()) << " )";
|
s << " ( " << it->GetMeanLatency() << tr("ms") << " )";
|
||||||
ShowTunnelDetails(s, it->GetState (), false, it->GetNumSentBytes ());
|
ShowTunnelDetails(s, it->GetState (), false, it->GetNumSentBytes ());
|
||||||
s << "</div>\r\n";
|
s << "</div>\r\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s << "<br>\r\n";
|
s << "<br>\r\n";
|
||||||
|
|
||||||
s << "<b>" << tr("Tags") << "</b><br>\r\n"
|
s << "<b>" << tr("Tags") << "</b><br>\r\n" << tr("Incoming") << ": <i>" << dest->GetNumIncomingTags () << "</i><br>\r\n";
|
||||||
<< tr("Incoming") << ": <i>" << dest->GetNumIncomingTags () << "</i><br>\r\n";
|
|
||||||
if (!dest->GetSessions ().empty ()) {
|
if (!dest->GetSessions ().empty ()) {
|
||||||
std::stringstream tmp_s; uint32_t out_tags = 0;
|
std::stringstream tmp_s; uint32_t out_tags = 0;
|
||||||
for (const auto& it: dest->GetSessions ()) {
|
for (const auto& it: dest->GetSessions ()) {
|
||||||
tmp_s << "<tr><td>" << i2p::client::context.GetAddressBook ().ToAddress(it.first) << "</td><td>" << it.second->GetNumOutgoingTags () << "</td></tr>\r\n";
|
tmp_s << "<tr><td>" << i2p::client::context.GetAddressBook ().ToAddress(it.first) << "</td><td>" << it.second->GetNumOutgoingTags () << "</td></tr>\r\n";
|
||||||
out_tags += it.second->GetNumOutgoingTags ();
|
out_tags += it.second->GetNumOutgoingTags ();
|
||||||
}
|
}
|
||||||
s << "<div class='slide'><label for='slide-tags'>" << tr("Outgoing") << ": <i>" << out_tags << "</i></label>\r\n"
|
s << "<div class='slide'><label for='slide-tags'>" << tr("Outgoing") << ": <i>" << out_tags << "</i></label>\r\n<input type=\"checkbox\" id=\"slide-tags\" />\r\n"
|
||||||
<< "<input type=\"checkbox\" id=\"slide-tags\" />\r\n"
|
<< "<div class=\"slidecontent\">\r\n<table>\r\n<thead><th>" << tr("Destination") << "</th><th>" << tr("Amount") << "</th></thead>\r\n<tbody class=\"tableitem\">\r\n" << tmp_s.str () << "</tbody></table>\r\n</div>\r\n</div>\r\n";
|
||||||
<< "<div class=\"slidecontent\">\r\n"
|
|
||||||
<< "<table>\r\n<thead><th>" << tr("Destination") << "</th><th>" << tr("Amount") << "</th></thead>\r\n"
|
|
||||||
<< "<tbody class=\"tableitem\">\r\n" << tmp_s.str () << "</tbody></table>\r\n</div>\r\n</div>\r\n";
|
|
||||||
} else
|
} else
|
||||||
s << tr("Outgoing") << ": <i>0</i><br>\r\n";
|
s << tr("Outgoing") << ": <i>0</i><br>\r\n";
|
||||||
s << "<br>\r\n";
|
s << "<br>\r\n";
|
||||||
|
@ -556,11 +488,8 @@ namespace http {
|
||||||
tmp_s << "<tr><td>" << i2p::client::context.GetAddressBook ().ToAddress(it.second->GetDestination ()) << "</td><td>" << it.second->GetState () << "</td></tr>\r\n";
|
tmp_s << "<tr><td>" << i2p::client::context.GetAddressBook ().ToAddress(it.second->GetDestination ()) << "</td><td>" << it.second->GetState () << "</td></tr>\r\n";
|
||||||
ecies_sessions++;
|
ecies_sessions++;
|
||||||
}
|
}
|
||||||
s << "<div class='slide'><label for='slide-ecies-sessions'>" << tr("Tags sessions") << ": <i>" << ecies_sessions << "</i></label>\r\n"
|
s << "<div class='slide'><label for='slide-ecies-sessions'>" << tr("Tags sessions") << ": <i>" << ecies_sessions << "</i></label>\r\n<input type=\"checkbox\" id=\"slide-ecies-sessions\" />\r\n"
|
||||||
<< "<input type=\"checkbox\" id=\"slide-ecies-sessions\" />\r\n"
|
<< "<div class=\"slidecontent\">\r\n<table>\r\n<thead><th>" << tr("Destination") << "</th><th>" << tr("Status") << "</th></thead>\r\n<tbody class=\"tableitem\">\r\n" << tmp_s.str () << "</tbody></table>\r\n</div>\r\n</div>\r\n";
|
||||||
<< "<div class=\"slidecontent\">\r\n<table>\r\n"
|
|
||||||
<< "<thead><th>" << tr("Destination") << "</th><th>" << tr("Status") << "</th></thead>\r\n"
|
|
||||||
<< "<tbody class=\"tableitem\">\r\n" << tmp_s.str () << "</tbody></table>\r\n</div>\r\n</div>\r\n";
|
|
||||||
} else
|
} else
|
||||||
s << tr("Tags sessions") << ": <i>0</i><br>\r\n";
|
s << tr("Tags sessions") << ": <i>0</i><br>\r\n";
|
||||||
s << "<br>\r\n";
|
s << "<br>\r\n";
|
||||||
|
@ -579,21 +508,19 @@ namespace http {
|
||||||
ShowLeaseSetDestination (s, dest, token);
|
ShowLeaseSetDestination (s, dest, token);
|
||||||
|
|
||||||
// Print table with streams information
|
// Print table with streams information
|
||||||
s << "<table>\r\n<caption>"
|
s << "<table>\r\n<caption>" << tr("Streams") << "</caption>\r\n<thead>\r\n<tr>";
|
||||||
<< tr("Streams")
|
s << "<th style=\"width:25px;\">StreamID</th>";
|
||||||
<< "</caption>\r\n<thead>\r\n<tr>"
|
s << "<th style=\"width:5px;\" \\>"; // Stream closing button column
|
||||||
<< "<th style=\"width:25px;\">StreamID</th>"
|
s << "<th class=\"streamdest\">Destination</th>";
|
||||||
<< "<th style=\"width:5px;\"> </th>" // Stream closing button column
|
s << "<th>Sent</th>";
|
||||||
<< "<th class=\"streamdest\">Destination</th>"
|
s << "<th>Received</th>";
|
||||||
<< "<th>Sent</th>"
|
s << "<th>Out</th>";
|
||||||
<< "<th>Received</th>"
|
s << "<th>In</th>";
|
||||||
<< "<th>Out</th>"
|
s << "<th>Buf</th>";
|
||||||
<< "<th>In</th>"
|
s << "<th>RTT</th>";
|
||||||
<< "<th>Buf</th>"
|
s << "<th>Window</th>";
|
||||||
<< "<th>RTT</th>"
|
s << "<th>Status</th>";
|
||||||
<< "<th>Window</th>"
|
s << "</tr>\r\n</thead>\r\n<tbody class=\"tableitem\">\r\n";
|
||||||
<< "<th>Status</th>"
|
|
||||||
<< "</tr>\r\n</thead>\r\n<tbody class=\"tableitem\">\r\n";
|
|
||||||
|
|
||||||
for (const auto& it: dest->GetAllStreams ())
|
for (const auto& it: dest->GetAllStreams ())
|
||||||
{
|
{
|
||||||
|
@ -620,8 +547,6 @@ namespace http {
|
||||||
}
|
}
|
||||||
s << "</tbody>\r\n</table>";
|
s << "</tbody>\r\n</table>";
|
||||||
}
|
}
|
||||||
else
|
|
||||||
ShowError(s, tr("Such destination is not found"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShowI2CPLocalDestination (std::stringstream& s, const std::string& id)
|
void ShowI2CPLocalDestination (std::stringstream& s, const std::string& id)
|
||||||
|
@ -656,10 +581,7 @@ namespace http {
|
||||||
if (storeType == i2p::data::NETDB_STORE_TYPE_LEASESET)
|
if (storeType == i2p::data::NETDB_STORE_TYPE_LEASESET)
|
||||||
ls.reset (new i2p::data::LeaseSet (leaseSet->GetBuffer(), leaseSet->GetBufferLen()));
|
ls.reset (new i2p::data::LeaseSet (leaseSet->GetBuffer(), leaseSet->GetBufferLen()));
|
||||||
else
|
else
|
||||||
{
|
ls.reset (new i2p::data::LeaseSet2 (storeType, leaseSet->GetBuffer(), leaseSet->GetBufferLen()));
|
||||||
ls.reset (new i2p::data::LeaseSet2 (storeType));
|
|
||||||
ls->Update (leaseSet->GetBuffer(), leaseSet->GetBufferLen(), false);
|
|
||||||
}
|
|
||||||
if (!ls) return;
|
if (!ls) return;
|
||||||
s << "<div class=\"leaseset listitem";
|
s << "<div class=\"leaseset listitem";
|
||||||
if (ls->IsExpired())
|
if (ls->IsExpired())
|
||||||
|
@ -690,7 +612,7 @@ namespace http {
|
||||||
}
|
}
|
||||||
else if (!i2p::context.IsFloodfill ())
|
else if (!i2p::context.IsFloodfill ())
|
||||||
{
|
{
|
||||||
s << "<b>" << tr("LeaseSets") << ":</b> " << tr(/* Message on LeaseSets page */ "floodfill mode is disabled") << ".<br>\r\n";
|
s << "<b>" << tr("LeaseSets") << ":</b> " << tr("not floodfill") << ".<br>\r\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -702,27 +624,15 @@ namespace http {
|
||||||
{
|
{
|
||||||
s << "<b>" << tr("Tunnels") << ":</b><br>\r\n";
|
s << "<b>" << tr("Tunnels") << ":</b><br>\r\n";
|
||||||
s << "<b>" << tr("Queue size") << ":</b> " << i2p::tunnel::tunnels.GetQueueSize () << "<br>\r\n<br>\r\n";
|
s << "<b>" << tr("Queue size") << ":</b> " << i2p::tunnel::tunnels.GetQueueSize () << "<br>\r\n<br>\r\n";
|
||||||
s << "<b>" << tr("TBM Queue size") << ":</b> " << i2p::tunnel::tunnels.GetTBMQueueSize () << "<br>\r\n<br>\r\n";
|
|
||||||
|
|
||||||
auto ExplPool = i2p::tunnel::tunnels.GetExploratoryPool ();
|
auto ExplPool = i2p::tunnel::tunnels.GetExploratoryPool ();
|
||||||
|
|
||||||
s << "<b>" << tr("Inbound tunnels") << ":</b><br>\r\n<div class=\"list\">\r\n";
|
s << "<b>" << tr("Inbound tunnels") << ":</b><br>\r\n<div class=\"list\">\r\n";
|
||||||
for (auto & it : i2p::tunnel::tunnels.GetInboundTunnels ()) {
|
for (auto & it : i2p::tunnel::tunnels.GetInboundTunnels ()) {
|
||||||
s << "<div class=\"listitem\">";
|
s << "<div class=\"listitem\">";
|
||||||
if (it->GetNumHops ())
|
it->Print(s);
|
||||||
{
|
|
||||||
it->VisitTunnelHops(
|
|
||||||
[&s](std::shared_ptr<const i2p::data::IdentityEx> hopIdent)
|
|
||||||
{
|
|
||||||
s << "⇒ ";
|
|
||||||
ShowHop(s, *hopIdent);
|
|
||||||
s << " ";
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
s << "⇒ " << it->GetTunnelID () << ":me";
|
|
||||||
if(it->LatencyIsKnown())
|
if(it->LatencyIsKnown())
|
||||||
s << " ( " << tr("%dms", it->GetMeanLatency()) << " )";
|
s << " ( " << it->GetMeanLatency() << tr("ms") << " )";
|
||||||
ShowTunnelDetails(s, it->GetState (), (it->GetTunnelPool () == ExplPool), it->GetNumReceivedBytes ());
|
ShowTunnelDetails(s, it->GetState (), (it->GetTunnelPool () == ExplPool), it->GetNumReceivedBytes ());
|
||||||
s << "</div>\r\n";
|
s << "</div>\r\n";
|
||||||
}
|
}
|
||||||
|
@ -730,21 +640,9 @@ namespace http {
|
||||||
s << "<b>" << tr("Outbound tunnels") << ":</b><br>\r\n<div class=\"list\">\r\n";
|
s << "<b>" << tr("Outbound tunnels") << ":</b><br>\r\n<div class=\"list\">\r\n";
|
||||||
for (auto & it : i2p::tunnel::tunnels.GetOutboundTunnels ()) {
|
for (auto & it : i2p::tunnel::tunnels.GetOutboundTunnels ()) {
|
||||||
s << "<div class=\"listitem\">";
|
s << "<div class=\"listitem\">";
|
||||||
s << it->GetTunnelID () << ":me ⇒";
|
it->Print(s);
|
||||||
// for each tunnel hop if not zero-hop
|
|
||||||
if (it->GetNumHops ())
|
|
||||||
{
|
|
||||||
it->VisitTunnelHops(
|
|
||||||
[&s](std::shared_ptr<const i2p::data::IdentityEx> hopIdent)
|
|
||||||
{
|
|
||||||
s << " ";
|
|
||||||
ShowHop(s, *hopIdent);
|
|
||||||
s << " ⇒";
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if(it->LatencyIsKnown())
|
if(it->LatencyIsKnown())
|
||||||
s << " ( " << tr("%dms", it->GetMeanLatency()) << " )";
|
s << " ( " << it->GetMeanLatency() << tr("ms") << " )";
|
||||||
ShowTunnelDetails(s, it->GetState (), (it->GetTunnelPool () == ExplPool), it->GetNumSentBytes ());
|
ShowTunnelDetails(s, it->GetState (), (it->GetTunnelPool () == ExplPool), it->GetNumSentBytes ());
|
||||||
s << "</div>\r\n";
|
s << "</div>\r\n";
|
||||||
}
|
}
|
||||||
|
@ -757,7 +655,8 @@ namespace http {
|
||||||
|
|
||||||
s << "<b>" << tr("Router commands") << "</b><br>\r\n<br>\r\n<div class=\"commands\">\r\n";
|
s << "<b>" << tr("Router commands") << "</b><br>\r\n<br>\r\n<div class=\"commands\">\r\n";
|
||||||
s << " <a href=\"" << webroot << "?cmd=" << HTTP_COMMAND_RUN_PEER_TEST << "&token=" << token << "\">" << tr("Run peer test") << "</a><br>\r\n";
|
s << " <a href=\"" << webroot << "?cmd=" << HTTP_COMMAND_RUN_PEER_TEST << "&token=" << token << "\">" << tr("Run peer test") << "</a><br>\r\n";
|
||||||
s << " <a href=\"" << webroot << "?cmd=" << HTTP_COMMAND_RELOAD_TUNNELS_CONFIG << "&token=" << token << "\">" << tr("Reload tunnels configuration") << "</a><br>\r\n";
|
|
||||||
|
// s << " <a href=\"/?cmd=" << HTTP_COMMAND_RELOAD_CONFIG << "\">Reload config</a><br>\r\n";
|
||||||
|
|
||||||
if (i2p::context.AcceptsTunnels ())
|
if (i2p::context.AcceptsTunnels ())
|
||||||
s << " <a href=\"" << webroot << "?cmd=" << HTTP_COMMAND_DISABLE_TRANSIT << "&token=" << token << "\">" << tr("Decline transit tunnels") << "</a><br>\r\n";
|
s << " <a href=\"" << webroot << "?cmd=" << HTTP_COMMAND_DISABLE_TRANSIT << "&token=" << token << "\">" << tr("Decline transit tunnels") << "</a><br>\r\n";
|
||||||
|
@ -782,43 +681,33 @@ namespace http {
|
||||||
|
|
||||||
s << "<br>\r\n<small>" << tr("<b>Note:</b> any action done here are not persistent and not changes your config files.") << "</small>\r\n<br>\r\n";
|
s << "<br>\r\n<small>" << tr("<b>Note:</b> any action done here are not persistent and not changes your config files.") << "</small>\r\n<br>\r\n";
|
||||||
|
|
||||||
auto loglevel = i2p::log::Logger().GetLogLevel();
|
|
||||||
s << "<b>" << tr("Logging level") << "</b><br>\r\n";
|
s << "<b>" << tr("Logging level") << "</b><br>\r\n";
|
||||||
s << " <a class=\"button" << (loglevel == eLogNone ? " selected" : "") << "\" href=\"" << webroot << "?cmd=" << HTTP_COMMAND_LOGLEVEL << "&level=none&token=" << token << "\"> none </a> \r\n";
|
s << " <a class=\"button\" href=\"" << webroot << "?cmd=" << HTTP_COMMAND_LOGLEVEL << "&level=none&token=" << token << "\"> none </a> \r\n";
|
||||||
s << " <a class=\"button" << (loglevel == eLogCritical ? " selected" : "") << "\" href=\"" << webroot << "?cmd=" << HTTP_COMMAND_LOGLEVEL << "&level=critical&token=" << token << "\"> critical </a> \r\n";
|
s << " <a class=\"button\" href=\"" << webroot << "?cmd=" << HTTP_COMMAND_LOGLEVEL << "&level=error&token=" << token << "\"> error </a> \r\n";
|
||||||
s << " <a class=\"button" << (loglevel == eLogError ? " selected" : "") << "\" href=\"" << webroot << "?cmd=" << HTTP_COMMAND_LOGLEVEL << "&level=error&token=" << token << "\"> error </a> \r\n";
|
s << " <a class=\"button\" href=\"" << webroot << "?cmd=" << HTTP_COMMAND_LOGLEVEL << "&level=warn&token=" << token << "\"> warn </a> \r\n";
|
||||||
s << " <a class=\"button" << (loglevel == eLogWarning ? " selected" : "") << "\" href=\"" << webroot << "?cmd=" << HTTP_COMMAND_LOGLEVEL << "&level=warn&token=" << token << "\"> warn </a> \r\n";
|
s << " <a class=\"button\" href=\"" << webroot << "?cmd=" << HTTP_COMMAND_LOGLEVEL << "&level=info&token=" << token << "\"> info </a> \r\n";
|
||||||
s << " <a class=\"button" << (loglevel == eLogInfo ? " selected" : "") << "\" href=\"" << webroot << "?cmd=" << HTTP_COMMAND_LOGLEVEL << "&level=info&token=" << token << "\"> info </a> \r\n";
|
s << " <a class=\"button\" href=\"" << webroot << "?cmd=" << HTTP_COMMAND_LOGLEVEL << "&level=debug&token=" << token << "\"> debug </a><br>\r\n<br>\r\n";
|
||||||
s << " <a class=\"button" << (loglevel == eLogDebug ? " selected" : "") << "\" href=\"" << webroot << "?cmd=" << HTTP_COMMAND_LOGLEVEL << "&level=debug&token=" << token << "\"> debug </a><br>\r\n<br>\r\n";
|
|
||||||
|
|
||||||
uint32_t maxTunnels = i2p::tunnel::tunnels.GetMaxNumTransitTunnels ();
|
uint16_t maxTunnels = GetMaxNumTransitTunnels ();
|
||||||
s << "<b>" << tr("Transit tunnels limit") << "</b><br>\r\n";
|
s << "<b>" << tr("Transit tunnels limit") << "</b><br>\r\n";
|
||||||
s << "<form method=\"get\" action=\"" << webroot << "\">\r\n";
|
s << "<form method=\"get\" action=\"" << webroot << "\">\r\n";
|
||||||
s << " <input type=\"hidden\" name=\"cmd\" value=\"" << HTTP_COMMAND_LIMITTRANSIT << "\">\r\n";
|
s << " <input type=\"hidden\" name=\"cmd\" value=\"" << HTTP_COMMAND_LIMITTRANSIT << "\">\r\n";
|
||||||
s << " <input type=\"hidden\" name=\"token\" value=\"" << token << "\">\r\n";
|
s << " <input type=\"hidden\" name=\"token\" value=\"" << token << "\">\r\n";
|
||||||
s << " <input type=\"number\" min=\"0\" max=\"" << TRANSIT_TUNNELS_LIMIT <<"\" name=\"limit\" value=\"" << maxTunnels << "\">\r\n";
|
s << " <input type=\"number\" min=\"0\" max=\"65535\" name=\"limit\" value=\"" << maxTunnels << "\">\r\n";
|
||||||
s << " <button type=\"submit\">" << tr("Change") << "</button>\r\n";
|
s << " <button type=\"submit\">" << tr("Change") << "</button>\r\n";
|
||||||
s << "</form>\r\n<br>\r\n";
|
s << "</form>\r\n<br>\r\n";
|
||||||
|
|
||||||
// get current used language
|
std::string currLang = i2p::client::context.GetLanguage ()->GetLanguage(); // get current used language
|
||||||
std::string currLang = i2p::client::context.GetLanguage ()->GetLanguage();
|
s << "<b>" << tr("Change language") << "</b><br>\r\n";
|
||||||
|
s << "<form method=\"get\" action=\"" << webroot << "\">\r\n";
|
||||||
s << "<b>"
|
s << " <input type=\"hidden\" name=\"cmd\" value=\"" << HTTP_COMMAND_SETLANGUAGE << "\">\r\n";
|
||||||
<< tr("Change language")
|
s << " <input type=\"hidden\" name=\"token\" value=\"" << token << "\">\r\n";
|
||||||
<< "</b><br>\r\n"
|
s << " <select name=\"lang\" id=\"lang\">\r\n";
|
||||||
<< "<form method=\"get\" action=\"" << webroot << "\">\r\n"
|
|
||||||
<< " <input type=\"hidden\" name=\"cmd\" value=\"" << HTTP_COMMAND_SETLANGUAGE << "\">\r\n"
|
|
||||||
<< " <input type=\"hidden\" name=\"token\" value=\"" << token << "\">\r\n"
|
|
||||||
<< " <select name=\"lang\" id=\"lang\">\r\n";
|
|
||||||
|
|
||||||
for (const auto& it: i2p::i18n::languages)
|
for (const auto& it: i2p::i18n::languages)
|
||||||
s << " <option value=\"" << it.first << "\"" << ((it.first.compare(currLang) == 0) ? " selected" : "") << ">" << it.second.LocaleName << "</option>\r\n";
|
s << " <option value=\"" << it.first << "\"" << ((it.first.compare(currLang) == 0) ? " selected" : "") << ">" << it.second.LocaleName << "</option>\r\n";
|
||||||
|
s << " </select>\r\n";
|
||||||
s << " </select>\r\n"
|
s << " <button type=\"submit\">" << tr("Change") << "</button>\r\n";
|
||||||
<< " <button type=\"submit\">"
|
s << "</form>\r\n<br>\r\n";
|
||||||
<< tr("Change")
|
|
||||||
<< "</button>\r\n"
|
|
||||||
<< "</form>\r\n<br>\r\n";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -826,71 +715,51 @@ namespace http {
|
||||||
{
|
{
|
||||||
if(i2p::tunnel::tunnels.CountTransitTunnels())
|
if(i2p::tunnel::tunnels.CountTransitTunnels())
|
||||||
{
|
{
|
||||||
s << "<b>" << tr("Transit Tunnels") << ":</b><br>\r\n";
|
s << "<b>" << tr("Transit Tunnels") << ":</b><br>\r\n<div class=\"list\">\r\n";
|
||||||
s << "<table><thead><th>⇒</th><th>ID</th><th>⇒</th><th>" << tr("Amount") << "</th><th>" << tr("Next") << "</th></thead><tbody class=\"tableitem\">";
|
|
||||||
for (const auto& it: i2p::tunnel::tunnels.GetTransitTunnels ())
|
for (const auto& it: i2p::tunnel::tunnels.GetTransitTunnels ())
|
||||||
{
|
{
|
||||||
|
s << "<div class=\"listitem\">\r\n";
|
||||||
if (std::dynamic_pointer_cast<i2p::tunnel::TransitTunnelGateway>(it))
|
if (std::dynamic_pointer_cast<i2p::tunnel::TransitTunnelGateway>(it))
|
||||||
s << "<tr><td></td><td>" << it->GetTunnelID () << "</td><td>⇒</td><td>";
|
s << it->GetTunnelID () << " ⇒ ";
|
||||||
else if (std::dynamic_pointer_cast<i2p::tunnel::TransitTunnelEndpoint>(it))
|
else if (std::dynamic_pointer_cast<i2p::tunnel::TransitTunnelEndpoint>(it))
|
||||||
s << "<tr><td>⇒</td><td>" << it->GetTunnelID () << "</td><td></td><td>";
|
s << " ⇒ " << it->GetTunnelID ();
|
||||||
else
|
else
|
||||||
s << "<tr><td>⇒</td><td>" << it->GetTunnelID () << "</td><td>⇒</td><td>";
|
s << " ⇒ " << it->GetTunnelID () << " ⇒ ";
|
||||||
ShowTraffic(s, it->GetNumTransmittedBytes ());
|
s << " " << it->GetNumTransmittedBytes () << "</div>\r\n";
|
||||||
s << "</td><td>" << it->GetNextPeerName () << "</td></tr>\r\n";
|
|
||||||
}
|
}
|
||||||
s << "</tbody></table>\r\n";
|
s << "</div>\r\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
s << "<b>" << tr("Transit Tunnels") << ":</b> " << tr(/* Message on transit tunnels page */ "no transit tunnels currently built") << ".<br>\r\n";
|
s << "<b>" << tr("Transit Tunnels") << ":</b> " << tr("no transit tunnels currently built") << ".<br>\r\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Sessions>
|
template<typename Sessions>
|
||||||
static void ShowTransportSessions (std::stringstream& s, const Sessions& sessions, const std::string name)
|
static void ShowNTCPTransports (std::stringstream& s, const Sessions& sessions, const std::string name)
|
||||||
{
|
{
|
||||||
auto comp = [](typename Sessions::mapped_type a, typename Sessions::mapped_type b)
|
std::stringstream tmp_s, tmp_s6; uint16_t cnt = 0, cnt6 = 0;
|
||||||
{ return a->GetRemoteEndpoint() < b->GetRemoteEndpoint(); };
|
|
||||||
std::set<typename Sessions::mapped_type, decltype(comp)> sortedSessions(comp);
|
|
||||||
for (const auto& it: sessions )
|
for (const auto& it: sessions )
|
||||||
{
|
{
|
||||||
auto ret = sortedSessions.insert(it.second);
|
if (it.second && it.second->IsEstablished () && !it.second->GetRemoteEndpoint ().address ().is_v6 ())
|
||||||
if (!ret.second)
|
|
||||||
LogPrint(eLogError, "HTTPServer: Duplicate remote endpoint detected: ", (*ret.first)->GetRemoteEndpoint());
|
|
||||||
}
|
|
||||||
std::stringstream tmp_s, tmp_s6; uint16_t cnt = 0, cnt6 = 0;
|
|
||||||
for (const auto& it: sortedSessions)
|
|
||||||
{
|
|
||||||
auto endpoint = it->GetRemoteEndpoint ();
|
|
||||||
if (it && it->IsEstablished () && endpoint.address ().is_v4 ())
|
|
||||||
{
|
{
|
||||||
tmp_s << "<div class=\"listitem\">\r\n";
|
tmp_s << "<div class=\"listitem\">\r\n";
|
||||||
if (it->IsOutgoing ()) tmp_s << " ⇒ ";
|
if (it.second->IsOutgoing ()) tmp_s << " ⇒ ";
|
||||||
tmp_s << i2p::data::GetIdentHashAbbreviation (it->GetRemoteIdentity ()->GetIdentHash ()) << ": "
|
tmp_s << i2p::data::GetIdentHashAbbreviation (it.second->GetRemoteIdentity ()->GetIdentHash ()) << ": "
|
||||||
<< endpoint.address ().to_string () << ":" << endpoint.port ();
|
<< it.second->GetRemoteEndpoint ().address ().to_string ();
|
||||||
if (!it->IsOutgoing ()) tmp_s << " ⇒ ";
|
if (!it.second->IsOutgoing ()) tmp_s << " ⇒ ";
|
||||||
tmp_s << " [" << it->GetNumSentBytes () << ":" << it->GetNumReceivedBytes () << "]";
|
tmp_s << " [" << it.second->GetNumSentBytes () << ":" << it.second->GetNumReceivedBytes () << "]";
|
||||||
if (it->GetRelayTag ())
|
|
||||||
tmp_s << " [itag:" << it->GetRelayTag () << "]";
|
|
||||||
if (it->GetSendQueueSize () > 0)
|
|
||||||
tmp_s << " [queue:" << it->GetSendQueueSize () << "]";
|
|
||||||
if (it->IsSlow ()) tmp_s << " [slow]";
|
|
||||||
tmp_s << "</div>\r\n" << std::endl;
|
tmp_s << "</div>\r\n" << std::endl;
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
if (it && it->IsEstablished () && endpoint.address ().is_v6 ())
|
if (it.second && it.second->IsEstablished () && it.second->GetRemoteEndpoint ().address ().is_v6 ())
|
||||||
{
|
{
|
||||||
tmp_s6 << "<div class=\"listitem\">\r\n";
|
tmp_s6 << "<div class=\"listitem\">\r\n";
|
||||||
if (it->IsOutgoing ()) tmp_s6 << " ⇒ ";
|
if (it.second->IsOutgoing ()) tmp_s6 << " ⇒ ";
|
||||||
tmp_s6 << i2p::data::GetIdentHashAbbreviation (it->GetRemoteIdentity ()->GetIdentHash ()) << ": "
|
tmp_s6 << i2p::data::GetIdentHashAbbreviation (it.second->GetRemoteIdentity ()->GetIdentHash ()) << ": "
|
||||||
<< "[" << endpoint.address ().to_string () << "]:" << endpoint.port ();
|
<< "[" << it.second->GetRemoteEndpoint ().address ().to_string () << "]";
|
||||||
if (!it->IsOutgoing ()) tmp_s6 << " ⇒ ";
|
if (!it.second->IsOutgoing ()) tmp_s6 << " ⇒ ";
|
||||||
tmp_s6 << " [" << it->GetNumSentBytes () << ":" << it->GetNumReceivedBytes () << "]";
|
tmp_s6 << " [" << it.second->GetNumSentBytes () << ":" << it.second->GetNumReceivedBytes () << "]";
|
||||||
if (it->GetRelayTag ())
|
|
||||||
tmp_s6 << " [itag:" << it->GetRelayTag () << "]";
|
|
||||||
if (it->GetSendQueueSize () > 0)
|
|
||||||
tmp_s6 << " [queue:" << it->GetSendQueueSize () << "]";
|
|
||||||
tmp_s6 << "</div>\r\n" << std::endl;
|
tmp_s6 << "</div>\r\n" << std::endl;
|
||||||
cnt6++;
|
cnt6++;
|
||||||
}
|
}
|
||||||
|
@ -917,14 +786,47 @@ namespace http {
|
||||||
{
|
{
|
||||||
auto sessions = ntcp2Server->GetNTCP2Sessions ();
|
auto sessions = ntcp2Server->GetNTCP2Sessions ();
|
||||||
if (!sessions.empty ())
|
if (!sessions.empty ())
|
||||||
ShowTransportSessions (s, sessions, "NTCP2");
|
ShowNTCPTransports (s, sessions, "NTCP2");
|
||||||
}
|
}
|
||||||
auto ssu2Server = i2p::transport::transports.GetSSU2Server ();
|
auto ssuServer = i2p::transport::transports.GetSSUServer ();
|
||||||
if (ssu2Server)
|
if (ssuServer)
|
||||||
{
|
{
|
||||||
auto sessions = ssu2Server->GetSSU2Sessions ();
|
auto sessions = ssuServer->GetSessions ();
|
||||||
if (!sessions.empty ())
|
if (!sessions.empty ())
|
||||||
ShowTransportSessions (s, sessions, "SSU2");
|
{
|
||||||
|
s << "<div class='slide'><label for='slide_ssu'><b>SSU</b> ( " << (int) sessions.size() << " )</label>\r\n<input type=\"checkbox\" id=\"slide_ssu\" />\r\n<div class=\"slidecontent list\">";
|
||||||
|
for (const auto& it: sessions)
|
||||||
|
{
|
||||||
|
s << "<div class=\"listitem\">\r\n";
|
||||||
|
auto endpoint = it.second->GetRemoteEndpoint ();
|
||||||
|
if (it.second->IsOutgoing ()) s << " ⇒ ";
|
||||||
|
s << endpoint.address ().to_string () << ":" << endpoint.port ();
|
||||||
|
if (!it.second->IsOutgoing ()) s << " ⇒ ";
|
||||||
|
s << " [" << it.second->GetNumSentBytes () << ":" << it.second->GetNumReceivedBytes () << "]";
|
||||||
|
if (it.second->GetRelayTag ())
|
||||||
|
s << " [itag:" << it.second->GetRelayTag () << "]";
|
||||||
|
s << "</div>\r\n" << std::endl;
|
||||||
|
}
|
||||||
|
s << "</div>\r\n</div>\r\n";
|
||||||
|
}
|
||||||
|
auto sessions6 = ssuServer->GetSessionsV6 ();
|
||||||
|
if (!sessions6.empty ())
|
||||||
|
{
|
||||||
|
s << "<div class='slide'><label for='slide_ssuv6'><b>SSUv6</b> ( " << (int) sessions6.size() << " )</label>\r\n<input type=\"checkbox\" id=\"slide_ssuv6\" />\r\n<div class=\"slidecontent list\">";
|
||||||
|
for (const auto& it: sessions6)
|
||||||
|
{
|
||||||
|
s << "<div class=\"listitem\">\r\n";
|
||||||
|
auto endpoint = it.second->GetRemoteEndpoint ();
|
||||||
|
if (it.second->IsOutgoing ()) s << " ⇒ ";
|
||||||
|
s << "[" << endpoint.address ().to_string () << "]:" << endpoint.port ();
|
||||||
|
if (!it.second->IsOutgoing ()) s << " ⇒ ";
|
||||||
|
s << " [" << it.second->GetNumSentBytes () << ":" << it.second->GetNumReceivedBytes () << "]";
|
||||||
|
if (it.second->GetRelayTag ())
|
||||||
|
s << " [itag:" << it.second->GetRelayTag () << "]";
|
||||||
|
s << "</div>\r\n" << std::endl;
|
||||||
|
}
|
||||||
|
s << "</div>\r\n</div>\r\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -950,7 +852,7 @@ namespace http {
|
||||||
s << "</div>\r\n";
|
s << "</div>\r\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
s << "<b>" << tr("SAM sessions") << ":</b> " << tr(/* Message on SAM sessions page */ "no sessions currently running") << ".<br>\r\n";
|
s << "<b>" << tr("SAM sessions") << ":</b> " << tr("no sessions currently running") << ".<br>\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShowSAMSession (std::stringstream& s, const std::string& id)
|
void ShowSAMSession (std::stringstream& s, const std::string& id)
|
||||||
|
@ -994,16 +896,8 @@ namespace http {
|
||||||
void ShowI2PTunnels (std::stringstream& s)
|
void ShowI2PTunnels (std::stringstream& s)
|
||||||
{
|
{
|
||||||
std::string webroot; i2p::config::GetOption("http.webroot", webroot);
|
std::string webroot; i2p::config::GetOption("http.webroot", webroot);
|
||||||
|
|
||||||
auto& clientTunnels = i2p::client::context.GetClientTunnels ();
|
|
||||||
auto httpProxy = i2p::client::context.GetHttpProxy ();
|
|
||||||
auto socksProxy = i2p::client::context.GetSocksProxy ();
|
|
||||||
if (!clientTunnels.empty () || httpProxy || socksProxy)
|
|
||||||
{
|
|
||||||
s << "<b>" << tr("Client Tunnels") << ":</b><br>\r\n<div class=\"list\">\r\n";
|
s << "<b>" << tr("Client Tunnels") << ":</b><br>\r\n<div class=\"list\">\r\n";
|
||||||
if (!clientTunnels.empty ())
|
for (auto& it: i2p::client::context.GetClientTunnels ())
|
||||||
{
|
|
||||||
for (auto& it: clientTunnels)
|
|
||||||
{
|
{
|
||||||
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
||||||
s << "<div class=\"listitem\"><a href=\"" << webroot << "?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
s << "<div class=\"listitem\"><a href=\"" << webroot << "?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
||||||
|
@ -1011,7 +905,7 @@ namespace http {
|
||||||
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
||||||
s << "</div>\r\n"<< std::endl;
|
s << "</div>\r\n"<< std::endl;
|
||||||
}
|
}
|
||||||
}
|
auto httpProxy = i2p::client::context.GetHttpProxy ();
|
||||||
if (httpProxy)
|
if (httpProxy)
|
||||||
{
|
{
|
||||||
auto& ident = httpProxy->GetLocalDestination ()->GetIdentHash();
|
auto& ident = httpProxy->GetLocalDestination ()->GetIdentHash();
|
||||||
|
@ -1020,6 +914,7 @@ namespace http {
|
||||||
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
||||||
s << "</div>\r\n"<< std::endl;
|
s << "</div>\r\n"<< std::endl;
|
||||||
}
|
}
|
||||||
|
auto socksProxy = i2p::client::context.GetSocksProxy ();
|
||||||
if (socksProxy)
|
if (socksProxy)
|
||||||
{
|
{
|
||||||
auto& ident = socksProxy->GetLocalDestination ()->GetIdentHash();
|
auto& ident = socksProxy->GetLocalDestination ()->GetIdentHash();
|
||||||
|
@ -1029,7 +924,6 @@ namespace http {
|
||||||
s << "</div>\r\n"<< std::endl;
|
s << "</div>\r\n"<< std::endl;
|
||||||
}
|
}
|
||||||
s << "</div>\r\n";
|
s << "</div>\r\n";
|
||||||
}
|
|
||||||
|
|
||||||
auto& serverTunnels = i2p::client::context.GetServerTunnels ();
|
auto& serverTunnels = i2p::client::context.GetServerTunnels ();
|
||||||
if (!serverTunnels.empty ()) {
|
if (!serverTunnels.empty ()) {
|
||||||
|
@ -1067,7 +961,7 @@ namespace http {
|
||||||
for (auto& it: serverForwards)
|
for (auto& it: serverForwards)
|
||||||
{
|
{
|
||||||
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
||||||
s << "<div class=\"listitem\"><a href=\"" << webroot << "?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
s << "<a href=\"" << webroot << "?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
||||||
s << it.second->GetName () << "</a> ⇐ ";
|
s << it.second->GetName () << "</a> ⇐ ";
|
||||||
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
||||||
s << "</div>\r\n"<< std::endl;
|
s << "</div>\r\n"<< std::endl;
|
||||||
|
@ -1163,7 +1057,6 @@ namespace http {
|
||||||
SendReply(res, content);
|
SendReply(res, content);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool strictheaders;
|
bool strictheaders;
|
||||||
i2p::config::GetOption("http.strictheaders", strictheaders);
|
i2p::config::GetOption("http.strictheaders", strictheaders);
|
||||||
if (strictheaders)
|
if (strictheaders)
|
||||||
|
@ -1186,7 +1079,6 @@ namespace http {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// HTML head start
|
// HTML head start
|
||||||
ShowPageHead (s);
|
ShowPageHead (s);
|
||||||
if (req.uri.find("page=") != std::string::npos) {
|
if (req.uri.find("page=") != std::string::npos) {
|
||||||
|
@ -1263,7 +1155,7 @@ namespace http {
|
||||||
ShowLeasesSets(s);
|
ShowLeasesSets(s);
|
||||||
else {
|
else {
|
||||||
res.code = 400;
|
res.code = 400;
|
||||||
ShowError(s, std::string (tr("Unknown page")) + ": " + page); // TODO
|
ShowError(s, tr("Unknown page") + ": " + page);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1277,7 +1169,7 @@ namespace http {
|
||||||
url.parse_query(params);
|
url.parse_query(params);
|
||||||
|
|
||||||
std::string webroot; i2p::config::GetOption("http.webroot", webroot);
|
std::string webroot; i2p::config::GetOption("http.webroot", webroot);
|
||||||
std::string redirect = std::to_string(COMMAND_REDIRECT_TIMEOUT) + "; url=" + webroot + "?page=commands";
|
std::string redirect = "5; url=" + webroot + "?page=commands";
|
||||||
std::string token = params["token"];
|
std::string token = params["token"];
|
||||||
|
|
||||||
if (token.empty () || m_Tokens.find (std::stoi (token)) == m_Tokens.end ())
|
if (token.empty () || m_Tokens.find (std::stoi (token)) == m_Tokens.end ())
|
||||||
|
@ -1289,7 +1181,7 @@ namespace http {
|
||||||
std::string cmd = params["cmd"];
|
std::string cmd = params["cmd"];
|
||||||
if (cmd == HTTP_COMMAND_RUN_PEER_TEST)
|
if (cmd == HTTP_COMMAND_RUN_PEER_TEST)
|
||||||
i2p::transport::transports.PeerTest ();
|
i2p::transport::transports.PeerTest ();
|
||||||
else if (cmd == HTTP_COMMAND_RELOAD_TUNNELS_CONFIG)
|
else if (cmd == HTTP_COMMAND_RELOAD_CONFIG)
|
||||||
i2p::client::context.ReloadConfig ();
|
i2p::client::context.ReloadConfig ();
|
||||||
else if (cmd == HTTP_COMMAND_ENABLE_TRANSIT)
|
else if (cmd == HTTP_COMMAND_ENABLE_TRANSIT)
|
||||||
i2p::context.SetAcceptsTunnels (true);
|
i2p::context.SetAcceptsTunnels (true);
|
||||||
|
@ -1351,50 +1243,20 @@ namespace http {
|
||||||
s << "<b>" << tr("ERROR") << "</b>: " << tr("StreamID can't be null") << "<br>\r\n<br>\r\n";
|
s << "<b>" << tr("ERROR") << "</b>: " << tr("StreamID can't be null") << "<br>\r\n<br>\r\n";
|
||||||
|
|
||||||
s << "<a href=\"" << webroot << "?page=local_destination&b32=" << b32 << "\">" << tr("Return to destination page") << "</a><br>\r\n";
|
s << "<a href=\"" << webroot << "?page=local_destination&b32=" << b32 << "\">" << tr("Return to destination page") << "</a><br>\r\n";
|
||||||
s << "<p>" << tr("You will be redirected in %d seconds", COMMAND_REDIRECT_TIMEOUT) << "</b>";
|
s << "<p>" << tr("You will be redirected in 5 seconds") << "</b>";
|
||||||
redirect = std::to_string(COMMAND_REDIRECT_TIMEOUT) + "; url=" + webroot + "?page=local_destination&b32=" + b32;
|
redirect = "5; 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 << "<b>" << tr("SUCCESS") << "</b>: " << tr("LeaseSet expiration time updated") << "<br>\r\n<br>\r\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
s << "<b>" << tr("ERROR") << "</b>: " << tr("LeaseSet is not found or already expired") << "<br>\r\n<br>\r\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
s << "<b>" << tr("ERROR") << "</b>: " << tr("Destination not found") << "<br>\r\n<br>\r\n";
|
|
||||||
|
|
||||||
s << "<a href=\"" << webroot << "?page=local_destination&b32=" << b32 << "\">" << tr("Return to destination page") << "</a><br>\r\n";
|
|
||||||
s << "<p>" << tr("You will be redirected in %d seconds", COMMAND_REDIRECT_TIMEOUT) << "</b>";
|
|
||||||
redirect = std::to_string(COMMAND_REDIRECT_TIMEOUT) + "; url=" + webroot + "?page=local_destination&b32=" + b32;
|
|
||||||
res.add_header("Refresh", redirect.c_str());
|
res.add_header("Refresh", redirect.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (cmd == HTTP_COMMAND_LIMITTRANSIT)
|
else if (cmd == HTTP_COMMAND_LIMITTRANSIT)
|
||||||
{
|
{
|
||||||
uint32_t limit = std::stoul(params["limit"], nullptr);
|
uint32_t limit = std::stoul(params["limit"], nullptr);
|
||||||
if (limit > 0 && limit <= TRANSIT_TUNNELS_LIMIT)
|
if (limit > 0 && limit <= 65535)
|
||||||
i2p::tunnel::tunnels.SetMaxNumTransitTunnels (limit);
|
SetMaxNumTransitTunnels (limit);
|
||||||
else {
|
else {
|
||||||
s << "<b>" << tr("ERROR") << "</b>: " << tr("Transit tunnels count must not exceed %d", TRANSIT_TUNNELS_LIMIT) << "\r\n<br>\r\n<br>\r\n";
|
s << "<b>" << tr("ERROR") << "</b>: " << tr("Transit tunnels count must not exceed 65535") << "\r\n<br>\r\n<br>\r\n";
|
||||||
s << "<a href=\"" << webroot << "?page=commands\">" << tr("Back to commands list") << "</a>\r\n<br>\r\n";
|
s << "<a href=\"" << webroot << "?page=commands\">" << tr("Back to commands list") << "</a>\r\n<br>\r\n";
|
||||||
s << "<p>" << tr("You will be redirected in %d seconds", COMMAND_REDIRECT_TIMEOUT) << "</b>";
|
s << "<p>" << tr("You will be redirected in 5 seconds") << "</b>";
|
||||||
res.add_header("Refresh", redirect.c_str());
|
res.add_header("Refresh", redirect.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1419,11 +1281,13 @@ namespace http {
|
||||||
{
|
{
|
||||||
auto signatureLen = dest->GetIdentity ()->GetSignatureLen ();
|
auto signatureLen = dest->GetIdentity ()->GetSignatureLen ();
|
||||||
uint8_t * signature = new uint8_t[signatureLen];
|
uint8_t * signature = new uint8_t[signatureLen];
|
||||||
|
char * sig = new char[signatureLen*2];
|
||||||
std::stringstream out;
|
std::stringstream out;
|
||||||
|
|
||||||
out << name << "=" << dest->GetIdentity ()->ToBase64 ();
|
out << name << "=" << dest->GetIdentity ()->ToBase64 ();
|
||||||
dest->Sign ((uint8_t *)out.str ().c_str (), out.str ().length (), signature);
|
dest->Sign ((uint8_t *)out.str ().c_str (), out.str ().length (), signature);
|
||||||
auto sig = i2p::data::ByteStreamToBase64 (signature, signatureLen);
|
auto len = i2p::data::ByteStreamToBase64 (signature, signatureLen, sig, signatureLen*2);
|
||||||
|
sig[len] = 0;
|
||||||
out << "#!sig=" << sig;
|
out << "#!sig=" << sig;
|
||||||
s << "<b>" << tr("SUCCESS") << "</b>:<br>\r\n<form action=\"http://shx5vqsw7usdaunyzr2qmes2fq37oumybpudrd4jjj4e4vk4uusa.b32.i2p/add\" method=\"post\" rel=\"noreferrer\" target=\"_blank\">\r\n"
|
s << "<b>" << tr("SUCCESS") << "</b>:<br>\r\n<form action=\"http://shx5vqsw7usdaunyzr2qmes2fq37oumybpudrd4jjj4e4vk4uusa.b32.i2p/add\" method=\"post\" rel=\"noreferrer\" target=\"_blank\">\r\n"
|
||||||
"<textarea readonly name=\"record\" cols=\"80\" rows=\"10\">" << out.str () << "</textarea>\r\n<br>\r\n<br>\r\n"
|
"<textarea readonly name=\"record\" cols=\"80\" rows=\"10\">" << out.str () << "</textarea>\r\n<br>\r\n<br>\r\n"
|
||||||
|
@ -1432,6 +1296,7 @@ namespace http {
|
||||||
"<input type=\"submit\" value=\"" << tr("Submit") << "\">\r\n"
|
"<input type=\"submit\" value=\"" << tr("Submit") << "\">\r\n"
|
||||||
"</form>\r\n<br>\r\n";
|
"</form>\r\n<br>\r\n";
|
||||||
delete[] signature;
|
delete[] signature;
|
||||||
|
delete[] sig;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
s << "<b>" << tr("ERROR") << "</b>: " << tr("Domain can't end with .b32.i2p") << "\r\n<br>\r\n<br>\r\n";
|
s << "<b>" << tr("ERROR") << "</b>: " << tr("Domain can't end with .b32.i2p") << "\r\n<br>\r\n<br>\r\n";
|
||||||
|
@ -1460,13 +1325,13 @@ namespace http {
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.code = 400;
|
res.code = 400;
|
||||||
ShowError(s, std::string (tr("Unknown command")) + ": " + cmd); // TODO
|
ShowError(s, tr("Unknown command") + ": " + cmd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
s << "<b>" << tr("SUCCESS") << "</b>: " << tr("Command accepted") << "<br><br>\r\n";
|
s << "<b>" << tr("SUCCESS") << "</b>: " << tr("Command accepted") << "<br><br>\r\n";
|
||||||
s << "<a href=\"" << webroot << "?page=commands\">" << tr("Back to commands list") << "</a><br>\r\n";
|
s << "<a href=\"" << webroot << "?page=commands\">" << tr("Back to commands list") << "</a><br>\r\n";
|
||||||
s << "<p>" << tr("You will be redirected in %d seconds", COMMAND_REDIRECT_TIMEOUT) << "</b>";
|
s << "<p>" << tr("You will be redirected in 5 seconds") << "</b>";
|
||||||
res.add_header("Refresh", redirect.c_str());
|
res.add_header("Refresh", redirect.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1479,13 +1344,13 @@ namespace http {
|
||||||
reply.body = content;
|
reply.body = content;
|
||||||
|
|
||||||
m_SendBuffer = reply.to_string();
|
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));
|
std::bind (&HTTPConnection::Terminate, shared_from_this (), std::placeholders::_1));
|
||||||
}
|
}
|
||||||
|
|
||||||
HTTPServer::HTTPServer (const std::string& address, int port):
|
HTTPServer::HTTPServer (const std::string& address, int port):
|
||||||
m_IsRunning (false), m_Thread (nullptr), m_Work (m_Service.get_executor ()),
|
m_IsRunning (false), m_Thread (nullptr), m_Work (m_Service),
|
||||||
m_Acceptor (m_Service, boost::asio::ip::tcp::endpoint (boost::asio::ip::make_address(address), port)),
|
m_Acceptor (m_Service, boost::asio::ip::tcp::endpoint (boost::asio::ip::address::from_string(address), port)),
|
||||||
m_Hostname(address)
|
m_Hostname(address)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2024, The PurpleI2P Project
|
* Copyright (c) 2013-2020, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
|
@ -24,8 +24,6 @@ namespace http
|
||||||
{
|
{
|
||||||
const size_t HTTP_CONNECTION_BUFFER_SIZE = 8192;
|
const size_t HTTP_CONNECTION_BUFFER_SIZE = 8192;
|
||||||
const int TOKEN_EXPIRATION_TIMEOUT = 30; // in seconds
|
const int TOKEN_EXPIRATION_TIMEOUT = 30; // in seconds
|
||||||
const int COMMAND_REDIRECT_TIMEOUT = 5; // in seconds
|
|
||||||
const int TRANSIT_TUNNELS_LIMIT = 1000000;
|
|
||||||
|
|
||||||
class HTTPConnection: public std::enable_shared_from_this<HTTPConnection>
|
class HTTPConnection: public std::enable_shared_from_this<HTTPConnection>
|
||||||
{
|
{
|
||||||
|
@ -83,8 +81,8 @@ namespace http
|
||||||
|
|
||||||
bool m_IsRunning;
|
bool m_IsRunning;
|
||||||
std::unique_ptr<std::thread> m_Thread;
|
std::unique_ptr<std::thread> m_Thread;
|
||||||
boost::asio::io_context m_Service;
|
boost::asio::io_service m_Service;
|
||||||
boost::asio::executor_work_guard<boost::asio::io_context::executor_type> m_Work;
|
boost::asio::io_service::work m_Work;
|
||||||
boost::asio::ip::tcp::acceptor m_Acceptor;
|
boost::asio::ip::tcp::acceptor m_Acceptor;
|
||||||
std::string m_Hostname;
|
std::string m_Hostname;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2023, The PurpleI2P Project
|
* Copyright (c) 2013-2022, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
|
@ -38,7 +38,7 @@ namespace http
|
||||||
"@media (prefers-color-scheme: dark) { :root { --main-bg-color: #242424; --main-text-color: #17ab5c; --main-link-color: #bf64b7; --main-link-hover-color: #000000; } }\r\n"
|
"@media (prefers-color-scheme: dark) { :root { --main-bg-color: #242424; --main-text-color: #17ab5c; --main-link-color: #bf64b7; --main-link-hover-color: #000000; } }\r\n"
|
||||||
"body { font: 100%/1.5em sans-serif; margin: 0; padding: 1.5em; background: var(--main-bg-color); color: var(--main-text-color); }\r\n"
|
"body { font: 100%/1.5em sans-serif; margin: 0; padding: 1.5em; background: var(--main-bg-color); color: var(--main-text-color); }\r\n"
|
||||||
"a, .slide label { text-decoration: none; color: var(--main-link-color); }\r\n"
|
"a, .slide label { text-decoration: none; color: var(--main-link-color); }\r\n"
|
||||||
"a:hover, a.button.selected, .slide label:hover, button[type=submit]:hover { color: var(--main-link-hover-color); background: var(--main-link-color); }\r\n"
|
"a:hover, .slide label:hover, button[type=submit]:hover { color: var(--main-link-hover-color); background: var(--main-link-color); }\r\n"
|
||||||
"a.button { appearance: button; text-decoration: none; padding: 0 5px; border: 1px solid var(--main-link-color); }\r\n"
|
"a.button { appearance: button; text-decoration: none; padding: 0 5px; border: 1px solid var(--main-link-color); }\r\n"
|
||||||
".header { font-size: 2.5em; text-align: center; margin: 1em 0; color: var(--main-link-color); }\r\n"
|
".header { font-size: 2.5em; text-align: center; margin: 1em 0; color: var(--main-link-color); }\r\n"
|
||||||
".wrapper { margin: 0 auto; padding: 1em; max-width: 64em; }\r\n"
|
".wrapper { margin: 0 auto; padding: 1em; max-width: 64em; }\r\n"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2025, The PurpleI2P Project
|
* Copyright (c) 2013-2022, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
|
@ -8,20 +8,31 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iomanip>
|
|
||||||
#include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
// Use global placeholders from boost introduced when local_time.hpp is loaded
|
// Use global placeholders from boost introduced when local_time.hpp is loaded
|
||||||
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
||||||
|
|
||||||
|
#include <boost/lexical_cast.hpp>
|
||||||
|
#include <boost/date_time/local_time/local_time.hpp>
|
||||||
|
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||||
|
#include <boost/property_tree/ini_parser.hpp>
|
||||||
#include <boost/property_tree/json_parser.hpp>
|
#include <boost/property_tree/json_parser.hpp>
|
||||||
|
|
||||||
|
#include "Crypto.h"
|
||||||
#include "FS.h"
|
#include "FS.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "NetDb.hpp"
|
#include "NetDb.hpp"
|
||||||
#include "Tunnel.h"
|
#include "RouterContext.h"
|
||||||
#include "Daemon.h"
|
#include "Daemon.h"
|
||||||
|
#include "Tunnel.h"
|
||||||
|
#include "Timestamp.h"
|
||||||
|
#include "Transports.h"
|
||||||
|
#include "version.h"
|
||||||
|
#include "util.h"
|
||||||
|
#include "ClientContext.h"
|
||||||
#include "I2PControl.h"
|
#include "I2PControl.h"
|
||||||
|
|
||||||
namespace i2p
|
namespace i2p
|
||||||
|
@ -29,24 +40,11 @@ namespace i2p
|
||||||
namespace client
|
namespace client
|
||||||
{
|
{
|
||||||
I2PControlService::I2PControlService (const std::string& address, int port):
|
I2PControlService::I2PControlService (const std::string& address, int port):
|
||||||
m_IsRunning (false),
|
m_IsRunning (false), m_Thread (nullptr),
|
||||||
|
m_Acceptor (m_Service, boost::asio::ip::tcp::endpoint(boost::asio::ip::address::from_string(address), port)),
|
||||||
m_SSLContext (boost::asio::ssl::context::sslv23),
|
m_SSLContext (boost::asio::ssl::context::sslv23),
|
||||||
m_ShutdownTimer (m_Service)
|
m_ShutdownTimer (m_Service)
|
||||||
{
|
{
|
||||||
if (port)
|
|
||||||
m_Acceptor = std::make_unique<boost::asio::ip::tcp::acceptor>(m_Service,
|
|
||||||
boost::asio::ip::tcp::endpoint(boost::asio::ip::make_address(address), port));
|
|
||||||
else
|
|
||||||
#if defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
|
|
||||||
{
|
|
||||||
std::remove (address.c_str ()); // just in case
|
|
||||||
m_LocalAcceptor = std::make_unique<boost::asio::local::stream_protocol::acceptor>(m_Service,
|
|
||||||
boost::asio::local::stream_protocol::endpoint(address));
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
LogPrint(eLogError, "I2PControl: Local sockets are not supported");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
i2p::config::GetOption("i2pcontrol.password", m_Password);
|
i2p::config::GetOption("i2pcontrol.password", m_Password);
|
||||||
|
|
||||||
// certificate / keys
|
// certificate / keys
|
||||||
|
@ -57,46 +55,59 @@ namespace client
|
||||||
i2pcp_crt = i2p::fs::DataDirPath(i2pcp_crt);
|
i2pcp_crt = i2p::fs::DataDirPath(i2pcp_crt);
|
||||||
if (i2pcp_key.at(0) != '/')
|
if (i2pcp_key.at(0) != '/')
|
||||||
i2pcp_key = i2p::fs::DataDirPath(i2pcp_key);
|
i2pcp_key = i2p::fs::DataDirPath(i2pcp_key);
|
||||||
if (!i2p::fs::Exists (i2pcp_crt) || !i2p::fs::Exists (i2pcp_key))
|
if (!i2p::fs::Exists (i2pcp_crt) || !i2p::fs::Exists (i2pcp_key)) {
|
||||||
{
|
|
||||||
LogPrint (eLogInfo, "I2PControl: Creating new certificate for control connection");
|
LogPrint (eLogInfo, "I2PControl: Creating new certificate for control connection");
|
||||||
CreateCertificate (i2pcp_crt.c_str(), i2pcp_key.c_str());
|
CreateCertificate (i2pcp_crt.c_str(), i2pcp_key.c_str());
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
LogPrint(eLogDebug, "I2PControl: Using cert from ", i2pcp_crt);
|
LogPrint(eLogDebug, "I2PControl: Using cert from ", i2pcp_crt);
|
||||||
m_SSLContext.set_options (boost::asio::ssl::context::default_workarounds | boost::asio::ssl::context::no_sslv2 | boost::asio::ssl::context::single_dh_use);
|
|
||||||
boost::system::error_code ec;
|
|
||||||
m_SSLContext.use_certificate_file (i2pcp_crt, boost::asio::ssl::context::pem, ec);
|
|
||||||
if (!ec)
|
|
||||||
m_SSLContext.use_private_key_file (i2pcp_key, boost::asio::ssl::context::pem, ec);
|
|
||||||
if (ec)
|
|
||||||
{
|
|
||||||
LogPrint (eLogInfo, "I2PControl: Failed to load ceritifcate: ", ec.message (), ". Recreating");
|
|
||||||
CreateCertificate (i2pcp_crt.c_str(), i2pcp_key.c_str());
|
|
||||||
m_SSLContext.use_certificate_file (i2pcp_crt, boost::asio::ssl::context::pem, ec);
|
|
||||||
if (!ec)
|
|
||||||
m_SSLContext.use_private_key_file (i2pcp_key, boost::asio::ssl::context::pem, ec);
|
|
||||||
if (ec)
|
|
||||||
// give up
|
|
||||||
LogPrint (eLogError, "I2PControl: Can't load certificates");
|
|
||||||
}
|
}
|
||||||
|
m_SSLContext.set_options (boost::asio::ssl::context::default_workarounds | boost::asio::ssl::context::no_sslv2 | boost::asio::ssl::context::single_dh_use);
|
||||||
|
m_SSLContext.use_certificate_file (i2pcp_crt, boost::asio::ssl::context::pem);
|
||||||
|
m_SSLContext.use_private_key_file (i2pcp_key, boost::asio::ssl::context::pem);
|
||||||
|
|
||||||
// handlers
|
// handlers
|
||||||
m_MethodHandlers["Authenticate"] = &I2PControlService::AuthenticateHandler;
|
m_MethodHandlers["Authenticate"] = &I2PControlService::AuthenticateHandler;
|
||||||
m_MethodHandlers["Echo"] = &I2PControlService::EchoHandler;
|
m_MethodHandlers["Echo"] = &I2PControlService::EchoHandler;
|
||||||
m_MethodHandlers["I2PControl"] = &I2PControlService::I2PControlHandler;
|
m_MethodHandlers["I2PControl"] = &I2PControlService::I2PControlHandler;
|
||||||
m_MethodHandlers["RouterInfo"] = &I2PControlHandlers::RouterInfoHandler;
|
m_MethodHandlers["RouterInfo"] = &I2PControlService::RouterInfoHandler;
|
||||||
m_MethodHandlers["RouterManager"] = &I2PControlService::RouterManagerHandler;
|
m_MethodHandlers["RouterManager"] = &I2PControlService::RouterManagerHandler;
|
||||||
m_MethodHandlers["NetworkSetting"] = &I2PControlHandlers::NetworkSettingHandler;
|
m_MethodHandlers["NetworkSetting"] = &I2PControlService::NetworkSettingHandler;
|
||||||
m_MethodHandlers["ClientServicesInfo"] = &I2PControlHandlers::ClientServicesInfoHandler;
|
m_MethodHandlers["ClientServicesInfo"] = &I2PControlService::ClientServicesInfoHandler;
|
||||||
|
|
||||||
// I2PControl
|
// I2PControl
|
||||||
m_I2PControlHandlers["i2pcontrol.password"] = &I2PControlService::PasswordHandler;
|
m_I2PControlHandlers["i2pcontrol.password"] = &I2PControlService::PasswordHandler;
|
||||||
|
|
||||||
|
// RouterInfo
|
||||||
|
m_RouterInfoHandlers["i2p.router.uptime"] = &I2PControlService::UptimeHandler;
|
||||||
|
m_RouterInfoHandlers["i2p.router.version"] = &I2PControlService::VersionHandler;
|
||||||
|
m_RouterInfoHandlers["i2p.router.status"] = &I2PControlService::StatusHandler;
|
||||||
|
m_RouterInfoHandlers["i2p.router.netdb.knownpeers"] = &I2PControlService::NetDbKnownPeersHandler;
|
||||||
|
m_RouterInfoHandlers["i2p.router.netdb.activepeers"] = &I2PControlService::NetDbActivePeersHandler;
|
||||||
|
m_RouterInfoHandlers["i2p.router.net.bw.inbound.1s"] = &I2PControlService::InboundBandwidth1S;
|
||||||
|
m_RouterInfoHandlers["i2p.router.net.bw.outbound.1s"] = &I2PControlService::OutboundBandwidth1S;
|
||||||
|
m_RouterInfoHandlers["i2p.router.net.status"] = &I2PControlService::NetStatusHandler;
|
||||||
|
m_RouterInfoHandlers["i2p.router.net.tunnels.participating"] = &I2PControlService::TunnelsParticipatingHandler;
|
||||||
|
m_RouterInfoHandlers["i2p.router.net.tunnels.successrate"] =
|
||||||
|
&I2PControlService::TunnelsSuccessRateHandler;
|
||||||
|
m_RouterInfoHandlers["i2p.router.net.total.received.bytes"] = &I2PControlService::NetTotalReceivedBytes;
|
||||||
|
m_RouterInfoHandlers["i2p.router.net.total.sent.bytes"] = &I2PControlService::NetTotalSentBytes;
|
||||||
|
|
||||||
// RouterManager
|
// RouterManager
|
||||||
m_RouterManagerHandlers["Reseed"] = &I2PControlService::ReseedHandler;
|
m_RouterManagerHandlers["Reseed"] = &I2PControlService::ReseedHandler;
|
||||||
m_RouterManagerHandlers["Shutdown"] = &I2PControlService::ShutdownHandler;
|
m_RouterManagerHandlers["Shutdown"] = &I2PControlService::ShutdownHandler;
|
||||||
m_RouterManagerHandlers["ShutdownGraceful"] = &I2PControlService::ShutdownGracefulHandler;
|
m_RouterManagerHandlers["ShutdownGraceful"] = &I2PControlService::ShutdownGracefulHandler;
|
||||||
|
|
||||||
|
// NetworkSetting
|
||||||
|
m_NetworkSettingHandlers["i2p.router.net.bw.in"] = &I2PControlService::InboundBandwidthLimit;
|
||||||
|
m_NetworkSettingHandlers["i2p.router.net.bw.out"] = &I2PControlService::OutboundBandwidthLimit;
|
||||||
|
|
||||||
|
// ClientServicesInfo
|
||||||
|
m_ClientServicesInfoHandlers["I2PTunnel"] = &I2PControlService::I2PTunnelInfoHandler;
|
||||||
|
m_ClientServicesInfoHandlers["HTTPProxy"] = &I2PControlService::HTTPProxyInfoHandler;
|
||||||
|
m_ClientServicesInfoHandlers["SOCKS"] = &I2PControlService::SOCKSInfoHandler;
|
||||||
|
m_ClientServicesInfoHandlers["SAM"] = &I2PControlService::SAMInfoHandler;
|
||||||
|
m_ClientServicesInfoHandlers["BOB"] = &I2PControlService::BOBInfoHandler;
|
||||||
|
m_ClientServicesInfoHandlers["I2CP"] = &I2PControlService::I2CPInfoHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
I2PControlService::~I2PControlService ()
|
I2PControlService::~I2PControlService ()
|
||||||
|
@ -110,7 +121,7 @@ namespace client
|
||||||
{
|
{
|
||||||
Accept ();
|
Accept ();
|
||||||
m_IsRunning = true;
|
m_IsRunning = true;
|
||||||
m_Thread = std::make_unique<std::thread>(std::bind (&I2PControlService::Run, this));
|
m_Thread = new std::thread (std::bind (&I2PControlService::Run, this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,19 +130,12 @@ namespace client
|
||||||
if (m_IsRunning)
|
if (m_IsRunning)
|
||||||
{
|
{
|
||||||
m_IsRunning = false;
|
m_IsRunning = false;
|
||||||
if (m_Acceptor) m_Acceptor->cancel ();
|
m_Acceptor.cancel ();
|
||||||
#if defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
|
|
||||||
if (m_LocalAcceptor)
|
|
||||||
{
|
|
||||||
auto path = m_LocalAcceptor->local_endpoint().path();
|
|
||||||
m_LocalAcceptor->cancel ();
|
|
||||||
std::remove (path.c_str ());
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
m_Service.stop ();
|
m_Service.stop ();
|
||||||
if (m_Thread)
|
if (m_Thread)
|
||||||
{
|
{
|
||||||
m_Thread->join ();
|
m_Thread->join ();
|
||||||
|
delete m_Thread;
|
||||||
m_Thread = nullptr;
|
m_Thread = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -153,60 +157,40 @@ namespace client
|
||||||
|
|
||||||
void I2PControlService::Accept ()
|
void I2PControlService::Accept ()
|
||||||
{
|
{
|
||||||
if (m_Acceptor)
|
auto newSocket = std::make_shared<ssl_socket> (m_Service, m_SSLContext);
|
||||||
{
|
m_Acceptor.async_accept (newSocket->lowest_layer(), std::bind (&I2PControlService::HandleAccept, this,
|
||||||
auto newSocket = std::make_shared<boost::asio::ssl::stream<boost::asio::ip::tcp::socket> > (m_Service, m_SSLContext);
|
std::placeholders::_1, newSocket));
|
||||||
m_Acceptor->async_accept (newSocket->lowest_layer(),
|
|
||||||
[this, newSocket](const boost::system::error_code& ecode)
|
|
||||||
{
|
|
||||||
HandleAccepted (ecode, newSocket);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
#if defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
|
|
||||||
else if (m_LocalAcceptor)
|
|
||||||
{
|
|
||||||
auto newSocket = std::make_shared<boost::asio::ssl::stream<boost::asio::local::stream_protocol::socket> > (m_Service, m_SSLContext);
|
|
||||||
m_LocalAcceptor->async_accept (newSocket->lowest_layer(),
|
|
||||||
[this, newSocket](const boost::system::error_code& ecode)
|
|
||||||
{
|
|
||||||
HandleAccepted (ecode, newSocket);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename ssl_socket>
|
void I2PControlService::HandleAccept(const boost::system::error_code& ecode, std::shared_ptr<ssl_socket> socket)
|
||||||
void I2PControlService::HandleAccepted (const boost::system::error_code& ecode,
|
|
||||||
std::shared_ptr<ssl_socket> newSocket)
|
|
||||||
{
|
{
|
||||||
if (ecode != boost::asio::error::operation_aborted)
|
if (ecode != boost::asio::error::operation_aborted)
|
||||||
Accept ();
|
Accept ();
|
||||||
|
|
||||||
if (ecode)
|
if (ecode) {
|
||||||
{
|
|
||||||
LogPrint (eLogError, "I2PControl: Accept error: ", ecode.message ());
|
LogPrint (eLogError, "I2PControl: Accept error: ", ecode.message ());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LogPrint (eLogDebug, "I2PControl: New request from ", newSocket->lowest_layer ().remote_endpoint ());
|
LogPrint (eLogDebug, "I2PControl: New request from ", socket->lowest_layer ().remote_endpoint ());
|
||||||
Handshake (newSocket);
|
Handshake (socket);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename ssl_socket>
|
|
||||||
void I2PControlService::Handshake (std::shared_ptr<ssl_socket> socket)
|
void I2PControlService::Handshake (std::shared_ptr<ssl_socket> socket)
|
||||||
{
|
{
|
||||||
socket->async_handshake(boost::asio::ssl::stream_base::server,
|
socket->async_handshake(boost::asio::ssl::stream_base::server,
|
||||||
[this, socket](const boost::system::error_code& ecode)
|
std::bind( &I2PControlService::HandleHandshake, this, std::placeholders::_1, socket));
|
||||||
{
|
}
|
||||||
if (ecode)
|
|
||||||
|
void I2PControlService::HandleHandshake (const boost::system::error_code& ecode, std::shared_ptr<ssl_socket> socket)
|
||||||
{
|
{
|
||||||
|
if (ecode) {
|
||||||
LogPrint (eLogError, "I2PControl: Handshake error: ", ecode.message ());
|
LogPrint (eLogError, "I2PControl: Handshake error: ", ecode.message ());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//std::this_thread::sleep_for (std::chrono::milliseconds(5));
|
||||||
ReadRequest (socket);
|
ReadRequest (socket);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename ssl_socket>
|
|
||||||
void I2PControlService::ReadRequest (std::shared_ptr<ssl_socket> socket)
|
void I2PControlService::ReadRequest (std::shared_ptr<ssl_socket> socket)
|
||||||
{
|
{
|
||||||
auto request = std::make_shared<I2PControlBuffer>();
|
auto request = std::make_shared<I2PControlBuffer>();
|
||||||
|
@ -216,13 +200,10 @@ namespace client
|
||||||
#else
|
#else
|
||||||
boost::asio::buffer (request->data (), request->size ()),
|
boost::asio::buffer (request->data (), request->size ()),
|
||||||
#endif
|
#endif
|
||||||
[this, socket, request](const boost::system::error_code& ecode, size_t bytes_transferred)
|
std::bind(&I2PControlService::HandleRequestReceived, this,
|
||||||
{
|
std::placeholders::_1, std::placeholders::_2, socket, request));
|
||||||
HandleRequestReceived (ecode, bytes_transferred, socket, request);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename ssl_socket>
|
|
||||||
void I2PControlService::HandleRequestReceived (const boost::system::error_code& ecode,
|
void I2PControlService::HandleRequestReceived (const boost::system::error_code& ecode,
|
||||||
size_t bytes_transferred, std::shared_ptr<ssl_socket> socket,
|
size_t bytes_transferred, std::shared_ptr<ssl_socket> socket,
|
||||||
std::shared_ptr<I2PControlBuffer> buf)
|
std::shared_ptr<I2PControlBuffer> buf)
|
||||||
|
@ -300,7 +281,37 @@ namespace client
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename ssl_socket>
|
void I2PControlService::InsertParam (std::ostringstream& ss, const std::string& name, int value) const
|
||||||
|
{
|
||||||
|
ss << "\"" << name << "\":" << value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::InsertParam (std::ostringstream& ss, const std::string& name, const std::string& value, bool quotes) const
|
||||||
|
{
|
||||||
|
ss << "\"" << name << "\":";
|
||||||
|
if (value.length () > 0)
|
||||||
|
{
|
||||||
|
if (quotes)
|
||||||
|
ss << "\"" << value << "\"";
|
||||||
|
else
|
||||||
|
ss << value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ss << "null";
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::InsertParam (std::ostringstream& ss, const std::string& name, double value) const
|
||||||
|
{
|
||||||
|
ss << "\"" << name << "\":" << std::fixed << std::setprecision(2) << value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::InsertParam (std::ostringstream& ss, const std::string& name, const boost::property_tree::ptree& value) const
|
||||||
|
{
|
||||||
|
std::ostringstream buf;
|
||||||
|
boost::property_tree::write_json (buf, value, false);
|
||||||
|
ss << "\"" << name << "\":" << buf.str();
|
||||||
|
}
|
||||||
|
|
||||||
void I2PControlService::SendResponse (std::shared_ptr<ssl_socket> socket,
|
void I2PControlService::SendResponse (std::shared_ptr<ssl_socket> socket,
|
||||||
std::shared_ptr<I2PControlBuffer> buf, std::ostringstream& response, bool isHtml)
|
std::shared_ptr<I2PControlBuffer> buf, std::ostringstream& response, bool isHtml)
|
||||||
{
|
{
|
||||||
|
@ -310,12 +321,12 @@ namespace client
|
||||||
std::ostringstream header;
|
std::ostringstream header;
|
||||||
header << "HTTP/1.1 200 OK\r\n";
|
header << "HTTP/1.1 200 OK\r\n";
|
||||||
header << "Connection: close\r\n";
|
header << "Connection: close\r\n";
|
||||||
header << "Content-Length: " << std::to_string(len) << "\r\n";
|
header << "Content-Length: " << boost::lexical_cast<std::string>(len) << "\r\n";
|
||||||
header << "Content-Type: application/json\r\n";
|
header << "Content-Type: application/json\r\n";
|
||||||
header << "Date: ";
|
header << "Date: ";
|
||||||
std::time_t t = std::time (nullptr);
|
auto facet = new boost::local_time::local_time_facet ("%a, %d %b %Y %H:%M:%S GMT");
|
||||||
std::tm tm = *std::gmtime (&t);
|
header.imbue(std::locale (header.getloc(), facet));
|
||||||
header << std::put_time(&tm, "%a, %d %b %Y %T GMT") << "\r\n";
|
header << boost::posix_time::second_clock::local_time() << "\r\n";
|
||||||
header << "\r\n";
|
header << "\r\n";
|
||||||
offset = header.str ().size ();
|
offset = header.str ().size ();
|
||||||
memcpy (buf->data (), header.str ().c_str (), offset);
|
memcpy (buf->data (), header.str ().c_str (), offset);
|
||||||
|
@ -323,11 +334,16 @@ namespace client
|
||||||
memcpy (buf->data () + offset, response.str ().c_str (), len);
|
memcpy (buf->data () + offset, response.str ().c_str (), len);
|
||||||
boost::asio::async_write (*socket, boost::asio::buffer (buf->data (), offset + len),
|
boost::asio::async_write (*socket, boost::asio::buffer (buf->data (), offset + len),
|
||||||
boost::asio::transfer_all (),
|
boost::asio::transfer_all (),
|
||||||
[socket, buf](const boost::system::error_code& ecode, std::size_t bytes_transferred)
|
std::bind(&I2PControlService::HandleResponseSent, this,
|
||||||
|
std::placeholders::_1, std::placeholders::_2, socket, buf));
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::HandleResponseSent (const boost::system::error_code& ecode, std::size_t bytes_transferred,
|
||||||
|
std::shared_ptr<ssl_socket> socket, std::shared_ptr<I2PControlBuffer> buf)
|
||||||
{
|
{
|
||||||
if (ecode)
|
if (ecode) {
|
||||||
LogPrint (eLogError, "I2PControl: Write error: ", ecode.message ());
|
LogPrint (eLogError, "I2PControl: Write error: ", ecode.message ());
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// handlers
|
// handlers
|
||||||
|
@ -381,6 +397,91 @@ namespace client
|
||||||
m_Tokens.clear ();
|
m_Tokens.clear ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RouterInfo
|
||||||
|
|
||||||
|
void I2PControlService::RouterInfoHandler (const boost::property_tree::ptree& params, std::ostringstream& results)
|
||||||
|
{
|
||||||
|
bool first = true;
|
||||||
|
for (auto it = params.begin (); it != params.end (); it++)
|
||||||
|
{
|
||||||
|
LogPrint (eLogDebug, "I2PControl: RouterInfo request: ", it->first);
|
||||||
|
auto it1 = m_RouterInfoHandlers.find (it->first);
|
||||||
|
if (it1 != m_RouterInfoHandlers.end ())
|
||||||
|
{
|
||||||
|
if (!first) results << ",";
|
||||||
|
else first = false;
|
||||||
|
(this->*(it1->second))(results);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
LogPrint (eLogError, "I2PControl: RouterInfo unknown request ", it->first);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::UptimeHandler (std::ostringstream& results)
|
||||||
|
{
|
||||||
|
InsertParam (results, "i2p.router.uptime", std::to_string (i2p::context.GetUptime ()*1000LL), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::VersionHandler (std::ostringstream& results)
|
||||||
|
{
|
||||||
|
InsertParam (results, "i2p.router.version", VERSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::StatusHandler (std::ostringstream& results)
|
||||||
|
{
|
||||||
|
auto dest = i2p::client::context.GetSharedLocalDestination ();
|
||||||
|
InsertParam (results, "i2p.router.status", (dest && dest->IsReady ()) ? "1" : "0");
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::NetDbKnownPeersHandler (std::ostringstream& results)
|
||||||
|
{
|
||||||
|
InsertParam (results, "i2p.router.netdb.knownpeers", i2p::data::netdb.GetNumRouters ());
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::NetDbActivePeersHandler (std::ostringstream& results)
|
||||||
|
{
|
||||||
|
InsertParam (results, "i2p.router.netdb.activepeers", (int)i2p::transport::transports.GetPeers ().size ());
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::NetStatusHandler (std::ostringstream& results)
|
||||||
|
{
|
||||||
|
InsertParam (results, "i2p.router.net.status", (int)i2p::context.GetStatus ());
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::TunnelsParticipatingHandler (std::ostringstream& results)
|
||||||
|
{
|
||||||
|
int transit = i2p::tunnel::tunnels.GetTransitTunnels ().size ();
|
||||||
|
InsertParam (results, "i2p.router.net.tunnels.participating", transit);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::TunnelsSuccessRateHandler (std::ostringstream& results)
|
||||||
|
{
|
||||||
|
int rate = i2p::tunnel::tunnels.GetTunnelCreationSuccessRate ();
|
||||||
|
InsertParam (results, "i2p.router.net.tunnels.successrate", rate);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::InboundBandwidth1S (std::ostringstream& results)
|
||||||
|
{
|
||||||
|
double bw = i2p::transport::transports.GetInBandwidth ();
|
||||||
|
InsertParam (results, "i2p.router.net.bw.inbound.1s", bw);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::OutboundBandwidth1S (std::ostringstream& results)
|
||||||
|
{
|
||||||
|
double bw = i2p::transport::transports.GetOutBandwidth ();
|
||||||
|
InsertParam (results, "i2p.router.net.bw.outbound.1s", bw);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::NetTotalReceivedBytes (std::ostringstream& results)
|
||||||
|
{
|
||||||
|
InsertParam (results, "i2p.router.net.total.received.bytes", (double)i2p::transport::transports.GetTotalReceivedBytes ());
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::NetTotalSentBytes (std::ostringstream& results)
|
||||||
|
{
|
||||||
|
InsertParam (results, "i2p.router.net.total.sent.bytes", (double)i2p::transport::transports.GetTotalSentBytes ());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// RouterManager
|
// RouterManager
|
||||||
|
|
||||||
|
@ -388,11 +489,10 @@ namespace client
|
||||||
{
|
{
|
||||||
for (auto it = params.begin (); it != params.end (); it++)
|
for (auto it = params.begin (); it != params.end (); it++)
|
||||||
{
|
{
|
||||||
|
if (it != params.begin ()) results << ",";
|
||||||
LogPrint (eLogDebug, "I2PControl: RouterManager request: ", it->first);
|
LogPrint (eLogDebug, "I2PControl: RouterManager request: ", it->first);
|
||||||
auto it1 = m_RouterManagerHandlers.find (it->first);
|
auto it1 = m_RouterManagerHandlers.find (it->first);
|
||||||
if (it1 != m_RouterManagerHandlers.end ())
|
if (it1 != m_RouterManagerHandlers.end ()) {
|
||||||
{
|
|
||||||
if (it != params.begin ()) results << ",";
|
|
||||||
(this->*(it1->second))(results);
|
(this->*(it1->second))(results);
|
||||||
} else
|
} else
|
||||||
LogPrint (eLogError, "I2PControl: RouterManager unknown request: ", it->first);
|
LogPrint (eLogError, "I2PControl: RouterManager unknown request: ", it->first);
|
||||||
|
@ -433,6 +533,37 @@ namespace client
|
||||||
i2p::data::netdb.Reseed ();
|
i2p::data::netdb.Reseed ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// network setting
|
||||||
|
void I2PControlService::NetworkSettingHandler (const boost::property_tree::ptree& params, std::ostringstream& results)
|
||||||
|
{
|
||||||
|
for (auto it = params.begin (); it != params.end (); it++)
|
||||||
|
{
|
||||||
|
LogPrint (eLogDebug, "I2PControl: NetworkSetting request: ", it->first);
|
||||||
|
auto it1 = m_NetworkSettingHandlers.find (it->first);
|
||||||
|
if (it1 != m_NetworkSettingHandlers.end ()) {
|
||||||
|
if (it != params.begin ()) results << ",";
|
||||||
|
(this->*(it1->second))(it->second.data (), results);
|
||||||
|
} else
|
||||||
|
LogPrint (eLogError, "I2PControl: NetworkSetting unknown request: ", it->first);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::InboundBandwidthLimit (const std::string& value, std::ostringstream& results)
|
||||||
|
{
|
||||||
|
if (value != "null")
|
||||||
|
i2p::context.SetBandwidth (std::atoi(value.c_str()));
|
||||||
|
int bw = i2p::context.GetBandwidthLimit();
|
||||||
|
InsertParam (results, "i2p.router.net.bw.in", bw);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::OutboundBandwidthLimit (const std::string& value, std::ostringstream& results)
|
||||||
|
{
|
||||||
|
if (value != "null")
|
||||||
|
i2p::context.SetBandwidth (std::atoi(value.c_str()));
|
||||||
|
int bw = i2p::context.GetBandwidthLimit();
|
||||||
|
InsertParam (results, "i2p.router.net.bw.out", bw);
|
||||||
|
}
|
||||||
|
|
||||||
// certificate
|
// certificate
|
||||||
void I2PControlService::CreateCertificate (const char *crt_path, const char *key_path)
|
void I2PControlService::CreateCertificate (const char *crt_path, const char *key_path)
|
||||||
{
|
{
|
||||||
|
@ -455,7 +586,7 @@ namespace client
|
||||||
X509_NAME_add_entry_by_txt (name, "O", MBSTRING_ASC, (unsigned char *)I2P_CONTROL_CERTIFICATE_ORGANIZATION, -1, -1, 0); // organization
|
X509_NAME_add_entry_by_txt (name, "O", MBSTRING_ASC, (unsigned char *)I2P_CONTROL_CERTIFICATE_ORGANIZATION, -1, -1, 0); // organization
|
||||||
X509_NAME_add_entry_by_txt (name, "CN", MBSTRING_ASC, (unsigned char *)I2P_CONTROL_CERTIFICATE_COMMON_NAME, -1, -1, 0); // common name
|
X509_NAME_add_entry_by_txt (name, "CN", MBSTRING_ASC, (unsigned char *)I2P_CONTROL_CERTIFICATE_COMMON_NAME, -1, -1, 0); // common name
|
||||||
X509_set_issuer_name (x509, name); // set issuer to ourselves
|
X509_set_issuer_name (x509, name); // set issuer to ourselves
|
||||||
X509_sign (x509, pkey, EVP_sha1 ()); // sign, last param must be NULL for EdDSA
|
X509_sign (x509, pkey, EVP_sha1 ()); // sign
|
||||||
|
|
||||||
// save cert
|
// save cert
|
||||||
if ((f = fopen (crt_path, "wb")) != NULL) {
|
if ((f = fopen (crt_path, "wb")) != NULL) {
|
||||||
|
@ -481,5 +612,178 @@ namespace client
|
||||||
}
|
}
|
||||||
EVP_PKEY_free (pkey);
|
EVP_PKEY_free (pkey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ClientServicesInfo
|
||||||
|
|
||||||
|
void I2PControlService::ClientServicesInfoHandler (const boost::property_tree::ptree& params, std::ostringstream& results)
|
||||||
|
{
|
||||||
|
for (auto it = params.begin (); it != params.end (); it++)
|
||||||
|
{
|
||||||
|
LogPrint (eLogDebug, "I2PControl: ClientServicesInfo request: ", it->first);
|
||||||
|
auto it1 = m_ClientServicesInfoHandlers.find (it->first);
|
||||||
|
if (it1 != m_ClientServicesInfoHandlers.end ())
|
||||||
|
{
|
||||||
|
if (it != params.begin ()) results << ",";
|
||||||
|
(this->*(it1->second))(results);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
LogPrint (eLogError, "I2PControl: ClientServicesInfo unknown request ", it->first);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::I2PTunnelInfoHandler (std::ostringstream& results)
|
||||||
|
{
|
||||||
|
boost::property_tree::ptree pt;
|
||||||
|
boost::property_tree::ptree client_tunnels, server_tunnels;
|
||||||
|
|
||||||
|
for (auto& it: i2p::client::context.GetClientTunnels ())
|
||||||
|
{
|
||||||
|
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
||||||
|
boost::property_tree::ptree ct;
|
||||||
|
ct.put("address", i2p::client::context.GetAddressBook ().ToAddress(ident));
|
||||||
|
client_tunnels.add_child(it.second->GetName (), ct);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto& serverTunnels = i2p::client::context.GetServerTunnels ();
|
||||||
|
if (!serverTunnels.empty ()) {
|
||||||
|
for (auto& it: serverTunnels)
|
||||||
|
{
|
||||||
|
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
||||||
|
boost::property_tree::ptree st;
|
||||||
|
st.put("address", i2p::client::context.GetAddressBook ().ToAddress(ident));
|
||||||
|
st.put("port", it.second->GetLocalPort ());
|
||||||
|
server_tunnels.add_child(it.second->GetName (), st);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
auto& clientForwards = i2p::client::context.GetClientForwards ();
|
||||||
|
if (!clientForwards.empty ())
|
||||||
|
{
|
||||||
|
for (auto& it: clientForwards)
|
||||||
|
{
|
||||||
|
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
||||||
|
boost::property_tree::ptree ct;
|
||||||
|
ct.put("address", i2p::client::context.GetAddressBook ().ToAddress(ident));
|
||||||
|
client_tunnels.add_child(it.second->GetName (), ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
auto& serverForwards = i2p::client::context.GetServerForwards ();
|
||||||
|
if (!serverForwards.empty ())
|
||||||
|
{
|
||||||
|
for (auto& it: serverForwards)
|
||||||
|
{
|
||||||
|
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
||||||
|
boost::property_tree::ptree st;
|
||||||
|
st.put("address", i2p::client::context.GetAddressBook ().ToAddress(ident));
|
||||||
|
server_tunnels.add_child(it.second->GetName (), st);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pt.add_child("client", client_tunnels);
|
||||||
|
pt.add_child("server", server_tunnels);
|
||||||
|
|
||||||
|
InsertParam (results, "I2PTunnel", pt);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::HTTPProxyInfoHandler (std::ostringstream& results)
|
||||||
|
{
|
||||||
|
boost::property_tree::ptree pt;
|
||||||
|
|
||||||
|
auto httpProxy = i2p::client::context.GetHttpProxy ();
|
||||||
|
if (httpProxy)
|
||||||
|
{
|
||||||
|
auto& ident = httpProxy->GetLocalDestination ()->GetIdentHash();
|
||||||
|
pt.put("enabled", true);
|
||||||
|
pt.put("address", i2p::client::context.GetAddressBook ().ToAddress(ident));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
pt.put("enabled", false);
|
||||||
|
|
||||||
|
InsertParam (results, "HTTPProxy", pt);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::SOCKSInfoHandler (std::ostringstream& results)
|
||||||
|
{
|
||||||
|
boost::property_tree::ptree pt;
|
||||||
|
|
||||||
|
auto socksProxy = i2p::client::context.GetSocksProxy ();
|
||||||
|
if (socksProxy)
|
||||||
|
{
|
||||||
|
auto& ident = socksProxy->GetLocalDestination ()->GetIdentHash();
|
||||||
|
pt.put("enabled", true);
|
||||||
|
pt.put("address", i2p::client::context.GetAddressBook ().ToAddress(ident));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
pt.put("enabled", false);
|
||||||
|
|
||||||
|
InsertParam (results, "SOCKS", pt);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::SAMInfoHandler (std::ostringstream& results)
|
||||||
|
{
|
||||||
|
boost::property_tree::ptree pt;
|
||||||
|
auto sam = i2p::client::context.GetSAMBridge ();
|
||||||
|
if (sam)
|
||||||
|
{
|
||||||
|
pt.put("enabled", true);
|
||||||
|
boost::property_tree::ptree sam_sessions;
|
||||||
|
for (auto& it: sam->GetSessions ())
|
||||||
|
{
|
||||||
|
boost::property_tree::ptree sam_session, sam_session_sockets;
|
||||||
|
auto& name = it.second->GetLocalDestination ()->GetNickname ();
|
||||||
|
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
||||||
|
sam_session.put("name", name);
|
||||||
|
sam_session.put("address", i2p::client::context.GetAddressBook ().ToAddress(ident));
|
||||||
|
|
||||||
|
for (const auto& socket: sam->ListSockets(it.first))
|
||||||
|
{
|
||||||
|
boost::property_tree::ptree stream;
|
||||||
|
stream.put("type", socket->GetSocketType ());
|
||||||
|
stream.put("peer", socket->GetSocket ().remote_endpoint());
|
||||||
|
|
||||||
|
sam_session_sockets.push_back(std::make_pair("", stream));
|
||||||
|
}
|
||||||
|
sam_session.add_child("sockets", sam_session_sockets);
|
||||||
|
sam_sessions.add_child(it.first, sam_session);
|
||||||
|
}
|
||||||
|
|
||||||
|
pt.add_child("sessions", sam_sessions);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
pt.put("enabled", false);
|
||||||
|
|
||||||
|
InsertParam (results, "SAM", pt);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::BOBInfoHandler (std::ostringstream& results)
|
||||||
|
{
|
||||||
|
boost::property_tree::ptree pt;
|
||||||
|
auto bob = i2p::client::context.GetBOBCommandChannel ();
|
||||||
|
if (bob)
|
||||||
|
{
|
||||||
|
/* TODO more info */
|
||||||
|
pt.put("enabled", true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
pt.put("enabled", false);
|
||||||
|
|
||||||
|
InsertParam (results, "BOB", pt);
|
||||||
|
}
|
||||||
|
|
||||||
|
void I2PControlService::I2CPInfoHandler (std::ostringstream& results)
|
||||||
|
{
|
||||||
|
boost::property_tree::ptree pt;
|
||||||
|
auto i2cp = i2p::client::context.GetI2CPServer ();
|
||||||
|
if (i2cp)
|
||||||
|
{
|
||||||
|
/* TODO more info */
|
||||||
|
pt.put("enabled", true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
pt.put("enabled", false);
|
||||||
|
|
||||||
|
InsertParam (results, "I2CP", pt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2025, The PurpleI2P Project
|
* Copyright (c) 2013-2022, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
|
@ -20,7 +20,6 @@
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
#include <boost/asio/ssl.hpp>
|
#include <boost/asio/ssl.hpp>
|
||||||
#include <boost/property_tree/ptree.hpp>
|
#include <boost/property_tree/ptree.hpp>
|
||||||
#include "I2PControlHandlers.h"
|
|
||||||
|
|
||||||
namespace i2p
|
namespace i2p
|
||||||
{
|
{
|
||||||
|
@ -33,8 +32,10 @@ namespace client
|
||||||
const char I2P_CONTROL_CERTIFICATE_COMMON_NAME[] = "i2pd.i2pcontrol";
|
const char I2P_CONTROL_CERTIFICATE_COMMON_NAME[] = "i2pd.i2pcontrol";
|
||||||
const char I2P_CONTROL_CERTIFICATE_ORGANIZATION[] = "Purple I2P";
|
const char I2P_CONTROL_CERTIFICATE_ORGANIZATION[] = "Purple I2P";
|
||||||
|
|
||||||
class I2PControlService: public I2PControlHandlers
|
class I2PControlService
|
||||||
{
|
{
|
||||||
|
typedef boost::asio::ssl::stream<boost::asio::ip::tcp::socket> ssl_socket;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
I2PControlService (const std::string& address, int port);
|
I2PControlService (const std::string& address, int port);
|
||||||
|
@ -47,59 +48,94 @@ namespace client
|
||||||
|
|
||||||
void Run ();
|
void Run ();
|
||||||
void Accept ();
|
void Accept ();
|
||||||
template<typename ssl_socket>
|
void HandleAccept(const boost::system::error_code& ecode, std::shared_ptr<ssl_socket> socket);
|
||||||
void HandleAccepted (const boost::system::error_code& ecode, std::shared_ptr<ssl_socket> newSocket);
|
|
||||||
template<typename ssl_socket>
|
|
||||||
void Handshake (std::shared_ptr<ssl_socket> socket);
|
void Handshake (std::shared_ptr<ssl_socket> socket);
|
||||||
template<typename ssl_socket>
|
void HandleHandshake (const boost::system::error_code& ecode, std::shared_ptr<ssl_socket> socket);
|
||||||
void ReadRequest (std::shared_ptr<ssl_socket> socket);
|
void ReadRequest (std::shared_ptr<ssl_socket> socket);
|
||||||
template<typename ssl_socket>
|
|
||||||
void HandleRequestReceived (const boost::system::error_code& ecode, size_t bytes_transferred,
|
void HandleRequestReceived (const boost::system::error_code& ecode, size_t bytes_transferred,
|
||||||
std::shared_ptr<ssl_socket> socket, std::shared_ptr<I2PControlBuffer> buf);
|
std::shared_ptr<ssl_socket> socket, std::shared_ptr<I2PControlBuffer> buf);
|
||||||
template<typename ssl_socket>
|
|
||||||
void SendResponse (std::shared_ptr<ssl_socket> socket,
|
void SendResponse (std::shared_ptr<ssl_socket> socket,
|
||||||
std::shared_ptr<I2PControlBuffer> buf, std::ostringstream& response, bool isHtml);
|
std::shared_ptr<I2PControlBuffer> buf, std::ostringstream& response, bool isHtml);
|
||||||
|
void HandleResponseSent (const boost::system::error_code& ecode, std::size_t bytes_transferred,
|
||||||
|
std::shared_ptr<ssl_socket> socket, std::shared_ptr<I2PControlBuffer> buf);
|
||||||
|
|
||||||
void CreateCertificate (const char *crt_path, const char *key_path);
|
void CreateCertificate (const char *crt_path, const char *key_path);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
void InsertParam (std::ostringstream& ss, const std::string& name, int value) const;
|
||||||
|
void InsertParam (std::ostringstream& ss, const std::string& name, double value) const;
|
||||||
|
void InsertParam (std::ostringstream& ss, const std::string& name, const std::string& value, bool quotes = true) const;
|
||||||
|
void InsertParam (std::ostringstream& ss, const std::string& name, const boost::property_tree::ptree& value) const;
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
typedef void (I2PControlService::*MethodHandler)(const boost::property_tree::ptree& params, std::ostringstream& results);
|
typedef void (I2PControlService::*MethodHandler)(const boost::property_tree::ptree& params, std::ostringstream& results);
|
||||||
|
|
||||||
void AuthenticateHandler (const boost::property_tree::ptree& params, std::ostringstream& results);
|
void AuthenticateHandler (const boost::property_tree::ptree& params, std::ostringstream& results);
|
||||||
void EchoHandler (const boost::property_tree::ptree& params, std::ostringstream& results);
|
void EchoHandler (const boost::property_tree::ptree& params, std::ostringstream& results);
|
||||||
void I2PControlHandler (const boost::property_tree::ptree& params, std::ostringstream& results);
|
void I2PControlHandler (const boost::property_tree::ptree& params, std::ostringstream& results);
|
||||||
|
void RouterInfoHandler (const boost::property_tree::ptree& params, std::ostringstream& results);
|
||||||
void RouterManagerHandler (const boost::property_tree::ptree& params, std::ostringstream& results);
|
void RouterManagerHandler (const boost::property_tree::ptree& params, std::ostringstream& results);
|
||||||
|
void NetworkSettingHandler (const boost::property_tree::ptree& params, std::ostringstream& results);
|
||||||
|
void ClientServicesInfoHandler (const boost::property_tree::ptree& params, std::ostringstream& results);
|
||||||
|
|
||||||
// I2PControl
|
// I2PControl
|
||||||
typedef void (I2PControlService::*I2PControlRequestHandler)(const std::string& value);
|
typedef void (I2PControlService::*I2PControlRequestHandler)(const std::string& value);
|
||||||
void PasswordHandler (const std::string& value);
|
void PasswordHandler (const std::string& value);
|
||||||
|
|
||||||
|
// RouterInfo
|
||||||
|
typedef void (I2PControlService::*RouterInfoRequestHandler)(std::ostringstream& results);
|
||||||
|
void UptimeHandler (std::ostringstream& results);
|
||||||
|
void VersionHandler (std::ostringstream& results);
|
||||||
|
void StatusHandler (std::ostringstream& results);
|
||||||
|
void NetDbKnownPeersHandler (std::ostringstream& results);
|
||||||
|
void NetDbActivePeersHandler (std::ostringstream& results);
|
||||||
|
void NetStatusHandler (std::ostringstream& results);
|
||||||
|
void TunnelsParticipatingHandler (std::ostringstream& results);
|
||||||
|
void TunnelsSuccessRateHandler (std::ostringstream& results);
|
||||||
|
void InboundBandwidth1S (std::ostringstream& results);
|
||||||
|
void OutboundBandwidth1S (std::ostringstream& results);
|
||||||
|
void NetTotalReceivedBytes (std::ostringstream& results);
|
||||||
|
void NetTotalSentBytes (std::ostringstream& results);
|
||||||
|
|
||||||
// RouterManager
|
// RouterManager
|
||||||
typedef void (I2PControlService::*RouterManagerRequestHandler)(std::ostringstream& results);
|
typedef void (I2PControlService::*RouterManagerRequestHandler)(std::ostringstream& results);
|
||||||
void ShutdownHandler (std::ostringstream& results);
|
void ShutdownHandler (std::ostringstream& results);
|
||||||
void ShutdownGracefulHandler (std::ostringstream& results);
|
void ShutdownGracefulHandler (std::ostringstream& results);
|
||||||
void ReseedHandler (std::ostringstream& results);
|
void ReseedHandler (std::ostringstream& results);
|
||||||
|
|
||||||
|
// NetworkSetting
|
||||||
|
typedef void (I2PControlService::*NetworkSettingRequestHandler)(const std::string& value, std::ostringstream& results);
|
||||||
|
void InboundBandwidthLimit (const std::string& value, std::ostringstream& results);
|
||||||
|
void OutboundBandwidthLimit (const std::string& value, std::ostringstream& results);
|
||||||
|
|
||||||
|
// ClientServicesInfo
|
||||||
|
typedef void (I2PControlService::*ClientServicesInfoRequestHandler)(std::ostringstream& results);
|
||||||
|
void I2PTunnelInfoHandler (std::ostringstream& results);
|
||||||
|
void HTTPProxyInfoHandler (std::ostringstream& results);
|
||||||
|
void SOCKSInfoHandler (std::ostringstream& results);
|
||||||
|
void SAMInfoHandler (std::ostringstream& results);
|
||||||
|
void BOBInfoHandler (std::ostringstream& results);
|
||||||
|
void I2CPInfoHandler (std::ostringstream& results);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
std::string m_Password;
|
std::string m_Password;
|
||||||
bool m_IsRunning;
|
bool m_IsRunning;
|
||||||
std::unique_ptr<std::thread> m_Thread;
|
std::thread * m_Thread;
|
||||||
|
|
||||||
boost::asio::io_context m_Service;
|
boost::asio::io_service m_Service;
|
||||||
std::unique_ptr<boost::asio::ip::tcp::acceptor> m_Acceptor;
|
boost::asio::ip::tcp::acceptor m_Acceptor;
|
||||||
#if defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
|
|
||||||
std::unique_ptr<boost::asio::local::stream_protocol::acceptor> m_LocalAcceptor;
|
|
||||||
#endif
|
|
||||||
boost::asio::ssl::context m_SSLContext;
|
boost::asio::ssl::context m_SSLContext;
|
||||||
boost::asio::deadline_timer m_ShutdownTimer;
|
boost::asio::deadline_timer m_ShutdownTimer;
|
||||||
std::set<std::string> m_Tokens;
|
std::set<std::string> m_Tokens;
|
||||||
|
|
||||||
std::map<std::string, MethodHandler> m_MethodHandlers;
|
std::map<std::string, MethodHandler> m_MethodHandlers;
|
||||||
std::map<std::string, I2PControlRequestHandler> m_I2PControlHandlers;
|
std::map<std::string, I2PControlRequestHandler> m_I2PControlHandlers;
|
||||||
|
std::map<std::string, RouterInfoRequestHandler> m_RouterInfoHandlers;
|
||||||
std::map<std::string, RouterManagerRequestHandler> m_RouterManagerHandlers;
|
std::map<std::string, RouterManagerRequestHandler> m_RouterManagerHandlers;
|
||||||
|
std::map<std::string, NetworkSettingRequestHandler> m_NetworkSettingHandlers;
|
||||||
|
std::map<std::string, ClientServicesInfoRequestHandler> m_ClientServicesInfoHandlers;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,390 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2022, 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 <iomanip>
|
|
||||||
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
|
||||||
#include <boost/lexical_cast.hpp>
|
|
||||||
#include <boost/property_tree/json_parser.hpp>
|
|
||||||
|
|
||||||
#include "Log.h"
|
|
||||||
#include "RouterContext.h"
|
|
||||||
#include "NetDb.hpp"
|
|
||||||
#include "Tunnel.h"
|
|
||||||
#include "Transports.h"
|
|
||||||
#include "version.h"
|
|
||||||
#include "ClientContext.h"
|
|
||||||
#include "I2PControlHandlers.h"
|
|
||||||
|
|
||||||
namespace i2p
|
|
||||||
{
|
|
||||||
namespace client
|
|
||||||
{
|
|
||||||
I2PControlHandlers::I2PControlHandlers ()
|
|
||||||
{
|
|
||||||
// RouterInfo
|
|
||||||
m_RouterInfoHandlers["i2p.router.uptime"] = &I2PControlHandlers::UptimeHandler;
|
|
||||||
m_RouterInfoHandlers["i2p.router.version"] = &I2PControlHandlers::VersionHandler;
|
|
||||||
m_RouterInfoHandlers["i2p.router.status"] = &I2PControlHandlers::StatusHandler;
|
|
||||||
m_RouterInfoHandlers["i2p.router.netdb.knownpeers"] = &I2PControlHandlers::NetDbKnownPeersHandler;
|
|
||||||
m_RouterInfoHandlers["i2p.router.netdb.activepeers"] = &I2PControlHandlers::NetDbActivePeersHandler;
|
|
||||||
m_RouterInfoHandlers["i2p.router.net.bw.inbound.1s"] = &I2PControlHandlers::InboundBandwidth1S;
|
|
||||||
m_RouterInfoHandlers["i2p.router.net.bw.inbound.15s"] = &I2PControlHandlers::InboundBandwidth15S;
|
|
||||||
m_RouterInfoHandlers["i2p.router.net.bw.outbound.1s"] = &I2PControlHandlers::OutboundBandwidth1S;
|
|
||||||
m_RouterInfoHandlers["i2p.router.net.bw.outbound.15s"] = &I2PControlHandlers::OutboundBandwidth15S;
|
|
||||||
m_RouterInfoHandlers["i2p.router.net.status"] = &I2PControlHandlers::NetStatusHandler;
|
|
||||||
m_RouterInfoHandlers["i2p.router.net.tunnels.participating"] = &I2PControlHandlers::TunnelsParticipatingHandler;
|
|
||||||
m_RouterInfoHandlers["i2p.router.net.tunnels.successrate"] = &I2PControlHandlers::TunnelsSuccessRateHandler;
|
|
||||||
m_RouterInfoHandlers["i2p.router.net.total.received.bytes"] = &I2PControlHandlers::NetTotalReceivedBytes;
|
|
||||||
m_RouterInfoHandlers["i2p.router.net.total.sent.bytes"] = &I2PControlHandlers::NetTotalSentBytes;
|
|
||||||
|
|
||||||
// NetworkSetting
|
|
||||||
m_NetworkSettingHandlers["i2p.router.net.bw.in"] = &I2PControlHandlers::InboundBandwidthLimit;
|
|
||||||
m_NetworkSettingHandlers["i2p.router.net.bw.out"] = &I2PControlHandlers::OutboundBandwidthLimit;
|
|
||||||
|
|
||||||
// ClientServicesInfo
|
|
||||||
m_ClientServicesInfoHandlers["I2PTunnel"] = &I2PControlHandlers::I2PTunnelInfoHandler;
|
|
||||||
m_ClientServicesInfoHandlers["HTTPProxy"] = &I2PControlHandlers::HTTPProxyInfoHandler;
|
|
||||||
m_ClientServicesInfoHandlers["SOCKS"] = &I2PControlHandlers::SOCKSInfoHandler;
|
|
||||||
m_ClientServicesInfoHandlers["SAM"] = &I2PControlHandlers::SAMInfoHandler;
|
|
||||||
m_ClientServicesInfoHandlers["BOB"] = &I2PControlHandlers::BOBInfoHandler;
|
|
||||||
m_ClientServicesInfoHandlers["I2CP"] = &I2PControlHandlers::I2CPInfoHandler;
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::InsertParam (std::ostringstream& ss, const std::string& name, int value) const
|
|
||||||
{
|
|
||||||
ss << "\"" << name << "\":" << value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::InsertParam (std::ostringstream& ss, const std::string& name, const std::string& value, bool quotes) const
|
|
||||||
{
|
|
||||||
ss << "\"" << name << "\":";
|
|
||||||
if (value.length () > 0)
|
|
||||||
{
|
|
||||||
if (quotes)
|
|
||||||
ss << "\"" << value << "\"";
|
|
||||||
else
|
|
||||||
ss << value;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ss << "null";
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::InsertParam (std::ostringstream& ss, const std::string& name, double value) const
|
|
||||||
{
|
|
||||||
ss << "\"" << name << "\":" << std::fixed << std::setprecision(2) << value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::InsertParam (std::ostringstream& ss, const std::string& name, const boost::property_tree::ptree& value) const
|
|
||||||
{
|
|
||||||
std::ostringstream buf;
|
|
||||||
boost::property_tree::write_json (buf, value, false);
|
|
||||||
ss << "\"" << name << "\":" << buf.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
// RouterInfo
|
|
||||||
|
|
||||||
void I2PControlHandlers::RouterInfoHandler (const boost::property_tree::ptree& params, std::ostringstream& results)
|
|
||||||
{
|
|
||||||
bool first = true;
|
|
||||||
for (auto it = params.begin (); it != params.end (); it++)
|
|
||||||
{
|
|
||||||
LogPrint (eLogDebug, "I2PControl: RouterInfo request: ", it->first);
|
|
||||||
auto it1 = m_RouterInfoHandlers.find (it->first);
|
|
||||||
if (it1 != m_RouterInfoHandlers.end ())
|
|
||||||
{
|
|
||||||
if (!first) results << ",";
|
|
||||||
else first = false;
|
|
||||||
(this->*(it1->second))(results);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
LogPrint (eLogError, "I2PControl: RouterInfo unknown request ", it->first);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::UptimeHandler (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
InsertParam (results, "i2p.router.uptime", std::to_string (i2p::context.GetUptime ()*1000LL), false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::VersionHandler (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
InsertParam (results, "i2p.router.version", VERSION);
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::StatusHandler (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
auto dest = i2p::client::context.GetSharedLocalDestination ();
|
|
||||||
InsertParam (results, "i2p.router.status", (dest && dest->IsReady ()) ? "1" : "0");
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::NetDbKnownPeersHandler (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
InsertParam (results, "i2p.router.netdb.knownpeers", i2p::data::netdb.GetNumRouters ());
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::NetDbActivePeersHandler (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
InsertParam (results, "i2p.router.netdb.activepeers", (int)i2p::transport::transports.GetPeers ().size ());
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::NetStatusHandler (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
InsertParam (results, "i2p.router.net.status", (int)i2p::context.GetStatus ());
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::TunnelsParticipatingHandler (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
int transit = i2p::tunnel::tunnels.GetTransitTunnels ().size ();
|
|
||||||
InsertParam (results, "i2p.router.net.tunnels.participating", transit);
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::TunnelsSuccessRateHandler (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
int rate = i2p::tunnel::tunnels.GetTunnelCreationSuccessRate ();
|
|
||||||
InsertParam (results, "i2p.router.net.tunnels.successrate", rate);
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::InboundBandwidth1S (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
double bw = i2p::transport::transports.GetInBandwidth ();
|
|
||||||
InsertParam (results, "i2p.router.net.bw.inbound.1s", bw);
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::InboundBandwidth15S (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
double bw = i2p::transport::transports.GetInBandwidth15s ();
|
|
||||||
InsertParam (results, "i2p.router.net.bw.inbound.15s", bw);
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::OutboundBandwidth1S (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
double bw = i2p::transport::transports.GetOutBandwidth ();
|
|
||||||
InsertParam (results, "i2p.router.net.bw.outbound.1s", bw);
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::OutboundBandwidth15S (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
double bw = i2p::transport::transports.GetOutBandwidth15s ();
|
|
||||||
InsertParam (results, "i2p.router.net.bw.outbound.15s", bw);
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::NetTotalReceivedBytes (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
InsertParam (results, "i2p.router.net.total.received.bytes", (double)i2p::transport::transports.GetTotalReceivedBytes ());
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::NetTotalSentBytes (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
InsertParam (results, "i2p.router.net.total.sent.bytes", (double)i2p::transport::transports.GetTotalSentBytes ());
|
|
||||||
}
|
|
||||||
|
|
||||||
// network setting
|
|
||||||
void I2PControlHandlers::NetworkSettingHandler (const boost::property_tree::ptree& params, std::ostringstream& results)
|
|
||||||
{
|
|
||||||
for (auto it = params.begin (); it != params.end (); it++)
|
|
||||||
{
|
|
||||||
LogPrint (eLogDebug, "I2PControl: NetworkSetting request: ", it->first);
|
|
||||||
auto it1 = m_NetworkSettingHandlers.find (it->first);
|
|
||||||
if (it1 != m_NetworkSettingHandlers.end ()) {
|
|
||||||
if (it != params.begin ()) results << ",";
|
|
||||||
(this->*(it1->second))(it->second.data (), results);
|
|
||||||
} else
|
|
||||||
LogPrint (eLogError, "I2PControl: NetworkSetting unknown request: ", it->first);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::InboundBandwidthLimit (const std::string& value, std::ostringstream& results)
|
|
||||||
{
|
|
||||||
if (value != "null")
|
|
||||||
i2p::context.SetBandwidth (std::atoi(value.c_str()));
|
|
||||||
int bw = i2p::context.GetBandwidthLimit();
|
|
||||||
InsertParam (results, "i2p.router.net.bw.in", bw);
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::OutboundBandwidthLimit (const std::string& value, std::ostringstream& results)
|
|
||||||
{
|
|
||||||
if (value != "null")
|
|
||||||
i2p::context.SetBandwidth (std::atoi(value.c_str()));
|
|
||||||
int bw = i2p::context.GetBandwidthLimit();
|
|
||||||
InsertParam (results, "i2p.router.net.bw.out", bw);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ClientServicesInfo
|
|
||||||
|
|
||||||
void I2PControlHandlers::ClientServicesInfoHandler (const boost::property_tree::ptree& params, std::ostringstream& results)
|
|
||||||
{
|
|
||||||
for (auto it = params.begin (); it != params.end (); it++)
|
|
||||||
{
|
|
||||||
LogPrint (eLogDebug, "I2PControl: ClientServicesInfo request: ", it->first);
|
|
||||||
auto it1 = m_ClientServicesInfoHandlers.find (it->first);
|
|
||||||
if (it1 != m_ClientServicesInfoHandlers.end ())
|
|
||||||
{
|
|
||||||
if (it != params.begin ()) results << ",";
|
|
||||||
(this->*(it1->second))(results);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
LogPrint (eLogError, "I2PControl: ClientServicesInfo unknown request ", it->first);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::I2PTunnelInfoHandler (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
boost::property_tree::ptree pt;
|
|
||||||
boost::property_tree::ptree client_tunnels, server_tunnels;
|
|
||||||
|
|
||||||
for (auto& it: i2p::client::context.GetClientTunnels ())
|
|
||||||
{
|
|
||||||
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
|
||||||
boost::property_tree::ptree ct;
|
|
||||||
ct.put("address", i2p::client::context.GetAddressBook ().ToAddress(ident));
|
|
||||||
client_tunnels.add_child(it.second->GetName (), ct);
|
|
||||||
}
|
|
||||||
|
|
||||||
auto& serverTunnels = i2p::client::context.GetServerTunnels ();
|
|
||||||
if (!serverTunnels.empty ()) {
|
|
||||||
for (auto& it: serverTunnels)
|
|
||||||
{
|
|
||||||
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
|
||||||
boost::property_tree::ptree st;
|
|
||||||
st.put("address", i2p::client::context.GetAddressBook ().ToAddress(ident));
|
|
||||||
st.put("port", it.second->GetLocalPort ());
|
|
||||||
server_tunnels.add_child(it.second->GetName (), st);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
auto& clientForwards = i2p::client::context.GetClientForwards ();
|
|
||||||
if (!clientForwards.empty ())
|
|
||||||
{
|
|
||||||
for (auto& it: clientForwards)
|
|
||||||
{
|
|
||||||
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
|
||||||
boost::property_tree::ptree ct;
|
|
||||||
ct.put("address", i2p::client::context.GetAddressBook ().ToAddress(ident));
|
|
||||||
client_tunnels.add_child(it.second->GetName (), ct);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
auto& serverForwards = i2p::client::context.GetServerForwards ();
|
|
||||||
if (!serverForwards.empty ())
|
|
||||||
{
|
|
||||||
for (auto& it: serverForwards)
|
|
||||||
{
|
|
||||||
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
|
||||||
boost::property_tree::ptree st;
|
|
||||||
st.put("address", i2p::client::context.GetAddressBook ().ToAddress(ident));
|
|
||||||
server_tunnels.add_child(it.second->GetName (), st);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pt.add_child("client", client_tunnels);
|
|
||||||
pt.add_child("server", server_tunnels);
|
|
||||||
|
|
||||||
InsertParam (results, "I2PTunnel", pt);
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::HTTPProxyInfoHandler (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
boost::property_tree::ptree pt;
|
|
||||||
|
|
||||||
auto httpProxy = i2p::client::context.GetHttpProxy ();
|
|
||||||
if (httpProxy)
|
|
||||||
{
|
|
||||||
auto& ident = httpProxy->GetLocalDestination ()->GetIdentHash();
|
|
||||||
pt.put("enabled", true);
|
|
||||||
pt.put("address", i2p::client::context.GetAddressBook ().ToAddress(ident));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
pt.put("enabled", false);
|
|
||||||
|
|
||||||
InsertParam (results, "HTTPProxy", pt);
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::SOCKSInfoHandler (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
boost::property_tree::ptree pt;
|
|
||||||
|
|
||||||
auto socksProxy = i2p::client::context.GetSocksProxy ();
|
|
||||||
if (socksProxy)
|
|
||||||
{
|
|
||||||
auto& ident = socksProxy->GetLocalDestination ()->GetIdentHash();
|
|
||||||
pt.put("enabled", true);
|
|
||||||
pt.put("address", i2p::client::context.GetAddressBook ().ToAddress(ident));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
pt.put("enabled", false);
|
|
||||||
|
|
||||||
InsertParam (results, "SOCKS", pt);
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::SAMInfoHandler (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
boost::property_tree::ptree pt;
|
|
||||||
auto sam = i2p::client::context.GetSAMBridge ();
|
|
||||||
if (sam)
|
|
||||||
{
|
|
||||||
pt.put("enabled", true);
|
|
||||||
boost::property_tree::ptree sam_sessions;
|
|
||||||
for (auto& it: sam->GetSessions ())
|
|
||||||
{
|
|
||||||
boost::property_tree::ptree sam_session, sam_session_sockets;
|
|
||||||
auto& name = it.second->GetLocalDestination ()->GetNickname ();
|
|
||||||
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
|
||||||
sam_session.put("name", name);
|
|
||||||
sam_session.put("address", i2p::client::context.GetAddressBook ().ToAddress(ident));
|
|
||||||
|
|
||||||
for (const auto& socket: sam->ListSockets(it.first))
|
|
||||||
{
|
|
||||||
boost::property_tree::ptree stream;
|
|
||||||
stream.put("type", socket->GetSocketType ());
|
|
||||||
stream.put("peer", socket->GetSocket ().remote_endpoint());
|
|
||||||
|
|
||||||
sam_session_sockets.push_back(std::make_pair("", stream));
|
|
||||||
}
|
|
||||||
sam_session.add_child("sockets", sam_session_sockets);
|
|
||||||
sam_sessions.add_child(it.first, sam_session);
|
|
||||||
}
|
|
||||||
|
|
||||||
pt.add_child("sessions", sam_sessions);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
pt.put("enabled", false);
|
|
||||||
|
|
||||||
InsertParam (results, "SAM", pt);
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::BOBInfoHandler (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
boost::property_tree::ptree pt;
|
|
||||||
auto bob = i2p::client::context.GetBOBCommandChannel ();
|
|
||||||
if (bob)
|
|
||||||
{
|
|
||||||
/* TODO more info */
|
|
||||||
pt.put("enabled", true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
pt.put("enabled", false);
|
|
||||||
|
|
||||||
InsertParam (results, "BOB", pt);
|
|
||||||
}
|
|
||||||
|
|
||||||
void I2PControlHandlers::I2CPInfoHandler (std::ostringstream& results)
|
|
||||||
{
|
|
||||||
boost::property_tree::ptree pt;
|
|
||||||
auto i2cp = i2p::client::context.GetI2CPServer ();
|
|
||||||
if (i2cp)
|
|
||||||
{
|
|
||||||
/* TODO more info */
|
|
||||||
pt.put("enabled", true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
pt.put("enabled", false);
|
|
||||||
|
|
||||||
InsertParam (results, "I2CP", pt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,82 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2022, 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
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef I2P_CONTROL_HANDLERS_H__
|
|
||||||
#define I2P_CONTROL_HANDLERS_H__
|
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
#include <boost/property_tree/ptree.hpp>
|
|
||||||
|
|
||||||
namespace i2p
|
|
||||||
{
|
|
||||||
namespace client
|
|
||||||
{
|
|
||||||
class I2PControlHandlers
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
I2PControlHandlers ();
|
|
||||||
|
|
||||||
// methods
|
|
||||||
// TODO: make protected
|
|
||||||
void RouterInfoHandler (const boost::property_tree::ptree& params, std::ostringstream& results);
|
|
||||||
void NetworkSettingHandler (const boost::property_tree::ptree& params, std::ostringstream& results);
|
|
||||||
void ClientServicesInfoHandler (const boost::property_tree::ptree& params, std::ostringstream& results);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
void InsertParam (std::ostringstream& ss, const std::string& name, int value) const;
|
|
||||||
void InsertParam (std::ostringstream& ss, const std::string& name, double value) const;
|
|
||||||
void InsertParam (std::ostringstream& ss, const std::string& name, const std::string& value, bool quotes = true) const;
|
|
||||||
void InsertParam (std::ostringstream& ss, const std::string& name, const boost::property_tree::ptree& value) const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// RouterInfo
|
|
||||||
typedef void (I2PControlHandlers::*RouterInfoRequestHandler)(std::ostringstream& results);
|
|
||||||
void UptimeHandler (std::ostringstream& results);
|
|
||||||
void VersionHandler (std::ostringstream& results);
|
|
||||||
void StatusHandler (std::ostringstream& results);
|
|
||||||
void NetDbKnownPeersHandler (std::ostringstream& results);
|
|
||||||
void NetDbActivePeersHandler (std::ostringstream& results);
|
|
||||||
void NetStatusHandler (std::ostringstream& results);
|
|
||||||
void TunnelsParticipatingHandler (std::ostringstream& results);
|
|
||||||
void TunnelsSuccessRateHandler (std::ostringstream& results);
|
|
||||||
void InboundBandwidth1S (std::ostringstream& results);
|
|
||||||
void InboundBandwidth15S (std::ostringstream& results);
|
|
||||||
void OutboundBandwidth1S (std::ostringstream& results);
|
|
||||||
void OutboundBandwidth15S (std::ostringstream& results);
|
|
||||||
void NetTotalReceivedBytes (std::ostringstream& results);
|
|
||||||
void NetTotalSentBytes (std::ostringstream& results);
|
|
||||||
|
|
||||||
// NetworkSetting
|
|
||||||
typedef void (I2PControlHandlers::*NetworkSettingRequestHandler)(const std::string& value, std::ostringstream& results);
|
|
||||||
void InboundBandwidthLimit (const std::string& value, std::ostringstream& results);
|
|
||||||
void OutboundBandwidthLimit (const std::string& value, std::ostringstream& results);
|
|
||||||
|
|
||||||
// ClientServicesInfo
|
|
||||||
typedef void (I2PControlHandlers::*ClientServicesInfoRequestHandler)(std::ostringstream& results);
|
|
||||||
void I2PTunnelInfoHandler (std::ostringstream& results);
|
|
||||||
void HTTPProxyInfoHandler (std::ostringstream& results);
|
|
||||||
void SOCKSInfoHandler (std::ostringstream& results);
|
|
||||||
void SAMInfoHandler (std::ostringstream& results);
|
|
||||||
void BOBInfoHandler (std::ostringstream& results);
|
|
||||||
void I2CPInfoHandler (std::ostringstream& results);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
std::map<std::string, RouterInfoRequestHandler> m_RouterInfoHandlers;
|
|
||||||
std::map<std::string, NetworkSettingRequestHandler> m_NetworkSettingHandlers;
|
|
||||||
std::map<std::string, ClientServicesInfoRequestHandler> m_ClientServicesInfoHandlers;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,15 +1,10 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2024, 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
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef USE_UPNP
|
#ifdef USE_UPNP
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
|
#include <boost/thread/thread.hpp>
|
||||||
|
#include <boost/asio.hpp>
|
||||||
|
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
|
|
||||||
#include "RouterContext.h"
|
#include "RouterContext.h"
|
||||||
|
@ -52,7 +47,7 @@ namespace transport
|
||||||
{
|
{
|
||||||
m_IsRunning = true;
|
m_IsRunning = true;
|
||||||
LogPrint(eLogInfo, "UPnP: Starting");
|
LogPrint(eLogInfo, "UPnP: Starting");
|
||||||
boost::asio::post (m_Service, std::bind (&UPnP::Discover, this));
|
m_Service.post (std::bind (&UPnP::Discover, this));
|
||||||
std::unique_lock<std::mutex> l(m_StartedMutex);
|
std::unique_lock<std::mutex> l(m_StartedMutex);
|
||||||
m_Thread.reset (new std::thread (std::bind (&UPnP::Run, this)));
|
m_Thread.reset (new std::thread (std::bind (&UPnP::Run, this)));
|
||||||
m_Started.wait_for (l, std::chrono::seconds (5)); // 5 seconds maximum
|
m_Started.wait_for (l, std::chrono::seconds (5)); // 5 seconds maximum
|
||||||
|
@ -115,16 +110,10 @@ namespace transport
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (MINIUPNPC_API_VERSION >= 18)
|
|
||||||
err = UPNP_GetValidIGD (m_Devlist, &m_upnpUrls, &m_upnpData, m_NetworkAddr, sizeof (m_NetworkAddr),
|
|
||||||
m_externalIPAddress, sizeof (m_externalIPAddress));
|
|
||||||
#else
|
|
||||||
err = UPNP_GetValidIGD (m_Devlist, &m_upnpUrls, &m_upnpData, m_NetworkAddr, sizeof (m_NetworkAddr));
|
err = UPNP_GetValidIGD (m_Devlist, &m_upnpUrls, &m_upnpData, m_NetworkAddr, sizeof (m_NetworkAddr));
|
||||||
#endif
|
|
||||||
m_upnpUrlsInitialized=err!=0;
|
m_upnpUrlsInitialized=err!=0;
|
||||||
if (err == UPNP_IGD_VALID_CONNECTED)
|
if (err == UPNP_IGD_VALID_CONNECTED)
|
||||||
{
|
{
|
||||||
#if (MINIUPNPC_API_VERSION < 18)
|
|
||||||
err = UPNP_GetExternalIPAddress (m_upnpUrls.controlURL, m_upnpData.first.servicetype, m_externalIPAddress);
|
err = UPNP_GetExternalIPAddress (m_upnpUrls.controlURL, m_upnpData.first.servicetype, m_externalIPAddress);
|
||||||
if(err != UPNPCOMMAND_SUCCESS)
|
if(err != UPNPCOMMAND_SUCCESS)
|
||||||
{
|
{
|
||||||
|
@ -132,7 +121,6 @@ namespace transport
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
LogPrint (eLogError, "UPnP: Found Internet Gateway Device ", m_upnpUrls.controlURL);
|
LogPrint (eLogError, "UPnP: Found Internet Gateway Device ", m_upnpUrls.controlURL);
|
||||||
if (!m_externalIPAddress[0])
|
if (!m_externalIPAddress[0])
|
||||||
|
@ -150,7 +138,7 @@ namespace transport
|
||||||
|
|
||||||
// UPnP discovered
|
// UPnP discovered
|
||||||
LogPrint (eLogDebug, "UPnP: ExternalIPAddress is ", m_externalIPAddress);
|
LogPrint (eLogDebug, "UPnP: ExternalIPAddress is ", m_externalIPAddress);
|
||||||
i2p::context.UpdateAddress (boost::asio::ip::make_address (m_externalIPAddress));
|
i2p::context.UpdateAddress (boost::asio::ip::address::from_string (m_externalIPAddress));
|
||||||
// port mapping
|
// port mapping
|
||||||
PortMapping ();
|
PortMapping ();
|
||||||
}
|
}
|
||||||
|
@ -171,14 +159,13 @@ namespace transport
|
||||||
|
|
||||||
void UPnP::PortMapping ()
|
void UPnP::PortMapping ()
|
||||||
{
|
{
|
||||||
auto a = context.GetRouterInfo().GetAddresses();
|
const auto& a = context.GetRouterInfo().GetAddresses();
|
||||||
if (!a) return;
|
for (const auto& address : a)
|
||||||
for (const auto& address : *a)
|
|
||||||
{
|
{
|
||||||
if (address && !address->host.is_v6 () && address->port)
|
if (!address->host.is_v6 () && address->port)
|
||||||
TryPortMapping (address);
|
TryPortMapping (address);
|
||||||
}
|
}
|
||||||
m_Timer.expires_from_now (boost::posix_time::minutes(UPNP_PORT_FORWARDING_INTERVAL)); // every 20 minutes
|
m_Timer.expires_from_now (boost::posix_time::minutes(20)); // every 20 minutes
|
||||||
m_Timer.async_wait ([this](const boost::system::error_code& ecode)
|
m_Timer.async_wait ([this](const boost::system::error_code& ecode)
|
||||||
{
|
{
|
||||||
if (ecode != boost::asio::error::operation_aborted)
|
if (ecode != boost::asio::error::operation_aborted)
|
||||||
|
@ -223,11 +210,10 @@ namespace transport
|
||||||
|
|
||||||
void UPnP::CloseMapping ()
|
void UPnP::CloseMapping ()
|
||||||
{
|
{
|
||||||
auto a = context.GetRouterInfo().GetAddresses();
|
const auto& a = context.GetRouterInfo().GetAddresses();
|
||||||
if (!a) return;
|
for (const auto& address : a)
|
||||||
for (const auto& address : *a)
|
|
||||||
{
|
{
|
||||||
if (address && !address->host.is_v6 () && address->port)
|
if (!address->host.is_v6 () && address->port)
|
||||||
CloseMapping (address);
|
CloseMapping (address);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -262,10 +248,10 @@ namespace transport
|
||||||
{
|
{
|
||||||
switch (address->transportStyle)
|
switch (address->transportStyle)
|
||||||
{
|
{
|
||||||
case i2p::data::RouterInfo::eTransportNTCP2:
|
case i2p::data::RouterInfo::eTransportNTCP:
|
||||||
return "TCP";
|
return "TCP";
|
||||||
break;
|
break;
|
||||||
case i2p::data::RouterInfo::eTransportSSU2:
|
case i2p::data::RouterInfo::eTransportSSU:
|
||||||
default:
|
default:
|
||||||
return "UDP";
|
return "UDP";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2024, The PurpleI2P Project
|
* Copyright (c) 2013-2020, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
|
@ -28,7 +28,6 @@ namespace i2p
|
||||||
namespace transport
|
namespace transport
|
||||||
{
|
{
|
||||||
const int UPNP_RESPONSE_TIMEOUT = 2000; // in milliseconds
|
const int UPNP_RESPONSE_TIMEOUT = 2000; // in milliseconds
|
||||||
const int UPNP_PORT_FORWARDING_INTERVAL = 20; // in minutes
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
@ -67,7 +66,7 @@ namespace transport
|
||||||
std::unique_ptr<std::thread> m_Thread;
|
std::unique_ptr<std::thread> m_Thread;
|
||||||
std::condition_variable m_Started;
|
std::condition_variable m_Started;
|
||||||
std::mutex m_StartedMutex;
|
std::mutex m_StartedMutex;
|
||||||
boost::asio::io_context m_Service;
|
boost::asio::io_service m_Service;
|
||||||
boost::asio::deadline_timer m_Timer;
|
boost::asio::deadline_timer m_Timer;
|
||||||
bool m_upnpUrlsInitialized = false;
|
bool m_upnpUrlsInitialized = false;
|
||||||
struct UPNPUrls m_upnpUrls;
|
struct UPNPUrls m_upnpUrls;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2024, The PurpleI2P Project
|
* Copyright (c) 2013-2020, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
|
@ -24,8 +24,6 @@
|
||||||
#include "Tunnel.h"
|
#include "Tunnel.h"
|
||||||
#include "RouterContext.h"
|
#include "RouterContext.h"
|
||||||
#include "ClientContext.h"
|
#include "ClientContext.h"
|
||||||
#include "Transports.h"
|
|
||||||
#include "util.h"
|
|
||||||
|
|
||||||
void handle_signal(int sig)
|
void handle_signal(int sig)
|
||||||
{
|
{
|
||||||
|
@ -56,14 +54,6 @@ void handle_signal(int sig)
|
||||||
case SIGPIPE:
|
case SIGPIPE:
|
||||||
LogPrint(eLogInfo, "SIGPIPE received");
|
LogPrint(eLogInfo, "SIGPIPE received");
|
||||||
break;
|
break;
|
||||||
case SIGTSTP:
|
|
||||||
LogPrint(eLogInfo, "Daemon: Got SIGTSTP, disconnecting from network...");
|
|
||||||
i2p::transport::transports.SetOnline(false);
|
|
||||||
break;
|
|
||||||
case SIGCONT:
|
|
||||||
LogPrint(eLogInfo, "Daemon: Got SIGCONT, restoring connection to network...");
|
|
||||||
i2p::transport::transports.SetOnline(true);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,36 +153,24 @@ namespace i2p
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef ANDROID
|
||||||
if (lockf(pidFH, F_TLOCK, 0) != 0)
|
if (lockf(pidFH, F_TLOCK, 0) != 0)
|
||||||
#else
|
|
||||||
struct flock fl;
|
|
||||||
fl.l_len = 0;
|
|
||||||
fl.l_type = F_WRLCK;
|
|
||||||
fl.l_whence = SEEK_SET;
|
|
||||||
fl.l_start = 0;
|
|
||||||
|
|
||||||
if (fcntl(pidFH, F_SETLK, &fl) != 0)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
LogPrint(eLogError, "Daemon: Could not lock pid file ", pidfile, ": ", strerror(errno));
|
LogPrint(eLogError, "Daemon: Could not lock pid file ", pidfile, ": ", strerror(errno));
|
||||||
std::cerr << "i2pd: Could not lock pid file " << pidfile << ": " << strerror(errno) << std::endl;
|
std::cerr << "i2pd: Could not lock pid file " << pidfile << ": " << strerror(errno) << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
char pid[10];
|
char pid[10];
|
||||||
sprintf(pid, "%d\n", getpid());
|
sprintf(pid, "%d\n", getpid());
|
||||||
ftruncate(pidFH, 0);
|
ftruncate(pidFH, 0);
|
||||||
if (write(pidFH, pid, strlen(pid)) < 0)
|
if (write(pidFH, pid, strlen(pid)) < 0)
|
||||||
{
|
{
|
||||||
LogPrint(eLogCritical, "Daemon: Could not write pidfile ", pidfile, ": ", strerror(errno));
|
LogPrint(eLogError, "Daemon: Could not write pidfile ", pidfile, ": ", strerror(errno));
|
||||||
std::cerr << "i2pd: Could not write pidfile " << pidfile << ": " << strerror(errno) << std::endl;
|
std::cerr << "i2pd: Could not write pidfile " << pidfile << ": " << strerror(errno) << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gracefulShutdownInterval = 0; // not specified
|
gracefulShutdownInterval = 0; // not specified
|
||||||
|
|
||||||
// handle signal TSTP
|
|
||||||
bool handleTSTP; i2p::config::GetOption("unix.handle_sigtstp", handleTSTP);
|
|
||||||
|
|
||||||
// Signal handler
|
// Signal handler
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
sa.sa_handler = handle_signal;
|
sa.sa_handler = handle_signal;
|
||||||
|
@ -204,11 +182,6 @@ namespace i2p
|
||||||
sigaction(SIGTERM, &sa, 0);
|
sigaction(SIGTERM, &sa, 0);
|
||||||
sigaction(SIGINT, &sa, 0);
|
sigaction(SIGINT, &sa, 0);
|
||||||
sigaction(SIGPIPE, &sa, 0);
|
sigaction(SIGPIPE, &sa, 0);
|
||||||
if (handleTSTP)
|
|
||||||
{
|
|
||||||
sigaction(SIGTSTP, &sa, 0);
|
|
||||||
sigaction(SIGCONT, &sa, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Daemon_Singleton::start();
|
return Daemon_Singleton::start();
|
||||||
}
|
}
|
||||||
|
@ -221,7 +194,6 @@ namespace i2p
|
||||||
|
|
||||||
void DaemonLinux::run ()
|
void DaemonLinux::run ()
|
||||||
{
|
{
|
||||||
i2p::util::SetThreadName ("i2pd-daemon");
|
|
||||||
while (running)
|
while (running)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for (std::chrono::seconds(1));
|
std::this_thread::sleep_for (std::chrono::seconds(1));
|
||||||
|
|
5
debian/NEWS
vendored
5
debian/NEWS
vendored
|
@ -1,5 +0,0 @@
|
||||||
i2pd (2.53.0-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
i2pd binary moved from /usr/sbin to /usr/bin. Please check your scripts if you used the old path.
|
|
||||||
|
|
||||||
-- r4sas <r4sas@i2pmail.org> Fri, 19 Jul 2024 16:00:00 +0000
|
|
139
debian/changelog
vendored
139
debian/changelog
vendored
|
@ -1,142 +1,3 @@
|
||||||
i2pd (2.56.0-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* updated to version 2.56.0/0.9.65
|
|
||||||
|
|
||||||
-- orignal <orignal@i2pmail.org> Tue, 11 Feb 2025 16:00:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.55.0-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* updated to version 2.55.0
|
|
||||||
|
|
||||||
-- orignal <orignal@i2pmail.org> Mon, 30 Dec 2024 16:00:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.54.0-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* updated to version 2.54.0/0.9.64
|
|
||||||
|
|
||||||
-- orignal <orignal@i2pmail.org> Sun, 6 Oct 2024 16:00:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.53.1-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* updated to version 2.53.1
|
|
||||||
|
|
||||||
-- orignal <orignal@i2pmail.org> Tue, 30 Jul 2024 16:00:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.53.0-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* updated to version 2.53.0/0.9.63
|
|
||||||
* binary moved from /usr/sbin to /usr/bin
|
|
||||||
|
|
||||||
-- r4sas <r4sas@i2pmail.org> Sat, 20 Jul 2024 15:10:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.52.0-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* updated to version 2.52.0
|
|
||||||
|
|
||||||
-- orignal <orignal@i2pmail.org> Sun, 12 May 2024 16:00:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.51.0-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* updated to version 2.51.0/0.9.62
|
|
||||||
|
|
||||||
-- orignal <orignal@i2pmail.org> Sat, 06 Apr 2024 16:00:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.50.2-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* updated to version 2.50.2/0.9.61
|
|
||||||
|
|
||||||
-- orignal <orignal@i2pmail.org> Sat, 06 Jan 2024 16:00:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.50.1-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* updated to version 2.50.1/0.9.61
|
|
||||||
|
|
||||||
-- r4sas <r4sas@i2pmail.org> Sat, 23 Dec 2023 18:30:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.50.0-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* updated to version 2.50.0/0.9.61
|
|
||||||
|
|
||||||
-- orignal <orignal@i2pmail.org> Mon, 18 Dec 2023 16:00:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.49.0-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* updated to version 2.49.0/0.9.60
|
|
||||||
|
|
||||||
-- orignal <orignal@i2pmail.org> Mon, 18 Sep 2023 16:00:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.48.0-1) unstable; urgency=high
|
|
||||||
|
|
||||||
* updated to version 2.48.0/0.9.59
|
|
||||||
|
|
||||||
-- orignal <orignal@i2pmail.org> Mon, 12 Jun 2023 16:00:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.47.0-1) unstable; urgency=high
|
|
||||||
|
|
||||||
* updated to version 2.47.0/0.9.58
|
|
||||||
|
|
||||||
-- orignal <orignal@i2pmail.org> Sat, 11 Mar 2023 16:00:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.46.1-2) unstable; urgency=critical
|
|
||||||
|
|
||||||
* re-pushed release due to new critical bug
|
|
||||||
|
|
||||||
-- r4sas <r4sas@i2pmail.org> Mon, 20 Feb 2023 23:40:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.46.1-1) unstable; urgency=high
|
|
||||||
|
|
||||||
* updated to version 2.46.1/0.9.57
|
|
||||||
|
|
||||||
-- r4sas <r4sas@i2pmail.org> Mon, 20 Feb 2023 02:45:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.46.0-1) unstable; urgency=high
|
|
||||||
|
|
||||||
* updated to version 2.46.0/0.9.57
|
|
||||||
|
|
||||||
-- orignal <orignal@i2pmail.org> Wed, 15 Feb 2023 19:00:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.45.1-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* updated to version 2.45.1/0.9.57
|
|
||||||
|
|
||||||
-- orignal <orignal@i2pmail.org> Wed, 11 Jan 2023 19:00:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.45.0-1) unstable; urgency=high
|
|
||||||
|
|
||||||
* updated to version 2.45.0/0.9.57
|
|
||||||
* compat level 12
|
|
||||||
* standards version 4.3.0
|
|
||||||
* increased nofile limit in service and init.d to 8192
|
|
||||||
* added conffiles
|
|
||||||
* removed #1210 patch
|
|
||||||
|
|
||||||
-- r4sas <r4sas@i2pmail.org> Tue, 3 Jan 2023 18:00:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.44.0-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* updated to version 2.44.0/0.9.56
|
|
||||||
|
|
||||||
-- orignal <orignal@i2pmail.org> Sun, 20 Nov 2022 19:00:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.43.0-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* updated to version 2.43.0/0.9.55
|
|
||||||
|
|
||||||
-- orignal <orignal@i2pmail.org> Mon, 22 Aug 2022 16:00:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.42.1-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* updated to version 2.42.1/0.9.54
|
|
||||||
* remove -O3 optimization flag
|
|
||||||
|
|
||||||
-- r4sas <r4sas@i2pmail.org> Tue, 24 May 2022 12:00:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.42.0-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* updated to version 2.42.0/0.9.54
|
|
||||||
|
|
||||||
-- orignal <orignal@i2pmail.org> Sun, 22 May 2022 16:00:00 +0000
|
|
||||||
|
|
||||||
i2pd (2.41.0-1) unstable; urgency=medium
|
i2pd (2.41.0-1) unstable; urgency=medium
|
||||||
|
|
||||||
* updated to version 2.41.0/0.9.53
|
* updated to version 2.41.0/0.9.53
|
||||||
|
|
2
debian/compat
vendored
2
debian/compat
vendored
|
@ -1 +1 @@
|
||||||
12
|
9
|
||||||
|
|
4
debian/control
vendored
4
debian/control
vendored
|
@ -2,8 +2,8 @@ Source: i2pd
|
||||||
Section: net
|
Section: net
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Maintainer: r4sas <r4sas@i2pmail.org>
|
Maintainer: r4sas <r4sas@i2pmail.org>
|
||||||
Build-Depends: debhelper (>= 12~), libboost-system-dev (>= 1.46), libboost-date-time-dev (>= 1.46), libboost-filesystem-dev (>= 1.46), libboost-program-options-dev (>= 1.46), libminiupnpc-dev, libssl-dev, zlib1g-dev
|
Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.17.2~), gcc (>= 4.7) | clang (>= 3.3), libboost-system-dev (>= 1.46), libboost-date-time-dev (>= 1.46), libboost-filesystem-dev (>= 1.46), libboost-program-options-dev (>= 1.46), libminiupnpc-dev, libssl-dev, zlib1g-dev
|
||||||
Standards-Version: 4.3.0
|
Standards-Version: 3.9.8
|
||||||
Homepage: http://i2pd.website/
|
Homepage: http://i2pd.website/
|
||||||
Vcs-Git: git://github.com/PurpleI2P/i2pd.git
|
Vcs-Git: git://github.com/PurpleI2P/i2pd.git
|
||||||
Vcs-Browser: https://github.com/PurpleI2P/i2pd
|
Vcs-Browser: https://github.com/PurpleI2P/i2pd
|
||||||
|
|
6
debian/copyright
vendored
6
debian/copyright
vendored
|
@ -3,18 +3,18 @@ Upstream-Name: i2pd
|
||||||
Source: https://github.com/PurpleI2P
|
Source: https://github.com/PurpleI2P
|
||||||
|
|
||||||
Files: *
|
Files: *
|
||||||
Copyright: 2013-2023 PurpleI2P
|
Copyright: 2013-2020 PurpleI2P
|
||||||
License: BSD-3-clause
|
License: BSD-3-clause
|
||||||
|
|
||||||
Files: debian/*
|
Files: debian/*
|
||||||
Copyright: 2013-2015 Kill Your TV <killyourtv@i2pmail.org>
|
Copyright: 2013-2015 Kill Your TV <killyourtv@i2pmail.org>
|
||||||
2014-2016 hagen <hagen@i2pmail.org>
|
2014-2016 hagen <hagen@i2pmail.org>
|
||||||
2016-2023 R4SAS <r4sas@i2pmail.org>
|
2016-2020 R4SAS <r4sas@i2pmail.org>
|
||||||
2017-2020 Yangfl <mmyangfl@gmail.com>
|
2017-2020 Yangfl <mmyangfl@gmail.com>
|
||||||
License: GPL-2+
|
License: GPL-2+
|
||||||
|
|
||||||
License: BSD-3-clause
|
License: BSD-3-clause
|
||||||
Copyright (c) 2013-2023, The PurpleI2P Project
|
Copyright (c) 2013-2017, The PurpleI2P Project
|
||||||
.
|
.
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
.
|
.
|
||||||
|
|
2
debian/i2pd.1
vendored
2
debian/i2pd.1
vendored
|
@ -64,7 +64,7 @@ The network interface to bind to for IPv4 connections
|
||||||
The network interface to bind to for IPv6 connections
|
The network interface to bind to for IPv6 connections
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-ipv4=\fR
|
\fB\-\-ipv4=\fR
|
||||||
Enable communication through ipv4 (\fIenabled\fR by default)
|
Enable communication through ipv6 (\fIenabled\fR by default)
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-ipv6\fR
|
\fB\-\-ipv6\fR
|
||||||
Enable communication through ipv6 (\fIdisabled\fR by default)
|
Enable communication through ipv6 (\fIdisabled\fR by default)
|
||||||
|
|
2
debian/i2pd.default
vendored
2
debian/i2pd.default
vendored
|
@ -8,4 +8,4 @@ I2PD_ENABLED="yes"
|
||||||
DAEMON_OPTS=""
|
DAEMON_OPTS=""
|
||||||
|
|
||||||
# If you have problems with hunging i2pd, you can try enable this
|
# If you have problems with hunging i2pd, you can try enable this
|
||||||
ulimit -n 8192
|
ulimit -n 4096
|
||||||
|
|
2
debian/i2pd.init
vendored
2
debian/i2pd.init
vendored
|
@ -13,7 +13,7 @@
|
||||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||||
DESC=i2pd # Introduce a short description here
|
DESC=i2pd # Introduce a short description here
|
||||||
NAME=i2pd # Introduce the short server's name here
|
NAME=i2pd # Introduce the short server's name here
|
||||||
DAEMON=/usr/bin/$NAME # Introduce the server's location here
|
DAEMON=/usr/sbin/$NAME # Introduce the server's location here
|
||||||
DAEMON_OPTS="" # Arguments to run the daemon with
|
DAEMON_OPTS="" # Arguments to run the daemon with
|
||||||
PIDFILE=/var/run/$NAME/$NAME.pid
|
PIDFILE=/var/run/$NAME/$NAME.pid
|
||||||
I2PCONF=/etc/$NAME/i2pd.conf
|
I2PCONF=/etc/$NAME/i2pd.conf
|
||||||
|
|
5
debian/i2pd.install
vendored
5
debian/i2pd.install
vendored
|
@ -1,6 +1,7 @@
|
||||||
i2pd usr/bin/
|
i2pd usr/sbin/
|
||||||
contrib/i2pd.conf etc/i2pd/
|
contrib/i2pd.conf etc/i2pd/
|
||||||
contrib/tunnels.conf etc/i2pd/
|
contrib/tunnels.conf etc/i2pd/
|
||||||
|
contrib/subscriptions.txt etc/i2pd/
|
||||||
contrib/certificates/ usr/share/i2pd/
|
contrib/certificates/ usr/share/i2pd/
|
||||||
contrib/tunnels.d/README etc/i2pd/tunnels.conf.d/
|
contrib/tunnels.d/README etc/i2pd/tunnels.conf.d/
|
||||||
contrib/apparmor/usr.bin.i2pd etc/apparmor.d
|
contrib/apparmor/usr.sbin.i2pd etc/apparmor.d
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue