Compare commits
No commits in common. "360233de40417658cfa5d856172e9a9aff4f3f2e" and "c575551d2e9418129473bf701e3d853504e05523" have entirely different histories.
360233de40
...
c575551d2e
3 changed files with 3 additions and 10 deletions
|
@ -4,9 +4,7 @@
|
||||||
<script>
|
<script>
|
||||||
const el = document.querySelector("pre");
|
const el = document.querySelector("pre");
|
||||||
const id = location.hash.slice(1);
|
const id = location.hash.slice(1);
|
||||||
const ws = new WebSocket(
|
const ws = new WebSocket("ws://localhost:8080/logs/socket/" + id);
|
||||||
location.origin.replace(/^http/, "ws") + "/logs/socket/" + id
|
|
||||||
);
|
|
||||||
window.ws = ws;
|
window.ws = ws;
|
||||||
ws.addEventListener("message", async (event) => {
|
ws.addEventListener("message", async (event) => {
|
||||||
el.append(await event.data.text());
|
el.append(await event.data.text());
|
||||||
|
|
|
@ -36,7 +36,6 @@ type config struct {
|
||||||
giteaUrl string
|
giteaUrl string
|
||||||
giteaUsername string
|
giteaUsername string
|
||||||
giteaPassword string
|
giteaPassword string
|
||||||
publicUrl string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func parseConfig() (c config) {
|
func parseConfig() (c config) {
|
||||||
|
@ -60,10 +59,5 @@ func parseConfig() (c config) {
|
||||||
log.Fatal("GITEA_PASSWORD is nil")
|
log.Fatal("GITEA_PASSWORD is nil")
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.publicUrl = os.Getenv("PUBLIC_URL"); len(c.publicUrl) == 0 {
|
|
||||||
log.Println("PUBLIC_URL is not defined, will default to localhost:8080")
|
|
||||||
c.publicUrl = "http://localhost:8080"
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,7 +140,8 @@ func (h webhook) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
runId := req.Header.Get("X-Gitea-Delivery")
|
runId := req.Header.Get("X-Gitea-Delivery")
|
||||||
runUrl := h.config.publicUrl + "/#" + runId
|
// TODO: make dynamic
|
||||||
|
runUrl := "http://localhost:8080/#" + runId
|
||||||
log.Printf("New run: %s", runUrl)
|
log.Printf("New run: %s", runUrl)
|
||||||
run := runss.newRun(runId)
|
run := runss.newRun(runId)
|
||||||
defer run.finishRun()
|
defer run.finishRun()
|
||||||
|
|
Loading…
Reference in a new issue