···11+.devenv
22+33+# Added by cargo
44+55+/target
+67
README.md
···11+# FUK
22+33+> No one gives a fuk… so you need to take it yourself.
44+55+**F**etch **U**ser **K**eys - simple tool for fetching SSH keys from various
66+sources.
77+88+## Sources
99+1010+- [ ] Raw - no fetching, just raw key from the configuration
1111+- [ ] Forges
1212+ + [ ] GitHub
1313+ + [ ] SourceHut
1414+ + [ ] GitLab
1515+ + [ ] Forgejo
1616+ + [ ] Defining your own forges
1717+- [ ] Host keys via `ssh-keyscan`
1818+1919+## Reason
2020+2121+In my case the reason was to be able to easily prepare set of SSH keys for use
2222+with [agenix][], tool for managing secrets while working with Nix deployments.
2323+However usage can be extended to other situations as well:
2424+2525+- Managing `allowed_signers` to check SSH signatures under commits and stuff
2626+- Fetching `authorized_keys` to allow users to upload their keys without admin
2727+ manual intervention
2828+2929+## Usage
3030+3131+Define configuration file, for example `keys.toml` in form:
3232+3333+```toml
3434+[[entry]]
3535+name = "hauleth"
3636+emails = [ "~@hauleth.dev" ]
3737+keys = [
3838+ { sourcehut = "~hauleth" },
3939+ { github = "hauleth" }
4040+]
4141+4242+[[entry]]
4343+name = "heimdall"
4444+keys = [
4545+ { host = "heimdall" }
4646+]
4747+```
4848+4949+Now you can run
5050+5151+```sh
5252+fuk keys.toml > keys.json
5353+```
5454+5555+And get JSON document containing all keys provided by these:
5656+5757+```json
5858+{
5959+ "hauleth": [
6060+ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN7q0wm7C+EX0ORpRxeyhvWTT2BMPjSRQIZmbzPLIiHC"
6161+ ],
6262+ "heimdall": [
6363+ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC36MGQHLsmS1aUtRYyC40lguLR4/sRXDxwT8ieSkGgLFc95xQ/7m8tIYmtCTwIMvN9gzJkW6ufbWfuX1iBYoWVVO/QdJz/5/Nl4ZofyfdFSk4ZYaWSOnMlY7vV9K0L0WsEEf1R3Erf42Ek051PcO8IeTtYTxkaugrBOPSVmzBOZu9osnJbatCsODe7uIWRU8jd5gmL7a9pmk9Q8nWDDXzu4bWd9Dg1M1d+rIY368J4LNOzknPZUkOcK1TpLkutB6bozvaeKSBNaqihA0un1VETArhiUmUY6a0y5e34PNLQjbl5UqHS5tmU5jmolDIJV2hF78+XrgaZf+CNoQ1Ac3QJ",
6464+ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEZsoYDw74ez/2YLPZMDQgN/KxyGiXHZt+CowWMiyoyL"
6565+ ]
6666+}
6767+```