Files
opencloud/services/groupware/Makefile
Pascal Bleser 76695c068d groupware: fix typos and minor issues
- fix a bunch of minor issues and typos that were found using GoLand
   and gosec

 - add a gosec Makefile target for Groupware related files, in
   services/groupware/Makefile

 - enable checking JMAP session capabilities for events and contacts,
   and only enable skipping that check for tasks until those are
   implemented in Stalwart as well

 - fix a CWE-190 (integer overflow or wraparound) found by gosec

 - consistently use struct references for methods of Groupware and
   Request, instead of mixing up references and copies

 - always log errors when unable to register a Prometheus metric
2026-04-13 16:40:15 +02:00

51 lines
1.6 KiB
Makefile

SHELL := bash
NAME := groupware
ifneq (, $(shell command -v go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
include ../../.bingo/Variables.mk
endif
include ../../.make/default.mk
include ../../.make/go.mk
include ../../.make/release.mk
include ../../.make/docs.mk
.PHONY: apidoc
apidoc: swagger.yml
.PHONY: tsnode
tsnode: node_modules
.PHONY: node_modules
node_modules:
pnpm install
.PHONY: swagger.yml
swagger.yml: apidoc.yml examples
groupware-apidocs -C ../../ -t $< > $@
APIDOC_PORT=9999
.PHONY: serve-apidoc
serve-apidoc: swagger.yml tsnode
swagger serve --no-open --port=$(APIDOC_PORT) --host=127.0.0.1 --flavor=redoc $<
api.html: swagger.yml favicon.png tsnode
pnpm exec redocly build-docs --output=$@.template --title="OpenCloud Groupware API" --theme.openapi.hideHostname=false --theme.openapi.hideTryItPanel=false --theme.openapi.pathInMiddlePanel=true $<
NODE_OPTIONS='--no-warnings --loader ts-node/esm' pnpm exec ts-node ./apidoc-postprocess-html.ts favicon.png < $@.template > $@
rm $@.template
.PHONY: apidoc-static
apidoc-static: api.html
.PHONY: examples
examples:
cd ../../pkg/jmap/ && go test -tags=groupware_examples . -v -count=1 -run '^.*Example$''
cd ../../pkg/jscontact/ && go test -tags=groupware_examples . -v -count=1 -run '^.*Example$''
cd ../../pkg/jscalendar/ && go test -tags=groupware_examples . -v -count=1 -run '^.*Example$''
cd ./pkg/groupware/ && go test -tags=groupware_examples . -v -count=1 -run '^.*Example$''
.PHONY: gosec
gosec:
cd ../../ && gosec ./pkg/jmap/... ./pkg/jscalendar/... ./pkg/jscontact/... ./services/groupware/pkg/...