homelab-apps/services.jsonnet

214 lines
6.7 KiB
Plaintext
Raw Permalink Normal View History

local compose = import 'compose.libsonnet';
local Compose = compose.Compose;
local Command = compose.Command;
local Port = compose.Port;
local MediaService = compose.MediaService;
local MediaMounts = compose.MediaMounts;
local HomelabDomain = compose.HomelabDomain;
2022-11-13 01:06:12 +00:00
function(secrets={})
Compose({
2023-07-24 01:13:23 +00:00
gluetun: {
image: 'qmcgaw/gluetun',
cap_add: ['NET_ADMIN'],
devices: ['/dev/net/tun:/dev/net/tun'],
environment: {
TZ: 'America/New_York',
// VPN_SERVICE_PROVIDER: 'custom',
// VPN_TYPE: 'wireguard',
2023-07-24 01:13:23 +00:00
// VPN_PORT_FORWARDING_PROVIDER: 'protonvpn',
// VPN_ENDPOINT_IP: std.get(secrets, 'VPN_ENDPOINT_IP'),
// VPN_ENDPOINT_PORT: std.get(secrets, 'VPN_ENDPOINT_PORT'),
// WIREGUARD_PUBLIC_KEY: std.get(secrets, 'WIREGUARD_PUBLIC_KEY'),
// WIREGUARD_PRIVATE_KEY: std.get(secrets, 'WIREGUARD_PRIVATE_KEY'),
// WIREGUARD_ADDRESSES: std.get(secrets, 'WIREGUARD_ADDRESSES'),
VPN_SERVICE_PROVIDER: 'protonvpn',
VPN_PORT_FORWARDING: 'on',
OPENVPN_USER: std.get(secrets, 'OPENVPN_USER'),
OPENVPN_PASSWORD: std.get(secrets, 'OPENVPN_PASSWORD'),
SERVER_HOSTNAMES: 'node-ch-08.protonvpn.net',
2023-07-24 01:13:23 +00:00
},
ports: [
2023-07-27 02:51:56 +00:00
// http proxy
// Port(8888),
// shadowsocks proxy
// Port(8388),
// Port(8388, kind='udp'),
// app local ports
// deluge
// Port(58846),
// Port(58846, kind='udp'),
// transmission
Port(9091),
Port(9091, kind='udp'),
2023-07-24 01:13:23 +00:00
],
webPort:: 8000,
volumes: { gluetun_data: '/gluetun' },
},
2022-11-13 01:06:12 +00:00
traefik: {
image: 'traefik:latest',
command: Command({
'log.level': 'DEBUG',
2022-11-13 01:06:12 +00:00
'api.insecure': 'true',
'providers.docker': 'true',
'providers.docker.exposedbydefault': 'false',
'entrypoints.web.address': ':80',
2023-07-27 02:51:56 +00:00
'entrypoints.web-tls.address': ':443',
'entrypoints.web-tls.http.tls.domains[0].main': HomelabDomain,
'entrypoints.web-tls.http.tls.domains[0].sans': '*.%s' % HomelabDomain,
2023-07-27 02:51:56 +00:00
'entrypoints.web-tls.http.tls.certresolver': 'letsencrypt',
'certificatesresolvers.letsencrypt.acme.dnschallenge': true,
'certificatesresolvers.letsencrypt.acme.dnschallenge.provider': 'luadns',
'certificatesresolvers.letsencrypt.acme.email': 'mat@mat.services',
'certificatesresolvers.letsencrypt.acme.storage': '/letsencrypt/acme.json',
2022-11-13 01:06:12 +00:00
}),
docker:: true,
2022-11-17 18:44:48 +00:00
webPort:: 8080,
2023-07-24 01:13:23 +00:00
ports: [
Port(80),
2023-07-27 02:51:56 +00:00
Port(443),
2023-07-24 01:13:23 +00:00
],
2023-07-27 02:51:56 +00:00
environment: {
LUADNS_API_USERNAME: 'mat@mat.services',
LUADNS_API_TOKEN: std.get(secrets, 'LETSENCRYPT_DNS_PROVIDER_KEY'),
2023-07-27 02:51:56 +00:00
},
2022-11-13 01:06:12 +00:00
traefik:: {
// 'traefik.http.routers.http-catchall.rule': 'hostregexp(`{host:.+}`)'
// 'traefik.http.routers.http-catchall.entrypoints': 'web'
// 'traefik.http.routers.http-catchall.middlewares': 'redirect-to-https'
// 'traefik.http.middlewares.redirect-to-https.redirectscheme.scheme': 'https'
},
2023-07-27 02:51:56 +00:00
volumes: { letsencrypt_data: '/letsencrypt' }
2022-11-13 01:06:12 +00:00
},
portainer: {
image: 'portainer/portainer-ce:latest',
docker:: true,
2022-11-17 18:44:48 +00:00
volumes: { portainer_portainer_data: '/data' },
2022-11-13 01:06:12 +00:00
webPort:: 9000,
2023-07-27 02:51:56 +00:00
// useful when traefik is having issues
// ports: [Port(9443)],
2022-11-13 01:06:12 +00:00
},
transmission: MediaService(
name='transmission',
env={
USER: 'mat',
PASS: std.get(secrets, 'TRANSMISSION_PASS'),
// PEERPORT: 55249,
},
2022-11-13 01:06:12 +00:00
mounts={ torrents: '/downloads' },
webPort=9091,
2023-07-24 01:13:23 +00:00
extras={ gluetun:: true },
2022-11-13 01:06:12 +00:00
),
// deluge: MediaService(
// name='deluge',
// env={ DELUGE_LOGLEVEL: 'error' },
// mounts={ torrents: '/downloads' },
// webPort=8112,
// extras={ gluetun:: true },
// external=true,
// ),
2022-11-13 01:06:12 +00:00
prowlarr: MediaService(
name='prowlarr',
tag='develop',
webPort=9696,
mounts={
torrents: '/downloads',
'passport-5tb': '/passport-5tb',
'passport-1tb': '/passport-1tb',
},
2023-07-24 01:13:23 +00:00
extras={ gluetun:: true },
external=true,
2022-11-13 01:06:12 +00:00
),
bazarr: MediaService(
name='bazarr',
webPort=6767,
mounts={
'passport-5tb': '/passport-5tb',
'passport-1tb': '/passport-1tb',
},
2023-07-24 01:13:23 +00:00
extras={ gluetun:: true },
external=true,
2022-11-13 01:06:12 +00:00
),
radarr: MediaService(
name='radarr',
webPort=7878,
mounts={
'passport-5tb/movies': '/passport-5tb',
'passport-1tb/movies': '/passport-1tb',
torrents: '/downloads',
},
2023-07-24 01:13:23 +00:00
extras={ gluetun:: true },
external=true,
2022-11-13 01:06:12 +00:00
),
sonarr: MediaService(
name='sonarr',
webPort=8989,
mounts={
'passport-5tb/tv': '/passport-5tb',
'passport-1tb/tv': '/passport-1tb',
torrents: '/downloads',
2023-07-24 01:13:23 +00:00
},
extras={ gluetun:: true },
external=true,
2022-11-13 01:06:12 +00:00
),
plex: {
image: 'plexinc/pms-docker',
environment: {
TZ: 'America/New_York',
2022-11-13 01:06:12 +00:00
PLEX_CLAIM: std.get(secrets, 'PLEX_CLAIM'),
2023-07-24 01:13:23 +00:00
// ADVERTISE_IP: std.get(secrets, 'PLEX_ADVERTISE_IP'),
2022-11-13 01:06:12 +00:00
},
2022-11-17 18:44:48 +00:00
volumes: { media_plex_config: '/config' },
2022-11-13 01:06:12 +00:00
mounts:: MediaMounts({
'torrents/plex-transcode': '/transcode',
'passport-5tb': '/passport-5tb',
'passport-1tb': '/passport-1tb',
}),
devices: ['/dev/dri:/dev/dri'],
webPort:: 32400,
ports: [
2023-07-27 02:51:56 +00:00
// plex
2023-07-24 01:13:23 +00:00
Port(32400),
2023-07-27 02:51:56 +00:00
// companion
2022-11-13 01:06:12 +00:00
Port(3005),
2023-07-27 02:51:56 +00:00
// dlna
2022-11-13 01:06:12 +00:00
Port(32469),
Port(1900, kind='udp'),
2023-07-27 02:51:56 +00:00
// gdm network discovery
2022-11-13 01:06:12 +00:00
Port(32410, kind='udp'),
Port(32412, kind='udp'),
Port(32413, kind='udp'),
Port(32414, kind='udp'),
2023-07-27 02:51:56 +00:00
// bonjour/avahi
// Port(5353, kind='udp'),
// plex for roku via companion
// Port(8324),
2022-11-13 01:06:12 +00:00
],
},
archivebox: {
image: 'archivebox/archivebox:dev',
2023-07-24 01:13:23 +00:00
command: 'server --quick-init 0.0.0.0:8000',
2022-11-17 18:44:48 +00:00
// TODO: hack to workaround https://github.com/ArchiveBox/ArchiveBox/issues/1002
2023-07-24 01:13:23 +00:00
// entrypoint: '/bin/bash',
// command: '-c "chown -R archivebox:archivebox /app/archivebox/core/migrations && /app/bin/docker_entrypoint.sh server --quick-init 0.0.0.0:8000"',
2022-11-13 01:06:12 +00:00
environment: {
ALLOWED_HOSTS: '*',
MEDIA_MAX_SIZE: '750m',
RESOLUTION: '1024,768',
},
mounts:: MediaMounts({ 'passport-5tb/archivebox': '/data' }),
webPort:: 8000,
host:: 'archive',
},
2022-11-18 02:11:22 +00:00
actual: {
image: 'actualbudget/actual-server:latest',
2022-11-18 02:11:22 +00:00
environment: {
userFilesPath: '/data/user',
serverFilesPath: '/data/server',
externalPort: 5006,
},
volumes: { actual_data: '/data' },
webPort:: 5006,
},
2022-11-13 01:06:12 +00:00
})