main
bel 2025-06-19 14:37:12 -06:00
commit bc7bea99ea
4 changed files with 156 additions and 0 deletions

5
go.mod Normal file
View File

@ -0,0 +1,5 @@
module gitea/home
go 1.22.2
require gopkg.in/yaml.v3 v3.0.1

4
go.sum Normal file
View File

@ -0,0 +1,4 @@
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

38
main.go Normal file
View File

@ -0,0 +1,38 @@
package main
import (
"fmt"
"log"
"net/http"
"os"
_ "gopkg.in/yaml.v3"
)
func main() {
f := "/mnt/internal.yaml"
if len(os.Args) > 1 {
f = os.Args[1]
}
log.Println("listening on 28031")
if err := http.ListenAndServe(":28031", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if err := func() error {
var internal struct {
Proxy2 string
Home string
}
var proxy2, home map[string]string
if b, err := os.ReadFile(f); err != nil {
return err
} else if err := yaml.Unmarshal(b, &internal); err != nil {
return err
}
return io.EOF
}(); err != nil {
fmt.Fprintln(w, err.Error())
}
fmt.Fprintln(w, f)
})); err != nil {
panic(err)
}
}

109
testdata/internal.yaml vendored Normal file
View File

@ -0,0 +1,109 @@
user: ""
pass: ""
p: 443
r: 550
b: 550
crt: /mnt/server.crt
key: /mnt/server.key
tcp: ""
timeout: 30s
proxy2: |
firefly2: http://192.168.0.86:9031
rssmon2: http://192.168.0.86:9101
rssmon3: http://192.168.0.86:33419
ytubespdrun: http://192.168.0.86:29687
vpntorfeed: http://192.168.0.86:29688
stuncaddsies: http://192.168.0.86:20018
stuncaddsiesi: http://192.168.0.86:20015
airsonic: http://192.168.0.86:4040
jellyfin: http://192.168.0.86:8096
ympd1: http://192.168.0.86:4041
ympd2: http://192.168.0.86:14041
mpd1: http://192.168.0.86:7000
mpd2: http://192.168.0.86:17000
calibre: http://192.168.0.86:8083
calibre4: http://192.168.0.86:8084
ovpn: http://192.168.0.86:61112
leanote: http://192.168.0.86:19191
gollum: http://192.168.0.86:38090
notes: http://192.168.0.86:38090
scratch: http://192.168.0.86:5000
gi: http://192.168.0.86:8080
cocalc: https://192.168.0.86:9901
copart: http://192.168.0.86:41241
sharelatex: http://192.168.0.86:9911
auth: http://192.168.0.86:51426
olaris: http://192.168.0.86:9096
gotify: http://192.168.0.86:22412
wyze0: https://192.168.0.83
wyze1: https://192.168.0.96
wyze2: https://192.168.0.97
wyze3: https://192.168.0.98
cctv: https://192.168.0.86:1080
synapse: http://192.168.0.86:39987
jitsim: http://192.168.0.86:39989
board: http://192.168.0.86:9666
gogs: http://192.168.0.86:59515
ss: http://192.168.0.86:8081
nullboard: http://192.168.0.86:21005
moolah: http://192.168.0.86:29833
comment-hugo: http://192.168.0.86:35812
hugo: http://192.168.0.86:35813
audioserve: http://192.168.0.86:30000
draw: http://192.168.0.86:49662
read: http://192.168.0.86:35843
moolah2: http://192.168.0.86:29843
ledger: http://192.168.0.86:29823
justvjs: http://192.168.0.86:59512
movienight: http://192.168.0.86:59512
terminal: https://192.168.0.86:8271
term: https://192.168.0.86:8271
vpntor: http://192.168.0.86:9091
justtor: http://192.168.0.86:9092
pihole: http://192.168.0.86:8888
syncthing: http://192.168.0.86:8384
miniflux: http://192.168.0.86:8033
miniflux2: http://192.168.0.86:8033
notes-server: http://192.168.0.86:39090
tube: http://192.168.0.86:36122
firestormy: http://192.168.0.86:21002
todo: http://192.168.0.86:39909
kanboard: http://192.168.0.86:38991
email: http://192.168.0.86:4420
workout-tracker: http://192.168.0.86:62328
ntfy: http://192.168.0.86:51427
jellyfin: http://192.168.0.86:8096
dev: https://192.168.0.86:58080
192: https://192.168.0.86:58080
bitwarden: http://192.168.0.86:35823
element: http://192.168.0.86:19989
talk: http://192.168.0.86:35844
gogs: http://192.168.0.86:59515
ai: https://kubecon-tabtab-ainize-team.endpoint.ainize.ai
tubesync: http://192.168.0.86:34848
audioserve: http://192.168.0.86:30000
moolah: http://192.168.0.86:29833
rand-mm: http://192.168.0.86:58041
rand-100: http://192.168.0.86:58042
search: http://192.168.0.86:29712
rand-workout-hiit: http://192.168.0.86:58043
rand-workout-rest: http://192.168.0.86:58044
tachi: http://192.168.0.86:31592
wghttp: http://192.168.0.86:61113
gitness: http://192.168.0.86:59525
gitea: http://192.168.0.86:59526
influxdb: http://192.168.0.86:38086
gallery: http://192.168.0.86:62312
photos: http://192.168.0.86:62322
ntfy: http://192.168.0.86:51427
rss: http://192.168.0.86:19512
feed: http://192.168.0.86:19513
cams: http://192.168.0.86:29898
jackett: http://192.168.0.86:29990
speedtest: http://192.168.0.86:41280
moolah: http://192.168.0.86:29843
audiobookshelf: http://192.168.0.86:62281
show-rss: http://192.168.0.86:41290
ytdlp2strm: http://192.168.0.86:38097
oauth: http://auth.scratch.com