Compare commits

..

545 Commits

Author SHA1 Message Date
renovate abfdae0012 fix(deps): update golang.org/x/sys commit hash to 528a39c (#974)
Reviewed-on: vikunja/api#974
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-09-09 22:22:38 +00:00
renovate 5f5936c972 fix(deps): update golang.org/x/sys commit hash to aa78b53 (#973)
Reviewed-on: vikunja/api#973
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-09-09 16:16:28 +00:00
renovate 111ac92619 fix(deps): update golang.org/x/sys commit hash to a851e7d (#972)
Reviewed-on: vikunja/api#972
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-09-08 20:17:39 +00:00
kolaente bf00ea4939
0.18.1 release preparations 2021-09-08 19:46:02 +02:00
kolaente 465f6d90ab
Fix tasks not exported 2021-09-08 18:40:54 +02:00
renovate 07bda3eae3 fix(deps): update golang.org/x/sys commit hash to c212e73 (#971)
Reviewed-on: vikunja/api#971
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-09-08 16:22:29 +00:00
kolaente 03d818fd9f
Fix tmp export file created in the wrong path 2021-09-08 17:44:23 +02:00
kolaente f019ae42bb
Fix exporting tasks from archived lists 2021-09-08 17:40:33 +02:00
kolaente 9000f2c3cd
Fix lint 2021-09-07 19:09:44 +02:00
kolaente cc1bb3083f
Don't try to export items which do not have a parent 2021-09-06 22:14:38 +02:00
kolaente be47459c14
Docs: Add another third-party tutorial link 2021-09-06 21:15:04 +02:00
renovate 086f005e3d fix(deps): update golang.org/x/sys commit hash to 6f6e228 (#970)
Reviewed-on: vikunja/api#970
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-09-06 19:02:33 +00:00
kolaente 24bb7e98fa
0.18.0 release preparations 2021-09-05 16:49:13 +02:00
kolaente 496c38de8e
Switch the :latest docker image tag to contain the latest release instead of the latest unstable 2021-09-05 14:39:56 +02:00
konrad 90146aea5b User Data Export and import (#967)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#967
Co-authored-by: konrad <k@knt.li>
Co-committed-by: konrad <k@knt.li>
2021-09-04 19:26:31 +00:00
renovate fc51a3e76f fix(deps): update golang.org/x/sys commit hash to 97244b9 (#965)
Reviewed-on: vikunja/api#965
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-09-03 12:41:22 +00:00
renovate 4154247d95 fix(deps): update module github.com/lib/pq to v1.10.3 (#963)
Reviewed-on: vikunja/api#963
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-09-02 21:16:49 +00:00
renovate e3956527d4 fix(deps): update golang.org/x/sys commit hash to f475640 (#962)
Reviewed-on: vikunja/api#962
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-09-02 06:09:23 +00:00
kolaente 15e5a9069b
Docs: Update translation guidelines 2021-08-31 22:45:02 +02:00
kolaente c9d0f519ee
Docs: Update translation guidelines 2021-08-31 22:41:56 +02:00
renovate 72f7c3333a fix(deps): update golang.org/x/sys commit hash to f4d4317 (#961)
Reviewed-on: vikunja/api#961
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-31 05:17:52 +00:00
kolaente d7b74500c3
Add another youtube tutorial 2021-08-30 20:55:21 +02:00
kolaente bd24743640
docs: Add other installation resources 2021-08-23 17:52:01 +02:00
renovate e2dd9d85b5 fix(deps): update golang.org/x/sys commit hash to 63515b4 (#959)
Reviewed-on: vikunja/api#959
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-23 08:21:32 +00:00
kolaente f8833ae8a2
docs: Add k8s-at-home Helm Chart for Vikunja 2021-08-20 19:24:50 +02:00
renovate ade085ddeb Update golang.org/x/sys commit hash to 41cdb87 (#956)
Reviewed-on: vikunja/api#956
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-20 15:52:48 +00:00
renovate e00bcf4802 Update golang.org/x/sys commit hash to f52c844 (#954)
Reviewed-on: vikunja/api#954
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-19 21:31:53 +00:00
renovate aee4b14ed0 Update golang.org/x/oauth2 commit hash to 2bc19b1 (#955)
Reviewed-on: vikunja/api#955
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-19 20:23:55 +00:00
renovate f98c7877fc Update golang.org/x/sys commit hash to 00dd8d7 (#953)
Reviewed-on: vikunja/api#953
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-18 16:06:38 +00:00
renovate 52eb923327 Update golang.org/x/oauth2 commit hash to 7df4dd6 (#952)
Reviewed-on: vikunja/api#952
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-18 05:29:05 +00:00
renovate f04c8048df Update golang.org/x/sys commit hash to bfb29a6 (#951)
Reviewed-on: vikunja/api#951
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-17 20:07:13 +00:00
renovate 8382d06ea9 Update golang.org/x/crypto commit hash to 32db794 (#949)
Reviewed-on: vikunja/api#949
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-17 17:28:44 +00:00
renovate 67681f9e2b Update golang.org/x/sys commit hash to 7d9622a (#948)
Reviewed-on: vikunja/api#948
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-17 15:39:16 +00:00
renovate fef3d8199c Update golang.org/x/sys commit hash to 1e6c022 (#947)
Reviewed-on: vikunja/api#947
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-16 21:17:25 +00:00
renovate 32ba088497 Update golang.org/x/sys commit hash to 15123e1 (#946)
Reviewed-on: vikunja/api#946
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-16 10:35:10 +00:00
renovate b451399a1d Update golang.org/x/sys commit hash to 30e4713 (#945)
Reviewed-on: vikunja/api#945
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-16 05:29:30 +00:00
kolaente 98f367eb97
Add menu link to Vikunja Cloud in docs 2021-08-15 18:20:39 +02:00
kolaente dcddaab7b5
Set todoist migration redirect url to the frontend url by default 2021-08-14 18:27:29 +02:00
renovate b3bb7395cd Update golang.org/x/crypto commit hash to 0a44fdf (#944)
Reviewed-on: vikunja/api#944
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-14 07:06:37 +00:00
kolaente 483496cc26
Fix saving reminders of repeating tasks 2021-08-13 21:36:16 +02:00
renovate 7ffa08ee1a Update golang.org/x/crypto commit hash to 0ba0e8f (#943)
Reviewed-on: vikunja/api#943
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-12 21:18:57 +00:00
renovate ed65a7cd34 Update module github.com/go-redis/redis/v8 to v8.11.3 (#942)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#942
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-12 18:09:15 +00:00
renovate 83809d1bd6 Update monachus/hugo Docker tag to v0.75.1 (#940)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#940
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-12 17:59:37 +00:00
konrad 2007f63502 Tune test db server settings to speed up tests (#939)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#939
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-08-11 22:03:04 +00:00
kolaente b92da0a5f1
Rename and sign drone config 2021-08-11 23:28:21 +02:00
renovate 6b7aa380ec Update module github.com/swaggo/swag to v1.7.1 (#936)
Reviewed-on: vikunja/api#936
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-11 21:02:29 +00:00
konrad 27119ad6d4 User account deletion (#937)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#937
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-08-11 19:08:10 +00:00
renovate cd21c5fc6e Update golang.org/x/oauth2 commit hash to faf39c7 (#935)
Reviewed-on: vikunja/api#935
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-11 16:47:48 +00:00
kolaente 77c2b77079
Show config full paths and env variables with config options 2021-08-11 18:20:34 +02:00
renovate 1fbd9b67e0 Update golang.org/x/sys commit hash to d867a43 (#934)
Reviewed-on: vikunja/api#934
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-10 14:31:44 +00:00
renovate fb69260b64 Update golang.org/x/sys commit hash to e5e7981 (#933)
Reviewed-on: vikunja/api#933
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-06 19:41:48 +00:00
renovate aeba72a7ea Update module github.com/go-redis/redis/v8 to v8.11.2 (#932)
Reviewed-on: vikunja/api#932
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-06 15:13:37 +00:00
renovate cd5b46363d Update golang.org/x/oauth2 commit hash to 6f1e639 (#931)
Reviewed-on: vikunja/api#931
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-05 19:12:18 +00:00
renovate c3da454854 Update module github.com/golang-jwt/jwt to v4 (#930)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#930
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-03 21:43:18 +00:00
renovate e38be9bd18 Update module github.com/labstack/echo/v4 to v4.5.0 (#929)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#929
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-02 18:33:53 +00:00
kolaente dc2915875b
Docs: Fix rewrite rules in apache example configs 2021-08-02 17:09:38 +02:00
renovate be4d53d805 Update module github.com/golang-jwt/jwt to v3.2.2 (#928)
Reviewed-on: vikunja/api#928
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-08-02 15:03:46 +00:00
kolaente d34c85d544
Increase test timeout 2021-08-02 13:13:24 +02:00
kolaente 647f3cb9f1
Increase test timeout 2021-08-02 13:02:49 +02:00
kolaente f237afd2ac
Fix panic on invalid smtp config 2021-08-02 00:05:13 +02:00
konrad 4c5f457313 Ensure case insensitive search on postgres (#927)
Reviewed-on: vikunja/api#927
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-08-01 21:40:25 +00:00
kolaente 9c2a59582a
Fix setting up keyvalue storage in tests 2021-07-30 15:31:51 +02:00
kolaente d746c1bede
Notify the user after three failed login attempts 2021-07-30 15:01:04 +02:00
kolaente 220f43331f
Reset failed totp attempts when logging in successfully 2021-07-30 14:46:10 +02:00
kolaente 24f7d9b4f7
Only send an email about failed totp after three failed attempts 2021-07-30 14:42:03 +02:00
kolaente 5cfc9bf2f9
Disable the user account after 10 failed password attempts 2021-07-29 18:45:22 +02:00
kolaente 3572ac4b82
Send a notification on failed TOTP 2021-07-29 18:05:25 +02:00
konrad 1571dfa825 Task mentions (#926)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#926
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-07-29 15:42:49 +00:00
kolaente e600f61e06
Fix moving the done bucket around 2021-07-29 17:32:33 +02:00
renovate ea921f5350 Update module github.com/go-redis/redis/v8 to v8.11.1 (#925)
Reviewed-on: vikunja/api#925
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-07-29 09:47:34 +00:00
konrad 6ccb85a0dc Reorder tasks, lists and kanban buckets (#923)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#923
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-07-28 19:06:40 +00:00
kolaente dac315db59
Fix jwt middleware 2021-07-27 15:25:48 +02:00
kolaente eae3cbc7bb
Replace jwt-go with github.com/golang-jwt/jwt 2021-07-27 10:46:28 +02:00
kolaente d9b38b85f6
Fix setting a saved filter as favorite 2021-07-20 21:32:25 +02:00
kolaente c7f337f303
Fix tests & lint 2021-07-20 11:00:20 +02:00
kolaente 733f26f017
Fix error handling when deleting an attachment file 2021-07-20 10:14:49 +02:00
kolaente e4a0066e20
Make sure all associated entities of a task are deleted when the task is deleted 2021-07-19 23:52:58 +02:00
kolaente d28390d792
Fix task relations not getting properly cleaned up when deleting them 2021-07-19 23:40:18 +02:00
kolaente 0b90d826be
Don't notify the user who created the team 2021-07-19 23:29:25 +02:00
renovate 850c3a3dd4 Update module github.com/mattn/go-sqlite3 to v1.14.8 (#921)
Reviewed-on: vikunja/api#921
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-07-17 16:39:53 +00:00
kolaente 4cf7c459da
Allow running migration 20210711173657 multiple times to fix issues when it didn't completely run through previously 2021-07-15 11:36:33 +02:00
kolaente 2a80e552cc
Save user tokens as varchar(450) and not text to fix mysql indexing issues 2021-07-14 14:48:27 +02:00
kolaente 7e229a1b83
Save user tokens as text and not varchar 2021-07-14 12:43:28 +02:00
kolaente 7ee535de47
Docs improvements 2021-07-14 00:25:12 +02:00
konrad 4216ed7277 Refactor user email confirmation + password reset handling (#919)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#919
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-07-13 20:56:02 +00:00
kolaente d5d4d8b6ed
Fix lint 2021-07-13 12:16:12 +02:00
kolaente 9559cbf1ec
Add more logging for test data api endpoint 2021-07-13 12:14:59 +02:00
kolaente 265e778867
Docs: Translation now happening at crowdin 2021-07-13 11:42:46 +02:00
renovate 53f37e12ec Update module github.com/iancoleman/strcase to v0.2.0 (#918)
Reviewed-on: vikunja/api#918
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-07-13 09:20:11 +00:00
renovate 302199089d Update module github.com/labstack/echo/v4 to v4.4.0 (#917)
Reviewed-on: vikunja/api#917
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-07-12 20:37:02 +00:00
kolaente 7adbd21698
Fix setting task favorite status of related tasks
Not really reproducable locally, but a real issue.
2021-07-12 12:19:01 +02:00
kolaente d26f81162f
Add ios to the list of not working caldav clients 2021-07-11 16:37:05 +02:00
kolaente e21a3904ff
Fix mapping task priorities from Vikunja to calDAV
Resolves #866
2021-07-11 15:03:50 +02:00
kolaente 562ef9af36
Add searching for tasks by index 2021-07-11 14:19:59 +02:00
renovate 294fc16593 Update golang.org/x/crypto commit hash to a769d52 (#916)
Reviewed-on: vikunja/api#916
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-07-11 10:48:39 +00:00
konrad d0c77ad1c1 Make sure list / task favorites are set per user, not per entity (#915)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#915
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-07-10 10:21:54 +00:00
kolaente 373e3f3d60
Add a note about default password to docs 2021-07-09 21:12:32 +02:00
kolaente 358661e060
Change task title to TEXT instead of varchar(250) to allow for longer task titles 2021-07-09 19:46:47 +02:00
kolaente 32a07c4c61
Fix importing archived projects and done items from todoist 2021-07-08 11:37:50 +02:00
kolaente 5b825f1cc8
Make sure a bucket exists or use the default bucket when importing tasks 2021-07-08 10:34:03 +02:00
andreymal 50b49ffab6 Add support of Unix socket (#912)
Reviewed-on: vikunja/api#912
Reviewed-by: konrad <konrad@kola-entertainments.de>
Co-authored-by: andreymal <andriyano-31@mail.ru>
Co-committed-by: andreymal <andriyano-31@mail.ru>
2021-07-08 08:13:01 +00:00
kolaente 8b6aeb8571
Fix lint 2021-07-07 20:53:26 +02:00
kolaente 0c5dfe5c48
Better logging for errors while importing a bunch of tasks 2021-07-06 18:14:40 +02:00
kolaente d7932d2648
Don't fail when removing the last bucket in migration from other services 2021-07-06 15:43:38 +02:00
renovate f1df45b632 Update module github.com/yuin/goldmark to v1.4.0 (#908)
Reviewed-on: vikunja/api#908
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-07-05 08:53:07 +00:00
renovate ff2dac1a10 Update module github.com/spf13/cobra to v1.2.1 (#906)
Reviewed-on: vikunja/api#906
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-07-04 13:08:54 +00:00
renovate e857d73c22 Update module github.com/spf13/cobra to v1.2.0 (#905)
Reviewed-on: vikunja/api#905
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-07-01 22:07:05 +00:00
renovate b3f7827e39 Update module github.com/go-redis/redis/v8 to v8.11.0 (#903)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#903
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-07-01 10:05:50 +00:00
renovate bba6d8feb1 Update module github.com/gabriel-vasile/mimetype to v1.3.1 (#904)
Reviewed-on: vikunja/api#904
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-07-01 08:18:11 +00:00
renovate 2cc365ff0c Update golang.org/x/oauth2 commit hash to a41e5a7 (#902)
Reviewed-on: vikunja/api#902
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-28 19:57:58 +00:00
renovate 5593d7bace Update module github.com/yuin/goldmark to v1.3.9 (#901)
Reviewed-on: vikunja/api#901
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-28 16:27:00 +00:00
renovate e6d4620f92 Update golang.org/x/image commit hash to a66eb64 (#900)
Reviewed-on: vikunja/api#900
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-28 06:35:43 +00:00
renovate f70d357a93 Update module github.com/spf13/viper to v1.8.1 (#899)
Reviewed-on: vikunja/api#899
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-25 15:22:42 +00:00
kolaente 37718c3282
Todoist migration: don't panic if no reminder was found for task
See #897
2021-06-24 23:02:28 +02:00
kolaente 7408380560
Add translation docs 2021-06-24 00:14:29 +02:00
renovate 4ed4a96059 Update golang.org/x/oauth2 commit hash to a8dc77f (#896)
Reviewed-on: vikunja/api#896
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-22 22:15:20 +00:00
renovate 9b03c28e0d Update golang.org/x/oauth2 commit hash to bce0382 (#895)
Reviewed-on: vikunja/api#895
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-22 20:13:16 +00:00
renovate f17e2f9e7c Update golang.org/x/oauth2 commit hash to 14747e6 (#894)
Reviewed-on: vikunja/api#894
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-22 18:03:11 +00:00
renovate 441e38086d Update golang.org/x/image commit hash to e6eecd4 (#893)
Reviewed-on: vikunja/api#893
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-22 10:57:37 +00:00
kolaente bf68ccbb25
Don't use the mariadb root user in docker-compose examples 2021-06-20 22:37:35 +02:00
renovate 1386ed4023 Update module github.com/yuin/goldmark to v1.3.8 (#892)
Reviewed-on: vikunja/api#892
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-17 12:40:52 +00:00
renovate d2a3db5dce Update golang.org/x/crypto commit hash to 5ff15b2 (#891)
Reviewed-on: vikunja/api#891
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-17 06:34:59 +00:00
kolaente 63340b32f8
Revert "Update alpine Docker tag to v3.14 (#889)"
This reverts commit 81d469f6

See https://gitlab.alpinelinux.org/alpine/aports/-/issues/12764
2021-06-16 15:58:22 +02:00
renovate 52f6b10a65 Update module github.com/spf13/viper to v1.8.0 (#890)
Reviewed-on: vikunja/api#890
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-16 08:19:05 +00:00
renovate 81d469f687 Update alpine Docker tag to v3.14 (#889)
Reviewed-on: vikunja/api#889
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-16 08:06:15 +00:00
renovate 769b5d1c6c Update golang.org/x/oauth2 commit hash to d040287 (#888)
Reviewed-on: vikunja/api#888
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-15 20:20:34 +00:00
renovate 1c77e40e6e Update golang.org/x/term commit hash to 6886f2d (#887)
Reviewed-on: vikunja/api#887
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-15 18:50:23 +00:00
kolaente 6f54d4d8be
Revert "Update alpine Docker tag to v3.13 (#884)"
This reverts commit b4f08e88

Reverting because alpine 3.13 does not work on arm (but it does on arm64) - see https://drone.kolaente.de/vikunja/api/3070/4/3
2021-06-15 10:18:04 +02:00
renovate 6018573d81 Update module github.com/coreos/go-oidc to v3 (#885)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#885
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-14 20:56:29 +00:00
renovate b4f08e88ae Update alpine Docker tag to v3.13 (#884)
Reviewed-on: vikunja/api#884
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-14 20:34:11 +00:00
renovate 88c3bd43a4 Update module go-redis/redis/v8 to v8.10.0 (#882)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#882
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-11 15:38:01 +00:00
renovate 61dd159131 Update module go-redis/redis/v8 to v8.7.1 (#807)
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#807
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-11 14:10:26 +00:00
renovate 5c79add056 Update module getsentry/sentry-go to v0.11.0 (#869)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#869
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-11 13:24:20 +00:00
renovate 6b70069eba Update module prometheus/client_golang to v1.11.0 (#879)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#879
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-11 13:08:28 +00:00
kolaente 9147e6739f
Fix authentication callback 2021-06-09 23:00:42 +02:00
kolaente 570d146b21
Fix parsing openid config when using a json config file 2021-06-09 21:56:17 +02:00
renovate cc2c158b9d Update golang.org/x/image commit hash to 775e3b0 (#880)
Reviewed-on: vikunja/api#880
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-06-07 16:15:28 +00:00
kolaente 78a206c818
Add setting for first day of the week 2021-06-03 18:11:44 +02:00
kolaente fc5703ac8c
Add truncate parameter to test fixtures setup 2021-06-03 15:30:31 +02:00
sytone 3277f6acf7 Add default list setting (#875)
Co-authored-by: Sytone <github@sytone.com>
Reviewed-on: vikunja/api#875
Reviewed-by: konrad <konrad@kola-entertainments.de>
Co-authored-by: sytone <kolaente@sytone.com>
Co-committed-by: sytone <kolaente@sytone.com>
2021-06-02 21:20:22 +00:00
kolaente 8a1e98a7f2
Fix goimports 2021-05-31 21:05:14 +02:00
kolaente 9a2655dbf1
Fix saving pointer values to memory keyvalue 2021-05-31 20:54:15 +02:00
kolaente d48aa101cf
Refactor & fix storing struct-values in redis keyvalue 2021-05-28 10:52:51 +02:00
kolaente df45675df3
Rearrange setting frontend url in config 2021-05-28 08:46:31 +02:00
kolaente afd6bde74d
Make sure the configured frontend url always has a / at the end 2021-05-28 08:39:27 +02:00
kolaente e23014dbe4
Fix swagger docs for create requests 2021-05-26 21:56:31 +02:00
kolaente 8e65ffb99b
Fix duplicating empty lists 2021-05-26 12:01:50 +02:00
kolaente 3f6d85497f
Fix error when searching for a namespace returned no results 2021-05-26 12:00:55 +02:00
kolaente 88b9ea6a96
Fix error when searching for a namespace with subscribers 2021-05-26 11:04:29 +02:00
renovate 67f863120e Update module go-testfixtures/testfixtures/v3 to v3.6.1 (#868)
Reviewed-on: vikunja/api#868
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-05-21 08:16:45 +00:00
kolaente ffede02ddc
Update golang.org/x/net commit hash to 37e1c6af 2021-05-20 19:42:33 +02:00
kolaente 3973ce985d
Try to get more information about the user when authenticating with openid 2021-05-19 14:45:24 +02:00
renovate 2351194547 Update module yuin/goldmark to v1.3.7 (#867)
Reviewed-on: vikunja/api#867
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-05-17 15:03:08 +00:00
kolaente b7ec24ff52
Fix old references to master in docs 2021-05-17 12:53:12 +02:00
renovate aaac4c6dfc Update module lib/pq to v1.10.2 (#865)
Co-authored-by: konrad <konrad@kola-entertainments.de>
Reviewed-on: vikunja/api#865
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-05-17 10:44:55 +00:00
kolaente 2e52cc1802
Fix lint 2021-05-17 12:15:15 +02:00
kolaente 20ede346b4
Only filter out failing openid providers if multiple are configured and one of them failed 2021-05-16 13:28:15 +02:00
kolaente b76ad8efe2
Add more logging and better error messages for openid authentication + clarify docs 2021-05-16 13:23:10 +02:00
renovate d695681a0e Update module yuin/goldmark to v1.3.6 (#863)
Reviewed-on: vikunja/api#863
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-05-15 13:17:27 +00:00
renovate 52c3075c3d Update golang.org/x/oauth2 commit hash to f6687ab (#862)
Reviewed-on: vikunja/api#862
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-05-14 22:10:40 +00:00
kolaente e837c2a003
Release preparations 2021-05-14 17:03:42 +02:00
renovate f670d394fa Update golang.org/x/crypto commit hash to c07d793 (#861)
Reviewed-on: vikunja/api#861
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-05-13 17:20:01 +00:00
renovate 71cc7334cc Update golang.org/x/crypto commit hash to cd7d49e (#860)
Reviewed-on: vikunja/api#860
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-05-13 13:20:53 +00:00
earnest ma fc1867ec70 Update README (#858)
Reviewed-on: vikunja/api#858
Reviewed-by: konrad <konrad@kola-entertainments.de>
Co-authored-by: earnest ma <me@earne.link>
Co-committed-by: earnest ma <me@earne.link>
2021-05-11 18:14:35 +00:00
renovate d69482cda9 Update module gabriel-vasile/mimetype to v1.3.0 (#857)
Reviewed-on: vikunja/api#857
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-05-10 10:16:25 +00:00
renovate 71d60e908a Update module labstack/echo/v4 to v4.3.0 (#856)
Reviewed-on: vikunja/api#856
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-05-08 22:17:06 +00:00
kompetenzbolzen 86b7d224ab Expose tls parameter of Go MySQL driver to config file (#855)
Co-authored-by: Jonas Gunz <himself@jonasgunz.de>
Reviewed-on: vikunja/api#855
Reviewed-by: konrad <konrad@kola-entertainments.de>
Co-authored-by: kompetenzbolzen <himself@jonasgunz.de>
Co-committed-by: kompetenzbolzen <himself@jonasgunz.de>
2021-05-08 14:54:55 +00:00
kolaente 9dc72c5c98
Use golang's tzdata package to handle time zones 2021-05-07 12:18:21 +02:00
renovate f052fc19fc Update golang.org/x/crypto commit hash to 38f3c27 (#854)
Reviewed-on: vikunja/api#854
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-05-06 16:16:53 +00:00
renovate 06cc0a06e4 Update golang.org/x/crypto commit hash to 3497b51 (#853)
Reviewed-on: vikunja/api#853
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-05-06 06:26:24 +00:00
renovate 02dd7ee571 Update golang.org/x/image commit hash to 7319ad4 (#852)
Reviewed-on: vikunja/api#852
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-05-04 15:28:30 +00:00
renovate abc1fa2fed Update golang.org/x/crypto commit hash to e9a3299 (#851)
Reviewed-on: vikunja/api#851
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-05-03 20:14:00 +00:00
renovate b5da7fc546 Update golang.org/x/term commit hash to a79de54 (#850)
Reviewed-on: vikunja/api#850
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-05-03 08:37:51 +00:00
renovate d715b02421 Update golang.org/x/term commit hash to c04ba85 (#849)
Reviewed-on: vikunja/api#849
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-04-29 16:15:27 +00:00
renovate b7b69afa0c Update golang.org/x/term commit hash to f5beecf (#845)
Reviewed-on: vikunja/api#845
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-04-27 20:37:13 +00:00
renovate ce15ade6b8 Update golang.org/x/oauth2 commit hash to 81ed05c (#848)
Reviewed-on: vikunja/api#848
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-04-27 19:36:51 +00:00
kolaente 0986ec6bdd
Update changelog 2021-04-22 17:20:04 +02:00
kolaente 8b56308a59
Update changelog 2021-04-22 17:20:04 +02:00
kolaente 0f5f85e687
Fix tests 2021-04-22 17:13:47 +02:00
kolaente 4ceeb877b1
Fix checking list rights when accessing a bucket 2021-04-22 16:44:42 +02:00
kolaente 4393320691
Add security information to readme 2021-04-22 15:07:28 +02:00
kolaente e4db9dfe6c
Cleanup old docs themes submodule 2021-04-22 11:33:15 +02:00
kolaente 4504499f60
Switch building the docs to download the theme instead of building 2021-04-22 11:25:19 +02:00
renovate 43cb7f1fc2 Update golang.org/x/term commit hash to b80969c (#843)
Reviewed-on: vikunja/api#843
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-04-22 08:54:44 +00:00
renovate 30919fd4da Update module lib/pq to v1.10.1 (#841)
Reviewed-on: vikunja/api#841
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-04-21 20:28:50 +00:00
renovate 5089049b17 Update golang.org/x/crypto commit hash to 83a5a9b (#840)
Reviewed-on: vikunja/api#840
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-04-21 19:45:25 +00:00
renovate 6fc4e35ac4 Update golang.org/x/crypto commit hash to 5bf0f12 (#839)
Reviewed-on: vikunja/api#839
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-04-21 17:57:35 +00:00
kolaente 6e263b6a91
Improve sending overdue task reminders by only sending one for all overdue tasks 2021-04-18 15:32:02 +02:00
kolaente 7ff7b0d743
Improve duration format of overdue tasks in reminders 2021-04-18 14:25:50 +02:00
renovate 410a7426cf Update module go-testfixtures/testfixtures/v3 to v3.6.0 (#838)
Reviewed-on: vikunja/api#838
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-04-18 10:31:13 +00:00
renovate 8d1cee4500 Update golang.org/x/crypto commit hash to 4f45737 (#836)
Reviewed-on: vikunja/api#836
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-04-15 19:08:11 +00:00
kolaente f429efc220
Add bucket limit validation 2021-04-15 16:55:21 +02:00
kolaente 6e5a9868f5
Fix moving repeating tasks to the done bucket 2021-04-15 16:36:24 +02:00
renovate 2547de59ae Update module mattn/go-sqlite3 to v1.14.7 (#835)
Reviewed-on: vikunja/api#835
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-04-14 16:20:09 +00:00
konrad b4d726f5a8 Add repeat monthly setting for tasks (#834)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#834
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-04-14 09:04:58 +00:00
renovate ad9749e37d Update golang.org/x/oauth2 commit hash to 5e61552 (#833)
Reviewed-on: vikunja/api#833
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-04-13 14:19:32 +00:00
kolaente 967270b2c1
Fix docs 2021-04-11 18:38:06 +02:00
konrad d07b284ee3 Add reminders for overdue tasks (#832)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#832
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-04-11 15:08:43 +00:00
konrad b3c604fd2f Add link share password authentication (#831)
Reviewed-on: vikunja/api#831
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-04-11 13:17:50 +00:00
renovate 6a927c0703 Update module labstack/echo/v4 to v4.2.2 (#830)
Reviewed-on: vikunja/api#830
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-04-08 13:01:29 +00:00
kolaente 126f3acdc8
Enable searching users by full email or name 2021-04-07 18:28:58 +02:00
kolaente 8ddc00bd29
Fix getting user info from /user endpoint for link shares 2021-04-07 15:02:57 +02:00
kolaente cb0df3ebbc
Show empty avatar when the user was not found 2021-04-07 14:56:44 +02:00
kolaente 325dcc5795
Fix matrix notify room id 2021-04-07 14:46:40 +02:00
konrad 84291679cc Add names for link shares (#829)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#829
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-04-07 12:44:39 +00:00
kolaente b7d832891a
Switch telegram notifications to matrix notifications 2021-04-07 12:27:51 +02:00
renovate b2bbb03e48 Update golang.org/x/term commit hash to 72f3dc4 (#828)
Reviewed-on: vikunja/api#828
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-04-07 09:15:09 +00:00
kolaente 0b8173c1c3
Fix not able to make saved filters favorite 2021-04-03 16:49:20 +02:00
renovate 9b7eef985e Update golang.org/x/oauth2 commit hash to 2e8d934 (#827)
Reviewed-on: vikunja/api#827
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-04-03 11:08:49 +00:00
renovate 8a7baaed19 Update module go-sql-driver/mysql to v1.6.0 (#826)
Reviewed-on: vikunja/api#826
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-04-01 16:31:27 +00:00
kolaente 73f2d4532d
Make sure all tables are properly pluralized 2021-03-28 20:17:35 +02:00
kolaente bc782e68ff
Add systemd service file to linux packages 2021-03-28 18:18:58 +02:00
kolaente 6c3488b8aa
Fix event error handler retrying infinitely 2021-03-28 17:55:19 +02:00
kolaente d7f3c653f9
Remove unused tools from tools.go 2021-03-28 17:24:56 +02:00
renovate e2aa916bdd Update module adlio/trello to v1.9.0 (#825)
Reviewed-on: vikunja/api#825
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-03-28 15:04:37 +00:00
renovate 398f05e9a0 Update golang.org/x/oauth2 commit hash to 22b0ada (#823)
Reviewed-on: vikunja/api#823
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-03-25 10:50:41 +00:00
kolaente be3184d49f
Add test for moving a task to another list 2021-03-24 22:47:03 +01:00
konrad 81d021e872 Improve loading labels performance (#824)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#824
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-03-24 21:46:20 +00:00
konrad d1b87d2705 Add a "done" option to kanban buckets (#821)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#821
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-03-24 20:16:35 +00:00
kolaente 7b29ac7128
Fix user uploaded avatars 2021-03-23 22:32:23 +01:00
renovate 7b7ccddf51 Update golang.org/x/crypto commit hash to 0c34fe9 (#822)
Reviewed-on: vikunja/api#822
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-03-23 19:28:10 +00:00
kolaente 532855d850
Fix filter for task index 2021-03-21 18:48:41 +01:00
kolaente ee436efba3
Add endpoint to remove a list background 2021-03-21 17:49:14 +01:00
renovate 9d0dcb8d7d Update module spf13/afero to v1.6.0 (#820)
Reviewed-on: vikunja/api#820
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-03-21 10:53:41 +00:00
kolaente 6fa95e6492
Fix getting lists for shared, favorite and saved lists namespace 2021-03-18 21:39:38 +01:00
renovate fc4eb8ceb9 Update module prometheus/client_golang to v1.10.0 (#819)
Reviewed-on: vikunja/api#819
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-03-18 18:25:48 +00:00
renovate 87f7cbfa73 Update golang.org/x/term commit hash to de623e6 (#818)
Reviewed-on: vikunja/api#818
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-03-17 21:11:45 +00:00
renovate f8683796e8 Update golang.org/x/crypto commit hash to 513c2a4 (#817)
Reviewed-on: vikunja/api#817
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-03-17 21:11:29 +00:00
renovate 5e048feedf Update golang.org/x/crypto commit hash to e6e6c4f (#816)
Reviewed-on: vikunja/api#816
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-03-15 21:17:14 +00:00
kolaente 67167d4abb
Fix shared lists showing up twice 2021-03-14 21:12:03 +01:00
renovate 156e50f371 Update golang.org/x/oauth2 commit hash to cd4f82c (#815)
Reviewed-on: vikunja/api#815
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-03-14 12:49:05 +00:00
renovate cf2cfde4fc Update module src.techknowlogick.com/xgo to v1.4.0+1.16.2 (#814)
Reviewed-on: vikunja/api#814
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-03-12 09:22:48 +00:00
renovate f78bb613e4 Update golang.org/x/oauth2 commit hash to 5366d9d (#813)
Reviewed-on: vikunja/api#813
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-03-11 17:19:53 +00:00
renovate 3a7678bfb9 Update module gabriel-vasile/mimetype to v1.2.0 (#812)
Reviewed-on: vikunja/api#812
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-03-11 14:45:51 +00:00
konrad 466b2b676c Pagingation for tasks in kanban buckets (#805)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#805
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-03-10 10:59:10 +00:00
renovate 89d0fbcc7c Update module imdario/mergo to v0.3.12 (#811)
Reviewed-on: vikunja/api#811
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-03-10 10:01:42 +00:00
renovate 77e9a58a52 Update module labstack/echo/v4 to v4.2.1 (#810)
Reviewed-on: vikunja/api#810
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-03-09 12:12:37 +00:00
renovate 81665168bc Update module lib/pq to v1.10.0 (#809)
Reviewed-on: vikunja/api#809
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-03-09 09:49:47 +00:00
kolaente 6de3d8b3a1
Explicitly check if there are Ids before trying to get items by a list of Ids 2021-03-02 18:40:39 +01:00
kolaente 3999580fe6
Add basic auth for metrics endpoint 2021-02-28 11:29:53 +01:00
renovate c71a1fea82 Update module jgautheron/goconst to v1 (#804)
Reviewed-on: vikunja/api#804
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-27 14:52:00 +00:00
renovate 729cb3de38 Update github.com/gordonklaus/ineffassign commit hash to 2e10b26 (#803)
Reviewed-on: vikunja/api#803
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-25 22:24:22 +00:00
kolaente 4880a0265b
Fix notifications table not being created on initial setup 2021-02-22 21:20:13 +01:00
konrad 2178166ece Add crud endpoints for notifications (#801)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#801
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-02-21 14:50:34 +00:00
kolaente 509f23c550
Fix build
go mod tidy did the trick.
2021-02-20 18:47:02 +01:00
renovate a22dd094c2 Update golang.org/x/image commit hash to ac19c3e (#798)
Reviewed-on: vikunja/api#798
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-20 17:36:03 +00:00
renovate b6accd7c67 Update golang.org/x/crypto commit hash to 5ea612d (#797)
Reviewed-on: vikunja/api#797
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-20 16:56:37 +00:00
renovate 393a3bc37a Update golang.org/x/sync commit hash to 036812b (#799)
Reviewed-on: vikunja/api#799
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-20 15:28:21 +00:00
renovate b98ac9f551 Update golang.org/x/term commit hash to 6a3ed07 (#800)
Reviewed-on: vikunja/api#800
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-20 14:36:49 +00:00
renovate 8ab5289c3d Update golang.org/x/oauth2 commit hash to 9bb9049 (#796)
Reviewed-on: vikunja/api#796
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-20 07:35:37 +00:00
renovate 32cf66e9d5 Update module go-redis/redis/v8 to v8.6.0 (#795)
Reviewed-on: vikunja/api#795
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-20 07:34:44 +00:00
kolaente eb3a945678
Fix deleting task relations
While the request body of a DELETE request *can* have data in it, it is not really supported and pretty much undocumented. As such, it doesn't work in all clients and probably broke with recent updates.
This fixes this by moving all parts of the task relation used to identify it in the url.

More Info: https://stackoverflow.com/a/299696/10924593
2021-02-18 23:35:33 +01:00
renovate 3afedc25f0 Update golang.org/x/oauth2 commit hash to ba52d33 (#794)
Reviewed-on: vikunja/api#794
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-18 21:36:56 +00:00
renovate 4fc7d1f64f Update golang.org/x/crypto commit hash to b8e89b7 (#793)
Reviewed-on: vikunja/api#793
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-18 20:58:49 +00:00
renovate 0c5c54a267 Update module getsentry/sentry-go to v0.10.0 (#792)
Reviewed-on: vikunja/api#792
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-18 20:58:27 +00:00
kolaente 86a9d2e9f3
Explicitly set darwin-10.15 when building binaries 2021-02-18 21:35:45 +01:00
renovate 8b2b996e7a Update module src.techknowlogick.com/xgo to v1.3.0+1.16.0 (#791)
Reviewed-on: vikunja/api#791
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-18 06:42:25 +00:00
kolaente d8623fe185
Cleanup listener names 2021-02-17 20:50:04 +01:00
kolaente c873c1ec32
Send a notification to the user when they are added to the list 2021-02-17 20:48:06 +01:00
kolaente 0bd27ddeb7
Subscribe a user to a task when they are assigned to it 2021-02-17 20:14:38 +01:00
kolaente aaeb89db4f
Refactor getting all namespaces 2021-02-16 22:36:06 +01:00
renovate 2f1a3fea88 Update golang.org/x/oauth2 commit hash to 16ff188 (#789)
Reviewed-on: vikunja/api#789
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-16 21:06:45 +00:00
renovate d9a57e7ef4 Update golang.org/x/image commit hash to 4410531 (#788)
Reviewed-on: vikunja/api#788
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-16 06:54:08 +00:00
renovate ddcf7624bd Update golang.org/x/image commit hash to 55ae14f (#787)
Reviewed-on: vikunja/api#787
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-15 07:27:20 +00:00
kolaente 911e5b22ee
Fix lint 2021-02-14 23:11:39 +01:00
kolaente bef22f5756
Fix tests 2021-02-14 23:03:44 +01:00
kolaente d8e10e1a58
Add separate docker manifest file for latest docker images 2021-02-14 22:46:46 +01:00
kolaente 83f003355d
Fix sending notifications to users if the user object didn't have an email 2021-02-14 22:44:01 +01:00
kolaente 58492fffce
Run all lint checks at once 2021-02-14 22:40:08 +01:00
kolaente 268e344128
Fix multiarch docker image building 2021-02-14 22:11:12 +01:00
kolaente 9cff4e33ca
Fix docs 2021-02-14 20:37:18 +01:00
konrad e7875ecb3b Subscriptions and notifications for namespaces, tasks and lists (#786)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#786
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-02-14 19:18:14 +00:00
renovate 618b464ca3 Update module labstack/echo/v4 to v4.2.0 (#785)
Reviewed-on: vikunja/api#785
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-13 22:46:03 +00:00
renovate 448ac314b6 Update module spf13/cobra to v1.1.3 (#784)
Reviewed-on: vikunja/api#784
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-13 22:43:14 +00:00
renovate d6c6fcadc5 Update golang.org/x/oauth2 commit hash to 6667018 (#783)
Reviewed-on: vikunja/api#783
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-13 22:39:28 +00:00
kolaente 65f42b8bda
Re-Enable migration test steps in pipeline 2021-02-13 16:58:12 +01:00
kolaente ec7becd426
Check if we're on main and change the version name accordingly if that's the case 2021-02-13 16:32:26 +01:00
kolaente 59092afbc0
Explicitly add docker build step for latest 2021-02-13 16:01:20 +01:00
kolaente 480db6aa9b
Pipeline debugging 2021-02-10 20:49:20 +01:00
kolaente bb77df68f5
Temporarily disable migration step 2021-02-10 20:25:24 +01:00
kolaente 9ef17a6dbc
Change test file names to unstable 2021-02-10 19:59:53 +01:00
kolaente 37a4e1e658
Temporary build fix 2021-02-10 19:58:24 +01:00
kolaente 02b6dbd07d
Fix unstable version build file names 2021-02-10 19:56:51 +01:00
kolaente 61d76e6875
Change unstable versions in migration tests 2021-02-10 18:53:30 +01:00
kolaente 7debeaa9ff
Change main branch to main 2021-02-10 18:50:15 +01:00
renovate 5d698f2ff8 Update module olekukonko/tablewriter to v0.0.5 (#782)
Reviewed-on: vikunja/api#782
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-10 17:47:21 +00:00
renovate 7bb3f4c847 Update module spf13/cobra to v1.1.2 (#781)
Reviewed-on: vikunja/api#781
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-10 06:38:34 +00:00
kolaente 269e7dd5df
Don't keep old releases from os packages when releasing for master 2021-02-09 20:41:19 +01:00
renovate 8cfa2aa480 Update github.com/gordonklaus/ineffassign commit hash to d0e41b2 (#780)
Reviewed-on: vikunja/api#780
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-09 19:27:41 +00:00
konrad 015ca310e9 Add notifications package for easy sending of notifications (#779)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#779
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-02-07 21:05:09 +00:00
kolaente 9fe46f9a61
Don't try to get users for tasks if no tasks were found when looking for reminders 2021-02-07 14:46:47 +01:00
kolaente 18b35e1119
Fix drone file 2021-02-04 22:40:38 +01:00
kolaente b8ccfbd190
Add arm64 builds 2021-02-04 22:32:37 +01:00
kolaente 490ba2ea50
Fix due dates with times when migrating from todoist 2021-02-04 21:06:01 +01:00
kolaente fb53322d40
Change the name of the newly created bucket from "New Bucket" to "Backlog" 2021-02-04 20:48:07 +01:00
renovate 55f9106c9e Update module go-redis/redis/v8 to v8.5.0 (#778)
Reviewed-on: vikunja/api#778
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-04 18:42:39 +00:00
kolaente d600d8b5a6
Fix IncrBy and DecrBy in memory keyvalue implementation if there was no value set previously 2021-02-03 21:59:45 +01:00
konrad 0ab9ce9ec4 Add events (#777)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#777
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-02-02 22:48:37 +00:00
kolaente a71aa0c898
Disable deb repo in drone 2021-02-02 21:32:57 +01:00
kolaente c4a71016b8
Update copyright year 2021-02-02 20:19:13 +01:00
renovate 34ef1438d8 Update golang.org/x/oauth2 commit hash to 0101308 (#776)
Reviewed-on: vikunja/api#776
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-02-01 19:29:22 +00:00
kolaente 657dcc5313
Fix lint 2021-01-31 13:51:23 +01:00
kolaente 2d283b78c2
Fix the shared lists pseudo namespace containing owned lists 2021-01-31 13:09:14 +01:00
kolaente 6bdc1fdb0d
Only send reminders for undone tasks 2021-01-31 12:54:15 +01:00
kolaente d69c799197
Fix resetting the bucket limit 2021-01-31 12:40:02 +01:00
kolaente 2e88600c93
Change keyvalue.Get to return if a value exists or not instead of an error 2021-01-31 12:32:46 +01:00
renovate fe72f30b24 Update golang.org/x/oauth2 commit hash to f9ce19e (#775)
Reviewed-on: vikunja/api#775
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-01-28 14:39:28 +00:00
kolaente 6945d8ba69
Pin golang alpine builder image to 3.12 to fix builds on arm 2021-01-26 21:02:59 +01:00
renovate ef0035d4bd Update module go-redis/redis/v8 to v8.4.11 (#774)
Reviewed-on: vikunja/api#774
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-01-26 19:14:03 +00:00
renovate db77de3ae6 Update golang.org/x/oauth2 commit hash to af13f52 (#773)
Reviewed-on: vikunja/api#773
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-01-25 22:07:04 +00:00
renovate 1c98fecbd9 Update module go-redis/redis/v8 to v8.4.10 (#771)
Reviewed-on: vikunja/api#771
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-01-22 08:23:08 +00:00
kolaente 343fa6ca0d
Add github funding link 2021-01-20 21:53:38 +01:00
renovate aadfb8d8f2 Update module go-redis/redis/v8 to v8.4.9 (#770)
Reviewed-on: vikunja/api#770
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-01-20 20:29:36 +00:00
konrad 2447f84e2b Fix /dav/principals/*/ throwing a server error when accessed with GET instead of PROPFIND (#769)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#769
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-01-16 14:37:35 +00:00
kolaente c1ad9d58f5
Revert "Update alpine Docker tag to v3.13 (#768)"
This reverts commit 32c021e2

The alpine image in version 3.13 has issues, therefore I'm reverting that commit until they are fixed.
2021-01-16 14:52:38 +01:00
kolaente e16c5f72ca
Fix setting the user in created_by when uploading an attachment 2021-01-15 22:50:55 +01:00
kolaente 20af034d78
Fix retrieving over openid providers if there are none
Fixes #767
2021-01-15 20:40:07 +01:00
renovate 32c021e2b3 Update alpine Docker tag to v3.13 (#768)
Reviewed-on: vikunja/api#768
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-01-15 06:49:08 +00:00
renovate e9263f92d5 Update module iancoleman/strcase to v0.1.3 (#766)
Reviewed-on: vikunja/api#766
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-01-15 06:48:43 +00:00
renovate 044a1a9161 Update golang.org/x/oauth2 commit hash to d3ed898 (#765)
Reviewed-on: vikunja/api#765
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-01-13 21:25:20 +00:00
renovate 10ba7b5b65 Update golang.org/x/oauth2 commit hash to 8b1d76f (#764)
Reviewed-on: vikunja/api#764
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-01-13 17:11:55 +00:00
renovate e9a340026d Update module stretchr/testify to v1.7.0 (#763)
Reviewed-on: vikunja/api#763
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-01-13 10:22:09 +00:00
renovate 64441701fd Update golang.org/x/oauth2 commit hash to 01de73c (#762)
Reviewed-on: vikunja/api#762
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-01-12 21:15:21 +00:00
renovate df79173b22 Update module go-testfixtures/testfixtures/v3 to v3.5.0 (#761)
Reviewed-on: vikunja/api#761
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-01-11 22:14:13 +00:00
renovate 4e137ed72d Update module coreos/go-oidc to v3 (#760)
Reviewed-on: vikunja/api#760
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-01-11 22:13:58 +00:00
kolaente 279c5f6b73
0.16.0 release preparations 2021-01-10 16:09:26 +01:00
renovate a840880692 Update module go-redis/redis/v8 to v8.4.8 (#759)
Reviewed-on: vikunja/api#759
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-01-10 09:39:21 +00:00
renovate 4bb6842fb3 Update module go-redis/redis/v8 to v8.4.7 (#758)
Reviewed-on: vikunja/api#758
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-01-09 16:17:01 +00:00
konrad adf1172c39 Add tests for sending task reminders (#757)
Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#757
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
2021-01-09 13:59:54 +00:00
renovate f0af97e411 Update module go-redis/redis/v8 to v8.4.6 (#756)
Reviewed-on: vikunja/api#756
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-01-09 11:11:07 +00:00
renovate ea5dd87b12 Update github.com/gordonklaus/ineffassign commit hash to 8eed68e (#755)
Reviewed-on: vikunja/api#755
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2021-01-04 20:13:00 +00:00
kolaente ac23536c36
Make sure a password reset token can be used only once 2020-12-30 21:51:45 +01:00
kolaente 787044628f
Fix password reset without a reseet token 2020-12-30 21:43:14 +01:00
renovate c842b70cb5 Update module magefile/mage to v1.11.0 (#754)
Update module magefile/mage to v1.11.0

Reviewed-on: vikunja/api#754
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-29 09:52:09 +00:00
kolaente 456af4d4a9
Fix go header lint 2020-12-29 02:04:20 +01:00
renovate 8c97f45cb7 Update module mattn/go-sqlite3 to v1.14.6 (#751)
Update module mattn/go-sqlite3 to v1.14.6

Reviewed-on: vikunja/api#751
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-27 14:06:16 +00:00
renovate b8312469d7 Update module cweill/gotests to v1.6.0 (#752)
Update module cweill/gotests to v1.6.0

Reviewed-on: vikunja/api#752
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-27 01:17:05 +00:00
kolaente be7b53b9bc
Update nfpm config for nfpm v2 2020-12-23 20:51:37 +01:00
kolaente d6cb4f94f6
Update code header template 2020-12-23 20:51:16 +01:00
kolaente 9baf6d39bd
Change license to AGPLv3 2020-12-23 16:41:52 +01:00
konrad 8d1a09b5a2 Use db sessions everywere (#750)
Fix lint

Fix lint

Fix loading tasks with search

Fix loading lists

Fix loading task

Fix loading lists and namespaces

Fix tests

Fix user commands

Fix upload

Fix migration handlers

Fix all manual root handlers

Fix session in avatar

Fix session in list duplication & routes

Use sessions in migration code

Make sure the openid stuff uses a session

Add alias for db type in db package

Use sessions for file

Use a session for everything in users

Use a session for everything in users

Make sure to use a session everywhere in models

Create new session from db

Add session handling for user list

Add session handling for unsplash

Add session handling for teams and related

Add session handling for tasks and related entities

Add session handling for task reminders

Add session handling for task relations

Add session handling for task comments

Add session handling for task collections

Add session handling for task attachments

Add session handling for task assignees

Add session handling for saved filters

Add session handling for namespace and related types

Add session handling for namespace and related types

Add session handling for list users

Add session handling for list tests

Add session handling to list teams and related entities

Add session handling for link shares and related entities

Add session handling for labels and related entities

Add session handling for kanban and related entities

Add session handling for bulk task and related entities

Add session handling for lists and related entities

Add session configuration for web handler

Update web handler

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#750
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-12-23 15:32:28 +00:00
kolaente fa68e89c04
Add task filters for kanban
Signed-off-by: kolaente <k@knt.li>
2020-12-22 12:38:05 +01:00
konrad 2d4e2e452c Add task filter for lists and namespaces (#748)
Add more tests for getting namespaces

Fix namespaces not found

Fix namespaces not found

Make like the default

Update docs & fix docs

Enable searching namespaces by their ids

Enable searching lists by their ids

Enable searching labels by their ids

Enable searching by user ids

Update docs

Add namespace filter

Add task filter for lists

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#748
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-12-21 23:13:15 +00:00
renovate 111efd5fae Update golang.org/x/crypto commit hash to eec23a3 (#749)
Update golang.org/x/crypto commit hash to eec23a3

Reviewed-on: vikunja/api#749
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-21 19:17:02 +00:00
konrad 03e4bf30c2 Add task filter for labels (#747)
Update docs

Add task filter for labels

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#747
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-12-20 12:41:36 +00:00
konrad 18325e964d Add task filter for assignees (#746)
Update docs

Add filter by assignee

Fix string values

Update docs

Update docs

Make "in" task filter actually work

Add "in" filter type

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#746
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-12-19 21:39:11 +00:00
konrad 92bcce3f7c Add task filter for reminders (#745)
Update swagger docs about reminders

Fix filter concat for reminders

Add task filter for reminders

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#745
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-12-19 15:14:20 +00:00
kolaente 9508d0faee
Fix missing auto increments from b0d4902406 on mysql
Fixes #744
2020-12-19 15:04:30 +01:00
kolaente 90817b6dae
Add "like" filter comparator 2020-12-19 13:56:55 +01:00
konrad b2e4fde63a Add email reminders (#743)
Fix tests

Expose email reminder setting through jwt

Set reminders on by default

Fix lint

Make user email configurable

Expose email reminder setting through /info

Don't try to send any reminders if none were found

More spacing for buttons

Fix db time format

Enable reminders by default

Make emails look more like the frontend

Add config to disable it

Add sending emaisl

Add getting all task users and reminding them

Add getting the next reminder in a cron

Move task reminder to separate file

Add cron

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#743
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-12-18 23:21:17 +00:00
kolaente 7dc2abb8e5
Make the debian repo structure for buster instead of strech 2020-12-18 23:33:23 +01:00
kolaente 27c44d6d5e
Change avatar endpoint 2020-12-18 23:11:11 +01:00
renovate 8a6f8922f8 Update module go-redis/redis/v8 to v8.4.4 (#742)
Update module go-redis/redis/v8 to v8.4.4

Reviewed-on: vikunja/api#742
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-18 16:51:46 +00:00
konrad b0d4902406 Make sure all int64 db fields are using bigint when actually storing the data (#741)
Fix lint

Fix migration query for postgres

Fix migration statements

Add migration to make all int(11) fields bigint by default

Make all int(11) fields bigint by default

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#741
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-12-18 16:51:22 +00:00
renovate f15a8baee3 Update module ulule/limiter/v3 to v3.8.0 (#699)
fmt

Upgrade redis client to v8 everywhere

Update module ulule/limiter/v3 to v3.8.0

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#699
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-18 15:21:21 +00:00
konrad 0bd2632d29 Add login via email (#740)
Add login via email

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#740
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-12-18 13:54:49 +00:00
konrad 8d739b2cf9 Refactor adding more details to tasks (#739)
Refactor adding more details to tasks

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#739
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-12-18 13:54:36 +00:00
kolaente ccfa019870
Don't create a list identifier by default 2020-12-18 13:07:34 +01:00
konrad 969e467f48 Add colors for caldav (#738)
Add colors for caldav

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#738
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-12-18 12:04:27 +00:00
kolaente 5281ca548b
Fix docs about caldav tasks.org 2020-12-18 12:48:42 +01:00
konrad f5b5204776 Add Microsoft Todo migration (#737)
Add more logs

Fix lint

Generate docs

Add swagger docs

Add microsoft todo parsing logic

go mod tidy

Add basic test structure

Add more fields to tasks

rename microsoft todo package

Add getting microsoft todo data

Add structs and helper methods

Add microsoft todo config and routes

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#737
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-12-18 11:12:05 +00:00
renovate 25deb24849 Update module prometheus/client_golang to v1.9.0 (#735)
Update module prometheus/client_golang to v1.9.0

Reviewed-on: vikunja/api#735
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-17 20:06:30 +00:00
renovate d91c2e10b0 Update golang.org/x/crypto commit hash to 9d13527 (#736)
Update golang.org/x/crypto commit hash to 9d13527

Reviewed-on: vikunja/api#736
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-17 16:29:18 +00:00
konrad 9f3d898150 Add trello migration (#734)
Fix tests for background images

Generate docs

Fix lint

Do the swag

Add more logging

Remove the default bucket if it was empty

Add launch.json

Make importing backgrounds work

Add comment

Fix getting task attachments

Fix getting trello token

Add trello migration routes and status

Add support for converting checklists

Add test for attachments

Add the actual conversion

Add Trello conversion test

Add migration function stubs

Add basic trello migration structure

Add trello migration config

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#734
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-12-17 13:44:04 +00:00
renovate a7c585e086 Update golang.org/x/crypto commit hash to 8b5274c (#733)
Update golang.org/x/crypto commit hash to 8b5274c

Reviewed-on: vikunja/api#733
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-16 23:48:56 +00:00
konrad 00ed5884b4 Add support for migrating todoist boards (#732)
Add migrating buckets to converting todoist to vikunja structure

Add buckets migration

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#732
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-12-16 14:19:09 +00:00
kolaente 90ae940a6b
Clarify docs about cors configuration 2020-12-16 13:23:26 +01:00
kolaente e4de700a10
Simplify updating task reminders 2020-12-16 13:05:58 +01:00
renovate 1e020c9c50 Update golang.org/x/crypto commit hash to 5f87f34 (#729)
Update golang.org/x/crypto commit hash to 5f87f34

Reviewed-on: vikunja/api#729
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-10 21:18:12 +00:00
renovate d1e7d5116a Update golang.org/x/term commit hash to 2321bbc (#731)
Update golang.org/x/term commit hash to 2321bbc

Reviewed-on: vikunja/api#731
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-10 15:37:42 +00:00
renovate da064e9429 Update golang.org/x/lint commit hash to 83fdc39 (#728)
Update golang.org/x/lint commit hash to 83fdc39

Reviewed-on: vikunja/api#728
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-10 15:37:22 +00:00
renovate 67faa26cbc Update golang.org/x/image commit hash to 35266b9 (#727)
Update golang.org/x/image commit hash to 35266b9

Reviewed-on: vikunja/api#727
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-10 13:13:57 +00:00
renovate b0b6d5926b Update golang.org/x/term commit hash to ee85cb9 (#726)
Update golang.org/x/term commit hash to ee85cb9

Reviewed-on: vikunja/api#726
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-10 12:05:59 +00:00
renovate 22b626c9e0 Update golang.org/x/sync commit hash to 09787c9 (#725)
Update golang.org/x/sync commit hash to 09787c9

Reviewed-on: vikunja/api#725
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-10 09:54:29 +00:00
renovate eeb0006531 Update golang.org/x/oauth2 commit hash to 08078c5 (#722)
Update golang.org/x/oauth2 commit hash to 08078c5

Reviewed-on: vikunja/api#722
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-09 22:10:52 +00:00
renovate 9db56f86ca Update module spf13/afero to v1.5.1 (#730)
Update module spf13/afero to v1.5.1

Reviewed-on: vikunja/api#730
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-09 18:27:42 +00:00
renovate c71265aafe Update module spf13/afero to v1.5.0 (#724)
Update module spf13/afero to v1.5.0

Reviewed-on: vikunja/api#724
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-08 17:21:55 +00:00
renovate 24c8792150 Update module getsentry/sentry-go to v0.9.0 (#723)
Update module getsentry/sentry-go to v0.9.0

Reviewed-on: vikunja/api#723
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-08 14:02:53 +00:00
renovate 2f69c6342a Update module src.techknowlogick.com/xgo to v1.2.0+1.15.6 (#720)
Update module src.techknowlogick.com/xgo to v1.2.0+1.15.6

Reviewed-on: vikunja/api#720
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-07 15:49:23 +00:00
renovate c99ed212da Update module swaggo/swag to v1.7.0 (#721)
Update module swaggo/swag to v1.7.0

Reviewed-on: vikunja/api#721
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-07 15:49:08 +00:00
renovate c8af41738c Update golang.org/x/crypto commit hash to be400ae (#719)
Update golang.org/x/crypto commit hash to be400ae

Reviewed-on: vikunja/api#719
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-03 18:39:55 +00:00
renovate f3801843a4 Update golang.org/x/oauth2 commit hash to 0b49973 (#718)
Update golang.org/x/oauth2 commit hash to 0b49973

Reviewed-on: vikunja/api#718
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-03 06:47:02 +00:00
renovate 08430f1951 Update golang.org/x/crypto commit hash to c8d3bf9 (#710)
Change terminal package

Update golang.org/x/crypto commit hash to c8d3bf9

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#710
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-02 21:33:03 +00:00
renovate 80ce8f80ba Update module lib/pq to v1.9.0 (#717)
Update module lib/pq to v1.9.0

Reviewed-on: vikunja/api#717
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-12-02 07:04:04 +00:00
konrad 9334b29366 Add testing endpoint to reset db tables (#716)
Fix lint

Better error messages

Add docs

Add testing endpoint to reset db

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#716
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-11-28 23:08:30 +00:00
renovate 87048818ce Update golang.org/x/oauth2 commit hash to 9fd6049 (#714)
Update golang.org/x/oauth2 commit hash to 9fd6049

Reviewed-on: vikunja/api#714
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-11-26 20:27:19 +00:00
kolaente d2d610e0f5
Fix /info endpoint 500 error when no openid providers were configured 2020-11-26 21:26:31 +01:00
kolaente ae6144c042
Fix getting current user when updating avatar or user name 2020-11-21 22:02:49 +01:00
kolaente d1c65935e6
Add name field to users 2020-11-21 21:51:55 +01:00
konrad 2b5c9ae7a8 Authentication with OpenID Connect providers (#713)
Add config docs

Lint

Move provider-related stuff to separate file

Refactor getting auth providers

Fix tests

Fix user tests

Fix openid tests

Add swagger docs

Fix lint

Fix lint issues

Fix checking if the user already exists

Make sure to create a new namespace for new users

Docs

Add tests for openid

Remove unnessecary err check

Consistently return nil users if creating a new user failed

Move sending confirmation email to separate function

Better variable names

Move checks to separate functions

Refactor creating user into seperate file

Fix creating new local users

Test creating new users from different issuers

Generate a random username right away if no preferred username has been given

Add todo

Cache openid providers

Add getting int clientids

Fix migration

Move creating tokens to auth package

Add getting or creating a third party user

Add parsing claims

Add retreiving auth tokens

Add token callback from openid package

Add check for provider key

Add routes

Start adding openid auth handler

Add config for openid auth

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#713
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-11-21 16:38:58 +00:00
kolaente f67fe2ce25
Fix drone badge in README 2020-11-20 21:54:15 +01:00
renovate 23e84f3fa4 Update github.com/jgautheron/goconst commit hash to ccae5bf (#712)
Update github.com/jgautheron/goconst commit hash to ccae5bf

Reviewed-on: vikunja/api#712
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-11-17 16:41:45 +00:00
renovate 70a076c4fe Update module mattn/go-sqlite3 to v1.14.5 (#711)
Update module mattn/go-sqlite3 to v1.14.5

Reviewed-on: vikunja/api#711
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-11-16 17:21:29 +00:00
renovate 58c3b1616f Update module getsentry/sentry-go to v0.8.0 (#709)
Update module getsentry/sentry-go to v0.8.0

Reviewed-on: vikunja/api#709
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-11-16 15:04:57 +00:00
renovate 24d27a93c8 Update module gabriel-vasile/mimetype to v1.1.2 (#708)
Update module gabriel-vasile/mimetype to v1.1.2

Reviewed-on: vikunja/api#708
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-11-16 13:56:56 +00:00
renovate 27aa8662c0 Update golang.org/x/crypto commit hash to 0c6587e (#706)
Update golang.org/x/crypto commit hash to 0c6587e

Reviewed-on: vikunja/api#706
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-11-12 17:18:23 +00:00
renovate 479f9238ff Update module pquerna/otp to v1.3.0 (#705)
Update module pquerna/otp to v1.3.0

Reviewed-on: vikunja/api#705
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-11-11 06:44:30 +00:00
renovate 2b84be5167 Update github.com/jgautheron/goconst commit hash to f8e4fe8 (#703)
Update github.com/jgautheron/goconst commit hash to f8e4fe8

Reviewed-on: vikunja/api#703
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-11-08 22:20:54 +00:00
renovate 5d45af707b Update github.com/jgautheron/goconst commit hash to b58d7cf (#702)
Update github.com/jgautheron/goconst commit hash to b58d7cf

Reviewed-on: vikunja/api#702
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-11-08 20:46:19 +00:00
renovate e9a8d8c157 Update github.com/gordonklaus/ineffassign commit hash to 3b93a88 (#701)
Update github.com/gordonklaus/ineffassign commit hash to 3b93a88

Reviewed-on: vikunja/api#701
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-11-07 10:14:08 +00:00
renovate 1cc49806e0 Update module src.techknowlogick.com/xormigrate to v1.4.0 (#700)
Update module src.techknowlogick.com/xormigrate to v1.4.0

Reviewed-on: vikunja/api#700
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-11-06 07:05:39 +00:00
kolaente 316ac0558b
Fix task updated timestamp not being updated in the response after updating a task 2020-10-25 12:59:28 +01:00
freaktechnik ffce9b51cc Fix completion status in DAV for OpenTasks and multiline descriptions (#697)
Add tests for multiline descriptions and completed state

Fix caldav descriptions

Fix caldav task complete status for OpenTasks

Co-authored-by: Martin Giger <martin@humanoids.be>
Reviewed-on: vikunja/api#697
Co-Authored-By: freaktechnik <martin@humanoids.be>
Co-Committed-By: freaktechnik <martin@humanoids.be>
2020-10-21 21:03:19 +00:00
renovate 760278fde6 Update module fzipp/gocyclo to v0.3.1 (#696)
Update module fzipp/gocyclo to v0.3.1

Reviewed-on: vikunja/api#696
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-21 05:09:54 +00:00
kolaente 980fe21050
0.15.1 release preparations 2020-10-20 20:29:57 +02:00
kolaente 707709deb1
Fix not possible to create tasks if metrics were enabled 2020-10-20 20:28:44 +02:00
renovate 6270bb3e77 Update golang.org/x/sync commit hash to 67f06af (#695)
Update golang.org/x/sync commit hash to 67f06af

Reviewed-on: vikunja/api#695
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-20 18:09:29 +00:00
renovate 2c2701c054 Update module swaggo/swag to v1.6.9 (#694)
Update module swaggo/swag to v1.6.9

Reviewed-on: vikunja/api#694
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-20 16:08:28 +00:00
kolaente 2b8c9c698d
0.15.0 release preparations 2020-10-19 21:06:31 +02:00
kolaente 80367d60d4
Fix release trigger in drone 2020-10-19 20:35:23 +02:00
renovate 688ca65edf Update module go-testfixtures/testfixtures/v3 to v3.4.1 (#693)
Update module go-testfixtures/testfixtures/v3 to v3.4.1

Reviewed-on: vikunja/api#693
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-19 15:39:08 +00:00
freaktechnik dcefc18b98 Add app support info for DAV (#692)
Add app support info for DAV

Reviewed-on: vikunja/api#692
Co-Authored-By: freaktechnik <martin@humanoids.be>
Co-Committed-By: freaktechnik <martin@humanoids.be>
2020-10-19 12:17:08 +00:00
freaktechnik 214f2f008e Support absolute iCal timestamps in CalDAV requests (#691)
no need to export from there I think

parse absolute ical timestamps

Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-authored-by: Martin Giger <martin@humanoids.be>
Reviewed-on: vikunja/api#691
Co-Authored-By: freaktechnik <martin@humanoids.be>
Co-Committed-By: freaktechnik <martin@humanoids.be>
2020-10-19 09:11:15 +00:00
kolaente 004e432e7c
Fix nfpm command in drone 2020-10-19 07:58:24 +02:00
renovate 47486af06d Update module spf13/cobra to v1.1.1 (#690)
Update module spf13/cobra to v1.1.1

Reviewed-on: vikunja/api#690
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-18 20:16:25 +00:00
kolaente 8b9b1984fc
Make sure we have go installed when building os packages (for build step dependencies) 2020-10-18 21:28:33 +02:00
kolaente 6dd7bcb0fe
Make sure we have git installed when building os packages 2020-10-18 20:29:54 +02:00
kolaente b94950d7c2
Fix trigger for pushing release artifacts to drone 2020-10-18 13:59:26 +02:00
konrad 618353bf95 Use nfpm to build deb, rpm and apk packages (#689)
Cleanup

Update docs for deb

Add building os packages to drone

Add apk packages

Replace version and binlocation strings in nfpm config

Make nfpm config replacable

Fix nfpm config

Add nfpm config

go mod tidy

Add nfpm mage target

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#689
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-10-18 11:41:27 +00:00
freaktechnik 1555081939 fetch tasks for caldav lists (#641)
Fix shadowed error

Panic if a TaskCollection.ReadAll does not return []*models.Task

Fetch tasks for caldav lists

Co-authored-by: kolaente <k@knt.li>
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-authored-by: Martin Giger <martin@humanoids.be>
Reviewed-on: vikunja/api#641
Co-Authored-By: freaktechnik <martin@humanoids.be>
Co-Committed-By: freaktechnik <martin@humanoids.be>
2020-10-18 10:40:50 +00:00
renovate 7fe9e6d3f6 Update module swaggo/swag to v1.6.8 (#680)
Regenerate swagger docs with new swaggo

Update module swaggo/swag to v1.6.8

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#680
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-17 18:03:05 +00:00
renovate cbba0695a8 Update module fzipp/gocyclo to v0.3.0 (#687)
Update module fzipp/gocyclo to v0.3.0

Reviewed-on: vikunja/api#687
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-17 10:26:52 +00:00
renovate 921526e086 Update golang.org/x/crypto commit hash to 9e8e0b3 (#685)
Update golang.org/x/crypto commit hash to 9e8e0b3

Co-authored-by: konrad <konrad@kola-entertainments.de>
Reviewed-on: vikunja/api#685
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-17 09:34:23 +00:00
konrad 1b21339bf8 Generate config docs from sample config (#684)
Add docs todo to PR template

Clarify docs

Fix parsing of descriptions and multi-level values

Add method to write out the file

Only render default value for non-top-level values

Remove comment headings from yaml comments

Add printing config

Add basic parsing of sample config with comments

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#684
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-10-17 08:07:39 +00:00
renovate e9d6daa1a3 Update module fzipp/gocyclo to v0.2.0 (#686)
Update module fzipp/gocyclo to v0.2.0

Reviewed-on: vikunja/api#686
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-17 08:06:20 +00:00
renovate 8b001313f4 Update golang.org/x/crypto commit hash to 84dcc77 (#678)
Update golang.org/x/crypto commit hash to 84dcc77

Reviewed-on: vikunja/api#678
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-16 19:55:20 +00:00
renovate e0c8eca669 Update module prometheus/client_golang to v1.8.0 (#681)
Update module prometheus/client_golang to v1.8.0

Reviewed-on: vikunja/api#681
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-15 20:24:03 +00:00
renovate c629130b3b Update module spf13/cobra to v1.1.0 (#679)
Update module spf13/cobra to v1.1.0

Reviewed-on: vikunja/api#679
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-14 19:16:18 +00:00
kolaente 9252225d7f
Disable gocyclo for migration modules
Signed-off-by: kolaente <k@knt.li>
2020-10-13 08:05:55 +02:00
kolaente 38b5c7fb6c
Add checks if tasks exist in maps before trying to access them
Signed-off-by: kolaente <k@knt.li>
2020-10-12 19:33:17 +02:00
kolaente e26df26f78
Fix migrating items with large items from todoist
see #266
2020-10-12 08:08:52 +02:00
renovate 158e07e581 Update module go-errors/errors to v1.1.1 (#677)
Update module go-errors/errors to v1.1.1

Reviewed-on: vikunja/api#677
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-11 21:27:42 +00:00
konrad 699d3d6060 Add Golangci Lint (#676)
Increase golangci timeout

Fix installing golangci-lint in ci

Remove mage targets replaced by golangci

Run golint in ci

Add goheader linter

Enable & fix more linters

Fix lint issues

Add mage target to automagically fix issues found by golangci

golangci-lint run --fix

Add golangci config

Add golangci mage target

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#676
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-10-11 20:10:03 +00:00
konrad d56a611be7 Key-Value Storages (#674)
Fix lint

Add docs for keyvalue config options

Use keyvalue store to cache unsplash photo results

Cleanup

Use keyvalue store for upload avatar

Use keyvalue store for initials avatar

Fix initializing metrics

Use keyvalue for metrics

Add IncryBy and DecrBy methods to increase or decrease a value

Fix lint

Return custom error if a key does not exist

Init keyvalue storage

Follow the keyvalue storage setting for things like cache and other

Add docs

Add configuration of the storage backend

Add redis keyvalue storage implementation

Add doc comments

Add methods to use storage through the package itself

Add memory implementation for keyvalue store

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#674
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-10-10 16:53:59 +00:00
kolaente bf5d8af3f6
Fix docs index links 2020-10-10 12:12:54 +02:00
renovate 0769098357 Update golang.org/x/sync commit hash to b3e1573 (#675)
Update golang.org/x/sync commit hash to b3e1573

Reviewed-on: vikunja/api#675
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-10 07:04:40 +00:00
renovate 71094d981f Update module spf13/afero to v1.4.1 (#673)
Update module spf13/afero to v1.4.1

Reviewed-on: vikunja/api#673
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-06 12:03:14 +00:00
renovate 32d97f1451 Update golang.org/x/crypto commit hash to 7f63de1 (#672)
Update golang.org/x/crypto commit hash to 7f63de1

Reviewed-on: vikunja/api#672
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-02 18:19:39 +00:00
renovate bf9d1c634a Update module mattn/go-sqlite3 to v1.14.4 (#670)
Update module mattn/go-sqlite3 to v1.14.4

Reviewed-on: vikunja/api#670
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-02 15:05:51 +00:00
renovate ebd96d7766 Update golang.org/x/crypto commit hash to c90954c (#671)
Update golang.org/x/crypto commit hash to c90954c

Reviewed-on: vikunja/api#671
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-02 15:05:32 +00:00
renovate 089d156259 Update golang.org/x/crypto commit hash to eb9a90e (#669)
Update golang.org/x/crypto commit hash to eb9a90e

Reviewed-on: vikunja/api#669
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-10-01 21:09:37 +00:00
renovate dd589022e4 Update golang.org/x/crypto commit hash to afb6bcd (#668)
Update golang.org/x/crypto commit hash to afb6bcd

Reviewed-on: vikunja/api#668
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-09-30 17:18:49 +00:00
renovate b850f65295 Update golang.org/x/sync commit hash to 3042136 (#667)
Update golang.org/x/sync commit hash to 3042136

Reviewed-on: vikunja/api#667
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-09-30 14:44:18 +00:00
kolaente b3d09cd2d4
Fix loading list background information for uploaded backgrounds
Signed-off-by: kolaente <k@knt.li>
2020-09-28 20:53:17 +02:00
konrad 64d125afd9 Testing improvements (#666)
Change method names to avoid doubling db

Assert team test exists

Assert team member test exists

Assert task test exists

Assert task relation test exists

Assert task comment test exists

Better tests for team namespaces

Assert exists in namespace users tests

Assert exists in namespace tests

Assert exists in user list tests

Assert exists in list tests

Better team list tests

Assert label tests exist in db

Assert label task tests exist in db

Assert label task tests exist in db

Assert kanban tests exist in db

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#666
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-09-27 15:45:17 +00:00
renovate dd5d64da3e Update golang.org/x/image commit hash to e162460 (#665)
Update golang.org/x/image commit hash to e162460

Reviewed-on: vikunja/api#665
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-09-27 13:35:07 +00:00
kolaente 1776eb56fe
Fix upload avatar not working
Signed-off-by: kolaente <k@knt.li>
2020-09-27 12:50:52 +02:00
renovate f8c135f22e Update golang.org/x/image commit hash to a67d67e (#664)
Update golang.org/x/image commit hash to a67d67e

Reviewed-on: vikunja/api#664
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-09-27 07:12:14 +00:00
konrad 0fb2edf051 Saved filters (#655)
Fix updating saved filters

Fix filter not loadable because of missing param declaration

Add fancy special cases for postgres exists in db

Add special case for postgrs json

Add read one test

Add rights tests

Fix lint

Fixed getting a single saved filter from db

Add tests for the usual crud methods

Add test stubs and TODOs

Add test for converting saved filter ids to list ids and vice versa

Add test fixture for saved filters and fix existing tests

Fix exposed json variables of filters

Fix creating saved filters table for tests

Add getting saved filters as pseudo namespace

Cleanup

Refactor getting all namespaces to use a map for easier handling of pseudo namespaces

Add custom erros for saved filters

Swagger docs

Fix lint

Add routes for saved filters

Add alias for mage build

Add method to get a saved filter from the lists endpoint

Add getting tasks from a saved filter

Add create, update, delete, read one methods

Add rights methods for saved filters

Fix docs minLength

Add saved filters column

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#655
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
2020-09-26 21:02:17 +00:00
renovate a6fdf114d1 Update golang.org/x/image commit hash to 4578eab (#663)
Update golang.org/x/image commit hash to 4578eab

Reviewed-on: vikunja/api#663
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-09-24 09:01:34 +00:00
renovate ca1b33d24d Update github.com/asaskevich/govalidator commit hash to 7a23bdc (#657)
Update github.com/asaskevich/govalidator commit hash to 7a23bdc

Reviewed-on: vikunja/api#657
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-09-23 11:27:58 +00:00
renovate c98b9bbee6 Update golang.org/x/image commit hash to e59bae6 (#659)
Update golang.org/x/image commit hash to e59bae6

Reviewed-on: vikunja/api#659
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-09-23 11:27:43 +00:00
renovate 19a0a85c73 Update github.com/jgautheron/goconst commit hash to 8f5268c (#658)
Update github.com/jgautheron/goconst commit hash to 8f5268c

Reviewed-on: vikunja/api#658
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-09-23 10:25:10 +00:00
renovate 77122b8f1b Update module iancoleman/strcase to v0.1.2 (#660)
Update module iancoleman/strcase to v0.1.2

Reviewed-on: vikunja/api#660
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-09-23 07:59:24 +00:00
renovate 436af467d6 Update module mattn/go-sqlite3 to v1.14.3 (#661)
Update module mattn/go-sqlite3 to v1.14.3

Reviewed-on: vikunja/api#661
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-09-23 07:12:18 +00:00
renovate 04130e4ea3 Update module spf13/afero to v1.4.0 (#662)
Update module spf13/afero to v1.4.0

Reviewed-on: vikunja/api#662
Co-Authored-By: renovate <renovatebot@kolaente.de>
Co-Committed-By: renovate <renovatebot@kolaente.de>
2020-09-23 05:05:58 +00:00
kolaente 7e6e44e787
Replace renovate tokens with env 2020-09-22 22:25:23 +02:00
kolaente 9e7ca8df51
Update renovate token 2020-09-22 21:42:40 +02:00
konrad 6bdddd462a Favorite lists (#654)
Add tests

Remove the favorites pseudo namespace if there are no lists or tasks favorited

Regenerate swagger docs

Fix favorite lists not being updated because of nonexisting users (the favorite list does not have one)

Make the pseudo favorites list always favorited

Add favorited lists to the favorites pseudo namespace

Add favorite field to list

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#654
2020-09-06 14:20:16 +00:00
konrad e5559137dd Favorite tasks (#653)
Fixed namespace tests

Add test for favorite tasks

Fix favorite tasks not being updated

Fix integration tests

Fix lint

Return a pseudo namespace and list for favorites

Make sure users can only see their favorites

Add condition show tasks from the favorites list

Regenerate swagger docs

Add favorite field to task

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#653
2020-09-05 20:16:02 +00:00
kolaente ecf09e17a8
Only check if a bucket limit is exceeded when moving a task between buckets 2020-09-04 22:01:33 +02:00
konrad 14d706c91e Kanban bucket limits (#652)
Fix integration tests

Generate swagger docs

Add test for moving a task between buckets

Add check for bucket limit when updating a task

Add fixture to ensure a bucket with a high limit will never exceed the limit

Refactor bucket limit check into seperate function

Add test for creating and fix

Fix unexported field

Add error in case a task was added to a bucket which has its limit already exceeded

Add migration to add new task field

Add limit field to buckets

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#652
2020-09-04 14:37:56 +00:00
kolaente 5317a89623
Make sure to copy the permissions as well when moving files 2020-09-04 14:00:54 +02:00
kolaente e9b1786188
Regenerate swagger docs 2020-09-04 13:15:46 +02:00
kolaente 313289d28d
Add rootpath to deb command to not include everything in the deb file 2020-09-04 10:42:32 +02:00
kolaente 05e237560d
Add mage command to create a new migration 2020-09-04 10:15:33 +02:00
kolaente e4dd314079
Add caldav enabled/disabled to /info endpoint 2020-09-04 09:58:42 +02:00
kolaente 118c7f25b5
Fix release commands in drone 2020-09-03 22:46:41 +02:00
kolaente b64a80da0b
Make sure built binary files are executable when compressing with upx 2020-09-03 22:45:04 +02:00
kolaente bb26c9d97c
Make sure to only initialize all variables when needed 2020-09-03 22:14:30 +02:00
kolaente edf3854632
Add github sponsor link 2020-09-03 21:59:17 +02:00
kolaente 19a66450ec
Fix building for darwin with mage 2020-09-03 21:22:41 +02:00
kolaente 3a839dfb86
Add util function to move files 2020-09-03 20:42:26 +02:00
kolaente 78b261e440
Skip directories when moving build release artefacts in drone 2020-09-03 18:08:57 +02:00
kolaente 471d1b0ec5
Fix dockerimage build 2020-09-03 18:08:26 +02:00
kolaente 58dfbe13ed
Add FreeBSD guide to installation docs 2020-09-03 17:44:44 +02:00
kolaente 1a4eef1056
Add toc to docs 2020-09-03 17:34:44 +02:00
kolaente 8da7db3e26
Cleanup references to make 2020-09-03 17:18:41 +02:00
konrad d359130bcf Switch to mage (#651)
Add comment about magefile compile

Switch make to mage commands in drone

Fix misspell

Update docs

Add general release command

Add reprepro command

Make sure the filename contains the proper version

Add deb package building

Add zip command

Preserve file permissions when copying files

Fix release:os-package

Make sure to not create checksums of directories

Cleanup

Only compress what upx is able to compress

Add check command

Add release:os-package command

Add copy command

Add comments

Add compress step

Move releasing binaries to a more general function and add ones of linux + darwin

Add release:windows command

Add release:dir command

Add namespaces for commands

Reorder

Add command to run all checks at once

Add goconst-check

Add gosec-check

Add static-check

Add gocyclo-check

Add ineffasign-check

Add misspell-check

Add command to check for swagger docs regeneration

Add comments

Add command to generate swagger docs

Reorder

Add check for installing golint before running it

Add fmt check command

Add fmt command

Use runAndStreamOutput everywhere

Add aliases and comments

Add todo

Reorder

Add test coverage command

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#651
2020-09-03 15:13:19 +00:00
renovate 05099e1784 Update module spf13/afero to v1.3.5 (#650)
Update module spf13/afero to v1.3.5

Reviewed-on: vikunja/api#650
2020-09-02 21:19:34 +00:00
renovate 79970ebb4a Update module labstack/echo/v4 to v4.1.17 (#646)
Update module labstack/echo/v4 to v4.1.17

Reviewed-on: vikunja/api#646
2020-08-31 09:19:49 +00:00
renovate 27b4086351 Update module iancoleman/strcase to v0.1.1 (#645)
Update module iancoleman/strcase to v0.1.1

Reviewed-on: vikunja/api#645
2020-08-30 08:18:18 +00:00
renovate ae7eafd6ad Update module mattn/go-sqlite3 to v1.14.2 (#647)
Update module mattn/go-sqlite3 to v1.14.2

Reviewed-on: vikunja/api#647
2020-08-30 08:17:50 +00:00
renovate 21b5aee054 Update github.com/c2h5oh/datasize commit hash to 48ed595 (#644)
Update github.com/c2h5oh/datasize commit hash to 48ed595

Reviewed-on: vikunja/api#644
2020-08-25 16:06:32 +00:00
renovate 2b34a8d4e6 Update github.com/shurcooL/vfsgen commit hash to 0d455de (#642)
Update github.com/shurcooL/vfsgen commit hash to 0d455de

Reviewed-on: vikunja/api#642
2020-08-24 20:00:48 +00:00
renovate b4771c1bce Update golang.org/x/crypto commit hash to 5c72a88 (#640)
Update golang.org/x/crypto commit hash to 5c72a88

Reviewed-on: vikunja/api#640
2020-08-20 23:09:04 +00:00
renovate c83858bf7e Update module mattn/go-sqlite3 to v1.14.1 (#638)
Update module mattn/go-sqlite3 to v1.14.1

Reviewed-on: vikunja/api#638
2020-08-20 20:46:16 +00:00
renovate 08b8964b3d Update github.com/asaskevich/govalidator commit hash to 29e1ff8 (#639)
Update github.com/asaskevich/govalidator commit hash to 29e1ff8

Reviewed-on: vikunja/api#639
2020-08-20 12:10:36 +00:00
kolaente d88551e99d
Add dav proxy directions to example proxy configurations
Signed-off-by: kolaente <k@knt.li>
2020-08-20 14:08:35 +02:00
renovate ebd71d1f04 Update module iancoleman/strcase to v0.1.0 (#636)
Update module iancoleman/strcase to v0.1.0

Co-authored-by: konrad <konrad@kola-entertainments.de>
Reviewed-on: vikunja/api#636
2020-08-19 08:31:41 +00:00
renovate a61ab0c5cf Update github.com/asaskevich/govalidator commit hash to 50839af (#637)
Update github.com/asaskevich/govalidator commit hash to 50839af

Reviewed-on: vikunja/api#637
2020-08-18 18:07:45 +00:00
kolaente fa718e2576
Fix token renew for link shares
Signed-off-by: kolaente <k@knt.li>
2020-08-18 16:55:44 +02:00
kolaente c517a87b85
Don't add a subtask to the top level of tasks to not add it twice in the list 2020-08-17 22:30:24 +02:00
kolaente 28fd0e91ee
Mention client_max_body_size in nginx proxy settings 2020-08-17 22:15:48 +02:00
renovate 14c27600d8 Update github.com/asaskevich/govalidator commit hash to df4adff (#552)
Update github.com/asaskevich/govalidator commit hash to df4adff

Reviewed-on: vikunja/api#552
2020-08-17 13:48:12 +00:00
kolaente dedce20780
"Fix" gocyclo 2020-08-16 23:48:34 +02:00
kolaente a58b932743
Work around tasks with attachments not being duplicated 2020-08-16 23:44:16 +02:00
kolaente 301bebf8d3
Only try to download attachments from todoist when there is a url
Credit: freaktechnik
2020-08-16 23:26:19 +02:00
kolaente d192c36c39
Add better tests for namespaces 2020-08-15 22:16:36 +02:00
kolaente bdfb804bb2
Fix reading passwords on windows 2020-08-13 17:59:10 +02:00
konrad 16dbcfda7e Manage users via cli (#632)
Add users cli commands to docs

Fix checking for changing username or user email

Add user status change command

Make sure only one user exists with a particular email when updating

Add password reset

Add user id to help

Remove user delete (too many possible side effects, postponed until later)

Make sure to fail on any errors

Fail if changing the username would result in duplicate users

Add user update command

Add user create command

Add command stubs for all commands

Render users in a beautiful table

Started adding user list command

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#632
2020-08-13 15:34:02 +00:00
renovate 0169ecc37e Update module 4d63.com/tz to v1.2.0 (#631)
Update module 4d63.com/tz to v1.2.0

Reviewed-on: vikunja/api#631
2020-08-13 08:38:01 +00:00
kolaente 4a70c81b33
Make sure to require admin rights when modifying list/namespace users to be consistent with teams
Signed-off-by: kolaente <k@knt.li>
2020-08-12 18:20:47 +02:00
renovate 5e84ce639f Update module src.techknowlogick.com/xgo to v1.1.0+1.15.0 (#630)
Update module src.techknowlogick.com/xgo to v1.1.0+1.15.0

Reviewed-on: vikunja/api#630
2020-08-12 09:27:43 +00:00
renovate 6c45388da9 Update module imdario/mergo to v0.3.11 (#629)
Update module imdario/mergo to v0.3.11

Reviewed-on: vikunja/api#629
2020-08-11 20:12:50 +00:00
konrad bd8c1c3bb7 Return rights when reading a single item (#626)
Fix lint

Update docs

Fix loading all rights (list & namespace)

Add tests

Update web framework

Make tests run again

Update all calls to CanRead methods

Update task attachment & task comment & task rights to return the max right

Update team rights to return the max right

Update namespace rights to return the max right

Update list rights to return the max right

Update link share rights to return the max right

Update label rights to return the max right

Update web dependency

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#626
2020-08-10 12:11:43 +00:00
renovate 28b8cabea5 Update module spf13/afero to v1.3.4 (#628)
Update module spf13/afero to v1.3.4

Reviewed-on: vikunja/api#628
2020-08-10 07:26:50 +00:00
renovate 7c91803056 Update module go-testfixtures/testfixtures/v3 to v3.4.0 (#627)
Update module go-testfixtures/testfixtures/v3 to v3.4.0

Reviewed-on: vikunja/api#627
2020-08-09 20:18:27 +00:00
renovate b375e1d043 Update github.com/gordonklaus/ineffassign commit hash to e36bfde (#625)
Update github.com/gordonklaus/ineffassign commit hash to e36bfde

Reviewed-on: vikunja/api#625
2020-08-09 09:18:55 +00:00
kolaente d718d247c8
Fix users with disabled totp but not enrolled being unable to login 2020-08-07 16:41:35 +02:00
kolaente 6a82d4e2af
Fix updating team admin status 2020-08-05 17:28:11 +02:00
kolaente 11722bf029
Add update route to toggle team member admin status 2020-08-05 17:21:17 +02:00
konrad dfb7730b63 More avatar providers (#622)
Don't fail if the last avatar file does not exist when deleting it

Fix lint

Remove old global avatar setting and update docs

Generate docs

Invalidate the avatar cache when uploading a new one

Add debug logs

Add caching for upload avatars

Add cache locks

Fix encoding

Resize the uploaded image to a max of 1024 pixels

Remove the old uploaded avatar if one already exists

Add mimetype check for images

Set avatar provider to upload when uploading an avatar

Add upload avatar provider

Make font size smaller to let the initials still look good in smaller sizes

Add debug log

Add cache and resizing of initials avatars

Make font size depend on avatar size

Add drawing initials avatar

Add initials provider

Make the initials avatar provider the default

Add routes

Add user avatar settings handler methods

Add user avatar provider field

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#622
2020-08-02 17:16:58 +00:00
renovate c9117dd037 Update module spf13/afero to v1.3.3 (#623)
Update module spf13/afero to v1.3.3

Reviewed-on: vikunja/api#623
2020-08-02 14:11:50 +00:00
konrad e4539ef232 Use db sessions for task-related things (#621)
Use db sessions for task-related things

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#621
2020-08-01 16:54:38 +00:00
renovate 0ba6ae7a18 Update module spf13/viper to v1.7.1 (#620)
Update module spf13/viper to v1.7.1

Reviewed-on: vikunja/api#620
2020-08-01 06:24:46 +00:00
renovate 25ecc4a510 Update golang.org/x/crypto commit hash to 123391f (#619)
Update golang.org/x/crypto commit hash to 123391f

Reviewed-on: vikunja/api#619
2020-07-29 06:39:36 +00:00
renovate 259c2195dc Update module lib/pq to v1.8.0 (#618)
Update module lib/pq to v1.8.0

Reviewed-on: vikunja/api#618
2020-07-28 06:44:54 +00:00
kolaente 7bdc9dd428
Pin telegram notification plugin in drone 2020-07-24 18:32:18 +02:00
renovate 5f8872f8cc Update module getsentry/sentry-go to v0.7.0 (#617)
Update module getsentry/sentry-go to v0.7.0

Reviewed-on: vikunja/api#617
2020-07-21 13:02:45 +00:00
renovate 5794ede6f6 Update module lib/pq to v1.7.1 (#616)
Update module lib/pq to v1.7.1

Reviewed-on: vikunja/api#616
2020-07-20 17:37:08 +00:00
kolaente 41cf73a473
Add option to configure legal urls 2020-07-18 18:53:56 +02:00
renovate f8d84139fa Update module imdario/mergo to v0.3.10 (#615)
Update module imdario/mergo to v0.3.10

Reviewed-on: vikunja/api#615
2020-07-18 16:52:05 +00:00
kolaente d3964ff4bd
Update xgo to v1.0.0+1.14.6 2020-07-18 18:42:34 +02:00
kolaente 9acba7d3f0
Fix duplicating a list with background 2020-07-17 14:16:59 +02:00
kolaente 2d567bfe0f
Make sure lists which would have a duplicate identifier can still be duplicated
+ debug logging for duplicating lists
2020-07-17 13:26:49 +02:00
renovate 7207aa60fb Update module src.techknowlogick.com/xgo to v1 (#613)
Update module src.techknowlogick.com/xgo to v1

Reviewed-on: vikunja/api#613
2020-07-15 06:32:48 +00:00
renovate 2b9af951bf Update src.techknowlogick.com/xgo commit hash to 96de19c (#612)
Update src.techknowlogick.com/xgo commit hash to 96de19c

Reviewed-on: vikunja/api#612
2020-07-14 19:58:42 +00:00
renovate c84efcbbcc Update src.techknowlogick.com/xgo commit hash to 7c2e3c9 (#611)
Update src.techknowlogick.com/xgo commit hash to 7c2e3c9

Reviewed-on: vikunja/api#611
2020-07-14 17:59:50 +00:00
kolaente 092aae3260
Add config option to force ssl connections to connect with the mailer 2020-07-14 17:30:39 +02:00
renovate 222582fb0c Update module spf13/afero to v1.3.2 (#610)
Update module spf13/afero to v1.3.2

Reviewed-on: vikunja/api#610
2020-07-14 13:19:46 +00:00
kolaente a99367bc5f
Fix release trigger 2020-07-14 14:45:16 +02:00
kolaente c47d5c7228
Switch s3 release bucket to scaleway 2020-07-14 13:43:35 +02:00
kolaente 3d709e3bb7
Update docs with testmail command + reorder 2020-07-14 09:34:32 +02:00
renovate 3a9360a57b Update golang.org/x/crypto commit hash to 948cd5f (#609)
Update golang.org/x/crypto commit hash to 948cd5f

Reviewed-on: vikunja/api#609
2020-07-10 08:21:21 +00:00
renovate dd3c4cd032 Update golang.org/x/crypto commit hash to ab33eee (#608)
Update golang.org/x/crypto commit hash to ab33eee

Reviewed-on: vikunja/api#608
2020-07-08 07:12:16 +00:00
kolaente 2a4a622518
0.14.1 release preparations 2020-07-07 10:58:03 +02:00
konrad 4db06ba9a1 Fix creating lists with non ascii characters (#607)
Fix test name

Fix migrating lists with non utf-8 characters in their name

Fix creating lists with non utf-8 characters

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: vikunja/api#607
2020-07-07 07:48:12 +00:00
kolaente 96f366f5e7
Add docs about using vikunja with utf-8 characters 2020-07-06 21:53:26 +02:00
kolaente 78791f31a4
Fix parsing todoist reminder dates 2020-07-05 20:49:29 +02:00
kolaente ec3fa9300b
Fix parsing todoist reminder dates 2020-07-05 17:48:36 +02:00
kolaente 9fa7e30a0a
update theme 2020-07-05 15:25:25 +02:00
jtojnar 158d98c2bd Makefile: make add EXTRA_GOFLAG to GOFLAGS (#605)
Makefile: make add EXTRA_GOFLAG to GOFLAGS

Some commands (`go generate`) only support taking `GOFLAGS` from the environment
but setting `GOFLAGS` environment variable is ineffectual because the variable
of the same name defined in the Makefile shadows it.

We also have a custom `EXTRA_GOFLAGS` variable but we only pass that to `go build`.

Let’s add `EXTRA_GOFLAGS` to the `GOFLAGS` variable in the Makefile to allow passing
custom flags to Go through `EXTRA_GOFLAGS` environment variable.

Co-authored-by: Jan Tojnar <jtojnar@gmail.com>
Reviewed-on: vikunja/api#605
Reviewed-by: konrad <konrad@kola-entertainments.de>
2020-07-04 16:55:45 +00:00
kolaente ae12871bd7
Fix decoding active users from redis 2020-07-02 23:19:03 +02:00
kolaente 7141050f8b
Make sure the metrics map accesses only happen explicitly 2020-07-02 21:16:39 +02:00
425 changed files with 35576 additions and 6948 deletions

View File

@ -1,3 +1,4 @@
---
kind: pipeline
name: testing
@ -5,42 +6,96 @@ workspace:
base: /go
path: src/code.vikunja.io/api
volumes:
- name: tmp-sqlite-unit
temp:
medium: memory
- name: tmp-sqlite-integration
temp:
medium: memory
- name: tmp-sqlite-migration
temp:
medium: memory
- name: tmp-mysql-unit
temp:
medium: memory
- name: tmp-mysql-integration
temp:
medium: memory
- name: tmp-mysql-migration
temp:
medium: memory
- name: tmp-postgres-unit
temp:
medium: memory
- name: tmp-postgres-integration
temp:
medium: memory
- name: tmp-postgres-migration
temp:
medium: memory
services:
- name: test-mysql-unit
image: mariadb:10
environment:
MYSQL_ROOT_PASSWORD: vikunjatest
MYSQL_DATABASE: vikunjatest
volumes:
- name: tmp-mysql-unit
path: /var/lib/mysql
- name: test-mysql-integration
image: mariadb:10
environment:
MYSQL_ROOT_PASSWORD: vikunjatest
MYSQL_DATABASE: vikunjatest
volumes:
- name: tmp-mysql-integration
path: /var/lib/mysql
- name: test-mysql-migration
image: mariadb:10
environment:
MYSQL_ROOT_PASSWORD: vikunjatest
MYSQL_DATABASE: vikunjatest
volumes:
- name: tmp-mysql-migration
path: /var/lib/mysql
- name: test-postgres-unit
image: postgres:12
image: postgres:13
environment:
POSTGRES_PASSWORD: vikunjatest
POSTGRES_DB: vikunjatest
volumes:
- name: tmp-postgres-unit
path: /var/lib/postgresql/data
commands:
- docker-entrypoint.sh -c fsync=off -c full_page_writes=off # turns of wal
- name: test-postgres-integration
image: postgres:12
image: postgres:13
environment:
POSTGRES_PASSWORD: vikunjatest
POSTGRES_DB: vikunjatest
volumes:
- name: tmp-postgres-integration
path: /var/lib/postgresql/data
commands:
- docker-entrypoint.sh -c fsync=off -c full_page_writes=off # turns of wal
- name: test-postgres-migration
image: postgres:12
image: postgres:13
environment:
POSTGRES_PASSWORD: vikunjatest
POSTGRES_DB: vikunjatest
volumes:
- name: tmp-postgres-migration
path: /var/lib/postgresql/data
commands:
- docker-entrypoint.sh -c fsync=off -c full_page_writes=off # turns of wal
trigger:
branch:
include:
- master
- main
event:
include:
- push
@ -52,13 +107,27 @@ steps:
commands:
- git fetch --tags
- name: build
# We're statically compiling the magefile to avoid race condition issues caused by multiple pipeline steps
# compiling the same magefile at the same time. It's also faster if each step does not need to compile it first.
- name: mage
image: vikunja/golang-build:latest
pull: true
environment:
GOPROXY: 'https://goproxy.kolaente.de'
commands:
- make build
- mage -compile ./mage-static
- env
when:
event: [ push, tag, pull_request ]
- name: build
image: vikunja/golang-build:latest
pull: true
environment:
GOPROXY: 'https://goproxy.kolaente.de'
depends_on: [ mage ]
commands:
- ./mage-static build:build
when:
event: [ push, tag, pull_request ]
@ -69,17 +138,8 @@ steps:
GOPROXY: 'https://goproxy.kolaente.de'
depends_on: [ build ]
commands:
- make generate
- make lint
- make fmt-check
# - make got-swag # Commented out until we figured out how to get this working on drone
- make ineffassign-check
- make misspell-check
- make goconst-check
- make gocyclo-check
- make static-check
- wget -O - -q https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $GOPATH/bin v2.2.0 # Need to manually install as it does not support being installed via go modules like the rest.
- make gosec-check
- wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.31.0
- ./mage-static check:all
when:
event: [ push, tag, pull_request ]
@ -88,8 +148,8 @@ steps:
pull: true
commands:
# Get the latest version
- wget https://dl.vikunja.io/api/master/vikunja-master-linux-amd64-full.zip -q -O vikunja-latest.zip
- unzip vikunja-latest.zip vikunja-master-linux-amd64
- wget https://dl.vikunja.io/api/unstable/vikunja-unstable-linux-amd64-full.zip -q -O vikunja-latest.zip
- unzip vikunja-latest.zip vikunja-unstable-linux-amd64
- name: test-migration-sqlite
image: kolaente/toolbox:latest
@ -97,11 +157,14 @@ steps:
depends_on: [ test-migration-prepare, build ]
environment:
VIKUNJA_DATABASE_TYPE: sqlite
VIKUNJA_DATABASE_PATH: ./vikunja-migration-test.db
VIKUNJA_DATABASE_PATH: /db/vikunja-migration-test.db
VIKUNJA_LOG_DATABASE: stdout
VIKUNJA_LOG_DATABASELEVEL: debug
volumes:
- name: tmp-sqlite-migration
path: /db
commands:
- ./vikunja-master-linux-amd64 migrate
- ./vikunja-unstable-linux-amd64 migrate
# Run the migrations from the binary build in the step before
- ./vikunja migrate
when:
@ -120,7 +183,7 @@ steps:
VIKUNJA_LOG_DATABASE: stdout
VIKUNJA_LOG_DATABASELEVEL: debug
commands:
- ./vikunja-master-linux-amd64 migrate
- ./vikunja-unstable-linux-amd64 migrate
# Run the migrations from the binary build in the step before
- ./vikunja migrate
when:
@ -140,7 +203,7 @@ steps:
VIKUNJA_LOG_DATABASE: stdout
VIKUNJA_LOG_DATABASELEVEL: debug
commands:
- ./vikunja-master-linux-amd64 migrate
- ./vikunja-unstable-linux-amd64 migrate
# Run the migrations from the binary build in the step before
- ./vikunja migrate
when:
@ -152,9 +215,8 @@ steps:
environment:
GOPROXY: 'https://goproxy.kolaente.de'
commands:
- make generate
- make test
depends_on: [ fetch-tags ]
- ./mage-static test:unit
depends_on: [ fetch-tags, mage ]
when:
event: [ push, tag, pull_request ]
@ -165,10 +227,13 @@ steps:
GOPROXY: 'https://goproxy.kolaente.de'
VIKUNJA_TESTS_USE_CONFIG: 1
VIKUNJA_DATABASE_TYPE: sqlite
VIKUNJA_DATABASE_PATH: /db/vikunja-test.db
volumes:
- name: tmp-sqlite-unit
path: /db
commands:
- make generate
- make test
depends_on: [ fetch-tags ]
- ./mage-static test:unit
depends_on: [ fetch-tags, mage ]
when:
event: [ push, tag, pull_request ]
@ -184,9 +249,8 @@ steps:
VIKUNJA_DATABASE_PASSWORD: vikunjatest
VIKUNJA_DATABASE_DATABASE: vikunjatest
commands:
- make generate
- make test
depends_on: [ fetch-tags ]
- ./mage-static test:unit
depends_on: [ fetch-tags, mage ]
when:
event: [ push, tag, pull_request ]
@ -203,9 +267,8 @@ steps:
VIKUNJA_DATABASE_DATABASE: vikunjatest
VIKUNJA_DATABASE_SSLMODE: disable
commands:
- make generate
- make test
depends_on: [ fetch-tags ]
- ./mage-static test:unit
depends_on: [ fetch-tags, mage ]
when:
event: [ push, tag, pull_request ]
@ -215,9 +278,8 @@ steps:
environment:
GOPROXY: 'https://goproxy.kolaente.de'
commands:
- make generate
- make integration-test
depends_on: [ fetch-tags ]
- ./mage-static test:integration
depends_on: [ fetch-tags, mage ]
when:
event: [ push, tag, pull_request ]
@ -228,10 +290,13 @@ steps:
GOPROXY: 'https://goproxy.kolaente.de'
VIKUNJA_TESTS_USE_CONFIG: 1
VIKUNJA_DATABASE_TYPE: sqlite
VIKUNJA_DATABASE_PATH: /db/vikunja-test.db
volumes:
- name: tmp-sqlite-integration
path: /db
commands:
- make generate
- make integration-test
depends_on: [ fetch-tags ]
- ./mage-static test:integration
depends_on: [ fetch-tags, mage ]
when:
event: [ push, tag, pull_request ]
@ -247,9 +312,8 @@ steps:
VIKUNJA_DATABASE_PASSWORD: vikunjatest
VIKUNJA_DATABASE_DATABASE: vikunjatest
commands:
- make generate
- make integration-test
depends_on: [ fetch-tags ]
- ./mage-static test:integration
depends_on: [ fetch-tags, mage ]
when:
event: [ push, tag, pull_request ]
@ -266,9 +330,8 @@ steps:
VIKUNJA_DATABASE_DATABASE: vikunjatest
VIKUNJA_DATABASE_SSLMODE: disable
commands:
- make generate
- make integration-test
depends_on: [ fetch-tags ]
- ./mage-static test:integration
depends_on: [ fetch-tags, mage ]
when:
event: [ push, tag, pull_request ]
@ -289,7 +352,7 @@ workspace:
trigger:
ref:
- refs/heads/master
- refs/heads/main
- "refs/tags/**"
steps:
@ -299,14 +362,26 @@ steps:
commands:
- git fetch --tags
# We're statically compiling the magefile to avoid race condition issues caused by multiple pipeline steps
# compiling the same magefile at the same time. It's also faster if each step does not need to compile it first.
- name: mage
image: vikunja/golang-build:latest
pull: true
environment:
GOPROXY: 'https://goproxy.kolaente.de'
commands:
- mage -compile ./mage-static
when:
event: [ push, tag, pull_request ]
- name: before-static-build
image: techknowlogick/xgo:latest
pull: true
commands:
- export PATH=$PATH:$GOPATH/bin
- make generate
- make release-dirs
depends_on: [ fetch-tags ]
- go install github.com/magefile/mage
- ./mage-static release:dirs
depends_on: [ fetch-tags, mage ]
- name: static-build-windows
image: techknowlogick/xgo:latest
@ -317,7 +392,8 @@ steps:
GOPATH: /srv/app
commands:
- export PATH=$PATH:$GOPATH/bin
- make release-windows
- go install github.com/magefile/mage
- ./mage-static release:windows
depends_on: [ before-static-build ]
- name: static-build-linux
@ -329,7 +405,8 @@ steps:
GOPATH: /srv/app
commands:
- export PATH=$PATH:$GOPATH/bin
- make release-linux
- go install github.com/magefile/mage
- ./mage-static release:linux
depends_on: [ before-static-build ]
- name: static-build-darwin
@ -341,7 +418,8 @@ steps:
GOPATH: /srv/app
commands:
- export PATH=$PATH:$GOPATH/bin
- make release-darwin
- go install github.com/magefile/mage
- ./mage-static release:darwin
depends_on: [ before-static-build ]
- name: after-build-compress
@ -352,7 +430,7 @@ steps:
- static-build-linux
- static-build-darwin
commands:
- make release-compress
- ./mage-static release:compress
- name: after-build-static
image: techknowlogick/xgo:latest
@ -360,10 +438,11 @@ steps:
depends_on:
- after-build-compress
commands:
- make release-copy
- make release-check
- make release-os-package
- make release-zip
- go install github.com/magefile/mage
- ./mage-static release:copy
- ./mage-static release:check
- ./mage-static release:os-package
- ./mage-static release:zip
- name: sign-release
image: plugins/gpgsign:1
@ -383,82 +462,135 @@ steps:
image: plugins/s3:1
pull: true
settings:
bucket: vikunja
bucket: vikunja-releases
access_key:
from_secret: aws_access_key_id
secret_key:
from_secret: aws_secret_access_key
endpoint: https://storage.kolaente.de
endpoint: https://s3.fr-par.scw.cloud
region: fr-par
path_style: true
strip_prefix: dist/zip/
source: dist/zip/*
target: /api/master/
trigger:
ref:
- refs/heads/master
target: /api/unstable/
when:
branch:
- main
event:
- push
depends_on: [ sign-release ]
- name: release-version
image: plugins/s3:1
pull: true
settings:
bucket: vikunja
bucket: vikunja-releases
access_key:
from_secret: aws_access_key_id
secret_key:
from_secret: aws_secret_access_key
endpoint: https://storage.kolaente.de
endpoint: https://s3.fr-par.scw.cloud
region: fr-par
path_style: true
strip_prefix: dist/zip/
source: dist/zip/*
target: /api/${DRONE_TAG##v}/
trigger:
ref:
- "refs/tags/**"
when:
event:
- tag
depends_on: [ sign-release ]
# Build a debian package and push it to our bucket
- name: build-deb
image: kolaente/fpm
# Build os packages and push it to our bucket
- name: build-os-packages
image: goreleaser/nfpm
pull: true
commands:
- make build-deb
- apk add git go
- ./mage-static release:packages
- mv dist/os-packages/vikunja*.x86_64.rpm dist/os-packages/vikunja-unstable-x86_64.rpm
- mv dist/os-packages/vikunja*_amd64.deb dist/os-packages/vikunja-unstable-amd64.deb
- mv dist/os-packages/vikunja*_x86_64.apk dist/os-packages/vikunja-unstable-x86_64.apk
depends_on: [ static-build-linux ]
- name: deb-structure
image: kolaente/reprepro
# Push the os releases to our pseudo-s3-bucket
- name: release-os-latest
image: plugins/s3:1
pull: true
environment:
GPG_PRIVATE_KEY:
from_secret: gpg_privatekey
commands:
- export GPG_TTY=$(tty)
- gpg -qk
- echo "use-agent" >> ~/.gnupg/gpg.conf
- gpgconf --kill gpg-agent
- echo $GPG_PRIVATE_KEY > ~/frederik.gpg
- gpg --import ~/frederik.gpg
- mkdir debian/conf -p
- cp build/reprepro-dist-conf debian/conf/distributions
- make reprepro
depends_on: [ build-deb ]
settings:
bucket: vikunja-releases
access_key:
from_secret: aws_access_key_id
secret_key:
from_secret: aws_secret_access_key
endpoint: https://s3.fr-par.scw.cloud
region: fr-par
path_style: true
strip_prefix: dist/os-packages/
source: dist/os-packages/*
target: /api/unstable/
when:
branch:
- main
event:
- push
depends_on: [ build-os-packages ]
- name: release-os-version
image: plugins/s3:1
pull: true
settings:
bucket: vikunja-releases
access_key:
from_secret: aws_access_key_id
secret_key:
from_secret: aws_secret_access_key
endpoint: https://s3.fr-par.scw.cloud
region: fr-par
path_style: true
strip_prefix: dist/os-packages/
source: dist/os-packages/*
target: /api/${DRONE_TAG##v}/
when:
event:
- tag
depends_on: [ build-os-packages ]
### Broken, disabled until we figure out how to fix it
# - name: deb-structure
# image: kolaente/reprepro
# pull: true
# environment:
# GPG_PRIVATE_KEY:
# from_secret: gpg_privatekey
# commands:
# - export GPG_TTY=$(tty)
# - gpg -qk
# - echo "use-agent" >> ~/.gnupg/gpg.conf
# - gpgconf --kill gpg-agent
# - echo $GPG_PRIVATE_KEY > ~/frederik.gpg
# - gpg --import ~/frederik.gpg
# - mkdir debian/conf -p
# - cp build/reprepro-dist-conf debian/conf/distributions
# - ./mage-static release:reprepro
# depends_on: [ build-os-packages ]
# Push the releases to our pseudo-s3-bucket
- name: release-deb
image: plugins/s3:1
pull: true
settings:
bucket: vikunja
bucket: vikunja-releases
access_key:
from_secret: aws_access_key_id
secret_key:
from_secret: aws_secret_access_key
endpoint: https://storage.kolaente.de
endpoint: https://s3.fr-par.scw.cloud
region: fr-par
path_style: true
strip_prefix: debian
source: debian/*/*/*/*/*
target: /deb/
depends_on: [ deb-structure ]
# depends_on: [ deb-structure ]
---
kind: pipeline
@ -475,26 +607,21 @@ trigger:
event:
- push
branch:
- master
- main
steps:
- name: submodules
image: docker:git
commands:
- git submodule update --init
- git submodule update --recursive --remote
- name: theme
image: kolaente/yarn
image: kolaente/toolbox
pull: true
group: build-static
commands:
- mkdir docs/themes/vikunja -p
- cd docs/themes/vikunja
- yarn --production=false
- ./node_modules/.bin/gulp prod
- wget https://dl.vikunja.io/theme/vikunja-theme.tar.gz
- tar -xzf vikunja-theme.tar.gz
- name: build
image: monachus/hugo:v0.54.0
image: monachus/hugo:v0.75.1
pull: true
commands:
- cd docs
@ -523,11 +650,11 @@ depends_on:
platform:
os: linux
arch: arm
arch: arm64
trigger:
ref:
- refs/heads/master
- refs/heads/main
- "refs/tags/**"
steps:
@ -535,7 +662,22 @@ steps:
image: docker:git
commands:
- git fetch --tags
- name: docker
- name: docker-arm-unstable
image: plugins/docker:linux-arm
pull: true
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: vikunja/api
tags: unstable-linux-arm
depends_on: [ fetch-tags ]
when:
ref:
- refs/heads/main
- name: docker-arm
image: plugins/docker:linux-arm
pull: true
settings:
@ -547,6 +689,40 @@ steps:
auto_tag: true
auto_tag_suffix: linux-arm
depends_on: [ fetch-tags ]
when:
ref:
- "refs/tags/**"
- name: docker-arm64-unstable
image: plugins/docker:linux-arm64
pull: true
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: vikunja/api
tags: unstable-linux-arm64
depends_on: [ fetch-tags ]
when:
ref:
- refs/heads/main
- name: docker-arm64
image: plugins/docker:linux-arm64
pull: true
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: vikunja/api
auto_tag: true
auto_tag_suffix: linux-arm64
depends_on: [ fetch-tags ]
when:
ref:
- "refs/tags/**"
---
kind: pipeline
@ -562,7 +738,7 @@ platform:
trigger:
ref:
- refs/heads/master
- refs/heads/main
- "refs/tags/**"
steps:
@ -570,6 +746,22 @@ steps:
image: docker:git
commands:
- git fetch --tags
- name: docker-unstable
image: plugins/docker:linux-amd64
pull: true
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: vikunja/api
tags: unstable-linux-amd64
depends_on: [ fetch-tags ]
when:
ref:
- refs/heads/main
- name: docker
image: plugins/docker:linux-amd64
pull: true
@ -582,6 +774,9 @@ steps:
auto_tag: true
auto_tag_suffix: linux-amd64
depends_on: [ fetch-tags ]
when:
ref:
- "refs/tags/**"
---
kind: pipeline
@ -590,7 +785,7 @@ name: docker-manifest
trigger:
ref:
- refs/heads/master
- refs/heads/main
- "refs/tags/**"
depends_on:
@ -598,7 +793,22 @@ depends_on:
- docker-arm-release
steps:
- name: manifest
- name: manifest-unstable
pull: always
image: plugins/manifest
settings:
tags: unstable
ignore_missing: true
spec: docker-manifest-unstable.tmpl
password:
from_secret: docker_password
username:
from_secret: docker_username
when:
ref:
- refs/heads/main
- name: manifest-release
pull: always
image: plugins/manifest
settings:
@ -609,6 +819,26 @@ steps:
from_secret: docker_password
username:
from_secret: docker_username
when:
ref:
- "refs/tags/**"
- name: manifest-release-latest
pull: always
image: plugins/manifest
depends_on:
- clone
settings:
tags: latest
ignore_missing: true
spec: docker-manifest.tmpl
password:
from_secret: docker_password
username:
from_secret: docker_username
when:
ref:
- "refs/tags/**"
---
kind: pipeline
@ -617,26 +847,33 @@ name: notify
trigger:
ref:
- refs/heads/master
- refs/heads/main
- "refs/tags/**"
depends_on:
- testing
- release
- deploy-docs
- docker-arm-release
- docker-amd64-release
- docker-manifest
steps:
- name: telegram
image: appleboy/drone-telegram
- name: notify
image: plugins/matrix
settings:
token:
from_secret: TELEGRAM_TOKEN
to:
from_secret: TELEGRAM_TO
message: >
{{repo.owner}}/{{repo.name}}: \[{{build.status}}] Build {{build.number}}
{{commit.author}} pushed to {{commit.branch}} {{commit.sha}}: `{{commit.message}}`
Build started at {{datetime build.started "2006-Jan-02T15:04:05Z" "GMT+2"}} finished at {{datetime build.finished "2006-Jan-02T15:04:05Z" "GMT+2"}}.
homeserver: https://matrix.org
roomid: WqBDCxzghKcNflkErL:matrix.org
username:
from_secret: matrix_username
password:
from_secret: matrix_password
when:
status:
- success
- failure
---
kind: signature
hmac: 110b782e9b704b4b3b3d618678383718c92262cf3c214f4fe6705d40cd3da367
...

22
.editorconfig Normal file
View File

@ -0,0 +1,22 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
[*.go]
indent_style = tab
[*.{yaml,yml}]
indent_style = space
indent_size = 2
[*.json]
indent_style = space
indent_size = 4

View File

@ -6,6 +6,6 @@
* [ ] I added or improved tests
* [ ] I added or improved docs for my feature
* [ ] Swagger (including `make do-the-swag`)
* [ ] Swagger (including `mage do-the-swag`)
* [ ] Error codes
* [ ] New config options
* [ ] New config options (including adding them to `config.yml.saml` and running `mage generate-docs`)

2
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,2 @@
github: kolaente
custom: https://www.buymeacoffee.com/kolaente

3
.gitignore vendored
View File

@ -4,6 +4,7 @@
config.yml
config.yaml
!docs/config.yml
docs/themes/
*.db
Run
dist/
@ -22,3 +23,5 @@ files/
!pkg/files/
vikunja-dump*
vendor/
os-packages/
mage_output_file.go

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "docs/themes/vikunja"]
path = docs/themes/vikunja
url = ../theme.git

82
.golangci.yml Normal file
View File

@ -0,0 +1,82 @@
run:
timeout: 15m
tests: true
linters:
enable:
- megacheck
- govet
- goconst
- gocritic
- gocyclo
- goerr113
- goheader
- gofmt
- goimports
- golint
- misspell
disable:
- scopelint # Obsolete, using exportloopref instead
presets:
- bugs
- unused
fast: false
linters-settings:
nestif:
min-complexity: 6
goheader:
template-path: code-header-template.txt
issues:
exclude-rules:
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- gocyclo
- deadcode
- path: pkg/integrations/*
linters:
- gocyclo
- deadcode
- varcheck
- unparam
- bodyclose
- path: pkg/integrations/*
text: "unlambda"
linters:
- gocritic
- path: pkg/modules/background/unsplash/unsplash\.go
linters:
- bodyclose
- path: pkg/migration/*
linters:
- exhaustive
- goconst
- goerr113
- path: pkg/models/task_collection_filter\.go
linters:
- exhaustive
- path: pkg/utils/random_string\.go
text: "G404:" # We don't care about cryptographically secure randomness when we're using that utility function.
linters:
- gosec
- path: pkg/modules/dump/*
linters:
- goerr113
- path: pkg/
text: "err113: do not define dynamic errors, use wrapped static errors instead:"
linters:
- goerr113
- text: "commentFormatting: put a space between `//` and comment text"
linters:
- gocritic
- path: pkg/modules/migration
linters:
- gocyclo
- path: pkg/routes/api/v1/docs.go
linters:
- goheader
- text: "Missed string"
linters:
- goheader

17
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceRoot}",
"env": {},
"args": []
}
]
}

View File

@ -2,11 +2,608 @@
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
All releases can be found on https://code.vikunja.io/api/releases.
## [0.18.1] - 2021-09-08
### Fixed
* Docs: Add another third-party tutorial link
* Don't try to export items which do not have a parent
* fix(deps): update golang.org/x/sys commit hash to 6f6e228 (#970)
* fix(deps): update golang.org/x/sys commit hash to c212e73 (#971)
* Fix exporting tasks from archived lists
* Fix lint
* Fix tasks not exported
* Fix tmp export file created in the wrong path
## [0.18.0] - 2021-09-05
### Added
* Add default list setting (#875)
* Add menu link to Vikunja Cloud in docs
* Add more logging and better error messages for openid authentication + clarify docs
* Add more logging for test data api endpoint
* Add searching for tasks by index
* Add setting for first day of the week
* Add support of Unix socket (#912)
* Add truncate parameter to test fixtures setup
* Notify the user after three failed login attempts
* Reorder tasks, lists and kanban buckets (#923)
* Send a notification on failed TOTP
* Task mentions (#926)
* Try to get more information about the user when authenticating with openid
* User account deletion (#937)
* User Data Export and import (#967)
### Changed
* Allow running migration 20210711173657 multiple times to fix issues when it didn't completely run through previously
* Better logging for errors while importing a bunch of tasks
* Change task title to TEXT instead of varchar(250) to allow for longer task titles
* Disable the user account after 10 failed password attempts
* Docs: Add a note about default password
* Docs: Add another youtube tutorial
* Docs: Add ios to the list of not working caldav clients
* Docs: Add k8s-at-home Helm Chart for Vikunja
* Docs: Add other installation resources
* Docs: Add translation docs
* Docs: Fix rewrite rules in apache example configs
* Docs: Translation now happening at crowdin
* Docs: Update translation guidelines
* Don't fail when removing the last bucket in migration from other services
* Don't notify the user who created the team
* Don't use the mariadb root user in docker-compose examples
* Ensure case insensitive search on postgres (#927)
* Increase test timeout
* Only filter out failing openid providers if multiple are configured and one of them failed
* Only send an email about failed totp after three failed attempts
* Rearrange setting frontend url in config
* Refactor user email confirmation + password reset handling (#919)
* Rename and sign drone config
* Replace jwt-go with github.com/golang-jwt/jwt
* Reset failed totp attempts when logging in successfully
* Save user tokens as text and not varchar
* Save user tokens as varchar(450) and not text to fix mysql indexing issues
* Set todoist migration redirect url to the frontend url by default
* Show config full paths and env variables with config options
* Switch the :latest docker image tag to contain the latest release instead of the latest unstable
* Tune test db server settings to speed up tests (#939)
### Fixed
* Fix authentication callback
* Fix duplicating empty lists
* Fix error handling when deleting an attachment file
* Fix error when searching for a namespace returned no results
* Fix error when searching for a namespace with subscribers
* Fix goimports
* Fix importing archived projects and done items from todoist
* Fix jwt middleware
* Fix lint
* Fix mapping task priorities from Vikunja to calDAV
* Fix moving the done bucket around
* Fix old references to master in docs
* Fix panic on invalid smtp config
* Fix parsing openid config when using a json config file
* Fix saving pointer values to memory keyvalue
* Fix saving reminders of repeating tasks
* Fix setting a saved filter as favorite
* Fix setting task favorite status of related tasks
* Fix setting up keyvalue storage in tests
* Fix swagger docs for create requests
* Fix task relations not getting properly cleaned up when deleting them
* Fix tests & lint
* Make sure a bucket exists or use the default bucket when importing tasks
* Make sure all associated entities of a task are deleted when the task is deleted
* Make sure list / task favorites are set per user, not per entity (#915)
* Make sure the configured frontend url always has a / at the end
* Refactor & fix storing struct-values in redis keyvalue
* Todoist migration: don't panic if no reminder was found for task
### Dependency updates
* fix(deps): update golang.org/x/sys commit hash to 63515b4 (#959)
* fix(deps): update golang.org/x/sys commit hash to 97244b9 (#965)
* fix(deps): update golang.org/x/sys commit hash to f475640 (#962)
* fix(deps): update golang.org/x/sys commit hash to f4d4317 (#961)
* fix(deps): update module github.com/lib/pq to v1.10.3 (#963)
* Update alpine Docker tag to v3.13 (#884)
* Update alpine Docker tag to v3.14 (#889)
* Update golang.org/x/crypto commit hash to 0a44fdf (#944)
* Update golang.org/x/crypto commit hash to 0ba0e8f (#943)
* Update golang.org/x/crypto commit hash to 32db794 (#949)
* Update golang.org/x/crypto commit hash to 5ff15b2 (#891)
* Update golang.org/x/crypto commit hash to a769d52 (#916)
* Update golang.org/x/image commit hash to 775e3b0 (#880)
* Update golang.org/x/image commit hash to a66eb64 (#900)
* Update golang.org/x/image commit hash to e6eecd4 (#893)
* Update golang.org/x/net commit hash to 37e1c6af
* Update golang.org/x/oauth2 commit hash to 14747e6 (#894)
* Update golang.org/x/oauth2 commit hash to 2bc19b1 (#955)
* Update golang.org/x/oauth2 commit hash to 6f1e639 (#931)
* Update golang.org/x/oauth2 commit hash to 7df4dd6 (#952)
* Update golang.org/x/oauth2 commit hash to a41e5a7 (#902)
* Update golang.org/x/oauth2 commit hash to a8dc77f (#896)
* Update golang.org/x/oauth2 commit hash to bce0382 (#895)
* Update golang.org/x/oauth2 commit hash to d040287 (#888)
* Update golang.org/x/oauth2 commit hash to f6687ab (#862)
* Update golang.org/x/oauth2 commit hash to faf39c7 (#935)
* Update golang.org/x/sys commit hash to 00dd8d7 (#953)
* Update golang.org/x/sys commit hash to 15123e1 (#946)
* Update golang.org/x/sys commit hash to 1e6c022 (#947)
* Update golang.org/x/sys commit hash to 30e4713 (#945)
* Update golang.org/x/sys commit hash to 41cdb87 (#956)
* Update golang.org/x/sys commit hash to 7d9622a (#948)
* Update golang.org/x/sys commit hash to bfb29a6 (#951)
* Update golang.org/x/sys commit hash to d867a43 (#934)
* Update golang.org/x/sys commit hash to e5e7981 (#933)
* Update golang.org/x/sys commit hash to f52c844 (#954)
* Update golang.org/x/term commit hash to 6886f2d (#887)
* Update module getsentry/sentry-go to v0.11.0 (#869)
* Update module github.com/coreos/go-oidc to v3 (#885)
* Update module github.com/gabriel-vasile/mimetype to v1.3.1 (#904)
* Update module github.com/golang-jwt/jwt to v3.2.2 (#928)
* Update module github.com/golang-jwt/jwt to v4 (#930)
* Update module github.com/go-redis/redis/v8 to v8.11.0 (#903)
* Update module github.com/go-redis/redis/v8 to v8.11.1 (#925)
* Update module github.com/go-redis/redis/v8 to v8.11.2 (#932)
* Update module github.com/go-redis/redis/v8 to v8.11.3 (#942)
* Update module github.com/iancoleman/strcase to v0.2.0 (#918)
* Update module github.com/labstack/echo/v4 to v4.4.0 (#917)
* Update module github.com/labstack/echo/v4 to v4.5.0 (#929)
* Update module github.com/mattn/go-sqlite3 to v1.14.8 (#921)
* Update module github.com/spf13/cobra to v1.2.0 (#905)
* Update module github.com/spf13/cobra to v1.2.1 (#906)
* Update module github.com/spf13/viper to v1.8.0 (#890)
* Update module github.com/spf13/viper to v1.8.1 (#899)
* Update module github.com/swaggo/swag to v1.7.1 (#936)
* Update module github.com/yuin/goldmark to v1.3.8 (#892)
* Update module github.com/yuin/goldmark to v1.3.9 (#901)
* Update module github.com/yuin/goldmark to v1.4.0 (#908)
* Update module go-redis/redis/v8 to v8.10.0 (#882)
* Update module go-redis/redis/v8 to v8.7.1 (#807)
* Update module go-testfixtures/testfixtures/v3 to v3.6.1 (#868)
* Update module lib/pq to v1.10.2 (#865)
* Update module prometheus/client_golang to v1.11.0 (#879)
* Update module yuin/goldmark to v1.3.6 (#863)
* Update module yuin/goldmark to v1.3.7 (#867)
* Update monachus/hugo Docker tag to v0.75.1 (#940)
## [0.17.1] - 2021-06-09
### Fixed
* Fix parsing openid config when using a json config file
## [0.17.0] - 2021-05-14
### Added
* Add a "done" option to kanban buckets (#821)
* Add arm64 builds
* Add basic auth for metrics endpoint
* Add bucket limit validation
* Add crud endpoints for notifications (#801)
* Add endpoint to remove a list background
* Add events (#777)
* Add github funding link
* Add link share password authentication (#831)
* Add names for link shares (#829)
* Add notifications package for easy sending of notifications (#779)
* Add reminders for overdue tasks (#832)
* Add repeat monthly setting for tasks (#834)
* Add security information to readme
* Add separate docker manifest file for latest docker images
* Add systemd service file to linux packages
* Add test for moving a task to another list
* Enable searching users by full email or name
* Expose tls parameter of Go MySQL driver to config file (#855)
* Pagingation for tasks in kanban buckets (#805)
### Changed
* Change keyvalue.Get to return if a value exists or not instead of an error
* Change main branch to main
* Change test file names to unstable
* Change the name of the newly created bucket from "New Bucket" to "Backlog"
* Change unstable versions in migration tests
* Check if we're on main and change the version name accordingly if that's the case
* Cleanup listener names
* Cleanup old docs themes submodule
* Disable deb repo in drone
* Don't keep old releases from os packages when releasing for master
* Don't try to get users for tasks if no tasks were found when looking for reminders
* Explicitly add docker build step for latest
* Explicitly check if there are Ids before trying to get items by a list of Ids
* Improve duration format of overdue tasks in reminders
* Improve loading labels performance (#824)
* Improve sending overdue task reminders by only sending one for all overdue tasks
* Make sure all tables are properly pluralized
* Only send reminders for undone tasks
* Re-Enable migration test steps in pipeline
* Refactor getting all namespaces
* Remove unused tools from tools.go
* Run all lint checks at once
* Send a notification to the user when they are added to the list
* Show empty avatar when the user was not found
* Subscribe a user to a task when they are assigned to it
* Subscriptions and notifications for namespaces, tasks and lists (#786)
* Switch building the docs to download the theme instead of building
* Switch telegram notifications to matrix notifications
* Temporarily disable migration step
* Temporary build fix
* Update changelog
* Update copyright year
* Update README (#858)
* Use golang's tzdata package to handle time zones
### Fixed
* Explicitly set darwin-10.15 when building binaries
* Fix build
* Fix checking list rights when accessing a bucket
* Fix /dav/principals/*/ throwing a server error when accessed with GET instead of PROPFIND (#769)
* Fix deleting task relations
* Fix docs
* Fix drone file
* Fix due dates with times when migrating from todoist
* Fix event error handler retrying infinitely
* Fix filter for task index
* Fix getting lists for shared, favorite and saved lists namespace
* Fix getting user info from /user endpoint for link shares
* Fix IncrBy and DecrBy in memory keyvalue implementation if there was no value set previously
* Fix lint
* Fix matrix notify room id
* Fix moving repeating tasks to the done bucket
* Fix multiarch docker image building
* Fix not able to make saved filters favorite
* Fix notifications table not being created on initial setup
* Fix resetting the bucket limit
* Fix retrieving over openid providers if there are none
* Fix sending notifications to users if the user object didn't have an email
* Fix setting the user in created_by when uploading an attachment
* Fix shared lists showing up twice
* Fix tests
* Fix the shared lists pseudo namespace containing owned lists
* Fix unstable version build file names
* Fix user uploaded avatars
* Pin golang alpine builder image to 3.12 to fix builds on arm
* Revert "Update alpine Docker tag to v3.13 (#768)"
### Dependency Updates
* Update alpine Docker tag to v3.13 (#768)
* Update github.com/gordonklaus/ineffassign commit hash to 2e10b26 (#803)
* Update github.com/gordonklaus/ineffassign commit hash to d0e41b2 (#780)
* Update golang.org/x/crypto commit hash to 0c34fe9 (#822)
* Update golang.org/x/crypto commit hash to 3497b51 (#853)
* Update golang.org/x/crypto commit hash to 38f3c27 (#854)
* Update golang.org/x/crypto commit hash to 4f45737 (#836)
* Update golang.org/x/crypto commit hash to 513c2a4 (#817)
* Update golang.org/x/crypto commit hash to 5bf0f12 (#839)
* Update golang.org/x/crypto commit hash to 5ea612d (#797)
* Update golang.org/x/crypto commit hash to 83a5a9b (#840)
* Update golang.org/x/crypto commit hash to b8e89b7 (#793)
* Update golang.org/x/crypto commit hash to c07d793 (#861)
* Update golang.org/x/crypto commit hash to cd7d49e (#860)
* Update golang.org/x/crypto commit hash to e6e6c4f (#816)
* Update golang.org/x/crypto commit hash to e9a3299 (#851)
* Update golang.org/x/image commit hash to 4410531 (#788)
* Update golang.org/x/image commit hash to 55ae14f (#787)
* Update golang.org/x/image commit hash to 7319ad4 (#852)
* Update golang.org/x/image commit hash to ac19c3e (#798)
* Update golang.org/x/oauth2 commit hash to 0101308 (#776)
* Update golang.org/x/oauth2 commit hash to 01de73c (#762)
* Update golang.org/x/oauth2 commit hash to 16ff188 (#789)
* Update golang.org/x/oauth2 commit hash to 22b0ada (#823)
* Update golang.org/x/oauth2 commit hash to 2e8d934 (#827)
* Update golang.org/x/oauth2 commit hash to 5366d9d (#813)
* Update golang.org/x/oauth2 commit hash to 5e61552 (#833)
* Update golang.org/x/oauth2 commit hash to 6667018 (#783)
* Update golang.org/x/oauth2 commit hash to 81ed05c (#848)
* Update golang.org/x/oauth2 commit hash to 8b1d76f (#764)
* Update golang.org/x/oauth2 commit hash to 9bb9049 (#796)
* Update golang.org/x/oauth2 commit hash to af13f52 (#773)
* Update golang.org/x/oauth2 commit hash to ba52d33 (#794)
* Update golang.org/x/oauth2 commit hash to cd4f82c (#815)
* Update golang.org/x/oauth2 commit hash to d3ed898 (#765)
* Update golang.org/x/oauth2 commit hash to f9ce19e (#775)
* Update golang.org/x/sync commit hash to 036812b (#799)
* Update golang.org/x/term commit hash to 6a3ed07 (#800)
* Update golang.org/x/term commit hash to 72f3dc4 (#828)
* Update golang.org/x/term commit hash to a79de54 (#850)
* Update golang.org/x/term commit hash to b80969c (#843)
* Update golang.org/x/term commit hash to c04ba85 (#849)
* Update golang.org/x/term commit hash to de623e6 (#818)
* Update golang.org/x/term commit hash to f5beecf (#845)
* Update module adlio/trello to v1.9.0 (#825)
* Update module coreos/go-oidc to v3 (#760)
* Update module gabriel-vasile/mimetype to v1.2.0 (#812)
* Update module gabriel-vasile/mimetype to v1.3.0 (#857)
* Update module getsentry/sentry-go to v0.10.0 (#792)
* Update module go-redis/redis/v8 to v8.4.10 (#771)
* Update module go-redis/redis/v8 to v8.4.11 (#774)
* Update module go-redis/redis/v8 to v8.4.9 (#770)
* Update module go-redis/redis/v8 to v8.5.0 (#778)
* Update module go-redis/redis/v8 to v8.6.0 (#795)
* Update module go-sql-driver/mysql to v1.6.0 (#826)
* Update module go-testfixtures/testfixtures/v3 to v3.5.0 (#761)
* Update module go-testfixtures/testfixtures/v3 to v3.6.0 (#838)
* Update module iancoleman/strcase to v0.1.3 (#766)
* Update module imdario/mergo to v0.3.12 (#811)
* Update module jgautheron/goconst to v1 (#804)
* Update module labstack/echo/v4 to v4.2.0 (#785)
* Update module labstack/echo/v4 to v4.2.1 (#810)
* Update module labstack/echo/v4 to v4.2.2 (#830)
* Update module labstack/echo/v4 to v4.3.0 (#856)
* Update module lib/pq to v1.10.0 (#809)
* Update module lib/pq to v1.10.1 (#841)
* Update module mattn/go-sqlite3 to v1.14.7 (#835)
* Update module olekukonko/tablewriter to v0.0.5 (#782)
* Update module prometheus/client_golang to v1.10.0 (#819)
* Update module spf13/afero to v1.6.0 (#820)
* Update module spf13/cobra to v1.1.2 (#781)
* Update module spf13/cobra to v1.1.3 (#784)
* Update module src.techknowlogick.com/xgo to v1.3.0+1.16.0 (#791)
* Update module src.techknowlogick.com/xgo to v1.4.0+1.16.2 (#814)
* Update module stretchr/testify to v1.7.0 (#763)
## [0.16.1] - 2021-04-22
### Fixed
* Fix checking list rights when accessing a bucket
* Remove old deb-structure ci step
* Fix docker from
## [0.16.0] - 2021-01-10
### Added
* Add colors for caldav (#738)
* Add email reminders (#743)
* Add "like" filter comparator
* Add login via email (#740)
* Add Microsoft Todo migration (#737)
* Add name field to users
* Add support for migrating todoist boards (#732)
* Add task filter for assignees (#746)
* Add task filter for labels (#747)
* Add task filter for lists and namespaces (#748)
* Add task filter for reminders (#745)
* Add task filters for kanban
* Add testing endpoint to reset db tables (#716)
* Add tests for sending task reminders (#757)
* Add trello migration (#734)
* Authentication with OpenID Connect providers (#713)
### Fixed
* Fix completion status in DAV for OpenTasks and multiline descriptions (#697)
* Fix docs about caldav tasks.org
* Fix drone badge in README
* Fix getting current user when updating avatar or user name
* Fix go header lint
* Fix /info endpoint 500 error when no openid providers were configured
* Fix missing auto increments from b0d4902406 on mysql
* Fix not possible to create tasks if metrics were enabled
* Fix password reset without a reseet token
* Fix task updated timestamp not being updated in the response after updating a task
### Changed
* Change avatar endpoint
* Change license to AGPLv3
* Clarify docs about cors configuration
* Don't create a list identifier by default
* Make sure all int64 db fields are using bigint when actually storing the data (#741)
* Make sure a password reset token can be used only once
* Make the debian repo structure for buster instead of strech
* Refactor adding more details to tasks (#739)
* Simplify updating task reminders
* Update code header template
* Update github.com/gordonklaus/ineffassign commit hash to 3b93a88 (#701)
* Update github.com/gordonklaus/ineffassign commit hash to 8eed68e (#755)
* Update github.com/jgautheron/goconst commit hash to b58d7cf (#702)
* Update github.com/jgautheron/goconst commit hash to ccae5bf (#712)
* Update github.com/jgautheron/goconst commit hash to f8e4fe8 (#703)
* Update golang.org/x/crypto commit hash to 0c6587e (#706)
* Update golang.org/x/crypto commit hash to 5f87f34 (#729)
* Update golang.org/x/crypto commit hash to 8b5274c (#733)
* Update golang.org/x/crypto commit hash to 9d13527 (#736)
* Update golang.org/x/crypto commit hash to be400ae (#719)
* Update golang.org/x/crypto commit hash to c8d3bf9 (#710)
* Update golang.org/x/crypto commit hash to eec23a3 (#749)
* Update golang.org/x/image commit hash to 35266b9 (#727)
* Update golang.org/x/lint commit hash to 83fdc39 (#728)
* Update golang.org/x/oauth2 commit hash to 08078c5 (#722)
* Update golang.org/x/oauth2 commit hash to 0b49973 (#718)
* Update golang.org/x/oauth2 commit hash to 9fd6049 (#714)
* Update golang.org/x/sync commit hash to 09787c9 (#725)
* Update golang.org/x/sync commit hash to 67f06af (#695)
* Update golang.org/x/term commit hash to 2321bbc (#731)
* Update golang.org/x/term commit hash to ee85cb9 (#726)
* Update module cweill/gotests to v1.6.0 (#752)
* Update module fzipp/gocyclo to v0.3.1 (#696)
* Update module gabriel-vasile/mimetype to v1.1.2 (#708)
* Update module getsentry/sentry-go to v0.8.0 (#709)
* Update module getsentry/sentry-go to v0.9.0 (#723)
* Update module go-redis/redis/v8 to v8.4.4 (#742)
* Update module go-redis/redis/v8 to v8.4.6 (#756)
* Update module go-redis/redis/v8 to v8.4.7 (#758)
* Update module go-redis/redis/v8 to v8.4.8 (#759)
* Update module lib/pq to v1.9.0 (#717)
* Update module magefile/mage to v1.11.0 (#754)
* Update module mattn/go-sqlite3 to v1.14.5 (#711)
* Update module mattn/go-sqlite3 to v1.14.6 (#751)
* Update module pquerna/otp to v1.3.0 (#705)
* Update module prometheus/client_golang to v1.9.0 (#735)
* Update module spf13/afero to v1.5.0 (#724)
* Update module spf13/afero to v1.5.1 (#730)
* Update module src.techknowlogick.com/xgo to v1.2.0+1.15.6 (#720)
* Update module src.techknowlogick.com/xormigrate to v1.4.0 (#700)
* Update module swaggo/swag to v1.6.9 (#694)
* Update module swaggo/swag to v1.7.0 (#721)
* Update module ulule/limiter/v3 to v3.8.0 (#699)
* Update nfpm config for nfpm v2
* Use db sessions everywere (#750)
## [0.15.1] - 2020-10-20
### Fixed
* Fix not possible to create tasks if metrics were enabled
## [0.15.0] - 2020-10-19
### Added
* Add app support info for DAV (#692)
* Add better tests for namespaces
* Add caldav enabled/disabled to /info endpoint
* Add checks if tasks exist in maps before trying to access them
* Add config option to force ssl connections to connect with the mailer
* Add dav proxy directions to example proxy configurations
* Add docs about using vikunja with utf-8 characters
* Add FreeBSD guide to installation docs
* Add github sponsor link
* Add Golangci Lint (#676)
* Add mage command to create a new migration
* Add option to configure legal urls
* Add rootpath to deb command to not include everything in the deb file
* Add toc to docs
* Add update route to toggle team member admin status
* Add util function to move files
* Disable gocyclo for migration modules
* Favorite lists (#654)
* Favorite tasks (#653)
* Generate config docs from sample config (#684)
* Kanban bucket limits (#652)
* Key-Value Storages (#674)
* Manage users via cli (#632)
* Mention client_max_body_size in nginx proxy settings
* More avatar providers (#622)
* Return rights when reading a single item (#626)
* Saved filters (#655)
### Fixed
* Cleanup references to make
* Don't add a subtask to the top level of tasks to not add it twice in the list
* Fetch tasks for caldav lists (#641)
* Fix building for darwin with mage
* Fix creating lists with non ascii characters (#607)
* Fix decoding active users from redis
* Fix dockerimage build
* Fix docs index links
* Fix duplicating a list with background
* "Fix" gocyclo
* Fix loading list background information for uploaded backgrounds
* Fix migrating items with large items from todoist
* Fix nfpm command in drone
* Fix parsing todoist reminder dates
* Fix reading passwords on windows
* Fix release commands in drone
* Fix release trigger
* Fix release trigger in drone
* Fix token renew for link shares
* Fix trigger for pushing release artifacts to drone
* Fix updating team admin status
* Fix upload avatar not working
* Fix users with disabled totp but not enrolled being unable to login
* Makefile: make add EXTRA_GOFLAG to GOFLAGS (#605)
* Make sure built binary files are executable when compressing with upx
* Make sure lists which would have a duplicate identifier can still be duplicated
* Make sure the metrics map accesses only happen explicitly
* Make sure to copy the permissions as well when moving files
* Make sure to only initialize all variables when needed
* Make sure to require admin rights when modifying list/namespace users to be consistent with teams
* Make sure we have git installed when building os packages
* Make sure we have go installed when building os packages (for build step dependencies)
* Only check if a bucket limit is exceeded when moving a task between buckets
* Only try to download attachments from todoist when there is a url
* Pin telegram notification plugin in drone
* Regenerate swagger docs
* Skip directories when moving build release artefacts in drone
* Support absolute iCal timestamps in CalDAV requests (#691)
* Work around tasks with attachments not being duplicated
### Changed
* Replace renovate tokens with env
* Switch s3 release bucket to scaleway
* Switch to mage (#651)
* Testing improvements (#666)
* Update docs with testmail command + reorder
* Update github.com/asaskevich/govalidator commit hash to 29e1ff8 (#639)
* Update github.com/asaskevich/govalidator commit hash to 50839af (#637)
* Update github.com/asaskevich/govalidator commit hash to 7a23bdc (#657)
* Update github.com/asaskevich/govalidator commit hash to df4adff (#552)
* Update github.com/c2h5oh/datasize commit hash to 48ed595 (#644)
* Update github.com/gordonklaus/ineffassign commit hash to e36bfde (#625)
* Update github.com/jgautheron/goconst commit hash to 8f5268c (#658)
* Update github.com/shurcooL/vfsgen commit hash to 0d455de (#642)
* Update golang.org/x/crypto commit hash to 123391f (#619)
* Update golang.org/x/crypto commit hash to 5c72a88 (#640)
* Update golang.org/x/crypto commit hash to 7f63de1 (#672)
* Update golang.org/x/crypto commit hash to 84dcc77 (#678)
* Update golang.org/x/crypto commit hash to 948cd5f (#609)
* Update golang.org/x/crypto commit hash to 9e8e0b3 (#685)
* Update golang.org/x/crypto commit hash to ab33eee (#608)
* Update golang.org/x/crypto commit hash to afb6bcd (#668)
* Update golang.org/x/crypto commit hash to c90954c (#671)
* Update golang.org/x/crypto commit hash to eb9a90e (#669)
* Update golang.org/x/image commit hash to 4578eab (#663)
* Update golang.org/x/image commit hash to a67d67e (#664)
* Update golang.org/x/image commit hash to e162460 (#665)
* Update golang.org/x/image commit hash to e59bae6 (#659)
* Update golang.org/x/sync commit hash to 3042136 (#667)
* Update golang.org/x/sync commit hash to b3e1573 (#675)
* Update module 4d63.com/tz to v1.2.0 (#631)
* Update module fzipp/gocyclo to v0.2.0 (#686)
* Update module fzipp/gocyclo to v0.3.0 (#687)
* Update module getsentry/sentry-go to v0.7.0 (#617)
* Update module go-errors/errors to v1.1.1 (#677)
* Update module go-testfixtures/testfixtures/v3 to v3.4.0 (#627)
* Update module go-testfixtures/testfixtures/v3 to v3.4.1 (#693)
* Update module iancoleman/strcase to v0.1.0 (#636)
* Update module iancoleman/strcase to v0.1.1 (#645)
* Update module iancoleman/strcase to v0.1.2 (#660)
* Update module imdario/mergo to v0.3.10 (#615)
* Update module imdario/mergo to v0.3.11 (#629)
* Update module labstack/echo/v4 to v4.1.17 (#646)
* Update module lib/pq to v1.7.1 (#616)
* Update module lib/pq to v1.8.0 (#618)
* Update module mattn/go-sqlite3 to v1.14.1 (#638)
* Update module mattn/go-sqlite3 to v1.14.2 (#647)
* Update module mattn/go-sqlite3 to v1.14.3 (#661)
* Update module mattn/go-sqlite3 to v1.14.4 (#670)
* Update module prometheus/client_golang to v1.8.0 (#681)
* Update module spf13/afero to v1.3.2 (#610)
* Update module spf13/afero to v1.3.3 (#623)
* Update module spf13/afero to v1.3.4 (#628)
* Update module spf13/afero to v1.3.5 (#650)
* Update module spf13/afero to v1.4.0 (#662)
* Update module spf13/afero to v1.4.1 (#673)
* Update module spf13/cobra to v1.1.0 (#679)
* Update module spf13/cobra to v1.1.1 (#690)
* Update module spf13/viper to v1.7.1 (#620)
* Update module src.techknowlogick.com/xgo to v1.1.0+1.15.0 (#630)
* Update module src.techknowlogick.com/xgo to v1 (#613)
* Update module swaggo/swag to v1.6.8 (#680)
* Update renovate token
* Update src.techknowlogick.com/xgo commit hash to 7c2e3c9 (#611)
* Update src.techknowlogick.com/xgo commit hash to 96de19c (#612)
* update theme
* Update xgo to v1.0.0+1.14.6
* Use db sessions for task-related things (#621)
* Use nfpm to build deb, rpm and apk packages (#689)
## [0.14.1] - 2020-07-07
### Fixed
@ -22,7 +619,7 @@ All releases can be found on https://code.vikunja.io/api/releases.
## [0.14.0] - 2020-07-01
### Added
### Added
* Add ability to run the docker container with configurable user and group ids
* Add better errors if the sqlite db file is not writable
@ -236,7 +833,7 @@ All releases can be found on https://code.vikunja.io/api/releases.
## [0.12] - 2020-04-04
#### Added
#### Added
* Add support for archiving lists and namespaces (#152)
* Colors for lists and namespaces (#155)
@ -260,7 +857,7 @@ All releases can be found on https://code.vikunja.io/api/releases.
## [0.11] - 2020-03-01
### Added
### Added
* Add config options for cors handling (#124)
* Add config options for task attachments (#125)
@ -328,7 +925,7 @@ All releases can be found on https://code.vikunja.io/api/releases.
## [0.9] - 2019-11-24
### Added
### Added
* Task Attachments (#104)
* Task Relations (#103)
@ -341,7 +938,8 @@ All releases can be found on https://code.vikunja.io/api/releases.
### Fixed
* Fix default logging settings (#107)
* Fixed a bug where adding assignees or reminders via an update would re-create them and not respect already inserted ones, leaving a lot of garbage
* Fixed a bug where adding assignees or reminders via an update would re-create them and not respect already inserted
ones, leaving a lot of garbage
* Fixed a bug where deleting an attachment would cause a nil panic
* Fixed building docs theme
* Fixed error when setting max file size on 32-Bit systems
@ -354,7 +952,7 @@ All releases can be found on https://code.vikunja.io/api/releases.
* Fixed removing reminders
* Small link share fixes (#96)
### Changed
### Changed
* Improve pagination (#105)
* Moved `teams_{namespace|list}_*` to `{namespace|list}_teams_*` for better consistency (#101)
@ -475,7 +1073,8 @@ All releases can be found on https://code.vikunja.io/api/releases.
* Updated libraries
* Updated drone to version 1
* Releases are now signed with our pgp key (more info about this on [the download page](https://vikunja.io/en/download/)).
* Releases are now signed with our pgp key (more info about this
on [the download page](https://vikunja.io/en/download/)).
## [0.5] - 2018-12-02
@ -505,7 +1104,7 @@ All releases can be found on https://code.vikunja.io/api/releases.
## [0.3] - 2018-11-02
### Added
### Added
* Password reset
* Email verification when registering

View File

@ -1,7 +1,7 @@
##############
# Build stage
FROM golang:1-alpine AS build-env
FROM golang:1-alpine3.12 AS build-env
ARG VIKUNJA_VERSION
ENV TAGS "sqlite"
@ -16,7 +16,8 @@ WORKDIR ${GOPATH}/src/code.vikunja.io/api
# Checkout version if set
RUN if [ -n "${VIKUNJA_VERSION}" ]; then git checkout "${VIKUNJA_VERSION}"; fi \
&& make clean generate build
&& go install github.com/magefile/mage \
&& mage build:clean build
###################
# The actual image

143
LICENSE
View File

@ -1,5 +1,5 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
@ -7,17 +7,15 @@
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
@ -26,44 +24,34 @@ them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
@ -72,7 +60,7 @@ modification follow.
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
@ -549,35 +537,45 @@ to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
@ -635,40 +633,29 @@ the "copyright" line and a pointer to where the full notice is found.
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
GNU Affero General Public License for more details.
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

247
Makefile
View File

@ -1,247 +0,0 @@
DIST := dist
IMPORT := code.vikunja.io/api
SED_INPLACE := sed -i
ifeq ($(OS), Windows_NT)
EXECUTABLE := vikunja.exe
else
EXECUTABLE := vikunja
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SED_INPLACE := sed -i ''
endif
endif
GOFILES := $(shell find . -name "*.go" -type f ! -path "*/bindata.go")
GOFMT ?= gofmt -s
GOFLAGS := -v
EXTRA_GOFLAGS ?=
LDFLAGS := -X "code.vikunja.io/api/pkg/version.Version=$(shell git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')" -X "main.Tags=$(TAGS)"
PACKAGES ?= $(filter-out code.vikunja.io/api/pkg/integrations,$(shell go list))
SOURCES ?= $(shell find . -name "*.go" -type f)
TAGS ?=
ifeq ($(OS), Windows_NT)
EXECUTABLE := vikunja.exe
else
EXECUTABLE := vikunja
endif
ifneq ($(DRONE_TAG),)
VERSION ?= $(subst v,,$(DRONE_TAG))
else
ifneq ($(DRONE_BRANCH),)
VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
else
VERSION ?= master
endif
endif
ifeq ($(DRONE_WORKSPACE),'')
BINLOCATION := $(EXECUTABLE)
else
BINLOCATION := $(DIST)/binaries/$(EXECUTABLE)-$(VERSION)-linux-amd64
endif
ifeq ($(VERSION),master)
PKGVERSION := $(shell git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')
else
PKGVERSION := $(VERSION)
endif
.PHONY: all
all: build
.PHONY: clean
clean:
go clean ./...
rm -rf $(EXECUTABLE) $(DIST) $(BINDATA)
.PHONY: test
test:
# We run everything sequentially and not in parallel to prevent issues with real test databases
VIKUNJA_SERVICE_ROOTPATH=$(shell pwd) go test $(GOFLAGS) -p 1 -cover -coverprofile cover.out $(PACKAGES)
.PHONY: test-coverage
test-coverage: test
go tool cover -html=cover.out -o cover.html
.PHONY: integration-test
integration-test:
# We run everything sequentially and not in parallel to prevent issues with real test databases
VIKUNJA_SERVICE_ROOTPATH=$(shell pwd) go test $(GOFLAGS) -p 1 code.vikunja.io/api/pkg/integrations
.PHONY: lint
lint:
@hash golint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install $(GOFLAGS) golang.org/x/lint/golint; \
fi
for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;
.PHONY: fmt
fmt:
$(GOFMT) -w $(GOFILES)
.PHONY: fmt-check
fmt-check:
# get all go files and run go fmt on them
@diff=$$($(GOFMT) -d $(GOFILES)); \
if [ -n "$$diff" ]; then \
echo "Please run 'make fmt' and commit the result:"; \
echo "$${diff}"; \
exit 1; \
fi;
.PHONY: build
build: generate $(EXECUTABLE)
.PHONY: generate
generate:
go generate code.vikunja.io/api/pkg/static
$(EXECUTABLE): $(SOURCES)
go build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
.PHONY: compress-build
compress-build:
upx -9 $(EXECUTABLE)
.PHONY: release
release: release-dirs release-windows release-linux release-darwin release-copy release-check release-os-package release-zip
.PHONY: release-dirs
release-dirs:
mkdir -p $(DIST)/binaries $(DIST)/release $(DIST)/zip
.PHONY: release-windows
release-windows:
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install $(GOFLAGS) src.techknowlogick.com/xgo; \
fi
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out vikunja-$(VERSION) .
ifneq ($(DRONE_WORKSPACE),'')
mv /build/* $(DIST)/binaries
endif
.PHONY: release-linux
release-linux:
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install $(GOFLAGS) src.techknowlogick.com/xgo; \
fi
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'linux/*' -out vikunja-$(VERSION) .
ifneq ($(DRONE_WORKSPACE),'')
mv /build/* $(DIST)/binaries
endif
.PHONY: release-darwin
release-darwin:
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install $(GOFLAGS) src.techknowlogick.com/xgo; \
fi
xgo -dest $(DIST)/binaries -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out vikunja-$(VERSION) .
ifneq ($(DRONE_WORKSPACE),'')
mv /build/* $(DIST)/binaries
endif
# Compresses all releases made by make release-* but not mips* releases since upx can't handle these.
.PHONY: release-compress
release-compress:
$(foreach file,$(filter-out $(wildcard $(wildcard $(DIST)/binaries/$(EXECUTABLE)-*mips*)),$(wildcard $(DIST)/binaries/$(EXECUTABLE)-*)), upx -9 $(file);)
.PHONY: release-copy
release-copy:
$(foreach file,$(wildcard $(DIST)/binaries/$(EXECUTABLE)-*),cp $(file) $(DIST)/release/$(notdir $(file));)
.PHONY: release-check
release-check:
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;)
.PHONY: release-os-package
release-os-package:
$(foreach file,$(filter-out %.sha256,$(wildcard $(DIST)/release/$(EXECUTABLE)-*)),mkdir $(file)-full;mv $(file) $(file)-full/; mv $(file).sha256 $(file)-full/; cp config.yml.sample $(file)-full/config.yml; cp LICENSE $(file)-full/; )
.PHONY: release-zip
release-zip:
$(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),cd $(file); zip -r ../../zip/$(shell basename $(file)).zip *; cd ../../../; )
# Builds a deb package using fpm from a previously created binary (using make build)
.PHONY: build-deb
build-deb:
fpm -s dir -t deb --url https://vikunja.io -n vikunja -v $(PKGVERSION) --license GPLv3 --directories /opt/vikunja --after-install ./build/after-install.sh --description 'Vikunja is an open-source todo application, written in Go. It lets you create lists,tasks and share them via teams or directly between users.' -m maintainers@vikunja.io ./$(BINLOCATION)=/opt/vikunja/vikunja ./config.yml.sample=/etc/vikunja/config.yml;
.PHONY: reprepro
reprepro:
reprepro_expect debian includedeb strech ./$(EXECUTABLE)_$(PKGVERSION)_amd64.deb
.PHONY: got-swag
got-swag: do-the-swag
@diff=$$(git diff docs/swagger/swagger.json); \
if [ -n "$$diff" ]; then \
echo "Please run 'make do-the-swag' and commit the result:"; \
echo "$${diff}"; \
exit 1; \
fi;
.PHONY: do-the-swag
do-the-swag:
@hash swag > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install $(GOFLAGS) github.com/swaggo/swag/cmd/swag; \
fi
swag init -g pkg/routes/routes.go --parseDependency -o ./pkg/swagger;
# Fix the generated swagger file, currently a workaround until swaggo can properly use go mod
sed -i '/"definitions": {/a "code.vikunja.io.web.HTTPError": {"type": "object","properties": {"code": {"type": "integer"},"message": {"type": "string"}}},' pkg/swagger/docs.go;
sed -i 's/code.vikunja.io\/web.HTTPError/code.vikunja.io.web.HTTPError/g' pkg/swagger/docs.go;
sed -i 's/package\ docs/package\ swagger/g' pkg/swagger/docs.go;
sed -i 's/` + \\"`\\" + `/` + "`" + `/g' pkg/swagger/docs.go;
.PHONY: misspell-check
misspell-check:
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install $(GOFLAGS) github.com/client9/misspell/cmd/misspell; \
fi
for S in $(GOFILES); do misspell -error $$S || exit 1; done;
.PHONY: ineffassign-check
ineffassign-check:
@hash ineffassign > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install $(GOFLAGS) github.com/gordonklaus/ineffassign; \
fi
for S in $(GOFILES); do ineffassign $$S || exit 1; done;
.PHONY: gocyclo-check
gocyclo-check:
@hash gocyclo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go get -u github.com/fzipp/gocyclo; \
go install $(GOFLAGS) github.com/fzipp/gocyclo; \
fi
for S in $(GOFILES); do gocyclo -over 47 $$S || exit 1; done;
.PHONY: static-check
static-check:
@hash staticcheck > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go get -u honnef.co/go/tools; \
go install $(GOFLAGS) honnef.co/go/tools/cmd/staticcheck; \
fi
staticcheck $(PACKAGES);
.PHONY: gosec-check
gosec-check:
@hash gosec > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
echo "Please manually install gosec by running"; \
echo "curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | bash -s -- -b $GOPATH/bin v2.2.0"; \
exit 1; \
fi
gosec ./...
.PHONY: goconst-check
goconst-check:
@hash goconst > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go get -u github.com/jgautheron/goconst/cmd/goconst; \
go install $(GOFLAGS) github.com/jgautheron/goconst/cmd/goconst; \
fi;
for S in $(PACKAGES); do goconst $$S || exit 1; done;

View File

@ -1,11 +1,11 @@
<img src="https://vikunja.io/images/vikunja-logo.svg" alt="" style="display: block;width: 50%;margin: 0 auto;" width="50%"/>
[![Build Status](https://drone1.kolaente.de/api/badges/vikunja/api/status.svg)](https://drone1.kolaente.de/vikunja/api)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](LICENSE)
[![Download](https://img.shields.io/badge/download-v0.14.1-brightgreen.svg)](https://dl.vikunja.io)
[![Build Status](https://drone.kolaente.de/api/badges/vikunja/api/status.svg)](https://drone.kolaente.de/vikunja/api)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](LICENSE)
[![Download](https://img.shields.io/badge/download-v0.18.1-brightgreen.svg)](https://dl.vikunja.io)
[![Docker Pulls](https://img.shields.io/docker/pulls/vikunja/api.svg)](https://hub.docker.com/r/vikunja/api/)
[![Swagger Docs](https://img.shields.io/badge/swagger-docs-brightgreen.svg)](https://try.vikunja.io/api/v1/docs)
[![Go Report Card](https://goreportcard.com/badge/git.kolaente.de/vikunja/api)](https://goreportcard.com/report/git.kolaente.de/vikunja/api)
[![Go Report Card](https://goreportcard.com/badge/kolaente.dev/vikunja/api)](https://goreportcard.com/report/kolaente.dev/vikunja/api)
# Vikunja API
@ -13,17 +13,22 @@
# Table of contents
* [Security Reports](#security-reports)
* [Features](#features)
* [Docs](#docs)
* [Roadmap](#roadmap)
* [Contributing](#contributing)
* [License](#license)
## Security Reports
If you find any security-related issues you don't want to disclose publicly, please use [the contact information on our website](https://vikunja.io/contact/#security).
## Features
* Create TODO lists with tasks
* Reminder for tasks
* Namespaces: A "group" which bundels multiple lists
* Namespaces: A "group" which bundles multiple lists
* Share lists and namespaces with teams and users with granular permissions
* Plenty of details for tasks
@ -35,46 +40,22 @@ try it on [try.vikunja.io](https://try.vikunja.io)!
* [Installing](https://vikunja.io/docs/installing/)
* [Build from source](https://vikunja.io/docs/build-from-sources/)
* [Development setup](https://vikunja.io/docs/development/)
* [Makefile](https://vikunja.io/docs/makefile/)
* [Magefile](https://vikunja.io/docs/magefile/)
* [Testing](https://vikunja.io/docs/testing/)
All docs can be found on [the vikunja home page](https://vikunja.io/docs/).
All docs can be found on [the Vikunja home page](https://vikunja.io/docs/).
### Roadmap
> I know, it's still a long way to go. I'm currently working on a lot of "basic" features, the exiting things will come later. Don't worry, they'll come.
See [the roadmap](https://my.vikunja.cloud/share/QFyzYEmEYfSyQfTOmIRSwLUpkFjboaBqQCnaPmWd/auth) (hosted on Vikunja!) for more!
* [x] Prioritize tasks
* [x] Subtasks
* [x] Repeating tasks
* [x] Get tasks via caldav
* [x] Get all your tasks for an interval (day/month/period)
* [x] Labels for tasks
* [x] Assign users to tasks
* [x] Attachments on tasks
* [x] More sharing features
* [x] Share with individual users
* [x] Share via a world-readable link with or without password, like Nextcloud
* [x] Disable registration, making an instance "invite-only"
* [ ] SSE to notify multiple clients of updates when something was changed
* [ ] "Smart Lists" - Create lists based on filters
* [ ] IMAP-Integration - Send an email to Vikunja to create a new task
* [ ] Webhooks - Trigger other events when an action is done (like completing a task)
* [ ] Performace statistics - Get an overview and beautiful charts about what you got done this month
* [ ] Activity feeds - Get a quick overview about who did what
* [ ] Bulk-edit multiple tasks at once
* [ ] Team-efforts - Requiring a task to be marked as done by multiple members until it's done
* [ ] Global limits for namespaces/lists/tasks
See [our roadmap](https://my.vikunja.cloud/share/QFyzYEmEYfSyQfTOmIRSwLUpkFjboaBqQCnaPmWd/auth) (hosted on Vikunja!) for even more!
* [ ] [Mobile apps](https://code.vikunja.io/app) (seperate repo) *In Progress*
* [ ] [Webapp](https://code.vikunja.io/frontend) (seperate repo) *In Progress*
* [ ] [Mobile apps](https://code.vikunja.io/app) (separate repo) *In Progress*
* [ ] [Webapp](https://code.vikunja.io/frontend) (separate repo) *In Progress*
## Contributing
Fork -> Push -> Pull-Request. Also see the [dev docs](https://vikunja.io/docs/development/) for more infos.
Fork -> Push -> Pull-Request. Also see the [dev docs](https://vikunja.io/docs/development/) for more info.
## License
This project is licensed under the GPLv3 License. See the [LICENSE](LICENSE) file for the full license text.
This project is licensed under the AGPLv3 License. See the [LICENSE](LICENSE) file for the full license text.

View File

@ -1,5 +1,6 @@
#!/bin/bash
ln -s /opt/vikunja/vikunja /usr/bin/vikunja
systemctl enable vikunja.service
# Fix the config to contain proper values
NEW_SECRET=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)

View File

@ -1,8 +1,8 @@
Origin: dl.vikunja.io
Label: Vikunja
Codename: strech
Codename: buster
Architectures: amd64
Components: main
Description: The debian repo for Vikunja builds.
SignWith: yes
Pull: strech
Pull: buster

15
code-header-template.txt Normal file
View File

@ -0,0 +1,15 @@
Vikunja is a to-do list application to facilitate your life.
Copyright 2018-2021 Vikunja and contributors. All rights reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public Licensee as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public Licensee for more details.
You should have received a copy of the GNU Affero General Public Licensee
along with this program. If not, see <https://www.gnu.org/licenses/>.

View File

@ -5,6 +5,10 @@ service:
JWTSecret: "<jwt-secret>"
# The interface on which to run the webserver
interface: ":3456"
# Path to Unix socket. If set, it will be created and used instead of tcp
unixsocket:
# Permission bits for the Unix socket. Note that octal values must be prefixed by "0o", e.g. 0o660
unixsocketmode:
# The URL of the frontend, used to send password reset emails.
frontendurl: ""
# The base path on the file system where the binary and assets are.
@ -13,9 +17,6 @@ service:
rootpath: <rootpath>
# The max number of items which can be returned per page
maxitemsperpage: 50
# If set to true, enables a /metrics endpoint for prometheus to collect metrics about the system
# You'll need to use redis for this in order to enable common metrics over multiple nodes
enablemetrics: false
# Enable the caldav endpoint, see the docs for more details
enablecaldav: true
# Set the motd message, available from the /info endpoint
@ -26,7 +27,7 @@ service:
enableregistration: true
# Whether to enable task attachments or not
enabletaskattachments: true
# The time zone all timestamps are in
# The time zone all timestamps are in. Please note that time zones have to use [the official tz database names](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). UTC or GMT offsets won't work.
timezone: GMT
# Whether task comments should be enabled or not
enabletaskcomments: true
@ -34,6 +35,18 @@ service:
enabletotp: true
# If not empty, enables logging of crashes and unhandled errors in sentry.
sentrydsn: ''
# If not empty, this will enable `/test/{table}` endpoints which allow to put any content in the database.
# Used to reset the db before frontend tests. Because this is quite a dangerous feature allowing for lots of harm,
# each request made to this endpoint neefs to provide an `Authorization: <token>` header with the token from below. <br/>
# **You should never use this unless you know exactly what you're doing**
testingtoken: ''
# If enabled, vikunja will send an email to everyone who is either assigned to a task or created it when a task reminder
# is due.
enableemailreminders: true
# If true, will allow users to request the complete deletion of their account. When using external authentication methods
# it may be required to coordinate with them in order to delete the account. This setting will not affect the cli commands
# for user deletion.
enableuserdeletion: true
database:
# Database type to use. Supported types are mysql, postgres and sqlite.
@ -57,12 +70,16 @@ database:
# Secure connection mode. Only used with postgres.
# (see https://pkg.go.dev/github.com/lib/pq?tab=doc#hdr-Connection_String_Parameters)
sslmode: disable
# Enable SSL/TLS for mysql connections. Options: false, true, skip-verify, preferred
tls: false
cache:
# If cache is enabled or not
enabled: false
# Cache type. Possible values are memory or redis, you'll need to enable redis below when using redis
type: memory
# Cache type. Possible values are "keyvalue", "memory" or "redis".
# When choosing "keyvalue" this setting follows the one configured in the "keyvalue" section.
# When choosing "redis" you will need to configure the redis connection seperately.
type: keyvalue
# When using memory this defines the maximum size an element can take
maxelementsize: 1000
@ -81,7 +98,7 @@ cors:
# Note: If you want to put the frontend and the api on seperate domains or ports, you will need to enable this.
# Otherwise the frontend won't be able to make requests to the api through the browser.
enable: true
# A list of origins which may access the api.
# A list of origins which may access the api. These need to include the protocol (`http://` or `https://`) and port, if any.
origins:
- "*"
# How long (in seconds) the results of a preflight request can be cached.
@ -106,6 +123,8 @@ mailer:
queuelength: 100
# The timeout in seconds after which the current open connection to the mailserver will be closed.
queuetimeout: 30
# By default, vikunja will try to connect with starttls, use this option to force it to use ssl.
forcessl: false
log:
# A folder where all the logfiles should go.
@ -124,6 +143,10 @@ log:
http: "stdout"
# Echo has its own logging which usually is unnessecary, which is why it is disabled by default. Possible values are stdout, stderr, file or off to disable standard logging.
echo: "off"
# Whether or not to log events. Useful for debugging. Possible values are stdout, stderr, file or off to disable events logging.
events: "stdout"
# The log level for event log messages. Possible values (case-insensitive) are ERROR, INFO, DEBUG.
eventslevel: "info"
ratelimit:
# whether or not to enable the rate limit
@ -134,8 +157,10 @@ ratelimit:
period: 60
# The max number of requests a user is allowed to do in the configured time period
limit: 100
# The store where the limit counter for each user is stored. Possible values are "memory" or "redis"
store: memory
# The store where the limit counter for each user is stored.
# Possible values are "keyvalue", "memory" or "redis".
# When choosing "keyvalue" this setting follows the one configured in the "keyvalue" section.
store: keyvalue
files:
# The path where files are stored
@ -163,7 +188,7 @@ migration:
todoist:
# Wheter to enable the todoist migrator or not
enable: false
# The client id, required for making requests to the wunderlist api
# The client id, required for making requests to the todoist api
# You need to register your vikunja instance at https://developer.todoist.com/appconsole.html to get this
clientid:
# The client secret, also required for making requests to the todoist api
@ -173,13 +198,36 @@ migration:
# This is usually the frontend url where the frontend then makes a request to /migration/todoist/migrate
# with the code obtained from the todoist api.
# Note that the vikunja frontend expects this to be /migrate/todoist
redirecturl:
redirecturl: <frontend url>/migrate/todoist
trello:
# Wheter to enable the trello migrator or not
enable: false
# The client id, required for making requests to the trello api
# You need to register your vikunja instance at https://trello.com/app-key (log in before you visit that link) to get this
key:
# The url where clients are redirected after they authorized Vikunja to access their trello cards.
# This needs to match the url you entered when registering your Vikunja instance at trello.
# This is usually the frontend url where the frontend then makes a request to /migration/trello/migrate
# with the code obtained from the trello api.
# Note that the vikunja frontend expects this to end on /migrate/trello.
redirecturl: <frontend url>/migrate/trello
microsofttodo:
# Wheter to enable the microsoft todo migrator or not
enable: false
# The client id, required for making requests to the microsoft graph api
# See https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app#register-an-application
# for information about how to register your vikuinja instance.
clientid:
# The client secret, also required for making requests to the microsoft graph api
clientsecret:
# The url where clients are redirected after they authorized Vikunja to access their microsoft todo tasks.
# This needs to match the url you entered when registering your Vikunja instance at microsoft.
# This is usually the frontend url where the frontend then makes a request to /migration/microsoft-todo/migrate
# with the code obtained from the microsoft graph api.
# Note that the vikunja frontend expects this to be /migrate/microsoft-todo
redirecturl: <frontend url>/migrate/microsoft-todo
avatar:
# Switch between avatar providers. Possible values are gravatar and default.
# gravatar will fetch the avatar based on the user email.
# default will return a default avatar for every request.
provider: gravatar
# When using gravatar, this is the duration in seconds until a cached gravatar user avatar expires
gravatarexpiration: 3600
@ -201,3 +249,55 @@ backgrounds:
# It will only show in the UI if your application has been approved for Enterprise usage, therefore if
# youre in Demo mode, you can also find the ID in the URL at the end: https://unsplash.com/oauth/applications/:application_id
applicationid:
# Legal urls
# Will be shown in the frontend if configured here
legal:
imprinturl:
privacyurl:
# Key Value Storage settings
# The Key Value Storage is used for different kinds of things like metrics and a few cache systems.
keyvalue:
# The type of the storage backend. Can be either "memory" or "redis". If "redis" is chosen it needs to be configured seperately.
type: "memory"
auth:
# Local authentication will let users log in and register (if enabled) through the db.
# This is the default auth mechanism and does not require any additional configuration.
local:
# Enable or disable local authentication
enabled: true
# OpenID configuration will allow users to authenticate through a third-party OpenID Connect compatible provider.<br/>
# The provider needs to support the `openid`, `profile` and `email` scopes.<br/>
# **Note:** Some openid providers (like gitlab) only make the email of the user available through openid claims if they have set it to be publicly visible.
# If the email is not public in those cases, authenticating will fail.
# **Note 2:** The frontend expects to be redirected after authentication by the third party
# to <frontend-url>/auth/openid/<auth key>. Please make sure to configure the redirect url with your third party
# auth service accordingy if you're using the default vikunja frontend.
# Take a look at the [default config file](https://kolaente.dev/vikunja/api/src/branch/main/config.yml.sample) for more information about how to configure openid authentication.
openid:
# Enable or disable OpenID Connect authentication
enabled: false
# The url to redirect clients to. Defaults to the configured frontend url. If you're using Vikunja with the official
# frontend, you don't need to change this value.
redirecturl: <frontend url>
# A list of enabled providers
providers:
# The name of the provider as it will appear in the frontend.
- name:
# The auth url to send users to if they want to authenticate using OpenID Connect.
authurl:
# The client ID used to authenticate Vikunja at the OpenID Connect provider.
clientid:
# The client secret used to authenticate Vikunja at the OpenID Connect provider.
clientsecret:
# Prometheus metrics endpoint
metrics:
# If set to true, enables a /metrics endpoint for prometheus to collect metrics about Vikunja.
enabled: false
# If set to a non-empty value the /metrics endpoint will require this as a username via basic auth in combination with the password below.
username:
# If set to a non-empty value the /metrics endpoint will require this as a password via basic auth in combination with the username below.
password:

View File

@ -0,0 +1,17 @@
image: vikunja/api:unstable
manifests:
-
image: vikunja/api:unstable-linux-amd64
platform:
architecture: amd64
os: linux
-
image: vikunja/api:unstable-linux-arm64
platform:
architecture: arm64
os: linux
-
image: vikunja/api:unstable-linux-arm
platform:
architecture: arm
os: linux

View File

@ -11,6 +11,11 @@ manifests:
platform:
architecture: amd64
os: linux
-
image: vikunja/api:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64
platform:
architecture: arm64
os: linux
-
image: vikunja/api:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm
platform:

View File

@ -20,16 +20,21 @@ params:
plausibleDomain: vikunja.io
plausibleURL: https://analytics.kolaente.de
markup:
goldmark:
renderer:
unsafe: true
menu:
page:
- name: Home
url: https://vikunja.io/en/
weight: 10
- name: Features
url: https://vikunja.io/en/features
url: https://vikunja.io/features
weight: 20
- name: Download
url: https://vikunja.io/en/download
url: https://vikunja.io/download
weight: 30
- name: Docs
url: https://vikunja.io/docs
@ -40,3 +45,6 @@ menu:
- name: Community
url: https://community.vikunja.io/
weight: 60
- name: Get it Hosted
url: https://vikunja.cloud/?utm_source=io&utm_medium=io&utm_campaign=menu
weight: 70

View File

@ -17,9 +17,9 @@ To learn more about the what, why and how, take a look at [the features page](ht
## Start
A good starting point if you want to install and host Vikunja on your server are [the install documentation](installing)
and [available configuration options](config-options).
A good starting point if you want to install and host Vikunja on your server are [the install documentation]({{< ref "./setup/install.md">}})
and [available configuration options]({{< ref "./setup/config.md">}}).
## Developing
If you want to start contributing to Vikunja, take a look at [the development docs](development).
If you want to start contributing to Vikunja, take a look at [the development docs]({{< ref "./development/development.md">}}).

View File

@ -1,6 +1,6 @@
---
date: "2019-03-31:00:00+01:00"
title: "Adding new cli commands"
title: "Cli Commands"
draft: false
type: "doc"
menu:

View File

@ -0,0 +1,41 @@
---
date: "2019-02-12:00:00+02:00"
title: "Configuration Options"
draft: false
type: "doc"
menu:
sidebar:
parent: "development"
---
# Configuration options
All configuration variables are declared in the `config` package.
It uses [viper](https://github.com/spf13/viper) under the hood to handle setting defaults and parsing config files.
Viper handles parsing all different configuration sources.
## Adding new config options
To make handling configuration parameters a bit easier, we introduced a `Key` string type in the `config` package which
you can call directly to get a config value.
To add a new config option, you should add a new key const to `pkg/config/config.go` and possibly a default value.
Default values should always enable the feature to work or turn it off completely if it always needs
additional configuration.
Make sure to also add the new config option to the default config file (`config.yml.sample` at the root of the repository)
with an explanatory comment to make sure it is well documented.
Then run `mage generate-docs` to generate the configuration docs from the sample file.
## Getting Configuration Values
To retreive a configured value call the key with a getter for the type you need.
For example:
{{< highlight golang >}}
if config.CacheEnabled.GetBool() {
// Do something with enabled caches
}
{{< /highlight >}}
Take a look at the methods declared on the type to see what's available.

View File

@ -0,0 +1,35 @@
---
title: "Cron Tasks"
date: 2021-07-13T23:21:52+02:00
draft: false
menu:
sidebar:
parent: "development"
---
# How to add a cron job task
Cron jobs are tasks which run on a predefined schedule.
Vikunja uses these through a light wrapper package around the excellent [github.com/robfig/cron](https://github.com/robfig/cron) package.
The package exposes a `cron.Schedule` method with two arguments: The first one to define the schedule when the cron task
should run, and the second one with the actual function to run at the schedule.
You would then create a new function to register your the actual cron task in your package.
A basic function to register a cron task looks like this:
{{< highlight golang >}}
func RegisterSomeCronTask() {
err := cron.Schedule("0 * * * *", func() {
// Do something every hour
}
}
{{< /highlight >}}
Call the register method in the `FullInit()` method of the `init` package to actually register it.
## Schedule Syntax
The cron syntax uses the same on you may know from unix systems.
It is described in detail [here](https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format).

View File

@ -0,0 +1,40 @@
---
date: "2019-02-12:00:00+02:00"
title: "Database"
draft: false
type: "doc"
menu:
sidebar:
parent: "development"
---
# Database
Vikunja uses [xorm](http://xorm.io/) as an abstraction layer to handle the database connection.
Please refer to [their](http://xorm.io/docs/) documentation on how to exactly use it.
{{< table_of_contents >}}
## Using the database
When using the common web handlers, you get an `xorm.Session` to do database manipulations.
In other packages, use the `db.NewSession()` method to get a new database session.
## Adding new database tables
To add a new table to the database, create the struct and [add a migration for it]({{< ref "db-migrations.md" >}}).
To learn more about how to configure your struct to create "good" tables, refer to [the xorm documentaion](http://xorm.io/docs/).
In most cases you will also need to implement the `TableName() string` method on the new struct to make sure the table
name matches the rest of the tables - plural.
## Adding data to test fixtures
Adding data for test fixtures can be done via `yaml` files in `pkg/models/fixtures`.
The name of the yaml file should match the table name in the database.
Adding values to it is done via array definition inside it.
**Note**: Table and column names need to be in snake_case as that's what is used internally in the database
and for mapping values from the database to xorm so your structs can use it.

View File

@ -1,6 +1,6 @@
---
date: "2019-03-29:00:00+02:00"
title: "Database migrations"
title: "Database Migrations"
draft: false
type: "doc"
menu:
@ -16,6 +16,8 @@ Additionally, they can also be run directly by using the `migrate` command.
We use [xormigrate](https://github.com/techknowlogick/xormigrate) to handle migrations,
which is based on gormigrate.
{{< table_of_contents >}}
## Add a new migration
All migrations are stored in `pkg/migrations` and files should have the same name as their id.
@ -35,6 +37,11 @@ All migrations are sorted before being executed, since `init()` does not guarant
When you're adding a new struct, you also need to add it to the `models.GetTables()` function
to ensure it will be created on new installations.
### Generating a new migration stub
You can easily generate a pre-filled migration stub by running `mage dev:make-migration`.
It will ask you for a table name and generate an empty migration similar to the example shown below.
### Example
{{< highlight golang >}}

View File

@ -12,54 +12,11 @@ menu:
# Development
We use go modules to vendor libraries for Vikunja, so you'll need at least go `1.11` to use these.
If you don't intend to add new dependencies, go `1.9` and above should be fine.
We use go modules to manage third-party libraries for Vikunja, so you'll need at least go `1.11` to use these.
To contribute to Vikunja, fork the project and work on the master branch.
To contribute to Vikunja, fork the project and work on the main branch.
A lot of developing tasks are automated using a Makefile, so make sure to [take a look at it]({{< ref "make.md">}}).
A lot of developing tasks are automated using a Magefile, so make sure to [take a look at it]({{< ref "mage.md">}}).
## Libraries
We keep all libraries used for Vikunja around in the `vendor/` folder to still be able to build the project even if
some maintainers take their libraries down like [it happened in the past](https://github.com/jteeuwen/go-bindata/issues/5).
## Tests
See [testing]({{< ref "test.md">}}).
#### Development using go modules
If you're able to use go modules, you can clone the project wherever you want to and work from there.
#### Development-setup without go modules
Some internal packages are referenced using their respective package URL. This can become problematic.
To “trick” the Go tool into thinking this is a clone from the official repository, download the source code
into `$GOPATH/code.vikunja.io/api`. Fork the Vikunja repository, it should then be possible to switch the source directory on the command line.
{{< highlight bash >}}
cd $GOPATH/src/code.vikunja.io/api
{{< /highlight >}}
To be able to create pull requests, the forked repository should be added as a remote to the Vikunja sources, otherwise changes cant be pushed.
{{< highlight bash >}}
git remote rename origin upstream
git remote add origin git@git.kolaente.de:<USERNAME>/api.git
git fetch --all --prune
{{< /highlight >}}
This should provide a working development environment for Vikunja. Take a look at the Makefile to get an overview about
the available tasks. The most common tasks should be `make test` which will start our test environment and `make build`
which will build a vikunja binary into the working directory. Writing test cases is not mandatory to contribute, but it
is highly encouraged and helps developers sleep at night.
Thats it! You are ready to hack on Vikunja. Test changes, push them to the repository, and open a pull request.
## Static assets
Each Vikunja release contains all static assets directly compiled into the binary.
To prevent this during development, use the `dev` tag when developing.
See the [make docs](make.md#statically-compile-all-templates-into-the-binary) about how to compile with static assets for a release.
Make sure to check the other doc articles for specific development tasks like [testing]({{< ref "test.md">}}),
[database migrations]({{< ref "db-migrations.md" >}}) and the [project structure]({{< ref "structure.md" >}}).

View File

@ -5,7 +5,7 @@ draft: false
type: "doc"
menu:
sidebar:
parent: "practical instructions"
parent: "development"
---
# Custom Errors

View File

@ -0,0 +1,211 @@
---
date: 2018-10-13T19:26:34+02:00
title: "Events and Listeners"
draft: false
menu:
sidebar:
parent: "development"
---
# Events and Listeners
Vikunja provides a simple observer pattern mechanism through events and listeners.
The basic principle of events is always the same: Something happens (=An event is fired) and something reacts to it (=A listener is called).
Vikunja supports this principle through the `events` package.
It is built upon the excellent [watermill](https://watermill.io) library.
Currently, it only supports dispatching events through Go Channels which makes it configuration-less.
More methods of dispatching events (like kafka or rabbitmq) are available in watermill and could be enabled with a PR.
This document explains how events and listeners work in Vikunja, how to use them and how to create new ones.
{{< table_of_contents >}}
## Events
### Definition
Each event has to implement this interface:
{{< highlight golang >}}
type Event interface {
Name() string
}
{{< /highlight >}}
An event can contain whatever data you need.
When an event is dispatched, all of the data it contains will be marshaled into json for dispatching.
You then get the event with all its data back in the listener, see below.
#### Naming Convention
Event names should roughly have the entity they're dealing with on the left and the action on the right of the name, separated by `.`.
There's no limit to how "deep" or specifig an event name can be.
The name should have the most general concept it's describing at the left, getting more specific on the right of it.
#### Location
All events for a package should be declared in the `events.go` file of that package.
### Creating a New Event
The easiest way to create a new event is to generate it with mage:
```
mage dev:make-event <event-name> <package>
```
The function takes the name of the event as the first argument and the package where the event should be created as the second argument.
Events will be appended to the `pkg/<module>/events.go` file.
Both parameters are mandatory.
The event type name is automatically camel-cased and gets the `Event` suffix if the provided name does not already have one.
The event name is derived from the type name and stripped of the `.event` suffix.
The generated event will look something like the example below.
### Dispatching events
To dispatch an event, simply call the `events.Dispatch` method and pass in the event as parameter.
### Example
The `TaskCreatedEvent` is declared in the `pkg/models/events.go` file as follows:
{{< highlight golang >}}
// TaskCreatedEvent represents an event where a task has been created
type TaskCreatedEvent struct {
Task *Task
Doer web.Auth
}
// Name defines the name for TaskCreatedEvent
func (t *TaskCreatedEvent) Name() string {
return "task.created"
}
{{< /highlight >}}
It is dispatched in the `createTask` function of the `models` package:
{{< highlight golang >}}
func createTask(s *xorm.Session, t *Task, a web.Auth, updateAssignees bool) (err error) {
// ...
err = events.Dispatch(&TaskCreatedEvent{
Task: t,
Doer: a,
})
// ...
}
{{< /highlight >}}
As you can see, the curent task and doer are injected into it.
### Special Events
#### `BootedEvent`
Once Vikunja is fully initialized, right before the api web server is started, this event is fired.
## Listeners
A listener is a piece of code that gets executed asynchronously when an event is dispatched.
A single event can have multiple listeners who are independent of each other.
### Definition
All listeners must implement this interface:
{{< highlight golang >}}
// Listener represents something that listens to events
type Listener interface {
Handle(msg *message.Message) error
Name() string
}
{{< /highlight >}}
The `Handle` method is executed when the event this listener listens on is dispatched.
* As the single parameter, it gets the payload of the event, which is the event struct when it was dispatched decoded as json object and passed as a slice of bytes.
To use it you'll need to unmarshal it. Unfortunately there's no way to pass an already populated event object to the function because we would not know what type it has when parsing it.
* If the handler returns an error, the listener is retried 5 times, with an exponentional back-off period in between retries.
If it still fails after the fifth retry, the event is nack'd and it's up to the event dispatcher to resend it.
You can learn more about this mechanism in the [watermill documentation](https://watermill.io/docs/middlewares/#retry).
The `Name` method needs to return a unique listener name for this listener.
It should follow the same convention as event names, see above.
### Creating a New Listener
The easiest way to create a new listener for an event is with mage:
```
mage dev:make-listener <listener-name> <event-name> <package>
```
This will create a new listener type in the `pkg/<package>/listners.go` file and implement the `Handle` and `Name` methods.
It will also pre-generate some boilerplate code to unmarshal the event from the payload.
Furthermore, it will register the listener for its event in the `RegisterListeners()` method of the same file.
This function is called at startup and has to contain all events you want to listen for.
### Listening for Events
To listen for an event, you need to register the listener for the event it should be called for.
This usually happens in the `RegisterListeners()` method in `pkg/<package>/listners.go` which is called at start up.
The listener will never be executed if it hasn't been registered.
See the example below.
### Example
{{< highlight golang >}}
// RegisterListeners registers all event listeners
func RegisterListeners() {
events.RegisterListener((&ListCreatedEvent{}).Name(), &IncreaseListCounter{})
}
// IncreaseTaskCounter represents a listener
type IncreaseTaskCounter struct {}
// Name defines the name for the IncreaseTaskCounter listener
func (s *IncreaseTaskCounter) Name() string {
return "task.counter.increase"
}
// Hanlde is executed when the event IncreaseTaskCounter listens on is fired
func (s *IncreaseTaskCounter) Handle(payload message.Payload) (err error) {
return keyvalue.IncrBy(metrics.TaskCountKey, 1)
}
{{< /highlight >}}
## Testing
When testing, you should call the `events.Fake()` method in the `TestMain` function of the package you want to test.
This prevents any events from being fired and lets you assert an event has been dispatched like so:
{{< highlight golang >}}
events.AssertDispatched(t, &TaskCreatedEvent{})
{{< /highlight >}}
### Testing a listener
You can call an event listener manually with the `events.TestListener` method like so:
{{< highlight golang >}}
ev := &TaskCommentCreatedEvent{
Task: &task,
Doer: u,
Comment: tc,
}
events.TestListener(t, ev, &SendTaskCommentNotification{})
{{< /highlight >}}
This will call the listener's `Handle` method and assert it did not return an error when calling.

View File

@ -1,11 +1,11 @@
---
date: "2019-02-12:00:00+02:00"
title: "Add a new api endpoint"
title: "New API Endpoints"
draft: false
type: "doc"
menu:
sidebar:
parent: "practical instructions"
parent: "development"
---
# Add a new api endpoint/feature

View File

@ -0,0 +1,192 @@
---
date: "2019-02-12:00:00+02:00"
title: "Magefile"
draft: false
type: "doc"
menu:
sidebar:
parent: "development"
---
# Mage
Vikunja uses [Mage](https://magefile.org/) to script common development tasks and even releasing.
Mage is a pure go solution which allows for greater flexibility and things like better paralelization.
This document explains what taks are available and what they do.
{{< table_of_contents >}}
## Installation
To use mage, you'll need to install the mage cli.
To install it, run the following command:
```
go install github.com/magefile/mage
```
## Categories
There are multiple categories of subcommands in the magefile:
* `build`: Contains commands to build a single binary
* `check`: Contains commands to statically check the source code
* `release`: Contains commands to release Vikunja with everything that's required
* `test`: Contains commands to run all kinds of tests
* `dev`: Contains commands to run development tasks
* `misc`: Commands which do not belong in either of the other categories
## CI
These tasks are automatically run in our CI every time someone pushes to main or you update a pull request:
* `mage check:lint`
* `mage check:fmt`
* `mage check:ineffassign`
* `mage check:misspell`
* `mage check:goconst`
* `mage build:generate`
* `mage build:build`
## Build
### Build Vikunja
{{< highlight bash >}}
mage build:build
{{< /highlight >}}
or
{{< highlight bash >}}
mage build
{{< /highlight >}}
Builds a `vikunja`-binary in the root directory of the repo for the platform it is run on.
### clean
{{< highlight bash >}}
mage build:clean
{{< /highlight >}}
Cleans all build and executable files
## Check
All check sub-commands exit with a status code of 1 if the check fails.
Various code-checks are available:
* `mage check:all`: Runs fmt-check, lint, got-swag, misspell-check, ineffasign-check, gocyclo-check, static-check, gosec-check, goconst-check all in parallel
* `mage check:fmt`: Checks if the code is properly formatted with go fmt
* `mage check:go-sec`: Checks the source code for potential security issues by scanning the Go AST using the [gosec tool](https://github.com/securego/gosec)
* `mage check:goconst`: Checks for repeated strings that could be replaced by a constant using [goconst](https://github.com/jgautheron/goconst/)
* `mage check:gocyclo`: Checks for the cyclomatic complexity of the source code using [gocyclo](https://github.com/fzipp/gocyclo)
* `mage check:got-swag`: Checks if the swagger docs need to be re-generated from the code annotations
* `mage check:ineffassign`: Checks the source code for ineffectual assigns using [ineffassign](https://github.com/gordonklaus/ineffassign)
* `mage check:lint`: Runs golint on all packages
* `mage check:misspell`: Checks the source code for misspellings
* `mage check:static`: Statically analyzes the source code about a range of different problems using [staticcheck](https://staticcheck.io/docs/)
## Release
### Build Releases
{{< highlight bash >}}
mage release
{{< /highlight >}}
Builds binaries for all platforms and zips them with a copy of the `templates/` folder.
All built zip files are stored into `dist/zips/`. Binaries are stored in `dist/binaries/`,
binaries bundled with `templates` are stored in `dist/releases/`.
All cross-platform binaries built using this series of commands are built with the help of
[xgo](https://github.com/techknowlogick/xgo). The mage command will automatically install the
binary to be able to use it.
`mage release:release` is a shortcut to execute `mage release:dirs release:windows release:linux release:darwin release:copy release:check release:os-package release:zip`.
* `mage release:dirs` creates all directories needed
* `mage release:windows`/`release:linux`/`release:darwin` execute xgo to build for their respective platforms
* `mage release:copy` bundles binaries with a copy of the `LICENSE` and sample config files to then be zipped
* `mage release:check` creates sha256 checksums for each binary which will be included in the zip file
* `mage release:os-package` bundles a binary with the `sha256` checksum file, a sample `config.yml` and a copy of the license in a folder for each architecture
* `mage release:compress` compresses all build binaries with `upx` to save space
* `mage release:zip` paclages a zip file for the files created by `release:os-package`
### Build os packages
{{< highlight bash >}}
mage release:packages
{{< /highlight >}}
Will build `.deb`, `.rpm` and `.apk` packages to `dist/os-packages`.
### Make a debian repo
{{< highlight bash >}}
mage release:reprepro
{{< /highlight >}}
Takes an already built debian package and creates a debian repo structure around it.
Used to be run inside a [docker container](https://git.kolaente.de/konrad/reprepro-docker) in the CI process when releasing.
## Test
### unit
{{< highlight bash >}}
mage test:unit
{{< /highlight >}}
Runs all tests except integration tests.
### coverage
{{< highlight bash >}}
mage test:coverage
{{< /highlight >}}
Runs all tests except integration tests and generates a `coverage.html` file to inspect the code coverage.
### integration
{{< highlight bash >}}
mage test:integration
{{< /highlight >}}
Runs all integration tests.
## Dev
### Create a new migration
{{< highlight bash >}}
mage dev:create-migration
{{< /highlight >}}
Creates a new migration with the current date.
Will ask for the name of the struct you want to create a migration for.
See also [migration docs]({{< ref "mage.md" >}}).
## Misc
### Format the code
{{< highlight bash >}}
mage fmt
{{< /highlight >}}
Formats all source code using `go fmt`.
### Generate swagger definitions from code comments
{{< highlight bash >}}
mage do-the-swag
{{< /highlight >}}
Generates swagger definitions from the comment annotations in the code.

View File

@ -1,151 +0,0 @@
---
date: "2019-02-12:00:00+02:00"
title: "Makefile"
draft: false
type: "doc"
menu:
sidebar:
parent: "development"
---
# Makefile
We scripted a lot of tasks used mostly for developing into the makefile. This documents explains what
taks are available and what they do.
## CI
These tasks are automatically run in our CI every time someone pushes to master or you update a pull request:
* `make lint`
* `make fmt-check`
* `make ineffassign-check`
* `make misspell-check`
* `make goconst-check`
* `make generate`
* `make build`
### clean
{{< highlight bash >}}
make clean
{{< /highlight >}}
Clears all builds and binaries.
### test
{{< highlight bash >}}
make test
{{< /highlight >}}
Runs all tests in Vikunja.
### Format the code
{{< highlight bash >}}
make fmt
{{< /highlight >}}
Formats all source code using `go fmt`.
#### Check formatting
{{< highlight bash >}}
make fmt-check
{{< /highlight >}}
Checks if the code needs to be formatted. Fails if it does.
### Build Vikunja
{{< highlight bash >}}
make build
{{< /highlight >}}
Builds a `vikunja`-binary in the root directory of the repo for the platform it is run on.
### Statically compile all templates into the binary
{{< highlight bash >}}
make generate
{{< /highlight >}}
This generates static code with all templates, meaning no template need to be referenced at runtime.
### Compress the built binary
{{< highlight bash >}}
make compress-build
{{< /highlight >}}
Go binaries are very big.
To make the vikunja binary smaller, we can compress it using [upx](https://upx.github.io/).
### Build Releases
{{< highlight bash >}}
make release
{{< /highlight >}}
Builds binaries for all platforms and zips them with a copy of the `templates/` folder.
All built zip files are stored into `dist/zips/`. Binaries are stored in `dist/binaries/`,
binaries bundled with `templates` are stored in `dist/releases/`.
All cross-platform binaries built using this series of commands are built with the help of
[xgo](https://github.com/techknowlogick/xgo). The make command will automatically install the
binary to be able to use it.
`make release` is actually just a shortcut to execute `make release-dirs release-windows release-linux release-darwin release-copy release-check release-os-package release-zip`.
* `release-dirs` creates all directories needed
* `release-windows`/`release-linux`/`release-darwin` execute xgo to build for their respective platforms
* `release-copy` bundles binaries with a copy of `templates/` to then be zipped
* `release-check` creates sha256 checksums for each binary which will be included in the zip file
* `release-os-package` bundles a binary with a copy of the `templates/` folder, the `sha256` checksum file, a sample `config.yml` and a copy of the license in a folder for each architecture
* `release-compress` compresses all build binaries, see `compress-build`
* `release-zip` makes a zip file for the files created by `release-os-package`
### Build debian packages
{{< highlight bash >}}
make build-deb
{{< /highlight >}}
Will build a `.deb` package into the current folder. You need to have [fpm](https://fpm.readthedocs.io/en/latest/intro.html) installed to be able to do this.
#### Make a debian repo
{{< highlight bash >}}
make reprepro
{{< /highlight >}}
Takes an already built debian package and creates a debian repo structure around it.
Used to be run inside a [docker container](https://git.kolaente.de/konrad/reprepro-docker) in the CI process when releasing.
### Generate swagger definitions from code comments
{{< highlight bash >}}
make do-the-swag
{{< /highlight >}}
Generates swagger definitions from the comments in the code.
#### Check if swagger generation is needed
{{< highlight bash >}}
make got-swag
{{< /highlight >}}
This command is currently more an experiment, use it with caution.
It may bring up wrong results.
### Code-Checks
* `misspell-check`: Checks for commonly misspelled words
* `ineffassign-check`: Checks for ineffectual assignments in the code using [ineffassign](https://github.com/gordonklaus/ineffassign).
* `gocyclo-check`: Calculates cyclomatic complexities of functions using [gocyclo](https://github.com/fzipp/gocyclo).
* `static-check`: Analyzes the code for bugs, improvements and more using [staticcheck](https://staticcheck.io/docs/).
* `gosec-check`: Inspects source code for security problems by scanning the Go AST using the [gosec tool](https://github.com/securego/gosec).
* `goconst-check`: Finds repeated strings that could be replaced by a constant using [goconst](https://github.com/jgautheron/goconst/).

View File

@ -5,7 +5,7 @@ draft: false
type: "doc"
menu:
sidebar:
parent: "practical instructions"
parent: "development"
---
# Metrics
@ -15,7 +15,9 @@ Metrics work by exposing a `/metrics` endpoint which can then be accessed by pro
To keep the load on the database minimal, metrics are stored and updated in redis.
The `metrics` package provides several functions to create and update metrics.
## New metrics
{{< table_of_contents >}}
## Exposing New Metrics
First, define a `const` with the metric key in redis. This is done in `pkg/metrics/metrics.go`.
@ -41,6 +43,6 @@ Because metrics are stored in redis, you are responsible to increase or decrease
To do this, use `metrics.UpdateCount(value, key)` where `value` is the amount you want to cange it (you can pass
negative values to decrease it) and `key` it the redis key used to define the metric.
# Using it
## Using it
A Prometheus config with a Grafana template is available at [our git repo](https://git.kolaente.de/vikunja/monitoring).

View File

@ -14,20 +14,35 @@ It is possible to migrate data from other to-do services to Vikunja.
To make this easier, we have put together a few helpers which are documented on this page.
In general, each migrator implements a migrator interface which is then called from a client.
The interface makes it possible to use helper methods which handle http an focus only on the implementation of the migrator itself.
The interface makes it possible to use helper methods which handle http and focus only on the implementation of the migrator itself.
### Structure
There are two ways of migrating data from another service:
1. Through the auth-based flow where the user gives you access to their data at the third-party service through an
oauth flow. You can then call the service's api on behalf of your user to get all the data.
The Todoist, Trello and Microsoft To-Do Migrators use this pattern.
2. A file migration where the user uploads a file obtained from some third-party service. In your migrator, you need
to parse the file and create the lists, tasks etc.
The Vikunja File Import uses this pattern.
To differentiate the two, there are two different interfaces you must implement.
{{< table_of_contents >}}
## Structure
All migrator implementations live in their own package in `pkg/modules/migration/<name-of-the-service>`.
When creating a new migrator, you should place all related code inside that module.
### Migrator interface
## Migrator Interface
The migrator interface is defined as follows:
```go
// Migrator is the basic migrator interface which is shared among all migrators
type Migrator interface {
// Name holds the name of the migration.
// This is used to show the name to users and to keep track of users who already migrated.
Name() string
// Migrate is the interface used to migrate a user's tasks from another platform to vikunja.
// The user object is the user who's tasks will be migrated.
Migrate(user *models.User) error
@ -35,13 +50,24 @@ type Migrator interface {
// The use case for this are Oauth flows, where the server token should remain hidden and not
// known to the frontend.
AuthURL() string
// Name holds the name of the migration.
// This is used to show the name to users and to keep track of users who already migrated.
Name() string
}
```
### Defining http routes
## File Migrator Interface
```go
// FileMigrator handles importing Vikunja data from a file. The implementation of it determines the format.
type FileMigrator interface {
// Name holds the name of the migration.
// This is used to show the name to users and to keep track of users who already migrated.
Name() string
// Migrate is the interface used to migrate a user's tasks, list and other things from a file to vikunja.
// The user object is the user who's tasks will be migrated.
Migrate(user *user.User, file io.ReaderAt, size int64) error
}
```
## Defining http routes
Once your migrator implements the migration interface, it becomes possible to use the helper http handlers.
Their usage is very similar to the [general web handler](https://kolaente.dev/vikunja/web#user-content-defining-routes-using-the-standard-web-handler):
@ -52,23 +78,35 @@ authUrl, Status and Migrate methods.
```go
// This is an example for the Wunderlist migrator
if config.MigrationWunderlistEnable.GetBool() {
wunderlistMigrationHandler := &migrationHandler.MigrationWeb{
wunderlistMigrationHandler := &migrationHandler.MigrationWeb{
MigrationStruct: func() migration.Migrator {
return &wunderlist.Migration{}
},
}
wunderlistMigrationHandler.RegisterRoutes(m)
wunderlistMigrationHandler.RegisterRoutes(m)
}
```
You should also document the routes with [swagger annotations]({{< ref "../practical-instructions/swagger-docs.md" >}}).
And for the file migrator:
### Insertion helper method
```go
vikunjaFileMigrationHandler := &migrationHandler.FileMigratorWeb{
MigrationStruct: func() migration.FileMigrator {
return &vikunja_file.FileMigrator{}
},
}
vikunjaFileMigrationHandler.RegisterRoutes(m)
```
You should also document the routes with [swagger annotations]({{< ref "swagger-docs.md" >}}).
## Insertion helper method
There is a method available in the `migration` package which takes a fully nested Vikunja structure and creates it with all relations.
This means you start by adding a namespace, then add lists inside of that namespace, then tasks in the lists and so on.
The root structure must be present as `[]*models.NamespaceWithLists`.
The root structure must be present as `[]*models.NamespaceWithListsAndTasks`. It allows to represent all of Vikunja's
hierachie as a single data structure.
Then call the method like so:
@ -81,16 +119,18 @@ if err != nil {
err = migration.InsertFromStructure(fullVikunjaHierachie, user)
```
### Configuration
## Configuration
You should add at least an option to enable or disable the migration.
If your migrator is an oauth-based one, you should add at least an option to enable or disable it.
Chances are, you'll need some more options for things like client ID and secret
(if the other service uses oAuth as an authentication flow).
The easiest way to implement an on/off switch is to check whether your migration service is enabled or not when
registering the routes, and then simply don't registering the routes in the case it is disabled.
registering the routes, and then simply don't registering the routes in case it is disabled.
#### Making the migrator public in `/info`
File based migrators can always be enabled.
### Making the migrator public in `/info`
You should make your migrator available in the `/info` endpoint so that frontends can display options to enable them or not.
To do this, add an entry to `pkg/routes/api/v1/info.go`.
To do this, add an entry to the `AvailableMigrators` field in `pkg/routes/api/v1/info.go`.

View File

@ -0,0 +1,120 @@
---
date: 2021-02-07T19:26:34+02:00
title: "Notifications"
toc: true
draft: false
menu:
sidebar:
parent: "development"
---
# Notifications
Vikunjs provides a simple abstraction to send notifications per mail and in the database.
{{< table_of_contents >}}
## Definition
Each notification has to implement this interface:
{{< highlight golang >}}
type Notification interface {
ToMail() *Mail
ToDB() interface{}
Name() string
}
{{< /highlight >}}
Both functions return the formatted messages for mail and database.
A notification will only be sent or recorded for those of the two methods which don't return `nil`.
For example, if your notification should not be recorded in the database but only sent out per mail, it is enough to let the `ToDB` function return `nil`.
### Mail notifications
A list of chainable functions is available to compose a mail:
{{< highlight golang >}}
mail := NewMail().
// The optional sender of the mail message.
From("test@example.com").
// The optional receipient of the mail message. Uses the mail address of the notifiable if omitted.
To("test@otherdomain.com").
// The subject of the mail to send.
Subject("Testmail").
// The greeting, or "intro" line of the mail.
Greeting("Hi there,").
// A line of text
Line("This is a line of text").
// An action can contain a title and a url. It gets rendered as a big button in the mail.
// Note that you can have only one action per mail.
// All lines added before an action will appearr in the mail before the button, all lines
// added afterwards will appear after it.
Action("The Action", "https://example.com").
// Another line of text.
Line("This should be an outro line").
{{< /highlight >}}
If not provided, the `from` field of the mail contains the value configured in [`mailer.fromemail`](https://vikunja.io/docs/config-options/#fromemail).
### Database notifications
All data returned from the `ToDB()` method is serialized to json and saved into the database, along with the id of the
notifiable, the name of the notification and a time stamp.
If you don't use the database notification, the `Name()` function can return an empty string.
## Creating a new notification
The easiest way to generate a mail is by using the `mage dev:make-notification` command.
It takes the name of the notification and the package where the notification will be created.
## Notifiables
Notifiables can receive a notification.
A notifiable is defined with this interface:
{{< highlight golang >}}
type Notifiable interface {
// Should return the email address this notifiable has.
RouteForMail() string
// Should return the id of the notifiable entity
RouteForDB() int64
}
{{< /highlight >}}
The `User` type from the `user` package implements this interface.
## Sending a notification
Sending a notification is done with the `Notify` method from the `notifications` package.
It takes a notifiable and a notification as input.
For example, the email confirm notification when a new user registers is sent like this:
{{< highlight golang >}}
n := &EmailConfirmNotification{
User: update.User,
IsNew: false,
}
err = notifications.Notify(update.User, n)
return
{{< /highlight >}}
## Testing
The `mail` package provides a `Fake()` method which you should call in the `MainTest` functions of your package.
If it was called, no mails are being sent and you can instead assert they have been sent with the `AssertSent` method.
When testing, you should call the `notifications.Fake()` method in the `TestMain` function of the package you want to test.
This prevents any notifications from being sent and lets you assert a notifications has been sent like this:
{{< highlight golang >}}
notifications.AssertSent(t, &ReminderDueNotification{})
{{< /highlight >}}
## Example
Take a look at the [pkg/user/notifications.go](https://code.vikunja.io/api/src/branch/main/pkg/user/notifications.go) file for a good example.

View File

@ -1,6 +1,6 @@
---
date: "2019-02-12:00:00+02:00"
title: "Project structure"
title: "Project Structure"
draft: false
type: "doc"
menu:
@ -10,58 +10,22 @@ menu:
# Project structure
In general, this api repo has the following structure:
This document explains what each package does.
* `docker`
* `docs`
* `pkg`
* `caldav`
* `cmd`
* `config`
* `db`
* `fixtures`
* `files`
* `integration`
* `log`
* `mail`
* `metrics`
* `migration`
* `models`
* `modules`
* `migration`
* `handler`
* `wunderlist`
* `red`
* `routes`
* `api/v1`
* `static`
* `swagger`
* `user`
* `utils`
* `version`
* `REST-Tests`
* `templates`
* `vendor`
This document will explain what these mean and what you can find where.
{{< table_of_contents >}}
## Root level
The root directory is where [the config file]({{< ref "../setup/config.md">}}), [Makefile]({{< ref "make.md">}}), license, drone config,
The root directory is where [the config file]({{< ref "../setup/config.md">}}), [Magefile]({{< ref "mage.md">}}), license, drone config,
application entry point (`main.go`) and so on are located.
## docker
This directory holds additonal files needed to build and run the docker container, mainly service configuration to properly run Vikunja inside a docker
container.
## pkg
This is where most of the magic happens. Most packages with actual code are located in this folder.
### caldav
This folder holds a simple caldav implementation which is responsible for returning the caldav feature.
This folder holds a simple caldav implementation which is responsible for the caldav feature.
### cmd
@ -73,10 +37,15 @@ To learn more about how to use this cli, see [the cli usage docs]({{< ref "../us
### config
This package configures the config. It sets default values and sets up viper and tells it where to look for config files,
how to interpret which env variables for config etc.
This package configures handling of Vikunja's runtime configuration.
It sets default values and sets up viper and tells it where to look for config files, how to interpret which env variables
for config etc.
If you want to add a new config parameter, you should add default value in this package.
See also the [docs about adding a new configuration parameter]({{< ref "config.md" >}}).
### cron
See [how to add a cron task]({{< ref "cron.md" >}}).
### db
@ -100,17 +69,17 @@ This init is called in `main.go` after the config init is done.
### mail
This package handles all mail sending. To learn how to send a mail, see [sending emails]({{< ref "../practical-instructions/mail.md">}}).
This package handles all mail sending. To learn how to send a mail, see [notifications]({{< ref "notifications.md" >}}).
### metrics
This package handles all metrics which are exposed to the prometheus endpoint.
To learn how it works and how to add new metrics, take a look at [how metrics work]({{< ref "../practical-instructions/metrics.md">}}).
To learn how it works and how to add new metrics, take a look at [how metrics work]({{< ref "metrics.md">}}).
### migration
This package handles all migrations.
All migrations are stored and executed here.
All migrations are stored and executed in this package.
To learn more, take a look at the [migrations docs]({{< ref "../development/db-migrations.md">}}).
@ -121,11 +90,35 @@ When adding new features or upgrading existing ones, that most likely happens he
Because this package is pretty huge, there are several documents and how-to's about it:
* [Adding a feature]({{< ref "../practical-instructions/feature.md">}})
* [Making calls to the database]({{< ref "../practical-instructions/database.md">}})
* [Adding a feature]({{< ref "feature.md">}})
* [Making calls to the database]({{< ref "database.md">}})
### modules
Everything that can have multiple implementations (like a task migrator from a third-party task provider) lives in a
respective sub package in this package.
#### auth
Contains openid related authentication.
#### avatar
Contains all possible avatar providers a user can choose to set their avatar.
#### background
All list background providers are in sub-packages of this package.
#### dump
Handles everything related to the `dump` and `restore` commands of Vikunja.
#### keyvalue
A simple key-value store with an implementation for memory and redis.
Can be used to cache values.
#### migration
See [writing a migrator]({{< ref "migration.md" >}}).
@ -140,23 +133,22 @@ to talk to redis.
It uses the [go-redis](https://github.com/go-redis/redis) library, please see their configuration on how to use it.
**Note**: Only use this package directly if you have to use a direct redis connection.
In most cases, using the `keyvalue` package is a better fit.
### routes
This package defines all routes which are available for vikunja clients to use.
To add a new route, see [adding a new route]({{< ref "../practical-instructions/feature.md">}}).
To add a new route, see [adding a new route]({{< ref "feature.md">}}).
#### api/v1
This is where all http-handler functions for the api are stored.
Every handler function which does not use the standard web handler should live here.
### static
All static files generated by `make generate` live here.
### swagger
This is where the [generated]({{< ref "make.md#generate-swagger-definitions-from-code-comments">}} [api docs]({{< ref "../usage/api.md">}}) live.
This is where the [generated]({{< ref "mage.md#generate-swagger-definitions-from-code-comments">}} [api docs]({{< ref "../usage/api.md">}}) live.
You usually don't need to touch this package.
### user
@ -175,25 +167,5 @@ See their function definitions for instructions on how to use them.
### version
The single purpouse of this package is to hold the current vikunja version which gets overridden through build flags
each time `make release` or `make build` is run.
each time `mage release` or `mage build` is run.
It is a seperate package to avoid import cycles with other packages.
## REST-Tests
Holds all kinds of test files to directly test the api from inside of [jetbrains ide's](https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html).
These files are currently more an experiment, maybe we will drop them in the future to use something we could integrate in the testing process with drone.
Therefore, this has no claim to be complete yet even working, you're free to change whatever is needed to get it working for you.
## templates
Holds the email templates used to send plain text and html emails for new user registration and password changes.
## vendor
All libraries needed to build Vikunja.
We keep all libraries used for Vikunja around in the `vendor/` folder to still be able to build the project even if
some maintainers take their libraries down like [it happened in the past](https://github.com/jteeuwen/go-bindata/issues/5).
When adding a new dependency, make sure to run `go mod vendor` to put it inside this directory.

View File

@ -1,18 +1,20 @@
---
date: "2019-02-12:00:00+02:00"
title: "Modifying swagger api docs"
title: "Modifying Swagger API Docs"
draft: false
type: "doc"
menu:
sidebar:
parent: "practical instructions"
parent: "development"
---
# Adding/editing swagger api docs
# Modifying swagger api docs
The api documentation is generated using [swaggo](https://github.com/swaggo/swag) from comments.
### Documenting structs
{{< table_of_contents >}}
## Documenting structs
You should always comment every field which will be exposed as a json in the api.
These comments will show up in the documentation, it'll make it easier for developers using the api.
@ -23,13 +25,13 @@ As an example, this is the definition of a list with all comments:
// List represents a list of tasks
type List struct {
// The unique, numeric id of this list.
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"list"`
ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"list"`
// The title of the list. You'll see this in the namespace overview.
Title string `xorm:"varchar(250)" json:"title" valid:"required,runelength(3|250)" minLength:"3" maxLength:"250"`
// The description of the list.
Description string `xorm:"varchar(1000)" json:"description" valid:"runelength(0|1000)" maxLength:"1000"`
OwnerID int64 `xorm:"int(11) INDEX" json:"-"`
NamespaceID int64 `xorm:"int(11) INDEX" json:"-" param:"namespace"`
OwnerID int64 `xorm:"bigint INDEX" json:"-"`
NamespaceID int64 `xorm:"bigint INDEX" json:"-" param:"namespace"`
// The user who created this list.
Owner User `xorm:"-" json:"owner" valid:"-"`
@ -45,3 +47,27 @@ type List struct {
web.Rights `xorm:"-" json:"-"`
}
{{< /highlight >}}
## Documenting api Endpoints
All api routes should be documented with a comment above the handler function.
When generating the api docs with mage, the swagger cli will pick these up and put them in a neat document.
A comment looks like this:
{{< highlight golang >}}
// @Summary Login
// @Description Logs a user in. Returns a JWT-Token to authenticate further requests.
// @tags user
// @Accept json
// @Produce json
// @Param credentials body user.Login true "The login credentials"
// @Success 200 {object} auth.Token
// @Failure 400 {object} models.Message "Invalid user password model."
// @Failure 412 {object} models.Message "Invalid totp passcode."
// @Failure 403 {object} models.Message "Invalid username or password."
// @Router /login [post]
func Login(c echo.Context) error {
// Handler logic
}
{{< /highlight >}}

View File

@ -10,40 +10,42 @@ menu:
# Testing
You can run unit tests with [our `Makefile`]({{< ref "make.md">}}) with
You can run unit tests with [mage]({{< ref "mage.md">}}) with
{{< highlight bash >}}
make test
mage test:unit
{{< /highlight >}}
### Running tests with config
{{< table_of_contents >}}
## Running tests with config
You can run tests with all available config variables if you want, enabeling you to run tests for a lot of scenarios.
To use the normal config set the enviroment variable `VIKUNJA_TESTS_USE_CONFIG=1`.
### Show sql queries
## Show sql queries
When `UNIT_TESTS_VERBOSE=1` is set, all sql queries will be shown when tests are run.
### Fixtures
## Fixtures
All tests are run against a set of db fixtures.
These fixtures are defined in `pkg/models/fixtures` in YAML-Files which represent the database structure.
When you add a new test case which requires new database entries to test against, update these files.
# Integration tests
## Integration tests
All integration tests live in `pkg/integrations`.
You can run them by executing `make integration-test`.
You can run them by executing `mage test:integration`.
The integration tests use the same config and fixtures as the unit tests and therefor have the same options available,
see at the beginning of this document.
To run integration tests, use `make integration-test`.
To run integration tests, use `mage test:integration`.
# Initializing db fixtures when writing tests
## Initializing db fixtures when writing tests
All db fixtures for all tests live in the `pkg/db/fixtures/` folder as yaml files.
Each file has the same name as the table the fixtures are for.

View File

@ -0,0 +1,76 @@
---
title: "German Translation Instructions"
date: 2021-06-23T23:47:34+02:00
draft: false
---
# German Translation Instructions
<div class="notification is-warning">
<b>NOTE:</b> This document contains translation instructions specific to the german translation of Vikunja.
For instructions applicable to all languages, check out the <a href="{{< ref "./translations.md">}}">general translation instructions</a>.
</div>
{{< table_of_contents >}}
## Allgemein
Anrede: Wenig förmlich:
* “Du”-Form
* Keine “Amtsdeusch“-Umschreibungen, einfach so als ob man den Nutzer direkt persönlich ansprechen würde
Genauer definiert:
* “falsch” anstatt “nicht korrekt/inkorrekt”
* “Wende dich an …” anstatt “kontaktiere …”
* In derselben Zeit übersetzen (sonst wird aus dem englischen “is“ das deutsche “war”)
* Richtige Anführungszeichen verwenden. Also `„“` statt `''` oder `'` oder ` oder ´
* `„` für beginnende Anführungszeichen, `“` für schließende Anführungszeichen
Es gelten Artikel und Worttrennungen aus dem [Duden](https://duden.de).
## Formulierungen
* `Account` statt `Konto`.
* `TOTP` immer als ein Wort und Groß.
* `CalDAV` immer so.
* `löschen` oder `entfernen` je nach Kontext. Wenn etwas *gelöscht* wird, existiert das gelöschte Objekt und danach
nicht mehr und hat evtl. andere Objekte mitgelöscht (z.B. eine Aufgabe). Wird etwas *entfernt*, bezieht sich das
meistens auf die Beziehung zu einem anderen Objekt. Das entfernte Objekt existiert danach immernoch, z.B. beim
Entfernen eine:r Nutzer:in aus einem Team.
* Analog zu `löschen` oder `entfernen` gilt ähnliches für `hinzufügen` oder `erstellen`. Eine Aufgabe wird *erstellt*,
aber ein:e Nutzer:in nur zu einem Team *hinzugefügt*.
* `Anmeldename` anstatt `Benutzer:innenname`
## Formulierungen in Modals und Buttons
Es sollten die gleichen Formulierungen auf Buttons und Modals verwendet werden.
Beispiel: Wenn der Button mit `löschen` beschriftet ist, sollte im Modal die Frage
lauten `Willst du das wirklich löschen?` und nicht `Willst du das wirklich entfernen?`. Gleiches gilt für
Erfolgs/Fehlermeldungen nach der Aktion.
## Gendern
Wo möglich, sollte eine geschlechtsneutrale Anrede verwendet werden. Falls diese sehr umständlich würden (siehe oben
„Amtsdeutsch-Umschreibungen“), soll mit *Doppelpunkt* gegendert werden.
Beispiel: „Benutzer:in“
## Trennungen
* E-Mail-Adresse (siehe Duden)
## Wörter und Ausdrücke
| Englisches Original | Verwendung in deutscher Übersetzung |
| ------------------- | -------------------- |
| Bucket | Spalte |
| Namespace | Namespace |
| Link Share | Linkfreigabe |
| Username | Anmeldename |
## Weiterführende Links
* http://docs.translatehouse.org/projects/localization-guide/en/latest/guide/translation_guidelines_german.html

View File

@ -0,0 +1,54 @@
---
title: "Translations"
date: 2021-06-23T22:52:06+02:00
draft: false
menu:
sidebar:
parent: "development"
---
# Translations
This document provides documentation about how to translate Vikunja.
{{< table_of_contents >}}
## Where to translate
Translation happens at [crowdin](https://crowdin.com/project/vikunja).
Currently, only the frontend (and by extension, the desktop app) is translatable.
## Translation Instructions
> These are the instructions for translating Vikunja in another language.
> For information about how to add new translation strings, see below.
For all languages these translation guidelines should be applied when translating:
* Use a less-formal style, as if you were talking to a friend.
* If the source string contains characters like `&` or `…`, the translated string should contain them as well.
More specific instructions for some languages can be found below.
### Wrong translation strings
If you encounter a wrong original translation string while translating, please don't correct it in the translation.
Instead, translate it to reflect the original meaning in the translated string but add a comment under the source string to discuss potential changes.
### Language-specific instructions
* [German]({{< ref "./translation-instructions-german.md">}})
## How to add new translation strings
All translation strings are stored in `src/i18n/lang/`.
New strings should be added only in the `en.json` file.
Strings in other languages will be synced through weblate and should not be added directly as a PR/commit in the frontend repo.
## Requesting a new language
If you want to start translating Vikunja in a language not yet available in Vikunja, please request the language through the crowdin interface.
If you have issues with this or need a discussion before doing so, please [contact us](https://vikunja.io/contact/) or [start a discussion in the forum](https://community.vikunja.io).
Once at least 50% of all translation strings are translated and approved, they will be added and distributed with the Vikunja frontend for users to select and use Vikunja with them.

View File

@ -1,38 +0,0 @@
---
date: "2019-02-12:00:00+02:00"
title: "Database"
draft: false
type: "doc"
menu:
sidebar:
parent: "practical instructions"
---
# Database
Vikunja uses [xorm](http://xorm.io/) as an abstraction layer to handle the database connection.
Please refer to [their](http://xorm.io/docs/) documentation on how to exactly use it.
Inside the `models` package, a variable `x` is available which contains a pointer to an instance of `xorm.Engine`.
This is used whenever you make a call to the database to get or update data.
This xorm instance is set up and initialized every time vikunja is started.
### Adding new database tables
To add a new table to the database, add a an instance of your struct to the `tables` variable in the
init function in `pkg/models/models.go`. Xorm will sync them automatically.
You also need to add a pointer to the `tablesWithPointer` slice to enable caching for all instances of this struct.
To learn more about how to configure your struct to create "good" tables, refer to [the xorm documentaion](http://xorm.io/docs/).
### Adding data to test fixtures
Adding data for test fixtures is done in via `yaml` files insinde of `pkg/models/fixtures`.
The name of the yaml file should equal the table name in the database.
Adding values to it is done via array definition inside of the yaml file.
**Note**: Table and column names need to be in snake_case as that's what is used internally in the database
and for mapping values from the database to xorm so your structs can use it.

View File

@ -1,84 +0,0 @@
---
date: "2019-02-12:00:00+02:00"
title: "Mailer"
draft: false
type: "doc"
menu:
sidebar:
parent: "practical instructions"
---
# Mailer
This document explains how to use the mailer to send emails and what to do to create a new kind of email to be sent.
## Sending emails
**Note:** You should use mail templates whenever possible (see below).
To send an email, use the function `mail.SendMail(options)`. The options are defined as follows:
{{< highlight golang >}}
type Opts struct {
To string // The email address of the recipent
Subject string // The subject of the mail
Message string // The plaintext message in the mail
HTMLMessage string // The html message
ContentType ContentType // The content type of the mail. Can be either mail.ContentTypePlain, mail.ContentTypeHTML, mail.ContentTypeMultipart. You should set this according to the kind of mail you want to send.
Boundary string
Headers []*header // Other headers to set in the mail.
}
{{< /highlight >}}
## Sending emails based on a template
For each mail with a template, there are two email templates: One for plaintext emails, one for html emails.
These are located in the `templates/mail` folder and follow the conventions of `template-name.{plain|hmtl}.tmpl`,
both the plaintext and html templates are in the same folder.
To send a mail based on a template, use the function `mail.SendMailWithTemplate(to, subject, tpl string, data map[string]interface{})`.
`to` and `subject` are pretty much self-explanatory, `tpl` is the name of the template, without `.html.tmpl` or `.plain.tmpl`.
`data` is a map you can pass additional data to your template.
#### Sending a mail with a template
A basic html email template would look like this:
{{< highlight go-html-template >}}
{{template "mail-header.tmpl" .}}
<p>
Hey there!<br/>
This is a minimal html email example.<br/>
{{.Something}}
</p>
{{template "mail-footer.tmpl"}}
{{< /highlight >}}
And the corresponding plaintext template:
{{< highlight go-text-template >}}
Hey there!
This is a minimal html email example.
{{.Something}}
{{< /highlight >}}
You would then call this like so:
{{< highlight golang >}}
data := make(map[string]interface{})
data["Something"] = "I am some computed value"
to := "test@example.com"
subject := "A simple test mail"
tpl := "demo" // Assuming you saved the templates as demo.plain.tmpl and demo.html.tmpl
mail.SendMailWithTemplate(to, subject, tpl, data)
{{< /highlight >}}
The function does not return an error. If an error occures when sending a mail, it is logged but not returned because sending the mail happens asinchrounly.
Notice the `mail-header.tmpl` and `mail-footer.tmpl` in the template. These populate some basic css, a box for your content and the vikunja logo.
All that's left for you is to put the content in, which then will appear in a beautifully-styled box.
Remeber, these are email templates. This is different from normal html/css, you cannot use whatever you want (because most of the clients are wayyy to outdated).

View File

@ -1,31 +0,0 @@
---
date: "2019-02-12:00:00+02:00"
title: "Adding new config options"
draft: false
type: "doc"
menu:
sidebar:
parent: "practical instructions"
---
# Adding new config options
Vikunja uses [viper](https://github.com/spf13/viper) to handle configuration options.
It handles parsing all different configuration sources.
The configuration is done in sections. These are represented with a `.` in viper.
Take a look at `pkg/config/config.go` to understand how these are set.
To add a new config option, you should add a default value to `pkg/config/config.go`.
Default values should always enable the feature to work somehow, or turn it off completely if it always needs
additional configuration.
Make sure to add the new config option to [the config document]({{< ref "../setup/config.md">}}) and the default config file
(`config.yml.sample` at the root of the repository) to make sure it is well documented.
If you're using a computed value as a default, make sure to update the sample config file and debian
post-install scripts to reflect that.
To get a configured option, use `viper.Get("config.option")`.
Take a look at [viper's documentation](https://github.com/spf13/viper#getting-values-from-viper) to learn of the
different ways available to get config options.

View File

@ -13,6 +13,8 @@ menu:
Vikunja does not store any data outside of the database.
So, all you need to backup are the contents of that database and maybe the config file.
{{< table_of_contents >}}
## MySQL
To create a backup from mysql use the `mysqldump` command:

View File

@ -14,16 +14,16 @@ Vikunja being a go application, has no other dependencies than go itself.
All libraries are bundeled inside the repo in the `vendor/` folder, so all it boils down to are these steps:
1. Make sure [Go](https://golang.org/doc/install) is properly installed on your system. You'll need at least Go `1.9`.
2. Make sure [Make](https://www.gnu.org/software/make/) is properly installed on your system.
2. Make sure [Mage](https://magefile) is properly installed on your system.
3. Clone the repo with `git clone https://code.vikunja.io/api`
3. Run `make build` in the source of this repo. This will build a binary in the root of the repo which will be able to run on your system.
3. Run `mage build:build` in the source of this repo. This will build a binary in the root of the repo which will be able to run on your system.
*Note:* Static ressources such as email templates are built into the binary.
For these to work, you may need to run `make generate` before building the vikunja binary.
When builing entirely with `make`, you dont need to do this, `make generate` will be run automatically when running `make build`.
For these to work, you may need to run `mage build:generate` before building the vikunja binary.
When builing entirely with `mage`, you dont need to do this, `mage build:generate` will be run automatically when running `mage build:build`.
# Build for different architectures
To build for other platforms and architectures than the one you're currently on, simply run `make release` or `make release-{linux|windows|darwin}`.
To build for other platforms and architectures than the one you're currently on, simply run `mage release:release` or `mage release:{linux|windows|darwin}`.
More options are available, please refer to the [makefile docs]({{< ref "../development/make.md">}}) for more details.
More options are available, please refer to the [magefile docs]({{< ref "../development/mage.md">}}) for more details.

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,8 @@ We'll use [docker compose](https://docs.docker.com/compose/) to make handling th
> If you have any issues setting up vikunja, please don't hesitate to reach out to us via [matrix](https://riot.im/app/#/room/!dCRiCiLaCCFVNlDnYs:matrix.org?via=matrix.org), the [community forum](https://community.vikunja.io/) or even [email](mailto:hello@vikunja.io).
{{< table_of_contents >}}
## Preparations (optional)
Create a directory for the project where all data and the compose file will live in.
@ -31,8 +33,11 @@ version: '3'
services:
db:
image: mariadb:10
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
MYSQL_ROOT_PASSWORD: supersecret
MYSQL_USER: vikunja
MYSQL_PASSWORD: secret
MYSQL_DATABASE: vikunja
volumes:
- ./db:/var/lib/mysql
@ -41,9 +46,9 @@ services:
image: vikunja/api
environment:
VIKUNJA_DATABASE_HOST: db
VIKUNJA_DATABASE_PASSWORD: supersecret
VIKUNJA_DATABASE_PASSWORD: secret
VIKUNJA_DATABASE_TYPE: mysql
VIKUNJA_DATABASE_USER: root
VIKUNJA_DATABASE_USER: vikunja
VIKUNJA_DATABASE_DATABASE: vikunja
volumes:
- ./files:/app/vikunja/files
@ -87,15 +92,22 @@ server {
proxy_pass http://frontend:80;
}
location /api/ {
location ~* ^/(api|dav|\.well-known)/ {
proxy_pass http://api:3456;
client_max_body_size 20M;
}
}
{{< /highlight >}}
This is a simple proxy configuration which will forward all requests to `/api/` to the api container and everything else to the frontend.
**Note:** Even if you want to make your installation available under a different port, you don't need to change anything in this configuration.
<div class="notification is-info">
<b>NOTE:</b> Even if you want to make your installation available under a different port, you don't need to change anything in this configuration.
</div>
<div class="notification is-warning">
<b>NOTE:</b> If you change the max upload size in Vikunja's settings, you'll need to also change the <code>client_max_body_size</code> in the nginx proxy config.
</div>
## Run it

View File

@ -15,7 +15,15 @@ It uses an nginx container or traefik on the host to proxy backend and frontend
For all available configuration options, see [configuration]({{< ref "config.md">}}).
### Redis
<div class="notification is-warning">
<b>NOTE:</b> If you intend to run Vikunja with mysql and/or to use non-latin characters
<a href="{{< ref "utf-8.md">}}">make sure your db is utf-8 compatible</a>.<br/>
All examples on this page already reflect this and do not require additional work.
</div>
{{< table_of_contents >}}
## Redis
To use redis, you'll need to add this to the config examples below:
@ -68,7 +76,7 @@ services:
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.vikunja-api.rule=Host(`vikunja.example.com`) && PathPrefix(`/api/v1`)"
- "traefik.http.routers.vikunja-api.rule=Host(`vikunja.example.com`) && PathPrefix(`/api/v1`, `/dav/`, `/.well-known/`)"
- "traefik.http.routers.vikunja-api.entrypoints=https"
- "traefik.http.routers.vikunja-api.tls.certResolver=acme"
frontend:
@ -84,6 +92,7 @@ services:
restart: unless-stopped
db:
image: mariadb:10
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
MYSQL_ROOT_PASSWORD: supersupersecret
MYSQL_USER: vikunja
@ -126,7 +135,7 @@ services:
labels:
- "traefik.docker.network=web"
- "traefik.enable=true"
- "traefik.frontend.rule=Host:vikunja.example.com;PathPrefix:/api/v1"
- "traefik.frontend.rule=Host:vikunja.example.com;PathPrefix:/api/v1,/dav/,/.well-known"
- "traefik.port=3456"
- "traefik.protocol=http"
frontend:
@ -143,6 +152,7 @@ services:
restart: unless-stopped
db:
image: mariadb:10
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
MYSQL_ROOT_PASSWORD: supersupersecret
MYSQL_USER: vikunja
@ -171,12 +181,17 @@ server {
proxy_pass http://frontend:80;
}
location /api/ {
location ~* ^/(api|dav|\.well-known)/ {
proxy_pass http://api:3456;
client_max_body_size 20M;
}
}
{{< /highlight >}}
<div class="notification is-warning">
<b>NOTE:</b> If you change the max upload size in Vikunja's settings, you'll need to also change the <code>client_max_body_size</code> in the nginx proxy config.
</div>
`docker-compose.yml` config:
{{< highlight yaml >}}
@ -185,8 +200,11 @@ version: '3'
services:
db:
image: mariadb:10
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
MYSQL_ROOT_PASSWORD: supersecret
MYSQL_USER: vikunja
MYSQL_PASSWORD: secret
MYSQL_DATABASE: vikunja
volumes:
- ./db:/var/lib/mysql
@ -195,9 +213,9 @@ services:
image: vikunja/api
environment:
VIKUNJA_DATABASE_HOST: db
VIKUNJA_DATABASE_PASSWORD: supersecret
VIKUNJA_DATABASE_PASSWORD: secret
VIKUNJA_DATABASE_TYPE: mysql
VIKUNJA_DATABASE_USER: root
VIKUNJA_DATABASE_USER: vikunja
VIKUNJA_DATABASE_DATABASE: vikunja
volumes:
- ./files:/app/vikunja/files
@ -226,6 +244,8 @@ You will need the following `Caddyfile` on your host (or elsewhere, but then you
{{< highlight conf >}}
vikunja.example.com {
reverse_proxy /api/* api:3456
reverse_proxy /.well-known/* api:3456
reverse_proxy /dav/* api:3456
reverse_proxy frontend:80
}
{{< /highlight >}}
@ -238,8 +258,11 @@ version: '3'
services:
db:
image: mariadb:10
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
MYSQL_ROOT_PASSWORD: supersecret
MYSQL_ROOT_PASSWORD: supersecret
MYSQL_USER: vikunja
MYSQL_PASSWORD: secret
MYSQL_DATABASE: vikunja
volumes:
- ./db:/var/lib/mysql
@ -248,9 +271,9 @@ services:
image: vikunja/api
environment:
VIKUNJA_DATABASE_HOST: db
VIKUNJA_DATABASE_PASSWORD: supersecret
VIKUNJA_DATABASE_PASSWORD: secret
VIKUNJA_DATABASE_TYPE: mysql
VIKUNJA_DATABASE_USER: root
VIKUNJA_DATABASE_USER: vikunja
VIKUNJA_DATABASE_DATABASE: vikunja
volumes:
- ./files:/app/vikunja/files

View File

@ -10,6 +10,13 @@ menu:
# Backend
<div class="notification is-warning">
<b>NOTE:</b> If you intend to run Vikunja with mysql and/or to use non-latin characters
<a href="{{< ref "utf-8.md">}}">make sure your db is utf-8 compatible</a>.
</div>
{{< table_of_contents >}}
## Install from binary
Download a copy of Vikunja from the [download page](https://vikunja.io/en/download/) for your architecture.
@ -21,7 +28,7 @@ wget <download-url>
### Verify the GPG signature
Starting with version `0.7`, all releases are signed using pgp.
Releases from `master` will always be signed.
Releases from `main` will always be signed.
To validate the downloaded zip file use the signiture file `.asc` and the key `FF054DACD908493A`:
@ -140,16 +147,19 @@ services:
image: vikunja/api:latest
environment:
VIKUNJA_DATABASE_HOST: db
VIKUNJA_DATABASE_PASSWORD: supersecret
VIKUNJA_DATABASE_PASSWORD: secret
VIKUNJA_DATABASE_TYPE: mysql
VIKUNJA_DATABASE_USER: root
VIKUNJA_DATABASE_USER: vikunja
VIKUNJA_SERVICE_JWTSECRET: <generated secret>
volumes:
- ./files:/app/vikunja/files
db:
image: mariadb:10
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
MYSQL_ROOT_PASSWORD: supersecret
MYSQL_USER: vikunja
MYSQL_PASSWORD: secret
MYSQL_DATABASE: vikunja
volumes:
- ./db:/var/lib/mysql
@ -170,6 +180,105 @@ dpkg -i vikunja.deb
This will install the backend to `/opt/vikunja`.
To configure it, use the config file in `/etc/vikunja/config.yml`.
## FreeBSD / FreeNAS
Unfortunately, we currently can't provide pre-built binaries for FreeBSD.
As a workaround, it is possible to compile vikunja for FreeBSD directly on a FreeBSD machine, a guide is available below:
*Thanks to HungrySkeleton who originally created this guide [in the forum](https://community.vikunja.io/t/freebsd-support/69/11).*
### Jail Setup
1. Create jail named ```vikunja```
2. Set jail properties to 'auto start'
3. Mount storage (```/mnt``` to ```jailData/vikunja```)
4. Start jail & SSH into it
### Installing packages
{{< highlight bash >}}
pkg update && pkg upgrade -y
pkg install nano git go gmake
go install github.com/magefile/mage
{{< /highlight >}}
### Clone vikunja repo
{{< highlight bash >}}
mkdir /mnt/GO/code.vikunja.io
cd /mnt/GO/code.vikunja.io
git clone https://code.vikunja.io/api
cd /mnt/GO/code.vikunja.io/api
{{< /highlight >}}
### Compile binaries
{{< highlight bash >}}
go install
mage build
{{< /highlight >}}
### Create folder to install backend server into
{{< highlight bash >}}
mkdir /mnt/backend
cp /mnt/GO/code.vikunja.io/api/vikunja /mnt/backend/vikunja
cd /mnt/backend
chmod +x /mnt/backend/vikunja
{{< /highlight >}}
### Set vikunja to boot on startup
{{< highlight bash >}}
nano /etc/rc.d/vikunja
{{< /highlight >}}
Then paste into the file:
{{< highlight bash >}}
#!/bin/sh
. /etc/rc.subr
name=vikunja
rcvar=vikunja_enable
command="/mnt/backend/${name}"
load_rc_config $name
run_rc_command "$1"
{{< /highlight >}}
Save and exit. Then execute:
{{< highlight bash >}}
chmod +x /etc/rc.d/vikunja
nano /etc/rc.conf
{{< /highlight >}}
Then add line to bottom of file:
{{< highlight bash >}}
vikunja_enable="YES"
{{< /highlight >}}
Test vikunja now works with
{{< highlight bash >}}
service vikunja start
{{< /highlight >}}
The API is now available through IP:
```
192.168.1.XXX:3456
```
## Configuration
See [available configuration options]({{< ref "config.md">}}).
## Default Password
After successfully installing Vikunja, there is no default user or password.
You only need to register a new account and set all the details when creating it.

View File

@ -17,6 +17,8 @@ Unzip them and store them somewhere your server can access them.
You also need to configure a rewrite condition to internally redirect all requests to `index.html` which handles all urls.
{{< table_of_contents >}}
## API URL configuration
By default, the frontend assumes it can reach the api at `/api/v1` relative to the frontend url.
@ -120,7 +122,7 @@ Put the following config in `cat /etc/apache2/sites-available/vikunja.conf`:
ServerName localhost
DocumentRoot /path/to/vikunja/static/frontend/files
RewriteEngine On
RewriteRule ^\/?(config\.json|favicon\.ico|css|fonts|images|img|js) - [L]
RewriteRule ^\/?(favicon\.ico|assets|audio|fonts|images|manifest\.webmanifest|robots\.txt|sw\.js|workbox-.*|api|dav|\.well-known) - [L]
RewriteRule ^(.*)$ /index.html [QSA,L]
</VirtualHost>
{{< /highlight >}}

View File

@ -30,6 +30,7 @@ This document provides an overview and instructions for the different methods.
* [Docker]({{< ref "install-backend.md#docker">}})
* [Debian packages]({{< ref "install-backend.md#debian-packages">}})
* [Configuration]({{< ref "config.md">}})
* [UTF-8 Settings]({{< ref "utf-8.md">}})
* [Frontend]({{< ref "install-frontend.md">}})
* [Docker]({{< ref "install-frontend.md#docker">}})
* [NGINX]({{< ref "install-frontend.md#nginx">}})
@ -38,3 +39,15 @@ This document provides an overview and instructions for the different methods.
* [Reverse proxies]({{< ref "reverse-proxies.md">}})
* [Full docker example]({{< ref "full-docker-example.md">}})
* [Backups]({{< ref "backups.md">}})
## Installation on kubernetes
A third-party Helm Chart is available from the k8s-at-home project [here](https://github.com/k8s-at-home/charts/tree/master/charts/stable/vikunja).
## Other installation resources
* [Docker Compose is MUCH Easier Than you Think - Let's Install Vikunja](https://www.youtube.com/watch?v=fGlz2PkXjuo) (Youtube)
* [Setup Vikunja using Docker Compose - Homelab Wiki](https://thehomelab.wiki/books/docker/page/setup-vikunja-using-docker-compose)
* [A Closer look at Vikunja - Email Notifications - Enable or Disable Registrations - Allow Attachments](https://www.youtube.com/watch?v=47wj9pRT6Gw) (Youtube)
* [Install Vikunja in Docker for self-hosted Task Tracking](https://smarthomepursuits.com/install-vikunja-in-docker-for-self-hosted-task-tracking/)

View File

@ -13,6 +13,8 @@ menu:
These examples assume you have an instance of the backend running on your server listening on port `3456`.
If you've changed this setting, you need to update the server configurations accordingly.
{{< table_of_contents >}}
## NGINX
Below are two example configurations which you can put in your `nginx.conf`:
@ -43,12 +45,17 @@ server {
index index.html index.htm;
}
location /api/ {
location ~* ^/(api|dav|\.well-known)/ {
proxy_pass http://localhost:3456;
client_max_body_size 20M;
}
}
{{< /highlight >}}
<div class="notification is-warning">
<b>NOTE:</b> If you change the max upload size in Vikunja's settings, you'll need to also change the <code>client_max_body_size</code> in the nginx proxy config.
</div>
### without gzip
{{< highlight conf >}}
@ -62,12 +69,17 @@ server {
index index.html index.htm;
}
location /api/ {
location ~* ^/(api|dav|\.well-known)/ {
proxy_pass http://localhost:3456;
client_max_body_size 20M;
}
}
{{< /highlight >}}
<div class="notification is-warning">
<b>NOTE:</b> If you change the max upload size in Vikunja's settings, you'll need to also change the <code>client_max_body_size</code> in the nginx proxy config.
</div>
## Apache
Put the following config in `cat /etc/apache2/sites-available/vikunja.conf`:
@ -82,14 +94,18 @@ Put the following config in `cat /etc/apache2/sites-available/vikunja.conf`:
</Proxy>
ProxyPass /api http://localhost:3456/api
ProxyPassReverse /api http://localhost:3456/api
ProxyPass /dav http://localhost:3456/dav
ProxyPassReverse /dav http://localhost:3456/dav
ProxyPass /.well-known http://localhost:3456/.well-known
ProxyPassReverse /.well-known http://localhost:3456/.well-known
DocumentRoot /var/www/html
RewriteEngine On
RewriteRule ^\/?(config\.json|favicon\.ico|css|fonts|images|img|js|api) - [L]
RewriteRule ^\/?(favicon\.ico|assets|audio|fonts|images|manifest\.webmanifest|robots\.txt|sw\.js|workbox-.*|api|dav|\.well-known) - [L]
RewriteRule ^(.*)$ /index.html [QSA,L]
</VirtualHost>
{{< /highlight >}}
**Note:** The apache modules `proxy` and `proxy_http` must be enabled for this.
**Note:** The apache modules `proxy`, `proxy_http` and `rewrite` must be enabled for this.
For more details see the [frontend apache configuration]({{< ref "install-frontend.md#apache">}}).

View File

@ -0,0 +1,108 @@
---
date: "2020-07-06:00:00+02:00"
title: "UTF-8 Settings"
draft: false
type: "doc"
menu:
sidebar:
parent: "setup"
---
# UTF-8 Settings
Vikunja itself is always fully capable of handling utf-8 characters.
However, your database might be not.
Vikunja itself will work just fine until you want to use non-latin characters in your tasks/lists/etc.
On this page, you will find information about how to fully ensure non-latin characters like aüäß or emojis work
with your installation.
{{< table_of_contents >}}
## Postgresql & SQLite
Postgresql and SQLite should handle utf-8 just fine - If you discover any issues nonetheless, please
[drop us a message](https://vikunja.io/contact/).
## MySQL
MySQL is not able to handle utf-8 by default.
To fix this, follow the steps below.
To find out if your db supports utf-8, run the following in a shell or similar, assuming the database
you're using for vikunja is called `vikunja`:
{{< highlight sql >}}
SELECT default_character_set_name FROM information_schema.SCHEMATA WHERE schema_name = 'vikunja';
{{< /highlight >}}
This will get you a result like the following:
```
+----------------------------+
| default_character_set_name |
+----------------------------+
| latin1 |
+----------------------------+
1 row in set (0.001 sec)
```
The charset `latin1` means the db is encoded in the `latin1` encoding which does not support utf-8 characters.
(The following guide is based on [this thread from stackoverflow](https://dba.stackexchange.com/a/104866))
### 0. Backup your database
Before attempting any conversion, please [back up your database]({{< ref "backups.md">}}).
### 1. Create a pre-conversion script
Copy the following sql statements in a file called `preAlterTables.sql` and replace all occurences of `vikunja` with
the name of your database:
{{< highlight sql >}}
use information_schema;
SELECT concat("ALTER DATABASE `",table_schema,"` CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;") as _sql
FROM `TABLES` where table_schema like 'vikunja' and TABLE_TYPE='BASE TABLE' group by table_schema;
SELECT concat("ALTER TABLE `",table_schema,"`.`",table_name,"` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;") as _sql
FROM `TABLES` where table_schema like 'vikunja' and TABLE_TYPE='BASE TABLE' group by table_schema, table_name;
SELECT concat("ALTER TABLE `",table_schema,"`.`",table_name, "` CHANGE `",column_name,"` `",column_name,"` ",data_type,"(",character_maximum_length,") CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci",IF(is_nullable="YES"," NULL"," NOT NULL"),";") as _sql
FROM `COLUMNS` where table_schema like 'vikunja' and data_type in ('varchar','char');
SELECT concat("ALTER TABLE `",table_schema,"`.`",table_name, "` CHANGE `",column_name,"` `",column_name,"` ",data_type," CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci",IF(is_nullable="YES"," NULL"," NOT NULL"),";") as _sql
FROM `COLUMNS` where table_schema like 'vikunja' and data_type in ('text','tinytext','mediumtext','longtext');
{{< /highlight >}}
### 2. Run the pre-conversion script
Running this will create the actual migration script for your particular database structure and save it in a file called `alterTables.sql`:
{{< highlight bash >}}
mysql -uroot < preAlterTables.sql | egrep '^ALTER' > alterTables.sql
{{< /highlight >}}
### 3. Convert the database
At this point converting is just a matter of executing the previously generated sql script:
{{< highlight bash >}}
mysql -uroot < alterTables.sql
{{< /highlight >}}
### 4. Verify it was successfully converted
If everything worked as intended, your db collation should now look like this:
{{< highlight sql >}}
SELECT default_character_set_name FROM information_schema.SCHEMATA WHERE schema_name = 'vikunja';
{{< /highlight >}}
Should get you:
```
+----------------------------+
| default_character_set_name |
+----------------------------+
| utf8mb4 |
+----------------------------+
1 row in set (0.001 sec)
```

View File

@ -16,6 +16,8 @@ menu:
Vikunja supports managing tasks via the [caldav VTODO](https://tools.ietf.org/html/rfc5545#section-3.6.2) extension.
{{< table_of_contents >}}
## URLs
All urls are located under the `/dav` subspace.
@ -64,14 +66,17 @@ Vikunja **currently does not** support these properties:
## Tested Clients
#### Working
### Working
* [Evolution](https://wiki.gnome.org/Apps/Evolution/)
#### Not working
* [OpenTasks](https://opentasks.app/) + [DAVx⁵](https://www.davx5.com/)
* [Tasks (Android)](https://tasks.org/)
### Not working
* [Thunderbird (68)](https://www.thunderbird.net/)
* iOS calDAV Sync (See [#753](https://kolaente.dev/vikunja/api/issues/753))
## Dev logs
The whole thing is not optimized at all and probably pretty inefficent.

View File

@ -13,8 +13,12 @@ menu:
You can interact with Vikunja using its `cli` interface.
The following commands are available:
* [dump](#dump)
* [help](#help)
* [migrate](#migrate)
* [restore](#restore)
* [testmail](#testmail)
* [user](#user)
* [version](#version)
* [web](#web)
@ -22,6 +26,16 @@ If you don't specify a command, the [`web`](#web) command will be executed.
All commands use the same standard [config file]({{< ref "../setup/config.md">}}).
### `dump`
Creates a zip file with all vikunja-related files.
This includes config, version, all files and the full database.
Usage:
{{< highlight bash >}}
$ vikunja dump
{{< /highlight >}}
### `help`
Shows more detailed help about any command.
@ -63,6 +77,91 @@ $ vikunja migrate rollback [flags]
Flags:
* `-n`, `--name` string: The id of the migration you want to roll back until.
### `restore`
Restores a previously created dump from a zip file, see `dump`.
Usage:
{{< highlight bash >}}
$ vikunja restore <path to dump zip file>
{{< /highlight >}}
### `testmail`
Sends a test mail using the configured smtp connection.
Usage:
{{< highlight bash >}}
$ vikunja testmail <email to send the test mail to>
{{< /highlight >}}
### `user`
Bundles a few commands to manage users.
#### `user change-status`
Enable or disable a user. Will toggle the current status if no flag (`--enable` or `--disable`) is provided.
Usage:
{{< highlight bash >}}
$ vikunja user change-status <user id> <flags>
{{< /highlight >}}
Flags:
* `-d`, `--disable`: Disable the user.
* `-e`, `--enable`: Enable the user.
#### `user create`
Create a new user.
Usage:
{{< highlight bash >}}
$ vikunja user create <flags>
{{< /highlight >}}
Flags:
* `-a`, `--avatar-provider`: The avatar provider of the new user. Optional.
* `-e`, `--email`: The email address of the new user.
* `-p`, `--password`: The password of the new user. You will be asked to enter it if not provided through the flag.
* `-u`, `--username`: The username of the new user.
#### `user list`
Shows a list of all users.
Usage:
{{< highlight bash >}}
$ vikunja user list
{{< /highlight >}}
#### `user reset-password`
Reset a users password, either through mailing them a reset link or directly.
Usage:
{{< highlight bash >}}
$ vikunja user reset-password <flags>
{{< /highlight >}}
Flags:
* `-d`, `--direct`: If provided, reset the password directly instead of sending the user a reset mail.
* `-p`, `--password`: The new password of the user. Only used in combination with --direct. You will be asked to enter it if not provided through the flag.
#### `user update`
Update an existing user.
Usage:
{{< highlight bash >}}
$ vikunja user update <user id>
{{< /highlight >}}
Flags:
* `-a`, `--avatar-provider`: The new avatar provider of the new user.
* `-e`, `--email`: The new email address of the user.
* `-u`, `--username`: The new username of the user.
### `version`
@ -82,22 +181,3 @@ Usage:
{{< highlight bash >}}
$ vikunja web
{{< /highlight >}}
### `dump`
Creates a zip file with all vikunja-related files.
This includes config, version, all files and the full database.
Usage:
{{< highlight bash >}}
$ vikunja dump
{{< /highlight >}}
### `restore`
Restores a previously created dump from a zip file, see `dump`.
Usage:
{{< highlight bash >}}
$ vikunja restore <path to dump zip file>
{{< /highlight >}}

View File

@ -12,13 +12,15 @@ menu:
This document describes the different errors Vikunja can return.
### Generic
{{< table_of_contents >}}
## Generic
| ErrorCode | HTTP Status Code | Description |
|-----------|------------------|-------------|
| 0001 | 403 | Generic forbidden error. |
### User
## User
| ErrorCode | HTTP Status Code | Description |
|-----------|------------------|-------------|
@ -37,15 +39,18 @@ This document describes the different errors Vikunja can return.
| 1015 | 412 | Totp is already enabled for this user. |
| 1016 | 412 | Totp is not enabled for this user. |
| 1017 | 412 | The provided Totp passcode is invalid. |
| 1018 | 412 | The provided user avatar provider type setting is invalid. |
| 1019 | 412 | No openid email address was provided. |
| 1020 | 412 | This user account is disabled. |
### Validation
## Validation
| ErrorCode | HTTP Status Code | Description |
|-----------|------------------|-------------|
| 2001 | 400 | ID cannot be empty or 0. |
| 2002 | 400 | Some of the request data was invalid. The response contains an aditional array with all invalid fields. |
### List
## List
| ErrorCode | HTTP Status Code | Description |
|-----------|------------------|-------------|
@ -56,7 +61,7 @@ This document describes the different errors Vikunja can return.
| 3007 | 400 | A list with this identifier already exists. |
| 3008 | 412 | The list is archived and can therefore only be accessed read only. This is also true for all tasks associated with this list. |
### Task
## Task
| ErrorCode | HTTP Status Code | Description |
|-----------|------------------|-------------|
@ -80,7 +85,7 @@ This document describes the different errors Vikunja can return.
| 4018 | 403 | Invalid task filter concatinator. |
| 4019 | 403 | Invalid task filter value. |
### Namespace
## Namespace
| ErrorCode | HTTP Status Code | Description |
|-----------|------------------|-------------|
@ -92,7 +97,7 @@ This document describes the different errors Vikunja can return.
| 5011 | 409 | This user has already access to that namespace. |
| 5012 | 412 | The namespace is archived and can therefore only be accessed read only. |
### Team
## Team
| ErrorCode | HTTP Status Code | Description |
|-----------|------------------|-------------|
@ -103,14 +108,14 @@ This document describes the different errors Vikunja can return.
| 6006 | 400 | Cannot delete the last team member. |
| 6007 | 403 | The team does not have access to the list to perform that action. |
### User List Access
## User List Access
| ErrorCode | HTTP Status Code | Description |
|-----------|------------------|-------------|
| 7002 | 409 | The user already has access to that list. |
| 7003 | 403 | The user does not have access to that list. |
### Label
## Label
| ErrorCode | HTTP Status Code | Description |
|-----------|------------------|-------------|
@ -118,16 +123,39 @@ This document describes the different errors Vikunja can return.
| 8002 | 404 | The label does not exist. |
| 8003 | 403 | The user does not have access to this label. |
### Right
## Right
| ErrorCode | HTTP Status Code | Description |
|-----------|------------------|-------------|
| 9001 | 403 | The right is invalid. |
### Kanban
## Kanban
| ErrorCode | HTTP Status Code | Description |
|-----------|------------------|-------------|
| 10001 | 404 | The bucket does not exist. |
| 10002 | 400 | The bucket does not belong to that list. |
| 10003 | 412 | You cannot remove the last bucket on a list. |
| 10001 | 404 | The bucket does not exist. |
| 10002 | 400 | The bucket does not belong to that list. |
| 10003 | 412 | You cannot remove the last bucket on a list. |
| 10004 | 412 | You cannot add the task to this bucket as it already exceeded the limit of tasks it can hold. |
| 10005 | 412 | There can be only one done bucket per list. |
## Saved Filters
| ErrorCode | HTTP Status Code | Description |
|-----------|------------------|-------------|
| 11001 | 404 | The saved filter does not exist. |
| 11002 | 412 | Saved filters are not available for link shares. |
## Subscriptions
| ErrorCode | HTTP Status Code | Description |
|-----------|------------------|-------------|
| 12001 | 412 | The subscription entity type is invalid. |
| 12002 | 412 | The user is already subscribed to the entity itself or a parent entity. |
## Link Shares
| ErrorCode | HTTP Status Code | Description |
|-----------|------------------|-------------|
| 13001 | 412 | This link share requires a password for authentication, but none was provided. |
| 13002 | 403 | The provided link share password was invalid. |

View File

@ -23,7 +23,7 @@ The following values are possible:
| 1 | Read and write. Namespaces or lists shared with this right can be read and written to by the team or user. |
| 2 | Admin. Can do anything like read and write, but can additionally manage sharing options. |
### Team admins
## Team admins
When adding or querying a team, every member has an additional boolean value stating if it is admin or not.
A team admin can also add and remove team members and also change whether a user in the team is admin or not.

1
docs/themes/vikunja vendored

@ -1 +0,0 @@
Subproject commit a17ba5976906ee431943798c08e4d3c38689590d

105
go.mod
View File

@ -17,73 +17,70 @@
module code.vikunja.io/api
require (
4d63.com/tz v1.1.0
code.vikunja.io/web v0.0.0-20200618164749-a5f3d450d39a
code.vikunja.io/web v0.0.0-20210706160506-d85def955bd3
gitea.com/xorm/xorm-redis-cache v0.2.0
github.com/ThreeDotsLabs/watermill v1.1.1
github.com/adlio/trello v1.9.0
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a
github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef
github.com/beevik/etree v1.1.0 // indirect
github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee
github.com/client9/misspell v0.3.4
github.com/cweill/gotests v1.5.3
github.com/d4l3k/messagediff v1.2.1 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/fzipp/gocyclo v0.0.0-20150627053110-6acd4345c835
github.com/getsentry/sentry-go v0.6.1
github.com/go-openapi/jsonreference v0.19.3 // indirect
github.com/go-openapi/spec v0.19.4 // indirect
github.com/go-redis/redis/v7 v7.4.0
github.com/go-sql-driver/mysql v1.5.0
github.com/go-testfixtures/testfixtures/v3 v3.3.0
github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334
github.com/imdario/mergo v0.3.9
github.com/jgautheron/goconst v0.0.0-20200227150835-cda7ea3bf591
github.com/kr/text v0.2.0 // indirect
github.com/labstack/echo/v4 v4.1.16
github.com/c2h5oh/datasize v0.0.0-20200825124411-48ed595a09d2
github.com/coreos/go-oidc/v3 v3.0.0
github.com/cweill/gotests v1.6.0
github.com/d4l3k/messagediff v1.2.1
github.com/disintegration/imaging v1.6.2
github.com/dustinkirkland/golang-petname v0.0.0-20191129215211-8e5a1ed0cff0
github.com/gabriel-vasile/mimetype v1.3.1
github.com/getsentry/sentry-go v0.11.0
github.com/go-errors/errors v1.1.1 // indirect
github.com/go-redis/redis/v8 v8.11.3
github.com/go-sql-driver/mysql v1.6.0
github.com/go-testfixtures/testfixtures/v3 v3.6.1
github.com/golang-jwt/jwt/v4 v4.0.0
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
github.com/golang/snappy v0.0.4 // indirect
github.com/iancoleman/strcase v0.2.0
github.com/imdario/mergo v0.3.12
github.com/labstack/echo/v4 v4.5.0
github.com/labstack/gommon v0.3.0
github.com/laurent22/ical-go v0.1.1-0.20181107184520-7e5d6ade8eef
github.com/lib/pq v1.7.0
github.com/mailru/easyjson v0.7.0 // indirect
github.com/mattn/go-sqlite3 v1.14.0
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/olekukonko/tablewriter v0.0.4
github.com/onsi/ginkgo v1.12.0 // indirect
github.com/onsi/gomega v1.9.0 // indirect
github.com/lib/pq v1.10.3
github.com/magefile/mage v1.11.0
github.com/mattn/go-isatty v0.0.13 // indirect
github.com/mattn/go-sqlite3 v1.14.8
github.com/olekukonko/tablewriter v0.0.5
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
github.com/pelletier/go-toml v1.4.0 // indirect
github.com/pquerna/otp v1.2.0
github.com/prometheus/client_golang v1.7.1
github.com/pquerna/otp v1.3.0
github.com/prometheus/client_golang v1.11.0
github.com/robfig/cron/v3 v3.0.1
github.com/samedi/caldav-go v3.0.0+incompatible
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749
github.com/shurcooL/vfsgen v0.0.0-20200627165143-92b8a710ab6c
github.com/spf13/afero v1.3.1
github.com/spf13/cobra v1.0.0
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/viper v1.7.0
github.com/stretchr/testify v1.6.1
github.com/swaggo/swag v1.6.7
github.com/ulule/limiter/v3 v3.5.0
github.com/urfave/cli v1.22.2 // indirect
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
golang.org/x/lint v0.0.0-20200302205851-738671d3881b
golang.org/x/net v0.0.0-20200602114024-627f9648deb9 // indirect
golang.org/x/text v0.3.3 // indirect
golang.org/x/tools v0.0.0-20200410194907-79a7a3126eef // indirect
github.com/spf13/afero v1.6.0
github.com/spf13/cobra v1.2.1
github.com/spf13/viper v1.8.1
github.com/stretchr/testify v1.7.0
github.com/swaggo/swag v1.7.1
github.com/ulule/limiter/v3 v3.8.0
github.com/yuin/goldmark v1.4.0
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d
golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20210909193231-528a39cd75f3
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/d4l3k/messagediff.v1 v1.2.1
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
honnef.co/go/tools v0.0.1-2020.1.4
src.techknowlogick.com/xgo v0.0.0-20200602060627-a09175ea9056
src.techknowlogick.com/xormigrate v1.3.0
xorm.io/builder v0.3.7
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
src.techknowlogick.com/xgo v1.4.1-0.20210311222705-d25c33fcd864
src.techknowlogick.com/xormigrate v1.4.0
xorm.io/builder v0.3.9
xorm.io/core v0.7.3
xorm.io/xorm v1.0.2
xorm.io/xorm v1.1.2
)
replace (
github.com/adlio/trello => github.com/kolaente/trello v1.7.1-0.20201216234312-5c4ef79b531e
github.com/coreos/bbolt => go.etcd.io/bbolt v1.3.4
github.com/coreos/go-systemd => github.com/coreos/go-systemd/v22 v22.0.0
github.com/hpcloud/tail => github.com/jeffbean/tail v1.0.1 // See https://github.com/hpcloud/tail/pull/159
@ -91,4 +88,4 @@ replace (
gopkg.in/fsnotify.v1 => github.com/kolaente/fsnotify v1.4.10-0.20200411160148-1bc3c8ff4048 // See https://github.com/fsnotify/fsnotify/issues/328 and https://github.com/golang/go/issues/26904
)
go 1.13
go 1.15

951
go.sum

File diff suppressed because it is too large Load Diff

1119
magefile.go Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,17 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2020 Vikunja and contributors. All rights reserved.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package main

25
nfpm.yaml Normal file
View File

@ -0,0 +1,25 @@
name: "vikunja"
arch: "amd64"
platform: "linux"
version: "<version>"
description: "Vikunja is an open-source todo application, written in Go. It lets you create lists,tasks and share them via teams or directly between users."
maintainer: "Vikunja Maintainers <maintainers@vikunja.io>"
homepage: "https://vikunja.io"
section: "default"
priority: "extra"
license: "AGPLv3"
depends:
- systemd
contents:
- src: <binlocation>
dst: /opt/vikunja/vikunja
- src: ./config.yml.sample
dst: /etc/vikunja/config.yml
type: "config"
- src: /opt/vikunja/vikunja
dst: /usr/local/bin/vikunja
type: "symlink"
- src: vikunja.service
dst: /usr/lib/systemd/system/vikunja.service
scripts:
postinstall: ./build/after-install.sh

View File

@ -1,32 +1,34 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2020 Vikunja and contributors. All rights reserved.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package caldav
import (
"code.vikunja.io/api/pkg/config"
"code.vikunja.io/api/pkg/user"
"code.vikunja.io/api/pkg/utils"
"fmt"
"regexp"
"strconv"
"strings"
"time"
"code.vikunja.io/api/pkg/config"
"code.vikunja.io/api/pkg/user"
"code.vikunja.io/api/pkg/utils"
)
// DateFormat ist the caldav date format
// DateFormat is the caldav date format
const DateFormat = `20060102T150405`
// Event holds a single caldav event
@ -35,6 +37,7 @@ type Event struct {
Description string
UID string
Alarms []Alarm
Color string
Timestamp time.Time
Start time.Time
@ -54,6 +57,7 @@ type Todo struct {
Organizer *user.User
Priority int64 // 0-9, 1 is highest
RelatedToUID string
Color string
Start time.Time
End time.Time
@ -74,6 +78,24 @@ type Alarm struct {
type Config struct {
Name string
ProdID string
Color string
}
func getCaldavColor(color string) (caldavcolor string) {
if color == "" {
return ""
}
if !strings.HasPrefix(color, "#") {
color = "#" + color
}
color += "FF"
return `
X-APPLE-CALENDAR-COLOR:` + color + `
X-OUTLOOK-COLOR:` + color + `
X-FUNAMBOL-COLOR:` + color
}
// ParseEvents parses an array of caldav events and gives them back as string
@ -83,7 +105,7 @@ VERSION:2.0
METHOD:PUBLISH
X-PUBLISHED-TTL:PT4H
X-WR-CALNAME:` + config.Name + `
PRODID:-//` + config.ProdID + `//EN`
PRODID:-//` + config.ProdID + `//EN` + getCaldavColor(config.Color)
for _, e := range events {
@ -91,11 +113,17 @@ PRODID:-//` + config.ProdID + `//EN`
e.UID = makeCalDavTimeFromTimeStamp(e.Timestamp) + utils.Sha256(e.Summary)
}
formattedDescription := ""
if e.Description != "" {
re := regexp.MustCompile(`\r?\n`)
formattedDescription = re.ReplaceAllString(e.Description, "\\n")
}
caldavevents += `
BEGIN:VEVENT
UID:` + e.UID + `
SUMMARY:` + e.Summary + `
DESCRIPTION:` + e.Description + `
SUMMARY:` + e.Summary + getCaldavColor(e.Color) + `
DESCRIPTION:` + formattedDescription + `
DTSTAMP:` + makeCalDavTimeFromTimeStamp(e.Timestamp) + `
DTSTART:` + makeCalDavTimeFromTimeStamp(e.Start) + `
DTEND:` + makeCalDavTimeFromTimeStamp(e.End)
@ -129,7 +157,7 @@ VERSION:2.0
METHOD:PUBLISH
X-PUBLISHED-TTL:PT4H
X-WR-CALNAME:` + config.Name + `
PRODID:-//` + config.ProdID + `//EN`
PRODID:-//` + config.ProdID + `//EN` + getCaldavColor(config.Color)
for _, t := range todos {
if t.UID == "" {
@ -140,7 +168,7 @@ PRODID:-//` + config.ProdID + `//EN`
BEGIN:VTODO
UID:` + t.UID + `
DTSTAMP:` + makeCalDavTimeFromTimeStamp(t.Timestamp) + `
SUMMARY:` + t.Summary
SUMMARY:` + t.Summary + getCaldavColor(t.Color)
if t.Start.Unix() > 0 {
caldavtodos += `
@ -151,12 +179,15 @@ DTSTART: ` + makeCalDavTimeFromTimeStamp(t.Start)
DTEND: ` + makeCalDavTimeFromTimeStamp(t.End)
}
if t.Description != "" {
re := regexp.MustCompile(`\r?\n`)
formattedDescription := re.ReplaceAllString(t.Description, "\\n")
caldavtodos += `
DESCRIPTION:` + t.Description
DESCRIPTION:` + formattedDescription
}
if t.Completed.Unix() > 0 {
caldavtodos += `
COMPLETED: ` + makeCalDavTimeFromTimeStamp(t.Completed)
COMPLETED:` + makeCalDavTimeFromTimeStamp(t.Completed) + `
STATUS:COMPLETED`
}
if t.Organizer != nil {
caldavtodos += `
@ -185,7 +216,7 @@ DURATION:PT` + fmt.Sprintf("%.6f", t.Duration.Hours()) + `H` + fmt.Sprintf("%.6f
if t.Priority != 0 {
caldavtodos += `
PRIORITY:` + strconv.Itoa(int(t.Priority))
PRIORITY:` + strconv.Itoa(mapPriorityToCaldav(t.Priority))
}
caldavtodos += `

View File

@ -1,26 +1,27 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2020 Vikunja and contributors. All rights reserved.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package caldav
import (
"code.vikunja.io/api/pkg/config"
"github.com/stretchr/testify/assert"
"testing"
"time"
"code.vikunja.io/api/pkg/config"
"github.com/stretchr/testify/assert"
)
func TestParseEvents(t *testing.T) {
@ -39,6 +40,7 @@ func TestParseEvents(t *testing.T) {
config: &Config{
Name: "test",
ProdID: "RandomProdID which is not random",
Color: "ffffff",
},
events: []*Event{
{
@ -48,6 +50,7 @@ func TestParseEvents(t *testing.T) {
Timestamp: time.Unix(1543626724, 0).In(config.GetTimeZone()),
Start: time.Unix(1543626724, 0).In(config.GetTimeZone()),
End: time.Unix(1543627824, 0).In(config.GetTimeZone()),
Color: "affffe",
},
{
Summary: "Event #2",
@ -71,9 +74,15 @@ METHOD:PUBLISH
X-PUBLISHED-TTL:PT4H
X-WR-CALNAME:test
PRODID:-//RandomProdID which is not random//EN
X-APPLE-CALENDAR-COLOR:#ffffffFF
X-OUTLOOK-COLOR:#ffffffFF
X-FUNAMBOL-COLOR:#ffffffFF
BEGIN:VEVENT
UID:randommduid
SUMMARY:Event #1
X-APPLE-CALENDAR-COLOR:#affffeFF
X-OUTLOOK-COLOR:#affffeFF
X-FUNAMBOL-COLOR:#affffeFF
DESCRIPTION:Lorem Ipsum
DTSTAMP:20181201T011204
DTSTART:20181201T011204
@ -238,6 +247,41 @@ DTSTAMP:20181202T050024
DTSTART:20181202T050024
DTEND:20181202T050320
END:VEVENT
END:VCALENDAR`,
},
{
name: "Test caldavparsing with multiline description",
args: args{
config: &Config{
Name: "test",
ProdID: "RandomProdID which is not random",
},
events: []*Event{
{
Summary: "Event #1",
Description: `Lorem Ipsum
Dolor sit amet`,
UID: "randommduid",
Timestamp: time.Unix(1543626724, 0).In(config.GetTimeZone()),
Start: time.Unix(1543626724, 0).In(config.GetTimeZone()),
End: time.Unix(1543627824, 0).In(config.GetTimeZone()),
},
},
},
wantCaldavevents: `BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
X-PUBLISHED-TTL:PT4H
X-WR-CALNAME:test
PRODID:-//RandomProdID which is not random//EN
BEGIN:VEVENT
UID:randommduid
SUMMARY:Event #1
DESCRIPTION:Lorem Ipsum\nDolor sit amet
DTSTAMP:20181201T011204
DTSTART:20181201T011204
DTEND:20181201T013024
END:VEVENT
END:VCALENDAR`,
},
}
@ -248,3 +292,129 @@ END:VCALENDAR`,
})
}
}
func TestParseTodos(t *testing.T) {
type args struct {
config *Config
todos []*Todo
}
tests := []struct {
name string
args args
wantCaldavtasks string
}{
{
name: "Test caldavparsing with multiline description",
args: args{
config: &Config{
Name: "test",
ProdID: "RandomProdID which is not random",
Color: "ffffff",
},
todos: []*Todo{
{
Summary: "Todo #1",
Description: `Lorem Ipsum
Dolor sit amet`,
UID: "randommduid",
Timestamp: time.Unix(1543626724, 0).In(config.GetTimeZone()),
Color: "affffe",
},
},
},
wantCaldavtasks: `BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
X-PUBLISHED-TTL:PT4H
X-WR-CALNAME:test
PRODID:-//RandomProdID which is not random//EN
X-APPLE-CALENDAR-COLOR:#ffffffFF
X-OUTLOOK-COLOR:#ffffffFF
X-FUNAMBOL-COLOR:#ffffffFF
BEGIN:VTODO
UID:randommduid
DTSTAMP:20181201T011204
SUMMARY:Todo #1
X-APPLE-CALENDAR-COLOR:#affffeFF
X-OUTLOOK-COLOR:#affffeFF
X-FUNAMBOL-COLOR:#affffeFF
DESCRIPTION:Lorem Ipsum\nDolor sit amet
LAST-MODIFIED:00010101T000000
END:VTODO
END:VCALENDAR`,
},
{
name: "Test caldavparsing with completed task",
args: args{
config: &Config{
Name: "test",
ProdID: "RandomProdID which is not random",
},
todos: []*Todo{
{
Summary: "Todo #1",
Description: "Lorem Ipsum",
UID: "randommduid",
Timestamp: time.Unix(1543626724, 0).In(config.GetTimeZone()),
Completed: time.Unix(1543627824, 0).In(config.GetTimeZone()),
},
},
},
wantCaldavtasks: `BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
X-PUBLISHED-TTL:PT4H
X-WR-CALNAME:test
PRODID:-//RandomProdID which is not random//EN
BEGIN:VTODO
UID:randommduid
DTSTAMP:20181201T011204
SUMMARY:Todo #1
DESCRIPTION:Lorem Ipsum
COMPLETED:20181201T013024
STATUS:COMPLETED
LAST-MODIFIED:00010101T000000
END:VTODO
END:VCALENDAR`,
},
{
name: "with priority",
args: args{
config: &Config{
Name: "test",
ProdID: "RandomProdID which is not random",
},
todos: []*Todo{
{
Summary: "Todo #1",
Description: "Lorem Ipsum",
UID: "randommduid",
Priority: 1,
Timestamp: time.Unix(1543626724, 0).In(config.GetTimeZone()),
},
},
},
wantCaldavtasks: `BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
X-PUBLISHED-TTL:PT4H
X-WR-CALNAME:test
PRODID:-//RandomProdID which is not random//EN
BEGIN:VTODO
UID:randommduid
DTSTAMP:20181201T011204
SUMMARY:Todo #1
DESCRIPTION:Lorem Ipsum
PRIORITY:9
LAST-MODIFIED:00010101T000000
END:VTODO
END:VCALENDAR`,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
gotCaldavtasks := ParseTodos(tt.args.config, tt.args.todos)
assert.Equal(t, gotCaldavtasks, tt.wantCaldavtasks)
})
}
}

View File

@ -1,39 +1,40 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2020 Vikunja and contributors. All rights reserved.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package caldav
import (
"code.vikunja.io/api/pkg/caldav"
"strconv"
"strings"
"time"
"code.vikunja.io/api/pkg/log"
"code.vikunja.io/api/pkg/models"
"github.com/laurent22/ical-go"
"strconv"
"time"
)
func getCaldavTodosForTasks(list *models.List) string {
func GetCaldavTodosForTasks(list *models.ListWithTasksAndBuckets, listTasks []*models.TaskWithComments) string {
// Make caldav todos from Vikunja todos
var caldavtodos []*caldav.Todo
for _, t := range list.Tasks {
var caldavtodos []*Todo
for _, t := range listTasks {
duration := t.EndDate.Sub(t.StartDate)
caldavtodos = append(caldavtodos, &caldav.Todo{
caldavtodos = append(caldavtodos, &Todo{
Timestamp: t.Updated,
UID: t.UID,
Summary: t.Title,
@ -50,15 +51,15 @@ func getCaldavTodosForTasks(list *models.List) string {
})
}
caldavConfig := &caldav.Config{
caldavConfig := &Config{
Name: list.Title,
ProdID: "Vikunja Todo App",
}
return caldav.ParseTodos(caldavConfig, caldavtodos)
return ParseTodos(caldavConfig, caldavtodos)
}
func parseTaskFromVTODO(content string) (vTask *models.Task, err error) {
func ParseTaskFromVTODO(content string) (vTask *models.Task, err error) {
parsed, err := ical.ParseCalendar(content)
if err != nil {
return nil, err
@ -76,13 +77,15 @@ func parseTaskFromVTODO(content string) (vTask *models.Task, err error) {
}
}
// Parse the UID
// Parse the priority
var priority int64
if _, ok := task["PRIORITY"]; ok {
priority, err = strconv.ParseInt(task["PRIORITY"], 10, 64)
priorityParsed, err := strconv.ParseInt(task["PRIORITY"], 10, 64)
if err != nil {
return nil, err
}
priority = parseVTODOPriority(priorityParsed)
}
// Parse the enddate
@ -110,12 +113,19 @@ func parseTaskFromVTODO(content string) (vTask *models.Task, err error) {
return
}
// https://tools.ietf.org/html/rfc5545#section-3.3.5
func caldavTimeToTimestamp(tstring string) time.Time {
if tstring == "" {
return time.Time{}
}
t, err := time.Parse(caldav.DateFormat, tstring)
format := DateFormat
if strings.HasSuffix(tstring, "Z") {
format = `20060102T150405Z`
}
t, err := time.Parse(format, tstring)
if err != nil {
log.Warningf("Error while parsing caldav time %s to TimeStamp: %s", tstring, err)
return time.Time{}

101
pkg/caldav/parsing_test.go Normal file
View File

@ -0,0 +1,101 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package caldav
import (
"testing"
"time"
"code.vikunja.io/api/pkg/config"
"code.vikunja.io/api/pkg/models"
"gopkg.in/d4l3k/messagediff.v1"
)
func TestParseTaskFromVTODO(t *testing.T) {
type args struct {
content string
}
tests := []struct {
name string
args args
wantVTask *models.Task
wantErr bool
}{
{
name: "normal",
args: args{content: `BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
X-PUBLISHED-TTL:PT4H
X-WR-CALNAME:test
PRODID:-//RandomProdID which is not random//EN
BEGIN:VTODO
UID:randomuid
DTSTAMP:20181201T011204
SUMMARY:Todo #1
DESCRIPTION:Lorem Ipsum
LAST-MODIFIED:00010101T000000
END:VTODO
END:VCALENDAR`,
},
wantVTask: &models.Task{
Title: "Todo #1",
UID: "randomuid",
Description: "Lorem Ipsum",
Updated: time.Unix(1543626724, 0).In(config.GetTimeZone()),
},
},
{
name: "With priority",
args: args{content: `BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
X-PUBLISHED-TTL:PT4H
X-WR-CALNAME:test
PRODID:-//RandomProdID which is not random//EN
BEGIN:VTODO
UID:randomuid
DTSTAMP:20181201T011204
SUMMARY:Todo #1
DESCRIPTION:Lorem Ipsum
PRIORITY:9
LAST-MODIFIED:00010101T000000
END:VTODO
END:VCALENDAR`,
},
wantVTask: &models.Task{
Title: "Todo #1",
UID: "randomuid",
Description: "Lorem Ipsum",
Priority: 1,
Updated: time.Unix(1543626724, 0).In(config.GetTimeZone()),
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := ParseTaskFromVTODO(tt.args.content)
if (err != nil) != tt.wantErr {
t.Errorf("ParseTaskFromVTODO() error = %v, wantErr %v", err, tt.wantErr)
return
}
if diff, equal := messagediff.PrettyDiff(got, tt.wantVTask); !equal {
t.Errorf("ParseTaskFromVTODO() gotVTask = %v, want %v, diff = %s", got, tt.wantVTask, diff)
}
})
}
}

66
pkg/caldav/priority.go Normal file
View File

@ -0,0 +1,66 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package caldav
// In caldav, priority values are an int from 0 to 9 where 1 is the highest priority and 9 the lowest. 0 is "unset".
// Vikunja only has priorites from 0 to 5 where 0 is unset and 5 is the highest
// See https://icalendar.org/iCalendar-RFC-5545/3-8-1-9-priority.html
func mapPriorityToCaldav(priority int64) (caldavPriority int) {
switch priority {
case 0:
return 0
case 1: // Low
return 9
case 2: // Medium
return 5
case 3: // High
return 3
case 4: // Urgent
return 2
case 5: // DO NOW
return 1
}
return 0
}
// See mapPriorityToCaldav
func parseVTODOPriority(priority int64) (vikunjaPriority int64) {
switch priority {
case 0:
return 0
case 1:
return 5
case 2:
return 4
case 3:
return 3
case 4:
return 3
case 5:
return 2
case 6:
return 1
case 7:
return 1
case 8:
return 1
case 9:
return 1
}
return 0
}

131
pkg/caldav/priority_test.go Normal file
View File

@ -0,0 +1,131 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package caldav
import "testing"
func Test_parseVTODOPriority(t *testing.T) {
tests := []struct {
name string
priority int64
want int64
}{
{
name: "unset",
priority: 0,
want: 0,
},
{
name: "DO NOW",
priority: 1,
want: 5,
},
{
name: "urgent",
priority: 2,
want: 4,
},
{
name: "high 1",
priority: 3,
want: 3,
},
{
name: "high 2",
priority: 4,
want: 3,
},
{
name: "medium",
priority: 5,
want: 2,
},
{
name: "low 1",
priority: 6,
want: 1,
},
{
name: "low 2",
priority: 7,
want: 1,
},
{
name: "low 3",
priority: 8,
want: 1,
},
{
name: "low 4",
priority: 9,
want: 1,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if gotVikunjaPriority := parseVTODOPriority(tt.priority); gotVikunjaPriority != tt.want {
t.Errorf("parseVTODOPriority() = %v, want %v", gotVikunjaPriority, tt.want)
}
})
}
}
func Test_mapPriorityToCaldav(t *testing.T) {
tests := []struct {
name string
priority int64
wantCaldavPriority int
}{
{
name: "unset",
priority: 0,
wantCaldavPriority: 0,
},
{
name: "low",
priority: 1,
wantCaldavPriority: 9,
},
{
name: "medium",
priority: 2,
wantCaldavPriority: 5,
},
{
name: "high",
priority: 3,
wantCaldavPriority: 3,
},
{
name: "urgent",
priority: 4,
wantCaldavPriority: 2,
},
{
name: "DO NOW",
priority: 5,
wantCaldavPriority: 1,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if gotCaldavPriority := mapPriorityToCaldav(tt.priority); gotCaldavPriority != tt.wantCaldavPriority {
t.Errorf("mapPriorityToCaldav() = %v, want %v", gotCaldavPriority, tt.wantCaldavPriority)
}
})
}
}

View File

@ -1,25 +1,26 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2020 Vikunja and contributors. All rights reserved.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package cmd
import (
"fmt"
"github.com/spf13/cobra"
"os"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{

View File

@ -1,27 +1,28 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2020 Vikunja and contributors. All rights reserved.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package cmd
import (
"time"
"code.vikunja.io/api/pkg/initialize"
"code.vikunja.io/api/pkg/log"
"code.vikunja.io/api/pkg/modules/dump"
"github.com/spf13/cobra"
"time"
)
func init() {

View File

@ -1,17 +1,17 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2020 Vikunja and contributors. All rights reserved.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package cmd

View File

@ -1,17 +1,17 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2020 Vikunja and contributors. All rights reserved.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package cmd

View File

@ -1,25 +1,27 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2020 Vikunja and contributors. All rights reserved.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package cmd
import (
"code.vikunja.io/api/pkg/config"
"code.vikunja.io/api/pkg/initialize"
"code.vikunja.io/api/pkg/log"
"code.vikunja.io/api/pkg/mail"
"code.vikunja.io/api/pkg/notifications"
"github.com/spf13/cobra"
)
@ -39,8 +41,20 @@ var testmailCmd = &cobra.Command{
},
Run: func(cmd *cobra.Command, args []string) {
log.Info("Sending testmail...")
email := args[0]
if err := mail.SendTestMail(email); err != nil {
message := notifications.NewMail().
From("Vikunja <"+config.MailerFromEmail.GetString()+">").
To(args[0]).
Subject("Test from Vikunja").
Line("This is a test mail!").
Line("If you received this, Vikunja is correctly set up to send emails.").
Action("Go to your instance", config.ServiceFrontendurl.GetString())
opts, err := notifications.RenderMail(message)
if err != nil {
log.Errorf("Error sending test mail: %s", err.Error())
return
}
if err := mail.SendTestMail(opts); err != nil {
log.Errorf("Error sending test mail: %s", err.Error())
return
}

365
pkg/cmd/user.go Normal file
View File

@ -0,0 +1,365 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package cmd
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
"time"
"code.vikunja.io/api/pkg/db"
"code.vikunja.io/api/pkg/initialize"
"code.vikunja.io/api/pkg/log"
"code.vikunja.io/api/pkg/models"
"code.vikunja.io/api/pkg/user"
"github.com/olekukonko/tablewriter"
"github.com/spf13/cobra"
"golang.org/x/term"
"xorm.io/xorm"
)
var (
userFlagUsername string
userFlagEmail string
userFlagPassword string
userFlagAvatar = "default"
userFlagResetPasswordDirectly bool
userFlagEnableUser bool
userFlagDisableUser bool
userFlagDeleteNow bool
)
func init() {
// User create flags
userCreateCmd.Flags().StringVarP(&userFlagUsername, "username", "u", "", "The username of the new user.")
_ = userCreateCmd.MarkFlagRequired("username")
userCreateCmd.Flags().StringVarP(&userFlagEmail, "email", "e", "", "The email address of the new user.")
_ = userCreateCmd.MarkFlagRequired("email")
userCreateCmd.Flags().StringVarP(&userFlagPassword, "password", "p", "", "The password of the new user. You will be asked to enter it if not provided through the flag.")
userCreateCmd.Flags().StringVarP(&userFlagAvatar, "avatar-provider", "a", "", "The avatar provider of the new user. Optional.")
// User update flags
userUpdateCmd.Flags().StringVarP(&userFlagUsername, "username", "u", "", "The new username of the user.")
userUpdateCmd.Flags().StringVarP(&userFlagEmail, "email", "e", "", "The new email address of the user.")
userUpdateCmd.Flags().StringVarP(&userFlagAvatar, "avatar-provider", "a", "", "The new avatar provider of the new user.")
// Reset PW flags
userResetPasswordCmd.Flags().BoolVarP(&userFlagResetPasswordDirectly, "direct", "d", false, "If provided, reset the password directly instead of sending the user a reset mail.")
userResetPasswordCmd.Flags().StringVarP(&userFlagPassword, "password", "p", "", "The new password of the user. Only used in combination with --direct. You will be asked to enter it if not provided through the flag.")
// Change status flags
userChangeEnabledCmd.Flags().BoolVarP(&userFlagDisableUser, "disable", "d", false, "Disable the user.")
userChangeEnabledCmd.Flags().BoolVarP(&userFlagEnableUser, "enable", "e", false, "Enable the user.")
// User deletion flags
userDeleteCmd.Flags().BoolVarP(&userFlagDeleteNow, "now", "n", false, "If provided, deletes the user immediately instead of sending them an email first.")
userCmd.AddCommand(userListCmd, userCreateCmd, userUpdateCmd, userResetPasswordCmd, userChangeEnabledCmd, userDeleteCmd)
rootCmd.AddCommand(userCmd)
}
func getPasswordFromFlagOrInput() (pw string) {
pw = userFlagPassword
if userFlagPassword == "" {
fmt.Print("Enter Password: ")
bytePW, err := term.ReadPassword(int(os.Stdin.Fd()))
if err != nil {
log.Fatalf("Error reading password: %s", err)
}
fmt.Printf("\nConfirm Password: ")
byteConfirmPW, err := term.ReadPassword(int(os.Stdin.Fd()))
if err != nil {
log.Fatalf("Error reading password: %s", err)
}
if string(bytePW) != string(byteConfirmPW) {
log.Critical("Passwords don't match!")
}
fmt.Printf("\n")
pw = strings.TrimSpace(string(bytePW))
}
return
}
func getUserFromArg(s *xorm.Session, arg string) *user.User {
id, err := strconv.ParseInt(arg, 10, 64)
if err != nil {
log.Fatalf("Invalid user id: %s", err)
}
u, err := user.GetUserByID(s, id)
if err != nil {
log.Fatalf("Could not get user: %s", err)
}
return u
}
var userCmd = &cobra.Command{
Use: "user",
Short: "Manage users locally through the cli.",
}
var userListCmd = &cobra.Command{
Use: "list",
Short: "Shows a list of all users.",
PreRun: func(cmd *cobra.Command, args []string) {
initialize.FullInit()
},
Run: func(cmd *cobra.Command, args []string) {
s := db.NewSession()
defer s.Close()
users, err := user.ListAllUsers(s)
if err != nil {
_ = s.Rollback()
log.Fatalf("Error getting users: %s", err)
}
if err := s.Commit(); err != nil {
log.Fatalf("Error getting users: %s", err)
}
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{
"ID",
"Username",
"Email",
"Status",
"Created",
"Updated",
})
for _, u := range users {
table.Append([]string{
strconv.FormatInt(u.ID, 10),
u.Username,
u.Email,
u.Status.String(),
u.Created.Format(time.RFC3339),
u.Updated.Format(time.RFC3339),
})
}
table.Render()
},
}
var userCreateCmd = &cobra.Command{
Use: "create",
Short: "Create a new user.",
PreRun: func(cmd *cobra.Command, args []string) {
initialize.FullInit()
},
Run: func(cmd *cobra.Command, args []string) {
s := db.NewSession()
defer s.Close()
u := &user.User{
Username: userFlagUsername,
Email: userFlagEmail,
Password: getPasswordFromFlagOrInput(),
}
newUser, err := user.CreateUser(s, u)
if err != nil {
_ = s.Rollback()
log.Fatalf("Error creating new user: %s", err)
}
err = models.CreateNewNamespaceForUser(s, newUser)
if err != nil {
_ = s.Rollback()
log.Fatalf("Error creating new namespace for user: %s", err)
}
if err := s.Commit(); err != nil {
log.Fatalf("Error saving everything: %s", err)
}
fmt.Printf("\nUser was created successfully.\n")
},
}
var userUpdateCmd = &cobra.Command{
Use: "update [user id]",
Short: "Update an existing user.",
Args: cobra.ExactArgs(1),
PreRun: func(cmd *cobra.Command, args []string) {
initialize.FullInit()
},
Run: func(cmd *cobra.Command, args []string) {
s := db.NewSession()
defer s.Close()
u := getUserFromArg(s, args[0])
if userFlagUsername != "" {
u.Username = userFlagUsername
}
if userFlagEmail != "" {
u.Email = userFlagEmail
}
if userFlagAvatar != "default" {
u.AvatarProvider = userFlagAvatar
}
_, err := user.UpdateUser(s, u)
if err != nil {
_ = s.Rollback()
log.Fatalf("Error updating the user: %s", err)
}
if err := s.Commit(); err != nil {
log.Fatalf("Error saving everything: %s", err)
}
fmt.Println("User updated successfully.")
},
}
var userResetPasswordCmd = &cobra.Command{
Use: "reset-password [user id]",
Short: "Reset a users password, either through mailing them a reset link or directly.",
PreRun: func(cmd *cobra.Command, args []string) {
initialize.FullInit()
},
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
s := db.NewSession()
defer s.Close()
u := getUserFromArg(s, args[0])
// By default we reset as usual, only with specific flag directly.
if userFlagResetPasswordDirectly {
err := user.UpdateUserPassword(s, u, getPasswordFromFlagOrInput())
if err != nil {
_ = s.Rollback()
log.Fatalf("Could not update user password: %s", err)
}
fmt.Println("Password updated successfully.")
} else {
err := user.RequestUserPasswordResetToken(s, u)
if err != nil {
_ = s.Rollback()
log.Fatalf("Could not send password reset email: %s", err)
}
fmt.Println("Password reset email sent successfully.")
}
if err := s.Commit(); err != nil {
log.Fatalf("Could not send password reset email: %s", err)
}
},
}
var userChangeEnabledCmd = &cobra.Command{
Use: "change-status [user id]",
Short: "Enable or disable a user. Will toggle the current status if no flag (--enable or --disable) is provided.",
PreRun: func(cmd *cobra.Command, args []string) {
initialize.FullInit()
},
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
s := db.NewSession()
defer s.Close()
u := getUserFromArg(s, args[0])
if userFlagEnableUser {
u.Status = user.StatusActive
} else if userFlagDisableUser {
u.Status = user.StatusDisabled
} else {
if u.Status == user.StatusActive {
u.Status = user.StatusDisabled
} else {
u.Status = user.StatusActive
}
}
_, err := user.UpdateUser(s, u)
if err != nil {
_ = s.Rollback()
log.Fatalf("Could not enable the user")
}
if err := s.Commit(); err != nil {
log.Fatalf("Error saving everything: %s", err)
}
fmt.Printf("User status successfully changed, status is now \"%s\"\n", u.Status)
},
}
var userDeleteCmd = &cobra.Command{
Use: "delete [user id]",
Short: "Delete an existing user.",
Long: "Kick off the user deletion process. If call without the --now flag, this command will only trigger an email to the user in order for them to confirm and start the deletion process. With the flag the user is deleted immediately. USE WITH CAUTION.",
Args: cobra.ExactArgs(1),
PreRun: func(cmd *cobra.Command, args []string) {
initialize.FullInit()
},
Run: func(cmd *cobra.Command, args []string) {
if userFlagDeleteNow {
fmt.Println("You requested to delete the user immediately. Are you sure?")
fmt.Println(`To confirm, please type "yes, I confirm" in all uppercase:`)
cr := bufio.NewReader(os.Stdin)
text, err := cr.ReadString('\n')
if err != nil {
log.Fatalf("could not read confirmation message: %s", err)
}
if text != "YES, I CONFIRM\n" {
log.Fatalf("invalid confirmation message")
}
}
s := db.NewSession()
defer s.Close()
if err := s.Begin(); err != nil {
log.Fatalf("Count not start transaction: %s", err)
}
u := getUserFromArg(s, args[0])
if userFlagDeleteNow {
err := models.DeleteUser(s, u)
if err != nil {
_ = s.Rollback()
log.Fatalf("Error removing the user: %s", err)
}
} else {
err := user.RequestDeletion(s, u)
if err != nil {
_ = s.Rollback()
log.Fatalf("Could not request user deletion: %s", err)
}
}
if err := s.Commit(); err != nil {
log.Fatalf("Error saving everything: %s", err)
}
if userFlagDeleteNow {
fmt.Println("User deleted successfully.")
} else {
fmt.Println("User scheduled for deletion successfully.")
}
},
}

View File

@ -1,26 +1,27 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2020 Vikunja and contributors. All rights reserved.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package cmd
import (
"code.vikunja.io/api/pkg/version"
"fmt"
"github.com/spf13/cobra"
"runtime"
"code.vikunja.io/api/pkg/version"
"github.com/spf13/cobra"
)
func init() {

View File

@ -1,39 +1,70 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2020 Vikunja and contributors. All rights reserved.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package cmd
import (
"context"
"net"
"os"
"os/signal"
"time"
"code.vikunja.io/api/pkg/cron"
"code.vikunja.io/api/pkg/config"
"code.vikunja.io/api/pkg/initialize"
"code.vikunja.io/api/pkg/log"
"code.vikunja.io/api/pkg/routes"
"code.vikunja.io/api/pkg/swagger"
"code.vikunja.io/api/pkg/utils"
"code.vikunja.io/api/pkg/version"
"context"
"github.com/labstack/echo/v4"
"github.com/spf13/cobra"
"os"
"os/signal"
"time"
)
func init() {
rootCmd.AddCommand(webCmd)
}
func setupUnixSocket(e *echo.Echo) error {
path := config.ServiceUnixSocket.GetString()
// Remove old unix socket that may have remained after a crash
if err := os.Remove(path); err != nil && !os.IsNotExist(err) {
return err
}
if config.ServiceUnixSocketMode.Get() != nil {
// Use Umask instead of Chmod to prevent insecure race condition
// (no-op on Windows)
mode := config.ServiceUnixSocketMode.GetInt()
oldmask := utils.Umask(0o777 &^ mode)
defer utils.Umask(oldmask)
}
l, err := net.Listen("unix", path)
if err != nil {
return err
}
e.Listener = l
return nil
}
var webCmd = &cobra.Command{
Use: "web",
Short: "Starts the rest api web server",
@ -53,6 +84,12 @@ var webCmd = &cobra.Command{
routes.RegisterRoutes(e)
// Start server
go func() {
// Listen unix socket if needed (ServiceInterface will be ignored)
if config.ServiceUnixSocket.GetString() != "" {
if err := setupUnixSocket(e); err != nil {
e.Logger.Fatal(err)
}
}
if err := e.Start(config.ServiceInterface.GetString()); err != nil {
e.Logger.Info("shutting down...")
}
@ -69,5 +106,6 @@ var webCmd = &cobra.Command{
if err := e.Shutdown(ctx); err != nil {
e.Logger.Fatal(err)
}
cron.Stop()
},
}

View File

@ -1,17 +1,17 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2020 Vikunja and contributors. All rights reserved.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package config
@ -25,8 +25,8 @@ import (
"path/filepath"
"strings"
"time"
_ "time/tzdata" // Imports time zone data instead of relying on the os
"4d63.com/tz"
"github.com/spf13/viper"
)
@ -36,12 +36,15 @@ type Key string
// These constants hold all config value keys
const (
// #nosec
ServiceJWTSecret Key = `service.JWTSecret`
ServiceInterface Key = `service.interface`
ServiceFrontendurl Key = `service.frontendurl`
ServiceEnableCaldav Key = `service.enablecaldav`
ServiceRootpath Key = `service.rootpath`
ServiceMaxItemsPerPage Key = `service.maxitemsperpage`
ServiceJWTSecret Key = `service.JWTSecret`
ServiceInterface Key = `service.interface`
ServiceUnixSocket Key = `service.unixsocket`
ServiceUnixSocketMode Key = `service.unixsocketmode`
ServiceFrontendurl Key = `service.frontendurl`
ServiceEnableCaldav Key = `service.enablecaldav`
ServiceRootpath Key = `service.rootpath`
ServiceMaxItemsPerPage Key = `service.maxitemsperpage`
// Deprecated. Use metrics.enabled
ServiceEnableMetrics Key = `service.enablemetrics`
ServiceMotd Key = `service.motd`
ServiceEnableLinkSharing Key = `service.enablelinksharing`
@ -51,6 +54,17 @@ const (
ServiceEnableTaskComments Key = `service.enabletaskcomments`
ServiceEnableTotp Key = `service.enabletotp`
ServiceSentryDsn Key = `service.sentrydsn`
ServiceTestingtoken Key = `service.testingtoken`
ServiceEnableEmailReminders Key = `service.enableemailreminders`
ServiceEnableUserDeletion Key = `service.enableuserdeletion`
AuthLocalEnabled Key = `auth.local.enabled`
AuthOpenIDEnabled Key = `auth.openid.enabled`
AuthOpenIDRedirectURL Key = `auth.openid.redirecturl`
AuthOpenIDProviders Key = `auth.openid.providers`
LegalImprintURL Key = `legal.imprinturl`
LegalPrivacyURL Key = `legal.privacyurl`
DatabaseType Key = `database.type`
DatabaseHost Key = `database.host`
@ -62,6 +76,7 @@ const (
DatabaseMaxIdleConnections Key = `database.maxidleconnections`
DatabaseMaxConnectionLifetime Key = `database.maxconnectionlifetime`
DatabaseSslMode Key = `database.sslmode`
DatabaseTLS Key = `database.tls`
CacheEnabled Key = `cache.enabled`
CacheType Key = `cache.type`
@ -76,6 +91,7 @@ const (
MailerFromEmail Key = `mailer.fromemail`
MailerQueuelength Key = `mailer.queuelength`
MailerQueueTimeout Key = `mailer.queuetimeout`
MailerForceSSL Key = `mailer.forcessl`
RedisEnabled Key = `redis.enabled`
RedisHost Key = `redis.host`
@ -90,6 +106,8 @@ const (
LogHTTP Key = `log.http`
LogEcho Key = `log.echo`
LogPath Key = `log.path`
LogEvents Key = `log.events`
LogEventsLevel Key = `log.eventslevel`
RateLimitEnabled Key = `ratelimit.enabled`
RateLimitKind Key = `ratelimit.kind`
@ -100,20 +118,26 @@ const (
FilesBasePath Key = `files.basepath`
FilesMaxSize Key = `files.maxsize`
MigrationWunderlistEnable Key = `migration.wunderlist.enable`
MigrationWunderlistClientID Key = `migration.wunderlist.clientid`
MigrationWunderlistClientSecret Key = `migration.wunderlist.clientsecret`
MigrationWunderlistRedirectURL Key = `migration.wunderlist.redirecturl`
MigrationTodoistEnable Key = `migration.todoist.enable`
MigrationTodoistClientID Key = `migration.todoist.clientid`
MigrationTodoistClientSecret Key = `migration.todoist.clientsecret`
MigrationTodoistRedirectURL Key = `migration.todoist.redirecturl`
MigrationWunderlistEnable Key = `migration.wunderlist.enable`
MigrationWunderlistClientID Key = `migration.wunderlist.clientid`
MigrationWunderlistClientSecret Key = `migration.wunderlist.clientsecret`
MigrationWunderlistRedirectURL Key = `migration.wunderlist.redirecturl`
MigrationTodoistEnable Key = `migration.todoist.enable`
MigrationTodoistClientID Key = `migration.todoist.clientid`
MigrationTodoistClientSecret Key = `migration.todoist.clientsecret`
MigrationTodoistRedirectURL Key = `migration.todoist.redirecturl`
MigrationTrelloEnable Key = `migration.trello.enable`
MigrationTrelloKey Key = `migration.trello.key`
MigrationTrelloRedirectURL Key = `migration.trello.redirecturl`
MigrationMicrosoftTodoEnable Key = `migration.microsofttodo.enable`
MigrationMicrosoftTodoClientID Key = `migration.microsofttodo.clientid`
MigrationMicrosoftTodoClientSecret Key = `migration.microsofttodo.clientsecret`
MigrationMicrosoftTodoRedirectURL Key = `migration.microsofttodo.redirecturl`
CorsEnable Key = `cors.enable`
CorsOrigins Key = `cors.origins`
CorsMaxAge Key = `cors.maxage`
AvatarProvider Key = `avatar.provider`
AvatarGravaterExpiration Key = `avatar.gravatarexpiration`
BackgroundsEnabled Key = `backgrounds.enabled`
@ -121,6 +145,12 @@ const (
BackgroundsUnsplashEnabled Key = `backgrounds.providers.unsplash.enabled`
BackgroundsUnsplashAccessToken Key = `backgrounds.providers.unsplash.accesstoken`
BackgroundsUnsplashApplicationID Key = `backgrounds.providers.unsplash.applicationid`
KeyvalueType Key = `keyvalue.type`
MetricsEnabled Key = `metrics.enabled`
MetricsUsername Key = `metrics.username`
MetricsPassword Key = `metrics.password`
)
// GetString returns a string config value
@ -153,6 +183,11 @@ func (k Key) GetStringSlice() []string {
return viper.GetStringSlice(string(k))
}
// Get returns the raw value from a config option
func (k Key) Get() interface{} {
return viper.Get(string(k))
}
var timezone *time.Location
// GetTimeZone returns the time zone configured for vikunja
@ -160,7 +195,7 @@ var timezone *time.Location
// it way easier, especially when testing.
func GetTimeZone() *time.Location {
if timezone == nil {
loc, err := tz.LoadLocation(ServiceTimeZone.GetString())
loc, err := time.LoadLocation(ServiceTimeZone.GetString())
if err != nil {
fmt.Printf("Error parsing time zone: %s", err)
os.Exit(1)
@ -192,6 +227,7 @@ func InitDefaultConfig() {
// Service
ServiceJWTSecret.setDefault(random)
ServiceInterface.setDefault(":3456")
ServiceUnixSocket.setDefault("")
ServiceFrontendurl.setDefault("")
ServiceEnableCaldav.setDefault(true)
@ -210,6 +246,12 @@ func InitDefaultConfig() {
ServiceTimeZone.setDefault("GMT")
ServiceEnableTaskComments.setDefault(true)
ServiceEnableTotp.setDefault(true)
ServiceEnableEmailReminders.setDefault(true)
ServiceEnableUserDeletion.setDefault(true)
// Auth
AuthLocalEnabled.setDefault(true)
AuthOpenIDEnabled.setDefault(false)
// Database
DatabaseType.setDefault("sqlite")
@ -222,6 +264,7 @@ func InitDefaultConfig() {
DatabaseMaxIdleConnections.setDefault(50)
DatabaseMaxConnectionLifetime.setDefault(10000)
DatabaseSslMode.setDefault("disable")
DatabaseTLS.setDefault("false")
// Cacher
CacheEnabled.setDefault(false)
@ -237,6 +280,7 @@ func InitDefaultConfig() {
MailerFromEmail.setDefault("mail@vikunja")
MailerQueuelength.setDefault(100)
MailerQueueTimeout.setDefault(30)
MailerForceSSL.setDefault(false)
// Redis
RedisEnabled.setDefault(false)
RedisHost.setDefault("localhost:6379")
@ -251,6 +295,8 @@ func InitDefaultConfig() {
LogHTTP.setDefault("stdout")
LogEcho.setDefault("off")
LogPath.setDefault(ServiceRootpath.GetString() + "/logs")
LogEvents.setDefault("stdout")
LogEventsLevel.setDefault("INFO")
// Rate Limit
RateLimitEnabled.setDefault(false)
RateLimitKind.setDefault("user")
@ -267,13 +313,18 @@ func InitDefaultConfig() {
// Migration
MigrationWunderlistEnable.setDefault(false)
MigrationTodoistEnable.setDefault(false)
MigrationTrelloEnable.setDefault(false)
MigrationMicrosoftTodoEnable.setDefault(false)
// Avatar
AvatarProvider.setDefault("gravatar")
AvatarGravaterExpiration.setDefault(3600)
// List Backgrounds
BackgroundsEnabled.setDefault(true)
BackgroundsUploadEnabled.setDefault(true)
BackgroundsUnsplashEnabled.setDefault(false)
// Key Value
KeyvalueType.setDefault("memory")
// Metrics
MetricsEnabled.setDefault(false)
}
// InitConfig initializes the config, sets defaults etc.
@ -307,6 +358,39 @@ func InitConfig() {
return
}
if CacheType.GetString() == "keyvalue" {
CacheType.Set(KeyvalueType.GetString())
}
if RateLimitStore.GetString() == "keyvalue" {
RateLimitStore.Set(KeyvalueType.GetString())
}
if ServiceFrontendurl.GetString() != "" && !strings.HasSuffix(ServiceFrontendurl.GetString(), "/") {
ServiceFrontendurl.Set(ServiceFrontendurl.GetString() + "/")
}
if AuthOpenIDRedirectURL.GetString() == "" {
AuthOpenIDRedirectURL.Set(ServiceFrontendurl.GetString() + "auth/openid/")
}
if MigrationTodoistRedirectURL.GetString() == "" {
MigrationTodoistRedirectURL.Set(ServiceFrontendurl.GetString() + "migrate/todoist")
}
if MigrationTrelloRedirectURL.GetString() == "" {
MigrationTrelloRedirectURL.Set(ServiceFrontendurl.GetString() + "migrate/trello")
}
if MigrationMicrosoftTodoRedirectURL.GetString() == "" {
MigrationMicrosoftTodoRedirectURL.Set(ServiceFrontendurl.GetString() + "migrate/microsoft-todo")
}
if ServiceEnableMetrics.GetBool() {
log.Println("WARNING: service.enablemetrics is deprecated and will be removed in a future release. Please use metrics.enable.")
MetricsEnabled.Set(true)
}
log.Printf("Using config file: %s", viper.ConfigFileUsed())
}

40
pkg/cron/cron.go Normal file
View File

@ -0,0 +1,40 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package cron
import (
"github.com/robfig/cron/v3"
)
var c *cron.Cron
// Init starts the cron
func Init() {
c = cron.New()
c.Start()
}
// Schedule schedules a job as a cron job
func Schedule(schedule string, f func()) (err error) {
_, err = c.AddFunc(schedule, f)
return
}
// Stop stops the cron scheduler
func Stop() {
c.Stop()
}

View File

@ -1,35 +1,37 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2020 Vikunja and contributors. All rights reserved.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package db
import (
"code.vikunja.io/api/pkg/config"
"code.vikunja.io/api/pkg/log"
"encoding/gob"
"fmt"
xrc "gitea.com/xorm/xorm-redis-cache"
"net/url"
"os"
"strconv"
"strings"
"time"
"code.vikunja.io/api/pkg/config"
"code.vikunja.io/api/pkg/log"
xrc "gitea.com/xorm/xorm-redis-cache"
"xorm.io/core"
"xorm.io/xorm"
"xorm.io/xorm/caches"
"xorm.io/xorm/schemas"
_ "github.com/go-sql-driver/mysql" // Because.
_ "github.com/lib/pq" // Because.
@ -52,23 +54,24 @@ func CreateDBEngine() (engine *xorm.Engine, err error) {
}
// Use Mysql if set
if config.DatabaseType.GetString() == "mysql" {
switch config.DatabaseType.GetString() {
case "mysql":
engine, err = initMysqlEngine()
if err != nil {
return
}
} else if config.DatabaseType.GetString() == "postgres" {
case "postgres":
engine, err = initPostgresEngine()
if err != nil {
return
}
} else if config.DatabaseType.GetString() == "sqlite" {
case "sqlite":
// Otherwise use sqlite
engine, err = initSqliteEngine()
if err != nil {
return
}
} else {
default:
log.Fatalf("Unknown database type %s", config.DatabaseType.GetString())
}
@ -90,7 +93,7 @@ func CreateDBEngine() (engine *xorm.Engine, err error) {
cacher := caches.NewLRUCacher(caches.NewMemoryStore(), config.CacheMaxElementSize.GetInt())
engine.SetDefaultCacher(cacher)
case "redis":
cacher := xrc.NewRedisCacher(config.RedisEnabled.GetString(), config.RedisPassword.GetString(), xrc.DEFAULT_EXPIRATION, engine.Logger())
cacher := xrc.NewRedisCacher(config.RedisHost.GetString(), config.RedisPassword.GetString(), xrc.DEFAULT_EXPIRATION, engine.Logger())
engine.SetDefaultCacher(cacher)
default:
log.Info("Did not find a valid cache type. Caching disabled. Please refer to the docs for poosible cache types.")
@ -110,11 +113,12 @@ func initMysqlEngine() (engine *xorm.Engine, err error) {
// We're using utf8mb here instead of just utf8 because we want to use non-BMP characters.
// See https://stackoverflow.com/a/30074553/10924593 for more info.
connStr := fmt.Sprintf(
"%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=true",
"%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=true&tls=%s",
config.DatabaseUser.GetString(),
config.DatabasePassword.GetString(),
config.DatabaseHost.GetString(),
config.DatabaseDatabase.GetString())
config.DatabaseDatabase.GetString(),
config.DatabaseTLS.GetString())
engine, err = xorm.NewEngine("mysql", connStr)
if err != nil {
return
@ -209,3 +213,13 @@ func WipeEverything() error {
return nil
}
// NewSession creates a new xorm session
func NewSession() *xorm.Session {
return x.NewSession()
}
// Type returns the db type of the currently configured db
func Type() schemas.DBType {
return x.Dialect().URI().DBType
}

View File

@ -1,22 +1,26 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2020 Vikunja and contributors. All rights reserved.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package db
import "encoding/json"
import (
"encoding/json"
"xorm.io/xorm/schemas"
)
// Dump dumps all database tables
func Dump() (data map[string][]byte, err error) {
@ -43,6 +47,9 @@ func Dump() (data map[string][]byte, err error) {
// Restore restores a table with all its entries
func Restore(table string, contents []map[string]interface{}) (err error) {
if _, err := x.IsTableExist(table); err != nil {
return err
}
for _, content := range contents {
if _, err := x.Table(table).Insert(content); err != nil {
@ -52,3 +59,22 @@ func Restore(table string, contents []map[string]interface{}) (err error) {
return
}
// RestoreAndTruncate removes all content from the table before restoring it from the contents map
func RestoreAndTruncate(table string, contents []map[string]interface{}) (err error) {
if _, err := x.IsTableExist(table); err != nil {
return err
}
if x.Dialect().URI().DBType == schemas.SQLITE {
if _, err := x.Query("DELETE FROM " + table); err != nil {
return err
}
} else {
if _, err := x.Query("TRUNCATE TABLE ?", table); err != nil {
return err
}
}
return Restore(table, contents)
}

View File

@ -2,24 +2,31 @@
title: testbucket1
list_id: 1
created_by_id: 1
limit: 9999999 # This bucket has a limit we will never exceed in the tests to make sure the logic allows for buckets with limits
position: 2
created: 2020-04-18 21:13:52
updated: 2020-04-18 21:13:52
- id: 2
title: testbucket2
list_id: 1
created_by_id: 1
limit: 3
position: 1
created: 2020-04-18 21:13:52
updated: 2020-04-18 21:13:52
- id: 3
title: testbucket3
list_id: 1
created_by_id: 1
is_done_bucket: 1
position: 3
created: 2020-04-18 21:13:52
updated: 2020-04-18 21:13:52
- id: 4
title: testbucket4 - other list
list_id: 2
created_by_id: 1
is_done_bucket: 1
created: 2020-04-18 21:13:52
updated: 2020-04-18 21:13:52
# The following are not or only partly owned by user 1
@ -205,3 +212,9 @@
created_by_id: 1
created: 2020-04-18 21:13:52
updated: 2020-04-18 21:13:52
- id: 35
title: testbucket35
list_id: 23
created_by_id: -2
created: 2020-04-18 21:13:52
updated: 2020-04-18 21:13:52

View File

@ -0,0 +1,21 @@
- entity_id: 1
user_id: 1
kind: 1
- entity_id: 15
user_id: 6 # owner
kind: 1
- entity_id: 15
user_id: 1
kind: 1
- entity_id: 34
user_id: 13 # owner
kind: 1
- entity_id: 34
user_id: 1
kind: 1
- entity_id: 23
user_id: 12 # owner
kind: 2
- entity_id: 23
user_id: 1
kind: 2

View File

@ -22,3 +22,12 @@
shared_by_id: 1
created: 2018-12-01 15:13:12
updated: 2018-12-02 15:13:12
- id: 4
hash: testWithPassword
list_id: 1
right: 0
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
sharing_type: 2
shared_by_id: 1
created: 2018-12-01 15:13:12
updated: 2018-12-02 15:13:12

View File

@ -5,6 +5,7 @@
identifier: test1
owner_id: 1
namespace_id: 1
position: 3
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -14,6 +15,7 @@
identifier: test2
owner_id: 3
namespace_id: 1
position: 2
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -23,6 +25,7 @@
identifier: test3
owner_id: 3
namespace_id: 2
position: 1
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -32,6 +35,7 @@
identifier: test4
owner_id: 3
namespace_id: 3
position: 4
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -41,6 +45,7 @@
identifier: test5
owner_id: 5
namespace_id: 5
position: 5
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -50,6 +55,7 @@
identifier: test6
owner_id: 6
namespace_id: 6
position: 6
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -59,6 +65,7 @@
identifier: test7
owner_id: 6
namespace_id: 6
position: 7
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -68,6 +75,7 @@
identifier: test8
owner_id: 6
namespace_id: 6
position: 8
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -77,6 +85,7 @@
identifier: test9
owner_id: 6
namespace_id: 6
position: 9
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -86,6 +95,7 @@
identifier: test10
owner_id: 6
namespace_id: 6
position: 10
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -95,6 +105,7 @@
identifier: test11
owner_id: 6
namespace_id: 6
position: 11
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -104,6 +115,7 @@
identifier: test12
owner_id: 6
namespace_id: 7
position: 12
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -113,6 +125,7 @@
identifier: test13
owner_id: 6
namespace_id: 8
position: 13
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -122,6 +135,7 @@
identifier: test14
owner_id: 6
namespace_id: 9
position: 14
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -131,6 +145,7 @@
identifier: test15
owner_id: 6
namespace_id: 10
position: 15
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -140,6 +155,7 @@
identifier: test16
owner_id: 6
namespace_id: 11
position: 16
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -149,6 +165,7 @@
identifier: test17
owner_id: 6
namespace_id: 12
position: 17
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
# This list is owned by user 7, and several other users have access to it via different methods.
@ -160,6 +177,7 @@
identifier: test18
owner_id: 7
namespace_id: 13
position: 18
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -169,8 +187,10 @@
identifier: test19
owner_id: 7
namespace_id: 14
position: 19
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
# User 1 does not have access to this list
-
id: 20
title: Test20
@ -178,6 +198,7 @@
identifier: test20
owner_id: 13
namespace_id: 15
position: 20
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -187,6 +208,7 @@
identifier: test21
owner_id: 1
namespace_id: 16
position: 21
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -197,5 +219,26 @@
owner_id: 1
namespace_id: 1
is_archived: 1
position: 22
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
id: 23
title: Test23
description: Lorem Ipsum
identifier: test23
owner_id: 12
namespace_id: 17
position: 23
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
id: 24
title: Test24
description: Lorem Ipsum
identifier: test6
owner_id: 6
namespace_id: 6
position: 7
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12

View File

@ -82,3 +82,9 @@
is_archived: 1
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
- id: 17
title: testnamespace17
description: Lorem Ipsum
owner_id: 12
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12

View File

@ -0,0 +1,6 @@
- id: 1
filters: '{"sort_by":null,"order_by":null,"filter_by":["start_date","end_date","due_date"],"filter_value":["2018-12-11T03:46:40+00:00","2018-12-13T11:20:01+00:00","2018-11-29T14:00:00+00:00"],"filter_comparator":["greater","less","greater"],"filter_concat":"","filter_include_nulls":false}'
title: testfilter1
owner_id: 1
updated: 2020-09-08 15:13:12
created: 2020-09-08 14:13:12

View File

@ -0,0 +1,35 @@
- id: 1
entity_type: 3 # Task
entity_id: 2
user_id: 1
created: 2021-02-01 15:13:12
- id: 2
entity_type: 1 # Namespace
entity_id: 6
user_id: 6
created: 2021-02-01 15:13:12
- id: 3
entity_type: 2 # List
entity_id: 12 # belongs to namespace 7
user_id: 6
created: 2021-02-01 15:13:12
- id: 4
entity_type: 3 # Task
entity_id: 22 # belongs to list 13 which belongs to namespace 8
user_id: 6
created: 2021-02-01 15:13:12
- id: 5
entity_type: 1 # Namespace
entity_id: 8
user_id: 6
created: 2021-02-01 15:13:12
- id: 6
entity_type: 2 # List
entity_id: 13
user_id: 6
created: 2021-02-01 15:13:12
- id: 7
entity_type: 3 # Task
entity_id: 26
user_id: 6
created: 2021-02-01 15:13:12

View File

@ -9,3 +9,8 @@
file_id: 9999
created_by_id: 1
created: 2018-12-01 15:13:12
- id: 3
task_id: 1
file_id: 1
created_by_id: -2
created: 2018-12-01 15:13:12

View File

@ -94,3 +94,9 @@
task_id: 36
created: 2020-02-19 18:07:06
updated: 2020-02-19 18:07:06
- id: 17
comment: comment 17
author_id: -2
task_id: 35
created: 2020-02-19 18:07:06
updated: 2020-02-19 18:07:06

View File

@ -6,3 +6,7 @@
task_id: 27
reminder: 2018-12-01 01:13:44
created: 2018-12-01 01:12:04
- id: 3
task_id: 2
reminder: 2018-12-01 01:13:44
created: 2018-12-01 01:12:04

View File

@ -8,6 +8,7 @@
created: 2018-12-01 01:12:04
updated: 2018-12-01 01:12:04
bucket_id: 1
position: 2
- id: 2
title: 'task #2 done'
done: true
@ -17,6 +18,7 @@
created: 2018-12-01 01:12:04
updated: 2018-12-01 01:12:04
bucket_id: 1
position: 4
- id: 3
title: 'task #3 high prio'
done: false
@ -335,5 +337,20 @@
bucket_id: 20
created: 2018-12-01 01:12:04
updated: 2018-12-01 01:12:04
- id: 37
title: 'task #37'
done: false
created_by_id: -2
list_id: 2
index: 2
created: 2018-12-01 01:12:04
updated: 2018-12-01 01:12:04
- id: 38
title: 'task #37 done with due date'
done: true
created_by_id: 1
list_id: 22
index: 2
created: 2018-12-01 01:12:04
updated: 2018-12-01 01:12:04
due_date: 2018-10-30 22:25:24

View File

@ -45,4 +45,10 @@
list_id: 19
right: 2
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
created: 2018-12-01 15:13:12
- id: 8
team_id: 1
list_id: 21
right: 0
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12

View File

@ -0,0 +1,18 @@
-
id: 1
user_id: 3
token: 'passwordresettesttoken'
kind: 1
created: 2021-07-12 00:00:11
-
id: 2
user_id: 4
token: 'tiepiQueed8ahc7zeeFe1eveiy4Ein8osooxegiephauph2Ael'
kind: 2
created: 2021-07-12 00:00:12
-
id: 3
user_id: 5
token: 'tiepiQueed8ahc7zeeFe1eveiy4Ein8osooxegiephauph2Aei'
kind: 2
created: 2021-07-12 00:00:13

View File

@ -3,7 +3,7 @@
username: 'user1'
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
email: 'user1@example.com'
is_active: true
issuer: local
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -11,6 +11,7 @@
username: 'user2'
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
email: 'user2@example.com'
issuer: local
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -18,7 +19,7 @@
username: 'user3'
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
email: 'user3@example.com'
password_reset_token: passwordresettesttoken
issuer: local
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -26,7 +27,8 @@
username: 'user4'
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
email: 'user4@example.com'
email_confirm_token: tiepiQueed8ahc7zeeFe1eveiy4Ein8osooxegiephauph2Ael
status: 1
issuer: local
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
-
@ -34,8 +36,8 @@
username: 'user5'
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
email: 'user5@example.com'
email_confirm_token: tiepiQueed8ahc7zeeFe1eveiy4Ein8osooxegiephauph2Ael
is_active: false
status: 1
issuer: local
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
# This use is used to create a whole bunch of lists which are then shared directly with a user
@ -43,55 +45,67 @@
username: 'user6'
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
email: 'user6@example.com'
is_active: true
issuer: local
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
- id: 7
username: 'user7'
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
email: 'user7@example.com'
is_active: true
issuer: local
discoverable_by_email: true
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
- id: 8
username: 'user8'
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
email: 'user8@example.com'
is_active: true
issuer: local
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
- id: 9
username: 'user9'
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
email: 'user9@example.com'
is_active: true
issuer: local
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
- id: 10
username: 'user10'
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
email: 'user10@example.com'
is_active: true
issuer: local
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
- id: 11
username: 'user11'
name: 'Some one else'
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
email: 'user11@example.com'
is_active: true
issuer: local
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
- id: 12
username: 'user12'
name: 'Name with spaces'
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
email: 'user12@example.com'
is_active: true
issuer: local
discoverable_by_name: true
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
- id: 13
username: 'user13'
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
email: 'user14@example.com'
is_active: true
issuer: local
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12
- id: 14
username: 'user14'
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
email: 'user15@some.service.com'
issuer: 'https://some.service.com'
subject: '12345'
updated: 2018-12-02 15:13:12
created: 2018-12-01 15:13:12

35
pkg/db/helpers.go Normal file
View File

@ -0,0 +1,35 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package db
import (
"xorm.io/builder"
"xorm.io/xorm/schemas"
)
// ILIKE returns an ILIKE query on postgres and a LIKE query on all other platforms.
// Postgres' is case sensitive by default.
// To work around this, we're using ILIKE as opposed to normal LIKE statements.
// ILIKE is preferred over LOWER(text) LIKE for performance reasons.
// See https://stackoverflow.com/q/7005302/10924593
func ILIKE(column, search string) builder.Cond {
if Type() == schemas.POSTGRES {
return builder.Expr(column+" ILIKE ?", "%"+search+"%")
}
return &builder.Like{column, "%" + search + "%"}
}

View File

@ -1,26 +1,29 @@
// Copyright2018-2020 Vikunja and contriubtors. All rights reserved.
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
//
// This file is part of Vikunja.
//
// Vikunja is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vikunja is distributed in the hope that it will be useful,
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vikunja. If not, see <https://www.gnu.org/licenses/>.
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package db
import (
"fmt"
"os"
"testing"
"code.vikunja.io/api/pkg/config"
"code.vikunja.io/api/pkg/log"
"os"
"github.com/stretchr/testify/assert"
"xorm.io/core"
"xorm.io/xorm"
)
@ -69,3 +72,32 @@ func InitTestFixtures(tablenames ...string) (err error) {
return nil
}
// AssertExists checks and asserts the existence of certain entries in the db
func AssertExists(t *testing.T, table string, values map[string]interface{}, custom bool) {
var exists bool
var err error
v := make(map[string]interface{})
// Postgres sometimes needs to build raw sql. Because it won't always need to do this and this isn't fun, it's a flag.
if custom {
//#nosec
sql := "SELECT * FROM " + table + " WHERE "
for col, val := range values {
sql += col + "=" + fmt.Sprintf("%v", val) + " AND "
}
sql = sql[:len(sql)-5]
exists, err = x.SQL(sql).Get(&v)
} else {
exists, err = x.Table(table).Where(values).Get(&v)
}
assert.NoError(t, err, fmt.Sprintf("Failed to assert entries exist in db, error was: %s", err))
assert.True(t, exists, fmt.Sprintf("Entries %v do not exist in table %s", values, table))
}
// AssertMissing checks and asserts the nonexiste nce of certain entries in the db
func AssertMissing(t *testing.T, table string, values map[string]interface{}) {
v := make(map[string]interface{})
exists, err := x.Table(table).Where(values).Exist(&v)
assert.NoError(t, err, fmt.Sprintf("Failed to assert entries don't exist in db, error was: %s", err))
assert.False(t, exists, fmt.Sprintf("Entries %v exist in table %s", values, table))
}

Some files were not shown because too many files have changed in this diff Show More