Commit Graph

155 Commits

Author SHA1 Message Date
Daan Sprenkels
fbab9028f4 Bump all dependencies 2021-10-03 10:43:56 +02:00
29ee3dc6fd Merge pull request 'Add request_duration_seconds metric' (#72) from metrics into master
Reviewed-on: dsprenkels/rushlink#72
2021-05-16 21:10:48 +02:00
Daan Sprenkels
306705cb28 Optimize query for updating metricURLsTotalGauge 2021-05-16 20:45:48 +02:00
Daan Sprenkels
c4ff0ab1b7 Add request_duration_seconds metric 2021-05-16 20:24:00 +02:00
Daan Sprenkels
a26894dac8 Refactor metric collection 2021-05-16 20:21:44 +02:00
Daan Sprenkels
4f07bc4c2a Update bindata.go 2021-05-13 10:46:06 +02:00
Daan Sprenkels
9ff11cc14c Remove boltdb leftovers 2021-05-13 10:44:32 +02:00
Daan Sprenkels
38b27b4d11 mod: Remove explicit go-bindata dep; NFC 2021-05-13 10:43:23 +02:00
Daan Sprenkels
590003aa36 Update dependencies 2021-05-08 22:45:04 +02:00
Daan Sprenkels
30ab6f9228 Fix gopls issues 2021-05-08 22:42:13 +02:00
Daan Sprenkels
6603ad886f Merge branch 'master' of gitea.hashru.nl:dsprenkels/rushlink 2021-05-07 10:17:35 +02:00
Daan Sprenkels
b8d1ca459c Fix gopls issues 2021-05-07 10:17:17 +02:00
5cb0a59f00 README: indicate change to ENV for configuration, refresh systemd unit file, introduce Gorm and db migration tool 2021-05-05 22:29:08 +02:00
1fe9553cc9 Merge pull request 'Use SQL database instead of bolt' (#71) from sql into master
Reviewed-on: dsprenkels/rushlink#71
2021-05-05 21:34:26 +02:00
Daan Sprenkels
3f09c1517d migrate: Fix 'no such table: migrations' err
Apparently, if you CREATE TABLE inside of a transaction, and then
(in the same transaction) do a SELECT on the same table before
committing, the table will not exist yet.

Now we do the migration in two steps: first initialize the schema;
then migrate the data.
2020-12-31 14:34:33 +01:00
Daan Sprenkels
f530a543f9 db: Test truncated keys are invalid; NFC 2020-12-17 15:15:04 +01:00
Daan Sprenkels
f527f2fb38 Automigrate when opening db 2020-12-17 15:14:45 +01:00
Daan Sprenkels
1ecb11c65f db: Do not warn during paste key generation 2020-12-17 14:49:52 +01: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
104dbab335 db: Refactor switch; NFC 2020-07-27 18:49:26 +02:00
Daan Sprenkels
a8eba1b0df db: Add a test for key validation; NFC 2020-07-27 18:48:24 +02:00
Daan Sprenkels
9d952edc67 Add a functional test for /nr
Fixes #68
2020-07-27 17:08:10 +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
1c09bb0a71 Fix incorrect router setup 2020-07-27 14:22:43 +02:00
Daan Sprenkels
03a04389ae Add a test for issue #66
Together with af6d7623, this commit solves issue #66.

Fixes #66.
2020-07-06 18:02:57 +02:00
Daan Sprenkels
af6d762378 Stop rendering after an invalid Accept value 2020-07-06 18:01:50 +02:00
Daan Sprenkels
7a369a1dae Merge pull request 'Error with 400 Bad Request when both 'file' and 'shorten' set' (#65) from issue-56 into master 2020-07-06 17:14:38 +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
70538f170f Add a test for issue #56 2020-07-06 17:17:07 +02:00
Daan Sprenkels
bbfe64a3a2 Merge pull request 'Add request logging to panic recovery' (#63) from issue-61 into master 2020-07-06 17:12:59 +02:00
Daan Sprenkels
5a39d6a37c Add request logging to panic recovery
Fixes #61
2020-07-06 17:15:56 +02:00
Daan Sprenkels
2883af7d31 Merge pull request 'Fix error handling in renderStatic' (#64) from issue-60 into master 2020-07-06 17:04:58 +02:00
Daan Sprenkels
d37222f82a Fix error handling in renderStatic
Fixes #60
2020-07-06 17:07:14 +02:00
badc22b8d0 Merge pull request 'db: Change db file mode to 660' (#62) from issue-58 into master 2020-06-28 12:15:57 +02:00
Daan Sprenkels
a58b9815bc Remove unused newPasteHandlerURLEncoded func; NFC 2020-05-30 19:29:27 +02:00
Daan Sprenkels
0b2297a2e8 Add a test for issue #60 2020-05-30 17:49:44 +02:00
Daan Sprenkels
77e89251e7 db: Change db file mode to 660
Fixes #58
2020-05-30 17:07:35 +02:00
Daan Sprenkels
847fd8072b Bump dependencies 2020-05-30 17:05:33 +02:00
Daan Sprenkels
5a5a0dc5ec Merge pull request 'Don't capture cursor in screenshot.' (#55) from mara/rushlink:master into master 2020-05-21 20:02:41 +02:00
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