forked from poz/niksos
feat: swap unmaintained anki sync server
the ankisyncd is dead. long live the anki-sync-server!
This commit is contained in:
parent
62d6a50e55
commit
826d63c832
7 changed files with 45 additions and 67 deletions
30
hosts/chmura/anki-sync-server.nix
Normal file
30
hosts/chmura/anki-sync-server.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
age.secrets.anki-user-credentials.file = ../../secrets/anki-user-credentials.age;
|
||||
|
||||
systemd.services.anki-sync-server = {
|
||||
description = "Selfhosted Anki sync server.";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
DynamicUser = true;
|
||||
StateDirectory = "anki-sync-server";
|
||||
ExecStart = "${pkgs.anki-bin}/bin/anki --syncserver";
|
||||
Environment = ''SYNC_BASE="/var/lib/anki-sync-server" SYNC_HOST="127.0.0.1" SYNC_PORT="27701"'';
|
||||
EnvironmentFile = config.age.secrets.anki-user-credentials.path;
|
||||
Restart = "always";
|
||||
};
|
||||
};
|
||||
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
virtualHosts."a.jacekpoz.pl".extraConfig = ''
|
||||
reverse_proxy * localhost:27701
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
{
|
||||
config,
|
||||
config',
|
||||
...
|
||||
}: {
|
||||
services.ankisyncd = {
|
||||
enable = true;
|
||||
port = 27701;
|
||||
};
|
||||
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
virtualHosts."a.jacekpoz.pl".extraConfig = ''
|
||||
reverse_proxy * localhost:27701
|
||||
'';
|
||||
};
|
||||
|
||||
age.secrets = {
|
||||
ankisyncd-username = {
|
||||
file = ../../secrets/ankisyncd-username.age;
|
||||
mode = "700";
|
||||
owner = config'.username;
|
||||
group = "users";
|
||||
};
|
||||
ankisyncd-password = {
|
||||
file = ../../secrets/ankisyncd-password.age;
|
||||
mode = "700";
|
||||
owner = config'.username;
|
||||
group = "users";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.ankisyncd.environment = {
|
||||
ANKISYNCD_USERNAME = "$(cat ${config.age.secrets.ankisyncd-username.path})";
|
||||
ANKISYNCD_PASSWORD = "$(cat ${config.age.secrets.ankisyncd-password.path})";
|
||||
};
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
_: {
|
||||
imports = [
|
||||
./ankisyncd.nix
|
||||
./anki-sync-server.nix
|
||||
./conduit.nix
|
||||
./configuration.nix
|
||||
#./freshrss.nix
|
||||
|
|
13
secrets/anki-user-credentials.age
Normal file
13
secrets/anki-user-credentials.age
Normal file
|
@ -0,0 +1,13 @@
|
|||
age-encryption.org/v1
|
||||
-> ssh-ed25519 05IAmg Xj4hau+EYfzst4g4kNce86xDPJvQqwMQIkzJq4r8Ens
|
||||
dqZ5S6iCoLeF4OtwTIVFJlirl7kTUaG6TbX17RBWDUM
|
||||
-> ssh-ed25519 HC8P8A L4ulkghg5JIZ+alzYzdPcYN38DMzqbj9BIzqNP3/dAg
|
||||
AhgHs9tQGFc3xepWXIlR6wgmeQFMkpIH8Utxk9czAiM
|
||||
-> ssh-ed25519 sItgaw mhBqgC7VnEBjZQr1WkiTsAZp6kWHfmRhb3nKGwm+zFA
|
||||
BTDfbP1Z7899ziQl749Dn/5wJ98GhGv6iDb4SjDpM58
|
||||
-> ssh-ed25519 YQNd1g DGNkUnzLfCIiF5RJKqBBH1jQFyZDxLX/LjnfdQvi0iQ
|
||||
pZxtQ1NK4gsHSkJgc0JuypcPoaLDjzvhbSYMloEZv4U
|
||||
-> VE&"q$-grease
|
||||
+ey9pz34m00mrTcNeXPvXsr85G0gOYV9Da+9OwwSU7s6Cg
|
||||
--- EFfOx1pWk2ZYQVfPCqu42s13RPzeFLlxh+5SDqefsdo
|
||||
^Q9@Îõó®pöö)p®·ø¾;÷è‡S…sYqwõT¯þW¿w—j"A…Ʊ&žX ^æ½\;çSúûPÿÁ¼Ý÷<13>V©úÍì¬ÿ£Œ
|
|
@ -1,13 +0,0 @@
|
|||
age-encryption.org/v1
|
||||
-> ssh-ed25519 05IAmg 1ZYcZpCbYtP1ck85Zk2AZ+zZv1Ux1zQWnVdAETv1nCw
|
||||
KOVtQNfLWaPT6GBzRBibjlEb23MTOS/bNcm8QljGYQk
|
||||
-> ssh-ed25519 HC8P8A vj+204x0X0+CVj1p+i/vA3EFRKnB58hUVUFdcKMfmSQ
|
||||
+1+0+CXjq6/k+ho2QBfgocqY4VjcLpqmcI3krmqsIyo
|
||||
-> ssh-ed25519 sItgaw UiCiBpKPPy9JkWcrDJjVRYYZLmFpAlxlZPrG9ODnnEM
|
||||
7H0w0J7iB1j4wqUcSHoZfTwsvRC+/V3I1CAqwKigVdo
|
||||
-> ssh-ed25519 YQNd1g RP8JIdng7SFRJLHPHC3Q2dW76URlbGQ2lTl5PEYGhDc
|
||||
UdUv8PS26CDvoBmBkKBLyjvg0neMiGkjivgSZEjD4po
|
||||
-> 5M-grease #s2dp/| $ c^&FswLA
|
||||
+9lvheu17GWcrBwurwFWB8YnnOO/9FmRILTrhPvCEOmZ6iXUHay6jbK+
|
||||
--- un4Yu4uYu7zqdZdmhGSPKvDHuxzYHZ9PemZC/Iyl2R0
|
||||
ß“VÔõ:tŽø"bpÙ˜Å3ÒƒazÅsV‘_yí ÊÿÐ,;›Á^›4‰Ÿ·ÛATGÁ/ÑnØÄ”Ç;Nؾ}'
|
|
@ -1,14 +0,0 @@
|
|||
age-encryption.org/v1
|
||||
-> ssh-ed25519 05IAmg hOwljrTCYZwaQsKuohprSVuqmJ5zfbT9/RdwWW3An1E
|
||||
QwTNvnAr7Kq802dOAkx7y8G+YlR2wtlT17agalRD9AE
|
||||
-> ssh-ed25519 HC8P8A xvzaQzCjMoIBViMf3NMoydEBVRTFMOoU4oOsAmwCehM
|
||||
IA2vtbC+wjOIcm91sQM/0V+6gkzhESNyr0AbrJPg/+8
|
||||
-> ssh-ed25519 sItgaw ViO7yNhkZ9i6xnJZmtvgrFfxlzPyP6B/GbsDrS7c1lo
|
||||
S7ZXnueUuI6S5CZrmdv4MxedXQ8KUUnDkIS3ujjkdjE
|
||||
-> ssh-ed25519 YQNd1g QOgINcUppPriV4lZ6jzwlUwwtcw7Jg05eN2inF/LmFQ
|
||||
T/7kzBQofEuVx+8CvxS+TR954CNtNEu6IQmvTAPVKH0
|
||||
-> syQ$va-grease ;~M&{8%< b1jw;$h Om._<}k
|
||||
o3RjXfALP1KKhRKrkoX/jnSPRIZrC6TSE4LG+dpUdC9wJvOEkpXEZenwpPyzI3LB
|
||||
NmY1Sw+gqQwNQiv62g6MyUTuxxKTvABiZFQfBdfFW3KjBLZIi30LtWU
|
||||
--- Y+q3InJWdcn3ojcmjVJTCDt7Cr9ntDygVQIeY6hP/kk
|
||||
U1ÐÁ·ÁüÄ`.Ù:3¿šæ¦˜tyáž ¨Ý¾tL`…"l§NÅûC
|
|
@ -8,6 +8,5 @@ let
|
|||
niks = [ niks_user niks_host ];
|
||||
chmura = [ chmura_user chmura_host ];
|
||||
in {
|
||||
"ankisyncd-username.age".publicKeys = niks ++ chmura;
|
||||
"ankisyncd-password.age".publicKeys = niks ++ chmura;
|
||||
"anki-user-credentials.age".publicKeys = niks ++ chmura;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue