Dmitry Verkhoturov and Umputun
7604548035
Update go to 1.23, golangci-lint to 1.61, baseimage to 1.14
2024-11-08 16:19:58 -06:00
Dmitry Verkhoturov and Umputun
532573fb34
fix problems reported by golangci-lint
2024-02-20 12:10:39 -06:00
Dmitry Verkhoturov and Umputun
81c30e01f8
cleanup images from deleted comments
...
Previously, images were deleted only from comments deleted
before EditDuration expiration. After this change, any deletion
of the comment deletes images if they are not used elsewhere
in comments under the same page.
2024-01-20 13:29:06 -06:00
Dmitry Verkhoturov and Umputun
c72f30eabb
remove proxied images from sanity check
...
Previously, proxied and local images were checked for presence in the
storage before previewing or posting the comment. That logic resulted in
an inability to post with an image when a proxy for images is enabled,
as proxied images are not downloaded to disk before the first time
someone loads them, which could only happen after the user either
previews or posts the message.
After this change, preview and post only checks the local images'
presence and ignore the proxied ones.
2023-07-23 12:10:52 -05:00
Dmitry Verkhoturov and Umputun
a03c002df4
bump golangci-lint to latest
2023-04-02 01:21:33 -05:00
Dmitry Verkhoturov and Umputun
d7e9be99f9
make Close() calls idempotent
...
Previously, few of them resulted in panics when called more than once.
2023-01-03 01:41:26 -06:00
Dmitry Verkhoturov and Umputun
c86bff8811
remove duplicate type definitions from function signatures
...
I haven't found a linter for these, so I had to catch these manually.
I found #757 to fix one of these, and I thought it would be good
to fix everything at once.
2022-11-13 11:51:51 -06:00
Dmitry Verkhoturov and Umputun
d2ea572abf
fix "it's" used in place of "its"
2022-10-20 14:18:21 -05:00
Dmitry Verkhoturov and Umputun
050f1b7941
migrate from mockery to moq
2022-10-02 21:21:28 -05:00
Dmitry Verkhoturov and Umputun
0728b28856
bump golangci-lint, fix discovered problems
...
Also, improve the goveralls installation method.
2022-09-28 18:11:09 -05:00
Dmitry Verkhoturov and Umputun
a6a9270f63
apply pngcrush, advpng and optipng to all png images
...
Commands used:
```
find . -type f -iname "*.png" -exec advpng -z4 {} \;
find . -type f -iname "*.png" -exec optipng -o7 -preserve {} \;
find . -type f -iname "*.png" -exec pngcrush -rem allb -brute -reduce -ow {} \;
```
2022-09-28 16:05:03 -05:00
Dmitry Verkhoturov and Umputun
e77dc33333
bump mockery from v1.1.2 to v2.14.0
...
Command-line params changed their names,
and old ones won't work anymore.
2022-09-12 17:22:34 -05:00
Dmitry Verkhoturov and Umputun
ba86db1263
replace errors package with fmt.Errorf
...
https://gist.github.com/Peltoche/60b8b81dfbf70164d0e2b88988003229
was used for it, thanks to @Peltoche for publishing it.
2022-04-26 00:25:09 -05:00
Dmitry Verkhoturov and Umputun
2a7966b9e6
replace numbers with proper HTTP status codes in tests
...
Also, remove unneeded whitespaces using whitespace
linter for golangci-lint.
2022-04-17 19:42:45 -05:00
Dmitry Verkhoturov and Umputun
cfb7361adf
optimise images for smaller size
2022-02-24 16:18:28 -06:00
Dmitry Verkhoturov and Umputun
90e537358d
update golangci-lint to 1.43.0, fix found issues
2021-11-23 15:00:40 -06:00
Dmitry Verkhoturov and Umputun
5abeab4008
stop Ticker after use to prevent the memory leak
...
https://github.com/golang/go/wiki/CodeReviewConcurrency#ticker-stop
2021-10-03 16:09:30 -06:00
Dmitry Verkhoturov and Umputun
9fa23cc537
reset image cleanup TTL on Submit
...
Also:
- make commitTTL equal to EditDuration,
so that image is committed to permanent
storage after comment can no longer be edited
- move cleanupTTL to Cleanup function,
as it's not used elsewhere in the code
- add variables to some tests sleeps, so that
instead of being magic numbers they would
rely on timers of structures they suppose
to wait for
2021-05-24 17:33:59 -05:00
Dmitry Verkhoturov and Umputun
86b2648d66
reset image cleanup timer on comment preview
2021-05-24 17:33:59 -05:00
Dmitry Verkhoturov and Umputun
0e550e83fa
add method to renew image cleanup timer
2021-05-24 17:33:59 -05:00
Dmitry Verkhoturov and Umputun
4d011aa5f3
remove error return from ExtractPictures
...
That function returns an error in a never
expected condition, and that error would be
logged message on the caller side:
none of the callers handles it.
That change hides that error from the caller
so that function would have a signature that
better fit what it does and how it behaves.
2021-05-17 21:31:56 -05:00
Dmitry Verkhoturov and Umputun
f9eb39db03
make commitTTL equal to EditDuration
...
So that image is committed to permanent
storage after comment can no longer be edited.
Also, move cleanupTTL to Cleanup function,
as it's not used elsewhere in the code.
2021-05-17 01:55:05 -05:00
Dmitry Verkhoturov and Umputun
df547cc815
less magic consonants in tests
2021-05-17 01:55:05 -05:00
Dmitry Verkhoturov and Umputun
ef1dd8162b
make consistent returns in bolt_store
2021-05-17 01:55:05 -05:00
Dmitry Verkhoturov and Umputun
fe716b0a71
validate image existence before post or preview
2021-05-16 13:50:09 -05:00
vdimir and Umputun
09f06f587c
Add tests for comment.Imported, refine image.SubmitAndCommit tests
2020-07-09 12:43:07 -05:00
vdimir and Umputun
9957ab642b
Add Imported field to comment, do not wait image submission for such comments
2020-07-09 12:43:07 -05:00
vdimir and Umputun
1f9566bb47
Use comment timestamp for submitting image ttl
2020-07-09 12:43:07 -05:00
Umputun
46f3ced83d
disable some stream tests
2020-06-08 16:10:31 -05:00
Dmitry Verkhoturov
80f4862c9c
fix leaking goroutines and add tests for them
2020-06-01 09:58:48 +02:00
Dmitry Verkhoturov and Umputun
0d67f7e53d
bump golangci-lint version, fix discovered issues
2020-05-24 19:00:07 -05:00
Umputun
0895de2f7e
rename all packages from the legacy remark/ to remark42
2020-05-12 11:34:16 -05:00
Dmitry Verkhoturov and Umputun
e922fc31a2
enable gocritic linter and fix found issues
2020-04-26 17:05:34 -05:00
Dmitry Verkhoturov and Umputun
71dcb13a71
commit proxy images same way as normally uploaded ones
2020-04-25 12:15:26 -05:00
Dmitry Verkhoturov and Umputun
b71e0be095
move cachedImgID and sha1Str from rest.proxy to store.image
2020-04-24 14:16:01 -05:00
Dmitry Verkhoturov
5ae6dcf652
introduce image.Service commitTTL and cleanupTTL properties
...
This allows having separate values of TTL for Commit and Cleanup
and moving them apart in time, also clarifying their connection
to EditTime which was previously outside of the package level.
2020-04-23 00:54:30 +02:00
Dmitry Verkhoturov
c7f73a6c84
add image.Store.Info() function
2020-04-23 00:52:36 +02:00
Dmitry Verkhoturov
3a0529e51b
enable golangci-lint for tests, fix discovered problems
2020-04-21 12:01:10 +02:00
Dmitry Verkhoturov and Umputun
513c8f353d
sticter golangci config, fix discovered issues
2020-04-19 16:21:09 -05:00
Dmitry Verkhoturov and Umputun
2acb00d424
rename image.Store.SaveWithID to Save
2020-04-19 16:21:09 -05:00
Dmitry Verkhoturov and Umputun
36cee9cc66
simplify image.Store interface
2020-04-19 16:21:09 -05:00
Dmitry Verkhoturov and Umputun
4605d567ae
make image.Close wait for all images Submit completion
2020-04-13 16:01:51 -05:00
Dmitry Verkhoturov and Umputun
afc94adc1b
remove log package usage from tests, sort imports
2020-04-13 16:01:51 -05:00
Dmitry Verkhoturov and Umputun
dba77d403d
bump go-pkgz modules, bbolt new url
2020-04-12 16:09:01 -05:00
Dmitry Verkhoturov and Umputun
fc63493e7e
return proper content type instead of image/*
2020-04-12 03:57:08 -05:00
Umputun
7614edf167
extract wait in image close
2020-04-12 03:45:03 -05:00
Dmitry Verkhoturov and Umputun
a133ab31fa
add context cancellation to image.Service.Cancel()
2020-04-12 03:34:13 -05:00
Dmitry Verkhoturov and Umputun
449e375cbb
fix image.Service termination in case Submit was never called
2020-04-12 03:34:13 -05:00
Dmitry Verkhoturov and Umputun
ce92f63215
add remote image storage support to backend
2020-04-04 14:06:39 -05:00
Dmitry Verkhoturov
4539b8ffb4
hide image.Store from image.Service consumers
2020-03-27 21:03:49 +01:00