Commit Graph

41 Commits

Author SHA1 Message Date
8e949f837b
Use PHC hashes for password storage 2023-04-30 18:16:52 +02:00
788e75c4c1
Add users system, required for uploading new pastes 2023-04-30 12:06:09 +02:00
Daan Sprenkels
b8d1ca459c Fix gopls issues 2021-05-07 10:17:17 +02:00
Daan Sprenkels
0048004252 Use sql database instead of bolt 2020-10-25 17:33:51 +01:00
Daan Sprenkels
f36fa30eff Rename current db to boltdb 2020-10-23 16:14:57 +02:00
Daan Sprenkels
50baaeadf1 Fix /nr
Related issue: #68
2020-07-27 16:58:46 +02:00
Daan Sprenkels
26be9b5104 Validate key format before retrieving from database
Fixes #67
2020-07-27 16:58:27 +02:00
Daan Sprenkels
6d3e8028cb Use high-entropy URLs for file uploads
Fixes issue #59
2020-07-27 14:53:19 +02:00
Daan Sprenkels
8904b648b7 Error w/ 400 when both 'file' and 'shorten' set
Fixes #56
2020-07-06 17:17:07 +02:00
Daan Sprenkels
a58b9815bc Remove unused newPasteHandlerURLEncoded func; NFC 2020-05-30 19:29:27 +02:00
Daan Sprenkels
016ffa8949 meta: Do 410 Gone if paste deleted 2020-05-11 22:45:56 +02:00
Daan Sprenkels
b9119a0df5 meta: Fix CanDelete string 2020-05-11 22:32:35 +02:00
Daan Sprenkels
a4cec1e4b0 meta: Add a delete button 2020-05-11 22:26:45 +02:00
Daan Sprenkels
b7ea5dfa4f Redirect to /xd42/meta after upload
Fixes #51
2020-05-11 22:22:23 +02:00
Daan Sprenkels
728d3833c3 Change redirect status code to Temporary Redirect 2020-04-22 18:24:46 +02:00
Daan Sprenkels
42ccc18002 User url.Parse instead of url.ParseRequestURI
url.ParseRequestURI assumes the URL does not contain a fragment
identifier.  However, this is not disallowed. So we should use
url.Parse instead.

Related issue: #45
2020-04-22 16:11:32 +02:00
Daan Sprenkels
de19234108 return after serving meta page 2020-01-05 00:14:53 +01:00
Daan Sprenkels
245dd64f82 Directly serve files instead of redirect
Fixes #28
2019-12-19 23:17:37 +01:00
Daan Sprenkels
5e6ce9c2be Replace io.Copy w/ http.ServeContent for download 2019-12-19 20:09:55 +04:00
Daan Sprenkels
3d07acb222 Show meta page immediately after create 2019-12-17 15:33:29 +05:30
Daan Sprenkels
c46a26f8a2 web: Implement drag-and-drop upload 2019-12-16 16:21:41 +05:30
Daan Sprenkels
ca859adab1 Redirect to /meta after upload/shorten 2019-12-16 10:51:21 +05:30
Daan Sprenkels
d34ac11d5e Update metadata info view 2019-12-16 10:19:17 +05:30
Daan Sprenkels
0bffde1dc1 Implement --host flag to override {{.Host}}
Fixes #15
2019-12-15 16:48:50 +05:30
Daan Sprenkels
728b5d9d4b Add extension to FileUpload request url
Fixes #27
2019-12-15 12:21:54 +05:30
Daan Sprenkels
40a32fa535 Respond to HEAD requests
Fixes #21
2019-12-15 11:44:27 +05:30
Daan Sprenkels
eec5e4def4 Detect file types instead of trusting clients 2019-12-10 11:16:18 +01:00
Daan Sprenkels
cf956501ac metrics: Add http_requests metric 2019-12-08 21:56:02 +01:00
Daan Sprenkels
0cfad96b68 Refactor database login into a separate module 2019-12-06 18:03:56 +01:00
Daan Sprenkels
df86d5836a Implement file deletion 2019-11-22 18:41:54 +01:00
Daan Sprenkels
66eb0bf97a Add support for file uploads 2019-11-10 19:03:57 +01:00
1b3ba9443a Move several packages to root package 2019-11-09 15:50:12 +01:00
Daan Sprenkels
e021e463ab Move rushlink command into cmd/ dir 2019-09-08 10:47:17 +02:00
Daan Sprenkels
8803281285 Put index in template 2019-09-06 00:17:50 +02:00
Daan Sprenkels
675245722f Revert "Format errors with HTML"
This reverts commit 80092dea5b.

After enabling both HTML and plain-text templating, I found that
this introduces a lot more complexity in the code than was desirable
for a project in this stage. The result looked fine, wrapping plain
text in <pre> tags. However, it was neccessary to keep duplicate
template files, for HTML and text. This was cumbersome, added a lot
of bloat, etc.

This feature is postponed to when there is more product.
2019-09-06 00:15:35 +02:00
Daan Sprenkels
80092dea5b Format errors with HTML 2019-09-05 23:07:54 +02:00
Daan Sprenkels
73814e0f5b Add reserved keys 2019-09-01 12:04:43 +02:00
Daan Sprenkels
0d7f7c7808 Add meta viewer and owner tokens 2019-09-01 01:41:01 +02:00
Daan Sprenkels
5a7394ffd3 Rename main bucket to "pastes" and add /nr 2019-08-31 00:02:01 +02:00
Daan Sprenkels
498c84541b Add a small prometheus exporter 2019-08-29 23:41:00 +02:00
Daan Sprenkels
3c4d0ca60e Implement retrieval of redirects 2019-08-29 00:51:40 +02:00