mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-08 14:33:23 +00:00
Compare commits
10 Commits
4.8.8.3
...
feature/on
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
111cc8dcbb | ||
|
|
3d118e0c31 | ||
|
|
feeb9e4809 | ||
|
|
92d49bd725 | ||
|
|
506df2eb89 | ||
|
|
5991e0e597 | ||
|
|
ba424d0ac6 | ||
|
|
5b2b675c53 | ||
|
|
9441830a47 | ||
|
|
fbdae95802 |
10
.github/workflows/deploy.yml
vendored
10
.github/workflows/deploy.yml
vendored
@@ -1,6 +1,5 @@
|
||||
name: 'Deploy workflow'
|
||||
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
@@ -249,12 +248,21 @@ jobs:
|
||||
export QIF_BIN_DIR="${{ runner.temp }}/Qt/Tools/QtInstallerFramework/${{ env.QIF_VERSION }}/bin"
|
||||
bash deploy/build_macos.sh
|
||||
|
||||
- name: 'Upload upacked build to update server'
|
||||
# if: github.ref_name == 'dev'
|
||||
env:
|
||||
MACOS_UNPACKED_BUILD_PATH: deploy/build/installer/amneziavpn-macos-repository
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_SECRET_ACCESS_KEY }}
|
||||
run: aws s3 sync --endpoint-url https://${{ vars.CF_ACCOUNT_ID }}.r2.cloudflarestorage.com ${{ env.MACOS_UNPACKED_BUILD_PATH }} s3://updates/beta/macos --delete
|
||||
|
||||
- name: 'Upload installer artifact'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: AmneziaVPN_MacOS_installer
|
||||
path: AmneziaVPN.dmg
|
||||
retention-days: 7
|
||||
|
||||
- name: 'Upload unpacked artifact'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -9,7 +9,7 @@ deploy/build_32/*
|
||||
deploy/build_64/*
|
||||
winbuild*.bat
|
||||
.cache/
|
||||
|
||||
.vscode/
|
||||
|
||||
# Qt-es
|
||||
/.qmake.cache
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "pageController.h"
|
||||
|
||||
#include <QProcess>
|
||||
|
||||
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
||||
#include <QGuiApplication>
|
||||
#else
|
||||
@@ -162,3 +164,74 @@ void PageController::closeApplication()
|
||||
{
|
||||
qApp->quit();
|
||||
}
|
||||
|
||||
bool PageController::checkForUpdates()
|
||||
{
|
||||
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
||||
return false;
|
||||
#else
|
||||
QString path = qApp->applicationDirPath();
|
||||
|
||||
bool checked = false;
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
if(path.contains(qApp->applicationName()+".app/Contents/MacOS")) {
|
||||
path = path.remove("Contents/MacOS");
|
||||
}
|
||||
path = path + "maintenancetool.app";
|
||||
|
||||
checked = true;
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
if(path.contains("/client/bin")) {
|
||||
path = path.remove("/client/bin");
|
||||
}
|
||||
path = path + "/maintenancetool";
|
||||
|
||||
checked = true;
|
||||
#endif
|
||||
|
||||
if (!checked) {
|
||||
return false;
|
||||
}
|
||||
|
||||
QStringList argsCheckUpdates;
|
||||
argsCheckUpdates << "--checkupdates";
|
||||
|
||||
QProcess process;
|
||||
process.start(path, argsCheckUpdates);
|
||||
|
||||
// Wait until the update tool is finished
|
||||
process.waitForFinished();
|
||||
|
||||
if (process.error() != QProcess::UnknownError) {
|
||||
emit showNotificationMessage(tr("Checking for updates: %1").arg(process.errorString()));
|
||||
return true;
|
||||
}
|
||||
|
||||
// Read the output
|
||||
QByteArray data = process.readAllStandardOutput();
|
||||
|
||||
// No output means no updates available
|
||||
// Note that the exit code will also be 1, but we don't use that
|
||||
// Also note that we should parse the output instead of just checking if it is empty if we want specific update info
|
||||
if (data.isEmpty()) {
|
||||
emit showNotificationMessage(tr("Checking for updates: %1").arg("it's the latest version"));
|
||||
return true;
|
||||
}
|
||||
|
||||
// Note: we start it detached because this application need to close for the update
|
||||
QStringList argsUpdater("--updater");
|
||||
bool bresult = QProcess::startDetached(path, argsUpdater);
|
||||
if (!bresult) {
|
||||
emit showNotificationMessage(tr("Checking for updates: %1").arg("test"));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Close the application
|
||||
qApp->quit();
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -90,6 +90,8 @@ public slots:
|
||||
|
||||
void closeApplication();
|
||||
|
||||
bool checkForUpdates();
|
||||
|
||||
signals:
|
||||
void goToPage(PageLoader::PageEnum page, bool slide = true);
|
||||
void goToStartPage();
|
||||
|
||||
@@ -192,7 +192,13 @@ PageType {
|
||||
text: qsTr("Check for updates")
|
||||
|
||||
onClicked: {
|
||||
Qt.openUrlExternally("https://github.com/amnezia-vpn/desktop-client/releases/latest")
|
||||
PageController.showBusyIndicator(true)
|
||||
|
||||
if (!PageController.checkForUpdates()) {
|
||||
Qt.openUrlExternally("https://github.com/amnezia-vpn/desktop-client/releases/latest")
|
||||
}
|
||||
|
||||
PageController.showBusyIndicator(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,9 @@ if [ -z "${QT_VERSION+x}" ]; then
|
||||
elif [ -f $HOME/Qt/$QT_VERSION/gcc_64/bin/qmake ]; then
|
||||
QT_BIN_DIR=$HOME/Qt/$QT_VERSION/gcc_64/bin
|
||||
fi
|
||||
|
||||
QIF_VERSION=4.6
|
||||
QIF_BIN_DIR=$QT_BIN_DIR/../../../Tools/QtInstallerFramework/$QIF_VERSION/bin
|
||||
fi
|
||||
|
||||
echo "Using Qt in $QT_BIN_DIR"
|
||||
@@ -85,4 +88,10 @@ cp -r $PROJECT_DIR/deploy/installer $BUILD_DIR
|
||||
|
||||
$CQTDEPLOYER_DIR/binarycreator.sh --offline-only -v -c $BUILD_DIR/installer/config/linux.xml -p $BUILD_DIR/installer/packages -f $PROJECT_DIR/deploy/AmneziaVPN_Linux_Installer
|
||||
|
||||
# echo "Generating repository..."
|
||||
$QIF_BIN_DIR/repogen -p $BUILD_DIR/installer/packages $BUILD_DIR/installer/amneziavpn-linux-repository
|
||||
|
||||
# echo "Building online installer..."
|
||||
$CQTDEPLOYER_DIR/binarycreator.sh --online-only -c $BUILD_DIR/installer/config/linux.xml -p $BUILD_DIR/installer/packages $PROJECT_DIR/deploy/AmneziaVPN_Linux_Online_Installer
|
||||
|
||||
|
||||
|
||||
@@ -163,7 +163,18 @@ if [ "${MAC_CERT_PW+x}" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Finished, artifact is $DMG_FILENAME"
|
||||
|
||||
echo "Finished to generate local installer, artifact is $DMG_FILENAME"
|
||||
# restore keychain
|
||||
security default-keychain -s login.keychain
|
||||
|
||||
echo "Generate online installer and repository..."
|
||||
|
||||
cd $PROJECT_DIR
|
||||
DIRNAME=$0
|
||||
if [ "${DIRNAME:0:1}" = "/" ];then
|
||||
CURDIR=`dirname $DIRNAME`
|
||||
else
|
||||
CURDIR="`pwd`"/"`dirname $DIRNAME`"
|
||||
fi
|
||||
|
||||
source $CURDIR/build_macos_online_installer.sh
|
||||
|
||||
100
deploy/build_macos_online_installer.sh
Executable file
100
deploy/build_macos_online_installer.sh
Executable file
@@ -0,0 +1,100 @@
|
||||
#!/bin/bash
|
||||
echo "___________________________________________________________________"
|
||||
echo "..................repository and online installer.................."
|
||||
echo "___________________________________________________________________"
|
||||
|
||||
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
|
||||
|
||||
mkdir -p $DEPLOY_DIR/build
|
||||
BUILD_DIR=$DEPLOY_DIR/build
|
||||
|
||||
echo "Project dir: ${PROJECT_DIR}"
|
||||
echo "Build dir: ${BUILD_DIR}"
|
||||
|
||||
APP_NAME=amneziavpn-online-installer
|
||||
APP_FILENAME=$APP_NAME.app
|
||||
APP_DOMAIN=org.amneziavpn.package
|
||||
PLIST_NAME=$APP_NAME.plist
|
||||
|
||||
REPO_NAME=amneziavpn-macos-repository
|
||||
|
||||
OUT_APP_DIR=$BUILD_DIR/client
|
||||
BUNDLE_DIR=$OUT_APP_DIR/$APP_FILENAME
|
||||
|
||||
PREBUILT_DEPLOY_DATA_DIR=$PROJECT_DIR/deploy/data/deploy-prebuilt/macos
|
||||
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
|
||||
DMG_FILENAME=$PROJECT_DIR/${APP_NAME}.dmg
|
||||
|
||||
# Search Qt
|
||||
if [ -z "${QT_VERSION+x}" ]; then
|
||||
QT_VERSION=6.5.1;
|
||||
QIF_VERSION=4.6
|
||||
QT_BIN_DIR=$HOME/Qt/$QT_VERSION/macos/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"
|
||||
|
||||
|
||||
echo "Generating repository..."
|
||||
$QIF_BIN_DIR/repogen -p $BUILD_DIR/installer/packages $BUILD_DIR/installer/$REPO_NAME
|
||||
|
||||
echo "Building online installer..."
|
||||
$QIF_BIN_DIR/binarycreator --online-only -c $BUILD_DIR/installer/config/macos.xml -p $BUILD_DIR/installer/packages $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 "$MAC_SIGNER_ID" $INSTALLER_BUNDLE_DIR
|
||||
/usr/bin/codesign --verify -vvvv $INSTALLER_BUNDLE_DIR || true
|
||||
|
||||
if [ "${NOTARIZE_APP+x}" ]; then
|
||||
echo "Notarizing installer bundle..."
|
||||
/usr/bin/ditto -c -k --keepParent $INSTALLER_BUNDLE_DIR $PROJECT_DIR/Installer_bundle_to_notarize.zip
|
||||
xcrun notarytool submit $PROJECT_DIR/Installer_bundle_to_notarize.zip --apple-id $APPLE_DEV_EMAIL --team-id $MAC_TEAM_ID --password $APPLE_DEV_PASSWORD
|
||||
rm $PROJECT_DIR/Installer_bundle_to_notarize.zip
|
||||
sleep 300
|
||||
xcrun stapler staple $INSTALLER_BUNDLE_DIR
|
||||
xcrun stapler validate $INSTALLER_BUNDLE_DIR
|
||||
spctl -a -vvvv $INSTALLER_BUNDLE_DIR || true
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Building DMG installer..."
|
||||
hdiutil create -volname AmneziaVPN -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 "$MAC_SIGNER_ID" $DMG_FILENAME
|
||||
/usr/bin/codesign --verify -vvvv $DMG_FILENAME || true
|
||||
|
||||
if [ "${NOTARIZE_APP+x}" ]; then
|
||||
echo "Notarizing DMG installer..."
|
||||
xcrun notarytool submit $DMG_FILENAME --apple-id $APPLE_DEV_EMAIL --team-id $MAC_TEAM_ID --password $APPLE_DEV_PASSWORD
|
||||
sleep 300
|
||||
xcrun stapler staple $DMG_FILENAME
|
||||
xcrun stapler validate $DMG_FILENAME
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Finished to generate online instaler and repository, artifact is $DMG_FILENAME"
|
||||
|
||||
# restore keychain
|
||||
security default-keychain -s login.keychain
|
||||
@@ -13,14 +13,14 @@
|
||||
<AllowSpaceInPath>true</AllowSpaceInPath>
|
||||
<AllowNonAsciiCharacters>false</AllowNonAsciiCharacters>
|
||||
<ControlScript>controlscript.js</ControlScript>
|
||||
<RepositorySettingsPageVisible>false</RepositorySettingsPageVisible>
|
||||
<RepositorySettingsPageVisible>true</RepositorySettingsPageVisible>
|
||||
<DependsOnLocalInstallerBinary>true</DependsOnLocalInstallerBinary>
|
||||
<SupportsModify>false</SupportsModify>
|
||||
<SupportsModify>true</SupportsModify>
|
||||
<DisableAuthorizationFallback>true</DisableAuthorizationFallback>
|
||||
<RemoteRepositories>
|
||||
<Repository>
|
||||
<Url>https://amneziavpn.org/updates/linux</Url>
|
||||
<Enabled>true</Enabled>
|
||||
<Url>https://updates.amzsvc.com/beta/linux</Url>
|
||||
<Enabled>1</Enabled>
|
||||
<DisplayName>AmneziaVPN - repository for Linux</DisplayName>
|
||||
</Repository>
|
||||
</RemoteRepositories>
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
<AllowSpaceInPath>true</AllowSpaceInPath>
|
||||
<AllowNonAsciiCharacters>false</AllowNonAsciiCharacters>
|
||||
<ControlScript>controlscript.js</ControlScript>
|
||||
<RepositorySettingsPageVisible>false</RepositorySettingsPageVisible>
|
||||
<RepositorySettingsPageVisible>true</RepositorySettingsPageVisible>
|
||||
<DependsOnLocalInstallerBinary>true</DependsOnLocalInstallerBinary>
|
||||
<SupportsModify>false</SupportsModify>
|
||||
<SupportsModify>true</SupportsModify>
|
||||
<DisableAuthorizationFallback>true</DisableAuthorizationFallback>
|
||||
<RemoteRepositories>
|
||||
<Repository>
|
||||
<Url>https://amneziavpn.org/updates/macos</Url>
|
||||
<Enabled>true</Enabled>
|
||||
<Url>https://updates.amzsvc.com/beta/macos</Url>
|
||||
<Enabled>1</Enabled>
|
||||
<DisplayName>AmneziaVPN - repository for macOS</DisplayName>
|
||||
</Repository>
|
||||
</RemoteRepositories>
|
||||
|
||||
Reference in New Issue
Block a user