Lauti: Difference between revisions

Onny (talk | contribs)
Add Radar sync script example
Onny (talk | contribs)
Rename eintopf to lauti
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
[https://codeberg.org/Klasse-Methode/eintopf Eintopf] is a community event calendar for groups and places.
[https://lauti.org Lauti] is a community event calendar for groups and places.


== Setup ==
== Setup ==
Line 6: Line 6:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
environment.etc."eintopf-secrets".text = ''
environment.etc."lauti-secrets".text = ''
EINTOPF_ADMIN_PASSWORD=test123
LAUTI_ADMIN_PASSWORD=test123
'';
'';


services.eintopf = {
services.eintopf = {
   enable = true;
   enable = true;
   settings.EINTOPF_ADMIN_EMAIL = "test@example.org";
   settings = {
   secrets = [ /etc/eintopf-secrets ];
    LAUTI_ADMIN_EMAIL = "test@example.org";
    LAUTI_BASE_URL = "http://localhost:3333";
    LAUTI_OSM_TILE_CACHE_DIR = "/var/lib/eintopf/osm";
    LAUTI_OSM_TILE_SERVER = "https://tile.openstreetmap.org/{z}/{x}/{y}.png";
    LAUTI_TIMEZONE = "Europe/Berlin";
    LAUTI_LANGUAGE = "en";
  };
   secrets = [ /etc/lauti-secrets ];
};
};
</syntaxhighlight>
</syntaxhighlight>
Line 28: Line 35:
   template-karlsunruh = pkgs.stdenv.mkDerivation {
   template-karlsunruh = pkgs.stdenv.mkDerivation {
     name = "karlsunruh";
     name = "karlsunruh";
     src = pkgs.fetchgit {
     src = pkgs.fetchFromGitLab {
       url = "https://git.project-insanity.org/onny/eintopf-karlsunruh.git";
       domain = "git.project-insanity.org";
       rev = "81cb96424b1162b6dd20c1b22f03dbdf49ae30d4";
      owner = "onny";
       hash = "sha256-+OeZG6+yZ0CwuIEN7pc0MankepZ6npiOD8RMyvWhQrY=";
      repo = "eintopf-karlsunruh";
       rev = "17622a22234b7eb664436582ee6147070c1b08bb";
       hash = "sha256-cW1Q5clLy8b2/DblKWy5i307inymxuOz6gtY1+iHRKo=";
     };
     };
     dontBuild = true;
     makeFlags = [ "DESTDIR=$(out)" ];
    installPhase = ''
      cp -r . $out/
    '';
   };
   };


Line 45: Line 51:
     enable = true;
     enable = true;
     settings = {
     settings = {
       EINTOPF_THEMES = "eintopf,${template-karlsunruh}";
       LAUTI_THEME = "karlsunruh";
      LAUTI_THEMES_PATH = "${template-karlsunruh}";
     };
     };
   };
   };
Line 54: Line 61:
== Tips and tricks ==
== Tips and tricks ==


=== Sync events from Radar to Eintopf ===
=== Sync events from Radar to Lauti ===
The following script can be imported into the NixOS system configuration and will runs every half an hour to sync events from a given Radar group id to a specific target Eintopf instance.
The following script can be imported into the NixOS system configuration and will runs every half an hour to sync events from a given Radar group id to a specific target Lauti instance.


Import the module and script into your system <code>flake.nix</code> file<syntaxhighlight lang="nix">
Import the module and script into your system <code>flake.nix</code> file<syntaxhighlight lang="nix">
Line 88: Line 95:


</syntaxhighlight>Enable the sync service in your system configuration by adding following snippet. Replace the setting variables according to your setup<syntaxhighlight lang="nix">
</syntaxhighlight>Enable the sync service in your system configuration by adding following snippet. Replace the setting variables according to your setup<syntaxhighlight lang="nix">
environment.etc."eintopf-radar-sync-secrets".text = ''
EINTOPF_AUTHORIZATION_TOKEN=foobar23
'';
services.eintopf-radar-sync = {
services.eintopf-radar-sync = {
   enable = true;
   enable = true;
   settings = {
   settings = {
     eintopfUrl = "karlsunruh.project-insanity.org";
     EINTOPF_URL = "https://karlsunruh.project-insanity.org";
     eintopfAuthorizationToken = "SECRET TOKEN";
     RADAR_GROUP_ID = "436012";
    radarGroupId = "436012";
   };
   };
  secrets = [ /etc/eintopf-radar-sync-secrets ];
};
};
</syntaxhighlight>
</syntaxhighlight>Get the authorization token through login request in the Lauti Swagger api interface, for example <nowiki>http://localhost:3333/api/v1/swagger#/auth/login</nowiki>
[[Category:Server]]
[[Category:Server]]
[[Category:Web Applications]]
[[Category:Web Applications]]