mutantmonkey
6 years ago
26 changed files with 233 additions and 167 deletions
-
17Dockerfile
-
1README.md
-
1csp_test.go
-
4display.go
-
12server.go
-
4server_test.go
-
10static/css/dropzone.css
-
3static/css/github-markdown.css
-
94static/css/linx.css
-
6static/js/bin.js
-
12static/js/upload.js
-
1templates.go
-
2templates/404.html
-
2templates/API.html
-
1templates/base.html
-
4templates/display/audio.html
-
7templates/display/base.html
-
20templates/display/bin.html
-
2templates/display/file.html
-
4templates/display/image.html
-
4templates/display/pdf.html
-
20templates/display/story.html
-
4templates/display/video.html
-
4templates/index.html
-
16templates/paste.html
-
1upload.go
@ -1,15 +1,26 @@ |
|||||
FROM golang:alpine |
|
||||
|
FROM golang:alpine3.8 AS build |
||||
|
|
||||
|
COPY . /go/src/github.com/andreimarcu/linx-server |
||||
|
WORKDIR /go/src/github.com/andreimarcu/linx-server |
||||
|
|
||||
RUN set -ex \ |
RUN set -ex \ |
||||
&& apk add --no-cache --virtual .build-deps git \ |
&& apk add --no-cache --virtual .build-deps git \ |
||||
&& go get github.com/andreimarcu/linx-server \ |
|
||||
|
&& go get -v . \ |
||||
&& apk del .build-deps |
&& apk del .build-deps |
||||
|
|
||||
|
FROM alpine:3.8 |
||||
|
|
||||
|
COPY --from=build /go/bin/linx-server /usr/local/bin/linx-server |
||||
|
|
||||
|
ENV GOPATH /go |
||||
|
COPY static /go/src/github.com/andreimarcu/linx-server/static/ |
||||
|
COPY templates /go/src/github.com/andreimarcu/linx-server/templates/ |
||||
|
|
||||
RUN mkdir -p /data/files && mkdir -p /data/meta && chown -R 65534:65534 /data |
RUN mkdir -p /data/files && mkdir -p /data/meta && chown -R 65534:65534 /data |
||||
|
|
||||
VOLUME ["/data/files", "/data/meta"] |
VOLUME ["/data/files", "/data/meta"] |
||||
|
|
||||
EXPOSE 8080 |
EXPOSE 8080 |
||||
USER nobody |
USER nobody |
||||
ENTRYPOINT ["/go/bin/linx-server", "-bind=0.0.0.0:8080", "-filespath=/data/files/", "-metapath=/data/meta/"] |
|
||||
|
ENTRYPOINT ["/usr/local/bin/linx-server", "-bind=0.0.0.0:8080", "-filespath=/data/files/", "-metapath=/data/meta/"] |
||||
CMD ["-sitename=linx", "-allowhotlink"] |
CMD ["-sitename=linx", "-allowhotlink"] |
@ -1,5 +1,7 @@ |
|||||
{% extends "base.html" %} |
{% extends "base.html" %} |
||||
|
|
||||
{% block content %} |
{% block content %} |
||||
|
<div class="error-404"> |
||||
<a href="{{ sitepath }}"><img src='{{ sitepath }}static/images/404.jpg'></a> |
<a href="{{ sitepath }}"><img src='{{ sitepath }}static/images/404.jpg'></a> |
||||
|
</div> |
||||
{% endblock %} |
{% endblock %} |
@ -1,7 +1,7 @@ |
|||||
{% extends "base.html" %} |
{% extends "base.html" %} |
||||
|
|
||||
{% block main %} |
{% block main %} |
||||
<a href="{{ sitepath }}selif/{{ filename }}"> |
|
||||
<img class="display-image" src="{{ sitepath }}selif/{{ filename }}" /> |
|
||||
|
<a href="{{ sitepath }}{{ selifpath }}{{ filename }}"> |
||||
|
<img class="display-image" src="{{ sitepath }}{{ selifpath }}{{ filename }}" /> |
||||
</a> |
</a> |
||||
{% endblock %} |
{% endblock %} |
@ -1,10 +1,10 @@ |
|||||
{% extends "base.html" %} |
{% extends "base.html" %} |
||||
|
|
||||
{% block main %} |
{% block main %} |
||||
<object class="display-pdf" data="{{ sitepath }}selif/{{ filename }}" type="application/pdf"> |
|
||||
|
<object class="display-pdf" data="{{ sitepath }}{{ selifpath }}{{ filename }}" type="application/pdf"> |
||||
|
|
||||
<p>It appears your Web browser is not configured to display PDF files. |
<p>It appears your Web browser is not configured to display PDF files. |
||||
No worries, just <a href="{{ sitepath }}selif/{{ filename }}">click here to download the PDF file.</a></p> |
|
||||
|
No worries, just <a href="{{ sitepath }}{{ selifpath }}{{ filename }}">click here to download the PDF file.</a></p> |
||||
|
|
||||
</object> |
</object> |
||||
{% endblock %} |
{% endblock %} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue