Merge branch 'dev' into qt_migration

This commit is contained in:
pokamest 2022-08-20 17:27:57 +03:00
commit 050d987d3b
133 changed files with 564 additions and 881 deletions

View file

@ -1,5 +1,3 @@
language: cpp
branches:
only:
- master
@ -10,135 +8,328 @@ jobs:
include:
- name: MacOS
os: osx
osx_image: xcode12.5
osx_image: xcode13.4
language: cpp
env:
- PATH=/usr/local/opt/ccache/libexec:$PATH
- QT_VERSION=5.15.2
- QIF_VERSION=4.1
- QIF_VERSION=4.4
- QT_BIN_DIR=$HOME/Qt/$QT_VERSION/clang_64/bin
- QIF_BIN_DIR=$QT_BIN_DIR/../../../Tools/QtInstallerFramework/$QIF_VERSION/bin
script:
install:
- |
if [ ! -f $HOME/Qt/$QT_VERSION/clang_64/bin/qmake ]; then \
brew install p7zip && \
if [ ! -f $QT_BIN_DIR/qmake ]; then \
brew install p7zip ccache && \
python3 -m pip install --upgrade pip && \
pip install -U aqtinstall requests py7zr && \
pip show aqtinstall && \
python3 -m aqt install --outputdir $HOME/Qt $QT_VERSION mac desktop clang_64 -m qtbase && \
python3 -m aqt tool --outputdir $HOME/Qt mac tools_ifw $QIF_VERSION qt.tools.ifw.${QIF_VERSION/./};
aqt install-qt mac desktop $QT_VERSION clang_64 -m all -O $HOME/Qt && \
aqt install-tool mac desktop tools_ifw -O $HOME/Qt ; \
fi
script:
- bash deploy/build_macos.sh
after_script:
- ccache --show-stats
deploy:
provider: releases
token: $GH_TOKEN
skip_cleanup: true
cleanup: false
file:
- "AmneziaVPN_unsigned.dmg"
- "AmneziaVPN.dmg"
on:
tags: true
branch: master
cache:
- ccache
- directories:
- $HOME/Qt
- $HOME/Library/Caches/Homebrew
# ------------------------------------------------------
- name: Windows_x64
os: windows
language: cpp
env:
- PATH=/c/Python39:/c/Python39/Scripts:$PATH
- QT_VERSION=5.14.2
- QIF_VERSION=4.1
- QT_BIN_DIR="c:\\Qt\\$QT_VERSION\\msvc2017_64\\bin"
- QT_VERSION=5.15.2
- QIF_VERSION=4.4
- QT_BIN_DIR="c:\\Qt\\$QT_VERSION\\msvc2019_64\\bin"
- QIF_BIN_DIR="c:\\Qt\\Tools\\QtInstallerFramework\\${QIF_VERSION}\\bin"
- BUILD_ARCH=64
- MSVC_PATH_WIN="C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community"
- MSVC_PATH="/C/Program Files (x86)/Microsoft Visual Studio/2019/Community"
before_install:
- if [ ! -f /C/Qt/$QT_VERSION/msvc2017_64/bin/qmake ]; then choco install python --version 3.9.1; fi
script:
- dir "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build"
- dir "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools"
install:
- if [ ! -f "$MSVC_PATH/VC/Auxiliary/Build/vcvars64.bat" ]; then choco install --ignorepackagecodes --no-progress -y visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.ATLMFC --includeRecommended --nocache --installPath $MSVC_PATH_WIN"; fi
- if [ ! -f /C/Qt/$QT_VERSION/msvc2019_64/bin/qmake ]; then choco install python --version 3.9.1; fi
- |
if [ ! -f /C/Qt/$QT_VERSION/msvc2017_64/bin/qmake ]; then \
if [ ! -f /C/Qt/$QT_VERSION/msvc2019_64/bin/qmake ]; then \
python -m pip install --upgrade pip && \
pip3 install -U aqtinstall requests py7zr && \
pip3 show aqtinstall && \
python -m aqt install --outputdir /C/Qt $QT_VERSION windows desktop win64_msvc2017_64 -m qtbase && \
python -m aqt tool --outputdir /C/Qt windows tools_ifw $QIF_VERSION qt.tools.ifw.${QIF_VERSION/./}; \
aqt install-qt windows desktop $QT_VERSION win64_msvc2019_64 -m all -O /C/Qt && \
aqt install-tool windows desktop tools_ifw -O /C/Qt ; \
fi
script:
- echo set BUILD_ARCH=$BUILD_ARCH > winbuild.bat
- echo set QT_BIN_DIR="$QT_BIN_DIR" >> winbuild.bat
- echo set QIF_BIN_DIR="$QIF_BIN_DIR" >> winbuild.bat
- echo call \""C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Auxiliary\\Build\\vcvars${BUILD_ARCH}.bat\"" >> winbuild.bat
- echo call \""C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\Common7\\Tools\\VsDevCmd.bat\" -arch=amd64" >> winbuild.bat
- echo set WIN_CERT_PW=$WIN_CERT_PW >> winbuild.bat
- echo call \""%MSVC_PATH_WIN%\\VC\\Auxiliary\\Build\\vcvars${BUILD_ARCH}.bat\"" >> winbuild.bat
- echo call \""%MSVC_PATH_WIN%\\Common7\\Tools\\VsDevCmd.bat\" -arch=amd64" >> winbuild.bat
- echo call deploy\\build_windows.bat >> winbuild.bat
- cmd //c winbuild.bat
deploy:
provider: releases
token: $GH_TOKEN
skip_cleanup: true
cleanup: false
file:
- "AmneziaVPN_x64.exe"
on:
tags: true
branch: master
cache:
directories:
- /C/Qt
- $MSVC_PATH
# ------------------------------------------------------
- name: Windows_x32
os: windows
language: cpp
env:
- PATH=/c/Python39:/c/Python39/Scripts:$PATH
- QT_VERSION=5.14.2
- QIF_VERSION=4.1
- QT_BIN_DIR="c:\\Qt\\${QT_VERSION}\\msvc2017\\bin"
- QT_VERSION=5.15.2
- QIF_VERSION=4.4
- QT_BIN_DIR="c:\\Qt\\${QT_VERSION}\\msvc2019\\bin"
- QIF_BIN_DIR="c:\\Qt\\Tools\\QtInstallerFramework\\${QIF_VERSION}\\bin"
- BUILD_ARCH=32
- MSVC_PATH_WIN="C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community"
- MSVC_PATH="/C/Program Files (x86)/Microsoft Visual Studio/2019/Community"
before_install:
- if [ ! -f /C/Qt/$QT_VERSION/msvc2017/bin/qmake ]; then choco install python --version 3.9.1; fi
script:
- dir "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build"
- dir "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools"
install:
- if [ ! -f "$MSVC_PATH/VC/Auxiliary/Build/vcvars64.bat" ]; then choco install --ignorepackagecodes --no-progress -y visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.ATLMFC --includeRecommended --nocache --installPath $MSVC_PATH_WIN"; fi
- if [ ! -f /C/Qt/$QT_VERSION/msvc2019/bin/qmake ]; then choco install python --version 3.9.1; fi
- |
if [ ! -f /C/Qt/$QT_VERSION/msvc2017/bin/qmake ]; then \
if [ ! -f /C/Qt/$QT_VERSION/msvc2019/bin/qmake ]; then \
python -m pip install --upgrade pip && \
pip3 install -U aqtinstall requests py7zr && \
pip3 show aqtinstall && \
python -m aqt install --outputdir /C/Qt $QT_VERSION windows desktop win32_msvc2017 -m qtbase && \
python -m aqt tool --outputdir /C/Qt windows tools_ifw $QIF_VERSION qt.tools.ifw.${QIF_VERSION/./}; \
aqt install-qt windows desktop $QT_VERSION win32_msvc2019 -m all -O /C/Qt && \
aqt install-tool windows desktop tools_ifw -O /C/Qt ; \
fi
- echo call \""C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\Common7\\Tools\\VsDevCmd.bat\"" > winbuild.bat
- echo set BUILD_ARCH=$BUILD_ARCH >> winbuild.bat
script:
- echo set BUILD_ARCH=$BUILD_ARCH > winbuild.bat
- echo set QT_BIN_DIR="$QT_BIN_DIR" >> winbuild.bat
- echo set QIF_BIN_DIR="$QIF_BIN_DIR" >> winbuild.bat
- echo call \""C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Auxiliary\\Build\\vcvars${BUILD_ARCH}.bat\"" >> winbuild.bat
- echo set WIN_CERT_PW=$WIN_CERT_PW >> winbuild.bat
- echo call \""%MSVC_PATH_WIN%\\VC\\Auxiliary\\Build\\vcvars${BUILD_ARCH}.bat\"" >> winbuild.bat
- echo call \""%MSVC_PATH_WIN%\\Common7\\Tools\\VsDevCmd.bat\"" >> winbuild.bat
- echo call deploy\\build_windows.bat >> winbuild.bat
- cmd //c winbuild.bat
deploy:
provider: releases
token: $GH_TOKEN
skip_cleanup: true
cleanup: false
file:
- "AmneziaVPN_x32.exe"
on:
tags: true
branch: master
deploy:
skip_cleanup: true
cache:
directories:
- /C/Qt
- $MSVC_PATH
# ------------------------------------------------------
- name: Linux
os: linux
dist: focal
addons:
apt:
packages:
- p7zip
- python3
- python3-pip
- libgl-dev
- mesa-common-dev
- libpulse-dev
env:
- QT_VERSION=5.15.2
- QIF_VERSION=4.4
- QT_BIN_DIR=$HOME/Qt/$QT_VERSION/gcc_64/bin
- QIF_BIN_DIR=$QT_BIN_DIR/../../../Tools/QtInstallerFramework/$QIF_VERSION/bin
install:
- |
if [ ! -f $QT_BIN_DIR/qmake ]; then \
python3 -m pip install --user $(whoami) --upgrade pip && \
export PATH=$HOME/.local/bin:$PATH && \
python3 -m pip install -U aqtinstall requests py7zr && \
python3 -m pip show aqtinstall && \
python3 -m aqt install-qt linux desktop $QT_VERSION gcc_64 -m all -O $HOME/Qt && \
python3 -m aqt install-tool linux desktop tools_ifw -O $HOME/Qt ; \
fi
script:
- bash deploy/build_linux.sh
after_script:
- ccache --show-stats
deploy:
provider: releases
token: $GH_TOKEN
cleanup: false
file:
- "AmneziaVPN.bundle"
on:
tags: true
branch: master
cache:
- ccache
- directories:
- $HOME/Qt
# ------------------------------------------------------
- name: Android
os: linux
language: android
dist: xenial
addons:
apt:
packages:
- p7zip
- python3
- python3-pip
android:
components:
# Uncomment the lines below if you want to
# use the latest revision of Android SDK Tools
# - tools
# - platform-tools
# The BuildTools version used by your project
- build-tools-30.0.2
# The SDK version used to compile your project
- android-30
# Additional components
- extra
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
env:
- QT_VERSION=5.15.2
- QT_BIN_DIR=$HOME/Qt/$QT_VERSION/android/bin
- USE_ANDROID_NDK_VERSION=21d
- ANDROID_NDK_HOME=$HOME/NDK
install:
- |
if [ ! -f $QT_BIN_DIR/qmake ]; then \
export PATH=$HOME/.local/bin:$PATH && \
python3 -m pip install -U aqtinstall requests py7zr && \
python3 -m pip show aqtinstall && \
python3 -m aqt install-qt linux android $QT_VERSION android_armv7 -m all -O $HOME/Qt && \
python3 -m aqt install-qt linux android $QT_VERSION android_arm64_v8a -m all -O $HOME/Qt && \
python3 -m aqt install-qt linux android $QT_VERSION android_x86_64 -m all -O $HOME/Qt && \
python3 -m aqt install-qt linux android $QT_VERSION android_x86 -m all -O $HOME/Qt ; \
fi
- |
export TERM=dumb &&
curl -L https://dl.google.com/android/repository/android-ndk-r${USE_ANDROID_NDK_VERSION}-linux-x86_64.zip -O &&
unzip ./android-ndk-r${USE_ANDROID_NDK_VERSION}-linux-x86_64.zip > /dev/null &&
rm android-ndk-r${USE_ANDROID_NDK_VERSION}-linux-x86_64.zip &&
export ANDROID_NDK_HOME=`pwd`/android-ndk-r${USE_ANDROID_NDK_VERSION} &&
export LOCAL_ANDROID_NDK_HOME="$ANDROID_NDK_HOME" &&
export LOCAL_ANDROID_NDK_HOST_PLATFORM="linux-x86_64" &&
export PATH=$PATH:${ANDROID_NDK_HOME} &&
env
script:
- bash deploy/build_android.sh
after_script:
- ccache --show-stats
deploy:
provider: releases
token: $GH_TOKEN
cleanup: false
file:
- "AmneziaVPN.aab"
on:
tags: true
branch: master
cache:
- ccache
- directories:
- $HOME/Qt
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache
- $ANDROID_NDK_HOME
# ------------------------------------------------------
- name: iOS
os: osx
osx_image: xcode13.4
language: cpp
env:
- PATH=/usr/local/opt/ccache/libexec:~/go/bin:$PATH
- QT_VERSION=5.15.2
- QT_BIN_DIR=$HOME/Qt/$QT_VERSION/ios/bin
- QT_IOS_BIN=$QT_BIN_DIR
install:
- |
if [ ! -f $QT_BIN_DIR/qmake ]; then \
brew install p7zip ccache && \
python3 -m pip install --upgrade pip && \
pip install -U aqtinstall requests py7zr && \
pip show aqtinstall && \
aqt install-qt mac ios $QT_VERSION -m all -O $HOME/Qt ; \
fi
- brew install golang
- go install golang.org/x/mobile/cmd/gomobile@latest
- gomobile init
script:
- bash deploy/build_ios.sh
after_script:
- ccache --show-stats
cache:
- ccache
- directories:
- $HOME/Qt
- $HOME/Library/Caches/Homebrew
before_cache:
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew cleanup; fi
# Cache only .git files under "/usr/local/Homebrew" so "brew update" does not take 5min every build
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then find /usr/local/Homebrew \! -regex ".+\.git.+" -delete; fi
cache:
directories:
- $HOME/Qt
- /C/Qt
- $HOME/Library/Caches/Homebrew

View file

@ -20,8 +20,6 @@ AmneziaVPN uses a number of open source projects to work:
- [OpenVPN](https://openvpn.net/)
- [ShadowSocks](https://shadowsocks.org/)
- [Qt](https://www.qt.io/)
- [EasyRSA](https://github.com/OpenVPN/easy-rsa) - part of OpenVPN
- [CygWin](https://www.cygwin.com/) - only for Windiws, used for launching EasyRSA scripts
- [QtSsh](https://github.com/jaredtao/QtSsh) - forked form Qt Creator
- and more...

View file

@ -48,7 +48,7 @@ dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.2"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0"
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.0.10"
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"
implementation project(path: ':shadowsocks')
}
@ -97,6 +97,9 @@ android {
}
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

View file

@ -520,7 +520,9 @@ class VPNService : BaseVpnService(), LocalDnsService.Interface {
peerBuilder.addAllowedIp(network)
}
}
peerBuilder.setEndpoint(InetEndpoint.parse(peerConfig["Endpoint"]))
val endpointConfig = peerConfig["Endpoint"]
val endpoint = InetEndpoint.parse(endpointConfig)
peerBuilder.setEndpoint(endpoint)
peerConfig["PersistentKeepalive"]?.let {
peerBuilder.setPersistentKeepalive(it.toInt())
}

View file

@ -46,7 +46,6 @@ enum ErrorCode
FailedToSaveConfigData,
OpenVpnConfigMissing,
OpenVpnManagementServerError,
EasyRsaError,
ConfigMissing,
// Distro errors

View file

@ -35,10 +35,11 @@ QString errorString(ErrorCode code){
case (FailedToSaveConfigData): return QObject::tr("Failed to save config to disk");
case (OpenVpnConfigMissing): return QObject::tr("OpenVPN config missing");
case (OpenVpnManagementServerError): return QObject::tr("OpenVPN management server error");
case (EasyRsaError): return QObject::tr("EasyRSA runtime error");
// Distro errors
case (OpenVpnExecutableMissing): return QObject::tr("OpenVPN executable missing");
case (ShadowSocksExecutableMissing): return QObject::tr("ShadowSocks (ss-local) executable missing");
case (CloakExecutableMissing): return QObject::tr("Cloak (ck-client) executable missing");
case (AmneziaServiceConnectionFailed): return QObject::tr("Amnezia helper service error");
case (OpenSslFailed): return QObject::tr("OpenSSL failed");

View file

@ -27,6 +27,10 @@ OpenVpnOverCloakProtocol::~OpenVpnOverCloakProtocol()
ErrorCode OpenVpnOverCloakProtocol::start()
{
if (!QFileInfo::exists(cloakExecPath())) {
setLastError(ErrorCode::CloakExecutableMissing);
return lastError();
}
#ifndef Q_OS_IOS
if (Utils::processIsRunning(Utils::executable("ck-client", false))) {
Utils::killProcessByName(Utils::executable("ck-client", false));
@ -106,6 +110,8 @@ QString OpenVpnOverCloakProtocol::cloakExecPath()
{
#ifdef Q_OS_WIN
return Utils::executable(QString("cloak/ck-client"), true);
#elif defined Q_OS_LINUX
return Utils::usrExecutable("ck-client");
#else
return Utils::executable(QString("/ck-client"), true);
#endif

View file

@ -27,6 +27,13 @@ ShadowSocksVpnProtocol::~ShadowSocksVpnProtocol()
ErrorCode ShadowSocksVpnProtocol::start()
{
if (!QFileInfo::exists(shadowSocksExecPath())) {
setLastError(ErrorCode::ShadowSocksExecutableMissing);
return lastError();
}
#ifndef Q_OS_IOS
if (Utils::processIsRunning(Utils::executable("ss-local", false))) {
Utils::killProcessByName(Utils::executable("ss-local", false));

View file

@ -270,6 +270,6 @@ print G "done."
sed -i '' '/<string>Original<\/string>/d' AmneziaVPN.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
fi
print Y "Opening in XCode..."
open AmneziaVPN.xcodeproj
# print Y "Opening in XCode..."
# open AmneziaVPN.xcodeproj
print G "All done!"

67
deploy/build_android.sh Normal file
View file

@ -0,0 +1,67 @@
#!/bin/bash
echo "Build script started ..."
set -o errexit -o nounset
# Hold on to current directory
PROJECT_DIR=$(pwd)
DEPLOY_DIR=$PROJECT_DIR/deploy
mkdir -p $DEPLOY_DIR/build
BUILD_DIR=$DEPLOY_DIR/build
echo "Project dir: ${PROJECT_DIR}"
echo "Build dir: ${BUILD_DIR}"
APP_NAME=AmneziaVPN
APP_FILENAME=$APP_NAME.app
APP_DOMAIN=org.amneziavpn.package
OUT_APP_DIR=$BUILD_DIR/client
BUNDLE_DIR=$OUT_APP_DIR/$APP_FILENAME
INSTALLER_DATA_DIR=$BUILD_DIR/installer/packages/$APP_DOMAIN/data
INSTALLER_BUNDLE_DIR=$BUILD_DIR/installer/$APP_FILENAME
PRO_FILE_PATH=$PROJECT_DIR/$APP_NAME.pro
QMAKE_STASH_FILE=$PROJECT_DIR/.qmake_stash
# Seacrh Qt
if [ -z "${QT_VERSION+x}" ]; then
QT_VERSION=5.15.2;
QT_BIN_DIR=$HOME/Qt/$QT_VERSION/gcc_64/bin
fi
echo "Using Qt in $QT_BIN_DIR"
# Checking env
$QT_BIN_DIR/qmake -v
make -v
gcc -v
# Build App
echo "Building App..."
cd $BUILD_DIR
$QT_BIN_DIR/qmake -r -spec android-clang CONFIG+=qtquickcompiler ANDROID_ABIS="armeabi-v7a arm64-v8a x86 x86_64" $PROJECT_DIR/AmneziaVPN.pro
$ANDROID_NDK_HOME/prebuilt/linux-x86_64/bin/make -j2
$ANDROID_NDK_HOME/prebuilt/linux-x86_64/bin/make install INSTALL_ROOT=android
# Build and run tests here
#echo "............Deploy.................."
# TODO possible solution: https://github.com/mhoeher/opentodolist/blob/b8981852e500589851132a02c5a62af9b0ed592c/ci/android-cmake-build.sh
#$QT_BIN_DIR/androiddeployqt \
# --output $OUT_APP_DIR \
# --gradle \
# --release \
# --deployment bundled
#cp $OUT_APP_DIR/build/outputs/apk/release/android-build-release-unsigned.apk \
# OpenTodoList-${ANDROID_ABIS}-${OTL_VERSION}.apk

49
deploy/build_ios.sh Normal file
View file

@ -0,0 +1,49 @@
#!/bin/bash
echo "Build script started ..."
set -o errexit -o nounset
# Hold on to current directory
PROJECT_DIR=$(pwd)
DEPLOY_DIR=$PROJECT_DIR/deploy
mkdir -p $DEPLOY_DIR/build
BUILD_DIR=$DEPLOY_DIR/build
echo "Project dir: ${PROJECT_DIR}"
echo "Build dir: ${BUILD_DIR}"
APP_NAME=AmneziaVPN
APP_FILENAME=$APP_NAME.app
APP_DOMAIN=org.amneziavpn.package
PLIST_NAME=$APP_NAME.plist
OUT_APP_DIR=$BUILD_DIR/client
BUNDLE_DIR=$OUT_APP_DIR/$APP_FILENAME
PRO_FILE_PATH=$PROJECT_DIR/$APP_NAME.pro
QMAKE_STASH_FILE=$PROJECT_DIR/.qmake_stash
# Seacrh Qt
if [ -z "${QT_VERSION+x}" ]; then
QT_VERSION=5.15.2;
QIF_VERSION=4.1
QT_BIN_DIR=$HOME/Qt/$QT_VERSION/ios/bin
fi
echo "Using Qt in $QT_BIN_DIR"
# Checking env
$QT_BIN_DIR/qmake -v
# Build App
echo "Building App..."
cd $PROJECT_DIR/client
$PROJECT_DIR/client/scripts/apple_compile.sh ios
# Build and run tests here
#echo "............Deploy.................."

59
deploy/build_linux.sh Normal file
View file

@ -0,0 +1,59 @@
#!/bin/bash
echo "Build script started ..."
set -o errexit -o nounset
# Hold on to current directory
PROJECT_DIR=$(pwd)
DEPLOY_DIR=$PROJECT_DIR/deploy
mkdir -p $DEPLOY_DIR/build
BUILD_DIR=$DEPLOY_DIR/build
echo "Project dir: ${PROJECT_DIR}"
echo "Build dir: ${BUILD_DIR}"
APP_NAME=AmneziaVPN
APP_FILENAME=$APP_NAME.app
APP_DOMAIN=org.amneziavpn.package
OUT_APP_DIR=$BUILD_DIR/client
BUNDLE_DIR=$OUT_APP_DIR/$APP_FILENAME
DEPLOY_DATA_DIR=$PROJECT_DIR/deploy/data/linux
INSTALLER_DATA_DIR=$BUILD_DIR/installer/packages/$APP_DOMAIN/data
INSTALLER_BUNDLE_DIR=$BUILD_DIR/installer/$APP_FILENAME
PRO_FILE_PATH=$PROJECT_DIR/$APP_NAME.pro
QMAKE_STASH_FILE=$PROJECT_DIR/.qmake_stash
# Seacrh Qt
if [ -z "${QT_VERSION+x}" ]; then
QT_VERSION=5.15.2;
QIF_VERSION=4.1
QT_BIN_DIR=$HOME/Qt/$QT_VERSION/gcc_64/bin
QIF_BIN_DIR=$QT_BIN_DIR/../../../Tools/QtInstallerFramework/$QIF_VERSION/bin
fi
echo "Using Qt in $QT_BIN_DIR"
echo "Using QIF in $QIF_BIN_DIR"
# Checking env
$QT_BIN_DIR/qmake -v
make -v
gcc -v
# Build App
echo "Building App..."
cd $BUILD_DIR
$QT_BIN_DIR/qmake $PROJECT_DIR/AmneziaVPN.pro 'CONFIG+=release CONFIG+=x86_64'
make
# Build and run tests here
#echo "............Deploy.................."

View file

@ -3,6 +3,13 @@ echo "Build script started ..."
set -o errexit -o nounset
while getopts n: flag
do
case "${flag}" in
n) NOTARIZE_APP=1;;
esac
done
# Hold on to current directory
PROJECT_DIR=$(pwd)
DEPLOY_DIR=$PROJECT_DIR/deploy
@ -20,12 +27,14 @@ PLIST_NAME=$APP_NAME.plist
OUT_APP_DIR=$BUILD_DIR/client
BUNDLE_DIR=$OUT_APP_DIR/$APP_FILENAME
DEPLOY_DATA_DIR=$PROJECT_DIR/deploy/data/macos
INSTALLER_DATA_DIR=$BUILD_DIR/installer/packages/$APP_DOMAIN/data
INSTALLER_BUNDLE_DIR=$BUILD_DIR/installer/$APP_FILENAME
PRO_FILE_PATH=$PROJECT_DIR/$APP_NAME.pro
QMAKE_STASH_FILE=$PROJECT_DIR/.qmake_stash
DMG_FILENAME=$PROJECT_DIR/${APP_NAME}_unsigned.dmg
DMG_FILENAME=$PROJECT_DIR/${APP_NAME}.dmg
# Seacrh Qt
if [ -z "${QT_VERSION+x}" ]; then
@ -62,64 +71,97 @@ echo "Packaging ..."
#cd $DEPLOY_DIR
$QT_BIN_DIR/macdeployqt $OUT_APP_DIR/$APP_FILENAME -always-overwrite
$QT_BIN_DIR/macdeployqt $OUT_APP_DIR/$APP_FILENAME -always-overwrite -qmldir=$PROJECT_DIR
cp -av $BUILD_DIR/service/server/$APP_NAME-service.app/Contents/macOS/$APP_NAME-service $BUNDLE_DIR/Contents/macOS
cp -Rv $PROJECT_DIR/deploy/data/macos/* $BUNDLE_DIR/Contents/macOS
rm -f $BUNDLE_DIR/Contents/macOS/post_install.sh $BUNDLE_DIR/Contents/macOS/post_uninstall.sh
if [ "${MAC_CERT_PW+x}" ]; then
CERTIFICATE_P12=$DEPLOY_DIR/PrivacyTechAppleCertDeveloperId.p12
WWDRCA=$DEPLOY_DIR/WWDRCA.cer
KEYCHAIN=amnezia.build.keychain
TEMP_PASS=tmp_pass
CERTIFICATE_P12=$DEPLOY_DIR/PrivacyTechAppleCertDeveloperId.p12
WWDRCA=$DEPLOY_DIR/WWDRCA.cer
KEYCHAIN=amnezia.build.keychain
TEMP_PASS=tmp_pass
security create-keychain -p $TEMP_PASS $KEYCHAIN || true
security default-keychain -s $KEYCHAIN
security unlock-keychain -p $TEMP_PASS $KEYCHAIN
security create-keychain -p $TEMP_PASS $KEYCHAIN || true
security default-keychain -s $KEYCHAIN
security unlock-keychain -p $TEMP_PASS $KEYCHAIN
security default-keychain
security list-keychains
security default-keychain
security list-keychains
security import $WWDRCA -k $KEYCHAIN -T /usr/bin/codesign || true
security import $CERTIFICATE_P12 -k $KEYCHAIN -P $MAC_CERT_PW -T /usr/bin/codesign || true
security import $WWDRCA -k $KEYCHAIN -T /usr/bin/codesign || true
security import $CERTIFICATE_P12 -k $KEYCHAIN -P $MAC_CERT_PW -T /usr/bin/codesign || true
security set-key-partition-list -S apple-tool:,apple: -k $TEMP_PASS $KEYCHAIN
security find-identity -p codesigning
security set-key-partition-list -S apple-tool:,apple: -k $TEMP_PASS $KEYCHAIN
security find-identity -p codesigning
/usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "Developer ID Application: Privacy Technologies OU (X7UJ388FXK)" $BUNDLE_DIR
/usr/bin/codesign --verify -vvvv $BUNDLE_DIR || true
spctl -a -vvvv $BUNDLE_DIR || true
echo "Signing App bundle..."
/usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "Developer ID Application: Privacy Technologies OU (X7UJ388FXK)" $BUNDLE_DIR
/usr/bin/codesign --verify -vvvv $BUNDLE_DIR || true
spctl -a -vvvv $BUNDLE_DIR || true
if [ "${NOTARIZE_APP+x}" ]; then
echo "Notatizing App bundle..."
/usr/bin/ditto -c -k --keepParent $BUNDLE_DIR $PROJECT_DIR/Bundle_to_notarize.zip
xcrun altool --notarize-app -f $PROJECT_DIR/Bundle_to_notarize.zip -t osx --primary-bundle-id "$APP_DOMAIN" -u "$APPLE_DEV_EMAIL" -p $APPLE_DEV_PASSWORD
rm $PROJECT_DIR/Bundle_to_notarize.zip
sleep 600
xcrun stapler staple $BUNDLE_DIR
xcrun stapler validate $BUNDLE_DIR
spctl -a -vvvv $BUNDLE_DIR || true
fi
fi
echo "Packaging installer..."
mkdir -p $INSTALLER_DATA_DIR
cp -av $PROJECT_DIR/deploy/installer $BUILD_DIR
cp -av $DEPLOY_DATA_DIR/post_install.sh $INSTALLER_DATA_DIR/post_install.sh
cp -av $DEPLOY_DATA_DIR/post_uninstall.sh $INSTALLER_DATA_DIR/post_uninstall.sh
cp -av $DEPLOY_DATA_DIR/$PLIST_NAME $INSTALLER_DATA_DIR/$PLIST_NAME
rm -f $BUNDLE_DIR/Contents/macOS/post_install.sh $BUNDLE_DIR/Contents/macOS/post_uninstall.sh
chmod a+x $INSTALLER_DATA_DIR/post_install.sh $INSTALLER_DATA_DIR/post_uninstall.sh
cd $BUNDLE_DIR
tar czf $INSTALLER_DATA_DIR/$APP_NAME.tar.gz ./
cd $BUILD_DIR/installer
$QIF_BIN_DIR/binarycreator --offline-only -v -c config/macos.xml -p packages -f $APP_FILENAME
echo "Building installer..."
$QIF_BIN_DIR/binarycreator --offline-only -v -c $BUILD_DIR/installer/config/macos.xml -p $BUILD_DIR/installer/packages -f $INSTALLER_BUNDLE_DIR
if [ "${MAC_CERT_PW+x}" ]; then
/usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "Developer ID Application: Privacy Technologies OU (X7UJ388FXK)" $APP_FILENAME
echo "Signing installer bundle..."
security unlock-keychain -p $TEMP_PASS $KEYCHAIN
/usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "Developer ID Application: Privacy Technologies OU (X7UJ388FXK)" $INSTALLER_BUNDLE_DIR
/usr/bin/codesign --verify -vvvv $INSTALLER_BUNDLE_DIR || true
if [ "${NOTARIZE_APP+x}" ]; then
echo "Notatizing installer bundle..."
/usr/bin/ditto -c -k --keepParent $INSTALLER_BUNDLE_DIR $PROJECT_DIR/Installer_bundle_to_notarize.zip
xcrun altool --notarize-app -f $PROJECT_DIR/Installer_bundle_to_notarize.zip -t osx --primary-bundle-id "$APP_DOMAIN" -u "$APPLE_DEV_EMAIL" -p $APPLE_DEV_PASSWORD
rm $PROJECT_DIR/Installer_bundle_to_notarize.zip
sleep 600
xcrun stapler staple $INSTALLER_BUNDLE_DIR
xcrun stapler validate $INSTALLER_BUNDLE_DIR
spctl -a -vvvv $INSTALLER_BUNDLE_DIR || true
fi
fi
hdiutil create -volname $APP_NAME -srcfolder $APP_NAME.app -ov -format UDZO $DMG_FILENAME
echo "Building DMG installer..."
hdiutil create -volname $APP_NAME -srcfolder $BUILD_DIR/installer/$APP_NAME.app -ov -format UDZO $DMG_FILENAME
if [ "${MAC_CERT_PW+x}" ]; then
/usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "Developer ID Application: Privacy Technologies OU (X7UJ388FXK)" $DMG_FILENAME
/usr/bin/codesign --verify -vvvv $DMG_FILENAME || true
spctl -a -vvvv $DMG_FILENAME || true
#xcrun altool --notarize-app -f $DMG_FILENAME -t osx --primary-bundle-id $APP_DOMAIN -u $APPLE_DEV_EMAIL -p $APPLE_DEV_PASSWORD
#xcrun stapler staple $DMG_FILENAME
#xcrun stapler validate $DMG_FILENAME
echo "Signing DMG installer..."
security unlock-keychain -p $TEMP_PASS $KEYCHAIN
/usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "Developer ID Application: Privacy Technologies OU (X7UJ388FXK)" $DMG_FILENAME
/usr/bin/codesign --verify -vvvv $DMG_FILENAME || true
if [ "${NOTARIZE_APP+x}" ]; then
echo "Notatizing DMG installer..."
xcrun altool --notarize-app -f $DMG_FILENAME -t osx --primary-bundle-id $APP_DOMAIN -u $APPLE_DEV_EMAIL -p $APPLE_DEV_PASSWORD
sleep 600
xcrun stapler staple $DMG_FILENAME
xcrun stapler validate $DMG_FILENAME
fi
fi
echo "Finished, artifact is $DMG_FILENAME"

View file

@ -1,160 +0,0 @@
#!/bin/bash
echo "Build script started ..."
set -o errexit -o nounset
# Hold on to current directory
PROJECT_DIR=$(pwd)
DEPLOY_DIR=$PROJECT_DIR/deploy
mkdir -p $DEPLOY_DIR/build
BUILD_DIR=$DEPLOY_DIR/build
echo "Project dir: ${PROJECT_DIR}"
echo "Build dir: ${BUILD_DIR}"
APP_NAME=AmneziaVPN
APP_FILENAME=$APP_NAME.app
APP_DOMAIN=org.amneziavpn.package
PLIST_NAME=$APP_NAME.plist
OUT_APP_DIR=$BUILD_DIR/client
BUNDLE_DIR=$OUT_APP_DIR/$APP_FILENAME
DEPLOY_DATA_DIR=$PROJECT_DIR/deploy/data/macos
INSTALLER_DATA_DIR=$BUILD_DIR/installer/packages/$APP_DOMAIN/data
INSTALLER_BUNDLE_DIR=$BUILD_DIR/installer/$APP_FILENAME
PRO_FILE_PATH=$PROJECT_DIR/$APP_NAME.pro
QMAKE_STASH_FILE=$PROJECT_DIR/.qmake_stash
DMG_FILENAME=$PROJECT_DIR/${APP_NAME}_unsigned.dmg
# Seacrh Qt
if [ -z "${QT_VERSION+x}" ]; then
QT_VERSION=5.15.2;
QIF_VERSION=4.1
QT_BIN_DIR=$HOME/Qt/$QT_VERSION/clang_64/bin
QIF_BIN_DIR=$QT_BIN_DIR/../../../Tools/QtInstallerFramework/$QIF_VERSION/bin
fi
echo "Using Qt in $QT_BIN_DIR"
echo "Using QIF in $QIF_BIN_DIR"
# Checking env
$QT_BIN_DIR/qmake -v
make -v
clang -v
# Build App
echo "Building App..."
cd $BUILD_DIR
$QT_BIN_DIR/qmake $PROJECT_DIR/AmneziaVPN.pro 'CONFIG+=release CONFIG+=x86_64'
make -j `sysctl -n hw.ncpu`
# Build and run tests here
echo "____________________________________"
echo "............Deploy.................."
echo "____________________________________"
# Package
echo "Packaging ..."
#cd $DEPLOY_DIR
$QT_BIN_DIR/macdeployqt $OUT_APP_DIR/$APP_FILENAME -always-overwrite -qmldir=$PROJECT_DIR
cp -av $BUILD_DIR/service/server/$APP_NAME-service.app/Contents/macOS/$APP_NAME-service $BUNDLE_DIR/Contents/macOS
cp -Rv $PROJECT_DIR/deploy/data/macos/* $BUNDLE_DIR/Contents/macOS
rm -f $BUNDLE_DIR/Contents/macOS/post_install.sh $BUNDLE_DIR/Contents/macOS/post_uninstall.sh
if [ "${MAC_CERT_PW+x}" ]; then
CERTIFICATE_P12=$DEPLOY_DIR/PrivacyTechAppleCertDeveloperId.p12
WWDRCA=$DEPLOY_DIR/WWDRCA.cer
KEYCHAIN=amnezia.build.keychain
TEMP_PASS=tmp_pass
security create-keychain -p $TEMP_PASS $KEYCHAIN || true
security default-keychain -s $KEYCHAIN
security unlock-keychain -p $TEMP_PASS $KEYCHAIN
security default-keychain
security list-keychains
security import $WWDRCA -k $KEYCHAIN -T /usr/bin/codesign || true
security import $CERTIFICATE_P12 -k $KEYCHAIN -P $MAC_CERT_PW -T /usr/bin/codesign || true
security set-key-partition-list -S apple-tool:,apple: -k $TEMP_PASS $KEYCHAIN
security find-identity -p codesigning
echo "Signing App bundle..."
/usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "Developer ID Application: Privacy Technologies OU (X7UJ388FXK)" $BUNDLE_DIR
/usr/bin/codesign --verify -vvvv $BUNDLE_DIR || true
spctl -a -vvvv $BUNDLE_DIR || true
echo "Notatizing App bundle..."
/usr/bin/ditto -c -k --keepParent $BUNDLE_DIR $PROJECT_DIR/Bundle_to_notarize.zip
xcrun altool --notarize-app -f $PROJECT_DIR/Bundle_to_notarize.zip -t osx --primary-bundle-id "$APP_DOMAIN" -u "$APPLE_DEV_EMAIL" -p $APPLE_DEV_PASSWORD
rm $PROJECT_DIR/Bundle_to_notarize.zip
sleep 600
xcrun stapler staple $BUNDLE_DIR
xcrun stapler validate $BUNDLE_DIR
spctl -a -vvvv $BUNDLE_DIR || true
fi
echo "Packaging installer..."
mkdir -p $INSTALLER_DATA_DIR
cp -av $PROJECT_DIR/deploy/installer $BUILD_DIR
cp -av $DEPLOY_DATA_DIR/post_install.sh $INSTALLER_DATA_DIR/post_install.sh
cp -av $DEPLOY_DATA_DIR/post_uninstall.sh $INSTALLER_DATA_DIR/post_uninstall.sh
cp -av $DEPLOY_DATA_DIR/$PLIST_NAME $INSTALLER_DATA_DIR/$PLIST_NAME
chmod a+x $INSTALLER_DATA_DIR/post_install.sh $INSTALLER_DATA_DIR/post_uninstall.sh
cd $BUNDLE_DIR
tar czf $INSTALLER_DATA_DIR/$APP_NAME.tar.gz ./
echo "Building installer..."
$QIF_BIN_DIR/binarycreator --offline-only -v -c $BUILD_DIR/installer/config/macos.xml -p $BUILD_DIR/installer/packages -f $INSTALLER_BUNDLE_DIR
if [ "${MAC_CERT_PW+x}" ]; then
echo "Signing installer bundle..."
security unlock-keychain -p $TEMP_PASS $KEYCHAIN
/usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "Developer ID Application: Privacy Technologies OU (X7UJ388FXK)" $INSTALLER_BUNDLE_DIR
/usr/bin/codesign --verify -vvvv $INSTALLER_BUNDLE_DIR || true
echo "Notatizing installer bundle..."
/usr/bin/ditto -c -k --keepParent $INSTALLER_BUNDLE_DIR $PROJECT_DIR/Installer_bundle_to_notarize.zip
xcrun altool --notarize-app -f $PROJECT_DIR/Installer_bundle_to_notarize.zip -t osx --primary-bundle-id "$APP_DOMAIN" -u "$APPLE_DEV_EMAIL" -p $APPLE_DEV_PASSWORD
rm $PROJECT_DIR/Installer_bundle_to_notarize.zip
sleep 600
xcrun stapler staple $INSTALLER_BUNDLE_DIR
xcrun stapler validate $INSTALLER_BUNDLE_DIR
spctl -a -vvvv $INSTALLER_BUNDLE_DIR || true
fi
echo "Building DMG installer..."
hdiutil create -volname $APP_NAME -srcfolder $BUILD_DIR/installer/$APP_NAME.app -ov -format UDZO $DMG_FILENAME
if [ "${MAC_CERT_PW+x}" ]; then
echo "Signing DMG installer..."
security unlock-keychain -p $TEMP_PASS $KEYCHAIN
/usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "Developer ID Application: Privacy Technologies OU (X7UJ388FXK)" $DMG_FILENAME
/usr/bin/codesign --verify -vvvv $DMG_FILENAME || true
echo "Notatizing DMG installer..."
xcrun altool --notarize-app -f $DMG_FILENAME -t osx --primary-bundle-id $APP_DOMAIN -u $APPLE_DEV_EMAIL -p $APPLE_DEV_PASSWORD
sleep 600
xcrun stapler staple $DMG_FILENAME
xcrun stapler validate $DMG_FILENAME
fi
echo "Finished, artifact is $DMG_FILENAME"
# restore keychain
security default-keychain -s login.keychain

View file

@ -0,0 +1,10 @@
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Name=AmneziaVPN client
Version=2.0.10
Comment=Client of your self-hosted VPN
Exec=AmneziaVPN
Icon=/usr/share/pixmaps/AmneziaVPN_Logo.png
Categories=Network;Qt;Security;
Terminal=false

View file

@ -7,8 +7,7 @@ StartLimitIntervalSec=0
Type=simple
Restart=always
RestartSec=1
ExecStart=/opt/AmneziaVPN/service/bin/AmneziaVPN-service
Environment="LD_LIBRARY_PATH=/opt/AmneziaVPN/client/lib/"
ExecStart=/opt/AmneziaVPN/service/AmneziaVPN-service.sh
[Install]
WantedBy=multi-user.target

View file

@ -1,8 +0,0 @@
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Name=AmneziaVPN client
Comment=AmneziaVPN client
Exec=AmneziaVPN
Icon=AmneziaVPN_Logo.png
Categories=VPN

View file

@ -1,8 +0,0 @@
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Name=AmneziaVPN client
Comment=AmneziaVPN client
Exec=AmneziaVPN
Icon=AmneziaVPN_Logo.png
Categories=VPN

View file

@ -5,8 +5,6 @@
#
# ####################################################################
#
# All variables has the CQT_ prefix
# BIN_PATH - are releative path to executable files of a deployed distribution.
# LIB_PATH - are releative path to libraryes of a deployed distribution.
# QML_PATH - are releative path to qml libraryes of a deployed distribution.
# PLUGIN_PATH - are releative path to qt plugins of a deployed distribution.
@ -20,7 +18,6 @@
# ####################################################################
BASE_DIR=$(dirname "$(readlink -f "$0")")
export PATH="$BASE_DIR"/bin/:$PATH
export LD_LIBRARY_PATH="$BASE_DIR"/lib/:"$BASE_DIR":$LD_LIBRARY_PATH
export QML_IMPORT_PATH="$BASE_DIR"/qml/:$QML_IMPORT_PATH
export QML2_IMPORT_PATH="$BASE_DIR"/qml/:$QML2_IMPORT_PATH

View file

@ -1,138 +0,0 @@
# For use with Easy-RSA 3.0+ and OpenSSL or LibreSSL
####################################################################
[ ca ]
default_ca = CA_default # The default ca section
####################################################################
[ CA_default ]
dir = $ENV::EASYRSA_PKI # Where everything is kept
certs = $dir # Where the issued certs are kept
crl_dir = $dir # Where the issued crl are kept
database = $dir/index.txt # database index file.
new_certs_dir = $dir/certs_by_serial # default place for new certs.
certificate = $dir/ca.crt # The CA certificate
serial = $dir/serial # The current serial number
crl = $dir/crl.pem # The current CRL
private_key = $dir/private/ca.key # The private key
RANDFILE = $dir/.rand # private random number file
x509_extensions = basic_exts # The extensions to add to the cert
# This allows a V2 CRL. Ancient browsers don't like it, but anything Easy-RSA
# is designed for will. In return, we get the Issuer attached to CRLs.
crl_extensions = crl_ext
default_days = $ENV::EASYRSA_CERT_EXPIRE # how long to certify for
default_crl_days= $ENV::EASYRSA_CRL_DAYS # how long before next CRL
default_md = $ENV::EASYRSA_DIGEST # use public key default MD
preserve = no # keep passed DN ordering
# This allows to renew certificates which have not been revoked
unique_subject = no
# A few different ways of specifying how similar the request should look
# For type CA, the listed attributes must be the same, and the optional
# and supplied fields are just that :-)
policy = policy_anything
# For the 'anything' policy, which defines allowed DN fields
[ policy_anything ]
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
name = optional
emailAddress = optional
####################################################################
# Easy-RSA request handling
# We key off $DN_MODE to determine how to format the DN
[ req ]
default_bits = $ENV::EASYRSA_KEY_SIZE
default_keyfile = privkey.pem
default_md = $ENV::EASYRSA_DIGEST
distinguished_name = $ENV::EASYRSA_DN
x509_extensions = easyrsa_ca # The extensions to add to the self signed cert
# A placeholder to handle the $EXTRA_EXTS feature:
#%EXTRA_EXTS% # Do NOT remove or change this line as $EXTRA_EXTS support requires it
####################################################################
# Easy-RSA DN (Subject) handling
# Easy-RSA DN for cn_only support:
[ cn_only ]
commonName = Common Name (eg: your user, host, or server name)
commonName_max = 64
commonName_default = $ENV::EASYRSA_REQ_CN
# Easy-RSA DN for org support:
[ org ]
countryName = Country Name (2 letter code)
countryName_default = $ENV::EASYRSA_REQ_COUNTRY
countryName_min = 2
countryName_max = 2
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = $ENV::EASYRSA_REQ_PROVINCE
localityName = Locality Name (eg, city)
localityName_default = $ENV::EASYRSA_REQ_CITY
0.organizationName = Organization Name (eg, company)
0.organizationName_default = $ENV::EASYRSA_REQ_ORG
organizationalUnitName = Organizational Unit Name (eg, section)
organizationalUnitName_default = $ENV::EASYRSA_REQ_OU
commonName = Common Name (eg: your user, host, or server name)
commonName_max = 64
commonName_default = $ENV::EASYRSA_REQ_CN
emailAddress = Email Address
emailAddress_default = $ENV::EASYRSA_REQ_EMAIL
emailAddress_max = 64
####################################################################
# Easy-RSA cert extension handling
# This section is effectively unused as the main script sets extensions
# dynamically. This core section is left to support the odd usecase where
# a user calls openssl directly.
[ basic_exts ]
basicConstraints = CA:FALSE
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer:always
# The Easy-RSA CA extensions
[ easyrsa_ca ]
# PKIX recommendations:
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
# This could be marked critical, but it's nice to support reading by any
# broken clients who attempt to do so.
basicConstraints = CA:true
# Limit key usage to CA tasks. If you really want to use the generated pair as
# a self-signed cert, comment this out.
keyUsage = cRLSign, keyCertSign
# nsCertType omitted by default. Let's try to let the deprecated stuff die.
# nsCertType = sslCA
# CRL extensions.
[ crl_ext ]
# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
# issuerAltName=issuer:copy
authorityKeyIdentifier=keyid:always,issuer:always

View file

@ -0,0 +1,10 @@
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Name=AmneziaVPN client
Version=2.0.10
Comment=Client of your self-hosted VPN
Exec=AmneziaVPN
Icon=/usr/share/pixmaps/AmneziaVPN_Logo.png
Categories=Network;Qt;Security;
Terminal=false

View file

@ -1,8 +0,0 @@
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Name=AmneziaVPN client
Comment=AmneziaVPN client
Exec=AmneziaVPN
Icon=AmneziaVPN_Logo.png
Categories=VPN

View file

@ -1 +0,0 @@
<クd<>箆!ソ`。スン

View file

@ -1 +0,0 @@
<クd<>箆!ソ`。スン

View file

@ -1 +0,0 @@
<クd<>箆!ソ`。スン

View file

@ -25,31 +25,20 @@ if sudo systemctl is-active --quiet $APP_NAME; then
sudo rm -rf /etc/systemd/system/$APP_NAME.service >> $LOG_FILE
fi
sudo chmod +x $APP_PATH/client/bin/easyrsa >> $LOG_FILE
sudo chmod --- $APP_PATH/client/bin/update-resolv-conf.sh
sudo chmod +rx $APP_PATH/client/bin/update-resolv-conf.sh
sudo chmod -R a-w $APP_PATH/
sudo cp $APP_PATH/service/$APP_NAME.service /etc/systemd/system/ >> $LOG_FILE
sudo cp $APP_PATH/$APP_NAME.service /etc/systemd/system/ >> $LOG_FILE
sudo systemctl start $APP_NAME >> $LOG_FILE
sudo systemctl enable $APP_NAME >> $LOG_FILE
sudo ln -s $APP_PATH/client/$APP_NAME.sh /usr/sbin/$APP_NAME >> $LOG_FILE
sudo chmod 555 $APP_PATH/client/$APP_NAME.sh >> $LOG_FILE
sudo ln -s $APP_PATH/client/$APP_NAME.sh /usr/local/sbin/$APP_NAME >> $LOG_FILE
sudo ln -s $APP_PATH/client/$APP_NAME.sh /usr/local/bin/$APP_NAME >> $LOG_FILE
echo "user desktop creation loop started" >> $LOG_FILE
getent passwd {1000..6000} | while IFS=: read -r name password uid gid gecos home shell; do
echo "name: $name"
if ! test -f /home/$name/.icons; then
mkdir /home/$name/.icons/ >> $LOG_FILE
fi
sudo cp $APP_PATH/$APP_NAME.desktop /usr/share/applications/ >> $LOG_FILE
sudo chmod 555 /usr/share/applications/$APP_NAME.desktop >> $LOG_FILE
cp -f $APP_PATH/client/share/icons/AmneziaVPN_Logo.png /home/$name/.icons/ >> $LOG_FILE
cp $APP_PATH/client/$APP_NAME.desktop /home/$name/Desktop/ >> $LOG_FILE
sudo chown $name:$name /home/$name/.local/share/gvfs-metadata/home* >> $LOG_FILE
sudo -u $name dbus-launch gio set /home/$name/Desktop/AmneziaVPN.desktop "metadata::trusted" yes >> $LOG_FILE
sudo chown $name:$name /home/$name/Desktop/AmneziaVPN.desktop >> $LOG_FILE
done
echo "user desktop creation loop ended" >> $LOG_FILE
date >> $LOG_FILE

View file

@ -29,47 +29,30 @@ if test -f /etc/systemd/system/$APP_NAME.service; then
sudo rm -rf /etc/systemd/system/$APP_NAME.service >> $LOG_FILE
fi
if test -f /usr/bin/$APP_NAME; then
sudo rm -rf /usr/sbin/$APP_NAME >> $LOG_FILE
fi
if test -f $APP_PATH; then
sudo rm -rf $APP_PATH >> $LOG_FILE
fi
if test -f /usr/sbin/$APP_NAME; then
sudo rm -rf /usr/sbin/$APP_NAME >> $LOG_FILE
sudo rm -f /usr/sbin/$APP_NAME >> $LOG_FILE
fi
if test -f /usr/sbin/$APP_NAME-service; then
sudo rm -rf /usr/sbin/$APP_NAME-service >> $LOG_FILE
if test -f /usr/bin/$APP_NAME; then
sudo rm -f /usr/bin/$APP_NAME >> $LOG_FILE
fi
getent passwd {1000..6000} | while IFS=: read -r name password uid gid gecos home shell; do
if test -f /home/$name/Desktop/$APP_NAME\ client.desktop; then
sudo rm -rf /home/$name/Desktop/$APP_NAME\ client.desktop >> $LOG_FILE
fi
if test -f /usr/local/bin/$APP_NAME; then
sudo rm -f /usr/local/bin/$APP_NAME >> $LOG_FILE
fi
if test -f /home/$name/Desktop/$APP_NAME.desktop; then
sudo rm -rf /home/$name/Desktop/$APP_NAME.desktop >> $LOG_FILE
fi
if test -f /usr/local/sbin/$APP_NAME; then
sudo rm -f /usr/local/sbin/$APP_NAME >> $LOG_FILE
fi
if test -f /home/$name/.config/$APP_NAME.ORG; then
sudo rm -rf /home/$name/.config/$APP_NAME.ORG >> $LOG_FILE
fi
if test -f /usr/share/applications/$APP_NAME.desktop; then
sudo rm -f /usr/share/applications/$APP_NAME.desktop >> $LOG_FILE
if test -f /home/$name/.local/share/$APP_NAME.ORG; then
sudo rm -rf /home/$name/.local/share/$APP_NAME.ORG >> $LOG_FILE
fi
if test -f /home/$name/.local/share/$APP_NAME; then
sudo rm -rf /home/$name/.local/share/$APP_NAME >> $LOG_FILE
fi
if test -f /home/$name/.icons/AmneziaVPN_Logo.png; then
sudo rm -rf /home/$name/.icons/AmneziaVPN_Logo.png >> $LOG_FILE
fi
done
fi
date >> $LOG_FILE
echo "Service after uninstall status:" >> $LOG_FILE

View file

@ -5,8 +5,6 @@
#
# ####################################################################
#
# All variables has the CQT_ prefix
# BIN_PATH - are releative path to executable files of a deployed distribution.
# LIB_PATH - are releative path to libraryes of a deployed distribution.
# QML_PATH - are releative path to qml libraryes of a deployed distribution.
# PLUGIN_PATH - are releative path to qt plugins of a deployed distribution.
@ -20,7 +18,6 @@
# ####################################################################
BASE_DIR=$(dirname "$(readlink -f "$0")")
export PATH="$BASE_DIR"/bin/:$PATH
export LD_LIBRARY_PATH="$BASE_DIR"/lib/:"$BASE_DIR":$LD_LIBRARY_PATH
export QML_IMPORT_PATH="$BASE_DIR"/qml/:$QML_IMPORT_PATH
export QML2_IMPORT_PATH="$BASE_DIR"/qml/:$QML2_IMPORT_PATH

View file

@ -1,7 +0,0 @@
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Name=AmneziaVPN service
Comment=AmneziaVPN service
Exec=AmneziaVPN-service
Categories=VPN

Some files were not shown because too many files have changed in this diff Show more