hiroshi/languagetool: Migrate from fuuko

This commit is contained in:
Simon Bruder 2024-08-20 22:57:55 +02:00
parent 79707438c2
commit e9fce22b71
Signed by: simon
GPG key ID: 347FF8699CDA0776
5 changed files with 17 additions and 5 deletions

View file

@ -9,7 +9,6 @@
../../modules ../../modules
../../users/simon ../../users/simon
./services/languagetool.nix
./services/media-backup.nix ./services/media-backup.nix
./services/media.nix ./services/media.nix
./services/photoprism.nix ./services/photoprism.nix

View file

@ -6,6 +6,8 @@
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
../../modules ../../modules
./services/languagetool.nix
]; ];
sbruder = { sbruder = {
@ -13,6 +15,10 @@
restic.system.enable = true; restic.system.enable = true;
wireguard.home.enable = true; wireguard.home.enable = true;
infovhost.enable = true; infovhost.enable = true;
nginx = {
hardening.enable = true;
proxyv4.enable = true;
};
}; };
networking.hostName = "hiroshi"; networking.hostName = "hiroshi";

View file

@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023 Simon Bruder <simon@sbruder.de> # SPDX-FileCopyrightText: 2023-2024 Simon Bruder <simon@sbruder.de>
# #
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
@ -12,8 +12,9 @@ in
#allowOrigin = "https://languagetool.sbruder.de"; #allowOrigin = "https://languagetool.sbruder.de";
allowOrigin = "*"; allowOrigin = "*";
settings = { settings = {
# http://languagetool.org/download/ngram-data/
languageModel = "/var/lib/languagetool/ngrams"; languageModel = "/var/lib/languagetool/ngrams";
word2vecModel = "/var/lib/languagetool/word2vec"; # https://fasttext.cc/docs/en/language-identification.html
fasttextModel = "/var/lib/languagetool/fasttext/lid.176.bin"; fasttextModel = "/var/lib/languagetool/fasttext/lid.176.bin";
fasttextBinary = "${pkgs.fasttext}/bin/fasttext"; fasttextBinary = "${pkgs.fasttext}/bin/fasttext";
}; };
@ -23,6 +24,9 @@ in
#systemd.services.languagetool.serviceConfig.StandardOutput = "null"; #systemd.services.languagetool.serviceConfig.StandardOutput = "null";
services.nginx.virtualHosts."languagetool.sbruder.de" = { services.nginx.virtualHosts."languagetool.sbruder.de" = {
enableACME = true;
forceSSL = true;
locations = { locations = {
"/".proxyPass = "http://127.0.0.1:${toString cfg.port}"; "/".proxyPass = "http://127.0.0.1:${toString cfg.port}";
}; };

View file

@ -5,7 +5,11 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
baseDomain = "koyomi.sbruder.de"; baseDomain = "koyomi.sbruder.de";
backends = { }; backends = {
hiroshi = [
"languagetool.sbruder.de"
];
};
fallbackCert = pkgs.runCommandNoCC "fallback-cert" { } '' fallbackCert = pkgs.runCommandNoCC "fallback-cert" { } ''
cat > openssl.cnf << EOF cat > openssl.cnf << EOF

View file

@ -19,7 +19,6 @@
}; };
}) })
[ [
"languagetool.sbruder.de"
"media.sbruder.de" "media.sbruder.de"
"photoprism.sbruder.de" "photoprism.sbruder.de"
"torrent.sbruder.de" "torrent.sbruder.de"