feat(koi): outline wiki
This commit is contained in:
parent
f27bacde37
commit
26a33620bc
5 changed files with 101 additions and 0 deletions
|
@ -29,6 +29,8 @@
|
|||
./containers/navidrome
|
||||
./containers/conduwuit
|
||||
./containers/zond
|
||||
./containers/authentik
|
||||
./containers/outline-wiki
|
||||
./containers/teisu.nix
|
||||
./containers/bots/pcre-sub-bot.nix
|
||||
./containers/bots/channel-logger-bot.nix
|
||||
|
|
85
hosts/koi/containers/outline-wiki/default.nix
Normal file
85
hosts/koi/containers/outline-wiki/default.nix
Normal file
|
@ -0,0 +1,85 @@
|
|||
{ abs, pkgs, config, ... }@inputs:
|
||||
|
||||
let
|
||||
secrets = import (abs "lib/secrets.nix");
|
||||
trivial = import (abs "lib/trivial.nix") inputs;
|
||||
|
||||
UID = 1111;
|
||||
context = trivial.storeDirectory ./image;
|
||||
in {
|
||||
imports = [
|
||||
(secrets.declare [{
|
||||
name = "outline-wiki-env";
|
||||
owner = "outline-wiki";
|
||||
}])
|
||||
];
|
||||
|
||||
users.users.outline-wiki = {
|
||||
isNormalUser = true;
|
||||
uid = UID;
|
||||
};
|
||||
|
||||
services.postgresql.ensureUsers = [
|
||||
{ name = "outline-wiki"; ensureDBOwnership = true; }
|
||||
];
|
||||
services.postgresql.ensureDatabases = [ "outline-wiki" ];
|
||||
desu.postgresql.ensurePasswords.outline-wiki = "outline-wiki";
|
||||
|
||||
virtualisation.oci-containers.containers.outline-wiki-redis = {
|
||||
image = "docker.io/redis:7.0-alpine";
|
||||
volumes = [
|
||||
"/srv/outline-wiki/redis:/data"
|
||||
];
|
||||
user = builtins.toString UID;
|
||||
};
|
||||
|
||||
systemd.services.docker-outline-wiki.serviceConfig.ExecStartPre = [
|
||||
(pkgs.writeShellScript "build-outline-wiki" ''
|
||||
docker build -t local/outline-wiki ${context}
|
||||
'')
|
||||
];
|
||||
virtualisation.oci-containers.containers.outline-wiki = {
|
||||
dependsOn = [ "outline-wiki-redis" ];
|
||||
image = "local/outline-wiki";
|
||||
volumes = [
|
||||
"/srv/outline-wiki/media:/var/lib/outline/data"
|
||||
];
|
||||
environment = {
|
||||
NODE_ENV = "production";
|
||||
PORT = "80";
|
||||
DATABASE_URL = "postgres://outline-wiki:outline-wiki@172.17.0.1:5432/outline-wiki";
|
||||
PGSSLMODE = "disable";
|
||||
REDIS_URL = "redis://outline-wiki-redis.docker:6379";
|
||||
URL = "https://lore.stupid.fish";
|
||||
COLLABORATION_URL = "https://lore.stupid.fish";
|
||||
FILE_STORAGE = "local";
|
||||
FILE_STORAGE_LOCAL_ROOT_DIR = "/var/lib/outline/data";
|
||||
FILE_STORAGE_UPLOAD_MAX_SIZE = "262144000";
|
||||
ENABLE_UPDATES = "false";
|
||||
WEB_CONCURRENCY = "1";
|
||||
LOG_LEVEL = "info";
|
||||
# fake license key
|
||||
LICENSE_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJjYXRnaXJscyA6MyIsImV4cCI6MTc5ODc1MDgwMCwiY3VzdG9tZXJJZCI6ImNhdGdpcmxzIDozIiwic2VhdENvdW50Ijo5OTk5OTksImlzVHJpYWwiOmZhbHNlLCJpYXQiOjE3MjY0ODg2MDV9.msuM1RpFYcEpD1FMfO55PZ6-DRn1q0EIu1zjAz-oHI8";
|
||||
};
|
||||
environmentFiles = [
|
||||
# oidc related config + SECRET_KEY, UTILS_SECRET
|
||||
(secrets.file config "outline-wiki-env")
|
||||
];
|
||||
user = builtins.toString UID;
|
||||
};
|
||||
systemd.services.docker-outline-wiki.after = [ "postgresql.service" ];
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /srv/outline-wiki 0777 root root -"
|
||||
];
|
||||
|
||||
services.nginx.virtualHosts."lore.stupid.fish" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "stupid.fish";
|
||||
|
||||
locations."/" = {
|
||||
proxyPass = "http://outline-wiki.docker$request_uri";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
}
|
8
hosts/koi/containers/outline-wiki/image/Dockerfile
Normal file
8
hosts/koi/containers/outline-wiki/image/Dockerfile
Normal file
|
@ -0,0 +1,8 @@
|
|||
FROM outlinewiki/outline-enterprise:0.79.1
|
||||
|
||||
USER root
|
||||
RUN apt-get update && apt-get install -y patch
|
||||
USER nodejs
|
||||
|
||||
COPY license.patch /license.patch
|
||||
RUN patch /opt/outline/build/server/utils/LicenseHelper.js < /license.patch
|
6
hosts/koi/containers/outline-wiki/image/license.patch
Normal file
6
hosts/koi/containers/outline-wiki/image/license.patch
Normal file
|
@ -0,0 +1,6 @@
|
|||
22,24c22
|
||||
< const decoded = _jsonwebtoken.default.verify(process.env.LICENSE_KEY || "", this.publicKey, {
|
||||
< ignoreExpiration: true
|
||||
< });
|
||||
---
|
||||
> const decoded = _jsonwebtoken.default.decode(process.env.LICENSE_KEY || "");
|
BIN
secrets/outline-wiki-env.age
Normal file
BIN
secrets/outline-wiki-env.age
Normal file
Binary file not shown.
Loading…
Reference in a new issue