merge master

This commit is contained in:
Pierre Dubouilh 2019-10-15 19:53:03 +02:00
commit ccd6ae2bea
No known key found for this signature in database
GPG key ID: 8FE8BEDA9D4DB0D7
4 changed files with 7 additions and 2 deletions

View file

@ -1,5 +1,5 @@
name: ci
on: [push]
on: [push, pull_request]
jobs:
build:

View file

@ -68,6 +68,7 @@ func hash(s string) string {
func exitPath(w http.ResponseWriter, s ...interface{}) {
if r := recover(); r != nil {
log.Println("error", s, r)
w.WriteHeader(500)
w.Write([]byte("error"))
} else if *verb {
log.Println(s...)

View file

@ -3,6 +3,9 @@ COPY . /gossaSrc
RUN cd /gossaSrc && make
FROM alpine
ENV UID="1000" GID="1000" HOST="0.0.0.0" PORT="8001" PREFIX="/" FOLLOW_SYMLINKS="false" SKIP_HIDDEN_FILES="true" DATADIR="/shared"
EXPOSE 8001
RUN apk add --no-cache su-exec
COPY --from=builder /gossaSrc/gossa /gossa
ENTRYPOINT [ "/gossa", "-h", "0.0.0.0", "/shared" ]
RUN echo -e 'exec su-exec ${UID}:${GID} /gossa -h ${HOST} -p ${PORT} -k=${SKIP_HIDDEN_FILES} --symlinks=${FOLLOW_SYMLINKS} --prefix=${PREFIX} ${DATADIR}'>> /start.sh
ENTRYPOINT [ "sh", "/start.sh" ]

View file

@ -15,6 +15,7 @@ if you prefer building the image yourself :
% sudo docker run -v ~/LocalDirToShare:/shared -p 8001:8001 gossa
```
the options are settable through environment variables that can be passed starting off the docker image.
a fancy docker image using [Caddy](https://caddyserver.com/) is also provided. a simple config is embedded in the docker file, and shows how to use http basic authentication, and automatic TLS for hands-free https 🎉