cloudflared: Install without Docker
This commit is contained in:
parent
9728c2b987
commit
4033de5a8b
4 changed files with 22 additions and 15 deletions
|
@ -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.
Binary file not shown.
21
system/nixos/cloudflared.nix
Normal file
21
system/nixos/cloudflared.nix
Normal 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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue