diff --git a/com.angoosh.RDPConnect/RDPConnect.flatpak b/com.angoosh.RDPConnect/RDPConnect.flatpak index 1f89f85..326227f 100644 Binary files a/com.angoosh.RDPConnect/RDPConnect.flatpak and b/com.angoosh.RDPConnect/RDPConnect.flatpak differ diff --git a/com.angoosh.RDPConnect/build.sh b/com.angoosh.RDPConnect/build.sh index 61d41b6..ff12c00 100755 --- a/com.angoosh.RDPConnect/build.sh +++ b/com.angoosh.RDPConnect/build.sh @@ -1,3 +1,3 @@ #!/bin/bash -flatpak-builder --force-clean --user --install-deps-from=flathub --repo=repo --install builddir com.angoosh.RDPConnect.yml -flatpak build-bundle repo RDPConnect.flatpak com.angoosh.RDPConnect --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo +flatpak-builder --gpg-sign=kaplanantonin@gmail.com --force-clean --user --install-deps-from=flathub --repo=repo --install builddir com.angoosh.RDPConnect.yml +#flatpak build-bundle repo RDPConnect.flatpak com.angoosh.RDPConnect --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo diff --git a/com.angoosh.RDPConnect/com.angoosh.RDPConnect.desktop b/com.angoosh.RDPConnect/com.angoosh.RDPConnect.desktop index 5a6a5b7..839cf17 100644 --- a/com.angoosh.RDPConnect/com.angoosh.RDPConnect.desktop +++ b/com.angoosh.RDPConnect/com.angoosh.RDPConnect.desktop @@ -1,6 +1,11 @@ [Desktop Entry] -Name=RDP Connect -Exec=rdpconnect +Version=1.0 Type=Application + +Name=RDP Connect +Comment=Connect to remote desktop +Categories=Utility;GNOME; + Icon=com.angoosh.RDPConnect -Categories=Office;Development \ No newline at end of file +Exec=rdpconnect +Terminal=false \ No newline at end of file diff --git a/com.angoosh.RDPConnect/com.angoosh.RDPConnect.metainfo.xml b/com.angoosh.RDPConnect/com.angoosh.RDPConnect.metainfo.xml index cb19c3b..78d5095 100644 --- a/com.angoosh.RDPConnect/com.angoosh.RDPConnect.metainfo.xml +++ b/com.angoosh.RDPConnect/com.angoosh.RDPConnect.metainfo.xml @@ -1,34 +1,67 @@ -com.angoosh.RDPConnect -CC0-1.0 -Apache-2.0 AND Beerware -RDP Connect -Connect to remote desktop - - Antonin Kaplan - - -

Simple GUI for FreeRDP

-

Code launched sdl-freerdp so it's gui can be used for confirming keys and other stuff if nessesary.

-

By default it launches FreeRDP only with /v /u /p tags. Aditional tags can be added in the settings json located in ~/.config/rdpconnect/settings.json in the extra_params array

-

Example settings.json which works with all my 2 multimonitor setups (one with 2 and one with 3 monitors): { + com.angoosh.RDPConnect + + RDP Connect +

Connect to remote desktop + + CC0-1.0 + Apache-2.0 + + + Antonin Kaplan + + + https://gitea.farmdash.org/angoosh/Flatpaks/raw/commit/f7dd9eba0ef64de37b82cde8f57781cda2ca7944/com.angoosh.RDPConnect/com.angoosh.RDPConnect.svg + + +

Simple GUI for FreeRDP

+

Code launched sdl-freerdp so it's gui can be used for confirming keys and other stuff if nessesary.

+

By default it launches FreeRDP only with /v /u /p tags. Aditional tags can be added in the settings json located in ~/.config/rdpconnect/settings.json in the extra_params array

+

Example settings.json which works with all my 2 multimonitor setups (one with 2 and one with 3 monitors): { "extra_params": [ "/monitors:1,0", "+dynamic-resolution" ], "save_conn": false -}

-
-com.angoosh.RDPConnect.desktop - - #deddda - #5e5c64 - - -https://gitea.farmdash.org/angoosh/Flatpaks/src/branch/main/com.angoosh.RDPConnect -https://gitea.farmdash.org/angoosh/Flatpaks/issues -https://gitea.farmdash.org/angoosh/Flatpaks/src/branch/main/com.angoosh.RDPConnect +} +

+
+ + com.angoosh.RDPConnect.desktop + + + #deddda + #5e5c64 + + + + + https://gitea.farmdash.org/angoosh/Flatpaks/src/branch/main/com.angoosh.RDPConnect + https://gitea.farmdash.org/angoosh/Flatpaks/issues + https://gitea.farmdash.org/angoosh/Flatpaks/src/branch/main/com.angoosh.RDPConnect + + + + https://gitea.farmdash.org/angoosh/Flatpaks/commits/branch/main + +

Initial release

+
+
+ + https://gitea.farmdash.org/angoosh/Flatpaks/commits/branch/main + +

Changed directory permissions from home to xdg-config

+
+
+
+ + + + https://gitea.farmdash.org/angoosh/Flatpaks/raw/commit/f6975cccb14ada36c4412738e98221fd94bccf8f/com.angoosh.RDPConnect/Screenshot0.png + + +
diff --git a/com.angoosh.RDPConnect/com.angoosh.RDPConnect.yml b/com.angoosh.RDPConnect/com.angoosh.RDPConnect.yml index eebb76e..0d22f0a 100644 --- a/com.angoosh.RDPConnect/com.angoosh.RDPConnect.yml +++ b/com.angoosh.RDPConnect/com.angoosh.RDPConnect.yml @@ -30,7 +30,7 @@ finish-args: - --share=network - --socket=pulseaudio - --socket=cups - - --filesystem=home + - --filesystem=xdg-config - --socket=pcsc # - --socket=system-bus # - --talk-name=org.freedesktop.Flatpak @@ -69,7 +69,7 @@ modules: build-args: - --share=network build-commands: - - pip3 install PyGObject + - pip3 install PyGObject cryptography - name: rdpconnect buildsystem: simple @@ -77,6 +77,7 @@ modules: - ls -l ./ - mkdir -p /app/share/icons/hicolor/scalable/apps/ - mkdir -p /app/share/applications/ + - mkdir -p /app/share/metainfo - install -Dm755 rdpconnect.sh /app/bin/rdpconnect - install -Dm755 main.py /app/ - install com.angoosh.RDPConnect.ui /app/ @@ -84,6 +85,7 @@ modules: - install style-light.css /app/ - install -Dm644 com.angoosh.RDPConnect.svg /app/share/icons/hicolor/scalable/apps/ - install -Dm644 com.angoosh.RDPConnect.desktop /app/share/applications/ + - install -Dm644 com.angoosh.RDPConnect.metainfo.xml /app/share/metainfo/ sources: - type: script dest-filename: rdpconnect.sh @@ -101,3 +103,5 @@ modules: path: com.angoosh.RDPConnect.svg - type: file path: com.angoosh.RDPConnect.desktop + - type: file + path: com.angoosh.RDPConnect.metainfo.xml \ No newline at end of file diff --git a/com.angoosh.RDPConnect/main.py b/com.angoosh.RDPConnect/main.py index eda8ff0..c273316 100755 --- a/com.angoosh.RDPConnect/main.py +++ b/com.angoosh.RDPConnect/main.py @@ -10,6 +10,7 @@ import os import gi import subprocess import json +from cryptography.fernet import Fernet gi.require_version('Gtk', '4.0') gi.require_version('Adw', '1') from gi.repository import Gtk, Adw, Gdk, Gio @@ -19,6 +20,22 @@ HOMEDIR = os.path.expanduser('~') conn_info = {} settings = {} +fernet = "" + +def load_keys(): + global fernet + cryptoKey = "" + try: + with open(HOMEDIR+"/.config/rdpconnect/.key", "r") as keyfile: + cryptoKey = str.encode(keyfile.readline()) + print("Encription key loaded") + except: + cryptoKey = Fernet.generate_key() + with open(HOMEDIR+"/.config/rdpconnect/.key", "w") as keyfile: + keyfile.write(cryptoKey.decode("utf-8")) + print("Encription key generated") + + fernet = Fernet(cryptoKey) def load_config(): global conn_info, settings @@ -29,6 +46,8 @@ def load_config(): loaded_json += line conn_info = json.loads(loaded_json) + + conn_info["passwd"] = fernet.decrypt(str.encode(conn_info["passwd"])).decode() except: print("[WARN] FILE: "+HOMEDIR+"/.config/rdpconnect/connection.json doesn't exist") @@ -84,10 +103,15 @@ class MyApp(Adw.Application): def saveConnConf(self): if settings["save_conn"]: + password = conn_info["passwd"] + conn_info["passwd"] = fernet.encrypt(password.encode()).decode("utf-8") + print("Saving connection config to "+HOMEDIR+"/.config/rdpconnect/connection.json") with open(HOMEDIR+"/.config/rdpconnect/connection.json", "w") as connection_file: js = json.dumps(conn_info, sort_keys=True, indent=4, separators=(',', ': ')) connection_file.write(js) + + conn_info["passwd"] = password else: with open(HOMEDIR+"/.config/rdpconnect/connection.json", "w") as connection_file: connection_file.write("") @@ -115,8 +139,8 @@ class MyApp(Adw.Application): if not os.path.isdir(HOMEDIR+"/.config/rdpconnect"): os.makedirs(HOMEDIR+"/.config/rdpconnect") -#subprocess.run(["ls", "-a", HOMEDIR]) +load_keys() load_config() app = MyApp(application_id=APPID) app.run(sys.argv) diff --git a/com.angoosh.RDPConnect/testkey b/com.angoosh.RDPConnect/testkey new file mode 100644 index 0000000..4f0bff8 --- /dev/null +++ b/com.angoosh.RDPConnect/testkey @@ -0,0 +1 @@ +U3YatkMZN1zNlxkD3P6PydSEGpift-ENdvYeSIYfMTI= \ No newline at end of file