|
1 | | -Later todo |
2 | | - - [ ] Add checking if git dirty or not pushed |
3 | | - - [ ] Add some log statistics |
4 | | - - [ ] Add some firewall statistics |
5 | | - - [ ] Add updates |
6 | | - - [ ] Add changelog (linux) |
7 | | - - [ ] Add news, linux, hackernews? |
8 | | - - [ ] Add website status check |
9 | | - - [ ] Add google analytics check |
10 | | - - [ ] But also constant ingress and event push (tetsuya) |
11 | | - - [ ] Add something that checks on any request |
12 | | - - [ ] Check itself |
13 | | - |
14 | | - |
15 | | -# Get it up on systemd |
| 1 | +# tetsuya |
16 | 2 |
|
17 | | -``` |
| 3 | +tetsuya collects information and offers it up as JSON packets and pretty |
| 4 | +print strings. |
| 5 | + |
| 6 | +It's *very* easy to extend: |
| 7 | + |
| 8 | +- Write a function (a *service*) that collects information from web/system. |
| 9 | + - It takes a `dataclass` as a *config* object (can be empty). |
| 10 | + - It returns another `dataclass` as a *report*. |
| 11 | + |
| 12 | +tetsuya offers the *report* object to your user (and your user only) as a JSON |
| 13 | +endpoint available via REST and command-line interface. |
| 14 | + |
| 15 | +You will also define two functions on your *report* dataclass: `short()` and |
| 16 | +`long()` which can pretty-print the JSON. |
| 17 | + |
| 18 | +It does some helpful stuff automatically: |
| 19 | + |
| 20 | +1. tetsuya can cache your new *service* for you and auto-refresh the cache: all |
| 21 | + tetsuya service configs have a cachelife integer and autorefresh boolean. |
| 22 | + |
| 23 | +2. tetsuya will derive the default config from your `dataclass`, but will read a |
| 24 | + .toml if you want to change it. |
| 25 | + |
| 26 | +3. tetsuya runs in a client-server model, with a background daemon doing the |
| 27 | + work, and a CLI interface for basic control. |
| 28 | + |
| 29 | +Try `uvx tetsuya --help-tree=ascii` to see the whole interface. |
| 30 | + |
| 31 | +## Installation |
| 32 | + |
| 33 | +### Daemon on systemd |
| 34 | + |
| 35 | +Theres a *tetsuya.service* file in the repository. |
| 36 | + |
| 37 | +```bash |
18 | 38 | mkdir -p ~/.config/systemd/user |
19 | 39 |
|
20 | 40 | systemctl --user daemon-reload |
21 | | -systemctl --user enable --now "$(realpath tetsuya.service)" |
| 41 | +systemctl --user enable --now "$(realpath ./tetsuya.service)" |
22 | 42 |
|
23 | | -loginctl enable-linger "$USER" # (allow it to start at boot) |
| 43 | +loginctl enable-linger "$USER" # (allow it to start at boot even if logged out) |
24 | 44 |
|
25 | 45 | journalctl --user -u tetsuya -f |
26 | 46 | ``` |
| 47 | + |
| 48 | +## Roadmap |
| 49 | + |
| 50 | +- [ ] Some early modules: |
| 51 | + - [ ] Do a Basic 200 is it good thing |
| 52 | + - [ ] Check domains for email record |
| 53 | + - [ ] Check SLL |
| 54 | + - [ ] Active sessions on linux |
| 55 | + - [ ] Updates available |
| 56 | + - [ ] Changelog on kernel |
| 57 | + |
| 58 | + ```bash |
| 59 | + if which yay 1> /dev/null; then |
| 60 | + ( |
| 61 | + set -e |
| 62 | + yay -Qu |
| 63 | + yay -Pw |
| 64 | + checkupdates |
| 65 | + ) |
| 66 | + fi |
| 67 | + ``` |
| 68 | + |
| 69 | +- [ ] Any errors on systemd + --kernel |
| 70 | +- [ ] Monarch Money from that guy? - MoneyFlown and redeploy |
| 71 | +- [ ] Improve naming and arguments, flags, etc. |
| 72 | + - [ ] -> Services to Client |
| 73 | + - [ ] Names of services = arguments |
| 74 | + - [ ] Add help descriptions |
| 75 | + - [ ] Turn off options like --thing, --no-thing, if --no-thing is default? |
| 76 | + - [ ] Go back to CLI and do the formatting better |
| 77 | +- [ ] Document throughout code |
| 78 | +- [ ] If we want to instantiate multiple instances of one service class: |
| 79 | +- [ ] Inspect: |
| 80 | + - [ ] all instances of get_name() |
| 81 | + - [ ] how services are registered |
| 82 | + - [ ] Consider Dictionary Storage and Access Here: |
| 83 | + - [ ] `_config.config_data` |
| 84 | + - [ ] `_timer.timer_tasks` |
| 85 | + - [ ] `service manager.??` (Not written at this time) |
| 86 | + - [ ] Will have to pass both service obj + class to _config, _timer |
| 87 | + - [ ] Make room for customed name in config + `.get_name()` |
| 88 | + - [ ] Start will have change (calls a lot of this stuff) |
| 89 | +- [ ] Don't enable service until it has a config |
| 90 | + - [ ] Allow per app config default generation |
| 91 | + - [ ] Upon reload, recalculate active services |
| 92 | + - [ ] Config API: |
| 93 | + - [ ] Separate Touch and Dump |
| 94 | +- [ ] Create persistence: |
| 95 | + - [ ] Roundtrip reports upon registering (json and back) |
| 96 | + - [ ] Save reports upon running |
| 97 | + - [ ] Load reports upong starting |
| 98 | +- [ ] Services can subscribe to changes of other services |
| 99 | +- [ ] Importing modules dynamically from a subfoler |
| 100 | +
|
| 101 | +### Desired Modules |
| 102 | +
|
| 103 | +- [ ] Google drive auditor, google accounts/emails |
| 104 | +- [ ] Check agreements (modules subscribed to other modules) |
| 105 | + - [ ] are we checking all domains that namecheap lists |
| 106 | + - [ ] does google list all |
| 107 | +- [ ] Analytics summary + link |
| 108 | +
|
| 109 | +- [ ] Git status |
| 110 | +- [ ] Scrape forum posts |
| 111 | +- [ ] Firewall stats |
| 112 | +- [ ] process accounting? |
0 commit comments