Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed Feb 5, 2024
2 parents c2f6320 + 70d1c42 commit fbe0a5c
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

env:
RELEASE: 4.5.0.16
TAILSCALE_VERSION: 1.36.2
TAILSCALE_VERSION: 1.56.1

jobs:
build:
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions Tailscale.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion harbour-tailscale.desktop
Original file line number Diff line number Diff line change
@@ -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
Expand Down
27 changes: 27 additions & 0 deletions qml/Tailscale.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
);
}
}


18 changes: 18 additions & 0 deletions qml/cover/CoverPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}

Expand All @@ -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();
}
}
}
}
6 changes: 5 additions & 1 deletion qml/pages/MainPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Page {
status.text = client.getStatus();
up.enabled = true;
down.enabled = false;
appWindow.restartBrowser();
}
}

Expand All @@ -77,7 +78,10 @@ Page {
text: qsTr("Up")
enabled: !client.isUp()

onClicked: client.up()
onClicked: {
client.up();
appWindow.restartBrowser();
}
}
}

Expand Down
15 changes: 15 additions & 0 deletions rpm/harbour-tailscale.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
* Fri Jan 12 2024 Andrea Scarpino <andrea@scarpino.dev> 0.0.7-1
- Update tailscale to 1.56.1

* Mon Jul 17 2023 Andrea Scarpino <andrea@scarpino.dev> 0.0.6-1
- Add up/down action to cover
- Fix segmentation fault on exit

* Thu Jul 13 2023 Andrea Scarpino <andrea@scarpino.dev> 0.0.5-1
- Restart the browser so that it picks up resolv.conf changes
- Bump tailscale version

* Wed May 24 2023 Andrea Scarpino <andrea@scarpino.dev> 0.0.4-1
- Disable liptstick to fix application start from the launcher.
- Bump tailscale version

* Wed Feb 01 2023 Andrea Scarpino <andrea@scarpino.dev> 0.0.3-1
- Disable SailJail to fix application start from the launcher.

Expand Down
21 changes: 2 additions & 19 deletions rpm/harbour-tailscale.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ 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}
%{!?qtc_qmake5:%define qtc_qmake5 %qmake5}
%{!?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
Expand Down Expand Up @@ -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}

Expand Down
2 changes: 1 addition & 1 deletion src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Client::Client(QObject *parent) :

Client::~Client()
{
delete m_cmd;
}

QString Client::getStatus() const
Expand Down Expand Up @@ -66,6 +65,7 @@ void Client::onUpFinished(int exitCode)
Q_EMIT statusUpdate(true);
}
m_cmd->deleteLater();
m_cmd = 0;
}

void Client::onUpReadyRead()
Expand Down

0 comments on commit fbe0a5c

Please sign in to comment.