mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-12-10 03:49:44 +00:00
feat(y2q): add cloudflared
- Add cloudflared runit service - Serve opengist via Cloudflare tunnel
This commit is contained in:
parent
3b3476c110
commit
04d4ac2a9e
3 changed files with 26 additions and 0 deletions
26
home/modules/runit/services/cloudflared.nix
Normal file
26
home/modules/runit/services/cloudflared.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
{ pkgs, config, rootPath, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
tunnel = "cb0d9c2c-48f9-4bca-9e81-ef92423c5afa";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
home.file.".cloudflared/${tunnel}.json".source = rootPath + /secrets/gitcrypt/cloudflared/${tunnel}.json;
|
||||||
|
home.file.".cloudflared/cert.pem".source = rootPath + /secrets/gitcrypt/cloudflared/cert.pem;
|
||||||
|
home.file.".cloudflared/config.yml".text = ''
|
||||||
|
tunnel: ${tunnel}
|
||||||
|
credentials-file: ${config.home.homeDirectory}/.cloudflared/${tunnel}.json
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
- hostname: gist.toast.name
|
||||||
|
service: http://${config.runit.services.opengist.environment.OG_HTTP_HOST}:${config.runit.services.opengist.environment.OG_HTTP_PORT}
|
||||||
|
|
||||||
|
- service: http_status:404
|
||||||
|
'';
|
||||||
|
|
||||||
|
runit.services.cloudflared = {
|
||||||
|
script = ''
|
||||||
|
exec ${pkgs.cloudflared}/bin/cloudflared tunnel run
|
||||||
|
'';
|
||||||
|
log.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
Binary file not shown.
BIN
secrets/gitcrypt/cloudflared/cert.pem
Normal file
BIN
secrets/gitcrypt/cloudflared/cert.pem
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue