Compare commits
4 Commits
1a43693d6a
...
c98dc674d5
Author | SHA1 | Date |
---|---|---|
Dirk Nederveen | c98dc674d5 | |
Dirk Nederveen | de7b46a85d | |
Ted Unangst | 50524cade2 | |
Ted Unangst | 91db81b44d |
|
@ -0,0 +1,4 @@
|
|||
honk.db*
|
||||
blob.db*
|
||||
./honk
|
||||
.git*
|
|
@ -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"]
|
||||
|
|
@ -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)
|
||||
}
|
||||
|
||||
var re_quickmention = regexp.MustCompile("(^|[ \n])@[[:alnum:]]+([ \n.]|$)")
|
||||
var re_quickmention = regexp.MustCompile("(^|[ \n])@[[:alnum:]]+([ \n.,']|$)")
|
||||
|
||||
func quickrename(s string, userid int64) string {
|
||||
nonstop := true
|
||||
|
@ -472,7 +472,8 @@ func quickrename(s string, userid int64) string {
|
|||
prefix += "@"
|
||||
m = m[1:]
|
||||
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:]
|
||||
m = m[:len(m)-1]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue