2024-02-05 13:13:44 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
kubenix,
|
|
|
|
...
|
|
|
|
}: {
|
2024-02-05 13:08:07 +00:00
|
|
|
kubernetes.helm.releases.piped = {
|
|
|
|
namespace = "default";
|
|
|
|
chart = kubenix.lib.helm.fetch {
|
|
|
|
repo = "https://helm.piped.video";
|
|
|
|
chart = "piped";
|
|
|
|
version = "5.0.0";
|
|
|
|
sha256 = "wfw0e37q52VW+bUMBmXILwUM0F1O1cH7Jk+6tmLAcS8=";
|
|
|
|
};
|
|
|
|
values = {
|
|
|
|
postgresql.enabled = false;
|
|
|
|
backend.config = {
|
|
|
|
FRONTEND_URL = "https://piped.gmem.ca";
|
|
|
|
API_URL = "https://pipedapi.gmem.ca";
|
|
|
|
PROXY_PART = "https://ytproxy.gmem.ca";
|
|
|
|
database.connection_url = "jdbc:postgresql://hippo-primary.default.svc:5432/piped";
|
|
|
|
database.secret = {
|
|
|
|
name = "hippo-pguser-piped";
|
|
|
|
username = "user";
|
|
|
|
password = "password";
|
|
|
|
};
|
|
|
|
};
|
2024-02-05 13:13:44 +00:00
|
|
|
fontend.env.BACKEND_HOSTNAME = "pipedapi.gmem.ca";
|
2024-02-05 13:08:07 +00:00
|
|
|
ingress = {
|
|
|
|
main = {
|
2024-02-05 13:13:44 +00:00
|
|
|
tls = [
|
|
|
|
{
|
|
|
|
hosts = ["piped.gmem.ca"];
|
|
|
|
secretName = "gmem-ca-wildcard";
|
|
|
|
}
|
|
|
|
];
|
2024-02-05 13:08:07 +00:00
|
|
|
hosts = [
|
2024-02-05 13:13:44 +00:00
|
|
|
{
|
|
|
|
host = "piped.gmem.ca";
|
|
|
|
paths = [{path = "/";}];
|
|
|
|
}
|
2024-02-05 13:08:07 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
backend = {
|
2024-02-05 13:13:44 +00:00
|
|
|
tls = [
|
|
|
|
{
|
|
|
|
hosts = ["pipedapi.gmem.ca"];
|
|
|
|
secretName = "gmem-ca-wildcard";
|
|
|
|
}
|
|
|
|
];
|
2024-02-05 13:08:07 +00:00
|
|
|
hosts = [
|
2024-02-05 13:13:44 +00:00
|
|
|
{
|
|
|
|
host = "pipedapi.gmem.ca";
|
|
|
|
paths = [{path = "/";}];
|
|
|
|
}
|
2024-02-05 13:08:07 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
ytproxy = {
|
2024-02-05 13:13:44 +00:00
|
|
|
tls = [
|
|
|
|
{
|
|
|
|
hosts = ["ytproxy.gmem.ca"];
|
|
|
|
secretName = "gmem-ca-wildcard";
|
|
|
|
}
|
|
|
|
];
|
2024-02-05 13:08:07 +00:00
|
|
|
hosts = [
|
2024-02-05 13:13:44 +00:00
|
|
|
{
|
|
|
|
host = "ytproxy.gmem.ca";
|
|
|
|
paths = [{path = "/";}];
|
|
|
|
}
|
2024-02-05 13:08:07 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
kubernetes.resources.cronJobs.piped-refresh.spec = {
|
|
|
|
schedule = "*/5 * * * *";
|
|
|
|
jobTemplate.spec.template.spec = {
|
|
|
|
restartPolicy = "Never";
|
|
|
|
containers.refresh-subscriptions = {
|
|
|
|
image = "alpine:3.15";
|
2024-02-05 13:13:44 +00:00
|
|
|
envFrom = [{secretRef.name = "hippo-pguser-piped";}];
|
2024-02-05 13:08:07 +00:00
|
|
|
command = [
|
|
|
|
"/bin/ash"
|
|
|
|
"-c"
|
|
|
|
''
|
2024-02-05 13:13:44 +00:00
|
|
|
apk --no-cache add postgresql-client curl &&
|
|
|
|
export PGPASSWORD=$password &&
|
|
|
|
export subs=$(psql -U piped -h hippo-primary.default.svc -qtAX -c 'select id from public.pubsub;') &&
|
|
|
|
while IFS= read -r line; do
|
|
|
|
curl -k "https://pipedapi.gmem.ca/channel/$line" > /dev/null
|
|
|
|
done < <(printf '%s' "$subs")
|
|
|
|
''
|
2024-02-05 13:08:07 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|