From 23199f5526db9be1d43a900dc8b8674a7babb966 Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 5 Dec 2026 22:09:29 +0100 Subject: WIP Somewhat blocked by https://bugzilla.redhat.com/show_bug.cgi?id=2521543 --- scripts/.gitignore | 1 + scripts/p7s/bitwarden.py | 8 ++++++++ scripts/p7s/ssh.py | 7 +++++++ scripts/p7s/ubpkg.py | 3 +++ scripts/pyproject.toml | 1 + 5 files changed, 20 insertions(+) create mode 100644 scripts/p7s/ssh.py (limited to 'scripts') diff --git a/scripts/.gitignore b/scripts/.gitignore index bee8a64b..76e51dbb 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore @@ -1 +1,2 @@ __pycache__ +p7s.egg-info diff --git a/scripts/p7s/bitwarden.py b/scripts/p7s/bitwarden.py index ab6cc4f2..6d17d3b1 100644 --- a/scripts/p7s/bitwarden.py +++ b/scripts/p7s/bitwarden.py @@ -40,3 +40,11 @@ def get_item(server, email, uuid): with b.login(server, email): b.sync() return b.get_item(uuid) + + +@contextlib.contextmanager +def default(): + b = Bitwarden() + with b.login("https://vaultwarden.pdp7.net", "alex@corcoles.net"): + b.sync() + yield b diff --git a/scripts/p7s/ssh.py b/scripts/p7s/ssh.py new file mode 100644 index 00000000..aac25d8e --- /dev/null +++ b/scripts/p7s/ssh.py @@ -0,0 +1,7 @@ +from p7s import bitwarden + + +def setup_ssh(): + with bitwarden.default() as b: + pass + diff --git a/scripts/p7s/ubpkg.py b/scripts/p7s/ubpkg.py index 3a333254..0784ea71 100644 --- a/scripts/p7s/ubpkg.py +++ b/scripts/p7s/ubpkg.py @@ -1,6 +1,7 @@ import os import pathlib import platform +import subprocess import urllib.request @@ -9,3 +10,5 @@ def setup_ubpkg(): with urllib.request.urlopen(f"https://github.com/alexpdp7/ubpkg/releases/latest/download/ubpkg-linux-{platform.machine()}") as urlopen: ubpkg.write_bytes(urlopen.read()) os.chmod(ubpkg, 0o700) + + subprocess.run([ubpkg, "bitwarden-cli", "deltachat-rpc-server", "hatch", "kubectl", "nix-portable", "ressh", "talosctl", "typst"], check=True) diff --git a/scripts/pyproject.toml b/scripts/pyproject.toml index 36bf52c2..291176ca 100644 --- a/scripts/pyproject.toml +++ b/scripts/pyproject.toml @@ -14,6 +14,7 @@ setup-imapfilter = 'p7s.mail:setup_imapfilter' setup-soju = 'p7s.soju:setup_soju' setup-ubpkg = 'p7s.ubpkg:setup_ubpkg' setup-x12 = 'p7s.x12:setup_x12' +setup-ssh = 'p7s.ssh:setup_ssh' senpai = 'p7s.senpai:main' ledger = 'p7s.ledger:main' google-meet-toggle-mute = 'p7s.google_meet:toggle_mute' -- cgit v1.2.3