Browse Source

Updated binnit to latest and added new files

Signed-off-by: Nagy Károly Gábriel <k@jpi.io>
master
Nagy Károly Gábriel 6 years ago
parent
commit
9a89396cbc
Signed by: karasz
GPG Key ID: C6BA1070A8CBDA0C
  1. 16
      Dockerfile
  2. BIN
      binnit/binnit
  3. 8
      binnit/binnit.cfg
  4. 23
      binnit/html/index.html
  5. 17
      binnit/html/paste.html
  6. 55
      binnit/static/index.css
  7. 61
      binnit/static/paste.css
  8. 7
      opt/binnit.cfg

16
Dockerfile

@ -1,16 +1,10 @@
FROM alpine:3.8
FROM scratch
# Make directories
# Copy the static executable and config.
# Copy everything
COPY binnit /
RUN mkdir -p /opt/binnit/log
RUN mkdir -p /opt/binnit/html
RUN mkdir -p /opt/binnit/paste
COPY opt/binnit /opt/binnit/
COPY opt/binnit.cfg /opt/binnit/
# Set port
# Set our port
EXPOSE 80
# Run the binary.
ENTRYPOINT ["/opt/binnit/binnit","-c","/opt/binnit/binnit.cfg"]
ENTRYPOINT ["/binnit/binnit","-c","/binnit/binnit.cfg"]

BIN
opt/binnit → binnit/binnit

Binary file not shown.

8
binnit/binnit.cfg

@ -0,0 +1,8 @@
server_name=paste.jpi.io
bind_addr=0.0.0.0
bind_port=80
paste_dir=/binnit/paste
templ_dir=/binnit/html
static_dir=/binnit/static
max_size=16384
log_file=/binnit/log/binnit.log

23
binnit/html/index.html

@ -0,0 +1,23 @@
<html>
<head>
<link rel="stylesheet" media="screen, projection" href="/static/index.css">
</head>
<body>
<h1>Binnit</h1>
<form method="POST">
<div class="title">
<p class="title">
<input type="text" name="title" placeholder="Title goes here..."/>
</p>
<p class="action">
<input type="checkbox" name="show" value="1" id="id_show" checked />
<label for "id_show"> Show link </label>
<input type="submit" class="button" value="Binnit!">
</p>
</div>
<div class="title">
<textarea name="paste" cols="40" placeholder="The pasta goes here..." rows="10" maxlength="262144000"></textarea>
</div>
</form>
</body>
</html>

17
binnit/html/paste.html

@ -0,0 +1,17 @@
<html>
<head>
<title>binit</title>
<link rel="stylesheet" media="screen, projection" href="/static/paste.css">
</head>
<body>
<div class="title">
Title: {{TITLE}}
</div>
<div class="date">
Date: {{DATE}}
</div>
<div class="content">
{{CONTENT}}
</div>
</body>
</html>

55
binnit/static/index.css

@ -0,0 +1,55 @@
body {
margin: 0px;
font-family:"Avenir Next","Helvetica Neue",Helvetica,Arial;
font-size:20px;
}
h1 {
margin: 0px;
padding: 10px 30px 0 30px;
line-height:2.5;
color: #fff;
background: linear-gradient(to right, #4A90E2, #72B4E4);
}
div.title {
margin: 3px;
padding: 0 30px 0 30px;
display: flex;
}
input.button {
padding: 5px;
font-size: 20px;
color: #fff;
background-color: #4a90e2;
border: 1px solid #33639c;
border-radius: 3px;
}
input.text {
font-size:16px;
height:20px;
border: 1px solid #ededed;
width: 100%
}
textarea {
width: 100%;
resize: none;
}
p.action {
margin-left: auto;
align-items: center;
display: flex;
}
p.title {
display: flex;
}
label {
font-size: 15px;
margin-right: 20px;
}

61
binnit/static/paste.css

@ -0,0 +1,61 @@
body {
margin-top: 10px;
line-height:1.6;
font-size:20px;
}
div.title {
border-bottom: 2px solid #444444;
border-left: 4px solid #444444;
margin: 3px;
padding-left: 5px;
}
div.raw_title {
border-top: 2px solid #444444;
border-left: 4px solid #444444;
margin: 3px;
padding-left: 5px;
}
div.date {
border-bottom: 2px solid #444444;
border-left: 4px solid #444444;
margin: 3px;
padding-left: 5px;
}
div.content {
margin-left: 30px;
border: solid 3px #444444;
padding: 5px;
width: 90%;
}
textarea.raw_content {
margin-left: 30px;
border: solid 3px #999999;
width: 91%;
height: 200px;
padding: 5px;
}
table, tr, td {
border: 0px;
margin: 0px;
padding: 0px;
border-collapse: collapse;
}
td.lineno {
background-color: #cccccc;
text-align: right;
vertical-align: middle;
padding-right: 3px;
}
td.line {
margin-left: 5px;
padding-left: 5px;
border-left: solid 3px #666666;
}

7
opt/binnit.cfg

@ -1,7 +0,0 @@
server_name=paste.jpi.io
bind_addr=0.0.0.0
bind_port=80
paste_dir=/opt/binnit/paste
templ_dir=/opt/binnit/html
max_size=16384
log_file=/opt/binnit/log/binnit.log
Loading…
Cancel
Save