Commit Graph

3228 Commits

Author SHA1 Message Date
Dmitry Verkhoturov 661f042cb4 pin golangci-lint version to latest available, fix reported errors 2024-05-09 22:32:00 -05:00
Pavel Francírek 877765cda2 Update cs.json - typos
Only typo corrections.
2024-04-11 11:37:58 -05:00
Dmitry Verkhoturov 4bb0017060 update go modules 2024-04-10 19:33:20 -05:00
Dmitry Verkhoturov e0423b8683 fix type for value for refresh token cache
It was set to string by mistake, proper type is token.Claims.
2024-03-22 04:16:29 -05:00
Dmitry Verkhoturov 5a781693aa hide delete button for non-admin users after edit period expires 2024-03-17 16:47:28 -05:00
Dmitry Verkhoturov e5743185b0 collect /find Info for tree and plain types consistently
MakeTree calculated Info locally for historical reasons,
and the results were consistent with the dataService.Info call
but calculated differently.

That change fixes that, ensuring that Info is requested
in the same manner.
2024-03-16 12:49:45 -05:00
dependabot[bot] 1510aec17c Bump google.golang.org/protobuf from 1.32.0 to 1.33.0 in /backend
Bumps google.golang.org/protobuf from 1.32.0 to 1.33.0.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-13 18:33:05 -05:00
Dmitry Verkhoturov 01837b69e5 fix readonly status, deleted count for plain /find request 2024-03-04 15:44:19 -06:00
Dmitry Verkhoturov d02099844e apply prettier to site files 2024-02-25 18:27:06 -06:00
Dmitry Verkhoturov 6fcfaa12b7 update site dependencies 2024-02-25 18:27:06 -06:00
Dmitry Verkhoturov 6269c19881 add more tests for GET /find endpoint 2024-02-21 10:43:28 -06:00
Dmitry Verkhoturov 1313dee829 update to lcw v2 with generic types 2024-02-20 14:15:35 -06:00
Dmitry Verkhoturov 3210de8f7b update go modules 2024-02-20 12:23:16 -06:00
Dmitry Verkhoturov 532573fb34 fix problems reported by golangci-lint 2024-02-20 12:10:39 -06:00
Konstantsin Kryulenia e1173bbcad use specific pnpm version 2024-02-03 12:09:57 -06:00
Konstantsin Kryulenia e748951182 skip lint jpeg files 2024-02-03 12:09:57 -06:00
Konstantsin Kryulenia df8670752a copy example image to public folder 2024-02-03 12:09:57 -06:00
Dmitry Verkhoturov 654250f033 don't load kitten picture from third party site 2024-02-03 12:09:57 -06:00
Dmitry Verkhoturov 0050c65596 add meaningful error for lack of auth on import, remap and backup
Previously, the error printed was just the following:

error response "401 Unauthorized", Unauthorized"

New error:

error response "401 Unauthorized", ensure you have set ADMIN_PASSWD
and provided it to the command you're running: Unauthorized
2024-01-28 12:16:24 -06:00
Dmitry Verkhoturov 02db7a917d fix lack of error on file site export
Previously, status 200 was set for file export, which is used
for backup, which resulted in an inability to set an error status code
in case of a problem with file generation.

After this change, status code 200 would be written automatically by Go
before we start writing the response's body.
2024-01-28 12:16:24 -06:00
Dmitry Verkhoturov 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
Paul Mineev 82c617806d chore: remove theme from comment content 2024-01-18 02:56:10 -06:00
Paul Mineev e043dc2ac3 fix: break long words in code tag, combine all styles in one file, move styles to correct place 2024-01-18 02:56:10 -06:00
Dmitry Verkhoturov cbd73865bd update go modules, update go-pkgz/auth to latest commit 2024-01-11 15:57:39 -06:00
Dmitry Verkhoturov 884b5685eb update docker images and github CI actions 2024-01-11 01:26:30 -06:00
NavyStack 3f14651653 fix: add missing Japanese translation 2024-01-08 11:23:03 -06:00
NavyStack 310b797679 fix: add missing Japanese translation 2024-01-08 11:23:03 -06:00
NavyStack 0594565143 FIX: Character escaping 2024-01-08 11:23:03 -06:00
NavyStack d4c153662b update: Korean translation 2024-01-08 11:23:03 -06:00
NavyStack f64b0b8831 fix: Korean missing strings 2024-01-08 11:23:03 -06:00
Vladimir D 94893b77dc bump deps 2023-12-26 11:47:09 -06:00
Vladimir D 30f46efa5b TLS InsecureSkipVerify option 2023-12-26 11:47:09 -06:00
Vladimir D e0904603c6 go-pkgz/auth and go-pkgz/email modules updated, bump deps 2023-12-26 11:47:09 -06:00
Dmitry Verkhoturov d143932924 add MIN_COMMENT_SIZE parameter 2023-12-02 12:16:26 -06:00
Dmitry Verkhoturov dcc7613409 allow disabling fancy HTML formatting
It might be necessary if the comments should preserve
original quotes instead of replacing them with angled ones.
2023-11-26 09:13:53 +01:00
Dmitry Verkhoturov d04d2097f8 fix Commento import URL
Previously, it was not using the domain
and relying on another export format.
2023-11-20 10:59:05 -06:00
Dmitry Verkhoturov ce678bf967 fix Commento top-level comments import
Previously, top-level comments were incorrectly assigned
parent comment id "root", which made them non-root,
so they are not returned when requested
in the `/find?format=tree` API call.

To fix the previously imported comments, please export all your comments
and replace `"pid":"root"` with `"pid":""` and then re-import them.
2023-11-18 20:30:18 +01:00
Dmitry Verkhoturov cd481d401d add tests for admin Store and DataService 2023-11-04 12:49:40 -05:00
Dmitry Verkhoturov 618c267370 combine multiple post info in DataStore.Info instead of returning first
Previously, only the first one was returned for site-wide requests,
and now all returned information will be correctly aggregated,
and the PostInfo.URL and PostInfo.ReadOnly parameters will be dropped.
2023-11-04 12:49:40 -05:00
Dmitry Verkhoturov 307866f7f5 simplify BoltDB.Info code
The new code does the same as the old one but doesn't call the checkFlag
in case ReadOnly is already set based on age.
2023-11-04 12:46:38 -05:00
Dmitry Verkhoturov 19e1616129 allow title extraction only from full match of AllowedHosts
Previously, we extracted the second-level domain,
but it doesn't make sense for a list of domains defined explicitly
to display the comments.
2023-11-04 12:45:19 -05:00
dependabot[bot] c6506b8905 Bump luxon from 2.3.0 to 2.5.2 in /site
Bumps [luxon](https://github.com/moment/luxon) from 2.3.0 to 2.5.2.
- [Release notes](https://github.com/moment/luxon/releases)
- [Changelog](https://github.com/moment/luxon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moment/luxon/compare/2.3.0...2.5.2)

---
updated-dependencies:
- dependency-name: luxon
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-28 03:15:10 -05:00
Paul Mineev 676ae77456 update links styles 2023-10-28 01:56:04 -05:00
Paul Mineev b93fc48b73 fix types on error message extraction 2023-10-28 01:45:03 -05:00
Paul Mineev 4be664e78d fix styles around admin controls 2023-10-28 01:36:17 -05:00
Paul Mineev 62aaa35287 fix types on error message extraction 2023-10-28 01:35:58 -05:00
Dmitry Verkhoturov 69b18d3536 fix wrapped errors checks
As errors can be wrapped in recent versions of Go, the proper way
to check the error types are `errors.As` and `errors.Is`.
2023-10-10 23:36:04 -05:00
Dmitry Verkhoturov efceed6f68 limit TitleExtractor to allow only Remark42 whitelisted domains
Allowed domains consist of `REMARK_URL` second-level domain (or whole IP in case it's IP like `127.0.0.1`) and `ALLOWED_HOSTS`. That is needed to prevent Remark42 from asking arbitrary servers and storing the page title as the comment.PostTitle.

Previous behaviour allowed the caller of the API to create a comment
with an arbitrary URL and learn the title of the page, which might be
accessible to the server Remark42 is installed on but not to the user
outside that network (CWE-918).
2023-10-10 23:34:35 -05:00
Dmitry Verkhoturov f4358173c7 limit TitleExtractor to allow only Remark42 whitelisted domains
Allowed domains consist of `REMARK_URL` second-level domain (or whole IP in case it's IP like `127.0.0.1`) and `ALLOWED_HOSTS`. That is needed to prevent Remark42 from asking arbitrary servers and storing the page title as the comment.PostTitle.

Previous behaviour allowed the caller of the API to create a comment
with an arbitrary URL and learn the title of the page, which might be
accessible to the server Remark42 is installed on but not to the user
outside that network (CWE-918).
2023-10-10 23:34:35 -05:00
Dmitry Verkhoturov 7a71d47556 remove all HTML tags from comment title and username
Previously, we stripped unsafe HTML tags but left some,
but it's not expected to have a link in a title or username,
so the new behaviour is stripping everything.
2023-10-10 12:41:26 -05:00