Commit Graph

113 Commits

Author SHA1 Message Date
Mara Bos dbb6a954e1 Don't capture cursor in screenshot.
Adds `-u` to maim to not capture the cursor.

However, maim still captures the cursor sometimes even with -u,
so this also switches the order to prefer `import` over `maim`,
which does not do this.
2020-05-15 13:08:18 +02:00
Daan Sprenkels 2c889e0808 Prevent directory traversal in file upload
Fixes #53
2020-05-12 20:01:03 +02:00
Daan Sprenkels 737a26fee3 test: Look for StatusFound instead of StatusOk; NFC 2020-05-12 19:09:43 +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 a0c8383555 template: Fix <pre> nesting 2020-05-11 20:58:50 +02:00
mrngm bbe787da5d Merge pull request 'Make rushlink script more portable.' (#48) from mara/rushlink:master into master 2020-05-04 12:12:46 +02:00
Mara Bos 28ddaee9d9 Make rushlink script more portable.
It didn't work on mac (and bsd, probably). Now it does.
2020-05-04 12:06:06 +02:00
Daan Sprenkels 01adfa8f2f Merge pull request 'Add a test for issue #45; NFC' (#46) from test-issue-45 into master 2020-04-27 13:00:31 +02:00
Daan Sprenkels c57e719e15 Add a test for issue #45; NFC
Fixes #45
2020-04-27 13:00:46 +02:00
Daan Sprenkels c0e4ac2c40 mod: Bump dependencies 2020-04-22 19:30:20 +02:00
Daan Sprenkels b73317c249 Add generated bindata.go file to repo 2020-04-22 19:05:56 +02:00
Daan Sprenkels 8e89955ce9 Remove debug logging statement; NFC 2020-04-22 18:25:55 +02:00
Daan Sprenkels e476797da0 db: Prevent infinite recursion when closing 2020-04-22 18:25:27 +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 63a588ba59 db: Add docstrings to FileUpload; NFC 2020-04-22 16:00:36 +02:00
Daan Sprenkels 3da165a57b Merge pull request 'Add copy-to-clipboard button to meta page' (#44) from issue-42 into master 2020-04-14 16:08:07 +02:00
Daan Sprenkels 09481f47e6 Do not show button if clipboard not available 2020-04-05 18:46:40 +02:00
Daan Sprenkels 1dd0d17ba5 Add copy-to-clipboard button to meta page
Fixes #42.
2020-04-05 18:16:41 +02:00
Daan Sprenkels 7c0bfaee76 .gitignore: Ignore .vscode dir; NFC 2020-04-05 18:15:41 +02:00
Daan Sprenkels a766d5d596 Update .gitignore; NFC 2020-04-05 18:12:16 +02:00
Daan Sprenkels c28dfd0cb4 Merge pull request 'Add rushlink --screenshot.' (#41) from mara/rushlink:master into master 2020-03-26 09:37:25 +01:00
Mara Bos 732b1fc2a6 Add rushlink --screenshot. 2020-03-24 17:25:51 +01:00
Mara Bos 8403ad2258 Make rushlink --delete work with urls that have a file extension. 2020-03-24 14:42:54 +01:00
Daan Sprenkels ad1ce67495 Merge pull request 'Add command line tool to submit and delete files and links.' (#39) from mara/rushlink:master into master 2020-03-23 17:00:45 +01:00
Mara Bos 11ea63e1fc Add command line tool to submit and delete files and links.
Fixes #11.
2020-03-23 17:00:24 +01:00
Daan Sprenkels 0a35cb2508 Merge branch 'master' of gitea.hashru.nl:dsprenkels/rushlink 2020-01-05 00:15:23 +01:00
Daan Sprenkels de19234108 return after serving meta page 2020-01-05 00:14:53 +01:00
Gerdriaan Mulder 9a690e2b8b README: restructure to accentuate building/deploying 2019-12-28 19:24:59 +01:00
Gerdriaan Mulder ac2c62f9e6 README updated with -root_url and sample systemd unit file 2019-12-28 18:47:20 +01:00
Daan Sprenkels 095348d614 web: Add an example w/ upload from process output
Fixes #35
2019-12-19 23:29:09 +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 8dce4e8483 web: Indent <pre> with padding-left (no spaces)
Fixes #34
2019-12-17 23:11:43 +05:30
Daan Sprenkels ffeb9a3362 Rename --host => --root-url 2019-12-17 15:43:32 +05:30
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 087b9920e6 [refactor] Add !=nil check in renderCreateSuccess 2019-12-16 11:27:09 +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 824c6f41e2 Enable submit using web interface 2019-12-16 09:53:36 +05:30
Daan Sprenkels f32e47b4c8 Add deprecation warning for omitting --host 2019-12-15 17:08:32 +05:30
Daan Sprenkels 8cbe984ba4 Default {{.Host}} to https:// 2019-12-15 17:06:48 +05:30
Daan Sprenkels 0bffde1dc1 Implement --host flag to override {{.Host}}
Fixes #15
2019-12-15 16:48:50 +05:30
Daan Sprenkels 41f4de43ac Return both URLs after upload
Fixes #25
2019-12-15 12:42:10 +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