summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Friedli2020-04-13 22:48:47 +0200
committerJan Friedli2020-04-13 22:48:47 +0200
commitbaed99b5a100b4ad4ee9083d396d5c254e49a715 (patch)
tree7d13abadb591985d30da6c23eef2e3a621bd5535
parent8a45eb2f5399aaa2a022389086a4afde22b00477 (diff)
added info page
Diffstat (limited to '')
-rw-r--r--main.py7
-rw-r--r--static/style.css161
-rw-r--r--templates/download.html2
-rw-r--r--templates/index.html8
-rw-r--r--templates/info.html61
5 files changed, 237 insertions, 2 deletions
diff --git a/main.py b/main.py
index 4cdb43e..18811b9 100644
--- a/main.py
+++ b/main.py
@@ -40,6 +40,13 @@ def create_app(test_config=None):
40 api = Api(app) 40 api = Api(app)
41 CORS(app, resources={r"/api/*": {"origins": utils.get_allow_origin_header_value()}}) 41 CORS(app, resources={r"/api/*": {"origins": utils.get_allow_origin_header_value()}})
42 42
43 @app.route('/info')
44 def info():
45 get_supported_extensions()
46 return render_template(
47 'info.html', extensions=get_supported_extensions()
48 )
49
43 @app.route('/download/<string:key>/<string:filename>') 50 @app.route('/download/<string:key>/<string:filename>')
44 def download_file(key: str, filename: str): 51 def download_file(key: str, filename: str):
45 if filename != secure_filename(filename): 52 if filename != secure_filename(filename):
diff --git a/static/style.css b/static/style.css
index 2cd09ea..46d10de 100644
--- a/static/style.css
+++ b/static/style.css
@@ -77,4 +77,165 @@ details[open] > summary:before {
77 margin-bottom: 1rem; 77 margin-bottom: 1rem;
78 border-radius: 3px; 78 border-radius: 3px;
79 width: 50vw; 79 width: 50vw;
80 position:relative;
81}
82
83.info-link {
84 position:absolute;
85 right: 10px;
86 bottom: 10px;
87 border-radius: 45%;
88 border: none;
89 padding: 6px;
90 display: flex;
91 align-items: center;
92 justify-content: center;
93 background-color: #A6C8F1;
94 max-height: 10px;
95 max-width: 10px;
96 font-size: 10px;
97 color: #FFFFFF;
98}
99
100
101.uk-badge {
102 background-color: #99C1F1;
103 padding: 15px;
104 margin: 5px;
105}
106
107
108div pre[class*="language-"] {
109 display: inline-block;
110 padding-right: 10em;
111 padding-top: 3rem;
112 border-radius: 6px;
113 background-image: url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fillRule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="%23FF5F56" stroke="%23E0443E" strokeWidth=".5" /><circle cx="26" cy="6" r="6" fill="%23FFBD2E" stroke="%23DEA123" strokeWidth=".5" /><circle cx="46" cy="6" r="6" fill="%2327C93F" stroke="%231AAB29" strokeWidth=".5" /></g></svg>');
114 background-repeat: no-repeat;
115 background-position: 16px 16px;
116 box-shadow: 5px 5px 15px 0px rgba(50, 50, 50, 0.75);
117}
118
119/**
120 * okaidia theme for JavaScript, CSS and HTML
121 * Loosely based on Monokai textmate theme by http://www.monokai.nl/
122 * @author ocodia
123 */
124
125code[class*="language-"],
126pre[class*="language-"] {
127 border: black;
128 color: #f8f8f2;
129 background: none;
130 text-shadow: 0 1px rgba(0, 0, 0, 0.3);
131 font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
132 text-align: left;
133 white-space: pre;
134 word-spacing: normal;
135 word-break: normal;
136 word-wrap: normal;
137 line-height: 1.5;
138
139 -moz-tab-size: 4;
140 -o-tab-size: 4;
141 tab-size: 4;
142
143 -webkit-hyphens: none;
144 -moz-hyphens: none;
145 -ms-hyphens: none;
146 hyphens: none;
147}
148
149/* Code blocks */
150pre[class*="language-"] {
151 padding: 1em;
152 margin: .5em 0;
153 overflow: auto;
154 border-radius: 0.3em;
155}
156
157:not(pre) > code[class*="language-"],
158pre[class*="language-"] {
159 background: #272822;
160}
161
162/* Inline code */
163:not(pre) > code[class*="language-"] {
164 padding: .1em;
165 border-radius: .3em;
166 white-space: normal;
167}
168
169.token.comment,
170.token.prolog,
171.token.doctype,
172.token.cdata {
173 color: slategray;
174}
175
176.token.punctuation {
177 color: #f8f8f2;
178}
179
180.namespace {
181 opacity: .7;
182}
183
184.token.property,
185.token.tag,
186.token.constant,
187.token.symbol,
188.token.deleted {
189 color: #f92672;
190}
191
192.token.boolean,
193.token.number {
194 color: #ae81ff;
195}
196
197.token.selector,
198.token.attr-name,
199.token.string,
200.token.char,
201.token.builtin,
202.token.inserted {
203 color: #a6e22e;
204}
205
206.token.operator,
207.token.entity,
208.token.url,
209.language-css .token.string,
210.style .token.string,
211.token.variable {
212 color: #f8f8f2;
213}
214
215.token.atrule,
216.token.attr-value,
217.token.function,
218.token.class-name {
219 color: #e6db74;
220}
221
222.token.keyword {
223 color: #66d9ef;
224}
225
226.token.regex,
227.token.important {
228 color: #fd971f;
229}
230
231.token.important,
232.token.bold {
233 font-weight: bold;
234}
235.token.italic {
236 font-style: italic;
237}
238
239.token.entity {
240 cursor: help;
80} \ No newline at end of file 241} \ No newline at end of file
diff --git a/templates/download.html b/templates/download.html
index 83dd9c4..7ece063 100644
--- a/templates/download.html
+++ b/templates/download.html
@@ -40,7 +40,7 @@
40 {% endfor %} 40 {% endfor %}
41 </dl> 41 </dl>
42 {% endif %} 42 {% endif %}
43 </p> 43 </p>
44 44
45 {% if meta %} 45 {% if meta %}
46 <h3> 46 <h3>
diff --git a/templates/index.html b/templates/index.html
index b361394..ed583d2 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -10,10 +10,16 @@
10 <form method=post enctype=multipart/form-data> 10 <form method=post enctype=multipart/form-data>
11 <div class="uk-margin"> 11 <div class="uk-margin">
12 <input type="file" name=file id="upload_file" accept="{{ mimetypes | join(', ') }}"> 12 <input type="file" name=file id="upload_file" accept="{{ mimetypes | join(', ') }}">
13 <button class="uk-button uk-button-default" type="submit" value="Upload">Upload</button> 13 <button class="uk-button uk-button-primary" type="submit" value="Upload">Upload</button>
14 </div> 14 </div>
15 </form> 15 </form>
16 </div> 16 </div>
17 </div> 17 </div>
18 <a href="/info" role="link" class="">
19 <span class="info-link">
20 ?
21 </span>
22 </a>
23
18 </div> 24 </div>
19{% endblock %} 25{% endblock %}
diff --git a/templates/info.html b/templates/info.html
new file mode 100644
index 0000000..889a08f
--- /dev/null
+++ b/templates/info.html
@@ -0,0 +1,61 @@
1{% extends "base.html" %}
2{% block content %}
3 <div>
4 <h1>
5 What are metadata?
6 </h1>
7 <p>
8 Metadata consists of information that characterizes your file. They answer background questions about who, how, when, and what. This gives your file multi-faceted documentation.
9 <a href="https://0xacab.org/jvoisin/mat2/blob/master/README.md">
10 https://0xacab.org/jvoisin/mat2/blob/master/README.md (09.2019)
11 </a>
12 </p>
13
14 <p>
15 The metadata of your file leak a lot of information about you. For example, cameras store file information about the time of a shot and which camera was used for it. Documents, such as PDF or Words, automatically add author or company information to the document. You don't want to publish all this information at all?
16 </p>
17
18 <p>
19 This is precisely the job of MAT2: getting rid, as much as possible, of metadata.
20 </p>
21
22 <h1>
23 MAT2 locally
24 </h1>
25 <p>
26 Please note that while we do not keep a copy of your file, there is no way that you could be certain about this: Act accordingly. Due to this warning, please consider running MAT2 locally on your device.
27 </p>
28
29 <h2>
30 MAT2 is available in pip
31 </h2>
32 <p>
33 <pre class=" language-javascript"><code class=" language-javascript">pip3 install mat2</code></pre>
34 </p>
35 <h2>
36 MAT2 on Debian
37 </h2>
38 <p>
39 MAT2 is available on Debian.
40 </p>
41 <p>
42 <pre class=" language-javascript"><code class=" language-javascript">sudo apt install mat2</code></pre>
43 </p>
44 <p>
45 More info: <a href="https://packages.debian.org/sid/mat2">https://packages.debian.org/sid/mat2</a>
46 </p>
47
48 <h1>
49 Supported file formats
50 </h1>
51 <p>
52 {% for extension in extensions %}
53 <span class="uk-badge">
54 {{ extension }}
55 </span>
56 {% endfor %}
57 </p>
58
59 </div>
60
61{% endblock %}