r/o
1
# nóssa
2
3
Phoenix/LiveView app hosting the [website][nossa] you're looking at.
4
5
I wanted to host my software on my own turf, in my own way. This is the
6
result. I'm hoping to add some nice interop to make collaboration easier;
7
particularly things like [ForgeFed] and [Friendly Forge Format (F3)][f3].
8
9
[nossa]: https://nossa.ee
10
[ForgeFed]: https://forgefed.org/
11
[f3]: https://f3.forgefriends.org/
12
13
14
## recursos / features
15
16
In most cases the answer to your question is "why not?".
17
18
* [git2-rs]-based repository access for web views.
19
* [git-http-backend] interface supporting smart transport/v2.
20
* LiveView frontend, with full support for non-JavaScript clients.
21
* Extensive test coverage.
22
* Comprehensive support for non-UTF-8 branch names, commit messages, filenames.
23
* Localised, with English and LATAM Spanish to start.
24
25
See [`TAREAS.md`](TAREAS.md) for a list of things yet to be done!
26
27
[git2-rs]: https://github.com/rust-lang/git2-rs
28
[git-http-backend]: https://git-scm.com/docs/git-http-backend
29
30
31
## desenvolvimento / development
32
33
The development and build process assumes you are able to use Nix flakes[^flakes].
34
35
Use `nix develop` to enter a dev shell. The first time you're getting set up
36
you'll want to do a `mix deps.get`; we use Mix normally in dev, and then use
37
[deps_nix] to make them reproducible for production builds.
38
39
Then:
40
41
* `make pg` --- starts Postgres with a database stored in `./db`.
42
* `make server` --- runs the Phoenix server in IEx.
43
* `make testwatch` --- runs `mix test` every time a relevant file changes.
44
* `make coverwatch` --- runs `mix test --cover` every time a relevant file changes.
45
46
The last two also can take `ARGS=...`.
47
48
[^flakes]: I am so sorry but I can't find a single good link that would actually
49
just take you through using them. It's true what they say about Nix people.
50
Try the [Nix flakes][z2n-flakes] page from Zero to Nix. It doesn't really
51
get any better than that.
52
53
[deps_nix]: https://github.com/code-supply/deps_nix
54
[z2n-flakes]: https://zero-to-nix.com/concepts/flakes/
55
56
57
## construindo para produção / building for prod
58
59
* `nix build` will produce a Mix release in `result`.
60
* `nix build .#nossa-docker` will create a Docker image which can be run
61
directly, or as part of an orchestration setup.
62
63
There's a NixOS module included, which can be used to deploy nóssa with a few
64
lines of configuration. To do this, add the input to your own `flake.nix`:
65
66
```nix
67
nossa = {
68
url = "git+https://nossa.ee/~talya/nossa";
69
# Add as desired:
70
# inputs.nixpkgs.follows = "nixpkgs";
71
# inputs.flake-utils.follows = "flake-utils";
72
# inputs.rust-overlay.follows = "rust-overlay";
73
};
74
```
75
76
Then include the `nossa.nixosModules.${system}.nossa` module. You can now
77
configure a nóssa installation per [`nix/module.nix`](nix/module.nix):
78
79
```nix
80
services.nossa = {
81
enable = true;
82
port = 8000; # for your reverse proxy.
83
metricsPort = 8001; # prometheus-style metrics.
84
host = "your-nossa.ee"; # hostname nóssa runs on.
85
secretKeyBaseFile = somePath; # secret key base for Phoenix.
86
erlangCookieFile = anotherPath; # cookie for Erlang.
87
maxBodyLength = 1000000000; # max push size via HTTP.
88
};
89
```
90
91
nóssa avoids running its own [epmd], so you will want to be running your own:
92
93
```nix
94
services.epmd.enable = true;
95
```
96
97
If you want to be able to connect to your running nóssa service, add the binary
98
to your system path:
99
100
```nix
101
environment.systemPackages = [config.services.nossa.package];
102
```
103
104
Note that you'll need to specify the path to the cookie in the environment to
105
connect successfully. For example:
106
107
```console
108
$ RELEASE_COOKIE="$(cat /run/secrets/erlang-cookie)" nossa remote
109
```
110
111
See the [Distributed Erlang — Security][security] section of the Erlang
112
documentation for more details sobre o biscoito mágico.
113
114
[epmd]: https://www.erlang.org/docs/28/apps/erts/epmd_cmd
115
[security]: https://www.erlang.org/docs/28/system/distributed.html#security
116
117
118
## executando no kubernetes / running on kubernetes
119
120
The flagship instance's configuration can be seen at
121
<https://nossa.ee/~talya/vyx/tree/main/-/flux/sources/nossa>, in the form of a
122
[Timoni] module. [`manifest.yaml`] contains the actual compiled manifests.
123
124
[Timoni]: https://timoni.sh/
125
[`manifest.yaml`]: https://nossa.ee/~talya/vyx/blob/main/-/flux/sources/nossa/manifest.yaml
126
127