Add endpoint-aware token management commands
This commit is contained in:
+170
-4
@@ -1,5 +1,13 @@
|
||||
# RV Launcher CLI
|
||||
|
||||
## Authors
|
||||
|
||||
Mateusz Pabiszczak, 2026
|
||||
|
||||
## Status
|
||||
|
||||
Draft
|
||||
|
||||
Plik opisuje przelaczniki i liste komend skryptu `workspace.py`.
|
||||
|
||||
## Pobranie repo i przelaczenie galezi
|
||||
@@ -55,10 +63,19 @@ Minimalny format pliku:
|
||||
|
||||
```json
|
||||
{
|
||||
"users": {
|
||||
"u1": {
|
||||
"tokens": {
|
||||
"t1": "TU_WSTAW_TOKEN"
|
||||
"version": 2,
|
||||
"servers": {
|
||||
"http://77.90.8.171:3001": {
|
||||
"type": "gitea",
|
||||
"scheme": "http",
|
||||
"host": "77.90.8.171",
|
||||
"port": 3001,
|
||||
"users": {
|
||||
"u1": {
|
||||
"tokens": {
|
||||
"t1": "TU_WSTAW_TOKEN"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -133,6 +150,11 @@ Komendy:
|
||||
- `show-config`
|
||||
- `list-series`
|
||||
- `list-cards [series]`
|
||||
- `tokens scan`
|
||||
- `tokens read`
|
||||
- `tokens stats`
|
||||
- `tokens write`
|
||||
- `tokens update`
|
||||
- `submission [series] [card]`
|
||||
- `tmux-container [series] [card]`
|
||||
|
||||
@@ -211,6 +233,150 @@ python3 workspace.py list-cards
|
||||
python3 workspace.py list-cards inf
|
||||
```
|
||||
|
||||
## `tokens scan`
|
||||
|
||||
Skanuje remote URL-e w repo i zapisuje znalezione dane do `tokens/tokens.json`.
|
||||
|
||||
Przelaczniki:
|
||||
|
||||
- `--repo PATH`
|
||||
Sciezka wewnatrz docelowego repo. Domyslnie biezacy katalog.
|
||||
|
||||
Typowy wynik:
|
||||
|
||||
```text
|
||||
repo_root<TAB>...
|
||||
scanned<TAB>1
|
||||
added<TAB>1
|
||||
servers<TAB>1
|
||||
token_path<TAB>...
|
||||
```
|
||||
|
||||
Przyklad:
|
||||
|
||||
```bash
|
||||
python3 workspace.py tokens scan
|
||||
python3 workspace.py tokens scan --repo ~/dev/workspace/rv/series/inf/03
|
||||
```
|
||||
|
||||
## `tokens read`
|
||||
|
||||
Pokazuje zawartosc `tokens/tokens.json` w podziale na endpointy serwerow.
|
||||
|
||||
Przelaczniki:
|
||||
|
||||
- `--server ENDPOINT`
|
||||
Ogranicza wynik do jednego endpointu.
|
||||
- `--show-secrets`
|
||||
Pokazuje pelne wartosci tokenow zamiast maskowania.
|
||||
|
||||
Typowy wynik:
|
||||
|
||||
```text
|
||||
token_path<TAB>...
|
||||
endpoint<TAB>http://77.90.8.171:3001
|
||||
type<TAB>gitea
|
||||
scheme<TAB>http
|
||||
host<TAB>77.90.8.171
|
||||
port<TAB>3001
|
||||
users<TAB>1
|
||||
tokens<TAB>1
|
||||
user<TAB>u1
|
||||
token<TAB>t1<TAB>SE****23
|
||||
```
|
||||
|
||||
Przyklad:
|
||||
|
||||
```bash
|
||||
python3 workspace.py tokens read
|
||||
python3 workspace.py tokens read --server http://77.90.8.171:3001
|
||||
```
|
||||
|
||||
## `tokens stats`
|
||||
|
||||
Pokazuje statystyki tokenow per endpoint serwera.
|
||||
|
||||
Przelaczniki:
|
||||
|
||||
- `--server ENDPOINT`
|
||||
Ogranicza wynik do jednego endpointu.
|
||||
|
||||
Typowy wynik:
|
||||
|
||||
```text
|
||||
endpoint<TAB>type<TAB>scheme<TAB>host<TAB>port<TAB>users<TAB>tokens
|
||||
http://77.90.8.171:3001<TAB>gitea<TAB>http<TAB>77.90.8.171<TAB>3001<TAB>1<TAB>1
|
||||
```
|
||||
|
||||
Przyklad:
|
||||
|
||||
```bash
|
||||
python3 workspace.py tokens stats
|
||||
```
|
||||
|
||||
## `tokens write`
|
||||
|
||||
Wpisuje dane z `tokens/tokens.json` do wybranego remota repo.
|
||||
|
||||
Przelaczniki:
|
||||
|
||||
- `--repo PATH`
|
||||
Sciezka wewnatrz docelowego repo. Domyslnie biezacy katalog.
|
||||
- `--remote NAME`
|
||||
Nazwa remota do aktualizacji lub utworzenia.
|
||||
- `--url URL`
|
||||
URL remota, jesli remote jeszcze nie istnieje.
|
||||
- `--server ENDPOINT`
|
||||
Endpoint serwera z `tokens.json`.
|
||||
- `--user NAME`
|
||||
Uzytkownik z wybranego endpointu.
|
||||
- `--token-name NAME`
|
||||
Nazwa tokena, na przyklad `t1`.
|
||||
- `--replace`
|
||||
Nadpisuje inne dane auth juz wpisane w remote URL.
|
||||
- `--dry-run`
|
||||
Pokazuje plan bez zapisu.
|
||||
|
||||
Przyklad:
|
||||
|
||||
```bash
|
||||
python3 workspace.py tokens write --repo ~/dev/workspace/rv/series/inf/03 --remote r1 --server http://77.90.8.171:3001 --user u1 --token-name t1
|
||||
```
|
||||
|
||||
## `tokens update`
|
||||
|
||||
Uruchamia synchronizacje w zadanym kierunku.
|
||||
|
||||
Przelaczniki:
|
||||
|
||||
- `--from remotes`
|
||||
Skanuje remote URL-e i zapisuje wynik do `tokens.json`.
|
||||
- `--from store`
|
||||
Bierze dane z `tokens.json` i wpisuje je do remota repo.
|
||||
- `--repo PATH`
|
||||
Sciezka wewnatrz repo.
|
||||
- `--remote NAME`
|
||||
Wymagane dla `--from store`.
|
||||
- `--url URL`
|
||||
Opcjonalny URL dla `--from store`.
|
||||
- `--server ENDPOINT`
|
||||
Opcjonalny wybor endpointu dla `--from store`.
|
||||
- `--user NAME`
|
||||
Opcjonalny wybor usera dla `--from store`.
|
||||
- `--token-name NAME`
|
||||
Opcjonalny wybor tokena dla `--from store`.
|
||||
- `--replace`
|
||||
Nadpisuje inne auth przy `--from store`.
|
||||
- `--dry-run`
|
||||
Pokazuje plan bez zapisu przy `--from store`.
|
||||
|
||||
Przyklady:
|
||||
|
||||
```bash
|
||||
python3 workspace.py tokens update --from remotes --repo ~/dev/workspace/rv/series/inf/03
|
||||
python3 workspace.py tokens update --from store --repo ~/dev/workspace/rv/series/inf/03 --remote r1 --server http://77.90.8.171:3001 --user u1 --token-name t1
|
||||
```
|
||||
|
||||
## `submission [series] [card]`
|
||||
|
||||
Wylicza flow oddawania rozwiazan:
|
||||
|
||||
Reference in New Issue
Block a user