Skip to content

Commit 924e77e

Browse files
committed
fix: update SHA256 checksum for saxion-eduroam.py and clean up code formatting
1 parent 9ca89ee commit 924e77e

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

content/docs/networking/eduroam-network-installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ A Python script automates the full `nmcli` connection setup for Saxion:
5959
curl -LO https://zephyrus-linux.stensel.nl/scripts/saxion-eduroam.py
6060

6161
# 2. Verify checksum
62-
echo "bb8c45e801fbd37bc7d8c12104ad3c525bc664571598344b90c5da0437631cf8 saxion-eduroam.py" | sha256sum -c
62+
echo "827f34d1454fa4d5ac3e297bacc65f6a1fd4828c92c94a41142de2a560d7e003 saxion-eduroam.py" | sha256sum -c
6363

6464
# 3. Run
6565
python3 saxion-eduroam.py
6666
```
6767

68-
**SHA256:** `bb8c45e801fbd37bc7d8c12104ad3c525bc664571598344b90c5da0437631cf8`
68+
**SHA256:** `827f34d1454fa4d5ac3e297bacc65f6a1fd4828c92c94a41142de2a560d7e003`
6969

7070
The script removes any existing eduroam profile, prompts for your **username** via a GUI dialog (zenity, kdialog, or yad) or terminal fallback, and activates the connection. Your password is never asked by the script; it is requested by your GNOME Keyring at connection time and stored securely, never in plaintext.
7171

content/docs/networking/eduroam-network-installation.nl.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ Een Python-script automatiseert de volledige `nmcli`-verbindingsconfiguratie voo
5959
curl -LO https://zephyrus-linux.stensel.nl/scripts/saxion-eduroam.py
6060

6161
# 2. Controleer de checksum
62-
echo "bb8c45e801fbd37bc7d8c12104ad3c525bc664571598344b90c5da0437631cf8 saxion-eduroam.py" | sha256sum -c
62+
echo "827f34d1454fa4d5ac3e297bacc65f6a1fd4828c92c94a41142de2a560d7e003 saxion-eduroam.py" | sha256sum -c
6363

6464
# 3. Uitvoeren
6565
python3 saxion-eduroam.py
6666
```
6767

68-
**SHA256:** `bb8c45e801fbd37bc7d8c12104ad3c525bc664571598344b90c5da0437631cf8`
68+
**SHA256:** `827f34d1454fa4d5ac3e297bacc65f6a1fd4828c92c94a41142de2a560d7e003`
6969

7070
Het script verwijdert een eventueel bestaand eduroam-profiel, vraagt je **gebruikersnaam** via een GUI-dialoog (zenity, kdialog of yad) of terminal-fallback, en activeert de verbinding. Je wachtwoord wordt nooit door het script gevraagd; dat wordt bij het verbinden opgevraagd door je GNOME Keyring en veilig opgeslagen, nooit in platte tekst.
7171

static/scripts/saxion-eduroam.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"Click OK to continue."
4040
)
4141

42+
4243
class Installer:
4344

4445
def __init__(self, silent: bool = False, username: str = ""):
@@ -50,7 +51,7 @@ def _detect_gui(self) -> str | None:
5051
"""Detects available GUI tools (zenity, kdialog, yad)."""
5152
if not os.environ.get("DISPLAY") and not os.environ.get("WAYLAND_DISPLAY"):
5253
return None
53-
54+
5455
for tool in ["zenity", "kdialog", "yad"]:
5556
if shutil.which(tool):
5657
return tool
@@ -107,7 +108,7 @@ def show_message(self, text: str, is_error: bool = False):
107108
cmd = ["kdialog", type_flag, text, f"--title={TITLE}"]
108109
elif self.gui_tool == "yad":
109110
image = "dialog-error" if is_error else "dialog-information"
110-
cmd = ["yad", f"--image={image}", "--button=OK", "--width=500",
111+
cmd = ["yad", f"--image={image}", "--button=OK", "--width=500",
111112
f"--title={TITLE}", f"--text={text}"]
112113

113114
subprocess.run(cmd, stderr=subprocess.DEVNULL)
@@ -132,7 +133,7 @@ def prompt_input(self, prompt: str, is_password: bool = False) -> str | None:
132133
res = subprocess.run(cmd, capture_output=True, text=True)
133134
if res.returncode != 0:
134135
return None
135-
136+
136137
val = res.stdout.strip()
137138
# Yad sometimes adds a trailing separator
138139
if self.gui_tool == "yad" and val.endswith("|"):
@@ -188,7 +189,10 @@ def run_nmcli(self, cmd: list[str]) -> bool:
188189
# Fatal error: show a static message to the GUI to avoid passing
189190
# nmcli output (which may echo user input) into a subprocess argument
190191
# (CWE-78 / CodeQL py/command-line-injection).
191-
self.show_message("NetworkManager failed to configure the connection.\nSee terminal output for details.", True)
192+
self.show_message(
193+
"NetworkManager failed to configure the connection.\n"
194+
"See terminal output for details.", True
195+
)
192196
sys.exit(1)
193197
return True
194198

@@ -201,9 +205,9 @@ def install(self):
201205
sys.exit(1)
202206

203207
self.get_credentials()
204-
208+
205209
ca_path = self.find_system_ca_bundle()
206-
210+
207211
# 1. Remove any existing eduroam connection
208212
subprocess.run(
209213
["nmcli", "connection", "delete", CON_NAME],
@@ -262,6 +266,7 @@ def install(self):
262266
print("[ERROR] Could not activate eduroam connection:")
263267
print(res.stderr.strip() or res.stdout.strip())
264268

269+
265270
def main():
266271

267272
parser = argparse.ArgumentParser(description="Saxion eduroam Installer")
@@ -282,5 +287,6 @@ def main():
282287
installer = Installer(args.silent, initial_username)
283288
installer.install()
284289

290+
285291
if __name__ == "__main__":
286292
main()

0 commit comments

Comments
 (0)