new workflow

Signed-off-by: Hadi <[email protected]>
This commit is contained in:
Hadi
2026-08-27 10:26:01 +02:00
parent ffeeea8021
commit bd3c05f82d
5 changed files with 164 additions and 17 deletions
+3
View File
@@ -0,0 +1,3 @@
if [ -d .git ]; then
git pull --ff-only 2>/dev/null || true
fi
+18 -9
View File
@@ -23,18 +23,27 @@ jobs:
- name: Update packages - name: Update packages
run: | run: |
python_pkgs=(toutatis ignorant ghunt user-scanner) for pkg_dir in pkgs/*/; do
go_pkgs=(github-recon gravatar-recon spilltea usbguard-tui jwt-tui settuings fztea) pkg="$(basename "$pkg_dir")"
default_nix="${pkg_dir}default.nix"
[ -f "$default_nix" ] || continue
for pkg in "${python_pkgs[@]}"; do if grep -qE 'buildGoModule|buildGo[0-9]+Module' "$default_nix"; then
echo "==> $pkg" echo "==> $pkg (go)"
nix run nixpkgs#nix-update -- --flake "$pkg" || true nix run nixpkgs#nix-update -- --flake --build "$pkg" || true
elif grep -qE 'buildPythonApplication|buildPythonPackage' "$default_nix"; then
echo "==> $pkg (python)"
nix run nixpkgs#nix-update -- --flake "$pkg" || true
fi
done done
for pkg in "${go_pkgs[@]}"; do - name: Update README package list
echo "==> $pkg" run: python3 scripts/update-readme.py
nix run nixpkgs#nix-update -- --flake --build "$pkg" || true env:
done GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Clean build results
run: rm -rf result result-*
- uses: peter-evans/create-pull-request@v7 - uses: peter-evans/create-pull-request@v7
with: with:
+2 -1
View File
@@ -1,2 +1,3 @@
.claude/ .claude/
result/ result
result-*
+14 -7
View File
@@ -12,13 +12,20 @@
## Packages ## Packages
| Package | Description | Source | <!-- Generated by scripts/update-readme.py — do not edit by hand. -->
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | <!-- PACKAGES:START -->
| `github-recon` | Retrieves and aggregates public OSINT data about a GitHub user using Go and the GitHub API. Finds hidden emails in commit history, previous usernames, friends, other GitHub accounts, and more. | [anotherhadi/github-recon](https://github.com/anotherhadi/github-recon) | | Package | Description | Source | Updated |
| `gravatar-recon` | Retrieve and aggregate public OSINT data from Gravatar. Given an email address, the tool queries the Gravatar API and extracts useful information such as profile metadata, avatar, social accounts, and contact info. | [anotherhadi/gravatar-recon](https://github.com/anotherhadi/gravatar-recon) | | --- | --- | --- | --- |
| `toutatis` | Toutatis is a tool that allows you to extract information from instagrams accounts such as e-mails, phone numbers and more. | [megadose/toutatis](https://github.com/megadose/toutatis) | | `fztea` | Remote control your flipper from the local terminal or over SSH | [jon4hz/fztea](https://github.com/jon4hz/fztea) | 2024-09-01 |
| `ignorant` | ignorant allows you to check if a phone number is used on different sites like snapchat, instagram. | [megadose/ignorant](https://github.com/megadose/ignorant) | | `github-recon` | Retrieves and aggregates public OSINT data about a GitHub user using Go and the GitHub API. Finds hidden emails in commit history, previous usernames, friends, other GitHub accounts, and more. | [anotherhadi/github-recon](https://github.com/anotherhadi/github-recon) | 2025-09-22 |
| `user-scanner` | Emaill and Username OSINT tool that analyzes username and email presence across multiple platforms, intended for security research, investigations, legitimate analysis. | [kaifcodec/user-scanner](https://github.com/kaifcodec/user-scanner) | | `gravatar-recon` | Retrieve and aggregate public OSINT data from Gravatar. Given an email address, the tool queries the Gravatar API and extracts useful information such as profile metadata, avatar, social accounts, and contact info. | [anotherhadi/gravatar-recon](https://github.com/anotherhadi/gravatar-recon) | 2025-09-25 |
| `jwt-tui` | A TUI for inspecting, editing, and signing JSON Web Tokens (JWTs). | [anotherhadi/jwt-tui](https://github.com/anotherhadi/jwt-tui) | 2026-05-26 |
| `monitui` | Delightfully minimal TUI for wrangling Hyprland monitors | [nathaniel-fargo/monitui](https://github.com/nathaniel-fargo/monitui) | 2026-03-14 |
| `revshell` | CLI reverse shell generator | [Gubarz/revshell](https://github.com/Gubarz/revshell) | 2026-04-12 |
| `settuings` | A TUI to manage your Linux system settings like wifi, bluetooth, and more, without leaving the terminal. | [anotherhadi/settuings](https://github.com/anotherhadi/settuings) | 2026-08-13 |
| `spilltea` | A minimal, terminal-based HTTP(S) proxy for pentesters and CTF players. | [anotherhadi/spilltea](https://github.com/anotherhadi/spilltea) | 2026-05-30 |
| `usbguard-tui` | A terminal UI for managing USB devices via usbguard. | [anotherhadi/usbguard-tui](https://github.com/anotherhadi/usbguard-tui) | 2026-08-23 |
<!-- PACKAGES:END -->
More tools coming soon. More tools coming soon.
+127
View File
@@ -0,0 +1,127 @@
#!/usr/bin/env python3
"""Regenerate the package table in README.md from the flake's own outputs.
No package names are hardcoded here: every package exposed by
`packages.<system>` (except the `default` alias) gets a row, built from its
`meta.description` / `meta.homepage`, plus the upstream commit date for the
pinned `rev` (fetched from the GitHub API), so the table shows how fresh
each pinned version actually is.
"""
import json
import os
import pathlib
import re
import subprocess
import sys
import urllib.error
import urllib.request
ROOT = pathlib.Path(__file__).resolve().parent.parent
PKGS_DIR = ROOT / "pkgs"
README = ROOT / "README.md"
START = "<!-- PACKAGES:START -->"
END = "<!-- PACKAGES:END -->"
def current_system() -> str:
return subprocess.run(
["nix", "eval", "--raw", "--impure", "--expr", "builtins.currentSystem"],
check=True, capture_output=True, text=True,
).stdout.strip()
def package_metadata(system: str) -> dict:
expr = (
"pkgs: builtins.mapAttrs (name: pkg: {"
' description = pkg.meta.description or "";'
' homepage = pkg.meta.homepage or "";'
"}) (builtins.removeAttrs pkgs [\"default\"])"
)
out = subprocess.run(
["nix", "eval", "--json", f".#packages.{system}", "--apply", expr],
check=True, capture_output=True, text=True, cwd=ROOT,
).stdout
return json.loads(out)
def pinned_rev(name: str) -> str | None:
"""Extract the literal `rev` pinned in pkgs/<name>/default.nix, resolving
a `${version}` interpolation if present."""
default_nix = PKGS_DIR / name / "default.nix"
if not default_nix.is_file():
return None
content = default_nix.read_text()
rev_match = re.search(r'\brev\s*=\s*"([^"]+)"', content)
if not rev_match:
return None
rev = rev_match.group(1)
if "${version}" in rev:
version_match = re.search(r'\bversion\s*=\s*"([^"]+)"', content)
if not version_match:
return None
rev = rev.replace("${version}", version_match.group(1))
return rev
def upstream_commit_date(homepage: str, rev: str) -> str | None:
match = re.match(r"https://github\.com/([^/]+)/([^/]+)/?$", homepage)
if not match:
return None
owner, repo = match.groups()
url = f"https://api.github.com/repos/{owner}/{repo}/commits/{rev}"
req = urllib.request.Request(url, headers={"User-Agent": "nur-packages-readme-bot"})
token = os.environ.get("GITHUB_TOKEN") or os.environ.get("GH_TOKEN")
if token:
req.add_header("Authorization", f"Bearer {token}")
try:
with urllib.request.urlopen(req, timeout=15) as resp:
data = json.load(resp)
except (urllib.error.URLError, urllib.error.HTTPError) as exc:
print(f"warning: could not fetch commit date for {owner}/{repo}@{rev}: {exc}", file=sys.stderr)
return None
date = data.get("commit", {}).get("committer", {}).get("date")
return date.split("T")[0] if date else None
def render_table(meta: dict) -> str:
lines = [
"| Package | Description | Source | Updated |",
"| --- | --- | --- | --- |",
]
for name in sorted(meta):
info = meta[name]
description = info["description"].strip()
homepage = info["homepage"]
label = homepage.removeprefix("https://github.com/") if homepage else homepage
source = f"[{label}]({homepage})" if homepage else ""
updated = ""
rev = pinned_rev(name)
if homepage and rev:
updated = upstream_commit_date(homepage, rev) or ""
lines.append(f"| `{name}` | {description} | {source} | {updated} |")
return "\n".join(lines)
def main() -> None:
system = current_system()
meta = package_metadata(system)
table = render_table(meta)
content = README.read_text()
pattern = re.compile(re.escape(START) + r".*" + re.escape(END), re.S)
if not pattern.search(content):
raise SystemExit(f"README.md is missing {START}/{END} markers")
README.write_text(pattern.sub(f"{START}\n{table}\n{END}", content))
if __name__ == "__main__":
main()