Commit Graph
63 Commits
Author SHA1 Message Date
Matt Godbolt f2c1e0bd31 The Grand Reformat (#3643)
* The Grand Reformat

- everything made prettier...literally
- some tweaks to include a few more files, including documentation
- minor changes to format style
- some tiny `// prettier-ignore` changes to keep a few things the way we like them
- a couple of super minor tweaks to embedded document types to ensure they format correctly
2022-05-09 23:13:50 -05:00
Matt Godbolt cb50486d27 Bump eslint dependencies and suppress most of the warnings 2021-05-27 23:06:42 -05:00
Matt Godbolt 259b72e16a Add some tests to s3 storage 2021-04-12 17:46:53 -05:00
Austin Morton a194b5a591 Always store shortlinks with a 6 character prefix in dynamodb 2021-04-09 20:06:06 -04:00
Austin Morton 80fa894cd0 Store shortlinks with both 6 and 9 character prefixs in dynamodb 2021-04-09 17:47:14 -04:00
Matt Godbolt 6fcf5d758f Increase the number of characters in s3 URLs
We used to use 6. This gives 32^6 possible URLs.
As we increase the number of URLs the godbolt.org site
stores, the chance of an attacker being able to guess
existing URLs has increased. To stay one step ahead,
we bump to 9 characetrs here: 32^9 possible is 35 trillion
possibilities.
2021-03-21 15:06:53 -05:00
Matt Godbolt 17b2bb8a58 Move /shortener to /api/shortener (#2426)
We still support /shortener (though will scrape logs to see when
we can remove).

The route under /api/shortener will have the CORS headers set up
properly for things like @foonathan's lexy visualiser.
2021-02-15 12:52:46 -06:00
Austin Morton de85aecc7d Normalize and enforce license disclaimer headers (#2234) 2020-09-27 00:20:19 -04:00
Austin Morton 044dcfbf88 Use ES6 Modules (#2132) 2020-09-26 16:59:26 -04:00
Austin Morton bac07fea6d Eliminate all dynamic require statements (#2230) 2020-09-25 11:21:30 -04:00
Austin Morton dde5ef02fa Move some files in preparation for es6 modules 2020-09-23 04:30:15 -04:00
Rubén Rincón BlancoandAustin Morton ccff4b9ee5 Add new eslint rules (#2121)
The largest changes here are:
- enforcing single quotes for strings
- enforcing trailing commas where possible

In addition to those we have enabled several eslint plugins:
- plugin:requirejs/recommended, to enforce some conventions in require statements
- plugin:node/recommended, to enforce correct usage of various node.js APIs
- plugin:unicorn/recommended, which contains a pretty mixed bag of useful rules

This PR attempts to not change code behavior when possible.  In cases where fixing
existing code would change semantics, a linting exclusion has been placed in the 
code base to silence the error.  You can find these by searching for `eslint-disable-next-line`.

Co-authored-by: Austin Morton <austinpmorton@gmail.com>
2020-08-04 16:39:02 -04:00
Rubén Rincón Blanco 1106db4939 Make url hash a base32 encode (#2062)
Avoids most of the problems present with the current base64 impl
2020-07-06 08:33:10 -04:00
Matt Godbolt 74780f3d49 More consisetency in storage handling. Thanks again @apmorton 2020-01-28 22:34:14 -06:00
Matt Godbolt 717ea51a3e First wave of @apmorton suggestions and fixes 2020-01-28 21:34:52 -06:00
Matt Godbolt c589e08025 Asyncify storage 2020-01-21 19:21:41 -06:00
Matt Godbolt fdab41d966 Use res.send() in most cases.
I discovered res.send() will set cache control headers, content-size,
and content-type, and will to-json objects (setting type to app/json).
Refactored a few things, hit an issue where testing chai http doesn't
seem to want to remember the data (in health check tests); reading the
chai http docs I don't actually think it's supported. Was working by
fluke before.

Took the opportunity to use a few "extract method" in the IDE too to
remove duplicated code (that the IDE was also nagging me about...)
2020-01-13 07:29:08 -06:00
RabsRincon 05edc75848 Add missing cache headers for some files 2020-01-08 13:54:43 +01:00
RabsRincon f733d6f3cc Make looking for usable text a bit better
It allows more letters, looks closer to the current length
 and has a max try count

Thanks to @jameshamm for a great rundown on what could be done :)

Closes #1706
2019-12-08 02:59:39 +01:00
Rubén Rincón a99531b14d Add i to list of banned letters
Fixes tests
2019-11-04 18:11:01 +01:00
Rubén Rincón 2364ecac75 Disallow confusing leters to appear in short urls
Closes #1661
2019-11-04 18:03:02 +01:00
Austin Morton c64d5dc587 Add remote storage backend (#1549)
Allows a CE instance to utilize another remote CE instance
for shortlink storage
2019-08-26 18:32:13 -04:00
Matt Godbolt 43c69be29d Moving things about to keep the host and subdomain from the original request 2019-05-31 22:03:27 -05:00
Matt Hammerly da696438bc make url shortener handler return entire url 2019-05-29 20:24:45 -07:00
Matt Godbolt d76657fdfd Braino! 2019-03-17 22:21:47 -05:00
Matt Godbolt 2011c840ce Rename thing we add as nonce, add tests. Fix logic error 2019-03-17 22:02:04 -05:00
RabsRincon bde3e829cf Implement profanity check on subhashes
c.f: #1297
2019-03-06 17:18:51 +01:00
jD91mZM2 dddae14df5 Fix warnings 2019-02-23 12:32:34 +01:00
jD91mZM2 1198a1a69c Use storageSolution=null over enableShort=false 2019-02-23 12:26:33 +01:00
RabsRincon c61cee6df5 Better handle missing short id case 2018-11-30 18:18:14 +01:00
RabsRincon 9b1d6624f4 Fix undefined variable access 2018-11-30 17:51:37 +01:00
RabsRincon 98a35ac3d1 Try a new strategy for s3 link expansion 2018-11-30 17:06:20 +01:00
Partouf 667588e527 being able to store and retreive clientstate json 2018-10-02 23:27:06 +02:00
RabsRincon bdc447fe30 Fix local storage & add compiler name to unfurling 2018-08-20 11:10:23 +02:00
Matt Godbolt 08cd1edc69 Use binary buffers for hash; safe64 encode results. Addresses #1056 2018-08-18 10:02:28 -05:00
RabsRincon 895369f932 Move to on-the-fly parsing 2018-08-17 21:07:51 +02:00
RabsRincon fa748a2d43 CamelCasify special_metadata 2018-08-17 20:51:55 +02:00
RabsRincon 9d02f2ed65 Restructure open graph metadata 2018-08-17 20:33:39 +02:00
RabsRincon c89a1cdab0 Create error handlerss 2018-08-13 19:21:24 +02:00
RabsRincon 349bbd41ed Improve 404 message 2018-08-13 17:22:08 +02:00
RabsRincon 9d388f017f Properly handle request ip logging 2018-08-13 16:09:32 +02:00
RabsRincon 4d8592935e Fix reset UI link & pending request on error 2018-08-13 14:55:37 +02:00
RabsRincon 1a060bcb1c Implement crazy idea to fix anchor links problems 2018-08-12 22:21:02 +02:00
RabsRincon e31daa71c2 Try to fix page reload behaviour seen in beta 2018-08-12 20:16:35 +02:00
RabsRincon 466a53293f Move metadata to top level to make it indexable 2018-08-12 19:41:52 +02:00
RabsRincon 482f388832 Add more metadata to each link 2018-08-12 17:13:41 +02:00
Matt Godbolt b538ab04f0 Store to s3 at the same time we write to dynamo. Wait for both before we return 'ok' to user 2018-08-11 09:39:46 -05:00
Matt Godbolt 5d000c4258 Make s3 storage configurable; configure for live site 2018-08-11 09:25:14 -05:00
RabsRincon 9af0b206f9 Add share metadata (og, twitter) for named links 2018-08-10 16:15:00 +02:00
RabsRincon e885c800fb Improve URL get param handling 2018-08-10 09:11:33 +02:00