Commit graph

83 commits

Author SHA1 Message Date
Paul Bienkowski b75ba42969 refactor: change mongoose models to use ES6 classes 2020-11-25 15:55:56 +01:00
Paul Bienkowski c5b5dda0b4 chore: remove Article model, it is unused, fix references from comments and favorites 2020-11-25 15:49:11 +01:00
Paul Bienkowski 11c806dbe3 fix: parse "visible" flag when posting a track, and trim details nicely when PUTing it 2020-11-25 12:40:13 +01:00
Paul Bienkowski 761330e9b6 refactor: rename req.payload to req.authInfo to be less confusing 2020-11-25 11:00:51 +01:00
Paul Bienkowski e607a1d64d chore: update routes to use new req.user 2020-11-25 11:00:51 +01:00
Paul Bienkowski 29269dcfcd feat: load user object in auth middleware chain 2020-11-25 11:00:51 +01:00
Paul Bienkowski 393fc3dbb2 fix: handle requests without authorization header 2020-11-24 23:22:22 +01:00
Paul Bienkowski 15edeb59e1 fix: show correct number of pages in global feed (only count visible tracks) 2020-11-24 20:22:49 +01:00
Paul Bienkowski 857ec7c3c6
Merge pull request #19 from Friends-of-OpenBikeSensor/streaming
More body parsers for uploading tracks
2020-11-24 20:22:25 +01:00
Paul Bienkowski cdadbb5df4 fix: a few issues with old node version, again 2020-11-24 00:32:49 +01:00
Paul Bienkowski 3b1376b661 feat: store user-agent (extracted OBS version only) for each track when uploading 2020-11-24 00:31:06 +01:00
Paul Bienkowski 2da013583b fix: raise forbidden when viewing invisible track and not author 2020-11-24 00:14:46 +01:00
Paul Bienkowski fb11a71663 feat: read a new (temporary) token type, OBSUserId from Authorization header 2020-11-24 00:14:46 +01:00
Paul Bienkowski b63afb1146 feat: allow querystring + single file body uploads for editing tracks 2020-11-24 00:14:46 +01:00
Paul Bienkowski 3c1d666dc3 feat: allow multipart bodies in POST /api/tracks and PUT /api/tracks/:track 2020-11-24 00:14:46 +01:00
Paul Bienkowski 9ad99587a9 chore: install connect-busboy for multipart body parsing 2020-11-24 00:14:46 +01:00
Paul Bienkowski 8cf01ba5f5 fix: a single-request upload shall just use /end 2020-11-23 23:21:36 +01:00
Paul Bienkowski 7460661607 fix: append to track body in /end too, and save new track in /add 2020-11-22 10:46:58 +01:00
Paul Bienkowski 33e8cbdb83 refactor: reorder /begin /add /end routes 2020-11-22 10:44:21 +01:00
Paul Bienkowski 6b98655c92 refactor: change addPointsToTrack -> parseTrackPoints generator 2020-11-21 23:07:58 +01:00
Paul Bienkowski b31d3e0e7d fix: parse tracks when they are fully uploaded in /end request, not before 2020-11-21 23:01:22 +01:00
Paul Bienkowski 13ed2ef936 fix: correctly detect dollar hack if there is no dollar at the end, also fix the tests 2020-11-21 23:00:56 +01:00
Paul Bienkowski 6b24ac59e8 chore: add .dockerignore 2020-11-21 20:05:26 +01:00
Paul Bienkowski 0b8fed3e27 chore: make everything async instead of manual promise chaining 2020-11-21 20:05:03 +01:00
Paul Bienkowski bb2b569abe chore: add "npm run lint" command 2020-11-21 19:41:25 +01:00
Paul Bienkowski b6ab3d0b1d chore: fix lint errors 2020-11-21 19:41:25 +01:00
Paul Bienkowski 481999b278 chore: format all files 2020-11-21 19:41:25 +01:00
Paul Bienkowski e75a71a9bc chore: include all JS files in eslint 2020-11-21 19:41:25 +01:00
Paul Bienkowski 02f8258a91 fix: detect version 2 format when metadata line is missing 2020-11-21 19:36:32 +01:00
Paul Bienkowski 1a00e7b010
Merge pull request #13 from opatut/refactor_tracks_logic_and_testing
Refactor tracks logic and support new CSV format
2020-11-21 19:35:22 +01:00
Paul Bienkowski bcf9f95c6d fix: do not use ?. operator for node 10 2020-11-21 17:53:32 +01:00
Paul Bienkowski 7aa6e0be84 feat: in OBSVER1, sanitize d1, d2, latitude and longitude values to null where appropriate 2020-11-21 13:48:22 +01:00
Paul Bienkowski 0c3cf9263d feat: parse body when POSTing a new track 2020-11-21 13:47:56 +01:00
Paul Bienkowski 16ca8db8c7 feat: properly parse data types in OBSVER1 2020-11-21 13:26:52 +01:00
Paul Bienkowski 598c6620d7 fix: correctly detect format OBSVER1 if there is no header, just data
This is required for OBS compatibility, which drops the header line on
upload.
2020-11-21 13:15:55 +01:00
Paul Bienkowski f8bb6e7ab7 fix: when detecting format, first apply the dollar->newline hack 2020-11-19 17:48:45 +01:00
Paul Bienkowski f890fc673f refactor: switch to async/await syntax in track routes 2020-11-18 23:00:08 +01:00
Paul Bienkowski 114a9677f1 chore: fix some eslint in routes/api/tracks.js 2020-11-18 22:30:25 +01:00
Paul Bienkowski f3740e5f37 feat: generate TrackData points when saving tracks through PUT, and return raw body through GET /:track 2020-11-18 22:17:00 +01:00
Paul Bienkowski 0b830601f5 feat: autodetect "$ as newlines" hack in both OBSVER1 and OBSVER2 2020-11-18 22:13:00 +01:00
Paul Bienkowski f013ab4263 refactor: use csv parser for obsver1 instead of selfbuilt solution 2020-11-18 21:51:08 +01:00
Paul Bienkowski f414d64480 fix: allow big uploads (up to 50mb) 2020-11-18 21:50:33 +01:00
Paul Bienkowski 22f8c46d6a wip 2020-11-18 20:53:35 +01:00
Paul Bienkowski d8975db15a chore: eslint fixes for logic/ folder 2020-11-18 17:24:28 +01:00
Paul Bienkowski 5d16c4d541 chore: fix dev setup 2020-11-18 17:24:15 +01:00
Paul Bienkowski 2ff842bd11 chore: introduce eslint 2020-11-18 17:15:32 +01:00
Paul Bienkowski 214da0c9f8 refactor(logic/tracks): clean up code 2020-11-18 11:23:34 +01:00
Paul Bienkowski 8f5237a182 test: add test data from postman-test to test addPointsToTrack 2020-11-18 11:23:34 +01:00
Paul Bienkowski 04f597cfb1 chore(logic): autoformat with prettier 2020-11-18 11:23:34 +01:00
Paul Bienkowski 79de852d91 chore: add prettier for autoformatting 2020-11-18 11:23:34 +01:00