Skip to content

Commit

Permalink
trying ci fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rexhoffman committed Sep 24, 2023
1 parent ef30b8c commit 3d05c39
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/dbus.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

<!-- Our well-known bus type, do not change this -->
<type>session</type>

<!-- Fork into daemon mode -->
<fork/>

<!-- We use system service launching using a helper -->
<standard_system_servicedirs/>

<!-- This is a setuid helper that is used to launch system services -->
<servicehelper>/lib/dbus-1/dbus-daemon-launch-helper</servicehelper>

<!-- Write a pid file -->
<pidfile>/var/run/dbus/pid</pidfile>

<!-- Enable logging to syslog -->
<syslog/>

<!-- Only allow socket-credentials-based authentication -->
<auth>EXTERNAL</auth>

<!-- Only listen on a local socket. (abstract=/path/to/socket
means use abstract namespace, don't really create filesystem
file; only Linux supports this. Use path=/whatever on other
systems.) -->
<listen>unix:path=/tmp/test_system_bus_socket</listen>
<busconfig>
6 changes: 3 additions & 3 deletions .setupkeystore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
keyring="$1"

set -x
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ] && [ "$keyring" == "gnome" ]; then
export $(dbus-launch)
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ] && [ "$keyring" == "gnome" ]; then
export $(dbus-launch --config-file=${HOME}/.github/workflow/dbus.xml)
eval "$(echo '\n' | gnome-keyring-daemon --unlock)"
echo xxx@gmail.com | secret-tool store --label="main" email address
PASS=$(secret-tool lookup email address)
Expand All @@ -25,7 +25,7 @@ if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ] && [ "$keyring" == "kde" ]; t
cp $GITHUB_WORKSPACE/.setupkeystore/* ~/.local/share/kwalletd
chmod 600 ~/.local/share/kwalletd/*
dbus-uuidgen --ensure
export $(dbus-launch)
export $(dbus-launch --config-file=${HOME}/.github/workflow/dbus.xml)
password=$(kwalletcli -f . -e address)
echo Checking the secret can be retrieved.
if [ "$password" != "xxx@gmail.com" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import org.freedesktop.dbus.annotations.DBusInterfaceName;
import org.freedesktop.dbus.connections.impl.DBusConnection;
import org.freedesktop.dbus.connections.impl.DBusConnectionBuilder;
import org.freedesktop.dbus.interfaces.DBusInterface;

import java.io.IOException;
Expand All @@ -45,7 +46,7 @@ public class KWalletBackend implements KeyringBackend {

public KWalletBackend() throws BackendNotSupportedException {
try {
connection = DBusConnection.getConnection(DBusConnection.DBusBusType.SESSION);
connection = DBusConnectionBuilder.forSessionBus().build();
wallet = connection.getRemoteObject("org.kde.kwalletd5", "/modules/kwalletd5", KWallet.class, true);
wallet.localWallet(); //attempt connection to wallet
} catch (Exception e) {
Expand Down

0 comments on commit 3d05c39

Please sign in to comment.