File tree Expand file tree Collapse file tree 9 files changed +122
-47
lines changed Expand file tree Collapse file tree 9 files changed +122
-47
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -24,9 +24,6 @@ postgrest_release: "13.0.5"
2424postgrest_arm_release_checksum : sha256:7b4eafdaf76bc43b57f603109d460a838f89f949adccd02f452ca339f9a0a0d4
2525postgrest_x86_release_checksum : sha256:05be2bd48abee6c1691fc7c5d005023466c6989e41a4fc7d1302b8212adb88b5
2626
27- gotrue_release : 2.179.0
28- gotrue_release_checksum : sha1:e985fce00b2720b747e6a04420910015c4967121
29-
3027aws_cli_release : " 2.23.11"
3128
3229salt_minion_version : 3007
Original file line number Diff line number Diff line change 3333 inputs . nixpkgs . follows = "nixpkgs" ;
3434 } ;
3535 system-manager = {
36- url = "github:numtide/system-manager" ;
36+ # FIXME: remove custom branch when this PR is merged:
37+ # https://github.com/numtide/system-manager/pull/266
38+ url = "github:numtide/system-manager/users" ;
39+ inputs . nixpkgs . follows = "nixpkgs" ;
40+ } ;
41+ gotrue = {
42+ # FIXME: remove custom fork when this PR is merged:
43+ # https://github.com/supabase/auth/pull/2166
44+ url = "github:yvan-sraka/auth" ;
3745 inputs . nixpkgs . follows = "nixpkgs" ;
3846 } ;
3947 } ;
Original file line number Diff line number Diff line change 11{ self , inputs , ... } :
22let
33 mkModules = system : [
4+ self . systemModules . gotrue
45 ( {
56 services . nginx . enable = true ;
67 nixpkgs . hostPlatform = system ;
8+ supabase . services . gotrue . enable = true ;
79 } )
810 ] ;
911
Original file line number Diff line number Diff line change 44{
55 imports = [ ./tests ] ;
66 flake = {
7- systemModules = { } ;
7+ systemModules = {
8+ gotrue = ./gotrue.nix ;
9+ } ;
810 } ;
911}
Original file line number Diff line number Diff line change 1+ {
2+ lib ,
3+ config ,
4+ ...
5+ } :
6+ let
7+ cfg = config . supabase . services . gotrue ;
8+ in
9+ {
10+ options = {
11+ supabase . services . gotrue = {
12+ enable = lib . mkEnableOption "Supabase (gotrue) authentication service" ;
13+ } ;
14+ } ;
15+
16+ config = lib . mkIf cfg . enable {
17+ self . inputs . gotrue . module . enable = true ;
18+
19+ # TODO: supabase-admin-api haven't been turned into a system-manager module yet:
20+ #
21+ # systemd.services.gotrue-optimizations = {
22+ # description = "gotrue (auth) optimizations";
23+ # wantedBy = [ "gotrue.service" ];
24+ # serviceConfig = {
25+ # Type = "oneshot";
26+ # # we don't want failures from this command to cause PG startup to fail
27+ # ExecStart = "/bin/bash -c '/opt/supabase-admin-api optimize auth --destination-config-file-path /etc/gotrue/gotrue.generated.env ; exit 0'";
28+ # ExecStartPost = "/bin/bash -c 'cp -a /etc/gotrue/gotrue.generated.env /etc/auth.d/20_generated.env ; exit 0'";
29+ # User = "postgrest";
30+ # };
31+ # };
32+
33+ # TODO: that's what the activation script was doing:
34+ # cp $out/etc/auth.env /etc/auth.d/20_generated.env
35+ # chown gotrue:gotrue /etc/auth.d/20_generated.env
36+ # chmod 600 /etc/auth.d/20_generated.env
37+ } ;
38+ }
Original file line number Diff line number Diff line change 1+ # from time import sleep
2+
3+
4+ def test_gotrue_service (host ):
5+ # sleep(5000) # Handy for interactive debugging (with docker exec -it $CONTAINER_ID /bin/bash)
6+ assert host .service ("gotrue.service" ).is_valid
7+ assert host .service ("gotrue.service" ).is_running , (
8+ "Auth service should be running but failed: {}" .format (
9+ host .run ("systemctl status gotrue.service" ).stdout
10+ )
11+ )
You can’t perform that action at this time.
0 commit comments