feat: remove matrix #7

Merged
ange merged 3 commits from devel into prod 2025-07-22 18:18:33 +00:00
9 changed files with 39 additions and 54 deletions

1
README.md Normal file
View File

@ -0,0 +1 @@
# yw5n.com

View File

@ -1,3 +1,3 @@
termux.sh https://git.gmoker.com/ange/termux/raw/branch/main/install.sh termux.sh https://git.gmoker.com/ange/termux/raw/branch/main/install.sh
dotfiles.sh https://git.gmoker.com/ange/dotfiles dotfiles https://git.gmoker.com/ange/dotfiles
arch.sh https://git.gmoker.com/ange/arch arch https://git.gmoker.com/ange/arch

2
go.mod
View File

@ -1,3 +1,3 @@
module main module main
go 1.24.1 go 1.24

View File

@ -24,11 +24,6 @@
<div id="main"> <div id="main">
<table> <table>
<tr>
<td>Matrix (Element)</td>
<td id="matrix">{{template "matrix"}}</td>
<td><button onclick="copyElem('matrix')">Copy</button></td>
</tr>
<tr> <tr>
<td>Discord</td> <td>Discord</td>
<td id="discord">{{template "discord"}}</td> <td id="discord">{{template "discord"}}</td>

View File

@ -1,36 +1,35 @@
#!/bin/bash -e #!/bin/bash -e
set -o pipefail set -o pipefail
function kapply() { kapply() {
for f in "$@"; do for f in "$@"; do
kubectl apply -f <(envsubst < "manifests/$f") kubectl apply --server-side \
-f<(envsubst "$(env | sed 's/^/$/')" < "manifests/$f")
done done
}; export -f kapply }; export -f kapply
function kcreatesec() { kcreatesec() {
kubectl create secret generic --dry-run=client -oyaml "$@" | kubectl replace -f- kubectl apply --server-side \
-f<(kubectl create secret generic --dry-run=client -oyaml "$@")
}; export -f kcreatesec }; export -f kcreatesec
function kcreatecm() { kcreatecm() {
kubectl create configmap --dry-run=client -oyaml "$@" | kubectl replace -f- kubectl apply --server-side \
-f<(kubectl create configmap --dry-run=client -oyaml "$@")
}; export -f kcreatecm }; export -f kcreatecm
function kgseckey() { kgseckey() {
local sec="$1"; shift local sec="$1"; shift
local key="$1"; shift local key="$1"; shift
if ! kubectl get secret "$sec" -ojson | jq -re ".data.\"$key\" // empty" | base64 -d; then kubectl get secret "$sec" -ojson | jq -re ".data.\"$key\"" | base64 -d
return 1
fi
}; export -f kgseckey }; export -f kgseckey
function kgcmkey() { kgcmkey() {
local cm="$1"; shift local cm="$1"; shift
local key="$1"; shift local key="$1"; shift
if ! kubectl get configmap "$cm" -ojson | jq -re ".data.\"$key\" // empty"; then kubectl get configmap "$cm" -ojson | jq -re ".data.\"$key\""
return 1
fi
}; export -f kgcmkey }; export -f kgcmkey

View File

@ -1,25 +0,0 @@
package main
import (
"log"
"os"
"strings"
)
var ALIASES map[string]string
func generateAliases() {
f, err := os.ReadFile("aliases.txt")
if err != nil {
log.Fatal(err)
}
ALIASES = make(map[string]string)
for l := range strings.SplitSeq(string(f), "\n") {
sp := strings.Fields(l)
if len(sp) == 2 {
ALIASES[sp[0]] = sp[1]
}
}
}

View File

@ -3,12 +3,31 @@ package main
import ( import (
"bytes" "bytes"
"html/template" "html/template"
"log"
"os"
"path/filepath" "path/filepath"
"regexp" "regexp"
"strings"
) )
var TMPL map[string][]byte var ALIASES map[string]string
func generateAliases() {
f, err := os.ReadFile("aliases.txt")
if err != nil {
log.Fatal(err)
}
ALIASES = make(map[string]string)
for l := range strings.SplitSeq(string(f), "\n") {
sp := strings.Fields(l)
if len(sp) == 2 {
ALIASES[sp[0]] = sp[1]
}
}
}
var TMPL map[string][]byte
func generateTmpl() { func generateTmpl() {
files, _ := filepath.Glob("html/*.html") files, _ := filepath.Glob("html/*.html")
re := regexp.MustCompile("html/(.+).html") re := regexp.MustCompile("html/(.+).html")

2
ssh
View File

@ -1 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDUccdlgUHzV+AhWDyjwcG4QwSNbybIV8MF7c6XpKQl4 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDUccdlgUHzV+AhWDyjwcG4QwSNbybIV8MF7c6XpKQl4 ange@yw5n.com

View File

@ -1,7 +1,3 @@
{{define "matrix"}}
<a href="https://app.element.io/#/user/@ange:gmoker.com" target="_blank" rel="noreferrer noopener">@ange:gmoker.com</a>
{{end}}
{{define "discord"}} {{define "discord"}}
@elrilio @elrilio
{{end}} {{end}}