Compare commits

..

1 Commits

Author SHA1 Message Date
Vladimir Dubrovin
2a07b70de6 Update workflow and environment
Some checks are pending
RPM build aarch64 / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
RPM build armhf / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
2026-04-08 21:13:53 +03:00
8 changed files with 80 additions and 97 deletions

View File

@ -1,8 +1,8 @@
name: RPM/DEB build aarch64
name: RPM build aarch64
on:
push:
branches: [ "master", "test-ci" ]
branches: [ "master" ]
paths: [ 'RELEASE', '.github/workflows/build-rpm-arm64.yml' ]
jobs:
@ -28,44 +28,24 @@ jobs:
- name: Linux libraries
run: |
sudo apt update
sudo apt install libssl-dev libpam-dev libpcre2-dev rpm build-essential debhelper
sudo apt install libssl-dev libpam-dev libpcre2-dev rpm
- name: make rpmbuild dir
run: mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
- name: configure rpm env
run: |
mkdir ~/debian
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
tar -czf ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz --transform "s,^,3proxy-$RELEASE/," .
ln -s ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/rpmbuild/SOURCES/$RELEASE.tar.gz
cp scripts/rh/3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec
cp ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/debian/3proxy_$RELEASE.orig.tar.gz
- name: rpmbuild
run: |
ret=`pwd`
cd ~/rpmbuild/SPECS
rpmbuild -ba 3proxy-$RELEASE.spec
cd $ret
mv ~/rpmbuild/RPMS/aarch64/3proxy-$RELEASE-1.aarch64.rpm 3proxy-$RELEASE.arm64.rpm
- name: Get artifact arp
mv ~/rpmbuild/RPMS/aarch64/3proxy-$RELEASE-1.aarch64.rpm 3proxy-$RELEASE.aarch64.rpm
- name: Get artifact
uses: actions/upload-artifact@v4
with:
name: "3proxy-${{ env.RELEASE }}-arm64.rpm"
name: "3proxy-${{ env.RELEASE }}-aarch64.rpm"
path: "*.rpm"
- name: debbuild
run: |
ret=`pwd`
cd ~/debian/
tar xzf 3proxy_$RELEASE.orig.tar.gz
cd 3proxy-$RELEASE
echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium" >debian/changelog
echo " " >>debian/changelog
echo " *3proxy $RELEASE build" >>debian/changelog
echo " " >>debian/changelog
echo " -- z3APA3A <3apa3a@3proxy.org> "`date "+%a, %d %b %Y %H:%M:%S %z"` >>debian/changelog
echo "">>debian/changelog
dpkg-buildpackage
cd $ret
cp ~/debian/3proxy_$RELEASE-"$VERSION"_arm64.deb ./3proxy-$RELEASE.arm64.deb
- name: Get artifact deb
uses: actions/upload-artifact@v4
with:
name: "3proxy-${{ env.RELEASE }}-arm64.deb"
path: "*.deb"

View File

@ -1,8 +1,8 @@
name: RPM/DEB build armhf
name: RPM build armhf
on:
push:
branches: [ "master", "test-ci" ]
branches: [ "master" ]
paths: [ 'RELEASE', '.github/workflows/build-rpm-armhf.yml' ]
jobs:
@ -49,15 +49,14 @@ jobs:
echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" >>~/ubuntu.sources
sudo cp ~/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources
sudo apt update
sudo apt install libssl3t64:armhf openssl:armhf libssl-dev:armhf libpam0g:armhf libpam0g-dev:armhf libpcre2-dev:armhf rpm crossbuild-essential-armhf build-essential debhelper
sudo apt install libssl3t64:armhf openssl:armhf libssl-dev:armhf libpam0g:armhf libpam0g-dev:armhf libpcre2-dev:armhf rpm crossbuild-essential-armhf
- name: make rpmbuild dir
run: mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
- name: configure rpm env
run: |
mkdir ~/debian
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
tar -czf ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz --transform "s,^,3proxy-$RELEASE/," .
ln -s ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/rpmbuild/SOURCES/$RELEASE.tar.gz
cp scripts/rh/3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec
cp ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/debian/3proxy_$RELEASE.orig.tar.gz
- name: rpmbuild
run: |
ret=`pwd`
@ -70,35 +69,10 @@ jobs:
export LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib:$LD_LIBRARY_PATH
rpmbuild -ba --define "PAMLIB pam0g" --define "_arch arm" --define "cross yes" --target=arm-linux-gnueabi 3proxy-$RELEASE.spec
cd $ret
mv ~/rpmbuild/RPMS/arm/3proxy-$RELEASE-1.arm.rpm 3proxy-$RELEASE.arm.rpm
mv ~/rpmbuild/RPMS/arm/3proxy-$RELEASE-1.arm.rpm 3proxy-$RELEASE.armhf.rpm
- name: Get artifact
uses: actions/upload-artifact@v4
with:
name: "3proxy-${{ env.RELEASE }}-arm.rpm"
name: "3proxy-${{ env.RELEASE }}-armhf.rpm"
path: "*.rpm"
- name: debbuild
run: |
ret=`pwd`
cd ~/debian/
tar xzf 3proxy_$RELEASE.orig.tar.gz
cd 3proxy-$RELEASE
echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium" >debian/changelog
echo " " >>debian/changelog
echo " *3proxy $RELEASE build" >>debian/changelog
echo " " >>debian/changelog
echo " -- z3APA3A <3apa3a@3proxy.org> "`date "+%a, %d %b %Y %H:%M:%S %z"` >>debian/changelog
echo "">>debian/changelog
PATH=/usr/arm-linux-gnueabihf/bin:$PATH
export PATH=$PATH
CC=arm-linux-gnueabihf-gcc
export CC=$CC
export RPATH=/usr/arm-linux-gnueabihf/lib:$RPATH
export LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib:$LD_LIBRARY_PATH
dpkg-buildpackage
cd $ret
cp ~/debian/3proxy_$RELEASE-"$VERSION"_armhf.deb ./3proxy-$RELEASE.arm.deb
- name: Get artifact deb
uses: actions/upload-artifact@v4
with:
name: "3proxy-${{ env.RELEASE }}-arm.deb"
path: "*.deb"

View File

@ -1,8 +1,8 @@
name: RPM/DEB build x86-64
name: RPM build x86-64
on:
push:
branches: [ "master", "test-ci" ]
branches: [ "master" ]
paths: [ 'RELEASE', '.github/workflows/build-rpm-x86-64.yml' ]
jobs:
@ -28,15 +28,14 @@ jobs:
- name: Linux libraries
run: |
sudo apt update
sudo apt install libssl-dev libpam-dev libpcre2-dev rpm build-essential debhelper
- name: configure rpm/deb env
sudo apt install libssl-dev libpam-dev libpcre2-dev rpm
- name: make rpmbuild dir
run: mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
- name: configure rpm env
run: |
mkdir ~/debian
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
tar -czf ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz --transform "s,^,3proxy-$RELEASE/," .
ln -s ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/rpmbuild/SOURCES/$RELEASE.tar.gz
cp scripts/rh/3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec
cp ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/debian/3proxy_$RELEASE.orig.tar.gz
- name: rpmbuild
run: |
ret=`pwd`
@ -44,31 +43,9 @@ jobs:
rpmbuild -ba 3proxy-$RELEASE.spec
cd $ret
mv ~/rpmbuild/RPMS/x86_64/3proxy-$RELEASE-1.x86_64.rpm 3proxy-$RELEASE.x86_64.rpm
- name: Get artifact rpm
uses: actions/upload-artifact@v6
- name: Get artifact
uses: actions/upload-artifact@v4
with:
name: "3proxy-${{ env.RELEASE }}-x86_64.rpm"
path: "*.rpm"
archive: false
- name: debbuild
run: |
ret=`pwd`
cd ~/debian/
tar xzf 3proxy_$RELEASE.orig.tar.gz
cd 3proxy-$RELEASE
echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium" >debian/changelog
echo " " >>debian/changelog
echo " *3proxy $RELEASE build" >>debian/changelog
echo " " >>debian/changelog
echo " -- z3APA3A <3apa3a@3proxy.org> "`date "+%a, %d %b %Y %H:%M:%S %z"` >>debian/changelog
echo "">>debian/changelog
dpkg-buildpackage
cd $ret
cp ~/debian/3proxy_$RELEASE-"$VERSION"_amd64.deb ./3proxy-$RELEASE.x86_64.deb
- name: Get artifact deb
uses: actions/upload-artifact@v6
with:
name: "3proxy-${{ env.RELEASE }}-x86_64.deb"
path: "*.deb"
archive: false

View File

@ -485,15 +485,19 @@ install(TARGETS 3proxy mycrypt proxy socks pop3p smtpp ftppr tcppm udppm tlspr
)
# Install plugins
file(GLOB PLUGINFILES "${PLUGIN_OUTPUT_DIR}/*${PLUGIN_SUFFIX}")
if(WIN32)
install(FILES
${PLUGINFILES}
${PLUGIN_OUTPUT_DIR}/utf8tocp1251${PLUGIN_SUFFIX}
${PLUGIN_OUTPUT_DIR}/WindowsAuthentication${PLUGIN_SUFFIX}
${PLUGIN_OUTPUT_DIR}/TrafficPlugin${PLUGIN_SUFFIX}
${PLUGIN_OUTPUT_DIR}/StringsPlugin${PLUGIN_SUFFIX}
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
else()
install(FILES
${PLUGINFILES}
${PLUGIN_OUTPUT_DIR}/StringsPlugin${PLUGIN_SUFFIX}
${PLUGIN_OUTPUT_DIR}/TrafficPlugin${PLUGIN_SUFFIX}
${PLUGIN_OUTPUT_DIR}/TransparentPlugin${PLUGIN_SUFFIX}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/3proxy
)
endif()

View File

@ -4,6 +4,30 @@
# This file defines functions for building plugins
#
# Function to add a simple plugin (single source file, no dependencies)
function(add_3proxy_plugin_simple PLUGIN_NAME SOURCE_FILE)
if(WIN32)
set(PLUGIN_SUFFIX ".dll")
else()
set(PLUGIN_SUFFIX ".ld.so")
endif()
add_library(${PLUGIN_NAME} SHARED ${SOURCE_FILE})
set_target_properties(${PLUGIN_NAME} PROPERTIES
PREFIX ""
SUFFIX ${PLUGIN_SUFFIX}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
target_link_libraries(${PLUGIN_NAME} PRIVATE Threads::Threads)
target_include_directories(${PLUGIN_NAME} PRIVATE
${CMAKE_SOURCE_DIR}/src
)
endfunction()
# Function to add a plugin with dependencies
function(add_3proxy_plugin PLUGIN_NAME)
set(options "")

4
debian/conffiles vendored
View File

@ -0,0 +1,4 @@
/usr/local/3proxy/conf/3proxy.cfg
/usr/local/3proxy/conf/add3proxyuser.sh
/usr/local/3proxy/conf/bandlimiters
/usr/local/3proxy/conf/counters

14
debian/postinst vendored
View File

@ -1,3 +1,10 @@
if [ ! -f /usr/local/3proxy/conf/passwd ]; then \
touch /usr/local/3proxy/conf/passwd;\
fi
chown -R proxy:proxy /usr/local/3proxy
chmod 550 /usr/local/3proxy/
chmod 550 /usr/local/3proxy/conf/
chmod 440 /usr/local/3proxy/conf/*
if /bin/systemctl >/dev/null 2>&1; then \
/usr/sbin/update-rc.d 3proxy disable || true; \
/usr/sbin/chkconfig 3proxy off || true; \
@ -27,3 +34,10 @@ elif [ -x /usr/sbin/service ]; then \
echo " "service 3proxy stop ;\
echo to stop proxy ;\
fi
echo " "/usr/local/3proxy/conf/add3proxyuser.sh
echo to add users
echo ""
echo Default config uses Google\'s DNS.
echo It\'s recommended to use provider supplied DNS or install local recursor, e.g. pdns-recursor.
echo Configure preferred DNS in /usr/local/3proxy/conf/3proxy.cfg.
echo run \'/usr/local/3proxy/conf/add3proxyuser.sh admin password\' to configure \'admin\' user

6
debian/rules vendored
View File

@ -3,8 +3,14 @@
%:
dh $@
override_dh_auto_build:
ln -s Makefile.Linux Makefile || true
dh_auto_build
override_dh_auto_clean:
find src/ -type f -name "*.o" -delete
find src/ -type f -name "Makefile.var" -delete
find bin/ -type f -executable -delete
rm -f Makefile
override_dh_usrlocal: