Compare commits
4 commits
1a43693d6a
...
c98dc674d5
| Author | SHA1 | Date | |
|---|---|---|---|
| c98dc674d5 | |||
| de7b46a85d | |||
|
|
50524cade2 | ||
|
|
91db81b44d |
4 changed files with 42 additions and 2 deletions
4
.dockerignore
Normal file
4
.dockerignore
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
honk.db*
|
||||||
|
blob.db*
|
||||||
|
./honk
|
||||||
|
.git*
|
||||||
20
Dockerfile
Normal file
20
Dockerfile
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
FROM golang:1.19
|
||||||
|
|
||||||
|
RUN apt update && apt install -y libsqlite3-dev && rm -rf /var/cache/apt/*
|
||||||
|
|
||||||
|
RUN mkdir /honk-src
|
||||||
|
WORKDIR /honk-src
|
||||||
|
|
||||||
|
COPY go.mod go.sum /honk-src/
|
||||||
|
COPY . /honk-src/
|
||||||
|
RUN go get && go mod vendor
|
||||||
|
|
||||||
|
|
||||||
|
RUN make
|
||||||
|
RUN mv ./honk /bin/honk
|
||||||
|
|
||||||
|
CMD ["/bin/honk", "-datadir", "/honk-data"]
|
||||||
|
|
||||||
|
COPY docker-entrypoint.sh /honk-src/docker-entrypoint.sh
|
||||||
|
ENTRYPOINT ["/honk-src/docker-entrypoint.sh"]
|
||||||
|
|
||||||
15
docker-entrypoint.sh
Executable file
15
docker-entrypoint.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ ! -r "/honk-data/honk.db" ]; then
|
||||||
|
set -u
|
||||||
|
(
|
||||||
|
echo "$HONK_USERNAME"
|
||||||
|
echo "$HONK_PASSWORD"
|
||||||
|
echo "${HONK_LISTEN_ADDR:-"0.0.0.0:8080"}"
|
||||||
|
echo "${HONK_SERVER_HOSTNAME}"
|
||||||
|
) | honk -datadir "/honk-data" init
|
||||||
|
set +u
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec $*
|
||||||
|
|
||||||
5
fun.go
5
fun.go
|
|
@ -457,7 +457,7 @@ func memetize(honk *Honk) {
|
||||||
honk.Noise = re_memes.ReplaceAllStringFunc(honk.Noise, repl)
|
honk.Noise = re_memes.ReplaceAllStringFunc(honk.Noise, repl)
|
||||||
}
|
}
|
||||||
|
|
||||||
var re_quickmention = regexp.MustCompile("(^|[ \n])@[[:alnum:]]+([ \n.]|$)")
|
var re_quickmention = regexp.MustCompile("(^|[ \n])@[[:alnum:]]+([ \n.,']|$)")
|
||||||
|
|
||||||
func quickrename(s string, userid int64) string {
|
func quickrename(s string, userid int64) string {
|
||||||
nonstop := true
|
nonstop := true
|
||||||
|
|
@ -472,7 +472,8 @@ func quickrename(s string, userid int64) string {
|
||||||
prefix += "@"
|
prefix += "@"
|
||||||
m = m[1:]
|
m = m[1:]
|
||||||
tail := ""
|
tail := ""
|
||||||
if last := m[len(m)-1]; last == ' ' || last == '\n' || last == '.' {
|
if last := m[len(m)-1]; last == ' ' || last == '\n' ||
|
||||||
|
last == '.' || last == ',' || last == '\'' {
|
||||||
tail = m[len(m)-1:]
|
tail = m[len(m)-1:]
|
||||||
m = m[:len(m)-1]
|
m = m[:len(m)-1]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue