added password encryption and metainfo file so we are 100% gnome-software compatible
This commit is contained in:
Binary file not shown.
@@ -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
|
||||
|
||||
@@ -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
|
||||
Exec=rdpconnect
|
||||
Terminal=false
|
||||
@@ -2,13 +2,19 @@
|
||||
<!-- Copyright 2024 Antonin Kaplan -->
|
||||
<component type="desktop-application">
|
||||
<id>com.angoosh.RDPConnect</id>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>Apache-2.0 AND Beerware</project_license>
|
||||
|
||||
<name>RDP Connect</name>
|
||||
<summary>Connect to remote desktop</summary>
|
||||
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>Apache-2.0</project_license>
|
||||
|
||||
<developer id="com.angoosh">
|
||||
<name>Antonin Kaplan</name>
|
||||
</developer>
|
||||
|
||||
<icon type="remote">https://gitea.farmdash.org/angoosh/Flatpaks/raw/commit/f7dd9eba0ef64de37b82cde8f57781cda2ca7944/com.angoosh.RDPConnect/com.angoosh.RDPConnect.svg</icon>
|
||||
|
||||
<description>
|
||||
<p>Simple GUI for FreeRDP</p>
|
||||
<p>Code launched sdl-freerdp so it's gui can be used for confirming keys and other stuff if nessesary.</p>
|
||||
@@ -19,16 +25,43 @@
|
||||
"+dynamic-resolution"
|
||||
],
|
||||
"save_conn": false
|
||||
} </code></p>
|
||||
}
|
||||
</code></p>
|
||||
</description>
|
||||
|
||||
<launchable type="desktop-id">com.angoosh.RDPConnect.desktop</launchable>
|
||||
|
||||
<branding>
|
||||
<color type="primary" scheme_preference="light">#deddda</color>
|
||||
<color type="primary" scheme_preference="dark">#5e5c64</color>
|
||||
</branding>
|
||||
|
||||
<content_rating type="oars-1.1" />
|
||||
|
||||
<url type="homepage">https://gitea.farmdash.org/angoosh/Flatpaks/src/branch/main/com.angoosh.RDPConnect</url>
|
||||
<url type="bugtracker">https://gitea.farmdash.org/angoosh/Flatpaks/issues</url>
|
||||
<url type="vcs-browser">https://gitea.farmdash.org/angoosh/Flatpaks/src/branch/main/com.angoosh.RDPConnect</url>
|
||||
|
||||
<releases>
|
||||
<release version="1.0.0" date="2024-11-19">
|
||||
<url type="details">https://gitea.farmdash.org/angoosh/Flatpaks/commits/branch/main</url>
|
||||
<description>
|
||||
<p>Initial release</p>
|
||||
</description>
|
||||
</release>
|
||||
<release version="1.0.1" date="2024-11-20">
|
||||
<url type="details">https://gitea.farmdash.org/angoosh/Flatpaks/commits/branch/main</url>
|
||||
<description>
|
||||
<p>Changed directory permissions from home to xdg-config</p>
|
||||
</description>
|
||||
</release>
|
||||
</releases>
|
||||
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://gitea.farmdash.org/angoosh/Flatpaks/raw/commit/f6975cccb14ada36c4412738e98221fd94bccf8f/com.angoosh.RDPConnect/Screenshot0.png</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
</component>
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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)
|
||||
|
||||
1
com.angoosh.RDPConnect/testkey
Normal file
1
com.angoosh.RDPConnect/testkey
Normal file
@@ -0,0 +1 @@
|
||||
U3YatkMZN1zNlxkD3P6PydSEGpift-ENdvYeSIYfMTI=
|
||||
Reference in New Issue
Block a user