Commit Graph
142 Commits
Author SHA1 Message Date
UmputunandGitHub 68b892f5e9 Image resize (#311)
* resize uploaded images #309

* fix temp files created in current dire after image test

* update mod

* missing image test files

* fix failed goroutine test on image-resize submit

* switch to mockery

* missing in mock change

* resize by both ResizeWidth and ResizeHeight

* add IMAGE_RESIZE params to readme

* add latest features to the description

* lint: missing file close in image test
2019-04-17 02:53:35 -05:00
Umputun 3debfff93d another test rejection due to image type check 2019-04-13 14:44:36 -05:00
Umputun ac261940d7 fix rest test with rejected non-pic 2019-04-13 14:39:55 -05:00
Umputun c52e5b3920 expose max image size via config rest #307 2019-04-12 10:13:14 -05:00
Umputun cecf147fd0 add tests for URLKeys 2019-04-09 00:10:21 -05:00
Umputun 22d787de58 user comment cached with user_id as well 2019-04-07 18:38:06 -05:00
Umputun 078bedd8e8 separate caching key URLKeyWithUser for find only 2019-04-07 18:34:20 -05:00
Umputun dc5ceeee12 cache find with userID to prevent leaking (and incorrect) vote status 2019-04-07 18:20:05 -05:00
Umputun 128ca53725 more voting tests 2019-04-07 15:58:25 -05:00
Umputun 4845bf357a restore rest setter for vote info of the current user 2019-04-07 14:12:40 -05:00
Umputun 2e4dfe3891 move vote setter to service level 2019-04-07 14:05:19 -05:00
Umputun 446cb486a0 extend test fo votes 2019-04-07 13:47:22 -05:00
Umputun 556e330af2 merge current master 2019-04-07 13:32:12 -05:00
Umputun 70134578e1 switch to chi v4 2019-04-04 02:17:12 -05:00
Umputun 0f433722da disable picture upload for anonymous 2019-04-04 01:53:47 -05:00
Umputun 29dc368ea8 revendor with fresh lgr, add logger to http server 2019-03-31 13:45:44 -05:00
Umputun 6ef88bf375 lint: tests warning 2019-03-25 23:57:27 -05:00
Umputun 4f73ddc40c move error parsing for rest to separate func 2019-03-25 23:31:02 -05:00
Umputun 38da69ea49 simplify counts hashing key 2019-03-25 20:58:57 -05:00
Umputun 7a948266a3 test more image types 2019-03-25 19:54:16 -05:00
Umputun 3b5a1a62de add vote for the current user, hide list of other votes #297 2019-03-25 16:14:10 -05:00
Umputun 2a64a71eb8 lint: missing err check in test 2019-03-25 01:15:51 -05:00
Umputun ded10dde6c integration test for create comment with images 2019-03-24 00:23:46 -05:00
Umputun db3f22d9fd change image submit to single goroutine with active wait. flush all submitted on close 2019-03-23 19:13:58 -05:00
Umputun 58ec50e613 wire image submit to store.Service 2019-03-23 18:33:19 -05:00
Umputun c990b05c21 add image service with delayed commit. Move cleanup loop to service 2019-03-23 14:54:45 -05:00
Umputun eb3dd467ad change image location to user based, make random uuid for file name 2019-03-22 03:03:41 -05:00
Umputun bc714480d4 lint: multiple shadowed errors, missed comments for exported methods 2019-03-19 20:54:05 -05:00
Umputun 58eb4e8852 typos 2019-03-11 14:09:05 -05:00
Umputun 4def2affd8 fix robosts test with added picture 2019-03-11 01:23:13 -05:00
Umputun 639f6c15f3 wire image save/load to rest and cmd 2019-03-11 01:16:25 -05:00
Umputun 1561dc2fda switch to go mod 2019-03-09 02:02:55 -06:00
Umputun a7004f15a5 add non-anon middleware to vote post controller #279 2019-03-07 15:13:42 -06:00
Umputun 347fe1a0db randomize db name for rest test to avoid conflicts in parallel testing 2019-03-06 12:15:44 -06:00
Umputun e3d6869cb0 common teardown for migrator tests, simplify WP import test 2019-03-05 22:32:34 -06:00
Umputun 2105b5ddfe revendor with latest lgr (logging) 2019-03-05 22:31:37 -06:00
Umputun 70ef130976 add error codes 2019-02-10 17:47:58 -06:00
Umputun ef59281112 add controversy sorting #274 2019-02-10 16:10:58 -06:00
Umputun e6f30b0768 sync with preemptuve lock in concurrent migrator 2019-02-02 18:45:24 -06:00
zonescape de68b8d8ee fix comment typo 2019-01-29 18:37:25 +03:00
Umputun af6076187f set rss descriptions matching rss type 2019-01-27 15:08:39 -06:00
Umputun b106fe0fc6 increase size of last comments for reply detection to 5000 and time to 31 days #268 2019-01-27 14:28:24 -06:00
Umputun cb5fc79dbe add site-level positve score support #260 2019-01-26 01:38:56 -06:00
Umputun 440beb3303 make sure last returns [] list #262 2019-01-25 23:20:30 -06:00
Umputun f7de26ef4b enforec empty list of comments on nil response 2019-01-25 22:49:52 -06:00
Umputun 6250f2e52e allow empty list of comments on find for fresh post without anything #262 2019-01-25 18:24:58 -06:00
Umputun 1cc09a33f6 fix lack of counter invalidation from the cache #261 2019-01-25 17:35:38 -06:00
Umputun 8f0b6a6a59 add unit test for counters #261 2019-01-25 17:10:22 -06:00
Aleksandr MelnikovandUmputun ab6c9a515c Support restricted words (#257)
* prepared interfaces and naive implementation for restricted words

* fixed whitespace tokenizer last token handling

* removed unnecessary check in whitespace tokenizer last token handling

* removed unnecessary interfaces, added matcher to service

* now using more explicit naming

* added config parameter/env variable to configure restricted words
provided simple matcher and lister implementation into service

* fixed linter warnings

* fixed linter warnings (part 2)

* added functional tests for rest api
moved check for restricted words into validation stage

* fixed missing error check in rest private test

* fixed failed test that expected validation in specific order

* fixed linter warning

* removed unnecessary 'else'

* removed redundant check from 'DataStore.EditComment'

* replaced exact matching for restricted words with wildcard matching

* fixed race condition when creating wildcardTrie
removed unnecessary wildcard masks
refactored tests in a table format

* improved documentation for restricted words param

* removed wildcardTrie caching as a premature optimization
removed unnecessary validation method ValidateCommentText
moved restricted words validation into service methods that create and update comment

* fixed error name due to linter warning
2019-01-21 16:48:35 -06:00
Umputun 7fa26343bd fix a comment 2019-01-17 15:07:47 -06:00