Skip to content

Commit 3f92211

Browse files
authored
Merge pull request #3 from cig0/stage
Prod
2 parents 5876098 + 6332eca commit 3f92211

File tree

6 files changed

+23
-42
lines changed

6 files changed

+23
-42
lines changed

.vscode/launch.json

-18
This file was deleted.

Dockerfile

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG GOLANG_VER=1.12.4-stretch
2-
ARG ALPINE_VER=3.9.3
2+
ARG ALPINE_VER=3.9.4
33

44
## Stage 0: build Go executable from code and templates
55
FROM golang:${GOLANG_VER} as builder
@@ -15,8 +15,6 @@ RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - && \
1515
mkdir -p /go/src/github.com/cig0 && \
1616
ln -sf /go/src/app /go/src/github.com/cig0/tornote
1717

18-
VOLUME /go/src/app/
19-
2018
RUN make install
2119

2220
## Stage 1: grab compiled binary
@@ -35,10 +33,8 @@ RUN apk add --update sqlite && \
3533
mkdir /lib64 && \
3634
ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
3735

38-
VOLUME /go/src/app/
39-
4036
USER limited
4137

4238
EXPOSE 8080
4339

44-
CMD ["tornote", "-addr", ":8080"]
40+
ENTRYPOINT ["tornote", "-addr", ":8080"]

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ If you have ideas to improve safety/security please open a new issue.
2121
## Running with Docker
2222

2323
```bash
24-
$ docker build -t tornote-app .
25-
$ docker run -p 80:8080 --name tornote tornote-app
24+
$ docker build --no-cache -t tornote .
25+
$ docker run --name tornote -p 80:8080/tcp --memory 10m --memory-reservation 8m --cpus 0.10 tornote
2626
```
2727

2828
## License

templates/index.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<!-- Warning -->
55
<noscript>
66
<div id="warn" class="alert alert-danger" role="alert">
7-
<strong>Warning!</strong> You must enable JavaScript because all encryption going inside web browser.
7+
<strong>Warning!</strong> You must enable JavaScript since encryption happens inside your web browser.
88
</div>
99
</noscript>
1010

@@ -13,15 +13,15 @@
1313
<form id="note" action="/note" method="post">
1414
<div class="form-group">
1515
<label for="note">
16-
Write your note below
17-
<span class="glyphicon glyphicon-edit small"></span>:
16+
Write your secure note below
17+
<span class="glyphicon glyphicon-edit small"></span>
1818
</label>
19-
<textarea class="form-control" name="body" cols="80" rows="4"></textarea>
19+
<textarea class="form-control" name="body" cols="80" rows="16"></textarea>
2020
<p class="help-block">
2121
Text will be encrypted with
2222
<a href="https://en.wikipedia.org/wiki/Advanced_Encryption_Standard">AES-256</a>
2323
<span class="glyphicon glyphicon-lock small"></span>
24-
algorithm and secret (generated on client-side).
24+
algorithm and a secret generated on your browser.
2525
</p>
2626
</div>
2727
<div class="form-group text-center">
@@ -36,7 +36,7 @@
3636
<!-- Secret link -->
3737
<div id="done" class="hidden">
3838
<div class="form-group">
39-
<label for="secret_link">Your secret message available on the link:</label>
39+
<label for="secret_link">Your secret message is available at:</label>
4040
<pre id="secret_link"></pre>
4141
</div>
4242
<div class="form-group text-center">

templates/layout/base.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
<meta charset="utf-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="viewport" content="width=device-width, initial-scale=1">
8-
<meta name="description" content="Anonymous self-destructing notes written in Go.">
8+
<meta name="description" content="Anonymous self-destructing notes">
99
<meta name="author" content="">
1010

1111
<title>Tornote - {{ template "title" . }}</title>
1212

13-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
14-
integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7"
13+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
14+
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
1515
crossorigin="anonymous">
1616
<link rel="stylesheet" href="/public/styles.css">
1717

18-
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
18+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
1919
</head>
2020
<body>
2121

templates/note.html

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
{{ define "title" }}Anonymous Self-destructing Notes{{ end }}
1+
{{ define "title" }}Anonymous self-destructing notes{{ end }}
22

33
{{ define "content" }}
44
<div class="form-group">
5-
<label for="secret_note">
6-
This note permanently deleted after reading
7-
<span class="glyphicon glyphicon-fire"></span>:
8-
</label>
5+
<label for="secret_note">Here is your secret message:</label>
96
<pre id="secret_note" class="hidden">{{.}}</pre>
7+
<p align='center'>The note on the server has already been destroyed
8+
<span class="glyphicon glyphicon-fire"></span>
9+
</p>
10+
<p align='center'>
11+
<em>You won't be able to access this data anymore!</em>
12+
</p>
1013
</div>
1114
<div class="form-group text-center">
1215
<a href="/" class="btn btn-lg btn-success">
1316
<span class="glyphicon glyphicon-record small"></span>
1417
Create another note
1518
</a>
1619
</div>
17-
{{ end }}
20+
{{ end }}

0 commit comments

Comments
 (0)