diff options
| author | Xe Iaso <me@xeiaso.net> | 2025-01-19 14:37:22 -0500 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2025-01-19 14:37:22 -0500 |
| commit | e34b2e76d8ac11cb439b50df62b5cd313d23c51c (patch) | |
| tree | ebc69405f4edaa0f1ed154448ccfb8e933e0d9e3 | |
| parent | 09e7fcfe4bbcfd4aa55549abfee7f81bf9a5dce7 (diff) | |
| download | x-e34b2e76d8ac11cb439b50df62b5cd313d23c51c.tar.xz x-e34b2e76d8ac11cb439b50df62b5cd313d23c51c.zip | |
cmd/anubis: add loading spinnersv1.11.0
Signed-off-by: Xe Iaso <me@xeiaso.net>
| -rw-r--r-- | cmd/anubis/index.templ | 91 | ||||
| -rw-r--r-- | cmd/anubis/index_templ.go | 16 | ||||
| -rw-r--r-- | cmd/anubis/static/js/main.mjs | 3 | ||||
| -rw-r--r-- | kube/aeacus/headscale/.gitignore | 1 | ||||
| -rw-r--r-- | kube/aeacus/headscale/1password.yaml | 6 | ||||
| -rw-r--r-- | kube/aeacus/headscale/configmap.yaml | 26 | ||||
| -rw-r--r-- | kube/aeacus/headscale/deployment.yaml | 87 | ||||
| -rw-r--r-- | kube/aeacus/headscale/ingress.yaml | 27 | ||||
| -rw-r--r-- | kube/aeacus/headscale/kustomization.yaml | 8 | ||||
| -rw-r--r-- | kube/aeacus/headscale/pvc.yaml | 13 | ||||
| -rw-r--r-- | kube/aeacus/headscale/service.yaml | 26 | ||||
| -rw-r--r-- | kube/aeacus/headscale/servicemonitor.yaml | 20 | ||||
| -rw-r--r-- | kube/aeacus/kustomization.yaml | 1 |
13 files changed, 317 insertions, 8 deletions
diff --git a/cmd/anubis/index.templ b/cmd/anubis/index.templ index 7148c8e..e0530d6 100644 --- a/cmd/anubis/index.templ +++ b/cmd/anubis/index.templ @@ -28,6 +28,96 @@ templ base(title string, body templ.Component) { .centered-div { text-align: center; } + + .lds-roller, + .lds-roller div, + .lds-roller div:after { + box-sizing: border-box; + } + .lds-roller { + display: inline-block; + position: relative; + width: 80px; + height: 80px; + } + .lds-roller div { + animation: lds-roller 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite; + transform-origin: 40px 40px; + } + .lds-roller div:after { + content: " "; + display: block; + position: absolute; + width: 7.2px; + height: 7.2px; + border-radius: 50%; + background: currentColor; + margin: -3.6px 0 0 -3.6px; + } + .lds-roller div:nth-child(1) { + animation-delay: -0.036s; + } + .lds-roller div:nth-child(1):after { + top: 62.62742px; + left: 62.62742px; + } + .lds-roller div:nth-child(2) { + animation-delay: -0.072s; + } + .lds-roller div:nth-child(2):after { + top: 67.71281px; + left: 56px; + } + .lds-roller div:nth-child(3) { + animation-delay: -0.108s; + } + .lds-roller div:nth-child(3):after { + top: 70.90963px; + left: 48.28221px; + } + .lds-roller div:nth-child(4) { + animation-delay: -0.144s; + } + .lds-roller div:nth-child(4):after { + top: 72px; + left: 40px; + } + .lds-roller div:nth-child(5) { + animation-delay: -0.18s; + } + .lds-roller div:nth-child(5):after { + top: 70.90963px; + left: 31.71779px; + } + .lds-roller div:nth-child(6) { + animation-delay: -0.216s; + } + .lds-roller div:nth-child(6):after { + top: 67.71281px; + left: 24px; + } + .lds-roller div:nth-child(7) { + animation-delay: -0.252s; + } + .lds-roller div:nth-child(7):after { + top: 62.62742px; + left: 17.37258px; + } + .lds-roller div:nth-child(8) { + animation-delay: -0.288s; + } + .lds-roller div:nth-child(8):after { + top: 56px; + left: 12.28719px; + } + @keyframes lds-roller { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } + } </style> </head> @@ -54,6 +144,7 @@ templ index() { <img style="display:none;" width="256" src={"/.within.website/x/cmd/anubis/static/img/happy.webp?cacheBuster=" + x.Version} /> <p id="status">Loading...</p> <script async type="module" src={"/.within.website/x/cmd/anubis/static/js/main.mjs?cacheBuster=" + x.Version}></script> + <div id="spinner" class="lds-roller"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div> <noscript> <p>Sadly, you must enable JavaScript to get past this challenge. I would love to not have to do this, but god is dead and AI scrapers have destroyed the common good.</p> </noscript> diff --git a/cmd/anubis/index_templ.go b/cmd/anubis/index_templ.go index 7f17ae1..ee06a60 100644 --- a/cmd/anubis/index_templ.go +++ b/cmd/anubis/index_templ.go @@ -60,14 +60,14 @@ func base(title string, body templ.Component) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><style>\n body,\n html {\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 65ch;\n margin-left: auto;\n margin-right: auto;\n }\n\n .centered-div {\n text-align: center;\n }\n </style></head><body id=\"top\"><main><center><h1 id=\"title\" class=\".centered-div\">") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><style>\n body,\n html {\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 65ch;\n margin-left: auto;\n margin-right: auto;\n }\n\n .centered-div {\n text-align: center;\n }\n\n .lds-roller,\n .lds-roller div,\n .lds-roller div:after {\n box-sizing: border-box;\n }\n .lds-roller {\n display: inline-block;\n position: relative;\n width: 80px;\n height: 80px;\n }\n .lds-roller div {\n animation: lds-roller 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n transform-origin: 40px 40px;\n }\n .lds-roller div:after {\n content: \" \";\n display: block;\n position: absolute;\n width: 7.2px;\n height: 7.2px;\n border-radius: 50%;\n background: currentColor;\n margin: -3.6px 0 0 -3.6px;\n }\n .lds-roller div:nth-child(1) {\n animation-delay: -0.036s;\n }\n .lds-roller div:nth-child(1):after {\n top: 62.62742px;\n left: 62.62742px;\n }\n .lds-roller div:nth-child(2) {\n animation-delay: -0.072s;\n }\n .lds-roller div:nth-child(2):after {\n top: 67.71281px;\n left: 56px;\n }\n .lds-roller div:nth-child(3) {\n animation-delay: -0.108s;\n }\n .lds-roller div:nth-child(3):after {\n top: 70.90963px;\n left: 48.28221px;\n }\n .lds-roller div:nth-child(4) {\n animation-delay: -0.144s;\n }\n .lds-roller div:nth-child(4):after {\n top: 72px;\n left: 40px;\n }\n .lds-roller div:nth-child(5) {\n animation-delay: -0.18s;\n }\n .lds-roller div:nth-child(5):after {\n top: 70.90963px;\n left: 31.71779px;\n }\n .lds-roller div:nth-child(6) {\n animation-delay: -0.216s;\n }\n .lds-roller div:nth-child(6):after {\n top: 67.71281px;\n left: 24px;\n }\n .lds-roller div:nth-child(7) {\n animation-delay: -0.252s;\n }\n .lds-roller div:nth-child(7):after {\n top: 62.62742px;\n left: 17.37258px;\n }\n .lds-roller div:nth-child(8) {\n animation-delay: -0.288s;\n }\n .lds-roller div:nth-child(8):after {\n top: 56px;\n left: 12.28719px;\n }\n @keyframes lds-roller {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n </style></head><body id=\"top\"><main><center><h1 id=\"title\" class=\".centered-div\">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 37, Col: 52} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 127, Col: 52} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -117,7 +117,7 @@ func index() templ.Component { var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs("/.within.website/x/cmd/anubis/static/img/pensive.webp?cacheBuster=" + x.Version) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 53, Col: 117} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 143, Col: 117} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { @@ -130,7 +130,7 @@ func index() templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs("/.within.website/x/cmd/anubis/static/img/happy.webp?cacheBuster=" + x.Version) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 54, Col: 126} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 144, Col: 126} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -143,13 +143,13 @@ func index() templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs("/.within.website/x/cmd/anubis/static/js/main.mjs?cacheBuster=" + x.Version) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 56, Col: 112} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 146, Col: 112} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "\"></script><noscript><p>Sadly, you must enable JavaScript to get past this challenge. I would love to not have to do this, but god is dead and AI scrapers have destroyed the common good.</p></noscript></div>") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "\"></script><div id=\"spinner\" class=\"lds-roller\"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div><noscript><p>Sadly, you must enable JavaScript to get past this challenge. I would love to not have to do this, but god is dead and AI scrapers have destroyed the common good.</p></noscript></div>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -185,7 +185,7 @@ func errorPage(message string) templ.Component { var templ_7745c5c3_Var10 string templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs("/.within.website/x/cmd/anubis/static/img/sad.webp?cacheBuster=" + x.Version) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 65, Col: 113} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 156, Col: 113} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) if templ_7745c5c3_Err != nil { @@ -198,7 +198,7 @@ func errorPage(message string) templ.Component { var templ_7745c5c3_Var11 string templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(message) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 66, Col: 16} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 157, Col: 16} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { diff --git a/cmd/anubis/static/js/main.mjs b/cmd/anubis/static/js/main.mjs index 272973b..f111bb4 100644 --- a/cmd/anubis/static/js/main.mjs +++ b/cmd/anubis/static/js/main.mjs @@ -14,6 +14,7 @@ const u = (url = "", params = {}) => { const status = document.getElementById('status'); const image = document.getElementById('image'); const title = document.getElementById('title'); + const spinner = document.getElementById('spinner'); status.innerHTML = 'Calculating...'; @@ -39,6 +40,8 @@ const u = (url = "", params = {}) => { title.innerHTML = "Success!"; status.innerHTML = `Done! Took ${t1 - t0}ms, ${nonce} iterations`; image.src = "/.within.website/x/cmd/anubis/static/img/happy.webp"; + spinner.innerHTML = ""; + spinner.style.display = "none"; setTimeout(() => { const redir = window.location.href; diff --git a/kube/aeacus/headscale/.gitignore b/kube/aeacus/headscale/.gitignore new file mode 100644 index 0000000..a539470 --- /dev/null +++ b/kube/aeacus/headscale/.gitignore @@ -0,0 +1 @@ +config.yaml
\ No newline at end of file diff --git a/kube/aeacus/headscale/1password.yaml b/kube/aeacus/headscale/1password.yaml new file mode 100644 index 0000000..b6fe635 --- /dev/null +++ b/kube/aeacus/headscale/1password.yaml @@ -0,0 +1,6 @@ +apiVersion: onepassword.com/v1 +kind: OnePasswordItem +metadata: + name: headscale +spec: + itemPath: "vaults/Kubernetes/items/Headscale" diff --git a/kube/aeacus/headscale/configmap.yaml b/kube/aeacus/headscale/configmap.yaml new file mode 100644 index 0000000..a77a2a7 --- /dev/null +++ b/kube/aeacus/headscale/configmap.yaml @@ -0,0 +1,26 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: headscale +data: + HEADSCALE_DATABASE_SQLITE_PATH: /etc/headscale/db.sqlite + HEADSCALE_DATABASE_TYPE: sqlite3 + HEADSCALE_DERP_AUTO_UPDATE_ENABLED: "true" + HEADSCALE_DERP_UPDATE_FREQUENCY: 24h + HEADSCALE_DERP_URLS: https://controlplane.tailscale.com/derpmap/default + HEADSCALE_DNS_BASE_DOMAIN: int.within.lgbt + HEADSCALE_DNS_MAGIC_DNS: "true" + HEADSCALE_DNS_CONFIG_NAMESERVERS_GLOBAL: "1.1.1.1 8.8.8.8" + HEADSCALE_DISABLE_CHECK_UPDATES: "true" + HEADSCALE_EPHEMERAL_NODE_INACTIVITY_TIMEOUT: 30m + HEADSCALE_PREFIXES_V4: "100.64.0.0/10" + HEADSCALE_PREFIXES_V6: "fd7a:115c:a1e0::/48" + HEADSCALE_PREFIXES_ALLOCATION: "random" + HEADSCALE_LISTEN_ADDR: "0.0.0.0:8000" + HEADSCALE_METRICS_LISTEN_ADDR: "0.0.0.0:9090" + HEADSCALE_NOISE: "{}" + HEADSCALE_NOISE_PRIVATE_KEY_PATH: "/etc/headscale/noise_private.key" + HEADSCALE_PRIVATE_KEY_PATH: "/etc/headscale/private.key" + HEADSCALE_SERVER_URL: "https://hs.xeserv.us" + HEADSCALE_OIDC_ONLY_START_IF_OIDC_IS_AVAILABLE: "true" + HEADSCALE_OIDC_STRIP_EMAIL_DOMAIN: "true" diff --git a/kube/aeacus/headscale/deployment.yaml b/kube/aeacus/headscale/deployment.yaml new file mode 100644 index 0000000..9008e4e --- /dev/null +++ b/kube/aeacus/headscale/deployment.yaml @@ -0,0 +1,87 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: headscale + labels: + app.kubernetes.io/instance: headscale + app.kubernetes.io/name: headscale + annotations: + keel.sh/policy: all + keel.sh/trigger: poll + keel.sh/pollSchedule: "@hourly" +spec: + revisionHistoryLimit: 3 + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app.kubernetes.io/name: headscale + app.kubernetes.io/instance: headscale + template: + metadata: + labels: + app.kubernetes.io/name: headscale + app.kubernetes.io/instance: headscale + spec: + serviceAccountName: default + automountServiceAccountToken: true + dnsPolicy: ClusterFirst + enableServiceLinks: true + containers: + - name: headscale + image: ghcr.io/juanfont/headscale:v0.23 + imagePullPolicy: Always + args: + - serve + - --config=/etc/headscale/cfg/headscale.yaml + resources: + limits: + cpu: "500m" + memory: "512Mi" + requests: + cpu: "100m" + memory: "256Mi" + ports: + - name: http + containerPort: 8000 + protocol: TCP + - name: metrics + containerPort: 9090 + protocol: TCP + - name: grpc + containerPort: 50443 + protocol: TCP + volumeMounts: + - name: config + mountPath: /etc/headscale + - name: secret + mountPath: /etc/headscale/cfg + livenessProbe: + failureThreshold: 3 + initialDelaySeconds: 0 + periodSeconds: 10 + tcpSocket: + port: 8000 + timeoutSeconds: 1 + readinessProbe: + failureThreshold: 3 + initialDelaySeconds: 0 + periodSeconds: 10 + tcpSocket: + port: 8000 + timeoutSeconds: 1 + startupProbe: + failureThreshold: 30 + initialDelaySeconds: 0 + periodSeconds: 5 + tcpSocket: + port: 8000 + timeoutSeconds: 1 + volumes: + - name: config + persistentVolumeClaim: + claimName: headscale-config + - name: secret + secret: + secretName: headscale
\ No newline at end of file diff --git a/kube/aeacus/headscale/ingress.yaml b/kube/aeacus/headscale/ingress.yaml new file mode 100644 index 0000000..9bc0fdd --- /dev/null +++ b/kube/aeacus/headscale/ingress.yaml @@ -0,0 +1,27 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod + nginx.ingress.kubernetes.io/force-ssl-redirect: "true" + name: headscale + labels: + app.kubernetes.io/instance: headscale + app.kubernetes.io/name: headscale +spec: + ingressClassName: nginx + tls: + - hosts: + - "hs.xeserv.us" + secretName: hs-xeserv-us-tls + rules: + - host: "hs.xeserv.us" + http: + paths: + - path: "/" + pathType: Prefix + backend: + service: + name: headscale + port: + number: 8000
\ No newline at end of file diff --git a/kube/aeacus/headscale/kustomization.yaml b/kube/aeacus/headscale/kustomization.yaml new file mode 100644 index 0000000..d46cd52 --- /dev/null +++ b/kube/aeacus/headscale/kustomization.yaml @@ -0,0 +1,8 @@ +resources: + - 1password.yaml + #- configmap.yaml + - deployment.yaml + - ingress.yaml + - pvc.yaml + - service.yaml + #- servicemonitor.yaml
\ No newline at end of file diff --git a/kube/aeacus/headscale/pvc.yaml b/kube/aeacus/headscale/pvc.yaml new file mode 100644 index 0000000..8f01b44 --- /dev/null +++ b/kube/aeacus/headscale/pvc.yaml @@ -0,0 +1,13 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: headscale-config + labels: + app.kubernetes.io/instance: headscale + app.kubernetes.io/name: headscale +spec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: "5Gi"
\ No newline at end of file diff --git a/kube/aeacus/headscale/service.yaml b/kube/aeacus/headscale/service.yaml new file mode 100644 index 0000000..a106e9d --- /dev/null +++ b/kube/aeacus/headscale/service.yaml @@ -0,0 +1,26 @@ +apiVersion: v1 +kind: Service +metadata: + name: headscale + labels: + app.kubernetes.io/service: headscale + app.kubernetes.io/instance: headscale + app.kubernetes.io/name: headscale +spec: + type: ClusterIP + ports: + - port: 8000 + targetPort: http + protocol: TCP + name: http + - port: 9090 + targetPort: metrics + protocol: TCP + name: metrics + - port: 50443 + targetPort: grpc + protocol: TCP + name: grpc + selector: + app.kubernetes.io/instance: headscale + app.kubernetes.io/name: headscale
\ No newline at end of file diff --git a/kube/aeacus/headscale/servicemonitor.yaml b/kube/aeacus/headscale/servicemonitor.yaml new file mode 100644 index 0000000..a2720b9 --- /dev/null +++ b/kube/aeacus/headscale/servicemonitor.yaml @@ -0,0 +1,20 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: headscale + labels: + app.kubernetes.io/name: headscale + app.kubernetes.io/instance: headscale + app.kubernetes.io/service: headscale +spec: + selector: + matchLabels: + app.kubernetes.io/service: headscale + app.kubernetes.io/name: headscale + app.kubernetes.io/instance: headscale + endpoints: + - interval: 30s + path: /metrics + port: metrics + scheme: http + scrapeTimeout: 10s
\ No newline at end of file diff --git a/kube/aeacus/kustomization.yaml b/kube/aeacus/kustomization.yaml index 842bc68..7e527de 100644 --- a/kube/aeacus/kustomization.yaml +++ b/kube/aeacus/kustomization.yaml @@ -1,3 +1,4 @@ resources: - core +- headscale - x
\ No newline at end of file |
