1
0
Fork 0

cloudflared: Install without Docker

This commit is contained in:
Daniel Kempkens 2022-12-26 17:53:21 +01:00
parent 9728c2b987
commit 4033de5a8b
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
4 changed files with 22 additions and 15 deletions

View file

@ -5,21 +5,6 @@ in
{ {
virtualisation.arion.projects.webserver.settings = { virtualisation.arion.projects.webserver.settings = {
services = { services = {
cloudflared = {
service = {
image = "cloudflare/cloudflared:latest";
container_name = "cloudflared";
restart = "unless-stopped";
command = [ "tunnel" "--no-autoupdate" "run" "--token" secret.container.webserver.cloudflared.config.token ];
extra_hosts = [
"host.docker.internal:host-gateway"
];
labels = {
"com.centurylinklabs.watchtower.enable" = "true";
};
};
};
mosquitto = { mosquitto = {
service = { service = {
image = "eclipse-mosquitto:2"; image = "eclipse-mosquitto:2";
@ -42,6 +27,7 @@ in
container_name = "weewx"; container_name = "weewx";
restart = "unless-stopped"; restart = "unless-stopped";
depends_on = [ "mosquitto" ]; depends_on = [ "mosquitto" ];
ports = [ "127.0.0.1:8000:8000" ];
environment = { environment = {
"TZ" = "Europe/Berlin"; "TZ" = "Europe/Berlin";
}; };

Binary file not shown.

View file

@ -0,0 +1,21 @@
{ pkgs, secret, ... }:
{
users.users.cloudflared = {
group = "cloudflared";
isSystemUser = true;
};
users.groups.cloudflared = { };
systemd.services.my_tunnel = {
wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" "systemd-resolved.service" ];
serviceConfig = {
ExecStart = "${pkgs.cloudflared}/bin/cloudflared tunnel --no-autoupdate run --token=${secret.cloudflared.token}";
Restart = "always";
User = "cloudflared";
Group = "cloudflared";
};
};
}