キャッチ・アンド・リリース!
Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja> git-svn-id: https://svn.yakumo.dev/yakumo.izuru/yukari/trunk@151 f3bd38d9-da89-464d-a02a-eb04e43141b5
This commit is contained in:
parent
415db42f42
commit
99977e1d8f
@ -1,3 +1,7 @@
|
||||
# v0.2.4 - 2024.03.24
|
||||
* Replace invalid favicon with one sourced from [here](https://en.touhouwiki.net/wiki/File:Th123YukariSigil.png), as well as using `//go:embed` for it
|
||||
* Add rc.d files for FreeBSD and OpenBSD, respectively
|
||||
|
||||
# v0.2.3 - 2024.03.21
|
||||
* Document the configuration file format, which is INI-style (which is compatible to the old format in the codebase, though it's now called as `config.Config.<key>`)
|
||||
* Manual page has been rewritten (using `mdoc(7)`)
|
||||
|
BIN
cmd/yukari/favicon.ico
Normal file
BIN
cmd/yukari/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
@ -76,7 +76,6 @@ type HTMLMainPageFormParam struct {
|
||||
URLParamName string
|
||||
}
|
||||
|
||||
var faviconBytes []byte
|
||||
var htmlFormExtension *template.Template
|
||||
var htmlBodyExtension *template.Template
|
||||
var htmlMainPageForm *template.Template
|
||||
@ -87,11 +86,10 @@ var htmlHeadContentType string
|
||||
var htmlPageStart string
|
||||
//go:embed templates/yukari_stop.html
|
||||
var htmlPageStop string
|
||||
//go:embed favicon.ico
|
||||
var faviconBytes []byte
|
||||
|
||||
func init() {
|
||||
FaviconBase64 := "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAF0lEQVRIx2NgGAWjYBSMglEwCkbBSAcACBAAAeaR9cIAAAAASUVORK5CYII"
|
||||
|
||||
faviconBytes, _ = base64.StdEncoding.DecodeString(FaviconBase64)
|
||||
var err error
|
||||
htmlFormExtension, err = template.New("html_form_extension").Parse(
|
||||
`<input type="hidden" name="yukariurl" value="{{.BaseURL}}" />{{if .YukariHash}}<input type="hidden" name="yukarihash" value="{{.YukariHash}}" />{{end}}`)
|
||||
@ -387,7 +385,7 @@ func appRequestHandler(ctx *fasthttp.RequestCtx) bool {
|
||||
|
||||
// server favicon.ico
|
||||
if bytes.Equal(ctx.Path(), []byte("/favicon.ico")) {
|
||||
ctx.SetContentType("image/png")
|
||||
ctx.SetContentType("image/vnd.microsoft.icon")
|
||||
ctx.Write(faviconBytes)
|
||||
return true
|
||||
}
|
||||
|
23
rc.d/yukari
Normal file
23
rc.d/yukari
Normal file
@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
# $TheSupernovaDuo$
|
||||
|
||||
# PROVIDE: yukari
|
||||
# REQUIRE: DAEMON NETWORKING
|
||||
# KEYWORD: shutdown
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="yukari"
|
||||
rcvar="yukari_enable"
|
||||
|
||||
load_rc_config "${name}"
|
||||
|
||||
: ${yukari_enable="NO"}
|
||||
: ${yukari_config=""}
|
||||
|
||||
pidfile="/var/run/${name}.pid"
|
||||
command="/usr/sbin/daemon"
|
||||
procname="/usr/local/bin/${name}"
|
||||
command_args="-S -m 3 -s info -l daemon -p ${pidfile} /usr/bin/env ${procname} ${yukari_args}"
|
||||
|
||||
run_rc_command "$1"
|
10
rc.d/yukarid
Normal file
10
rc.d/yukarid
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/ksh
|
||||
# $TheSupernovaDuo
|
||||
daemon="/usr/local/bin/yukari"
|
||||
|
||||
. /etc/rc.d/rc.subr
|
||||
|
||||
rc_bg=YES
|
||||
rc_reload=NO
|
||||
|
||||
rc_cmd "$1"
|
Loading…
x
Reference in New Issue
Block a user