Compare commits

..
9 Commits
Author SHA1 Message Date
Morteza Bashsiz 9af39a5715 Merge pull request #181 from MortezaBashsiz/dev
Release arm64 and amd64
2026-06-02 09:28:44 +02:00
Morteza Bashsiz 2f043a6f83 Merge pull request #180 from MortezaBashsiz/mori
Build debian package for arm64
2026-06-02 07:26:11 +02:00
Morteza Bashsiz d94075e5c3 fix workflow dev and main 2026-06-02 07:09:44 +02:00
Morteza Bashsiz 9f1a7c8637 fix control 2026-06-02 07:09:44 +02:00
Morteza Bashsiz 2add09ea33 fix control 2026-06-02 07:09:44 +02:00
Morteza Bashsiz 8beee5d127 add arm to workflow 2026-06-02 07:09:44 +02:00
Morteza Bashsiz 84bb675b9c add arm to workflow 2026-06-02 07:09:44 +02:00
Morteza Bashsiz 67c43de80d implement pullTimeout
Add configurable
```
  # pullTimeout: unsigned short
  # Defines the timeout for I/O Operation in milliseconds.
  #   Useful to expire serverside read timer.
  pullTimeout: 50
```
Higher number helps when your network is slower
2026-06-01 15:53:38 +02:00
Morteza Bashsiz ab4580920f implement pullTimeout (#178) 2026-06-01 15:47:15 +02:00
9 changed files with 209 additions and 52 deletions

No files matched your search

+64 -13
View File
@@ -15,16 +15,25 @@ permissions:
env:
PACKAGE_VERSION: 0.1.${{ github.run_number }}
PACKAGE_FILE: nipovpn_dev_0.1.${{ github.run_number }}_amd64.deb
jobs:
build:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
- arch: arm64
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up dependencies
run: |
sudo apt-get update
@@ -42,55 +51,97 @@ jobs:
- name: Build binary
run: |
rm -rf build
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
if [ "${{ matrix.arch }}" = "arm64" ]; then
docker run --rm --platform linux/arm64 \
-v "$PWD:/src" \
-w /src \
ubuntu:24.04 \
bash -c '
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y \
build-essential \
cmake \
libssl-dev \
libboost-all-dev \
libyaml-cpp-dev
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
'
sudo chown -R $USER:$USER build
else
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
fi
- name: Build Debian package
run: |
PACKAGE_FILE="nipovpn_dev_${PACKAGE_VERSION}_${{ matrix.arch }}.deb"
mkdir -p nipovpn/usr/bin
cp build/core/nipovpn nipovpn/usr/bin/nipovpn
chmod 755 nipovpn/usr/bin/nipovpn
sed -i -E "s/^Version[[:space:]]*:.*/Version: ${PACKAGE_VERSION}/" nipovpn/DEBIAN/control
sed -i -E "s/^Architecture[[:space:]]*:.*/Architecture: ${{ matrix.arch }}/" nipovpn/DEBIAN/control
echo "Final control file:"
cat nipovpn/DEBIAN/control
grep "^Version: ${PACKAGE_VERSION}$" nipovpn/DEBIAN/control
grep "^Architecture: ${{ matrix.arch }}$" nipovpn/DEBIAN/control
mkdir -p build
chmod 755 build
dpkg-deb --build nipovpn "build/${PACKAGE_FILE}"
ls -lah build/
- name: Show package information
run: |
PACKAGE_FILE="nipovpn_dev_${PACKAGE_VERSION}_${{ matrix.arch }}.deb"
dpkg -I "build/${PACKAGE_FILE}"
dpkg -c "build/${PACKAGE_FILE}"
- name: Upload Debian package as artifact
uses: actions/upload-artifact@v4
with:
name: nipovpn-dev-deb
path: build/${{ env.PACKAGE_FILE }}
name: nipovpn-dev-deb-${{ matrix.arch }}
path: build/nipovpn_dev_${{ env.PACKAGE_VERSION }}_${{ matrix.arch }}.deb
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Debian package artifact
- name: Download Debian package artifacts
uses: actions/download-artifact@v4
with:
name: nipovpn-dev-deb
pattern: nipovpn-dev-deb-*
merge-multiple: true
path: ./
- name: Create DEV GitHub Release
- name: Create Dev GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: dev-v${{ env.PACKAGE_VERSION }}
name: DEV Version v${{ env.PACKAGE_VERSION }}
name: Dev Version v${{ env.PACKAGE_VERSION }}
prerelease: true
files: ${{ env.PACKAGE_FILE }}
files: |
nipovpn_dev_${{ env.PACKAGE_VERSION }}_amd64.deb
nipovpn_dev_${{ env.PACKAGE_VERSION }}_arm64.deb
env:
GITHUB_TOKEN: ${{ github.token }}
+62 -11
View File
@@ -15,16 +15,25 @@ permissions:
env:
PACKAGE_VERSION: 0.2.${{ github.run_number }}
PACKAGE_FILE: nipovpn_mori_0.2.${{ github.run_number }}_amd64.deb
jobs:
build:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
- arch: arm64
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up dependencies
run: |
sudo apt-get update
@@ -42,47 +51,87 @@ jobs:
- name: Build binary
run: |
rm -rf build
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
if [ "${{ matrix.arch }}" = "arm64" ]; then
docker run --rm --platform linux/arm64 \
-v "$PWD:/src" \
-w /src \
ubuntu:24.04 \
bash -c '
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y \
build-essential \
cmake \
libssl-dev \
libboost-all-dev \
libyaml-cpp-dev
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
'
sudo chown -R $USER:$USER build
else
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
fi
- name: Build Debian package
run: |
PACKAGE_FILE="nipovpn_mori_${PACKAGE_VERSION}_${{ matrix.arch }}.deb"
mkdir -p nipovpn/usr/bin
cp build/core/nipovpn nipovpn/usr/bin/nipovpn
chmod 755 nipovpn/usr/bin/nipovpn
sed -i -E "s/^Version[[:space:]]*:.*/Version: ${PACKAGE_VERSION}/" nipovpn/DEBIAN/control
sed -i -E "s/^Architecture[[:space:]]*:.*/Architecture: ${{ matrix.arch }}/" nipovpn/DEBIAN/control
echo "Final control file:"
cat nipovpn/DEBIAN/control
grep "^Version: ${PACKAGE_VERSION}$" nipovpn/DEBIAN/control
grep "^Architecture: ${{ matrix.arch }}$" nipovpn/DEBIAN/control
mkdir -p build
chmod 755 build
dpkg-deb --build nipovpn "build/${PACKAGE_FILE}"
ls -lah build/
- name: Show package information
run: |
PACKAGE_FILE="nipovpn_mori_${PACKAGE_VERSION}_${{ matrix.arch }}.deb"
dpkg -I "build/${PACKAGE_FILE}"
dpkg -c "build/${PACKAGE_FILE}"
- name: Upload Debian package as artifact
uses: actions/upload-artifact@v4
with:
name: nipovpn-mori-deb
path: build/${{ env.PACKAGE_FILE }}
name: nipovpn-mori-deb-${{ matrix.arch }}
path: build/nipovpn_mori_${{ env.PACKAGE_VERSION }}_${{ matrix.arch }}.deb
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Debian package artifact
- name: Download Debian package artifacts
uses: actions/download-artifact@v4
with:
name: nipovpn-mori-deb
pattern: nipovpn-mori-deb-*
merge-multiple: true
path: ./
- name: Create MORI GitHub Release
@@ -91,6 +140,8 @@ jobs:
tag_name: mori-v${{ env.PACKAGE_VERSION }}
name: MORI Version v${{ env.PACKAGE_VERSION }}
prerelease: true
files: ${{ env.PACKAGE_FILE }}
files: |
nipovpn_mori_${{ env.PACKAGE_VERSION }}_amd64.deb
nipovpn_mori_${{ env.PACKAGE_VERSION }}_arm64.deb
env:
GITHUB_TOKEN: ${{ github.token }}
+64 -17
View File
@@ -15,16 +15,25 @@ permissions:
env:
PACKAGE_VERSION: 1.1.${{ github.run_number }}
PACKAGE_FILE: nipovpn_1.1.${{ github.run_number }}_amd64.deb
jobs:
build:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
- arch: arm64
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up dependencies
run: |
sudo apt-get update
@@ -42,59 +51,97 @@ jobs:
- name: Build binary
run: |
rm -rf build
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
if [ "${{ matrix.arch }}" = "arm64" ]; then
docker run --rm --platform linux/arm64 \
-v "$PWD:/src" \
-w /src \
ubuntu:24.04 \
bash -c '
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y \
build-essential \
cmake \
libssl-dev \
libboost-all-dev \
libyaml-cpp-dev
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
'
sudo chown -R $USER:$USER build
else
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
fi
- name: Build Debian package
run: |
PACKAGE_FILE="nipovpn_${PACKAGE_VERSION}_${{ matrix.arch }}.deb"
mkdir -p nipovpn/usr/bin
cp build/core/nipovpn nipovpn/usr/bin/nipovpn
chmod 755 nipovpn/usr/bin/nipovpn
sed -i -E "s/^Version[[:space:]]*:.*/Version: ${PACKAGE_VERSION}/" nipovpn/DEBIAN/control
sed -i -E "s/^Architecture[[:space:]]*:.*/Architecture: ${{ matrix.arch }}/" nipovpn/DEBIAN/control
echo "Final control file:"
cat nipovpn/DEBIAN/control
grep "^Version: ${PACKAGE_VERSION}$" nipovpn/DEBIAN/control
grep "^Architecture: ${{ matrix.arch }}$" nipovpn/DEBIAN/control
mkdir -p build
chmod 755 build
dpkg-deb --build nipovpn "build/${PACKAGE_FILE}"
ls -lah build/
- name: Show package information
run: |
PACKAGE_FILE="nipovpn_${PACKAGE_VERSION}_${{ matrix.arch }}.deb"
dpkg -I "build/${PACKAGE_FILE}"
dpkg -c "build/${PACKAGE_FILE}"
- name: Upload Debian package as artifact
uses: actions/upload-artifact@v4
with:
name: nipovpn-main-deb
path: build/${{ env.PACKAGE_FILE }}
name: nipovpn-deb-${{ matrix.arch }}
path: build/nipovpn_${{ env.PACKAGE_VERSION }}_${{ matrix.arch }}.deb
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Debian package artifact
- name: Download Debian package artifacts
uses: actions/download-artifact@v4
with:
name: nipovpn-main-deb
pattern: nipovpn-deb-*
merge-multiple: true
path: ./
- name: Check downloaded files
run: |
ls -lah
- name: Create MAIN GitHub Release
- name: Create Main GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.PACKAGE_VERSION }}
name: Version v${{ env.PACKAGE_VERSION }}
prerelease: false
files: ${{ env.PACKAGE_FILE }}
prerelease: true
files: |
nipovpn_${{ env.PACKAGE_VERSION }}_amd64.deb
nipovpn_${{ env.PACKAGE_VERSION }}_arm64.deb
env:
GITHUB_TOKEN: ${{ github.token }}
+2
View File
@@ -13,6 +13,7 @@ Config::Config(const RunMode &mode, const std::string &filePath)
configYaml_["general"]["methods"].as<std::vector<std::string>>(),
configYaml_["general"]["endPoints"].as<std::vector<std::string>>(),
configYaml_["general"]["timeout"].as<unsigned short>(),
configYaml_["general"]["pullTimeout"].as<unsigned short>(),
configYaml_["general"]["tunnelEnable"].as<bool>(false),
configYaml_["general"]["connectionReuse"].as<bool>(false),
configYaml_["general"]["tlsEnable"].as<bool>(false),
@@ -106,6 +107,7 @@ std::string Config::toString() const {
ss << "\n"
<< " timeout: " << general_.timeout << "\n"
<< " pullTimeout: " << general_.pullTimeout << "\n"
<< " tunnelEnable: " << std::boolalpha << general_.tunnelEnable << "\n"
<< " connectionReuse: " << std::boolalpha << general_.connectionReuse << "\n"
<< " tlsEnable: " << std::boolalpha << general_.tlsEnable << "\n"
+1
View File
@@ -24,6 +24,7 @@ private:
std::vector<std::string> methods;
std::vector<std::string> endPoints;
unsigned short timeout;
unsigned short pullTimeout;
bool tunnelEnable;
bool connectionReuse;
bool tlsEnable;
+1
View File
@@ -329,6 +329,7 @@ inline BoolStr validateConfig(int argc, const char *argv[]) {
configYaml["general"]["methods"].as<std::vector<std::string>>();
configYaml["general"]["endPoints"].as<std::vector<std::string>>();
configYaml["general"]["timeout"].as<unsigned short>();
configYaml["general"]["pullTimeout"].as<unsigned short>();
configYaml["general"]["tunnelEnable"].as<bool>();
} catch (const std::exception &e) {
result.message = std::string("Error in 'general' block: ") + e.what() + "\n";
+1 -1
View File
@@ -512,7 +512,7 @@ void TCPConnection::startTunnelPollServer() {
pollInProgress_ = true;
pollTimer_.expires_after(std::chrono::milliseconds(10));
pollTimer_.expires_after(std::chrono::milliseconds(config_->general().pullTimeout));
pollTimer_.async_wait(
boost::asio::bind_executor(
strand_,
+7 -7
View File
@@ -1,7 +1,7 @@
Package : nipovpn
Version : 0.1
Maintainer : Morteza Bashsiz
Architecture : amd64
Description : Powerfull and Secure http/s Proxy
Depends : libyaml-cpp0.8
Homepage : https://github.com/MortezaBashsiz/nipovpn
Package: nipovpn
Version: ${PACKAGE_VERSION}
Maintainer: Morteza Bashsiz
Architecture: ${{ matrix.arch }}
Description: Powerfull and Secure http/s Proxy
Depends: libyaml-cpp0.8
Homepage: https://github.com/MortezaBashsiz/nipovpn
+7 -3
View File
@@ -6,16 +6,16 @@ general:
# fakeUrls:
# Defines the list of fake urls between agent and server
fakeUrls:
- www.google.com
- nipo.ciron.net
- sudoer.net
- sudoer.ir
- sudoer.net
- google.com
- cloudflare.com
# methods:
# Defines the list of using methods
# you like to send requests from agent to server
# Program will choose randomly from this list
methods:
- HEAD
- GET
- POST
- PUT
@@ -33,6 +33,10 @@ general:
# Defines the timeout for I/O Operation in seconds. 0 indicates no timeout.
# Useful to automatically close stalled connections.
timeout: 10
# pullTimeout: unsigned short
# Defines the timeout for I/O Operation in milliseconds.
# Useful to expire serverside read timer.
pullTimeout: 50
# tunnelEnable: bool
# Defines the connection mode between agent and server. If enabled then the traffic
# will be TCP/TLS tunnel like.