Commit graph

158 commits

Author SHA1 Message Date
NickOvt 6548f3cd5e
fix(api-generate): API docs generation now is run through a separate npm command ZMS-139 (#659)
* added generate-api-docs npm command and corresponding code changes

* fix typo
2024-04-03 11:43:54 +03:00
NickOvt 64c6b5e63c
fix(api-quota): Quota reset now also logs storage diff. Log now includes zero valued fields ZMS-128 (#640)
* Log storage diff for quota usage recalculation API endpoint. Also logs 0

* include _set as required key as well
2024-02-29 10:32:40 +02:00
NickOvt 9f704f7c5d
fix(api-generation): api generation package now uses WIldduck Joi and does not depend on fixed joi version ZMS-126 (#639)
* restifyapi generate transformed into a class and uses the passed Joi and dirname

* remove joi dependency from .ncurc.js
2024-02-29 10:07:16 +02:00
NickOvt c7a1ab4987
fix(api-generate): Move API generation code into separate package and use it ZMS-119 (#613)
* test initial design of API generation as a restify plugin. next extract it into separate npm package and add more checks/logs etc.

* remove API docs generation from the WILDDUCK specific tools.js file into a separate file. Do appropriate changes

* move api generation into separate npm package, currently local

* add restifyapigenerate package and use it, fix path

* separate API docs generation config into a separate file. Fix API docs generation package version
2024-02-05 10:29:24 +02:00
NickOvt 84ab0c09dc
feat(api-health): Added /health endpoint to check Wildduck API health during runtime ZMS-120 (#607)
* add health api endpoint to check health of API

* fixes and add graylog logging

* round timestamp, cast to string. Use mongodb ping instead of topology.isConnected check

* add timeout to redis commands so that the health api endpoint will return a value
2024-01-26 10:23:01 +02:00
NickOvt ea24b9328b
feat(apidocs): Autogenerate OpenAPI docs ZMS-100 (#552)
* api.js added endpoint for generating openapi docs. added new info to one route in mailboxes.js and messages.js files so that the api docs generation can be done at all

* try to first generate json representation of the api docs

* add initial Joi Object parsing

* api.js make generation dynamic. messages.js add schemas from separate file. messages-schemas.js used for messages endpoint schemas

* add additions to schemas. Add new schemas to messages.js and also add response object there. Add response object parsing functionality to api.js

* add initial openapi doc yml file generation

* remove manual yaml parsing with js-yaml JSON -> YAML parsing

* fix replaceWithRefs and parseComponentsDecoupled functions, refactor, remove unnecessary comments and logs

* add support for another endpoint

* move big code from api.js to tools

* fix array type representation, fix response objects, add necessary data and changes to endpoints

* redo include logic into exclude login

* fix api generation in tools.js to accomodate new naming of objects

* fix messages.js, add structuredClone check in tools.js

* fix structured clone definition

* add one endpoint in messages.js to the api generation

* messages.js add one more endpoint to API generation

* add response to prev commit. Add new endpoint to API generation. Archive message and archive messages

* finish with post endpoints in messages.js

* added general request and response schemas. Also added req and res schemas for messages

* add multiple GET endpoints to API generation and changed them to new design. Use general schemas made earlier

* fix incorrect import of successRes

* fix mailboxes.js

* refactor general-schemas.js. Fix searchSchema in messages.js. Mailboxes.js fix response

* tools.js rename methodObj in API generation to operationObj

* tools.js api generation remove string fallbacks

* messages.js finish with GET endpoints, addition to API doc generation

* for openApi doc generation use JSON now instead of YAML
2023-11-10 17:55:16 +02:00
NickOvt c60373bbfe
ZMS-85 (#495)
* added new file to test git repo setup

* remove test.txt
Add api-tests-table.md file to keep track of api endpoints, method and their test count + test types (and their count)

* add js script to parse files in the /lib/api folder and retrieve a map of apiPath -> apiMethod

* delete parseApiFiles.js as it is unneeded

* add global (per test run) beforeEach and after hooks to collect test data and create an overview table

* update tests to conform to new test title structure

* add expectations to tests

* remove old api-tests-table.md that was handmade

* add expectations to tests in the api-test.js file

* add GET endpoint /api-methods/:arg to fetch all api endpoints for testing purposes only

* add and fix and refactor _globals-test.js file in the api test/api folder. Use global beforeEach and after hook to generate test overview table in api-test-overview.md file

* add missing newline at the end of file

* fix with prettier

* api.js fix style, remove unnecessary comments, remove :arg

* make first post,put,delete,get regex case insensitive, fix call to /api-methods

* _globals-test.js fixes

* fix some test titles

---------

Co-authored-by: Nikolai Ovtsinnikov <nikolai@zone.ee>
2023-09-14 12:49:55 +03:00
Andris Reinman a6de122c66
v1.39.5 2023-03-20 12:38:07 +02:00
Andris Reinman 5e993de791
Use restify error 2023-03-20 12:36:27 +02:00
Andris Reinman e23d188fa7
Use restify error 2023-03-20 12:34:06 +02:00
Andris Reinman 06f64c68a3
v1.39.4 2023-03-20 12:20:02 +02:00
Andris Reinman b74c1f27d7
Bumped deps 2023-03-10 11:16:43 +02:00
ethanbrooks 7831a4d498
Set restify mapFiles to true
When this is false then
2023-02-02 23:05:09 -05:00
Andris Reinman 62e00003b4
Fixed ACME renewals 2023-01-09 11:58:27 +02:00
Andris Reinman ef9a47352d
updated restify error response 2022-11-24 16:04:06 +02:00
Andris Reinman 5a48c662d6
Make sure that wrapped middleware does not return anything 2022-11-24 15:57:11 +02:00
Andris Reinman 4686b81875
Added restifyError handler 2022-11-24 13:21:10 +02:00
Andris Reinman e27eea14ff
Upgraded to Restify v9. Removed next() calls. 2022-11-24 12:26:10 +02:00
Andris Reinman 3f738389ba
Fixed CA handling for SNI certificates 2022-08-16 15:22:47 +03:00
Andris Reinman 957359c528
Allow to limit the count of filters per account 2022-07-28 11:54:26 +03:00
Andris Reinman f8af999040
allow to configure ASP limit dynamically 2022-07-04 17:18:07 +03:00
Andris Reinman 778dfac7ed
removed u2f, added webauthn 2022-03-06 00:08:48 +02:00
Andris Reinman 47d4ee5205
do not include acme routes if acme support is disabled 2022-02-03 11:56:50 +02:00
Andris Reinman 6b555c050f
pass loggelf for certificate handler 2021-10-08 17:30:15 +03:00
Andris Reinman 17a3d6107c
special case for email lines that end with carriage return only 2021-10-08 17:10:53 +03:00
Andris Reinman 2173a5c38f
Forward tracking 2021-10-04 11:57:43 +03:00
Andris Reinman 9df2a9ced8 fixed token check for acme requests 2021-09-10 10:41:58 +03:00
Andris Reinman 6fbf4c6afa allow acmeToken_get 2021-09-10 10:35:13 +03:00
Andris Reinman 64c47ec587 v1.35.1 2021-09-05 14:11:24 +03:00
Andris Reinman 6ccaec201e added simple admin page for settings 2021-09-04 15:32:27 +03:00
Andris Reinman d1885c28e0 Updated /settings endpoint. Added new setting keys 2021-09-04 10:30:50 +03:00
Andris Reinman f500a275af Added settings endpoint, allow to override ARCHIVE_TIME 2021-09-04 00:19:24 +03:00
Andris Reinman eb3e26e153 Upgraded OpenPGP to v5 2021-09-03 21:32:39 +03:00
Andris Reinman 53cda36329 Upgrade Mongodb library from 3 to 4
update
2021-08-30 11:21:50 +03:00
Andris Reinman 864fa8d8b6 use write lock for move api 2021-07-05 22:31:25 +03:00
Andris Reinman 383bcd6ee2 testing out acme-generated certificates 2021-06-11 15:07:40 +03:00
Andris Reinman 439b663815 fixed SNI for API 2021-05-19 20:54:18 +03:00
Andris Reinman c08a186f4e changes 2021-05-19 20:34:27 +03:00
Andris Reinman c3d4add637 api tls 2021-05-19 20:25:47 +03:00
Andris Reinman a03c97a943 updates for cert handling 2021-05-15 20:29:11 +03:00
Andris Reinman eec5d66094 Allow using SNI TLS certificates with IMAP/POP3 2021-05-13 17:08:14 +03:00
Andris Reinman 0e1cbb3654 Allow configuring CORS origins 2021-04-01 13:53:52 +03:00
Andris Reinman b9b1cd8494 Allow all CORS origin 2021-04-01 13:50:26 +03:00
Andris Reinman b61ba63d6a first draft for webhooks 2020-10-09 11:08:33 +03:00
Andris Reinman 399251f1fc added metaData for forwarded addresses 2020-09-28 13:45:41 +03:00
Andris Reinman fdc9af2a89 Fix broken accessToken check 2020-07-17 14:21:54 +03:00
Andris Reinman 8957ec028b default GET+POST to req.params 2020-07-16 11:15:04 +03:00
Andris Reinman 414962342b Log ip and sess to Graylog 2020-04-08 11:57:48 +03:00
Andris Reinman e2b59cb503
Fix issue where POP3 did not mark messages as seen 2020-03-15 13:25:17 +02:00
Andris Reinman 83bab195e7 updates to message auditing 2019-09-29 15:00:44 +03:00