diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f349e98..ed1a13c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ on: env: RELEASE: 4.5.0.16 - TAILSCALE_VERSION: 1.36.2 + TAILSCALE_VERSION: 1.56.1 jobs: build: diff --git a/README.md b/README.md index ebc467a..8f04bb0 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ This application uses **root** privileges to run as this is needed to start `tai This project **IS NOT** endorsed by Tailscale Inc. +## Install + +Install via [OpenRepos](https://openrepos.net/content/ilpianista/tailscale). + ## Translations [![Translation status](https://hosted.weblate.org/widgets/harbour-tailscale/-/svg-badge.svg)](https://hosted.weblate.org/engage/harbour-tailscale/?utm_source=widget) diff --git a/Tailscale.pro b/Tailscale.pro index 2041f4f..321e508 100644 --- a/Tailscale.pro +++ b/Tailscale.pro @@ -10,11 +10,12 @@ OTHER_FILES += \ qml/cover/CoverPage.qml \ qml/pages/About.qml \ qml/pages/MainPage.qml \ - qml/tailscale.qml \ + qml/Tailscale.qml \ harbour-tailscale.desktop \ rpm/harbour-tailscale.changes \ rpm/harbour-tailscale.spec \ - rpm/tailscale.service \ + rpm/tailscaled.defaults \ + rpm/tailscaled.service \ translations/*.ts CONFIG += sailfishapp_i18n diff --git a/harbour-tailscale.desktop b/harbour-tailscale.desktop index ac837f4..dd20bbc 100644 --- a/harbour-tailscale.desktop +++ b/harbour-tailscale.desktop @@ -1,6 +1,9 @@ [Desktop Entry] Type=Application -X-Nemo-Application-Type=silica-qt5 +# From https://harbour.jolla.com/faq +# > this will make sure that the application is launched using the right booster, and will make startup faster +# However this makes impossible to start the tailscale service when launched from lipstick. +#X-Nemo-Application-Type=silica-qt5 Categories=Network; Icon=harbour-tailscale Exec=harbour-tailscale diff --git a/qml/Tailscale.qml b/qml/Tailscale.qml index be97512..ee325c6 100644 --- a/qml/Tailscale.qml +++ b/qml/Tailscale.qml @@ -18,12 +18,39 @@ import QtQuick 2.0 import Sailfish.Silica 1.0 +import Nemo.DBus 2.0 import "pages" ApplicationWindow { + id: appWindow + initialPage: Component { MainPage { } } cover: Qt.resolvedUrl("cover/CoverPage.qml") + + DBusInterface { + id: systemdUser + + bus: DBus.SessionBus + service: 'org.freedesktop.systemd1' + path: '/org/freedesktop/systemd1' + iface: 'org.freedesktop.systemd1.Manager' + } + + function restartBrowser() { + systemdUser.typedCall('RestartUnit', + [ + { 'type': 's', 'value': 'booster-browser@sailfish-browser.service' }, + { 'type': 's', 'value': 'fail' } + ], + function(result) { + console.log("sailfish-browser restarted") + }, + function(error, message) { + console.log("failed (" + error + ") with:", message) + } + ); + } } diff --git a/qml/cover/CoverPage.qml b/qml/cover/CoverPage.qml index 780f71c..bd81f0b 100644 --- a/qml/cover/CoverPage.qml +++ b/qml/cover/CoverPage.qml @@ -26,6 +26,7 @@ CoverBackground { onStatusUpdate: { placeholder.text = isUp ? qsTr("Up") : qsTr("Down"); + cover.iconSource = isUp ? "image://theme/icon-m-dismiss" : "image://theme/icon-m-global-proxy"; } } @@ -34,4 +35,21 @@ CoverBackground { text: client.isUp() ? qsTr("Up") : qsTr("Down"); icon.source: "/usr/share/icons/hicolor/86x86/apps/harbour-tailscale.png" } + + CoverActionList { + CoverAction { + id: cover + iconSource: client.isUp() ? "image://theme/icon-m-dismiss" : "image://theme/icon-m-global-proxy"; + + onTriggered: { + if (client.isUp()) { + client.down(); + } else { + client.up(); + } + + appWindow.restartBrowser(); + } + } + } } diff --git a/qml/pages/MainPage.qml b/qml/pages/MainPage.qml index c5ed112..8fb7fc8 100644 --- a/qml/pages/MainPage.qml +++ b/qml/pages/MainPage.qml @@ -69,6 +69,7 @@ Page { status.text = client.getStatus(); up.enabled = true; down.enabled = false; + appWindow.restartBrowser(); } } @@ -77,7 +78,10 @@ Page { text: qsTr("Up") enabled: !client.isUp() - onClicked: client.up() + onClicked: { + client.up(); + appWindow.restartBrowser(); + } } } diff --git a/rpm/harbour-tailscale.changes b/rpm/harbour-tailscale.changes index c7f9e98..03f665a 100644 --- a/rpm/harbour-tailscale.changes +++ b/rpm/harbour-tailscale.changes @@ -1,3 +1,18 @@ +* Fri Jan 12 2024 Andrea Scarpino 0.0.7-1 +- Update tailscale to 1.56.1 + +* Mon Jul 17 2023 Andrea Scarpino 0.0.6-1 +- Add up/down action to cover +- Fix segmentation fault on exit + +* Thu Jul 13 2023 Andrea Scarpino 0.0.5-1 +- Restart the browser so that it picks up resolv.conf changes +- Bump tailscale version + +* Wed May 24 2023 Andrea Scarpino 0.0.4-1 +- Disable liptstick to fix application start from the launcher. +- Bump tailscale version + * Wed Feb 01 2023 Andrea Scarpino 0.0.3-1 - Disable SailJail to fix application start from the launcher. diff --git a/rpm/harbour-tailscale.spec b/rpm/harbour-tailscale.spec index b41cf05..c642e53 100644 --- a/rpm/harbour-tailscale.spec +++ b/rpm/harbour-tailscale.spec @@ -2,7 +2,7 @@ Name: harbour-tailscale # >> macros %global _missing_build_ids_terminate_build 0 -%define tailscale_version 1.36.2 +%define tailscale_version 1.56.1 # << macros %{!?qtc_qmake:%define qtc_qmake %qmake} @@ -10,7 +10,7 @@ Name: harbour-tailscale %{!?qtc_make:%define qtc_make make} %{?qtc_builddir:%define _builddir %qtc_builddir} Summary: tailscale -Version: 0.0.3 +Version: 0.0.7 Release: 1 Group: Qt/Qt License: GPLv3 @@ -48,23 +48,6 @@ BuildRequires: desktop-file-utils Tailscale makes networking easy -%if "%{?vendor}" == "chum" -PackageName: tailscale -Type: desktop-application -DeveloperName: Andrea Scarpino -Categories: - - Network -Custom: - Repo: https://github.com/ilpianista/harbour-tailscale -Screenshots: - - https://raw.githubusercontent.com/ilpianista/harbour-Tailscale/master/screenshots/screenshot_1.png -Url: - Homepage: https://github.com/ilpianista/harbour-tailscale - Bugtracker: https://github.com/ilpianista/harbour-tailscale/issues - Donation: https://liberapay.com/ilpianista -%endif - - %prep %setup -q -n %{name}-%{version} diff --git a/src/client.cpp b/src/client.cpp index b5e98a4..7574b10 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -36,7 +36,6 @@ Client::Client(QObject *parent) : Client::~Client() { - delete m_cmd; } QString Client::getStatus() const @@ -66,6 +65,7 @@ void Client::onUpFinished(int exitCode) Q_EMIT statusUpdate(true); } m_cmd->deleteLater(); + m_cmd = 0; } void Client::onUpReadyRead()