-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #228 from quexten/feature/macos
Mac Support
- Loading branch information
Showing
7 changed files
with
59 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build windows || darwin | ||
//go:build windows | ||
|
||
package pinentry | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
#!/usr/bin/env python3 | ||
import src.linux.main as linux_main | ||
|
||
linux_main.main() | ||
import platform | ||
|
||
if platform.system() == 'Darwin': | ||
import src.macos.main as macos_main | ||
macos_main.main() | ||
elif platform.system() == 'Linux': | ||
import src.linux.main as linux_main | ||
linux_main.main() | ||
else: | ||
print("Unsupported OS " + platform.system() + "... exiting...") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import sys | ||
import subprocess | ||
import os | ||
import secrets | ||
from src.services import goldwarden | ||
from src.services import pinentry | ||
import time | ||
|
||
root_path = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir, os.pardir)) | ||
|
||
def main(): | ||
token = secrets.token_hex(32) | ||
if not os.environ.get("GOLDWARDEN_DAEMON_AUTH_TOKEN") == None: | ||
token = os.environ["GOLDWARDEN_DAEMON_AUTH_TOKEN"] | ||
print("Starting Goldwarden GUI") | ||
goldwarden.run_daemon_background(token) | ||
time.sleep(1) | ||
#pinentry.daemonize() | ||
if not "--hidden" in sys.argv: | ||
p = subprocess.Popen(["python3", "-m", "src.gui.settings"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=root_path, start_new_session=True) | ||
p.stdin.write(f"{token}\n".encode()) | ||
p.stdin.flush() | ||
# print stdout | ||
while True: | ||
line = p.stderr.readline() | ||
if not line: | ||
break | ||
print(line.decode().strip()) | ||
while True: | ||
time.sleep(60) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters