https://nossa.ee · This website! ·
elixir git
r/o

nossa / README.md

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
* Deploys itself as a NixOS module, or happily runs in a container on Docker,
25
Kubernetes, etc.
26
27
See [`TAREAS.md`](TAREAS.md) for a list of things yet to be done!
28
29
[git2-rs]: https://github.com/rust-lang/git2-rs
30
[git-http-backend]: https://git-scm.com/docs/git-http-backend
31
32
33
## desenvolvimento / development
34
35
The development and build process assumes you are able to use Nix flakes[^flakes].
36
37
Use `nix develop` to enter a dev shell. The first time you're getting set up
38
you'll want to do a `mix deps.get`; we use Mix normally in dev, and then use
39
[deps_nix] to make them reproducible for production builds.
40
41
Then:
42
43
* `make pg` --- starts Postgres with a database stored in `./db`.
44
* `make pgstop` --- stops that instance when you're done.
45
* `make server` --- runs the Phoenix server in IEx.
46
* `make testwatch` --- runs `mix test` every time a relevant file changes.
47
* `make coverwatch` --- runs `mix test --cover` every time a relevant file changes.
48
49
The last two also can take `ARGS=...`.
50
51
[^flakes]: I am so sorry but I can't find a single good link that would actually
52
just take you through using them. It's true what they say about Nix people.
53
Try the [Nix flakes][z2n-flakes] page from Zero to Nix. It doesn't really
54
get any better than that.
55
56
[deps_nix]: https://github.com/code-supply/deps_nix
57
[z2n-flakes]: https://zero-to-nix.com/concepts/flakes/
58
59
60
## construindo para produção / building for prod
61
62
* `nix build` will produce a Mix release in `result`.
63
* `nix build .#nossa-docker` will create a Docker image which can be run
64
directly, or as part of an orchestration setup.
65
66
There's a NixOS module included, which can be used to deploy nóssa with a few
67
lines of configuration. To do this, add the input to your own `flake.nix`:
68
69
```nix
70
nossa = {
71
url = "git+https://nossa.ee/~talya/nossa";
72
# Add to taste:
73
# inputs.nixpkgs.follows = "nixpkgs";
74
# inputs.fenix.follows = "fenix";
75
};
76
```
77
78
Then include the `nossa.nixosModules.${system}.nossa` module. You can now
79
configure a nóssa installation per [`nix/module.nix`](nix/module.nix):
80
81
```nix
82
services.nossa = {
83
enable = true;
84
port = 8000; # for your reverse proxy.
85
metricsPort = 8001; # prometheus-style metrics.
86
host = "your-nossa.ee"; # hostname nóssa runs on.
87
secretKeyBaseFile = somePath; # secret key base for Phoenix.
88
erlangCookieFile = anotherPath; # cookie for Erlang.
89
maxBodyLength = 1000000000; # max push size via HTTP.
90
};
91
```
92
93
nóssa avoids running its own [epmd], so you will want to be running your own:
94
95
```nix
96
services.epmd.enable = true;
97
```
98
99
If you want to be able to connect to your running nóssa service, add the binary
100
to your system path:
101
102
```nix
103
environment.systemPackages = [config.services.nossa.package];
104
```
105
106
Note that you'll need to specify the path to the cookie in the environment to
107
connect successfully. For example:
108
109
```console
110
$ RELEASE_COOKIE="$(cat /run/secrets/erlang-cookie)" nossa remote
111
```
112
113
See the [Distributed Erlang — Security][security] section of the Erlang
114
documentation for more details sobre o biscoito mágico.
115
116
[epmd]: https://www.erlang.org/docs/28/apps/erts/epmd_cmd
117
[security]: https://www.erlang.org/docs/28/system/distributed.html#security
118
119
120
## executando no kubernetes / running on kubernetes
121
122
The flagship instance's configuration can be seen at
123
<https://nossa.ee/~talya/vyx/tree/main/-/flux/sources/nossa>, in the form of a
124
[Timoni] module. [`manifest.yaml`] contains the actual compiled manifests.
125
126
[Timoni]: https://timoni.sh/
127
[`manifest.yaml`]: https://nossa.ee/~talya/vyx/blob/main/-/flux/sources/nossa/manifest.yaml
128
129