1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-08 06:55:28 +02:00

Compare commits

...

915 commits

Author SHA1 Message Date
Harvey Kandola
efb092ef8f Prep v5.13.0 release 2024-12-31 13:09:30 -05:00
Harvey Kandola
3fc0a15f87 es-AR 2024-12-31 12:05:21 -05:00
Harvey Kandola
c841c85478 Add en-AR i18n 2024-12-30 13:49:39 -05:00
Harvey Kandola
2dae03332b Prep release 2024-06-18 11:53:23 -04:00
Harvey Kandola
44b1f263cd Restore activity and audit logs 2024-06-18 11:53:15 -04:00
Harvey Kandola
982e16737e Bump version 2024-02-19 11:55:21 -05:00
Harvey Kandola
f641e42434 Remove default conversion service URL 2024-02-19 11:55:15 -05:00
Harvey Kandola
8895db56af Skip restore of user logs 2024-02-19 11:54:50 -05:00
Harvey Kandola
acb59e1b43 Bump Go deps 2024-02-19 11:54:27 -05:00
Harvey Kandola
f2ba294be8 Prep 5.11.3 2024-02-16 10:53:02 -05:00
Harvey Kandola
69940cb7f1
Merge pull request #398 from mb3m/fix-win-build
Fix Windows build script
2024-02-02 06:44:23 -05:00
Harvey Kandola
6bfdda7178
Merge pull request #399 from mb3m/fix-french
French translation updates
2024-02-02 06:42:35 -05:00
Thomas Bolon
027fdf108c french translation updates
- uppercase with accent (E => É)
- Label => Étiquette
- misc terms
- space before punctuations ("?" => " ?")
2024-02-02 11:44:50 +01:00
Thomas Bolon
1f12df76aa typo 2024-02-02 11:17:49 +01:00
Thomas Bolon
d811b88896 fix windows build
- add a cd .. after ember build: the script moves to gui\ directory but
  does not move back, despite the rest of the script expecting running
  from the root directory.

- add multiple echo commands to help debug error

- fix robocopy wrong usage where glob patterns are specified on the
  source path instead of a specific third argument
2024-02-02 11:15:47 +01:00
Harvey Kandola
20fb853907 Implement Azure SQL database compatibility checks 2024-01-16 12:47:44 -05:00
Harvey Kandola
599c53a971 Loosen Microsoft SQL Server database compat. checks 2024-01-15 16:48:21 -05:00
Harvey Kandola
1f462ed4f7 Support Microsoft SQL Azure v12+ 2024-01-15 14:43:27 -05:00
Harvey Kandola
9f122fa79b Bump version 2024-01-11 11:15:43 -05:00
Harvey Kandola
4210caca48 Improve document transaction scopes 2024-01-10 15:54:56 -05:00
Harvey Kandola
c62fa4612b Upgrade Go deps 2024-01-10 14:47:49 -05:00
Harvey Kandola
510e1bd0bd Bump version to 5.11.0 2024-01-10 14:47:40 -05:00
Harvey Kandola
a32510b8e6 Add additional SQL Server indexes 2024-01-10 14:47:08 -05:00
Harvey Kandola
589f3f581f Prep 5.10.0 release 2023-09-18 12:27:18 -04:00
Harvey Kandola
20bba4cd7e Add performance indexes for MS SQL Server database provider 2023-09-18 12:27:09 -04:00
Harvey Kandola
cbf5f4be7d
Merge pull request #397 from armando-marra/master
Modified i18n.js and Readme.md
2023-09-08 12:15:28 -04:00
Armando Marra
dc63639c99
Update README.md
Added italian to languages list
2023-09-08 09:10:05 +02:00
Armando Marra
26f435bdc9
Merge branch 'documize:master' into master 2023-09-08 09:08:21 +02:00
Armando Marra
a8a82963fa
Merge pull request #1 from armando-marra/patch-1-it-lang
Update i18n.js
2023-09-08 09:07:42 +02:00
Armando Marra
ab8582e807
Update i18n.js
Added Italian language support
2023-09-08 09:06:48 +02:00
Harvey Kandola
4fa0566274
Merge pull request #396 from armando-marra/master
Added Italian translation
2023-08-23 09:09:45 -04:00
armando-marra
f4b45d2aa7
Update localize.go
Added Italian language
2023-08-23 14:22:47 +02:00
armando-marra
1abc5d3e52
Italian language JSON file 2023-08-23 14:14:38 +02:00
Harvey Kandola
6e463ff2f4 Bump version 2023-08-21 12:20:53 -04:00
Harvey Kandola
f80b3f3d10 5.8.0 2023-07-24 11:11:46 -04:00
Harvey Kandola
6c218cf087 Add additional indexes for SQL Server 2023-07-24 11:11:39 -04:00
Harvey Kandola
3d1c8a6c54 Remove archived versions from version selector 2023-07-24 11:11:25 -04:00
Harvey Kandola
576fd5e604
Merge pull request #395 from xadammr/patch-1
Add support for SQL Server 2022
2023-07-17 17:07:09 -04:00
Adam Roe
62407a28b4
Add support for SQL Server 2022 2023-07-15 18:27:20 +10:00
Harvey Kandola
0adf6d5dc8 Update permission.go 2023-06-12 13:24:47 -04:00
Harvey Kandola
15f8a64c86 Bump Go & improve SQL layer 2023-05-15 13:47:22 -04:00
Harvey Kandola
95c67acaa0
Merge pull request #394 from uchida-nunet/master
Minor corrections Japanese translation
2023-03-04 08:45:39 -05:00
Harvey Kandola
d8f66b5ffb Bump version 2023-02-27 13:30:34 -05:00
Uchida, Yasuhiro
c051e81a99 Update ja-JP.json 2023-02-24 01:08:43 +09:00
Uchida, Yasuhiro
1d86b98949
Update ja-JP.json 2023-02-24 00:59:06 +09:00
Harvey Kandola
0a1cc86907
Merge pull request #393 from uchida-nunet/master
add Japanese language support
2023-02-11 10:28:58 -05:00
uchida-nunet
a49869d35d Update ja-JP.json 2023-02-11 18:09:27 +09:00
uchida-nunet
848afd3263 change gui/app/services/i18n.js 2023-02-11 12:51:59 +09:00
uchida-nunet
b9cb99e3bb mod 2023-02-11 12:43:32 +09:00
uchida-nunet
64261ffcf5 Merge branch 'master' of https://github.com/uchida-nunet/documize-community 2023-02-11 12:30:12 +09:00
uchida-nunet
0030418707 add Japanese language support 2023-02-11 12:29:43 +09:00
uchida-nunet
0f91ee518e add Japanese language support 2023-02-11 12:06:29 +09:00
Harvey Kandola
5de1b7a92e
Merge pull request #392 from Xhelliom/dev
Minor corrections french translation
2023-02-07 11:04:17 -05:00
Stephane Wetterwald
a2524f785e Minor corrections 2023-02-07 15:57:25 +01:00
Harvey Kandola
f16b9f3810 Build prep 2023-02-06 14:01:19 -05:00
Harvey Kandola
1c09771c33 Bump version 2023-02-06 11:46:10 -05:00
Harvey Kandola
13fc5b5015 Test for user permissions before setting them 2023-02-06 11:46:03 -05:00
Harvey Kandola
76c777acc1 French localization 2023-02-06 11:45:47 -05:00
Harvey Kandola
ea9ff78411
Merge pull request #391 from Xhelliom/dev
Translate to french
2023-02-06 11:19:35 -05:00
Stephane Wetterwald
4a9dd47894 translate to french 2023-02-01 21:40:34 +01:00
Harvey Kandola
7565779ef1
Update docker-compose.yaml
Revert broken command
2023-01-11 20:04:00 -05:00
Stephane Wetterwald
c07e7b6afc more translations 2022-12-29 16:50:00 +01:00
Harvey Kandola
88bdafcb1b
Merge pull request #390 from rursache/patch-1
Updated docker-compose.yaml
2022-12-17 13:09:34 -05:00
Radu Ursache
5a3cb1b226
Updated docker-compose.yaml
Updated `docker-compose.yaml` to read the correct arch from device so arm64 devices can run Documize as well
2022-12-17 20:07:23 +02:00
Stephane Wetterwald
6ee8e6c7b4 translated to line 200 2022-12-15 12:32:35 +01:00
Stephane Wetterwald
599c464d2d add fr 2022-12-15 12:18:14 +01:00
Harvey Kandola
ae77fa2275
Merge pull request #389 from nemunaire/b/dockerfile
Dockerfile: Force node 16 + update go and alpine tags
2022-11-22 08:54:19 -05:00
Pierre-Olivier Mercier
610367aac5 Force node 16 + update go and alpine tags 2022-11-22 10:11:41 +01:00
Harvey Kandola
be2c2a7a2c v5.4.2 prep 2022-10-31 18:32:59 -04:00
Harvey Kandola
0d28b7ee79 Fix org reset during restore 2022-10-31 18:32:46 -04:00
Harvey Kandola
aa8b473018 Bump version to 5.4.1 2022-10-21 11:13:13 -04:00
Harvey Kandola
6993dc678f Fix regression for robots.txt and sitemap.xml 2022-10-21 11:13:03 -04:00
Harvey Kandola
e0e3f0c141 Fix middleware for favicon/sitemap 2022-10-21 11:12:46 -04:00
Harvey Kandola
4c031fe7e4 Set TLS min to 1.3 2022-10-21 11:12:17 -04:00
Harvey Kandola
e4025bee42 Bump to v5.4.0 2022-10-10 17:40:45 -04:00
Harvey Kandola
876775b395 Support TLS version selection
Allow config file and ENV variables to define minimum TLS version used for SSL connections.

tlsversion=1.3
2022-10-10 17:40:36 -04:00
Harvey Kandola
828c01d189 Update README.md 2022-09-18 15:40:10 -04:00
Harvey Kandola
a69bcc0af6 Update README.md 2022-09-18 15:39:16 -04:00
Harvey Kandola
5ec911dce2 Dotcom pricing landing page changes 2022-09-18 15:25:57 -04:00
Harvey Kandola
ce07d4d147 Bump version 2022-09-18 14:29:38 -04:00
Harvey Kandola
f3ef83162e
Update README.md 2022-09-16 12:25:02 -04:00
Harvey Kandola
f1a01ec195 Bump version to 5.2.2 2022-09-12 12:35:51 -04:00
Harvey Kandola
01e53c3d27 Fix sanitization of document title 2022-09-12 12:35:40 -04:00
Harvey Kandola
2cf21a7bea Fix i18n issue 2022-09-08 16:45:28 -04:00
Harvey Kandola
d4c606760c Bump version 2022-08-01 10:13:21 -04:00
Harvey Kandola
9343d77b26 Bump PDF viewer dep 2022-08-01 10:13:15 -04:00
Harvey Kandola
30aa8aadb6 Fix i18n bug for PDF viewer 2022-08-01 10:13:03 -04:00
Harvey Kandola
29bc2677a8 v5.2.0 2022-07-13 13:28:31 -04:00
Harvey Kandola
d9827df440
Merge pull request #387 from kmkzif/master
Add portuguese language support
2022-07-13 13:21:24 -04:00
KMKZ
cfd7ebd2bf Add portuguese language support 2022-07-12 22:14:26 -03:00
Harvey Kandola
b510615691 Update community.go 2022-07-10 15:49:34 -04:00
Harvey Kandola
e8641405cf Update package.json 2022-07-10 15:48:21 -04:00
Harvey Kandola
209f1b667e Bump version 2022-07-10 15:38:37 -04:00
Harvey Kandola
e70019d73b
Merge pull request #386 from 569258yin/master
Add chinese language support
2022-07-10 15:32:39 -04:00
manwang
dc26f063c8 add chinese language support 2022-07-09 08:50:35 +08:00
Harvey Kandola
68d067ef7b Update en-US.json 2022-05-16 16:30:17 -04:00
Harvey Kandola
0d52f434d5 Localized string updates 2022-05-16 16:23:19 -04:00
Harvey Kandola
ce22c78dac Bump version 2022-05-16 13:22:02 -04:00
Harvey Kandola
f976ea36f6 Fix version control translation strings 2022-05-16 13:12:55 -04:00
Harvey Kandola
1734963693 Remove unnecessary permission check 2022-05-12 12:27:06 -04:00
Harvey Kandola
247a2b2c03 Remove back tick 2022-04-15 15:53:47 -04:00
Harvey Kandola
38a790dd04 v5 release
Supported locales: English and German.
2022-04-13 13:54:27 -04:00
Harvey Kandola
b77b4abdc2 Add de-DE locale 2022-04-08 11:59:08 -04:00
Harvey Kandola
6b498a74c6
Merge pull request #383 from lafriks-fork/fix/docker_missing_i18n
Fix missing i18n files in docker build
2022-04-05 11:50:25 -04:00
Lauris BH
f6dd872782
Fix missing i18n files in docker build 2022-04-05 15:54:03 +03:00
Harvey Kandola
9473ecba9a Update flowchart.go 2022-03-24 13:13:11 -04:00
Harvey Kandola
1a909dd046 Support custom URLS for Diagrams.net 2022-03-24 13:05:45 -04:00
Harvey Kandola
607a2d5797 Create howto-localize.png 2022-03-23 12:35:32 -04:00
Harvey Kandola
037dfc40cd Update en-US.json 2022-03-22 13:18:32 -04:00
Harvey Kandola
65348eee28 More i18n strings 2022-03-22 13:13:57 -04:00
Harvey Kandola
78932fb8c7 Fix i18n strings 2022-03-22 12:14:31 -04:00
Harvey Kandola
6c8b10753d i18n fixes 2022-03-21 19:14:10 -04:00
Harvey Kandola
e56263564c
Merge pull request #382 from documize/i18n
Localization support
2022-03-21 13:18:44 -04:00
Harvey Kandola
22b6a4fb78 Update i18n.js 2022-03-21 13:15:53 -04:00
Harvey Kandola
7e26c003d6 Select user language before server language 2022-03-21 13:14:55 -04:00
Harvey Kandola
e81cbad385 Select language for server and per user 2022-03-21 12:43:45 -04:00
Harvey Kandola
4494ace0a2 Set org and per user locale 2022-03-19 18:07:38 -04:00
Harvey Kandola
23abcf1585 i18n fixes 2022-03-17 16:42:15 -04:00
Harvey Kandola
67070c3bfc Require sub check 2022-03-17 16:31:11 -04:00
Harvey Kandola
77c767a351 Update en-US.json 2022-03-17 16:17:37 -04:00
Harvey Kandola
17162ce336 i18n mail template strings 2022-03-17 13:03:04 -04:00
Harvey Kandola
7255eb4f56 i18n server-side strings 2022-03-16 17:39:01 -04:00
Harvey Kandola
df534f72fa i18n server-side strings 2022-03-16 16:58:42 -04:00
Harvey Kandola
f4a1350a41 i18n server-side loading and setup 2022-03-16 13:32:48 -04:00
Harvey Kandola
cd15c393fe Go 1.18 & tidy deps 2022-03-16 13:32:27 -04:00
McMatts
7f66977ac1 i18n notify strings 2022-03-14 14:49:10 -04:00
McMatts
33a9cbb5b0 Update licensing links 2022-03-14 14:33:54 -04:00
McMatts
716343680a i18n Enterprise feature-set 2022-03-14 14:09:50 -04:00
McMatts
5db5f4d63b i18n continuation 2022-03-14 12:01:46 -04:00
McMatts
3d3d50762e i18n section stings 2022-03-10 16:35:59 -05:00
McMatts
20c9168140 i18n section strings 2022-03-10 15:21:25 -05:00
McMatts
ce9c635fb4 i18n section strings 2022-03-10 13:49:19 -05:00
McMatts
f735ae1278 i18n section types 2022-03-10 12:10:39 -05:00
McMatts
bca7794c00 i18n doc strings 2022-03-09 15:20:16 -05:00
McMatts
371706fb49 i18n doc strings 2022-03-09 14:04:17 -05:00
McMatts
a236cbb01c i18n doc strings 2022-03-09 13:36:48 -05:00
McMatts
93b6f26365 i18n space strings 2022-03-08 17:05:12 -05:00
McMatts
5e687f5ef4 i18n space strings 2022-03-08 13:05:30 -05:00
McMatts
97c4c927ac i18n space strings 2022-03-08 12:50:34 -05:00
McMatts
4885a1b380 i18n space strings 2022-03-08 12:16:36 -05:00
McMatts
e0805d7131 i18n search strings 2022-03-08 11:35:59 -05:00
McMatts
6d735e8579 i18n page strings 2022-03-04 18:31:23 -05:00
McMatts
073ef81e80 i18n strings
Pods completed
2022-03-04 13:46:22 -05:00
McMatts
38c9a94a9c i18n strings 2022-03-04 13:28:36 -05:00
McMatts
59dc6ea991 i18n page strings 2022-03-04 13:07:11 -05:00
McMatts
4ab48cc67d i18n admin strings 2022-03-03 19:42:37 -05:00
McMatts
53297f7627 i18n admin strings 2022-03-03 19:10:06 -05:00
McMatts
4ed2b3902c JS build tweaks 2022-03-03 18:21:16 -05:00
McMatts
6968581e5b i18n admin strings 2022-03-03 14:38:27 -05:00
McMatts
c09a116e56 i18n admin strings 2022-03-03 14:03:48 -05:00
McMatts
7cf672646a i18n admin strings 2022-03-02 20:52:59 -05:00
McMatts
29447a2784 i18n admin strings 2022-03-02 20:30:39 -05:00
McMatts
479d03ba70 i18n admin sections 2022-03-02 19:55:52 -05:00
McMatts
a7dac6911c i18n strings 2022-03-01 22:59:56 -05:00
McMatts
08f21346c1 [WIP] i18n constant strings 2022-03-01 22:40:51 -05:00
McMatts
ce4f62d346 [WIP] i18n strings 2022-03-01 22:03:18 -05:00
McMatts
8a25509019 Implement basic i18n client-side foundation 2022-03-01 20:01:06 -05:00
McMatts
59c929d251 New logo 2022-03-01 20:00:33 -05:00
McMatts
245c538990 Initial i18n experiment 2022-03-01 16:22:53 -05:00
HarveyKandola
32a9528e6d Update README.md 2022-02-27 12:48:26 -05:00
HarveyKandola
a15f0c8eb6 Update README.md 2022-02-27 12:48:04 -05:00
HarveyKandola
eb9fbd25b9 Update README.md 2022-02-27 12:47:09 -05:00
Harvey Kandola
dbef758035
Merge pull request #381 from typkrft/master
Updated URL
2022-02-17 11:07:03 -05:00
Brandon
dea25a2b85
Updated URL
The current URL doesn't point to the actual download.
2022-02-17 10:59:25 -05:00
HarveyKandola
fcf38d8af9 Change downloads asset location 2022-02-14 14:23:10 -05:00
HarveyKandola
ce93a5e623 v4.2.2 2022-02-08 18:48:30 -05:00
HarveyKandola
8df1cc73b0 Update license-key.hbs 2022-02-08 18:31:37 -05:00
HarveyKandola
53ec7c9274 Update README.md 2022-01-12 14:15:56 -05:00
HarveyKandola
cfe85248ce Update screenshot 2022-01-12 14:15:11 -05:00
HarveyKandola
30c31a1ba7 Merge branch 'master' of https://github.com/documize/community 2022-01-12 14:13:18 -05:00
HarveyKandola
a97b6b22d9 Skip LDAP user creation if not sync'ed 2022-01-12 14:12:51 -05:00
Harvey Kandola
e985c5f808
Update README.md 2022-01-11 21:27:18 -05:00
HarveyKandola
4b89f3b1c2 Release 4.2.0 2022-01-11 21:20:01 -05:00
HarveyKandola
707dc1e052 Increase category name size 2022-01-11 13:52:41 -05:00
HarveyKandola
88211739f0 Bump deps 2022-01-11 13:52:30 -05:00
HarveyKandola
6b3cdb5033 Support for ARIA 2022-01-11 12:40:52 -05:00
HarveyKandola
45f216b8a1 Improved tooltip rendering speed 2022-01-10 17:14:08 -05:00
HarveyKandola
c31c130ffd Remove Ember Attacher add-on 2022-01-10 17:01:54 -05:00
HarveyKandola
5d5e212a6b FreeBSD builds 2021-11-19 08:34:19 -05:00
HarveyKandola
8fa5569ae5 Implement more re-branding updates 2021-11-15 14:52:29 -05:00
HarveyKandola
8976bf817b Update README 2021-11-10 19:31:03 -05:00
HarveyKandola
0c3fed2b18 Prep re-branding 2021-11-03 11:46:20 -04:00
HarveyKandola
60dfb54d54 Allow logger.Info multiple args 2021-10-07 14:16:05 -04:00
Harvey Kandola
c6863201b3
Merge pull request #380 from nemunaire/f/dockerfile 2021-09-22 10:31:34 -04:00
Pierre-Olivier Mercier
45567e274a Modernize Dockerfile 2021-09-21 22:14:30 +02:00
HarveyKandola
dff4c6929b Update README.md 2021-09-09 12:29:38 -04:00
HarveyKandola
eea8db9288 Fingerprint during Ember build 2021-09-07 20:18:30 -04:00
HarveyKandola
e19c4ad18a Update build.bat 2021-09-07 11:32:22 -04:00
HarveyKandola
989b7cd62c Sync with Community 2021-08-19 13:02:56 -04:00
HarveyKandola
df8f650319 Support VB.NET for code syntax highlighting 2021-08-18 19:41:19 -04:00
HarveyKandola
565a063231 Tweaked document list rendering of tooltips 2021-08-18 19:40:57 -04:00
HarveyKandola
cb46f34503 Update PDF dep 2021-08-18 19:40:12 -04:00
HarveyKandola
470e2d3ecf Move over to Go embed directive 2021-08-18 19:39:51 -04:00
HarveyKandola
cddba799f8 Update Ember deps 2021-08-18 19:39:14 -04:00
HarveyKandola
05df22ed4a Update go deps 2021-08-18 19:38:43 -04:00
HarveyKandola
a5dfa6ee39 Merge branch 'master' of https://github.com/documize/community 2021-03-28 16:03:51 -04:00
HarveyKandola
780ce2df61 Bump 3.9.0 release 2021-03-28 16:03:47 -04:00
Harvey Kandola
9f28e1bff2
Merge pull request #379 from esquith/patch-1
Update README.md
2021-03-28 21:02:53 +01:00
Esquith Allen
8ae94295a2
Update README.md 2021-03-28 16:00:39 -04:00
HarveyKandola
adb7b4d7bf Enforce TLS 1.2 minimum 2021-03-16 13:58:27 -04:00
HarveyKandola
66fcb77d8b Improve user management 2020-11-29 20:31:20 -05:00
Harvey Kandola
972413110f
Merge pull request #377 from Ma27/preview-button-toggle
gui/editors: toggle Preview/Edit button
2020-11-12 18:57:42 +00:00
Harvey Kandola
a0a166136e
Merge pull request #378 from Ma27/markdown-bulletpoints-margin
document/wysiwig: no margin for sublists
2020-11-12 18:54:17 +00:00
HarveyKandola
30d12ba756 Updated Draw.io integration 2020-11-09 11:01:09 -05:00
Maximilian Bosch
06bf9efcfc
document/wysiwig: no margin for sublists
When having a list with sublists in a `markdown` section like this

  * top-level
  * another one
    * sub-elem 1
    * sub-elem 2

then documize will create a margin of 15px before and after the sublist
which is rather unintuitive as this will create the wrong impression
that these bullet-points have no relation to the parent one even though
this is the most common semantic reason for sublists.

This patch removes the margin at the top and bottom for those kinds of
sublists.
2020-10-31 21:47:23 +01:00
Maximilian Bosch
9ed8f79315
gui/editors: toggle Preview/Edit button
When hitting "Preview" on a previewable section (e.g. one with
markdown), the tooltip and icon of the preview-button still show
"Preview". With this change, both the text and the button will be
switched accordingly.
2020-10-31 21:18:20 +01:00
Maximilian Bosch
73e8c7a278
docker-compose: explicitly pin postgres container to v12 2020-10-31 21:18:04 +01:00
Harvey Kandola
806efd7eac
Merge pull request #376 from AntonLydike/master
Fixed and updated Dockerfile
2020-08-23 15:14:57 +01:00
Anton Lydike
724f3c88b3 fixed and updated dockerfile 2020-08-21 15:42:10 +02:00
Harvey Kandola
4a7d915ebb
Merge pull request #375 from dimoonster/master
Proxy support when communicate with plantuml
2020-08-17 16:09:51 +01:00
Di_Moon
c7413da943 add proxy support when communicate with plantuml (remove spaces) 2020-08-14 11:56:27 +03:00
Di_Moon
4e0218f5ea add proxy support when communicate with plantuml 2020-08-14 11:54:30 +03:00
HarveyKandola
4fe022aa0c Database and LDAP upgrades
Bumped underlying dependencies affecting database and LDAP connectivity.

Bumped to Go v1.14.3 and released v3.8.0.
2020-05-21 12:32:46 +01:00
Harvey Kandola
aaa8c3282d
Update README.md 2020-03-09 12:37:13 +00:00
Harvey Kandola
5e022dd0b8
Update README.md 2020-03-09 12:30:37 +00:00
Harvey Kandola
bbca180298
Clarify support options 2020-03-09 12:30:16 +00:00
HarveyKandola
cdc7489659 Update Go modules/vendor directory
Closes #368
2020-02-15 15:42:54 +00:00
HarveyKandola
ab95fcc64d Prep 3.7.0 release
Awesome work @sauls8t !!
2020-02-04 14:43:47 +00:00
sauls8t
9bee58057e Add new pin related audit types 2020-02-04 14:37:02 +00:00
sauls8t
bda9719ecb Handle non-pinned spaces 2020-02-04 14:36:40 +00:00
sauls8t
fbd4b17c15 Record all doc pin related user actions 2020-02-04 14:36:11 +00:00
sauls8t
c689379f92 Restrict pin sequence changing
Only all documents filter enables the up/down pin sequence change clickers.
2020-02-04 12:37:59 +00:00
HarveyKandola
d1774b42bd Allow for clickable links in space description
Closes #361
2020-02-04 12:28:57 +00:00
sauls8t
8ac35a6b74 Routes for new pinned documents 2020-02-03 21:01:25 +00:00
sauls8t
813f270a9d Update schema for new pinned documents 2020-02-03 21:01:11 +00:00
sauls8t
e014f5b5c1 Pinned documents
Closes #278

Pin documents to the top of each space.
2020-02-03 21:00:35 +00:00
sauls8t
2b66d0096a MariaDB restore process compatibility 2020-02-03 20:58:25 +00:00
sauls8t
50f47f61a5 Rename folder/space for all space export 2020-02-03 20:57:36 +00:00
sauls8t
d26ecdc12f Prep 3.6.0 release 2019-12-14 13:13:47 +00:00
sauls8t
1a89201bd9 Provide generic IFrame section for documents
Closes #352
2019-12-09 12:31:44 +00:00
sauls8t
accf0a2c63 Use latest PlantUML lib and render as SVG
Closes #349 and #350
2019-12-09 10:54:02 +00:00
HarveyKandola
cafa3ceed0 Build prep 3.5.2 2019-12-06 18:02:00 +00:00
HarveyKandola
2b3e9dfbc9 Stop TinyMCE dialogs from scrolling background 2019-12-06 15:11:16 +00:00
HarveyKandola
1c1ebee15a Upgrade TinyMCE to 5.1.3 2019-12-06 15:10:50 +00:00
HarveyKandola
6ba4ca9c16 Fix scroll-to-section regression
Fixes #344
2019-12-06 11:09:02 +00:00
HarveyKandola
5aaa9f874d Hide PlantUML sample diagrams when you have content
Closes #346
2019-12-06 10:13:15 +00:00
sauls8t
51a25adbdb v3.5.1 2019-11-30 10:31:09 +00:00
Harvey Kandola
9d025c3f71
Update README.md 2019-11-19 18:11:49 +00:00
sauls8t
a4384210d4 Sanitize HTML in Markdown sections 2019-11-19 11:47:51 +00:00
HarveyKandola
6882491201 Build prep 2019-11-15 18:21:56 +00:00
HarveyKandola
d4edcb8b2c Show default category indicator to admins
Fixes #339
2019-11-15 16:38:56 +00:00
HarveyKandola
f117e91bcb Specify default categories for new documents
Closes #339

All new documents will be assigned default categories.

Documents created from templates that already have categories take precedence.
2019-11-15 14:51:52 +00:00
HarveyKandola
5c1ad25dc9 Allow rich rext for Site Message and Space Desc
Closes #291

Style both site-wide message and per space descriptions using the fully-featured rich text editor.
2019-11-15 12:41:08 +00:00
HarveyKandola
8970a21b58 Fix regression for downloading certain binary attachments 2019-11-14 17:38:53 +00:00
McMatts
0e6f2f1f5e Allow non space creators to manage space settings
Fixes #337
2019-11-13 09:49:19 +00:00
McMatts
7fc74be7cd Merge branch 'master' of https://github.com/documize/community 2019-11-08 14:55:32 +00:00
McMatts
faeadb2bbb Update embeded assets 2019-11-08 14:55:27 +00:00
McMatts
be50bf9f14
Update README.md 2019-11-08 14:54:33 +00:00
McMatts
60ef205948 Improve jump-to-section scrolling 2019-11-08 12:45:22 +00:00
McMatts
7ae801554d Bump version 2019-11-08 12:44:57 +00:00
McMatts
441efd42e9 Prevent edits to locked docs/sections 2019-11-08 12:44:41 +00:00
McMatts
a19ba46f7a Add http scheme for copied links 2019-11-08 11:11:27 +00:00
sauls8t
ad361c22ba Write HTTP headers before body write 2019-11-08 10:40:10 +00:00
sauls8t
7954f4b976 3.4.1 release 2019-11-02 09:22:09 +00:00
sauls8t
2d105f2154 Better handling for document.update TX 2019-10-30 13:57:26 +00:00
sauls8t
811e239baf Support comma-escaped LDAP DN values 2019-10-30 13:57:07 +00:00
HarveyKandola
c7e71173ea SQL Server per doc activity report 2019-10-28 15:04:36 +00:00
HarveyKandola
8fa8a3657c Handle escaped comma in LDAP DN string
Closes #326
2019-10-28 15:03:53 +00:00
HarveyKandola
a64a219ce8 Remove obsolete anchor plugin 2019-10-26 16:55:54 +01:00
HarveyKandola
d7a484a936 3.4 embedded assets 2019-10-26 16:16:16 +01:00
HarveyKandola
017b19141c 3.4.0 build prep 2019-10-26 16:15:56 +01:00
McMatts
39f457e90e Upgrade TinyMCE to v5.1.0
Introduces new sticky toolbar option!
2019-10-21 10:54:01 +01:00
McMatts
30d3e6f82e Improve canEdit permissions for attachments 2019-10-21 10:34:34 +01:00
McMatts
8c2bed283f Sync edit checks across editions 2019-10-21 10:34:10 +01:00
McMatts
a3867c617a Bump version and embed assets 2019-10-21 10:33:51 +01:00
McMatts
28424e7e4b Change audit store to use own TX 2019-10-21 10:33:37 +01:00
HarveyKandola
7c70274f5e Add edit check to atatchments list view 2019-10-14 17:29:34 +01:00
HarveyKandola
ef5b5cdb32 Bump version to 3.3.2 2019-10-14 12:27:41 +01:00
HarveyKandola
ccd756aca0 Document PostgreSQL wildcard search syntax 2019-10-10 11:58:41 +01:00
HarveyKandola
444b89e425 Improve SMTP setting persistence
Should close #327 by providing better handling of non-english dialect(?).
2019-10-07 15:44:07 +01:00
HarveyKandola
3d0f17386b Bump released to v3.3.1 2019-09-26 16:51:05 +01:00
HarveyKandola
513fd9f994 Enable tag searching for SQL Server database 2019-09-24 16:44:28 +01:00
HarveyKandola
5cef58eeba Re-sync space counts when moving docs
Between spaces!
2019-09-24 14:07:44 +01:00
HarveyKandola
fad1de2e41 Overhaul the space stats module
Closes #274

All space counters are reset after document and catergory operations.
2019-09-24 13:39:57 +01:00
sauls8t
6b723568d3 Provide Bash/Shell code syntax in Rich Text Editor
Closes #322
2019-09-18 11:25:21 +01:00
sauls8t
00889f0e0e Build number refresh 2019-09-17 11:13:34 +01:00
sauls8t
6629d76453 Add covering indexes to support super-size deployments
Resolves issues for enterprise customers with tonnes of data in these SQL tables:

- dmz_doc
- dmz_section

Multi-tenant compliant.
2019-09-14 13:04:56 +01:00
sauls8t
74300b009b v3.3.0 release prep 2019-09-12 13:16:10 +01:00
sauls8t
5004e5a85e Enable Full-text Search when using SQL Server 2016+ 2019-09-11 19:08:53 +01:00
HarveyKandola
0524a0c74c Added link to Go modules migration guide 2019-09-06 11:12:42 +01:00
HarveyKandola
b826852137 Moved from Dep to Go Modules
We have finally dropped go dep and moved over to go mod !

During the move, some dependencies have been bumped.
2019-09-06 11:06:28 +01:00
HarveyKandola
2c164a135a Remove obsolete build flag 2019-09-05 10:37:40 +01:00
HarveyKandola
44febcc25c Provide Docker Compose file for quick app+db setup
Closes #311
2019-08-29 14:14:10 +01:00
HarveyKandola
66e11cefbc Bump version to 3.2.0 2019-08-28 13:41:52 +01:00
HarveyKandola
5e9eeb5bf9 Use Ember v3.12.0
Bumped JS dependencies where possible
2019-08-28 12:57:02 +01:00
HarveyKandola
5b7610d726 Update README 2019-08-28 12:27:38 +01:00
HarveyKandola
0419f3b7b3 Update Jira client library to latest release
Related to #308
2019-08-27 17:16:06 +01:00
HarveyKandola
5b72da037c Ensure only change approvers can change doc level attachments
Does not affect section level attachments
2019-08-27 16:17:38 +01:00
HarveyKandola
d14e8a3ff6 Delete package-lock.json 2019-08-27 15:33:18 +01:00
HarveyKandola
9a3d2c3c28 Fixed HTML for new auth settings 2019-08-27 15:25:10 +01:00
HarveyKandola
3b76e10ee0 Ensure doc protected from non-category viewers
Closes #310
2019-08-27 15:24:59 +01:00
Harvey Kandola
29d7307537
Merge pull request #306 from dereknex/auth-with-cas
Authentication with Central Authentication Service (CAS) such as https://www.apereo.org/projects/cas
2019-08-27 11:05:18 +01:00
HarveyKandola
96e5812fc0 Improve CAS documentation 2019-08-27 11:02:56 +01:00
HarveyKandola
c35eb16fc5 Merge branch 'auth-with-cas' of https://github.com/dereknex/community into pr/306 2019-08-27 10:59:42 +01:00
HarveyKandola
9dd78ca9be Fix typos 2019-08-27 10:59:40 +01:00
Derek Chen
891ba07db8 add run cas server section 2019-08-21 23:25:12 +08:00
sauls8t
2ee9a9ff46 Setting first/last name for all scenarios 2019-08-18 15:23:01 +01:00
Derek Chen
399c36611f update user firstname and lastname when login with CAS 2019-08-18 21:33:25 +08:00
Derek Chen
fbb73560c0 Get firstname and lastname from CAS attributes 2019-08-17 22:13:37 +08:00
Derek Chen
15e687841f Merge branch 'auth-with-cas' of github.com:dereknex/community into auth-with-cas 2019-08-16 22:24:51 +08:00
Derek Chen
0a10087160 fix got blank page when CAS auth failure 2019-08-16 22:17:52 +08:00
Derek Chen
9d0d4a7861 fix got blank page when CAS auth failure 2019-08-16 22:00:55 +08:00
sauls8t
fc60a5917e Allow user sync when dual auth mode
LDAP sync can be executed if dual mode authentication is enabled.
2019-08-16 10:37:58 +01:00
sauls8t
285a01508b LDAP fix for dual mode 2019-08-15 17:28:45 +01:00
sauls8t
4f248bf018 Linting 2019-08-15 17:15:39 +01:00
sauls8t
32dbab826d Bumped database driver dependencies
Latest used for MySQL, SQL Server and PostgreSQL
2019-08-15 14:51:40 +01:00
sauls8t
b6e1543b7f Merge branch 'master' of https://github.com/documize/community 2019-08-15 13:57:00 +01:00
Harvey Kandola
f8bb879a70
Merge pull request #307 from dereknex/docker-build
Build Documize with docker
2019-08-15 13:54:53 +01:00
sauls8t
20366e6776 Fix typo 2019-08-15 13:54:26 +01:00
Derek Chen
ffacf17c5f update bindata.go 2019-08-14 17:39:41 +08:00
Chen Chong
bfe4c5d768 Update Dockerfile 2019-08-14 09:07:57 +00:00
Derek Chen
0f3a618140
Update Dockerfile
fix docker build miss 'gcc' error
2019-08-14 16:54:52 +08:00
Derek Chen
826f6d96a6 fix docker build miss gcc issue 2019-08-14 16:51:55 +08:00
苗超
6a9fa0140a Update Dockerfile 2019-08-14 08:38:47 +00:00
Derek Chen
24619c6a58 fix merge error 2019-08-14 11:48:59 +08:00
Derek Chen
ebc8214049 Merge branch 'docker-build' into auth-with-cas 2019-08-14 11:39:16 +08:00
Derek Chen
71c1def5c7 add Dockerfile 2019-08-14 11:36:41 +08:00
Derek Chen
fded0014a3 Merge branch 'master' into auth-with-cas 2019-08-13 22:32:40 +08:00
Derek Chen
041091504f fix lost auth token issue when refresh page 2019-08-13 22:10:08 +08:00
Derek Chen
8c2df6178d auth with cas 2019-08-09 13:44:03 +08:00
sauls8t
02d478c6dd Latest embedded assets 2019-08-07 17:21:39 -04:00
Derek Chen
8c99977fc9 working on forentend 2019-08-08 00:40:03 +08:00
sauls8t
9d6b6fec23 Bump version to 3.1.2 2019-08-05 13:54:25 -04:00
sauls8t
4e0e3b5101 Upgrade Markdown preview dependency
v9.0.1
2019-08-05 13:35:26 -04:00
sauls8t
e219c97a6b Enbale browser context menu for TinyMCE 2019-08-05 13:29:08 -04:00
sauls8t
7485f2cef7 Upgrade TinyMCE to v5.0.12 2019-08-05 13:28:48 -04:00
sauls8t
627195aae7 Clarify permissions explanation 2019-08-05 13:06:35 -04:00
Harvey Kandola
f39be2a594
Merge pull request #302 from Ma27/markdown-html-preview
Render HTML in Markdown during previews as well
2019-08-04 13:20:46 -04:00
Maximilian Bosch
444b4fd1f7
Render HTML in Markdown during previews as well
When having e.g. a markdown-based section in a document where you
reference another document, a HTML-link is generated. However when
previewing changes, the raw HTML is shown.

With setting `html: true` in the configuration for `markdownit`[1],
HTML is detected and properly parsed (Also markup tags such as `<h1>`
are rendered properly just like when using `blackfriday` to request a rendered
section).

Regarding probably harmful side-effects: setting e.g. `<style>* { display:
none !important; }</style>` causes a white page with `markdownit` as
well as with `blackfriday`. `<script>` tags aren't affected since
`handlebars` mostly breaks with `<script>` tags within variables that
are substituted using `{{{var}}}` into the DOM[3].

Please note that I didn't commit the modifications in `embed/bindata.go`
as it seemed to me after looking at the history that those updates are
only done when preparing a release.

[1] 1ad3aec204/lib/presets/default.js (L6-L9)
[2] https://github.com/documize/blackfriday/blob/master/markdown.go#L105-L146
[3] https://github.com/wycats/handlebars.js/issues/531
2019-08-01 21:02:35 +02:00
sauls8t
b31f330c41 Fixed SQL Server JSON support
Closes #298
2019-07-18 10:14:41 -04:00
sauls8t
69077ce419 Provider sample data for Cloud onboarding 2019-06-29 15:37:49 +01:00
sauls8t
201d2a339c Prep v3.1.0 build 2019-06-25 17:52:03 +01:00
sauls8t
326019d655 Add padding for section headings in export view 2019-06-25 17:25:00 +01:00
sauls8t
264c25cfe0 Prevent space user invitation for non-Documize auth providers
If running LDAP or Keycloak authentication, you cannot bypass user sync process to invite new users.

Closes #284
2019-06-25 17:05:25 +01:00
sauls8t
595301db64 Replace UPLOAD with + for attachments action 2019-06-25 16:53:43 +01:00
sauls8t
d6432afdad Sort labels by name
DB layer sorts, UI just receives and displays as-is.
2019-06-25 16:52:31 +01:00
HarveyKandola
9c36241b58 Update SQL Server driver library 2019-06-25 15:37:19 +01:00
HarveyKandola
c538fc9eb1 Update PostgreSQL driver library 2019-06-25 15:33:51 +01:00
HarveyKandola
f3df43efe0 Updated Go MySQL driver library 2019-06-25 15:26:53 +01:00
HarveyKandola
d04becc1a3 Improved backup/restore compatibility between DB providers 2019-06-25 15:26:38 +01:00
HarveyKandola
3621e2fb79 Install helps docs as part of onboarding process
Our own docs are installed as sample data!

Refactored search reindexing code.
2019-06-24 17:01:56 +01:00
HarveyKandola
411f64c359 Typo 2019-06-20 15:28:34 +01:00
HarveyKandola
ae923e7df1 Make tooltips use theme skin 2019-06-20 15:28:23 +01:00
HarveyKandola
bfe5262cb5 Streamlined add router methods 2019-06-20 15:27:09 +01:00
sauls8t
80f0876b51 Show admins incomplete config indicator
SMTP checks to start with.
2019-06-19 13:39:36 +01:00
sauls8t
b2cd375936 Increase border radius for UI card elements 2019-06-19 12:48:18 +01:00
sauls8t
243a170071 Fixed SQL syntax for SQL Server
Affected User Group admin
2019-06-19 12:47:47 +01:00
sauls8t
fb3f2cc24b Send product edition meta to setup wizard 2019-06-19 12:47:18 +01:00
sauls8t
946c433018 Detect first-time login event 2019-06-19 12:46:46 +01:00
sauls8t
4d2f30711c Accept activation key during setup process
Enterprise edition only.
2019-06-19 12:46:05 +01:00
HarveyKandola
887c999a1e Bumped Go compilation to v1.12.6 2019-06-14 15:16:28 +01:00
HarveyKandola
b256bf2e9d Move product assets to AWS S3
Moving from Google Cloud bucket to AWS S3 bucket.
2019-06-12 18:17:05 +01:00
Harvey Kandola
8f4cd755de
Merge pull request #282 from documize/core-0619
The all new v3 is here sporting a new layout, better theming, quick-jump to spaces and content, tonnes of document view improvements, comment replies, expand/collapse doc views and much more.
2019-06-12 14:19:12 +01:00
HarveyKandola
64612b825a Include new comment fields in backup/restore process
c_sectionid
c_replyto
2019-06-12 13:52:30 +01:00
HarveyKandola
216866a953 Shrink doc meta font size 2019-06-12 08:44:37 +01:00
HarveyKandola
14820df165 Move doc headings above doc meta 2019-06-11 18:03:28 +01:00
sauls8t
f7a738ad84 v3 build prep 2019-06-11 11:41:09 +01:00
sauls8t
df2775f8a4 Remove confusing dick handlers from document meta zone 2019-06-11 10:38:57 +01:00
sauls8t
a710839f69 Tidy up draft permission handling
Removes inconsistency of approvals vs. lifecycle.
2019-06-11 10:38:39 +01:00
sauls8t
2a45c82b46 Remove redundant logging 2019-06-11 10:37:49 +01:00
sauls8t
7eec01811a Add “Reply” to constants 2019-06-10 15:47:13 +01:00
sauls8t
ef5e4db298 Link comments doc sections + threaded replies
Allow for comments to be related to doc sections.

Enable one-level replies to comments.

closes #240
2019-06-07 19:44:06 +01:00
sauls8t
b1cb0ed155 Make section publish modal focus on first input 2019-06-06 18:29:38 +01:00
sauls8t
78fd14b3d3 Fix indentation 2019-06-06 18:17:03 +01:00
sauls8t
82ddcc057d Make copy/move process use dropdowns for selection
We currently use keyword searching to find target documents.

Replace this with space and document list dropdown for quicker and easier target document selection.
2019-06-06 17:58:48 +01:00
sauls8t
a90c5834fa Improve move/copy/merge sections between documents
Processx all child sections during copy/move/merge operation.

Ensure links work as expected within newly copied/moved content.

Index copied/moved content for searching.

fixes #138
fixes #248
2019-06-06 16:17:36 +01:00
sauls8t
ec8d5c78e2 Provide copy document option
Duplicates entire document tree into a new document (same space).
2019-06-06 11:45:41 +01:00
HarveyKandola
b75969ae90 Use app-meta service to construct section link 2019-06-05 12:56:02 +01:00
HarveyKandola
9b82f42cc1 Copy link to section to clipboard
Closes #174
2019-06-05 12:52:15 +01:00
HarveyKandola
b8fee6b962 Indent doc sections as per hierarchy
Reflect doc structure by indenting sections as you read the document.

Fixes #281.
2019-06-05 11:41:43 +01:00
HarveyKandola
8baad7e2f0 Enable doc section expand/collapse
Closes #170
2019-06-05 11:09:24 +01:00
HarveyKandola
99a5418dba Only show space dropdown when label has 2+ spaces 2019-06-03 17:00:32 +01:00
HarveyKandola
acd3dd63b5 Fix typo 2019-06-03 17:00:06 +01:00
HarveyKandola
96872990f9 Update export process CSS
This will ensure new styles are reflected during export process.
2019-06-03 12:21:18 +01:00
McMatts
c59a467cdb Print selected sections
Close #146
2019-05-31 19:41:34 +01:00
McMatts
715c31a1da Fix Ember lint issues and print view 2019-05-31 11:48:16 +01:00
McMatts
40237344e2 Show doc created/revised dates
Fixes #229
2019-05-30 15:10:28 +01:00
McMatts
91a3c59cd2 Remove redundant comment/feedback feature
Enterprise edition contains the feedbacl/comment feature and Community edition should not show this.

Closes #272
2019-05-30 10:41:09 +01:00
McMatts
fe7548cd97 Change position of doc attachments 2019-05-29 16:57:22 +01:00
McMatts
ca4a9a74ee Sync doc meta layout with Enterprise edition 2019-05-29 14:58:00 +01:00
McMatts
1e1cbdd843 Reduce space between doc sections
Fixes #253
2019-05-29 14:36:37 +01:00
McMatts
c8b82c85fe Sync doc meta style with Enterprise edition 2019-05-29 14:31:10 +01:00
McMatts
bae7909801 Sync with Enterprise edition changes 2019-05-29 12:49:20 +01:00
McMatts
c870547fa1 Move doc meta fields out of sidebar 2019-05-29 11:09:19 +01:00
McMatts
c0876e7be8 Allow for scrollable doc TOC + scroll to top + wrap section names
Closes #254
2019-05-28 16:12:25 +01:00
McMatts
cd9f681adf Resolve Code section type syntax load bug
For certain syntax types CodeMirror was missing required logic.

Fixes #276
2019-05-28 15:48:16 +01:00
McMatts
0240f98eb0 Add scroll to top option for document view
Closes #175
2019-05-28 14:08:19 +01:00
McMatts
c49707d160 Make popups close on doble-click + quote @size attrs
1. Popups should close on subsequent trigger clicks
2. @attrs should be quoted as oper linter warnings.
2019-05-28 10:59:48 +01:00
McMatts
c65eb97948 Show jump list to other space documents
Closes #219

Jump to documents within space when viewing a document.
2019-05-24 15:08:54 +01:00
McMatts
bc9dab72f2 Show quick list and jump to other spaces with same label
Closes #275
2019-05-24 13:45:01 +01:00
McMatts
6ae9414361 Complete UI refactoring to new nav and toolbar UX
Compact design!
2019-05-24 12:30:31 +01:00
McMatts
e37782e5b7 Fix edge case for attachments download auth checks
Edit permissions no longer interfere with download checks.
2019-05-24 12:29:46 +01:00
Harvey Kandola
2bbeaf91a0 Implement dropdown menu for document toolbar 2019-05-22 06:35:54 +01:00
Harvey Kandola
de273a38ed New toolbar styling and layout controls
Built to work with forthcoming feature set that requires display of more options.
2019-05-21 17:05:57 +01:00
Harvey Kandola
08794f8d5f Migrate views to new master layout 2019-05-20 17:40:57 +01:00
Harvey Kandola
14f313a836 Make Login action more prominent
Closes #247
2019-05-20 15:21:33 +01:00
Harvey Kandola
62c3cd03ad [WIP] Improve master layout for different devices + product growth
We have two pressing needs:

1. Improve experience on real estate challenged devices.
2. Make room for product feature-set growth.

To hit these targets, we need to develop better UX through smarter on-screen space management.
2019-05-20 10:39:48 +01:00
McMatts
bce1c1b166
Update README.md 2019-05-17 11:36:53 +01:00
Harvey Kandola
758bf07272 Bump version 2019-05-16 13:21:04 +01:00
Harvey Kandola
479508e436 Upgrade UI framework to Ember v3.10.0 2019-05-16 12:49:27 +01:00
Harvey Kandola
49bf4eeaa0 Update .gitignore 2019-05-16 12:48:46 +01:00
Harvey Kandola
1c45aef461 Fix TinyMCE toolbar 2019-05-16 11:14:34 +01:00
Harvey Kandola
a988bc0c3c
Update README.md 2019-05-15 16:50:51 +01:00
Harvey Kandola
91ec2f89d8 Compile for ARM and ARM64 (Raspberry Pi)
Closes #267 so folks can run Documize on the Pi.
2019-05-15 16:45:26 +01:00
McMatts
2477c36f11
Merge pull request #266 from documize/core-0519
Upgrade rich text editor, dual LDAP/forms authentication
2019-05-14 14:54:35 +01:00
McMatts
e2a3962092 Remove double screen blink after logout 2019-05-14 14:52:36 +01:00
McMatts
8ecbb9cdee Bump version 2.5.0 2019-05-14 14:52:11 +01:00
McMatts
f738077f5a Remove rogue log output 2019-05-14 14:51:58 +01:00
Harvey Kandola
f17de58fff Improve hyperlink color
Closes #261

Still more work to do, but an improvement nonetheless.
2019-05-14 11:28:19 +01:00
Harvey Kandola
40a0d77f93 Remove unecessary TRIM() from SQL queries
Should resolve #265
2019-05-14 09:38:26 +01:00
Harvey Kandola
072ca0dfed Ensure user admin works for new dual login mode 2019-05-13 16:50:20 +01:00
Harvey Kandola
b054addb9c Support dual login via LDAP and forms authentication
Closes #256 as we now support dual login -- LDAP and forms authentication.

Also bumped the vendored library to LDAP.v3 as it contains bug fixes.
2019-05-13 16:14:11 +01:00
Harvey Kandola
e59e1f060a
Update README.md 2019-05-13 15:58:30 +01:00
sauls8t
faf9a555d2 Upgrade to Tiny editor v5 2019-05-13 12:47:38 +01:00
sauls8t
8ab3cbe7e8 Support any name database
Closes #264
2019-05-10 16:38:19 +01:00
Saul S
86d25b2191
Update README.md 2019-04-29 13:37:00 +01:00
Saul S
9a53958c8f
Merge pull request #258 from documize/startup-config
Support for documize.conf files
2019-04-29 13:36:34 +01:00
sauls8t
b971c52469 Rebind dropzone elements for section attachments 2019-04-29 13:34:38 +01:00
sauls8t
34d1639899 Look for implicit documize.conf
@harveykandola

Now looks for implicit documize.conf, then specified .conf, then fallback to flags and envars.
2019-04-28 14:54:48 +01:00
sauls8t
1fefdaec9f Add comments 2019-04-27 17:11:58 +01:00
sauls8t
8f1bc8ce1f Specify runtime parameters in TOML format config file
In addition to specifying parameters in the command line and environment variables, you can now omit all parameters and provide a config file.

Example:

./documize myconfig.conf

Note: there is no switch setting, just provide the filename as an argument.

Fixes #243
2019-04-27 16:59:10 +01:00
sauls8t
d151555597 Update .gitignore to exclude .conf files
These are .toml format files
2019-04-26 19:54:31 +01:00
Harvey Kandola
4255291223 Merge branch 'master' of https://github.com/documize/community 2019-04-26 16:18:53 +01:00
Harvey Kandola
86a4e82c12 Reduce meta endpoint logging 2019-04-26 16:18:50 +01:00
Harvey Kandola
daa9e08ab4
Update README.md 2019-04-26 14:30:36 +01:00
Harvey Kandola
c666e68c2b v2.4.1 prep 2019-04-26 12:21:04 +01:00
Harvey Kandola
e6e3ed71ac
Merge pull request #250 from siepkes/postgresql_postgis_fix
Ignore PostGIS when determining if PostgreSQL is empty
2019-04-23 16:30:51 +01:00
Jasper Siepkes
89a28ad22f
Ignore PostGIS when determining if PostgreSQL is empty
If the PostGIS extension is installed in PostgreSQL the
'spatial_ref_sys' will automatically have been installed in the public
schema. Documize would see this table and incorrectly assume it
shouldn't enter setup mode.
2019-04-23 17:07:09 +02:00
Harvey Kandola
8e4ad6422b Ensure Backup/Restore process section attachments
New DB column c_sectionid means something new to backup and restore.
2019-04-21 11:53:48 +01:00
Harvey Kandola
4de83beba4 Update build process to include PDFJS 2019-04-19 15:09:12 +01:00
Harvey Kandola
10c57a0ae1
Merge pull request #249 from documize/section-pdf-files
PDF section type + section level attachments
2019-04-19 13:48:59 +01:00
Harvey Kandola
728789195c PDF section type build prep
Closes #207 -- view PDF's with new PDF section type.
2019-04-19 13:18:31 +01:00
Harvey Kandola
b5cd378302 Complete PDF section type 2019-04-19 11:30:40 +01:00
Harvey Kandola
7fde947a52 Enable PDF section editor 2019-04-18 15:42:18 +01:00
Harvey Kandola
61d0086337 Provide per section attachments
Upload and delete attachments on a per section basis.
2019-04-18 13:31:48 +01:00
Harvey Kandola
166aeba09b [WIP] PDF viewer section & per section attachments 2019-04-17 17:13:18 +01:00
Harvey Kandola
c0ed3c3d04 Bump version 2019-04-16 13:10:44 +01:00
Harvey Kandola
ab5314d5e1 Remove cursor from dropdown menu header 2019-04-16 12:53:35 +01:00
Harvey Kandola
51a0e1127e Add spam control basics 2019-04-16 12:53:22 +01:00
Harvey Kandola
e10d04d22e Exclude draft versions from non-lifecycle users
Only show draft documents to those with lifecycle permissions.

Closes #242
2019-04-15 13:23:41 +01:00
sauls8t
2fffb7869e Bump version 2019-04-13 17:23:37 +01:00
sauls8t
82ed36478b Show if search result is template
Helps to distinguish between docs and templates when listing search results.
2019-04-11 15:49:58 +01:00
sauls8t
1da49974cb Improve reverse proxy support
Should address edge cases and close #224 -- subject to field testing.

Does require the NGINX deployments use the following:

proxy_pass <http://documize-url:5001>;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
2019-04-11 14:45:36 +01:00
sauls8t
9e3eac19aa Allow doc/section/files links to open in tabs
Closes #233 and might help #236
2019-04-10 20:03:34 +01:00
Saul S
92696c5181
Include SQL Server 2019-04-09 15:31:29 +01:00
Saul S
eecf316d50
Merge pull request #238 from documize/mssqlserver
Microsoft SQL Server 2016+ database support
2019-04-09 15:30:11 +01:00
Harvey Kandola
fa383a58ff Bump version and update NOTICES 2019-04-09 13:24:42 +01:00
Harvey Kandola
b5a5cfd697 Give missing account warning during password reset
The reset password process will tell the user if they do not have an account.
2019-04-09 13:24:27 +01:00
Harvey Kandola
2ddd7ada9b Make storage providers generate row limit clause 2019-04-04 12:08:57 +01:00
Harvey Kandola
8515a77403 Remove debug info from compiled binaries 2019-04-04 12:08:30 +01:00
Harvey Kandola
f8d97d2a56 Make backup/restore compat with SQL Server 2019-04-02 15:47:31 +01:00
Harvey Kandola
e98f7b9218 Enable searching for SQL Server storage provider 2019-04-02 15:30:42 +01:00
Harvey Kandola
a41f43c380 WIP SQL Server support 2019-04-01 20:08:57 +01:00
Harvey Kandola
64403c402b Make store SQL Server compatible 2019-04-01 12:02:23 +01:00
Harvey Kandola
9ec858286f Create tables
Script to create tables with correct data types in SQL Server 2016 and above.

Search table not included.
2019-03-29 16:42:49 +00:00
Harvey Kandola
80aab3ce99 SQL Server provider basics 2019-03-27 15:09:48 -04:00
Harvey Kandola
deb579d8ad Microsoft SQL Server driver and prep 2019-03-26 08:51:02 -04:00
Harvey Kandola
e6335dd58c Prep 2.2.1 release 2019-03-25 13:41:22 -04:00
Harvey Kandola
e1a8f8b724 Display third party notices in UI 2019-03-24 17:53:22 -04:00
Harvey Kandola
e1001bb11e Merge branch 'master' of https://github.com/documize/community 2019-03-24 17:18:26 -04:00
Harvey Kandola
dbee77df56 Add more 3rd party library references 2019-03-24 17:18:24 -04:00
Harvey Kandola
9c2bff0374
Update README.md 2019-03-21 11:37:16 +00:00
Harvey Kandola
651cbb1dfe Add NOTICES.md
Covers third party dependencies
2019-03-20 12:53:50 +00:00
Harvey Kandola
a98c3a0fe2 Use + CONTENT for consistency
Closes #228
2019-03-18 18:04:34 +00:00
Harvey Kandola
a08b583b22 Use monospace font for Markdown editor
Closes #227
2019-03-18 18:02:47 +00:00
McMatts
6738d2c9e1
Merge pull request #225 from documize/dev0319
v2.2.0 merge
2019-03-15 13:01:28 +00:00
Harvey Kandola
441001fffe Make code section font size REM based
In line with recent changes.
2019-03-15 12:57:58 +00:00
Harvey Kandola
a4e07fbf7f Release v2.2.0 prep 2019-03-13 17:48:53 +00:00
McMatts
9a41e82aa3 Provide view density switcher for spaces & space view
Closes #218
2019-03-13 15:17:15 +00:00
McMatts
b89a297c70 Fixed an issue with duplicate search results
Issue crept in during switch to lodash lib.
2019-03-13 15:15:43 +00:00
McMatts
ca1e281775 Decrease tooltip delay 2019-03-13 15:15:12 +00:00
McMatts
c5fc0f93e0 Improve click handling for navigaiton elements in sidebar 2019-03-13 11:43:14 +00:00
McMatts
217e8a3a29 Add animation for ember attacher popup components 2019-03-13 11:42:55 +00:00
McMatts
1854998c80 Add diagnostic output for attachment download 2019-03-13 11:42:32 +00:00
McMatts
f4a371357e Clear new section title input box
After inserting new section we clear the seciton title
2019-03-13 11:42:12 +00:00
McMatts
1d00f8ac6e Allow sorting of search results and space contents
Closes #187

Sort search results and space contents by Name, Created or Revised.
2019-03-13 11:40:36 +00:00
McMatts
0985dbf5b6 Improve doc table of contents font sizing 2019-03-08 15:51:36 +00:00
McMatts
b2fcad649e Set new sidebar color 2019-03-08 15:51:19 +00:00
McMatts
f062005946 Introduce transaction isolation customization
Search related indexing transactions requires better TX begin/commit.

New helpers provide TX isolation control.
2019-03-08 15:50:55 +00:00
McMatts
36d7136210 Add diagnostic message for LDAP auth 2019-03-08 15:45:46 +00:00
McMatts
0bfde82040 Move space label to main view from sidebar
Solves long-standing debate about removing meta from sidebar, and keeping sidebat for navigation/filtering.
2019-03-08 15:45:12 +00:00
McMatts
e6e5f75ee7 Set doc revised for when section events
Supports new space recency filters.
2019-03-08 15:43:17 +00:00
McMatts
eb9501014d Make WYSIWYG font size & line height to REM
End of pixels @harveykandola
2019-03-06 14:11:37 +00:00
Harvey Kandola
e35639502d
Update README.md 2019-03-05 12:34:39 +00:00
Harvey Kandola
3db4981181
Update README.md 2019-03-05 12:33:16 +00:00
Harvey Kandola
3206eb4176
Update README.md 2019-03-05 12:32:45 +00:00
Harvey Kandola
576e1beade
Update README.md 2019-03-05 12:31:36 +00:00
Harvey Kandola
54eefc5132
Update README.md 2019-03-05 12:30:59 +00:00
McMatts
fbb1e334f8 Bump version to 2.1.1 2019-03-04 20:49:14 +00:00
McMatts
bb73655327 Write to stderr when onboarding shared space fails 2019-03-04 19:00:15 +00:00
McMatts
8c2febd636 Fixed lodash conversion issue with _.rest to _.drop
Solves move down on table of contents
2019-03-04 18:59:44 +00:00
McMatts
395008d06d Allow hypen in tag names with Firefox
When keycodes are different across browsers. :|
2019-03-04 18:59:06 +00:00
Harvey Kandola
d009e4ed2a Make setup process use new isEmail helper 2019-03-03 18:03:48 +00:00
Harvey Kandola
54bf258c61 Bump version + bundle web assets 2019-03-03 16:00:25 +00:00
Harvey Kandola
8332e8a03d Send back saved label after edits 2019-03-03 15:59:13 +00:00
Harvey Kandola
a6f8be2928 revert back to ember-ajax 3.x series 2019-03-03 15:58:58 +00:00
Harvey Kandola
cbd9fddcfe Space out save button 2019-03-03 15:58:39 +00:00
Harvey Kandola
4013b5ca03 Fix typo for self-host subdomain help info 2019-03-03 15:58:28 +00:00
Harvey Kandola
24b1326c31 Remove un-needed success alerts 2019-03-03 15:58:03 +00:00
Harvey Kandola
566807bc14 Replaced underscore.js & is.js with lodash.js 2019-03-03 13:10:04 +00:00
Harvey Kandola
df8e843bf5 Enabled TLS 1.3 support
IE11 might have issues so we don't support IE11.
2019-03-01 17:15:15 +00:00
Harvey Kandola
4d0de69489 New release prep 2019-03-01 17:13:29 +00:00
Harvey Kandola
25c247e99b Introduce new Tabular editor with CSV import support
Closes #211 and #202

An all-new tabular editor has been added -- this replaces the previous tabular editor.

Better formatting options.

CSV data can also be imported straight into the table.
2019-03-01 14:28:18 +00:00
Harvey Kandola
ed99b0c9f3 JS linting 2019-03-01 14:25:32 +00:00
Harvey Kandola
8b0bb456d9 Format Blockquote
Fixes #217 for both Rich Text and Markdown section types.
2019-03-01 12:59:10 +00:00
Harvey Kandola
e438542cab Upgrade ember-ajax to v4.0.1
Was v3.1.0
2019-02-28 17:47:12 +00:00
Harvey Kandola
553c17181e Upgrade EmberJS to v3.8.0 2019-02-28 17:46:02 +00:00
Harvey Kandola
9b06ddecb5 Refactor content linking code flow
Fixed EmberJS deprecation warnings by removing usage of observers.

Fixed edge case bug for repeated content link insertion modal clicks.
2019-02-28 15:11:46 +00:00
Harvey Kandola
3fd1d793a3 Standardize text color for PRE & CODE blocks 2019-02-28 14:16:51 +00:00
Harvey Kandola
fc17ea5225 Standardize style of PRE & CODE blocks
For Markdown, styling was not consistent between inline blocks and full code blocks.

Fixes #203
2019-02-28 13:58:59 +00:00
Harvey Kandola
f47f09661f Improve search by tag for MySQL
Fixes #214

MySQL requires specific full text search queries.
2019-02-28 13:39:53 +00:00
Harvey Kandola
4b7d4cf872 Ensure non-negative space summary counts
Sometimes users direct manipulate database and so space level counts don't match.

We ensure that counts don't go negative.
2019-02-28 12:42:42 +00:00
Harvey Kandola
c108d0eb30 Handle wrap-around for add section popup 2019-02-28 12:32:22 +00:00
Harvey Kandola
1f5221ffa0 Add install docs link to setup wizard 2019-02-28 12:31:57 +00:00
Harvey Kandola
a888b12ad1 Make TinyMCE Prism integration use full CSS path 2019-02-28 12:31:28 +00:00
Harvey Kandola
2510972a83 Allow SMTP config to specify FQDN of sending server
/cc @backba
2019-02-28 12:31:02 +00:00
Harvey Kandola
560f786b8b Merge branch 'master' of https://github.com/documize/community 2019-02-27 14:50:43 +00:00
Harvey Kandola
af641b93f1 Show doc links on setup screen 2019-02-27 14:50:42 +00:00
Harvey Kandola
f4fa63359f
Update README.md 2019-02-27 13:58:18 +00:00
Harvey Kandola
f828583b49 Allow admins to set subdomain for their instance
Fixes #209

Admins can see and set subdomain for their instance.

Self-host customers only!
2019-02-27 13:49:59 +00:00
Harvey Kandola
af9bc25660 PlantUML to force UTF-8 encoding
Should Fix #213
2019-02-27 13:10:19 +00:00
Harvey Kandola
66003dac21 Logo fetching to match on domain mismatch
Fixes #209

Sometimes people use subdomain like docs.example.org but backend does not reflect the domain, e.g. dmz_org.c_domain is empty.

So we fall back to loading logo for empty c_domain value as well.
2019-02-26 11:55:08 +00:00
sauls8t
d4f6694933 Change links to use www.documize.com 2019-02-24 18:41:18 +00:00
sauls8t
27030a0dc2 Update README.md 2019-02-22 18:28:22 +00:00
sauls8t
43f515a1f9 README update 2019-02-22 16:47:26 +00:00
sauls8t
9aaea9492a Fix issue with backup/restore of space labels
Closed #206
2019-02-21 10:56:15 +00:00
sauls8t
ac84eaf85d Ensure sqlx.In is compatible with latest PostgreSQL
Bump version
2019-02-12 12:15:09 +00:00
Harvey Kandola
9504a8cf6c Stop search view from messing iwht browser history
Fixes #195

Browser back button functions as expected.

Will go live in v2.0.3.
2019-02-10 16:46:09 +00:00
Harvey Kandola
fbe353475c Change location of jsconfig.json editor file 2019-02-10 13:12:47 +00:00
Harvey Kandola
bbed3e5a08 Chaneg build number data type to string
Fixes #198
2019-02-10 13:12:17 +00:00
McMatts
9f4715a494 Bump version 2019-02-05 20:27:02 +00:00
McMatts
d8cb69b6c0 Better UX for custom logo upload
Resolves issue with phantom click.
2019-02-05 20:26:47 +00:00
McMatts
7f2d2c01a6 Improved MS Word document name extraction
Use document filename and not H1 title inside document.

Supports both Linux & MSFT.
2019-02-05 20:25:36 +00:00
McMatts
f3e66b73c1 Increase size of space icon column in DB
Fixes #194
2019-02-05 20:23:26 +00:00
Harvey Kandola
02ffaa5f99 Tweak document toolbar layout
Position is to the high and right.
2019-01-27 15:40:01 +00:00
Harvey Kandola
9219dd9296 Set default label color if user does not pick one 2019-01-26 20:02:03 +00:00
Harvey Kandola
5faf6bda9b Remove label associations when deleting a label 2019-01-26 20:01:35 +00:00
sauls8t
89a7496c7f Improved self-managed install wizard layout 2019-01-26 13:24:54 +00:00
sauls8t
c0c3ca18e2 Fixed an issue with non-admin Jira connector auth
Role check should be OR and not AND.
2019-01-24 16:57:23 +00:00
sauls8t
2e443de84e Update bindata.go 2019-01-24 16:56:53 +00:00
sauls8t
9b51d9990f Update to latest EmberJS v3.7.x 2019-01-24 15:28:14 +00:00
sauls8t
278572c49b Use transition.to for query params 2019-01-24 15:27:50 +00:00
sauls8t
1e217274c6 Correctly unsubscribe from JS event listeners 2019-01-24 15:27:21 +00:00
sauls8t
9fd002b5da Change location of add section at bottom of content 2019-01-24 13:51:55 +00:00
sauls8t
f5bdbb49d0 Bump version 2019-01-24 13:51:31 +00:00
sauls8t
c69020f1e6 Move add section into section toolbar 2019-01-23 15:46:27 +00:00
sauls8t
0707bdd3d6 Improve Jira integration layout 2019-01-23 15:46:11 +00:00
sauls8t
36634be6f5 Put back to space button in sidebar (doc view) 2019-01-23 15:45:47 +00:00
sauls8t
6c71a1f18d Provide options for UI buttons to expand to fill parent 2019-01-23 15:44:46 +00:00
sauls8t
6126d4dd5d Introduce additional UI label constants 2019-01-23 15:44:20 +00:00
Harvey Kandola
013d09dda4 Lint space toolbar 2019-01-21 09:06:01 +00:00
Harvey Kandola
c6632fec1d Merge branch 'master' of https://github.com/documize/community 2019-01-20 16:49:34 +00:00
Harvey Kandola
e8735ffc12 Fix issue with MS Edge not downloading export HTML file 2019-01-20 16:49:32 +00:00
Harvey Kandola
c5155da74b
Update README.md 2019-01-20 16:46:15 +00:00
Harvey Kandola
e737339090 Change Save as Template confirm button label 2019-01-20 14:14:36 +00:00
Harvey Kandola
4f63a32ab1
Link to live docs 2019-01-18 13:18:10 +00:00
Harvey Kandola
7cc0b9c9b8
Merge pull request #189 from documize/core-1118
Documize v2.0
2019-01-18 13:14:56 +00:00
Harvey Kandola
560d00322f Embed latest web app assets 2019-01-18 13:13:31 +00:00
Harvey Kandola
b6d9c54667 Improve attachment and link handling 2019-01-16 16:55:43 +00:00
Harvey Kandola
6c07d2e569 Clean up popup menu rendering 2019-01-15 20:16:09 +00:00
Harvey Kandola
924b707db0 Allow session service to hold secure viewing token 2019-01-15 20:15:53 +00:00
Harvey Kandola
3da4144c1b Set correct model for space clone options 2019-01-15 20:15:12 +00:00
Harvey Kandola
1ef209b74f Change attachment deletion confirmation from modal to popover 2019-01-15 20:14:32 +00:00
Harvey Kandola
d281621d90 Optimize space deletion process
Utilize multiple SQL transactions to close out the space deletion process.
2019-01-15 20:13:45 +00:00
Harvey Kandola
d05052a5b4 Improve display on vertically constrained screens
Changed media queries to invoke mobile-first rendering if screen vertical height is less than 650px.
2019-01-13 13:57:12 +00:00
Harvey Kandola
317e9cbcaa Make sidebar nav scroll vertically on height restricted displays 2019-01-13 11:59:13 +00:00
Harvey Kandola
2efd239d14 Improve responsive long content wrapping 2019-01-13 09:40:22 +00:00
Harvey Kandola
984aa854e5 Reduce empty space for anon users on doc view 2019-01-13 09:40:00 +00:00
Harvey Kandola
ca213ba5d1 Detect and hide empty doc toolbar 2019-01-13 09:39:42 +00:00
Harvey Kandola
c1d796e6bc Update export process with latest build assets
We embed CSS into self-contained HTML file.

This change updates the CSS.
2019-01-12 15:14:55 +00:00
Harvey Kandola
60fbdfda11 Improve new user share space onboarding process 2019-01-11 14:03:03 +00:00
Harvey Kandola
659eb99c0f Remove redundant logging dependency 2019-01-09 11:04:23 +00:00
Harvey Kandola
bc28b36627 Make Markdown editor use Ember input helper 2019-01-09 11:03:58 +00:00
Harvey Kandola
f73c2f13d4 Syntax highlight code snippets added via TinyMCE
Prism dependencies included.
2019-01-09 11:02:59 +00:00
Harvey Kandola
0ce10ae5a2 Back-port CSS changes to export process
Export process produces a self-enclosed HMTL file.

The new styles introduced in v2 need to be available to the export process, hence this commit.
2019-01-08 18:11:48 +00:00
Harvey Kandola
a1d5dcaed9 Tweak sidebar responsive CSS 2019-01-08 17:47:51 +00:00
Harvey Kandola
3beb47fd49 Bump version to 2.0.0 2019-01-08 17:47:26 +00:00
Harvey Kandola
aa0f76d3e2 Add material icons dep for Tabular section type
It's required so not much we can do about it.
2019-01-08 17:47:11 +00:00
Harvey Kandola
479a61a3ef Update CodeMirror dep to v5.42.2
Affects Code and Markdown section types
2019-01-08 14:48:23 +00:00
Harvey Kandola
c706edec47 Improve print and PDF rendering 2019-01-08 13:56:42 +00:00
Harvey Kandola
5467771542 Display category names in documents list (space view)
We pre-fetch category names and attach them to documents.
2019-01-08 12:43:25 +00:00
Harvey Kandola
1d4a20cdfe Optimize category SQL code
Removed redundant join condition -- should speed things up!
2019-01-08 12:42:32 +00:00
Harvey Kandola
1b268d42de Remove redundant asset-map add-on 2019-01-07 19:35:07 +00:00
Harvey Kandola
4ddbe59556 Implement simpler solution for dynamic theme loading 2019-01-07 19:26:08 +00:00
Harvey Kandola
a424bbfcae Round the corners for label color box! 2019-01-07 19:25:36 +00:00
Harvey Kandola
fb391d49a5 Change CSS ul/ol/li default styling
Should support custom bullet styles eminating from add-ons.
2019-01-07 14:44:58 +00:00
Harvey Kandola
9206e9aaa1 Improve Ember build process 2019-01-07 14:43:56 +00:00
McMatts
e6ddb1ec24 Upgrade TinyMCE dependency to v4.9.2 2019-01-07 14:42:43 +00:00
McMatts
0b94d55fb9 Improve checkbox UI element styling 2019-01-07 12:42:27 +00:00
McMatts
4d83f5efd7 Update readme with new v2 screenshot 2019-01-07 12:42:11 +00:00
McMatts
dd355958a2 Refactor custom & default logo logic 2019-01-07 12:41:55 +00:00
McMatts
90aa9710a6 Develop PostgreSQL migration scripts 2019-01-07 12:40:47 +00:00
McMatts
036f36ba1d Enable custom logo upload and rendering 2019-01-06 13:50:12 +00:00
McMatts
a211ba051a Per space label, icon, description
Labels introduce visual grouping and filtering of spaces.
2019-01-04 16:33:30 +00:00
McMatts
fe8068965c Improve Document Toolbar iconography 2018-12-27 17:45:04 +00:00
McMatts
5757b2d36e Apply changes backported from Enterprise edition 2018-12-26 18:13:00 +00:00
McMatts
3d0a3cecf9 On start, fail if invald database connection
Fixes #188 and #186
2018-12-23 16:07:44 +00:00
McMatts
eb56169fe5 Fix up post-Enterprise Edition merge 2018-12-23 16:06:15 +00:00
Harvey Kandola
6f495dd1c6 Make document meta fields click-to-edit 2018-12-21 18:03:35 +00:00
Harvey Kandola
b495041222 Hanel empty state for document meta fields 2018-12-21 17:39:09 +00:00
Harvey Kandola
92cb03a1db Make content linker compat with new attachment API
Moved fom /attachments to /attachment API endpoint name.
2018-12-21 17:38:55 +00:00
Harvey Kandola
60f8cb7b5b Move Add Section wizard to new UI framework 2018-12-21 12:49:55 +00:00
Harvey Kandola
60d2ef57bb Remove Boostrap Grid
Replaced with CSS Grid layout.
2018-12-21 11:46:51 +00:00
Harvey Kandola
61c648a7ac Replaced Material Icons & Boostrap with custom UI framework 2018-12-21 11:15:59 +00:00
Harvey Kandola
d0f0a12f2d Use new UI framework for content block editor 2018-12-20 18:20:56 +00:00
Harvey Kandola
89957c8278 Change add-ons to use new UI framework 2018-12-20 18:12:17 +00:00
McMatts
e140caff55 Break out document tag and category mng sections
Separate out screens for tag and category management.
2018-12-20 14:31:59 +00:00
sauls8t
3c81297fc6 Move revisions to new ui framework 2018-12-20 13:05:22 +00:00
sauls8t
2042454e77 Add missing super call in routes 2018-12-20 13:05:06 +00:00
sauls8t
329c43eba0 Implement new toolbar for document view 2018-12-19 19:23:17 +00:00
sauls8t
93253be0f2 Update document view to use new UI framework
1. Sidebar contains ToC & attachments.
2. Document meta moved up before content (to frame  context).
3. Per section toolbar re-designed.

Co-Authored-By: Harvey Kandola <harvey@documize.com>
2018-12-19 18:36:45 +00:00
sauls8t
3d2060ca60 Migrate document attachments view to new UI framework 2018-12-19 12:41:36 +00:00
Harvey Kandola
7cdf97aa86 Revamp document view using new layout
New master page system and UI framework implemented on document view.

Sidebar contains ToC and Attachments.
2018-12-18 19:03:34 +00:00
Harvey Kandola
b4b3dbcb4c Complete the UI migration for all space setting views
Permissions and Categories admin views have been migrated to the new UI layout system.
2018-12-18 11:12:11 +00:00
McMatts
60e92b63a9 Applied new layout to space admin screens
Applied the new master layout and UI controls to the following space admin screens:

1. General options.
2. Deletion.
3. Permissions.
4. Content blocks.

Co-Authored-By: Harvey Kandola <harvey@documize.com>
2018-12-17 18:32:26 +00:00
McMatts
d5b5e015d1 Update Space view to use new layout 2018-12-17 13:39:13 +00:00
Harvey Kandola
0cc83c13c8 Move What's New into dedicated page
No longer a modal popup.

Also merged About dialog content.
2018-12-17 10:19:16 +00:00
Harvey Kandola
42db78ce14 Ensure modals in sidebar show in main view
z-index shenanigans to ensure modals rooted in position:fixed sidebar appear correct centered over main view.
2018-12-16 17:22:49 +00:00
Harvey Kandola
05a1db9d8a Put settings link to new sidebar UX
Just above Search but below all other core app views.
2018-12-16 17:21:43 +00:00
Harvey Kandola
9f35cbb64a Use font antiasliasing
Set as default site-wide.
2018-12-16 17:21:02 +00:00
Harvey Kandola
d1bc4a5b4c Provide better user list paging UX 2018-12-16 12:56:50 +00:00
Harvey Kandola
8a654fcf3d Change Search & Profile views to use new UX/UI 2018-12-14 16:40:54 +00:00
Harvey Kandola
0ec0c65002 Complete UI revamp for admin screens 2018-12-14 15:47:41 +00:00
Harvey Kandola
edb256e754 Bring new UX to each admin view 2018-12-14 11:52:31 +00:00
McMatts
ff1d737c68 New look and feel for auth screens 2018-12-13 13:34:26 +00:00
Harvey Kandola
8d525ce733 Optimize document fetching SQL
Removed redundant sub-query to speed up fetching of documents by space.

There is no cross-tenant leak of information with this change.
2018-12-13 12:25:53 +00:00
McMatts
f442081a41 Redesign setting screens
We're using iconography to stylize each setting screen.

Imeplemented new color palletes and shades.
2018-12-13 12:24:16 +00:00
Harvey Kandola
02102f9bf3 Provide icon rendering framework 2018-12-12 13:35:16 +00:00
Harvey Kandola
6eb68f84e0 Introduce modular UI framework
1. Modals wrapped
2. Toolbar icon actions: click and link-to navigation
3. Moved components into sub-folders
4. Replaced Bootstrap Tooltip and Dropdown libs with Ember specific add-ons

And more.

Co-Authored-By: Saul S <sauls8t@users.noreply.github.com>
Co-Authored-By: McMatts <matt@documize.com>
2018-12-11 18:00:08 +00:00
Harvey Kandola
f140e7ef77 Componentize UI elements: buttons, toolbars 2018-12-10 18:22:11 +00:00
Harvey Kandola
adbd00bdd7 [WIP] Upgrade EmberJS -- lint pass! 2018-12-08 20:54:19 +00:00
Harvey Kandola
c7808d0b5a [WIP] Upgrade EmberJS: add-on upgrades 2018-12-08 19:06:43 +00:00
Harvey Kandola
cf263a4f6a WIP EmberJS upgrade 2018-12-08 15:57:58 +00:00
Harvey Kandola
70a3b5915c WIP EmberJS upgrade 2018-12-08 15:54:10 +00:00
Harvey Kandola
5cfbf07e55 [WIP] Upgrading EmberJS codemods 2018-12-08 15:39:31 +00:00
Harvey Kandola
4b68529090 [WIP] Upgrade EmberJS to 3.5.x 2018-12-08 15:35:41 +00:00
Harvey Kandola
44d3e40663 Componentize new UI buttons and toolbar 2018-12-08 15:16:04 +00:00
Harvey Kandola
0de7efdf20 Introduce new button and toolbar styles 2018-12-06 20:13:03 +00:00
sauls8t
3b179d5bc0 Remove excess JS libs 2018-12-06 14:40:35 +00:00
sauls8t
75a19a80f9 Replace Bootstrap tooltips/popovers/dropdowns
With Ember Attacher component.

This commit removes redundant BS code.

Co-Authored-By: McMatts <matt@documize.com>
2018-12-06 14:10:00 +00:00
sauls8t
f05a6fc999 Introduce new nofications framework
Integrated https://github.com/documize/iziToast and added 4 log levels.
2018-12-05 13:44:10 +00:00
Harvey Kandola
f44cda66e6 Updated themes to use new color framework 2018-12-04 17:36:59 +00:00
Harvey Kandola
d7a46ceee6 Implement new refactored color scheme 2018-12-04 17:26:57 +00:00
Harvey Kandola
da0861b3fd Implement new sidebar and master layout 2018-12-03 19:51:34 +00:00
Harvey Kandola
34d54745f3 New theme layout 2018-12-02 16:19:25 +00:00
Harvey Kandola
679049d2b1 [WIP] User can select theme 2018-11-24 18:39:43 +00:00
Harvey Kandola
11e164496b [WIP] theme selector 2018-11-24 16:13:21 +00:00
Harvey Kandola
a7e52809dc Bump version 2018-11-21 12:01:03 +00:00
Harvey Kandola
7428199fdd Handle edge case of self-approving sections changes
Prevents double-submission bug leading to section being hidden from view.
2018-11-21 11:53:12 +00:00
Harvey Kandola
d499888cfd Revision history will respect doc lifecycle stage
Protected documents cannot be rolled back!
2018-11-21 11:52:33 +00:00
Harvey Kandola
c152d029f2 Add comments 2018-11-21 11:51:54 +00:00
McMatts
5d632712e0 Improve Space permissions
Closes out loopholes that allowed managers to kick owners.
2018-11-16 19:18:10 +00:00
McMatts
09635b67ab Experimental TX refactoring 2018-11-16 19:13:41 +00:00
McMatts
73d91a2dae Ensure Backup/Restore process activation keys 2018-11-16 19:13:18 +00:00
McMatts
5153d49ad7 Removed redundant vote code 2018-11-13 18:53:29 +00:00
sauls8t
b1865b2318 Sync'ed versions between EE & CE
Both sit @ 1.76.0
2018-11-13 15:19:05 +00:00
sauls8t
7e959b448c Move space deletion & archived docs into Space settings 2018-11-13 15:18:34 +00:00
sauls8t
b37f9d601f Bump version 2018-11-12 20:26:07 +00:00
sauls8t
0a313be1de Ignore product subscription column for table updates 2018-11-12 20:25:55 +00:00
sauls8t
1d8bb2d3ad Add experimental string to timestamp for backup/restore 2018-11-12 20:25:30 +00:00
sauls8t
3913995dd0 Use timestamp type for comments backup/restore 2018-11-12 20:24:59 +00:00
Harvey Kandola
5e58b56182 Removed redundant code 2018-11-12 15:02:25 +00:00
Harvey Kandola
cb9fd0940d
Merge pull request #185 from documize/app-subscription
App subscription
2018-11-11 18:37:13 +00:00
Harvey Kandola
4df1574663 Bump version 2018-11-11 16:54:47 +00:00
Harvey Kandola
77ab56dbf8 Tweaked app subscription logic 2018-11-11 16:54:36 +00:00
Harvey Kandola
c0e1bd5045 Conditionally backup/restore dmz_config 2018-11-11 16:54:11 +00:00
Harvey Kandola
0a64afd6b5 account deactivation process 2018-11-09 13:42:58 +00:00
Harvey Kandola
6a9ad7f540 Merge code between editions 2018-11-07 15:56:05 +00:00
Harvey Kandola
d1b803b246 PRovide basic in-app purchase/renewal flow 2018-11-05 19:48:50 +00:00
Harvey Kandola
745e610bcb
Merge pull request #183 from simonw/master
Better password advice
2018-10-31 17:27:44 +00:00
Simon Willison
db78d75489
Better password advice 2018-10-31 10:12:19 -07:00
Harvey Kandola
e116d3b000 Subscription checks 2018-10-29 16:53:54 +00:00
Harvey Kandola
6e4c5194e2 Latest build embed assets 2018-10-26 14:41:26 +01:00
Harvey Kandola
eb57cfbfd6 Backup process no longer indents JSON
Save time and memory on large datasets
2018-10-23 16:58:33 +01:00
Harvey Kandola
cccf160d37 Removed spaces 2018-10-23 16:57:58 +01:00
Harvey Kandola
4b543733e7 Provide better Keycloak aiuth failure msg 2018-10-23 16:57:40 +01:00
sauls8t
8cc6bf3d40 bump version 2018-10-23 13:47:41 +01:00
sauls8t
9c6075c6a4 State minimum MySQL v8 version 2018-10-23 13:47:34 +01:00
sauls8t
150f86025b Replace folderId with spaceId 2018-10-23 13:47:13 +01:00
sauls8t
313ed7f90a Allow inline doc title/desc editing 2018-10-23 13:47:00 +01:00
sauls8t
f950075593 Remove redundant code 2018-10-23 13:46:38 +01:00
Harvey Kandola
9667e8c2a0 Record user event backed-up-database 2018-10-20 17:31:59 +01:00
Saul S
88b84dc5ed
Merge pull request #179 from documize/backup-resttore
In-app Backup & Restore
2018-10-20 12:46:23 +01:00
sauls8t
cee71cb313 Tweaks to backup process permissions 2018-10-20 12:41:26 +01:00
sauls8t
db04057d9e Enable in-app backup/restore for global/tenants
Re-mapping of ORG and USER ID values ensures conflict-free merging.

Version numbers bumped.

Co-Authored-By: Harvey Kandola <harvey@documize.com>
2018-10-19 12:40:45 +01:00
sauls8t
ec1939c01d Provide Backup/Restore for system and tenant 2018-10-17 14:27:40 +01:00
sauls8t
b3383f46ca Update SQLX dependency 2018-10-17 14:27:02 +01:00
sauls8t
516140dd7e [WIP] Provide system restore facility
Co-Authored-By: Harvey Kandola <harvey@documize.com>
2018-10-15 18:59:21 +01:00
sauls8t
71a2860716 [WIP] Restore process
Co-Authored-By: Harvey Kandola <harvey@documize.com>
2018-10-12 17:54:30 +01:00
sauls8t
e0457b40da EmberJS: FolderID to SpaceID
Co-Authored-By: Harvey Kandola <harvey@documize.com>
2018-10-12 17:54:15 +01:00
sauls8t
66d5e73ed1 Generate global or tenant level backup file 2018-10-11 16:19:11 +01:00
sauls8t
4094677792 [WIP] Backup process outline 2018-10-10 15:13:09 +01:00
Saul S
8bbb0d3e82
Update README.md 2018-10-07 15:46:27 +01:00
Saul S
4aa3bba7bc
Merge pull request #178 from documize/sql-store
Pluggable storage provider + PostgreSQL support
2018-10-07 14:02:45 +01:00
sauls8t
49f05746bd Correct SQL Group BY for space user list SQL 2018-10-07 13:58:30 +01:00
Harvey Kandola
8eb930d281 Make search re-indexing multi-tenant aware
Makes things easier when having to reindex in multi-tenant deployments.
2018-10-06 17:23:55 +01:00
Harvey Kandola
85b3f6e8ee Bump version 2018-10-05 17:42:52 +01:00
Harvey Kandola
5b4c3ec8cd Faster candidate link selection via SQL.
Co-Authored-By: Saul S <sauls8t@users.noreply.github.com>
2018-10-05 17:42:42 +01:00
Harvey Kandola
df0e3c108e Improved secure mode viewing
Co-Authored-By: McMatts <matt@documize.com>
2018-10-05 17:42:06 +01:00
Harvey Kandola
ab2cbd4ff7 Add the basis for in-app backup/restore process
Zip format output.
2018-10-04 21:04:31 +01:00
Harvey Kandola
391c143483 Change RefID field size from 16 to 20 with updated algo
Xid dependency updated.

Moved to 20 length ID values.

Added new revision number to version and meta information. Revision number is timestamp format.
2018-10-04 21:03:47 +01:00
Harvey Kandola
7860bc1808 Remove redundant Bower files 2018-10-01 18:24:27 +01:00
Harvey Kandola
486395c1ce Reorder user dropdown menu options
Bring Settings up to the top.
2018-10-01 18:24:13 +01:00
Harvey Kandola
1c3eef345f Bump version 2018-10-01 18:23:47 +01:00
Harvey Kandola
c5476d99e9 Replace all SQL bool 0/1 to true/false
For more consistent database provider support.
2018-10-01 18:23:32 +01:00
sauls8t
6dfb1ad2e5 Improve document attachment upload process
Increase to 50MB file size.
2018-10-01 13:31:47 +01:00
sauls8t
075060d11c Implemented per database provider DATE INTERVAL queries 2018-10-01 13:31:22 +01:00
sauls8t
97d36fa2c8 Upgrade to latest Bootstrap 4.1.3 2018-10-01 13:30:38 +01:00
sauls8t
58aad87770 All in with Yarn, removed Bower 2018-10-01 13:30:03 +01:00
HarveyKandola
8a65567169 Implement PostgreSQL Full Text Search++
1. Full text search supports MySQL, MariaDB, Percona and now PostgreSQL.
2. Changed SQL Variant to typed enum.
3. Changed doc.Versioned from INT to BOOL.
4. Search Reindexer now parses all documents and attachments.
5. Site meta API call returns storage provider type.
6. README prep'ed for PostgreSQL support.
7. DELETE SQL statements ignore zero rows affected.

Closes #100 !!!

Co-Authored-By: Saul S <sauls8t@users.noreply.github.com>
Co-Authored-By: McMatts <matt@documize.com>
2018-09-28 16:33:15 +01:00
HarveyKandola
97beb3f4d3 Continued MySQL/PostgreSQL store provider refactoring
Refactored, renamed, removed storage related code.

Basic smoke test passed for PostgreSQL whilst fully working on MySQL variants as per usual.
2018-09-27 15:14:48 +01:00
HarveyKandola
b455e5eaf5 PostgreSQL prep
Update of vendored SQL libs and refactoring of store provider layer.
2018-09-26 17:59:56 +01:00
HarveyKandola
d0e005f638 Jira connector improvements and PostgresSQL schema 2018-09-24 18:53:01 +01:00
HarveyKandola
a9e12f3b4c Ensure installer process supports new database schema 2018-09-23 16:14:05 +01:00
sauls8t
153e38a5d4 Fix missing return on error 2018-09-20 17:23:26 +01:00
sauls8t
fe7389e7ca Improve SQL store for new schema 2018-09-20 17:07:40 +01:00
sauls8t
8ee63de6c7 More SQL changes in line with new schema 2018-09-20 12:47:47 +01:00
sauls8t
944fd98421 Fixed up more SQL store breaking changes 2018-09-20 11:12:17 +01:00
Harvey Kandola
5376bd88d8 Merge branch 'sql-store' of https://github.com/documize/community into sql-store 2018-09-20 09:31:42 +01:00
Harvey Kandola
3ea6ae3c37 Make Sitemap & Robots.txt use new schema 2018-09-20 09:31:06 +01:00
Harvey Kandola
d67767fcfc Make Sitemap & Robots.txt use new schema 2018-09-19 16:38:05 +01:00
Harvey Kandola
4f0cc2f616 Make API work with new schema 2018-09-19 16:03:29 +01:00
Harvey Kandola
28342fcf5e [WIP] new schema implementation 2018-09-18 20:55:40 +01:00
Harvey Kandola
9c2594b1b4 New schema implementation 2018-09-17 18:00:00 +01:00
Harvey Kandola
4f525bd634 [WIP] Schema refactor
Necessary work ahead of PostgresSQL and MS SQL Server support.
2018-09-17 15:31:22 +01:00
Harvey Kandola
09de686fcf Generic support for populating empty database 2018-09-14 18:17:05 +01:00
Harvey Kandola
97d90662dd Make database boot process storage provider agonistic
Moved database queries into provider specific object to ensure database checking, installation, upgrade procedures are pluggable.
2018-09-14 18:00:24 +01:00
Harvey Kandola
4c733ce581 Boot process logger message consistency and improvements 2018-09-14 13:00:58 +01:00
Harvey Kandola
2336dab69f Make database install/upgrade provider aware
Ground work for installing and upgrading database schema based upon DB provider (MySQL, PostgresSQL, SQL Server, etc.)

Cleaned up legacy cruft, refactored, commented and made simpler for to support additional database providers.
2018-09-14 12:50:30 +01:00
Harvey Kandola
cf1e1ff943 Make group membership UX clearer
By labelling buttons with more copy!
2018-09-13 10:10:28 +01:00
Harvey Kandola
3bccd6a537 Refactoring of database init code 2018-09-12 20:03:34 +01:00
Harvey Kandola
d7fea2125f LDAP improvements 2018-09-12 20:03:06 +01:00
Harvey Kandola
2792c8c1da Accept SSL for Jira connector 2018-09-11 14:15:39 +01:00
McMatts
0f19826556 Fix typo
Nice spot @harveykandola !
2018-09-11 12:26:00 +01:00
McMatts
64e6a41353 Correct Trello computed property for non-admins 2018-09-10 17:41:01 +01:00
McMatts
0847a82fc9 Reduce cloned space permissions copy
Removed unnecessary results from SQL.
2018-09-10 17:40:42 +01:00
Harvey Kandola
9ee9526a47 Display subscription information 2018-09-10 10:12:14 +01:00
Saul S
53e4861ded
Merge pull request #167 from documize/ldap
Native LDAP and Active Directory sync and authentication
2018-09-08 12:52:25 +01:00
sauls8t
8ab23c657b Provide link to mock user data 2018-09-07 17:47:08 +01:00
sauls8t
e03497032b Use paging for LDAP queries 2018-09-07 15:09:54 +01:00
sauls8t
ae084ae0bb Improve LDAP tests and preview process 2018-09-05 15:54:00 +01:00
sauls8t
6e0958b3c3 Bump version 2018-09-04 17:44:40 +01:00
sauls8t
074eea3aeb PRovide LDAP sync and authentication 2018-09-04 17:19:26 +01:00
sauls8t
63b17f9b88 Preview LDAP connection results 2018-09-03 18:19:46 +01:00
sauls8t
1ce7e53398 Capture LDAP configuration 2018-09-03 17:36:54 +01:00
sauls8t
fd167234ae Discrete data loading functions 2018-09-01 14:50:37 +01:00
sauls8t
e6b557f43b Refactor LDAP code into discrete functions 2018-08-31 21:00:51 +01:00
sauls8t
a7865d0f71 Refactor LDAP tests with reusable code 2018-08-30 16:01:36 +01:00
sauls8t
7df0fbcb2b Process mulitple groups in LDAP/AD group filter 2018-08-30 11:37:05 +01:00
sauls8t
e490407260 Refactor LDAP tests
Local tests run against OpenLDAP Docker container with sample data.

Public tests run against OpenLDAP server hosted by enterprising 3rd party ( https://www.forumsys.com/tutorials/integration-how-to/ldap/online-ldap-test-server).

AD tests run against AD server hosted in Azure.
2018-08-29 17:05:01 +01:00
sauls8t
e7bff0359a Authentication tests against LDAP and AD 2018-08-29 16:58:54 +01:00
sauls8t
2a2831e576 LDAP group fetching and AD connectivity 2018-08-29 16:20:37 +01:00
sauls8t
8d3dfcc3c7 [WIP] Basic LDAP connectivity 2018-08-28 10:19:22 +01:00
sauls8t
f28b7497fa Content links conditional checking
Whe link is interna,
2018-08-24 11:54:45 +01:00
McMatts
b1a35b7f75 Improved Draw.io integration pending changes detection 2018-08-23 12:29:55 +01:00
McMatts
8a30f3681c Bump version 2018-08-22 19:27:59 +01:00
McMatts
6073b24036 Increased Keycloak sync max results setting
Set to 99999 to support larger installations.
2018-08-21 15:41:46 +01:00
McMatts
1b16be2505 Make bulk group member management easier
Add and Remove members separated.

Introduced user list paging size.
2018-08-21 15:33:54 +01:00
McMatts
bd2e8ac165 Keep text inside tabnav control on small screens 2018-08-21 13:00:36 +01:00
McMatts
351b8dcc12 Set user admin max results and Keycloak sync option 2018-08-20 17:17:25 +01:00
McMatts
2c8b757ff6 Put search examples in scrollable component 2018-08-20 12:03:14 +01:00
HarveyKandola
abc0b206a4 Trim GOPATH from binary compile process 2018-08-17 13:50:39 +01:00
Harvey Kandola
47bb9d7d74
Merge pull request #164 from documize/jira-connector
Jira connector
2018-08-10 15:17:13 +01:00
HarveyKandola
58fc03f4c1 Make Trello config dependent on user permission 2018-08-10 15:16:49 +01:00
HarveyKandola
9987d29b7b Provide UI to configure Trello connector 2018-08-09 15:31:36 +01:00
HarveyKandola
7206f721f4 Provide UI for managing integration config
Closes #110
2018-08-08 14:57:56 +01:00
HarveyKandola
4d1eb952b2 Fully working Jira connector using JQL 2018-08-08 12:18:04 +01:00
HarveyKandola
64b1394ec1 Bump version 2018-08-08 12:17:11 +01:00
HarveyKandola
7b178a76b2 Render Jira issues 2018-08-07 19:43:25 +01:00
HarveyKandola
0f9602e3a0 Fetching Jira issues 2018-08-07 19:15:25 +01:00
HarveyKandola
7878a244d3 [WIP] Admin level Jira creds and vendored jira libs 2018-08-06 19:39:31 +01:00
sauls8t
0c5ec43c80 bump version 2018-08-01 19:34:08 -04:00
sauls8t
39891a0758 Fix Draw.io integratoin timing issue 2018-08-01 17:33:57 -04:00
sauls8t
63ce324eae Exclude non-live documents from space level category counts. 2018-08-01 13:50:39 -04:00
sauls8t
b74dfe6385 Scrolling for long category lists on space view 2018-07-31 14:30:04 -04:00
sauls8t
aaca1c73b1 Improve examples for search screen 2018-07-31 13:13:29 -04:00
Harvey Kandola
67bb3bae4f
Merge pull request #162 from documize/export-html
Export spaces, categories, documents to self-enclosed HTML file
2018-07-29 17:26:48 -04:00
HarveyKandola
39677791b3 Bump version 2018-07-29 16:41:26 -04:00
HarveyKandola
82a5bfe198 Better client-side download file process 2018-07-29 16:41:18 -04:00
HarveyKandola
9d80c5fc8c Handle draft documents during export process 2018-07-29 16:40:56 -04:00
HarveyKandola
4949043df9 Pre-process section types for HTML export 2018-07-29 14:08:39 -04:00
HarveyKandola
b7fa4e1a1a Export to HTML all content from shared spaces 2018-07-29 12:36:48 -04:00
HarveyKandola
def01b6265 Export single or multiple documents 2018-07-29 10:59:24 -04:00
HarveyKandola
cf0b06923d Color tweaks for timestamp 2018-07-28 17:35:29 -04:00
HarveyKandola
ef425a6ce2 WIP 2018-07-28 17:15:16 -04:00
HarveyKandola
689e5078b8 WIP 2018-07-28 15:47:14 -04:00
HarveyKandola
f916801008 WIP 2018-07-28 15:30:33 -04:00
HarveyKandola
d0970c153b WIP 2018-07-28 11:43:45 -04:00
Harvey Kandola
743eae5aad Templates document carry forward categories 2018-07-18 17:57:17 -04:00
Harvey Kandola
f884926df7 Reload permissions matrix after invites sent 2018-07-18 12:44:28 -04:00
Harvey Kandola
50c7fabeb6 Protect document activity and revisions from external users 2018-07-18 12:43:49 -04:00
Harvey Kandola
6617a5de45 Show notifications in footer 2018-07-11 08:44:12 -04:00
Harvey Kandola
4cfbd57871 Allow content to contain links to network locations 2018-07-09 14:41:55 -04:00
Harvey Kandola
19736aab04 New config setting: how many tags per document? 2018-07-05 12:02:10 -04:00
sauls8t
0743ae002c Version bump 2018-06-29 16:07:01 +01:00
sauls8t
4130d1f129 Flexbox for auth UI
Providing better support for flaky IE/Edge browsers.
2018-06-29 16:06:50 +01:00
sauls8t
10a184ad10 Cap category @ 30 2018-06-29 15:53:57 +01:00
sauls8t
a0f6626367 Cross-browser support for JS strings startWith 2018-06-29 15:53:38 +01:00
sauls8t
d5be8ec843 All new space permission managament
Using ember-toggle add-on.
2018-06-27 18:56:03 +01:00
sauls8t
13deb55cbb Display local datetimes
From UTC to local.

Closes #156
2018-06-27 13:29:29 +01:00
sauls8t
5ed180396e Add new check permissions helper 2018-06-27 13:09:25 +01:00
sauls8t
ad44112359 Document meta fields: better popovers & click-through editing
Non-admins receive popovers on hover.

Admins receive no popovers and get click-through to settings tab.

Space and document settings support jump to sub-section.

Co-Authored-By: Harvey Kandola <harvey@documize.com>
2018-06-25 19:43:29 +01:00
sauls8t
5d80480d75 Comment fix for attachment endpoint 2018-06-25 19:40:04 +01:00
sauls8t
ecc306136a Quick-abort space settings save operation if no permission 2018-06-25 19:39:32 +01:00
sauls8t
419ce1bbb5 Move permissions explainer matrix to end of layout 2018-06-25 19:38:37 +01:00
Harvey Kandola
3c5065375d
Merge pull request #159 from documize/search-data-limits
Search data limits
2018-06-23 08:31:10 +01:00
HarveyKandola
dc091fed7b bump version
Co-Authored-By: Saul S <sauls8t@users.noreply.github.com>
2018-06-23 08:30:48 +01:00
HarveyKandola
467acec3c4 Implement category-based permissioning for search results
Only see what you can see.

Co-Authored-By: Saul S <sauls8t@users.noreply.github.com>
2018-06-22 17:01:26 +01:00
HarveyKandola
ae50b889c5 Jump scroll to section for internal links 2018-06-22 12:44:20 +01:00
HarveyKandola
6ff74cf45e Removed obsolete doc general settings code 2018-06-22 11:02:31 +01:00
HarveyKandola
785e4c245d Removed space.category screen references 2018-06-21 13:58:45 +01:00
HarveyKandola
5d33860a15 Bump version 2018-06-21 12:38:26 +01:00
HarveyKandola
d689cbc281 Normalized remaining space options into settings admin
Moved space naming and category management into space settings.
2018-06-21 12:38:13 +01:00
McMatts
29534273b8 Add spacing to attachments view 2018-06-17 14:50:43 +01:00
McMatts
03be1ce904 Bump version 2018-06-15 14:26:24 +01:00
McMatts
30856433f8 License key workflow improved
Co-Authored-By: Saul S <sauls8t@users.noreply.github.com>
2018-06-15 14:26:02 +01:00
McMatts
27fde0dac8 Streamline document meta view and editing experience
Meta data:

1. Condensed layout.
2. Unified editing.

Co-Authored-By: Saul S <sauls8t@users.noreply.github.com>
2018-06-15 14:25:05 +01:00
sauls8t
f70d4b33a3 Warn if search criteria too short
Minimum keywords > 3
2018-06-13 15:54:58 +01:00
sauls8t
df9d9e174a Automatiically set Everyone as viewer on Public spaces 2018-06-13 12:47:40 +01:00
sauls8t
6e7f3cceaa Customizable Contact Us link in email notifications 2018-06-13 12:47:06 +01:00
sauls8t
8db452a18b Refresh documents list after document deletion 2018-06-13 12:46:23 +01:00
sauls8t
0b139c871f Bump version 2018-06-12 14:09:09 +01:00
sauls8t
5a480479a1 Bottom padding for Code section type in print media 2018-06-12 14:08:57 +01:00
sauls8t
ee28e27b16 Change order of links in top bar
Space should right-most.
2018-06-12 14:08:29 +01:00
sauls8t
ce9d314837 Display Keycloak settings outcome on save
Errors detected and displayed.
2018-06-12 14:07:50 +01:00
Saul S
628a633a0a
Merge pull request #158 from documize/may18-ux
Kick-ass UX/UI roll-out
2018-06-11 18:48:22 +01:00
Harvey Kandola
ed6edd8dcb Include latest embeddable assets 2018-06-11 14:57:53 +01:00
Harvey Kandola
ad2e653f3c Export to PDF related improvements 2018-06-11 14:40:21 +01:00
Harvey Kandola
2e9734e73e Handle edge case for document numbering + tests 2018-06-09 19:13:38 +01:00
Harvey Kandola
0da8ae9e4a Tweaked flexbox max-width for crazy long content 2018-06-09 19:13:15 +01:00
Harvey Kandola
d88adef5b5 Remove flexbox css for print media 2018-06-09 18:18:21 +01:00
Harvey Kandola
acdf2025ab Better defaults for content like setting 2018-06-08 13:43:46 +01:00
Harvey Kandola
78cdca3266 Reworked product license form 2018-06-07 19:14:45 +01:00
Harvey Kandola
5fe094a2d7 Save CodeMirror editor instance at end of process 2018-06-07 19:14:09 +01:00
Harvey Kandola
b316ba80d8 Format diagnostic message 2018-06-07 14:24:41 +01:00
Harvey Kandola
bf305d271e Improve style of empty state for add new section 2018-06-07 14:24:27 +01:00
Harvey Kandola
dea7a99aed Favicon cache buster 2018-06-07 14:24:08 +01:00
Harvey Kandola
94a2e2c0f7 Allow for empty document excerpt 2018-06-07 14:23:54 +01:00
Harvey Kandola
2d2296591b Bump version 2018-06-07 14:23:39 +01:00
Harvey Kandola
b34e41f65c Image upload for WYSIWYG editor
Fixes #106
2018-06-06 16:53:31 +01:00
Harvey Kandola
b828145163 New product icon color to match app color 2018-06-06 16:53:03 +01:00
Harvey Kandola
9a3259b60e Sync two editions and deal with the diff 2018-06-06 13:59:12 +01:00
Harvey Kandola
372b3f3692 Improve copy for template admin 2018-06-05 15:48:33 +01:00
Harvey Kandola
e68a18395e Add category breadrcrumb 2018-06-05 15:48:20 +01:00
Harvey Kandola
fcd95cf415 Link to category admin UI from space settings
Shortcut for better UX
2018-06-05 15:47:58 +01:00
Harvey Kandola
92f8fe550e Change space settings management into tab views 2018-06-05 14:04:14 +01:00
Harvey Kandola
738b3d94b6 Enable all serahcs options by default 2018-06-04 14:40:35 +01:00
sauls8t
59bc495b56 Set analytics permisison during on-board process 2018-06-04 14:39:38 +01:00
sauls8t
193d6914d6 Improve modality mixin with better $ event usage 2018-06-04 14:38:52 +01:00
sauls8t
06b28991a7 Stop background shift on modal open 2018-06-04 14:38:19 +01:00
sauls8t
fca6cc7ede Turn add section UX into modal flow
At long last we have a modal-driven add section process @HarveyKandola !
2018-06-04 14:37:21 +01:00
Harvey Kandola
716bd062d7 Provide each doc section with TOC controls
Put up/down/indent/outdent options on the section menu dropdown for easier TOC manipulation.
2018-06-01 11:49:09 +01:00
McMatts
d5157615e0 Move section save notification after logic checks 2018-05-31 18:20:36 +01:00
McMatts
dc2c7a5f7c Tooltip for new document sidebar 2018-05-31 18:20:10 +01:00
McMatts
f9e2141ed4 Make long section names wrap correctly and pad better 2018-05-31 18:19:52 +01:00
McMatts
b0daabb577 Handle Ember destoy state for notifications bus
Notifications should only bee active when Ember component is not destroyed.
2018-05-31 18:18:50 +01:00
McMatts
983b84235c Improve document sidebar flexbox CSS
Maximum widths to control table of contents wrapping.
2018-05-31 17:03:59 +01:00
McMatts
25fd13bd3f Sidebar more responsive and sticky
Tweaked CSS to support small-to-large screen real estate.
2018-05-31 15:15:48 +01:00
McMatts
f20a1d1d5f Removed previous page layout framework 2018-05-30 16:08:25 +01:00
McMatts
c7cc36b307 Move attachments into meta zone 2018-05-30 11:27:29 +01:00
Harvey Kandola
c5561491a2 Upgrade TinyMCE to 4.7.13 2018-05-29 18:28:08 +01:00
Harvey Kandola
cfe30dcde5 CodeMirror upgrade to 5.38.0 2018-05-29 18:27:42 +01:00
Harvey Kandola
36be6243ad WIP new document UX/UI 2018-05-29 18:26:04 +01:00
Harvey Kandola
21ba55a58f Change position of new space content dropdown 2018-05-25 12:14:24 +01:00
Harvey Kandola
3903e58367 Start of space admin functionality refactoring 2018-05-24 18:29:58 +01:00
Harvey Kandola
5d757c992f More UI conversion to new framework 2018-05-24 18:09:38 +01:00
Harvey Kandola
a453052087 Spaces view 2018-05-23 15:57:30 +01:00
Harvey Kandola
95323c90ee Upgrade to Ember 3.1.2 ++
Also disabled optional feature Application Template Wrapper.
2018-05-23 15:14:47 +01:00
Harvey Kandola
09d698fd2a WIP 2018-05-23 12:37:21 +01:00
Harvey Kandola
31580d883c Rename layout zones 2018-05-22 17:00:42 +01:00
Harvey Kandola
eb7ebf391d Provide the basic layout framework for UX/UI 2018-05-22 15:56:54 +01:00
Harvey Kandola
942bc386f4 Outline framework in place 2018-05-18 20:11:24 +01:00
Harvey Kandola
4045197871 Bump versions 2018-05-17 11:01:19 +01:00
Harvey Kandola
46ee4b1a58 Merge branch 'master' of https://github.com/documize/community 2018-05-14 11:52:52 +01:00
Harvey Kandola
f5b196c334 Draft documents always visible to editors when space lifecycle set to Draft mode 2018-05-14 11:52:51 +01:00
Harvey Kandola
53c2404822
Update README.md 2018-05-14 10:33:22 +01:00
Harvey Kandola
df1e022e71
Update README.md 2018-05-14 10:32:58 +01:00
Harvey Kandola
3e428de4cc
Update README.md 2018-05-14 10:28:22 +01:00
Harvey Kandola
17fc2329df
Update README.md 2018-05-14 10:27:51 +01:00
Saul S
9724f85653
Update README.md 2018-05-11 15:25:46 +01:00
sauls8t
e85744e1b3 Provide granular Dashbaord/Action view permissions
Closes #154
2018-05-11 15:17:10 +01:00
sauls8t
c66fae703c Fix keyword quoted string failure for MariaDB
Closes #153
2018-05-11 09:28:04 +01:00
sauls8t
e4c075ea4b Bump version 2018-05-10 15:35:09 +01:00
sauls8t
2066f72258 Support MySQL 8.x series
Two issues resolved relating to MySQL 8:

1. DB version checking skips MINOR/PATCH checks if MAJOR release changed.
2. Keyword 'admin' quoted to ensure MySQL compat.

Closes #152
2018-05-10 15:14:50 +01:00
sauls8t
0f87d5b07e New spaces to result in live documents
Ensure community edition users do not see Draft document lifecycle.
2018-05-10 15:12:17 +01:00
sauls8t
c94fd9cfcf Enforce non-draft mode lifecycle for CE
Closes #151 by enforcing non-draft mode settings for Community Edition.
2018-05-10 15:10:15 +01:00
Saul S
fb193ce9f9
Merge pull request #148 from documize/draw
Draw.io integration
2018-05-04 12:37:01 +01:00
sauls8t
2298ac3376 Set ReplyTo for SMTP based notifications
Ensure all replies go back to person who initiated the notification.
2018-05-03 18:03:25 +01:00
McMatts
3b0291d94c Bump version 2018-05-03 12:50:58 +01:00
McMatts
c32d094e91 Detect edge case for new section insert 2018-05-03 12:50:51 +01:00
McMatts
3bc775582d Code linting 2018-05-03 12:49:49 +01:00
McMatts
af632615cf Change UX for user group member management
Placed search results below existing members list.
2018-05-03 12:48:45 +01:00
Harvey Kandola
85b6e40d8c Finished up Draw.io integration 2018-05-03 12:46:15 +01:00
Harvey Kandola
d746c90624 Draw.io integration WIP 2018-05-02 14:55:02 +01:00
Harvey Kandola
2b8a7921ad Fix typo for user admin section 2018-05-02 14:54:24 +01:00
Harvey Kandola
567ee10c5f Include Codemirror vendor in libs 2018-05-02 14:54:08 +01:00
Harvey Kandola
ba42d5e282 Move ugly Codemirror init to vendor libs 2018-05-02 14:53:54 +01:00
Harvey Kandola
fb8adc6491 Prevent ember actions on destroyed objects 2018-05-02 14:53:26 +01:00
Harvey Kandola
455a384eb0 Prettify 2018-05-02 14:52:23 +01:00
Harvey Kandola
e234471b1e Ensure initials calculate correctly for Unicode via runes 2018-05-02 14:50:22 +01:00
Harvey Kandola
b839a0753c Latest build assets 2018-04-27 09:53:12 +01:00
sauls8t
05da8894b9 Trap for empty text diagram before generating 2018-04-26 15:14:41 +01:00
McMatts
734e8653dd Bump build numbers 2018-04-26 15:02:06 +01:00
McMatts
3e37b9b7e4 Flip revisions diff format, by popular request
Switch from 'what you will lose' to 'what you will gain'...
2018-04-26 15:01:43 +01:00
McMatts
b1e0e31a9e Prettify code 2018-04-26 13:44:41 +01:00
McMatts
f2a903d054 Ensure activity view works on UTC date formats 2018-04-26 13:44:29 +01:00
McMatts
b40db1433e Use default Ember object ID for permissions model 2018-04-26 12:03:23 +01:00
McMatts
962a8369aa Prettify some code 2018-04-26 12:02:36 +01:00
McMatts
f21c80d960 Revert section title change on cancel operation 2018-04-26 12:01:58 +01:00
McMatts
7b619101f1 Switch search to InnoDB
Better, faster searching
2018-04-25 12:19:47 +01:00
McMatts
08557c369c Implement User API support
Direct User API usage impacted UI usage of API.

Moved setting of new user permissions up the call chain.
2018-04-25 12:19:14 +01:00
Harvey Kandola
e47c5e61fc Remove superfluous SQL param
superflous
2018-04-25 12:17:12 +01:00
sauls8t
123fce6c17 Use unicode compat slug engine 2018-04-25 12:15:17 +01:00
sauls8t
91c8b05d89 Make Keycloak integration compatible with 4 series
Troubleshooting information provided
2018-04-23 12:47:31 +01:00
sauls8t
74e9699e1e Replace showNotificaiton() calls 2018-04-23 12:46:34 +01:00
2455 changed files with 503500 additions and 136405 deletions

View file

@ -1,3 +1,6 @@
.DS_Store
.git
bin
.idea
selfcert
gui/dist-prod

View file

@ -1,9 +0,0 @@
root = true
[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
indent_size = 4
insert_final_newline = true

8
.gitignore vendored
View file

@ -18,6 +18,7 @@ _convert
bin/*
dist/*
embed/bindata/*
edition/static/*
gui/dist/*
gui/dist-prod/*
@ -52,14 +53,12 @@ _testmain.go
node_modules
# Misc.
build
plugin-msword/plugin-msword
plugin-msword/plugin-msword-osx
npm-debug.log
debug
*.pem
*.crt
Dockerfile
container.sh
make.sh
jsconfig.json
@ -68,4 +67,7 @@ testem.log
# ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try
package.json.ember-try
embed/bindata_assetfs.go
dmz-backup*.zip
*.conf

View file

@ -1,62 +0,0 @@
{
"css": {
"indent_size": 4,
"indent_level": 0,
"indent_with_tabs": true,
"preserve_newlines": true,
"max_preserve_newlines": 2,
"newline_between_rules": true,
"selector_separator_newlines": true
},
"scss": {
"indent_size": 4,
"indent_level": 0,
"indent_with_tabs": true,
"preserve_newlines": true,
"max_preserve_newlines": 2,
"newline_between_rules": true,
"selector_separator_newlines": true
},
"html": {
"indent_size": 4,
"indent_level": 0,
"indent_with_tabs": true,
"preserve_newlines": true,
"max_preserve_newlines": 2,
"wrap_line_length": 0,
"indent_handlebars": true,
"indent_inner_html": false,
"indent_scripts": "keep"
},
"hbs": {
"indent_size": 4,
"indent_level": 0,
"indent_with_tabs": true,
"max_preserve_newlines": 2,
"preserve_newlines": true,
"wrap_line_length": 0
},
"js": {
"indent_size": 4,
"indent_level": 0,
"indent_with_tabs": true,
"preserve_newlines": true,
"wrap_line_length": 0,
"break_chained_methods": false,
"max_preserve_newlines": 2,
"jslint_happy": true,
"brace_style": "collapse-preserve-inline",
"keep_function_indentation": false,
"space_after_anon_function": false,
"space_before_anon_function": false,
"space_before_conditional": true,
"space_in_empty_paren": false,
"space_before_func_paren": false,
"space_in_paren": false
},
"sql": {
"indent_size": 4,
"indent_level": 0,
"indent_with_tabs": true
}
}

View file

@ -1,3 +0,0 @@
gui/public/tinymce/**
gui/public/tinymce/
gui/public/tinymce

View file

@ -1,3 +0,0 @@
{
"esversion":6
}

32
Dockerfile Normal file
View file

@ -0,0 +1,32 @@
FROM node:16-alpine as frontbuilder
WORKDIR /go/src/github.com/documize/community/gui
COPY ./gui /go/src/github.com/documize/community/gui
RUN npm --network-timeout=100000 install
RUN npm run build -- --environment=production --output-path dist-prod --suppress-sizes true
FROM golang:1.21-alpine as builder
WORKDIR /go/src/github.com/documize/community
COPY . /go/src/github.com/documize/community
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/assets /go/src/github.com/documize/community/edition/static/public/assets
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/codemirror /go/src/github.com/documize/community/edition/static/public/codemirror
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/prism /go/src/github.com/documize/community/edition/static/public/prism
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/sections /go/src/github.com/documize/community/edition/static/public/sections
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/tinymce /go/src/github.com/documize/community/edition/static/public/tinymce
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/pdfjs /go/src/github.com/documize/community/edition/static/public/pdfjs
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/i18n /go/src/github.com/documize/community/edition/static/public/i18n
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/*.* /go/src/github.com/documize/community/edition/static/
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/i18n/*.json /go/src/github.com/documize/community/edition/static/i18n/
COPY domain/mail/*.html /go/src/github.com/documize/community/edition/static/mail/
COPY core/database/templates/*.html /go/src/github.com/documize/community/edition/static/
COPY core/database/scripts/mysql/*.sql /go/src/github.com/documize/community/edition/static/scripts/mysql/
COPY core/database/scripts/postgresql/*.sql /go/src/github.com/documize/community/edition/static/scripts/postgresql/
COPY core/database/scripts/sqlserver/*.sql /go/src/github.com/documize/community/edition/static/scripts/sqlserver/
COPY domain/onboard/*.json /go/src/github.com/documize/community/edition/static/onboard/
RUN env GODEBUG=tls13=1 go build -mod=vendor -o bin/documize-community ./edition/community.go
# build release image
FROM alpine:3.16
RUN apk add --no-cache ca-certificates
COPY --from=builder /go/src/github.com/documize/community/bin/documize-community /documize
EXPOSE 5001
ENTRYPOINT [ "/documize" ]

163
Gopkg.lock generated
View file

@ -1,163 +0,0 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/codegangsta/negroni"
packages = ["."]
revision = "5dbbc83f748fc3ad38585842b0aedab546d0ea1e"
version = "v0.3.0"
[[projects]]
name = "github.com/dgrijalva/jwt-go"
packages = ["."]
revision = "dbeaa9332f19a944acb5736b4456cfcc02140e29"
version = "v3.1.0"
[[projects]]
name = "github.com/documize/blackfriday"
packages = ["."]
revision = "cadec560ec52d93835bf2f15bd794700d3a2473b"
version = "v2.0.0"
[[projects]]
branch = "master"
name = "github.com/documize/glick"
packages = ["."]
revision = "a8ccbef88237fcafe9cef3c9aee7ad83d0e132f9"
[[projects]]
branch = "master"
name = "github.com/documize/html-diff"
packages = ["."]
revision = "f61c192c7796644259832ef705c49259797e7fff"
[[projects]]
name = "github.com/elazarl/go-bindata-assetfs"
packages = ["."]
revision = "30f82fa23fd844bd5bb1e5f216db87fd77b5eb43"
version = "v1.0.0"
[[projects]]
name = "github.com/go-sql-driver/mysql"
packages = ["."]
revision = "a0583e0143b1624142adab07e0e97fe106d99561"
version = "v1.3"
[[projects]]
name = "github.com/golang/protobuf"
packages = ["proto"]
revision = "925541529c1fa6821df4e44ce2723319eb2be768"
version = "v1.0.0"
[[projects]]
name = "github.com/google/go-github"
packages = ["github"]
revision = "e48060a28fac52d0f1cb758bc8b87c07bac4a87d"
version = "v15.0.0"
[[projects]]
branch = "master"
name = "github.com/google/go-querystring"
packages = ["query"]
revision = "53e6ce116135b80d037921a7fdd5138cf32d7a8a"
[[projects]]
name = "github.com/gorilla/context"
packages = ["."]
revision = "1ea25387ff6f684839d82767c1733ff4d4d15d0a"
version = "v1.1"
[[projects]]
name = "github.com/gorilla/mux"
packages = ["."]
revision = "53c1911da2b537f792e7cafcb446b05ffe33b996"
version = "v1.6.1"
[[projects]]
branch = "master"
name = "github.com/jmoiron/sqlx"
packages = [
".",
"reflectx"
]
revision = "05cef0741ade10ca668982355b3f3f0bcf0ff0a8"
[[projects]]
branch = "master"
name = "github.com/mb0/diff"
packages = ["."]
revision = "d8d9a906c24d7b0ee77287e0463e5ca7f026032e"
[[projects]]
branch = "master"
name = "github.com/nu7hatch/gouuid"
packages = ["."]
revision = "179d4d0c4d8d407a32af483c2354df1d2c91e6c3"
[[projects]]
name = "github.com/pkg/errors"
packages = ["."]
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
version = "v0.8.0"
[[projects]]
branch = "master"
name = "github.com/shurcooL/sanitized_anchor_name"
packages = ["."]
revision = "86672fcb3f950f35f2e675df2240550f2a50762f"
[[projects]]
branch = "master"
name = "golang.org/x/crypto"
packages = [
"bcrypt",
"blowfish"
]
revision = "650f4a345ab4e5b245a3034b110ebc7299e68186"
[[projects]]
branch = "master"
name = "golang.org/x/net"
packages = [
"context",
"context/ctxhttp",
"html",
"html/atom"
]
revision = "f5dfe339be1d06f81b22525fe34671ee7d2c8904"
[[projects]]
branch = "master"
name = "golang.org/x/oauth2"
packages = [
".",
"internal"
]
revision = "543e37812f10c46c622c9575afd7ad22f22a12ba"
[[projects]]
name = "google.golang.org/appengine"
packages = [
"internal",
"internal/base",
"internal/datastore",
"internal/log",
"internal/remote_api",
"internal/urlfetch",
"urlfetch"
]
revision = "150dc57a1b433e64154302bdc40b6bb8aefa313a"
version = "v1.0.0"
[[projects]]
branch = "v3"
name = "gopkg.in/alexcesaro/quotedprintable.v3"
packages = ["."]
revision = "2caba252f4dc53eaf6b553000885530023f54623"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "56eea54cf0b9e18b3e456199ee01aedeeb07b55073ca3d10345e0c178689aee2"
solver-name = "gps-cdcl"
solver-version = 1

View file

@ -1,90 +0,0 @@
# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true
[[constraint]]
name = "github.com/codegangsta/negroni"
version = "0.3.0"
[[constraint]]
name = "github.com/dgrijalva/jwt-go"
version = "3.1.0"
[[constraint]]
name = "github.com/documize/blackfriday"
version = "2.0.0"
[[constraint]]
branch = "master"
name = "github.com/documize/glick"
[[constraint]]
branch = "master"
name = "github.com/documize/html-diff"
[[constraint]]
name = "github.com/elazarl/go-bindata-assetfs"
version = "1.0.0"
[[constraint]]
name = "github.com/go-sql-driver/mysql"
version = "1.3.0"
[[constraint]]
name = "github.com/google/go-github"
version = "15.0.0"
[[constraint]]
name = "github.com/gorilla/mux"
version = "1.6.1"
[[constraint]]
branch = "master"
name = "github.com/jmoiron/sqlx"
[[constraint]]
branch = "master"
name = "github.com/nu7hatch/gouuid"
[[constraint]]
name = "github.com/pkg/errors"
version = "0.8.0"
[[constraint]]
branch = "master"
name = "golang.org/x/crypto"
[[constraint]]
branch = "master"
name = "golang.org/x/net"
[[constraint]]
branch = "master"
name = "golang.org/x/oauth2"
[prune]
go-tests = true
unused-packages = true

2572
NOTICES.md Normal file

File diff suppressed because it is too large Load diff

146
README.md
View file

@ -1,112 +1,110 @@
# Documize - author, track and deliver documentation
Documize Community is an open source, modern, self-hosted, enterprise-grade knowledge management solution.
## The mission
- Built for technical and non-technical users
- Designed to unify both customer-facing and internal documentation
- Organization through labels, spaces and categories
To bring software development inspired features to the world of documenting -- refactoring, importing, testing, linting, metrics, PRs, versioning....
It's built with Golang + EmberJS and compiled down to a single executable binary that is available for Linux, Windows and Mac.
## What is it?
All you need to provide is your database -- PostgreSQL, Microsoft SQL Server or any MySQL variant.
Documize is an intelligent document environment (IDE) for authoring, tracking and delivering documentation -- everything you need in one place.
![Documize Community](https://github.com/documize/community/blob/master/screenshot.png?raw=true)
## Why should I care?
## Latest Release
Because maybe like us you're tired of:
[Community edition: v5.13.0](https://github.com/documize/community/releases)
* juggling WYSIWYG editors, wiki software and other document related solutions
* playing email tennis with documents, contributions, versions and feedback
* sharing not-so-secure folders with external participants
[Community+ edition: v5.13.0](https://www.documize.com/community/get-started)
Sound familiar? Read on.
The Community+ edition is the "enterprise" offering with advanced capabilities and customer support:
## Who is it for?
- content approval workflows
- content organization by label, space and category
- content version management
- content lifecycle management
- content feedback capture
- content PDF export
- analytics and reporting
- activity streams
- audit logs
- actions assignments
- product support
Anyone who wants a single place for any kind of document.
The Community+ edition is [free](https://www.documize.com/community/get-started) for the first five users -- thereafter pricing starts at just $900 annually for 100 users.
Anyone who wants to loop in external participants complete security.
Anyone who wishes documentation and knowledge capture worked like agile software development.
## What's different about Documize?
Sane organization through personal, team and public spaces.
Granular document access control via categories.
Section based approach to document construction.
Reusable templates and content blocks.
Documentation related tasking and delegation.
Integrations for embedding SaaS data within documents, zero add-on/marketplace fees.
## What does it look like?
All spaces.
![Documize](screenshot-1.png "Documize")
Space view.
![Documize](screenshot-2.png "Documize")
## Latest version
[Community edition: v1.63.0](https://github.com/documize/community/releases)
[Enterprise edition: v1.65.0](https://documize.com/downloads)
## OS support
Documize runs on the following:
## OS Support
- Linux
- Windows
- macOS
- Raspberry Pi (ARM build)
## Technology stack
Support for AMD and ARM 64 bit architectures.
Documize is built with the following technologies:
## Database Support
- EmberJS (v2.18.0)
- Go (v1.10.1)
For all database types, Full-Text Search (FTS) support is mandatory.
...and supports the following databases:
- MySQL (v5.7.10+)
- PostgreSQL (v9.6+)
- Microsoft SQL Server (2016+ with FTS)
- Microsoft SQL Azure (v12+)
- MySQL (v5.7.10+ and v8.0.12+)
- Percona (v5.7.16-10+)
- MariaDB (10.3.0+)
Coming soon, PostgreSQL and Microsoft SQL Server database support.
## Browser Support
## Authentication options
- Firefox
- Chrome
- Safari
- Microsoft Edge
- Brave
- Vivaldi
- Opera
Besides email/password login, you can also leverage the following options.
## Technology Stack
### Keycloak Integration
- Go (v1.23.4)
- Ember JS (v3.12.0)
Documize provides out-of-the-box integration with [Redhat Keycloak](http://www.keycloak.org) for open source identity and access management.
## Authentication Options
Connect and authenticate with LDAP, Active Directory and more.
Besides email/password login, you can also authenticate via:
<https://docs.documize.com>
* LDAP
* Active Directory
* Red Hat Keycloak
* Central Authentication Service (CAS)
### Auth0 Compatible
When using LDAP/Active Directory, you can enable dual-authentication with email/password.
Documize is compatible with Auth0 identity as a service.
## Localization
[![JWT Auth for open source projects](https://cdn.auth0.com/oss/badges/a0-badge-dark.png)](https://auth0.com/?utm_source=oss&utm_medium=gp&utm_campaign=oss)
Languages supported out-of-the-box:
Open Source Identity and Access Management
- English
- German
- French
- Chinese (中文)
- Portuguese (Brazil) (Português - Brasil)
- Japanese (日本語)
- Italian
- Spanish Argentinian
## Developer's Note
PR's welcome for additional languages.
We try to follow sound advice when writing commit messages:
## Product/Technical Support
https://chris.beams.io/posts/git-commit/
For both Community and Community+ editions, please contact our help desk for product help, suggestions and other enquiries.
## The legal bit at the end
<support@documize.com>
<https://documize.com>
We aim to respond within two working days.
This software (Documize Community Edition) is licensed under GNU AGPL v3 <http://www.gnu.org/licenses/agpl-3.0.en.html>. You can operate outside the AGPL restrictions by purchasing Documize Enterprise Edition and obtaining a commercial license by contacting <sales@documize.com>. Documize® is a registered trade mark of Documize Inc.
## The Legal Bit
<https://www.documize.com>
This software (Documize Community edition) is licensed under GNU AGPL v3 <http://www.gnu.org/licenses/agpl-3.0.en.html>.
Documize Community uses other open source components and we acknowledge them in [NOTICES](NOTICES.md)

View file

@ -7,50 +7,61 @@ echo "Building Ember assets..."
cd gui
call ember b -o dist-prod/ --environment=production
::Call allows the rest of the file to run
echo "Copying Ember assets..."
cd ..
rd /s /q embed\bindata\public
mkdir embed\bindata\public
rd /s /q edition\static\public
mkdir edition\static\public
echo "Copying Ember assets folder"
robocopy /e /NFL /NDL /NJH gui\dist-prod\assets embed\bindata\public\assets
robocopy /e /NFL /NDL /NJH gui\dist-prod\assets edition\static\public\assets
echo "Copying Ember codemirror folder"
robocopy /e /NFL /NDL /NJH gui\dist-prod\codemirror embed\bindata\public\codemirror
robocopy /e /NFL /NDL /NJH gui\dist-prod\codemirror edition\static\public\codemirror
echo "Copying Ember prism folder"
robocopy /e /NFL /NDL /NJH gui\dist-prod\prism edition\static\public\prism
echo "Copying Ember tinymce folder"
robocopy /e /NFL /NDL /NJH gui\dist-prod\tinymce embed\bindata\public\tinymce
robocopy /e /NFL /NDL /NJH gui\dist-prod\tinymce edition\static\public\tinymce
echo "Copying Ember pdfjs folder"
robocopy /e /NFL /NDL /NJH gui\dist-prod\pdfjs edition\static\public\pdfjs
echo "Copying Ember sections folder"
robocopy /e /NFL /NDL /NJH gui\dist-prod\sections embed\bindata\public\sections
robocopy /e /NFL /NDL /NJH gui\dist-prod\sections edition\static\public\sections
echo "Copying i18n folder"
robocopy /e /NFL /NDL /NJH gui\dist-prod\i18n edition\static\public\i18n
copy gui\dist-prod\*.* embed\bindata
copy gui\dist-prod\favicon.ico embed\bindata\public
copy gui\dist-prod\manifest.json embed\bindata\public
echo "Copying static files"
copy gui\dist-prod\*.* edition\static
rd /s /q embed\bindata\mail
mkdir embed\bindata\mail
copy domain\mail\*.html embed\bindata\mail
copy core\database\templates\*.html embed\bindata
echo "Copying favicon.ico"
copy gui\dist-prod\favicon.ico edition\static\public
rd /s /q embed\bindata\scripts
mkdir embed\bindata\scripts
echo "Copying manifest.json"
copy gui\dist-prod\manifest.json edition\static\public
echo "Copying mail templates"
rd /s /q edition\static\mail
mkdir edition\static\mail
copy domain\mail\*.html edition\static\mail
echo "Copying database templates"
copy core\database\templates\*.html edition\static
rd /s /q edition\static\i18n
mkdir edition\static\i18n
robocopy /e /NFL /NDL /NJH gui\dist-prod\i18n edition\static\i18n *.json
rd /s /q edition\static\scripts
mkdir edition\static\scripts
mkdir edition\static\scripts\mysql
mkdir edition\static\scripts\postgresql
mkdir edition\static\scripts\sqlserver
echo "Copying database scripts folder"
robocopy /e /NFL /NDL /NJH core\database\scripts\autobuild embed\bindata\scripts
robocopy /e /NFL /NDL /NJH core\database\scripts\mysql edition\static\scripts\mysql
robocopy /e /NFL /NDL /NJH core\database\scripts\postgresql edition\static\scripts\postgresql
robocopy /e /NFL /NDL /NJH core\database\scripts\sqlserver edition\static\scripts\sqlserver
echo "Generating in-memory static assets..."
go get -u github.com/jteeuwen/go-bindata/...
go get -u github.com/elazarl/go-bindata-assetfs/...
cd embed
go generate
cd ..
rd /s /q edition\static\onboard
mkdir edition\static\onboard
robocopy /e /NFL /NDL /NJH domain\onboard edition\static\onboard *.json
echo "Compiling Windows"
set GOOS=windows
go build -gcflags=-trimpath=%GOPATH% -asmflags=-trimpath=%GOPATH% -o bin/documize-community-windows-amd64.exe edition/community.go
echo "Compiling Linux"
set GOOS=linux
go build -gcflags=-trimpath=%GOPATH% -asmflags=-trimpath=%GOPATH% -o bin/documize-community-linux-amd64 edition/community.go
echo "Compiling Darwin"
set GOOS=darwin
go build -gcflags=-trimpath=%GOPATH% -asmflags=-trimpath=%GOPATH% -o bin/documize-community-darwin-amd64 edition/community.go
go build -mod=vendor -trimpath -gcflags="all=-trimpath=$GOPATH" -o bin/documize-community-windows-amd64.exe edition/community.go

View file

@ -8,50 +8,65 @@ echo "Build process started $NOW"
echo "Building Ember assets..."
cd gui
ember b -o dist-prod/ --environment=production
# export NODE_OPTIONS=--openssl-legacy-provider
ember build ---environment=production --output-path dist-prod --suppress-sizes true
cd ..
echo "Copying Ember assets..."
cd ..
rm -rf embed/bindata/public
mkdir -p embed/bindata/public
cp -r gui/dist-prod/assets embed/bindata/public
cp -r gui/dist-prod/codemirror embed/bindata/public/codemirror
cp -r gui/dist-prod/tinymce embed/bindata/public/tinymce
cp -r gui/dist-prod/sections embed/bindata/public/sections
cp gui/dist-prod/*.* embed/bindata
cp gui/dist-prod/favicon.ico embed/bindata/public
cp gui/dist-prod/manifest.json embed/bindata/public
rm -rf embed/bindata/mail
mkdir -p embed/bindata/mail
cp domain/mail/*.html embed/bindata/mail
cp core/database/templates/*.html embed/bindata
rm -rf embed/bindata/scripts
mkdir -p embed/bindata/scripts
cp -r core/database/scripts/autobuild/*.sql embed/bindata/scripts
rm -rf edition/static/public
mkdir -p edition/static/public
cp -r gui/dist-prod/assets edition/static/public
cp -r gui/dist-prod/codemirror edition/static/public/codemirror
cp -r gui/dist-prod/prism edition/static/public/prism
cp -r gui/dist-prod/sections edition/static/public/sections
cp -r gui/dist-prod/tinymce edition/static/public/tinymce
cp -r gui/dist-prod/pdfjs edition/static/public/pdfjs
cp -r gui/dist-prod/i18n edition/static/public/i18n
cp gui/dist-prod/*.* edition/static
cp gui/dist-prod/favicon.ico edition/static/public
cp gui/dist-prod/manifest.json edition/static/public
echo "Generating in-memory static assets..."
# go get -u github.com/jteeuwen/go-bindata/...
# go get -u github.com/elazarl/go-bindata-assetfs/...
cd embed
go generate
rm -rf edition/static/mail
mkdir -p edition/static/mail
cp domain/mail/*.html edition/static/mail
cp core/database/templates/*.html edition/static
echo "Compiling app..."
cd ..
for arch in amd64 ; do
for os in darwin linux windows ; do
if [ "$os" == "windows" ] ; then
echo "Compiling documize-community-$os-$arch.exe"
env GOOS=$os GOARCH=$arch go build -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -o bin/documize-community-$os-$arch.exe ./edition/community.go
else
echo "Compiling documize-community-$os-$arch"
env GOOS=$os GOARCH=$arch go build -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -o bin/documize-community-$os-$arch ./edition/community.go
fi
done
done
rm -rf edition/static/i18n
mkdir -p edition/static/i18n
cp -r gui/dist-prod/i18n/*.json edition/static/i18n
rm -rf edition/static/scripts
mkdir -p edition/static/scripts
mkdir -p edition/static/scripts/mysql
mkdir -p edition/static/scripts/postgresql
mkdir -p edition/static/scripts/sqlserver
cp -r core/database/scripts/mysql/*.sql edition/static/scripts/mysql
cp -r core/database/scripts/postgresql/*.sql edition/static/scripts/postgresql
cp -r core/database/scripts/sqlserver/*.sql edition/static/scripts/sqlserver
rm -rf edition/static/onboard
mkdir -p edition/static/onboard
cp -r domain/onboard/*.json edition/static/onboard
echo "Compiling for macOS Intel..."
env GOOS=darwin GOARCH=amd64 go build -mod=vendor -trimpath -o bin/documize-community-darwin-amd64 ./edition/community.go
echo "Compiling for macOS ARM..."
env GOOS=darwin GOARCH=arm64 go build -mod=vendor -trimpath -o bin/documize-community-darwin-arm64 ./edition/community.go
echo "Compiling for Windows AMD..."
env GOOS=windows GOARCH=amd64 go build -mod=vendor -trimpath -o bin/documize-community-windows-amd64.exe ./edition/community.go
echo "Compiling for Linux AMD..."
env GOOS=linux GOARCH=amd64 go build -mod=vendor -trimpath -o bin/documize-community-linux-amd64 ./edition/community.go
echo "Compiling for Linux ARM..."
env GOOS=linux GOARCH=arm go build -mod=vendor -trimpath -o bin/documize-community-linux-arm ./edition/community.go
echo "Compiling for Linux ARM64..."
env GOOS=linux GOARCH=arm64 go build -mod=vendor -trimpath -o bin/documize-community-linux-arm64 ./edition/community.go
echo "Compiling for FreeBSD ARM64..."
env GOOS=freebsd GOARCH=arm64 go build -mod=vendor -trimpath -o bin/documize-community-freebsd-arm64 ./edition/community.go
echo "Compiling for FreeBSD AMD64..."
env GOOS=freebsd GOARCH=amd64 go build -mod=vendor -trimpath -o bin/documize-community-freebsd-amd64 ./edition/community.go
echo "Finished."
# CGO_ENABLED=0 GOOS=linux go build -a -ldflags="-s -w" -installsuffix cgo
# go build -ldflags '-d -s -w' -a -tags netgo -installsuffix netgo test.go
# ldd test
# ldd test

View file

@ -19,8 +19,8 @@ import (
"net/http"
"path/filepath"
"context"
api "github.com/documize/community/core/convapi"
"golang.org/x/net/context"
)
// Msword type provides a peg to hang the Convert method on.

View file

@ -19,7 +19,7 @@ import (
"github.com/documize/community/core/api/plugins"
api "github.com/documize/community/core/convapi"
"golang.org/x/net/context"
"context"
)
// Convert provides the entry-point into the document conversion process.

View file

@ -1,155 +0,0 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
package convert_test
import (
"strings"
"testing"
"github.com/documize/community/core/api/convert"
"github.com/documize/community/core/api/plugins"
api "github.com/documize/community/core/convapi"
"github.com/documize/community/core/log"
"golang.org/x/net/context"
)
func TestConvert(t *testing.T) {
plugins.PluginFile = "" // no file as html is built-in
if lerr := plugins.LibSetup(); lerr == nil {
//t.Error("did not error on plugin.Libsetup() with no plugin.json file")
//return
}
defer log.IfErr(plugins.Lib.KillSubProcs())
ctx := context.Background()
xtn := "html"
fileRequest := new(api.DocumentConversionRequest)
fileRequest.Filedata = []byte(yorkweb)
resp, err := convert.Convert(ctx, xtn, fileRequest)
if err != nil {
t.Error(err)
return
}
if len(resp.Pages) != 3 ||
!strings.HasPrefix(resp.Pages[1].Title, "STARTING") ||
!strings.HasPrefix(resp.Pages[2].Title, "EXERCISE") {
for p, pg := range resp.Pages {
t.Error(p, pg.Level, len(pg.Body), pg.Title)
}
}
exp := "There are lots of ways to create web pages using already coded programmes. … HTML isn' t computer code, but is a language that uses US English to enable texts( words, images, sounds) to be inserted and formatting such as colo( u) r and centre/ erin…"
if resp.Excerpt != exp {
t.Errorf("unexpected excerpt wanted: `%s` got: `%s`", exp, resp.Excerpt)
}
// check errors are caught
resp, err = convert.Convert(ctx, "unknown", fileRequest)
if err == nil {
t.Error("does not error on unknown extension")
}
}
// www.york.ac.uk/teaching/cws/wws/webpage1.html
const yorkweb = `
<HMTL>
<HEAD>
<TITLE>webpage1</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFf" LINK="006666" ALINK="8B4513" VLINK="006666">
<TABLE WIDTH="75%" ALIGN="center">
<TR>
<TD>
<DIV ALIGN="center"><H1>STARTING . . . </H1></DIV>
<DIV ALIGN="justify"><P>There are lots of ways to create web pages using already coded programmes. These lessons will teach you how to use the underlying HyperText Markup Language - HTML.
<BR>
<P>HTML isn't computer code, but is a language that uses US English to enable texts (words, images, sounds) to be inserted and formatting such as colo(u)r and centre/ering to be written in. The process is fairly simple; the main difficulties often lie in small mistakes - if you slip up while word processing your reader may pick up your typos, but the page will still be legible. However, if your HTML is inaccurate the page may not appear - writing web pages is, at the least, very good practice for proof reading!</P>
<P>Learning HTML will enable you to:
<UL>
<LI>create your own simple pages
<LI>read and appreciate pages created by others
<LI>develop an understanding of the creative and literary implications of web-texts
<LI>have the confidence to branch out into more complex web design
</UL></P>
<P>A HTML web page is made up of tags. Tags are placed in brackets like this <B>< tag > </B>. A tag tells the browser how to display information. Most tags need to be opened < tag > and closed < /tag >.
<P> To make a simple web page you need to know only four tags:
<UL>
<LI>< HTML > tells the browser your page is written in HTML format
<LI>< HEAD > this is a kind of preface of vital information that doesn't appear on the screen.
<LI>< TITLE >Write the title of the web page here - this is the information that viewers see on the upper bar of their screen. (I've given this page the title 'webpage1').
<LI>< BODY >This is where you put the content of your page, the words and pictures that people read on the screen.
</UL>
<P>All these tags need to be closed.
<H4>EXERCISE</H4>
<P>Write a simple web page.</P>
<P> Copy out exactly the HTML below, using a WP program such as Notepad.<BR>
Information in <I>italics</I> indicates where you can insert your own text, other information is HTML and needs to be exact. However, make sure there are no spaces between the tag brackets and the text inside.<BR>
(Find Notepad by going to the START menu\ PROGRAMS\ ACCESSORIES\ NOTEPAD).
<P>
< HTML ><BR>
< HEAD ><BR>
< TITLE ><I> title of page</I>< /TITLE ><BR>
< /HEAD ><BR>
< BODY><BR>
<I> write what you like here: 'my first web page', or a piece about what you are reading, or a few thoughts on the course, or copy out a few words from a book or cornflake packet. Just type in your words using no extras such as bold, or italics, as these have special HTML tags, although you may use upper and lower case letters and single spaces. </I><BR>
< /BODY ><BR>
< /HTML ><BR>
<P>Save the file as 'first.html' (ie. call the file anything at all) It's useful if you start a folder - just as you would for word-processing - and call it something like WEBPAGES, and put your first.html file in the folder.
<P>NOW - open your browser.<BR>
On Netscape the process is: <BR>
Top menu; FILE\ OPEN PAGE\ CHOOSE FILE<BR>
Click on your WEBPAGES folder\ FIRST file<BR>
Click 'open' and your page should appear.
<P>On Internet Explorer: <BR>
Top menu; FILE\ OPEN\ BROWSE <BR>
Click on your WEBPAGES folder\ FIRST file<BR>
Click 'open' and your page should appear.<BR>
<P>If the page doesn't open, go back over your notepad typing and make sure that all the HTML tags are correct. Check there are no spaces between tags and internal text; check that all tags are closed; check that you haven't written < HTLM > or < BDDY >. Your page will work eventually.
<P>
Make another page. Call it somethingdifferent.html and place it in the same WEBPAGES folder as detailed above.
<P>start formatting in <A HREF="webpage2.html">lesson two</A>
<BR><A HREF="col3.html">back to wws index</A> </P>
</P>
</DIV>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
`

View file

@ -16,7 +16,7 @@ import (
api "github.com/documize/community/core/convapi"
"golang.org/x/net/context"
"context"
)
// Convert provides the standard interface for conversion of a ".documizeapi" json document.

View file

@ -16,9 +16,9 @@ import (
"fmt"
"strings"
"context"
api "github.com/documize/community/core/convapi"
"github.com/documize/community/core/stringutil"
"golang.org/x/net/context"
"golang.org/x/net/html"
"golang.org/x/net/html/atom"
)

View file

@ -16,7 +16,7 @@ import (
"github.com/documize/blackfriday"
"golang.org/x/net/context"
"context"
)
// Convert provides the standard interface for conversion of a Markdown document.

View file

@ -22,7 +22,7 @@ import (
"github.com/documize/community/core/api/convert/html"
"github.com/documize/community/core/api/convert/md"
api "github.com/documize/community/core/convapi"
"github.com/documize/community/domain"
"github.com/documize/community/domain/store"
"github.com/documize/glick"
)
@ -49,7 +49,7 @@ var Lib *glick.Library
// Setup configures the global library at Lib,
// largely based on the "config.json" file. It should be called only once.
func Setup(s *domain.Store) error {
func Setup(s *store.Store) error {
if insecure == "true" {
glick.InsecureSkipVerifyTLS = true
}

View file

@ -1,61 +0,0 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
package plugins
import (
"os"
"testing"
)
func TestSetup(t *testing.T) {
err := LibSetup()
if err == nil {
//t.Error("should error on non-existent config file")
//t.Fail()
}
ssc, err := Lib.Actions("Convert")
if err != nil {
t.Error(err)
}
// TODO(Elliott) review for empty database
//if len(ssc) > 3 {
// t.Errorf("extra convert formats:%v", ssc)
//}
/* this code leaves plugins still running */
err = os.Chdir("../../..")
if err != nil {
t.Error(err)
}
err = LibSetup()
if err != nil {
t.Error(err)
}
ssc, err = Lib.Actions("Convert")
if err != nil {
t.Error(err)
}
if len(ssc) == 0 {
t.Error("no extra convert formats (defined)")
}
err = os.Chdir("documize/api/plugins")
if err != nil {
t.Error(err)
}
err = Lib.KillSubProcs()
if err != nil {
t.Error(err)
}
}

70
core/asset/assets.go Normal file
View file

@ -0,0 +1,70 @@
package asset
import (
"embed"
"errors"
"io"
"io/fs"
"mime"
"net/http"
"path"
"path/filepath"
)
// GetPublicFileSystem
func GetPublicFileSystem(e embed.FS) (hfs http.FileSystem, err error) {
fsys, err := fs.Sub(e, "static/public")
if err != nil {
return nil, errors.New("failed GetPublicFileSystem")
}
return http.FS(fsys), nil
}
// FetchStatic loads static asset from embed file system.
func FetchStatic(e embed.FS, filename string) (content, contentType string, err error) {
data, err := e.ReadFile("static/" + filename)
if err != nil {
return
}
contentType = mime.TypeByExtension(filepath.Ext(filename))
content = string(data)
return
}
// FetchStaticDir returns filenames within specified directory
func FetchStaticDir(fs embed.FS, directory string) (files []string, err error) {
entries, err := fs.ReadDir("static/" + directory)
if err != nil {
return
}
for i := range entries {
if !entries[i].Type().IsDir() {
files = append(files, entries[i].Name())
}
}
return files, nil
}
// WriteStatic loads static asset from embed file system and writes to HTTP.
func WriteStatic(fs embed.FS, prefix, requestedPath string, w http.ResponseWriter) error {
f, err := fs.Open(path.Join(prefix, requestedPath))
if err != nil {
return err
}
defer f.Close()
stat, _ := f.Stat()
if stat.IsDir() {
return errors.New("cannot write static file")
}
contentType := mime.TypeByExtension(filepath.Ext(requestedPath))
w.Header().Set("Content-Type", contentType)
_, err = io.Copy(w, f)
return err
}

View file

@ -12,187 +12,85 @@
package database
import (
"errors"
"fmt"
"strconv"
"strings"
"github.com/documize/community/core/env"
"github.com/documize/community/core/streamutil"
"github.com/documize/community/server/web"
)
var dbCheckOK bool // default false
// Check that the database is configured correctly and that all the required tables exist.
// It must be the first function called in this package.
func Check(runtime *env.Runtime) bool {
runtime.Log.Info("Database checks: started")
runtime.Log.Info("Database: checking state")
csBits := strings.Split(runtime.Flags.DBConn, "/")
if len(csBits) > 1 {
web.SiteInfo.DBname = strings.Split(csBits[len(csBits)-1], "?")[0]
}
web.SiteInfo.DBname = runtime.StoreProvider.DatabaseName()
rows, err := runtime.Db.Query("SELECT VERSION() AS version, @@version_comment as comment, @@character_set_database AS charset, @@collation_database AS collation")
rows, err := runtime.Db.Query(runtime.StoreProvider.QueryMeta())
if err != nil {
runtime.Log.Error("Can't get MySQL configuration", err)
web.SiteInfo.Issue = "Can't get MySQL configuration: " + err.Error()
runtime.Log.Error("Database: unable to load meta information from database provider", err)
web.SiteInfo.Issue = "Unable to load meta information from database provider: " + err.Error()
runtime.Flags.SiteMode = env.SiteModeBadDB
return false
}
defer streamutil.Close(rows)
var version, dbComment, charset, collation string
if rows.Next() {
err = rows.Scan(&version, &dbComment, &charset, &collation)
}
if err == nil {
err = rows.Err() // get any error encountered during iteration
}
if err != nil {
runtime.Log.Error("no MySQL configuration returned", err)
web.SiteInfo.Issue = "no MySQL configuration return issue: " + err.Error()
runtime.Log.Error("Database: no meta data returned by database provider", err)
web.SiteInfo.Issue = "No meta data returned by database provider: " + err.Error()
runtime.Flags.SiteMode = env.SiteModeBadDB
return false
}
// Get SQL variant as this affects minimum version checking logic.
// MySQL and Percona share same version scheme (e..g 5.7.10).
// MariaDB starts at 10.2.x
runtime.DbVariant = GetSQLVariant(runtime.Flags.DBType, dbComment)
runtime.Log.Info(fmt.Sprintf("Database checks: SQL variant %v", runtime.DbVariant))
runtime.Log.Info("Database checks: SQL version " + version)
runtime.Log.Info(fmt.Sprintf("Database: provider name %v", runtime.StoreProvider.Type()))
runtime.Log.Info(fmt.Sprintf("Database: provider version %s", version))
verNums, err := GetSQLVersion(version)
if err != nil {
runtime.Log.Error("Database version check failed", err)
// Version OK?
versionOK, minVersion := runtime.StoreProvider.VerfiyVersion(version)
if !versionOK {
msg := fmt.Sprintf("*** ERROR: database version needs to be %s or above ***", minVersion)
runtime.Log.Info(msg)
web.SiteInfo.Issue = msg
runtime.Flags.SiteMode = env.SiteModeBadDB
return false
}
// Check minimum MySQL version as we need JSON column type.
verInts := []int{5, 7, 10} // Minimum MySQL version
if runtime.DbVariant == env.DBVariantMariaDB {
verInts = []int{10, 3, 0} // Minimum MariaDB version
// Character set and collation OK?
charOK, charRequired := runtime.StoreProvider.VerfiyCharacterCollation(charset, collation)
if !charOK {
msg := fmt.Sprintf("*** ERROR: %s ***", charRequired)
runtime.Log.Info(msg)
web.SiteInfo.Issue = msg
runtime.Flags.SiteMode = env.SiteModeBadDB
return false
}
for k, v := range verInts {
if verNums[k] < v {
want := fmt.Sprintf("%d.%d.%d", verInts[0], verInts[1], verInts[2])
runtime.Log.Error("MySQL version element "+strconv.Itoa(k+1)+" of '"+version+"' not high enough, need at least version "+want, errors.New("bad MySQL version"))
web.SiteInfo.Issue = "MySQL version element " + strconv.Itoa(k+1) + " of '" + version + "' not high enough, need at least version " + want
runtime.Flags.SiteMode = env.SiteModeBadDB
return false
}
// if there are no rows in the database, enter set-up mode
var flds []string
if err := runtime.Db.Select(&flds, runtime.StoreProvider.QueryTableList()); err != nil {
msg := fmt.Sprintf("Database: unable to get database table list ")
runtime.Log.Error(msg, err)
web.SiteInfo.Issue = msg + err.Error()
runtime.Flags.SiteMode = env.SiteModeBadDB
return false
}
{ // check the MySQL character set and collation
if charset != "utf8" && charset != "utf8mb4" {
runtime.Log.Error("MySQL character set not utf8/utf8mb4:", errors.New(charset))
web.SiteInfo.Issue = "MySQL character set not utf8/utf8mb4: " + charset
runtime.Flags.SiteMode = env.SiteModeBadDB
return false
}
if !strings.HasPrefix(collation, "utf8") {
runtime.Log.Error("MySQL collation sequence not utf8...:", errors.New(collation))
web.SiteInfo.Issue = "MySQL collation sequence not utf8...: " + collation
runtime.Flags.SiteMode = env.SiteModeBadDB
return false
}
if len(flds) <= 5 {
runtime.Log.Info("Database: starting setup mode for empty database")
runtime.Flags.SiteMode = env.SiteModeSetup
return false
}
{ // if there are no rows in the database, enter set-up mode
var flds []string
if err := runtime.Db.Select(&flds,
`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = '`+web.SiteInfo.DBname+
`' and TABLE_TYPE='BASE TABLE'`); err != nil {
runtime.Log.Error("Can't get MySQL number of tables", err)
web.SiteInfo.Issue = "Can't get MySQL number of tables: " + err.Error()
runtime.Flags.SiteMode = env.SiteModeBadDB
return false
}
if strings.TrimSpace(flds[0]) == "0" {
runtime.Log.Info("Entering database set-up mode because the database is empty.....")
runtime.Flags.SiteMode = env.SiteModeSetup
return false
}
}
// We have good database, so proceed with app boot process.
runtime.Flags.SiteMode = env.SiteModeNormal
web.SiteInfo.DBname = ""
{ // check all the required tables exist
var tables = []string{`account`,
`attachment`, `document`,
`label`, `organization`,
`page`, `revision`, `search`, `user`}
for _, table := range tables {
var dummy []string
if err := runtime.Db.Select(&dummy, "SELECT 1 FROM "+table+" LIMIT 1;"); err != nil {
runtime.Log.Error("Entering bad database mode because: SELECT 1 FROM "+table+" LIMIT 1;", err)
web.SiteInfo.Issue = "MySQL database is not empty, but does not contain table: " + table
runtime.Flags.SiteMode = env.SiteModeBadDB
return false
}
}
}
runtime.Flags.SiteMode = env.SiteModeNormal // actually no need to do this (as already ""), this for documentation
web.SiteInfo.DBname = "" // do not give this info when not in set-up mode
dbCheckOK = true
return true
}
// GetSQLVariant uses database value form @@version_comment to deduce MySQL variant.
func GetSQLVariant(dbType, vc string) env.DbVariant {
vc = strings.ToLower(vc)
dbType = strings.ToLower(dbType)
// determine type from database
if strings.Contains(vc, "mariadb") {
return env.DBVariantMariaDB
} else if strings.Contains(vc, "percona") {
return env.DBVariantPercona
} else if strings.Contains(vc, "mysql") {
return env.DbVariantMySQL
}
// now determine type from command line switch
if strings.Contains(dbType, "mariadb") {
return env.DBVariantMariaDB
} else if strings.Contains(dbType, "percona") {
return env.DBVariantPercona
} else if strings.Contains(dbType, "mysql") {
return env.DbVariantMySQL
}
// horrid default could cause app to crash
return env.DbVariantMySQL
}
// GetSQLVersion returns SQL version as major,minor,patch numerics.
func GetSQLVersion(v string) (ints []int, err error) {
ints = []int{0, 0, 0}
pos := strings.Index(v, "-")
if pos > 1 {
v = v[:pos]
}
vs := strings.Split(v, ".")
if len(vs) < 3 {
err = errors.New("MySQL version not of the form a.b.c")
return
}
for key, val := range vs {
num, err := strconv.Atoi(val)
if err != nil {
return ints, err
}
ints[key] = num
}
return
}

View file

@ -1,42 +0,0 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
package database
import "testing"
// go test github.com/documize/community/core/database -run TestGetVersion
func TestGetVersion(t *testing.T) {
ts2(t, "5.7.10", []int{5, 7, 10})
ts2(t, "5.7.10-log", []int{5, 7, 10})
ts2(t, "5.7.10-demo", []int{5, 7, 10})
ts2(t, "5.7.10-debug", []int{5, 7, 10})
ts2(t, "5.7.16-10", []int{5, 7, 16})
ts2(t, "5.7.12-0ubuntu0-12.12.3", []int{5, 7, 12})
ts2(t, "10.1.20-MariaDB-1~jessie", []int{10, 1, 20})
ts2(t, "ubuntu0-12.12.3", []int{0, 0, 0})
ts2(t, "junk-string", []int{0, 0, 0})
ts2(t, "somethingstring", []int{0, 0, 0})
}
func ts2(t *testing.T, in string, out []int) {
got, _ := GetSQLVersion(in)
// if err != nil {
// t.Errorf("Unable to GetSQLVersion %s", err)
// }
for k, v := range got {
if v != out[k] {
t.Errorf("version input of %s got %d for position %d but expected %d\n", in, v, k, out[k])
}
}
}

74
core/database/db_test.go Normal file
View file

@ -0,0 +1,74 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
package database
import (
"github.com/documize/community/core/env"
"testing"
)
// go test github.com/documize/community/core/database -run TestGetVersion
// func TestGetVersion(t *testing.T) {
// ts2(t, "5.7.10", []int{5, 7, 10})
// ts2(t, "5.7.10-log", []int{5, 7, 10})
// ts2(t, "5.7.10-demo", []int{5, 7, 10})
// ts2(t, "5.7.10-debug", []int{5, 7, 10})
// ts2(t, "5.7.16-10", []int{5, 7, 16})
// ts2(t, "5.7.12-0ubuntu0-12.12.3", []int{5, 7, 12})
// ts2(t, "10.1.20-MariaDB-1~jessie", []int{10, 1, 20})
// ts2(t, "ubuntu0-12.12.3", []int{0, 0, 0})
// ts2(t, "junk-string", []int{0, 0, 0})
// ts2(t, "somethingstring", []int{0, 0, 0})
// }
// func ts2(t *testing.T, in string, out []int) {
// got, _ := GetSQLVersion(in)
// // if err != nil {
// // t.Errorf("Unable to GetSQLVersion %s", err)
// // }
// for k, v := range got {
// if v != out[k] {
// t.Errorf("version input of %s got %d for position %d but expected %d\n", in, v, k, out[k])
// }
// }
// }
func TestDatabaseVersionLegacy(t *testing.T) {
i := extractVersionNumber("db_00021.sql")
if i != 21 {
t.Errorf("expected 21 got %d", i)
}
i = extractVersionNumber("db_000.sql")
if i != 0 {
t.Errorf("expected 0 got %d", i)
}
i = extractVersionNumber("26")
if i != 26 {
t.Errorf("expected 26 got %d", i)
}
}
func TestParamRebind(t *testing.T) {
q1in := "INSERT INTO dmz_org (c_refid, c_company, c_title) VALUES (?, ?, ?)"
q1out := "INSERT INTO dmz_org (c_refid, c_company, c_title) VALUES ($1, $2, $3)"
test1 := RebindParams(q1in, env.StoreTypePostgreSQL)
if test1 != q1out {
t.Errorf("expected %s got %s", q1in, test1)
}
t.Log(test1)
}

View file

@ -1,253 +0,0 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
package database
import (
"errors"
"fmt"
"net/http"
"strings"
"time"
"github.com/documize/community/core/api/plugins"
"github.com/documize/community/core/env"
"github.com/documize/community/core/secrets"
"github.com/documize/community/core/stringutil"
"github.com/documize/community/core/uniqueid"
"github.com/documize/community/domain"
"github.com/documize/community/server/web"
)
// Handler contains the runtime information such as logging and database.
type Handler struct {
Runtime *env.Runtime
Store *domain.Store
}
// Setup the tables in a blank database
func (h *Handler) Setup(w http.ResponseWriter, r *http.Request) {
defer func() {
target := "/setup"
status := http.StatusBadRequest
if h.Runtime.Flags.SiteMode == env.SiteModeNormal {
target = "/"
status = http.StatusOK
}
req, err := http.NewRequest("GET", target, nil)
if err != nil {
h.Runtime.Log.Error("database.Setup error in defer ", err)
}
http.Redirect(w, req, target, status)
}()
err := r.ParseForm()
if err != nil {
h.Runtime.Log.Error("database.Setup r.ParseForm()", err)
return
}
dbname := r.Form.Get("dbname")
dbhash := r.Form.Get("dbhash")
if dbname != web.SiteInfo.DBname || dbhash != web.SiteInfo.DBhash {
h.Runtime.Log.Error("database.Setup security credentials error ", errors.New("bad db name or validation code"))
return
}
details := onboardRequest{
URL: "",
Company: r.Form.Get("title"),
CompanyLong: r.Form.Get("title"),
Message: r.Form.Get("message"),
Email: r.Form.Get("email"),
Password: r.Form.Get("password"),
Firstname: r.Form.Get("firstname"),
Lastname: r.Form.Get("lastname"),
Revised: time.Now().UTC(),
}
if details.Company == "" ||
details.CompanyLong == "" ||
details.Message == "" ||
details.Email == "" ||
details.Password == "" ||
details.Firstname == "" ||
details.Lastname == "" {
h.Runtime.Log.Error("database.Setup error ", errors.New("required field in database set-up form blank"))
return
}
if err = Migrate(h.Runtime, false /* no tables exist yet */); err != nil {
h.Runtime.Log.Error("database.Setup migrate", err)
return
}
err = setupAccount(h.Runtime, details, secrets.GenerateSalt())
if err != nil {
h.Runtime.Log.Error("database.Setup setup account ", err)
return
}
h.Runtime.Flags.SiteMode = env.SiteModeNormal
err = plugins.Setup(h.Store)
if err != nil {
h.Runtime.Log.Error("database.Setup plugin setup failed", err)
}
}
// The result of completing the onboarding process.
type onboardRequest struct {
URL string
Company string
CompanyLong string
Message string
Email string
Password string
Firstname string
Lastname string
Revised time.Time
}
// setupAccount prepares the database for a newly onboard customer.
// Once done, they can then login and use Documize.
func setupAccount(rt *env.Runtime, completion onboardRequest, serial string) (err error) {
//accountTitle := "This is where you will find documentation for your all projects. You can customize this message from the settings screen."
salt := secrets.GenerateSalt()
password := secrets.GeneratePassword(completion.Password, salt)
// Allocate organization to the user.
orgID := uniqueid.Generate()
sql := fmt.Sprintf("insert into organization (refid, company, title, message, domain, email, serial) values (\"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\")",
orgID, completion.Company, completion.CompanyLong, completion.Message, completion.URL, completion.Email, serial)
_, err = runSQL(rt, sql)
if err != nil {
rt.Log.Error("Failed to insert into organization", err)
return
}
userID := uniqueid.Generate()
sql = fmt.Sprintf("insert into user (refid, firstname, lastname, email, initials, salt, password, global) values (\"%s\",\"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", 1)",
userID, completion.Firstname, completion.Lastname, completion.Email, stringutil.MakeInitials(completion.Firstname, completion.Lastname), salt, password)
_, err = runSQL(rt, sql)
if err != nil {
rt.Log.Error("Failed with error", err)
return err
}
// Link user to organization.
accountID := uniqueid.Generate()
sql = fmt.Sprintf("insert into account (refid, userid, orgid, admin, editor) values (\"%s\", \"%s\", \"%s\",1, 1)", accountID, userID, orgID)
_, err = runSQL(rt, sql)
if err != nil {
rt.Log.Error("Failed with error", err)
return err
}
// create space
labelID := uniqueid.Generate()
sql = fmt.Sprintf("insert into label (refid, orgid, label, type, userid) values (\"%s\", \"%s\", \"My Project\", 2, \"%s\")", labelID, orgID, userID)
_, err = runSQL(rt, sql)
if err != nil {
rt.Log.Error("insert into label failed", err)
}
// assign permissions to space
perms := []string{"view", "manage", "own", "doc-add", "doc-edit", "doc-delete", "doc-move", "doc-copy", "doc-template", "doc-approve", "doc-version", "doc-lifecycle"}
for _, p := range perms {
sql = fmt.Sprintf("insert into permission (orgid, who, whoid, action, scope, location, refid) values (\"%s\", 'user', \"%s\", \"%s\", 'object', 'space', \"%s\")", orgID, userID, p, labelID)
_, err = runSQL(rt, sql)
if err != nil {
rt.Log.Error("insert into permission failed", err)
}
}
// Create some user groups
groupDevID := uniqueid.Generate()
sql = fmt.Sprintf("INSERT INTO role (refid, orgid, role, purpose) VALUES (\"%s\", \"%s\", \"Technology\", \"On-site and remote development teams\")", groupDevID, orgID)
_, err = runSQL(rt, sql)
if err != nil {
rt.Log.Error("insert into role failed", err)
}
groupProjectID := uniqueid.Generate()
sql = fmt.Sprintf("INSERT INTO role (refid, orgid, role, purpose) VALUES (\"%s\", \"%s\", \"Project Management\", \"HQ project management\")", groupProjectID, orgID)
_, err = runSQL(rt, sql)
if err != nil {
rt.Log.Error("insert into role failed", err)
}
groupBackofficeID := uniqueid.Generate()
sql = fmt.Sprintf("INSERT INTO role (refid, orgid, role, purpose) VALUES (\"%s\", \"%s\", \"Back Office\", \"Non-IT and PMO personnel\")", groupBackofficeID, orgID)
_, err = runSQL(rt, sql)
if err != nil {
rt.Log.Error("insert into role failed", err)
}
// Join some groups
sql = fmt.Sprintf("INSERT INTO rolemember (orgid, roleid, userid) VALUES (\"%s\", \"%s\", \"%s\")", orgID, groupDevID, userID)
_, err = runSQL(rt, sql)
if err != nil {
rt.Log.Error("insert into rolemember failed", err)
}
sql = fmt.Sprintf("INSERT INTO rolemember (orgid, roleid, userid) VALUES (\"%s\", \"%s\", \"%s\")", orgID, groupProjectID, userID)
_, err = runSQL(rt, sql)
if err != nil {
rt.Log.Error("insert into rolemember failed", err)
}
sql = fmt.Sprintf("INSERT INTO rolemember (orgid, roleid, userid) VALUES (\"%s\", \"%s\", \"%s\")", orgID, groupBackofficeID, userID)
_, err = runSQL(rt, sql)
if err != nil {
rt.Log.Error("insert into rolemember failed", err)
}
return
}
// runSQL creates a transaction per call
func runSQL(rt *env.Runtime, sql string) (id uint64, err error) {
if strings.TrimSpace(sql) == "" {
return 0, nil
}
tx, err := rt.Db.Beginx()
if err != nil {
rt.Log.Error("runSql - failed to get transaction", err)
return
}
result, err := tx.Exec(sql)
if err != nil {
tx.Rollback()
rt.Log.Error("runSql - unable to run sql", err)
return
}
if err = tx.Commit(); err != nil {
rt.Log.Error("runSql - unable to commit sql", err)
return
}
tempID, _ := result.LastInsertId()
id = uint64(tempID)
return
}

232
core/database/installer.go Normal file
View file

@ -0,0 +1,232 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
package database
import (
"fmt"
"regexp"
"strconv"
"strings"
"github.com/documize/community/core/env"
"github.com/jmoiron/sqlx"
)
// InstallUpgrade creates new database or upgrades existing database.
func InstallUpgrade(runtime *env.Runtime, existingDB bool) (err error) {
// amLeader := false
// Get all SQL scripts.
scripts, err := LoadScripts(runtime)
if err != nil {
runtime.Log.Error("Database: unable to load scripts", err)
return
}
// Get current database version.
currentVersion := 0
if existingDB {
currentVersion, err = CurrentVersion(runtime)
if err != nil {
runtime.Log.Error("Database: unable to get current version", err)
return
}
runtime.Log.Info(fmt.Sprintf("Database: current version number is %d", currentVersion))
}
// Filter out database specific scripts.
dbTypeScripts := SpecificScripts(runtime, scripts)
if len(dbTypeScripts) == 0 {
runtime.Log.Info(fmt.Sprintf("Database: unable to load scripts for database type %s", runtime.StoreProvider.Type()))
return
}
runtime.Log.Info(fmt.Sprintf("Database: loaded %d SQL scripts for provider %s", len(dbTypeScripts), runtime.StoreProvider.Type()))
// Make a list of scripts to execute based upon current database state.
toProcess := []Script{}
for _, s := range dbTypeScripts {
if s.Version > currentVersion || currentVersion == 0 {
toProcess = append(toProcess, s)
}
}
runtime.Log.Info(fmt.Sprintf("Database: %d scripts to process", len(toProcess)))
// For MySQL type there was major new schema introduced in v24.
// We check for this release and bypass usual locking code
// because tables have changed.
legacyMigration := runtime.StoreProvider.Type() == env.StoreTypeMySQL &&
currentVersion > 0 && currentVersion < 25 && len(toProcess) >= 26 && toProcess[len(toProcess)-1].Version == 25
if legacyMigration {
// Bypass all DB locking/checking processes as these look for new schema
// which we are about to install.
toProcess = toProcess[len(toProcess)-1:]
runtime.Log.Info(fmt.Sprintf("Database: legacy schema has %d scripts to process", len(toProcess)))
}
err = runScripts(runtime, toProcess)
if err != nil {
runtime.Log.Error("Database: error processing SQL scripts", err)
}
return nil
}
// Run SQL scripts to instal or upgrade this database.
// We do not use transactions for Microsoft SQL Server because
// CREATE FULLTEXT CATALOG statement cannot be used inside a user transaction.
func runScripts(runtime *env.Runtime, scripts []Script) (err error) {
tx, err := runtime.Db.Beginx()
if err != nil {
return err
}
// We can have multiple scripts as each Documize database change has it's own SQL script.
for _, script := range scripts {
runtime.Log.Info(fmt.Sprintf("Database: processing SQL script %d", script.Version))
err = executeSQL(tx, runtime, script.Script)
if err != nil {
runtime.Log.Error(fmt.Sprintf("error executing SQL script %d", script.Version), err)
if runtime.StoreProvider.Type() != env.StoreTypeSQLServer {
tx.Rollback()
}
return err
}
// Record the fact we have processed this database script version.
if runtime.StoreProvider.Type() != env.StoreTypeSQLServer {
_, err = tx.Exec(runtime.StoreProvider.QueryRecordVersionUpgrade(script.Version))
} else {
_, err = runtime.Db.Exec(runtime.StoreProvider.QueryRecordVersionUpgrade(script.Version))
}
if err != nil {
// For MySQL we try the legacy DB schema.
if runtime.StoreProvider.Type() == env.StoreTypeMySQL {
runtime.Log.Info(fmt.Sprintf("Database: attempting legacy fallback for SQL script %d", script.Version))
_, err = tx.Exec(runtime.StoreProvider.QueryRecordVersionUpgradeLegacy(script.Version))
if err != nil {
runtime.Log.Error(fmt.Sprintf("error recording execution of SQL script %d", script.Version), err)
if runtime.StoreProvider.Type() != env.StoreTypeSQLServer {
tx.Rollback()
}
return err
}
} else {
// Unknown issue running script on non-MySQL database.
runtime.Log.Error(fmt.Sprintf("error executing SQL script %d", script.Version), err)
if runtime.StoreProvider.Type() != env.StoreTypeSQLServer {
tx.Rollback()
}
return err
}
}
}
tx.Commit()
return nil
}
// executeSQL runs specified SQL commands.
func executeSQL(tx *sqlx.Tx, runtime *env.Runtime, SQLfile []byte) error {
// Turn SQL file contents into runnable SQL statements.
stmts := getStatements(SQLfile)
for _, stmt := range stmts {
// MariaDB has no specific JSON column type (but has JSON queries)
if runtime.StoreProvider.Type() == env.StoreTypeMySQL &&
runtime.StoreProvider.TypeVariant() == env.StoreTypeMariaDB {
stmt = strings.Replace(stmt, "` JSON", "` TEXT", -1)
}
var err error
if runtime.StoreProvider.Type() != env.StoreTypeSQLServer {
_, err = tx.Exec(stmt)
} else {
_, err = runtime.Db.Exec(stmt)
}
if err != nil {
fmt.Println("sql statement error:", stmt)
return err
}
}
return nil
}
// getStatement strips out the comments and returns all the individual SQL commands (apart from "USE") as a []string.
func getStatements(bytes []byte) (stmts []string) {
// Strip comments of the form '-- comment' or like this one /**/
stripped := regexp.MustCompile("(?s)--.*?\n|/\\*.*?\\*/").ReplaceAll(bytes, []byte("\n"))
// Break into lines using ; terminator.
lines := strings.Split(string(stripped), ";")
// Prepare return data.
stmts = make([]string, 0, len(lines))
for _, v := range lines {
trimmed := strings.TrimSpace(v)
// Process non-empty lines and exclude "USE dbname" command
if len(trimmed) > 0 && !strings.HasPrefix(strings.ToUpper(trimmed), "USE ") {
stmts = append(stmts, trimmed+";")
}
}
return
}
// CurrentVersion returns number that represents the current database version number.
// For example 23 represents the 23rd iteration of the database.
func CurrentVersion(runtime *env.Runtime) (version int, err error) {
currentVersion := "0"
row := runtime.Db.QueryRow(runtime.StoreProvider.QueryGetDatabaseVersion())
err = row.Scan(&currentVersion)
if err != nil {
// For MySQL we try the legacy DB checks.
if runtime.StoreProvider.Type() == env.StoreTypeMySQL {
row := runtime.Db.QueryRow(runtime.StoreProvider.QueryGetDatabaseVersionLegacy())
err = row.Scan(&currentVersion)
}
}
return extractVersionNumber(currentVersion), nil
}
// Turns legacy "db_00021.sql" and new "21" format into version number 21.
func extractVersionNumber(s string) int {
// Good practice in case of human tampering.
s = strings.TrimSpace(s)
s = strings.ToLower(s)
// Remove any quotes from JSON string.
s = strings.Replace(s, "\"", "", -1)
// Remove legacy version string formatting.
// We know just store the number.
s = strings.Replace(s, "db_000", "", 1)
s = strings.Replace(s, ".sql", "", 1)
i, err := strconv.Atoi(s)
if err != nil {
i = 0
}
return i
}

View file

@ -1,281 +0,0 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
package database
import (
"bytes"
"crypto/rand"
"database/sql"
"fmt"
"os"
"regexp"
"sort"
"strings"
"time"
"github.com/documize/community/core/env"
"github.com/documize/community/core/streamutil"
"github.com/documize/community/server/web"
"github.com/jmoiron/sqlx"
)
const migrationsDir = "bindata/scripts"
// migrationsT holds a list of migration sql files to run.
type migrationsT []string
// migrations returns a list of the migrations to update the database as required for this version of the code.
func migrations(lastMigration string) (migrationsT, error) {
lastMigration = strings.TrimPrefix(strings.TrimSuffix(lastMigration, `"`), `"`)
files, err := web.AssetDir(migrationsDir)
if err != nil {
return nil, err
}
sort.Strings(files)
ret := make(migrationsT, 0, len(files))
hadLast := false
if len(lastMigration) == 0 {
hadLast = true
}
for _, v := range files {
if v == lastMigration {
hadLast = true
} else {
if hadLast {
ret = append(ret, v)
}
}
}
//fmt.Println(`DEBUG Migrations("`+lastMigration+`")=`,ret)
return ret, nil
}
// migrate the database as required, by applying the migrations.
func (m migrationsT) migrate(runtime *env.Runtime, tx *sqlx.Tx) error {
for _, v := range m {
runtime.Log.Info("Processing migration file: " + v)
buf, err := web.Asset(migrationsDir + "/" + v)
if err != nil {
return err
}
err = processSQLfile(tx, runtime.DbVariant, buf)
if err != nil {
return err
}
json := `{"database":"` + v + `"}`
sql := "INSERT INTO `config` (`key`,`config`) " +
"VALUES ('META','" + json +
"') ON DUPLICATE KEY UPDATE `config`='" + json + "';"
_, err = tx.Exec(sql) // add a record in the config file to say we have done the upgrade
if err != nil {
return err
}
}
return nil
}
func lockDB(runtime *env.Runtime) (bool, error) {
b := make([]byte, 2)
_, err := rand.Read(b)
if err != nil {
return false, err
}
wait := ((time.Duration(b[0]) << 8) | time.Duration(b[1])) * time.Millisecond / 10 // up to 6.5 secs wait
time.Sleep(wait)
tx, err := runtime.Db.Beginx()
if err != nil {
return false, err
}
_, err = tx.Exec("LOCK TABLE `config` WRITE;")
if err != nil {
return false, err
}
defer func() {
_, err = tx.Exec("UNLOCK TABLES;")
if err != nil {
runtime.Log.Error("unable to unlock tables", err)
}
tx.Commit()
}()
_, err = tx.Exec("INSERT INTO `config` (`key`,`config`) " +
fmt.Sprintf(`VALUES ('DBLOCK','{"pid": "%d"}');`, os.Getpid()))
if err != nil {
// good error would be "Error 1062: Duplicate entry 'DBLOCK' for key 'idx_config_area'"
if strings.HasPrefix(err.Error(), "Error 1062:") {
runtime.Log.Info("Database locked by another Documize instance")
return false, nil
}
return false, err
}
runtime.Log.Info("Database locked by this Documize instance")
return true, err // success!
}
func unlockDB(rt *env.Runtime) error {
tx, err := rt.Db.Beginx()
if err != nil {
return err
}
_, err = tx.Exec("DELETE FROM `config` WHERE `key`='DBLOCK';")
if err != nil {
return err
}
return tx.Commit()
}
func migrateEnd(runtime *env.Runtime, tx *sqlx.Tx, err error, amLeader bool) error {
if amLeader {
defer func() { unlockDB(runtime) }()
if tx != nil {
if err == nil {
tx.Commit()
runtime.Log.Info("Database checks: completed")
return nil
}
tx.Rollback()
}
runtime.Log.Error("Database checks: failed: ", err)
return err
}
return nil // not the leader, so ignore errors
}
func getLastMigration(tx *sqlx.Tx) (lastMigration string, err error) {
var stmt *sql.Stmt
stmt, err = tx.Prepare("SELECT JSON_EXTRACT(`config`,'$.database') FROM `config` WHERE `key` = 'META';")
if err == nil {
defer streamutil.Close(stmt)
var item = make([]uint8, 0)
row := stmt.QueryRow()
err = row.Scan(&item)
if err == nil {
if len(item) > 1 {
q := []byte(`"`)
lastMigration = string(bytes.TrimPrefix(bytes.TrimSuffix(item, q), q))
}
}
}
return
}
// Migrate the database as required, consolidated action.
func Migrate(runtime *env.Runtime, ConfigTableExists bool) error {
amLeader := false
if ConfigTableExists {
var err error
amLeader, err = lockDB(runtime)
if err != nil {
runtime.Log.Error("unable to lock DB", err)
}
} else {
amLeader = true // what else can you do?
}
tx, err := runtime.Db.Beginx()
if err != nil {
return migrateEnd(runtime, tx, err, amLeader)
}
lastMigration := ""
if ConfigTableExists {
lastMigration, err = getLastMigration(tx)
if err != nil {
return migrateEnd(runtime, tx, err, amLeader)
}
runtime.Log.Info("Database checks: last applied " + lastMigration)
}
mig, err := migrations(lastMigration)
if err != nil {
return migrateEnd(runtime, tx, err, amLeader)
}
if len(mig) == 0 {
runtime.Log.Info("Database checks: no updates required")
return migrateEnd(runtime, tx, nil, amLeader) // no migrations to perform
}
if amLeader {
runtime.Log.Info("Database checks: will execute the following update files: " + strings.Join([]string(mig), ", "))
return migrateEnd(runtime, tx, mig.migrate(runtime, tx), amLeader)
}
// a follower instance
targetMigration := string(mig[len(mig)-1])
for targetMigration != lastMigration {
time.Sleep(time.Second)
runtime.Log.Info("Waiting for database migration completion")
tx.Rollback() // ignore error
tx, err := runtime.Db.Beginx() // need this in order to see the changed situation since last tx
if err != nil {
return migrateEnd(runtime, tx, err, amLeader)
}
lastMigration, _ = getLastMigration(tx)
}
return migrateEnd(runtime, tx, nil, amLeader)
}
func processSQLfile(tx *sqlx.Tx, v env.DbVariant, buf []byte) error {
stmts := getStatements(buf)
for _, stmt := range stmts {
// MariaDB has no specific JSON column type (but has JSON queries)
if v == env.DBVariantMariaDB {
stmt = strings.Replace(stmt, "` JSON", "` TEXT", -1)
}
_, err := tx.Exec(stmt)
if err != nil {
return err
}
}
return nil
}
// getStatement strips out the comments and returns all the individual SQL commands (apart from "USE") as a []string.
func getStatements(bytes []byte) []string {
/* Strip comments of the form '-- comment' or like this one */
stripped := regexp.MustCompile("(?s)--.*?\n|/\\*.*?\\*/").ReplaceAll(bytes, []byte("\n"))
sqls := strings.Split(string(stripped), ";")
ret := make([]string, 0, len(sqls))
for _, v := range sqls {
trimmed := strings.TrimSpace(v)
if len(trimmed) > 0 &&
!strings.HasPrefix(strings.ToUpper(trimmed), "USE ") { // make sure we don't USE the wrong database
ret = append(ret, trimmed+";")
}
}
return ret
}

41
core/database/params.go Normal file
View file

@ -0,0 +1,41 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
package database
import (
"github.com/documize/community/core/env"
"github.com/jmoiron/sqlx"
)
// RebindParams changes MySQL query parameter placeholder from "?" to
// correct value for given database provider.
//
// MySQL uses ?, ?, ? (default for all Documize queries)
// PostgreSQL uses $1, $2, $3
// MS SQL Server uses @p1, @p2, @p3
func RebindParams(sql string, s env.StoreType) string {
bindParam := sqlx.QUESTION
switch s {
case env.StoreTypePostgreSQL:
bindParam = sqlx.DOLLAR
case env.StoreTypeSQLServer:
bindParam = sqlx.AT
}
return sqlx.Rebind(bindParam, sql)
}
// RebindPostgreSQL is a helper method on top of RebindParams.
func RebindPostgreSQL(sql string) string {
return RebindParams(sql, env.StoreTypePostgreSQL)
}

View file

@ -1,38 +0,0 @@
## PENDING REMOVALS
NONE
## MYSQL ENCODING
https://stackoverflow.com/questions/37307146/difference-between-utf8mb4-unicode-ci-and-utf8mb4-unicode-520-ci-collations-in-m
https://mathiasbynens.be/notes/mysql-utf8mb4
https://medium.com/@adamhooper/in-mysql-never-use-utf8-use-utf8mb4-11761243e434
## MIGRATE ENCODING
ALTER DATABASE documize CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE account CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE attachment CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE block CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE config CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE document CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE feedback CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE label CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE labelrole CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE link CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE organization CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE page CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE pagemeta CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE participant CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE pin CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE revision CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE search CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE share CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE useraction CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE useractivity CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE userconfig CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE userevent CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;

91
core/database/scripts.go Normal file
View file

@ -0,0 +1,91 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
package database
import (
"embed"
"fmt"
"sort"
"github.com/documize/community/core/asset"
"github.com/documize/community/core/env"
)
// Scripts holds all .SQL files for all supported database providers.
type Scripts struct {
MySQL []Script
PostgreSQL []Script
SQLServer []Script
}
// Script holds SQL script and it's associated version number.
type Script struct {
Version int
Script []byte
}
// LoadScripts returns .SQL scripts for supported database providers.
func LoadScripts(runtime *env.Runtime) (s Scripts, err error) {
// MySQL
s.MySQL, err = loadFiles(runtime.Assets, "scripts/mysql")
if err != nil {
return
}
// PostgreSQL
s.PostgreSQL, err = loadFiles(runtime.Assets, "scripts/postgresql")
if err != nil {
return
}
// PostgreSQL
s.SQLServer, err = loadFiles(runtime.Assets, "scripts/sqlserver")
if err != nil {
return
}
return s, nil
}
// SpecificScripts returns SQL scripts for current databasse provider.
func SpecificScripts(runtime *env.Runtime, all Scripts) (s []Script) {
switch runtime.StoreProvider.Type() {
case env.StoreTypeMySQL, env.StoreTypeMariaDB, env.StoreTypePercona:
return all.MySQL
case env.StoreTypePostgreSQL:
return all.PostgreSQL
case env.StoreTypeSQLServer:
return all.SQLServer
}
return
}
// loadFiles returns all SQL scripts in specified folder as [][]byte.
func loadFiles(fs embed.FS, path string) (b []Script, err error) {
scripts, err := asset.FetchStaticDir(fs, path)
if err != nil {
return
}
sort.Strings(scripts)
for i := range scripts {
filename := scripts[i]
sqlfile, _, err := asset.FetchStatic(fs, fmt.Sprintf("%s/%s", path, filename))
if err != nil {
return b, err
}
b = append(b, Script{Version: extractVersionNumber(filename), Script: []byte(sqlfile)})
}
return b, nil
}

View file

@ -1,3 +1,3 @@
/* community edition */
ALTER TABLE organization ADD COLUMN `service` VARCHAR(100) NOT NULL DEFAULT 'https://api.documize.com' AFTER `domain`;
ALTER TABLE organization ADD COLUMN `service` VARCHAR(100) NOT NULL DEFAULT '' AFTER `domain`;

View file

@ -1,6 +1,5 @@
/* community edition */
ALTER DATABASE documize CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE account CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE attachment CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE block CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
@ -44,7 +43,6 @@ CREATE TABLE IF NOT EXISTS `search` (
FULLTEXT INDEX `idx_search_content` (`content`))
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
ENGINE = MyISAM;
-- FULLTEXT search requires MyISAM and NOT InnoDB
-- migrate page content
INSERT INTO search (orgid, documentid, itemid, itemtype, content) SELECT orgid, documentid, id AS itemid, 'page' AS itemtype, TRIM(body) AS content FROM search_old;

View file

@ -13,6 +13,6 @@ ALTER TABLE useractivity ADD COLUMN `metadata` VARCHAR(1000) NOT NULL DEFAULT ''
-- new role for viewing content analytics
ALTER TABLE account ADD COLUMN `analytics` BOOL NOT NULL DEFAULT 0 AFTER `users`;
UPDATE account SET analytics=1 WHERE admin=1;
UPDATE account SET analytics=1 WHERE `admin`=1;
-- deprecations

View file

@ -0,0 +1,7 @@
/* community edition */
-- improved search table
ALTER TABLE search ENGINE = InnoDB;
OPTIMIZE TABLE search;
-- deprecations

View file

@ -0,0 +1,10 @@
/* community edition */
-- max tags per document setting
ALTER TABLE organization ADD COLUMN `maxtags` INT NOT NULL DEFAULT 3 AFTER `authconfig`;
-- support for network location link types
ALTER TABLE link ADD COLUMN `externalid` NVARCHAR(1000) NOT NULL DEFAULT '' AFTER `targetid`;
-- deprecations
ALTER TABLE organization DROP COLUMN `url`;

View file

@ -0,0 +1,335 @@
/* community edition */
-- table renaming
RENAME TABLE
`organization` TO dmz_org,
`label` TO dmz_space,
`category` TO dmz_category,
`categorymember` TO dmz_category_member,
`role` TO dmz_group,
`rolemember` TO dmz_group_member,
`permission` TO dmz_permission,
`document` TO dmz_doc,
`share` TO dmz_doc_share,
`vote` TO dmz_doc_vote,
`feedback` TO dmz_doc_comment,
`attachment` TO dmz_doc_attachment,
`link` TO dmz_doc_link,
`page` TO dmz_section,
`pagemeta` TO dmz_section_meta,
`block` TO dmz_section_template,
`revision` TO dmz_section_revision,
`user` TO dmz_user,
`account` TO dmz_user_account,
`useractivity` TO dmz_user_activity,
`userconfig` TO dmz_user_config,
`config` TO dmz_config,
`pin` TO dmz_pin,
`search` TO dmz_search,
`userevent` TO dmz_audit_log,
`useraction` TO dmz_action;
-- field renaming
ALTER TABLE dmz_org
CHANGE `refid` `c_refid` VARCHAR(20) NOT NULL,
CHANGE `company` `c_company` VARCHAR(500) NOT NULL,
CHANGE `title` `c_title` VARCHAR(500) NOT NULL,
CHANGE `message` `c_message` VARCHAR(500) NOT NULL,
CHANGE `domain` `c_domain` VARCHAR(200) NOT NULL DEFAULT '',
CHANGE `service` `c_service` VARCHAR(200) NOT NULL DEFAULT '',
CHANGE `email` `c_email` VARCHAR(500) NOT NULL DEFAULT '',
CHANGE `allowanonymousaccess` `c_anonaccess` BOOL NOT NULL DEFAULT 0,
CHANGE `authprovider` `c_authprovider` CHAR(20) NOT NULL DEFAULT 'documize',
CHANGE `authconfig` `c_authconfig` JSON,
CHANGE `maxtags` `c_maxtags` INT NOT NULL DEFAULT 3,
CHANGE `verified` `c_verified` BOOL NOT NULL DEFAULT 0,
CHANGE `serial` `c_serial` VARCHAR(50) NOT NULL DEFAULT '',
CHANGE `active` `c_active` BOOL NOT NULL DEFAULT 1,
CHANGE `created` `c_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
CHANGE `revised` `c_revised` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_space
CHANGE `refid` `c_refid` VARCHAR(20) NOT NULL,
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `userid` `c_userid` VARCHAR(20) NOT NULL DEFAULT '',
CHANGE `type` `c_type` INT NOT NULL DEFAULT 1,
CHANGE `lifecycle` `c_lifecycle` INT NOT NULL DEFAULT 1,
CHANGE `label` `c_name` VARCHAR(300) NOT NULL,
CHANGE `likes` `c_likes` VARCHAR(1000) NOT NULL DEFAULT '',
CHANGE `created` `c_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
CHANGE `revised` `c_revised` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_category
CHANGE `refid` `c_refid` VARCHAR(20) NOT NULL,
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `labelid` `c_spaceid` VARCHAR(20) NOT NULL,
CHANGE `category` `c_name` VARCHAR(50) NOT NULL,
CHANGE `created` `c_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
CHANGE `revised` `c_revised` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_category_member
CHANGE `refid` `c_refid` VARCHAR(20) NOT NULL,
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `labelid` `c_spaceid` VARCHAR(20) NOT NULL,
CHANGE `categoryid` `c_categoryid` VARCHAR(20) NOT NULL,
CHANGE `documentid` `c_docid` VARCHAR(20) NOT NULL,
CHANGE `created` `c_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
CHANGE `revised` `c_revised` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_group
CHANGE `refid` `c_refid` VARCHAR(20) NOT NULL,
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `role` `c_name` VARCHAR(50) NOT NULL DEFAULT '',
CHANGE `purpose` `c_desc` VARCHAR(100) DEFAULT '',
CHANGE `created` `c_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
CHANGE `revised` `c_revised` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_group_member
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `roleid` `c_groupid` VARCHAR(20) NOT NULL,
CHANGE `userid` `c_userid` VARCHAR(20) NOT NULL;
ALTER TABLE dmz_permission
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `who` `c_who` VARCHAR(30) NOT NULL,
CHANGE `whoid` `c_whoid` VARCHAR(20) NOT NULL DEFAULT '',
CHANGE `action` `c_action` VARCHAR(30) NOT NULL,
CHANGE `scope` `c_scope` VARCHAR(30) NOT NULL,
CHANGE `location` `c_location` VARCHAR(100) NOT NULL,
CHANGE `refid` `c_refid` VARCHAR(20) NOT NULL,
CHANGE `created` `c_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_doc
CHANGE `refid` `c_refid` VARCHAR(20) NOT NULL,
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `labelid` `c_spaceid` VARCHAR(20) NOT NULL,
CHANGE `userid` `c_userid` VARCHAR(20) NOT NULL DEFAULT '',
CHANGE `job` `c_job` CHAR(36) NOT NULL DEFAULT '',
CHANGE `location` `c_location` VARCHAR(2000) NOT NULL DEFAULT '',
CHANGE `title` `c_name` VARCHAR(2000) NOT NULL DEFAULT '',
CHANGE `excerpt` `c_desc` VARCHAR(2000) NOT NULL DEFAULT '',
CHANGE `slug` `c_slug` VARCHAR(2000) NOT NULL DEFAULT '',
CHANGE `tags` `c_tags` VARCHAR(1000) NOT NULL DEFAULT '',
CHANGE `template` `c_template` BOOL NOT NULL DEFAULT 0,
CHANGE `protection` `c_protection` INT NOT NULL DEFAULT 0,
CHANGE `approval` `c_approval` INT NOT NULL DEFAULT 0,
CHANGE `lifecycle` `c_lifecycle` INT NOT NULL DEFAULT 1,
CHANGE `versioned` `c_versioned` BOOL NOT NULL DEFAULT 0,
CHANGE `versionid` `c_versionid` VARCHAR(100) NOT NULL DEFAULT '',
CHANGE `versionorder` `c_versionorder` INT NOT NULL DEFAULT 0,
CHANGE `groupid` `c_groupid` VARCHAR(20) NOT NULL DEFAULT '',
CHANGE `created` `c_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
CHANGE `revised` `c_revised` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_doc_share
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `documentid` `c_docid` VARCHAR(20) NOT NULL,
CHANGE `userid` `c_userid` VARCHAR(20) DEFAULT '',
CHANGE `email` `c_email` VARCHAR(250) NOT NULL DEFAULT '',
CHANGE `message` `c_message` VARCHAR(500) NOT NULL DEFAULT '',
CHANGE `viewed` `c_viewed` VARCHAR(500) NOT NULL DEFAULT '',
CHANGE `secret` `c_secret` VARCHAR(250) NOT NULL DEFAULT '',
CHANGE `expires` `c_expires` VARCHAR(20) DEFAULT '',
CHANGE `active` `c_active` BOOL NOT NULL DEFAULT 1,
CHANGE `created` `c_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_doc_vote
CHANGE `refid` `c_refid` VARCHAR(20) NOT NULL,
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `documentid` `c_docid` VARCHAR(20) NOT NULL,
CHANGE `voter` `c_voter` VARCHAR(20) NOT NULL DEFAULT '',
CHANGE `vote` `c_vote` INT NOT NULL DEFAULT 0,
CHANGE `created` `c_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
CHANGE `revised` `c_revised` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_doc_comment
CHANGE `refid` `c_refid` VARCHAR(20) NOT NULL,
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `documentid` `c_docid` VARCHAR(20) NOT NULL,
CHANGE `userid` `c_userid` VARCHAR(20) DEFAULT '',
CHANGE `email` `c_email` VARCHAR(250) NOT NULL DEFAULT '',
CHANGE `feedback` `c_feedback` LONGTEXT,
CHANGE `created` `c_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_doc_attachment
CHANGE `refid` `c_refid` VARCHAR(20) NOT NULL,
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `documentid` `c_docid` VARCHAR(20) NOT NULL,
CHANGE `job` `c_job` CHAR(36) NOT NULL,
CHANGE `fileid` `c_fileid` CHAR(10) NOT NULL,
CHANGE `filename` `c_filename` VARCHAR(255) NOT NULL,
CHANGE `data` `c_data` LONGBLOB,
CHANGE `extension` `c_extension` CHAR(6) NOT NULL,
CHANGE `created` `c_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CHANGE `revised` `c_revised` TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_doc_link
CHANGE `refid` `c_refid` VARCHAR(20) NOT NULL,
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `folderid` `c_spaceid` VARCHAR(20) NOT NULL,
CHANGE `userid` `c_userid` VARCHAR(20) NOT NULL,
CHANGE `sourcedocumentid` `c_sourcedocid` VARCHAR(20) NOT NULL,
CHANGE `sourcepageid` `c_sourcesectionid` VARCHAR(20) NOT NULL,
CHANGE `linktype` `c_type` VARCHAR(20) NOT NULL,
CHANGE `targetdocumentid` `c_targetdocid` VARCHAR(20) NOT NULL,
CHANGE `targetid` `c_targetid` VARCHAR(20) NOT NULL DEFAULT '',
CHANGE `externalid` `c_externalid` VARCHAR(1000) NOT NULL DEFAULT '',
CHANGE `orphan` `c_orphan` BOOL NOT NULL DEFAULT 0,
CHANGE `created` `c_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CHANGE `revised` `c_revised` TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_section
CHANGE `refid` `c_refid` VARCHAR(20) NOT NULL,
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `documentid` `c_docid` VARCHAR(20) NOT NULL,
CHANGE `userid` `c_userid` VARCHAR(20) NOT NULL DEFAULT '',
CHANGE `pagetype` `c_type` CHAR(10) NOT NULL DEFAULT 'section',
CHANGE `contenttype` `c_contenttype` CHAR(20) NOT NULL DEFAULT 'wysiwyg',
CHANGE `blockid` `c_templateid` VARCHAR(20) NOT NULL DEFAULT '',
CHANGE `level` `c_level` INT UNSIGNED NOT NULL,
CHANGE `sequence` `c_sequence` DOUBLE NOT NULL,
CHANGE `title` `c_name` VARCHAR(2000) NOT NULL DEFAULT '',
CHANGE `body` `c_body` LONGTEXT,
CHANGE `revisions` `c_revisions` INT UNSIGNED NOT NULL,
CHANGE `status` `c_status` INT NOT NULL DEFAULT 0,
CHANGE `relativeid` `c_relativeid` VARCHAR(20) NOT NULL DEFAULT '',
CHANGE `created` `c_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CHANGE `revised` `c_revised` TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_section_meta
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `documentid` `c_docid` VARCHAR(20) NOT NULL,
CHANGE `userid` `c_userid` VARCHAR(20) NOT NULL DEFAULT '',
CHANGE `pageid` `c_sectionid` VARCHAR(20) NOT NULL,
CHANGE `rawbody` `c_rawbody` LONGBLOB,
CHANGE `config` `c_config` JSON,
CHANGE `externalsource` `c_external` BOOL DEFAULT 0,
CHANGE `created` `c_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CHANGE `revised` `c_revised` TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_section_template
CHANGE `refid` `c_refid` VARCHAR(20) NOT NULL,
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `labelid` `c_spaceid` VARCHAR(20) DEFAULT '',
CHANGE `userid` `c_userid` VARCHAR(20) DEFAULT '',
CHANGE `pagetype` `c_type` CHAR(10) NOT NULL DEFAULT 'section',
CHANGE `contenttype` `c_contenttype` CHAR(20) NOT NULL DEFAULT 'wysiwyg',
CHANGE `title` `c_name` VARCHAR(2000) NOT NULL DEFAULT '',
CHANGE `body` `c_body` LONGTEXT,
CHANGE `excerpt` `c_desc` VARCHAR(2000) NOT NULL DEFAULT '',
CHANGE `used` `c_used` INT UNSIGNED NOT NULL,
CHANGE `rawbody` `c_rawbody` LONGBLOB,
CHANGE `config` `c_config` JSON,
CHANGE `externalsource` `c_external` BOOL DEFAULT 0,
CHANGE `created` `c_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CHANGE `revised` `c_revised` TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_section_revision
CHANGE `refid` `c_refid` VARCHAR(20) NOT NULL,
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `documentid` `c_docid` VARCHAR(20) NOT NULL,
CHANGE `ownerid` `c_ownerid` VARCHAR(20) DEFAULT '',
CHANGE `pageid` `c_sectionid` VARCHAR(20) NOT NULL,
CHANGE `userid` `c_userid` VARCHAR(20) NOT NULL,
CHANGE `pagetype` `c_type` CHAR(10) NOT NULL DEFAULT 'section',
CHANGE `contenttype` `c_contenttype` CHAR(20) NOT NULL DEFAULT 'wysiwyg',
CHANGE `title` `c_name` VARCHAR(2000) NOT NULL DEFAULT '',
CHANGE `body` `c_body` LONGTEXT,
CHANGE `rawbody` `c_rawbody` LONGBLOB,
CHANGE `config` `c_config` JSON,
CHANGE `created` `c_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CHANGE `revised` `c_revised` TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_user
CHANGE `refid` `c_refid` VARCHAR(20) NOT NULL,
CHANGE `firstname` `c_firstname` VARCHAR(500) NOT NULL DEFAULT '',
CHANGE `lastname` `c_lastname` VARCHAR(500) NOT NULL DEFAULT '',
CHANGE `email` `c_email` VARCHAR(500) NOT NULL DEFAULT '',
CHANGE `initials` `c_initials` VARCHAR(20) NOT NULL DEFAULT '',
CHANGE `global` `c_globaladmin` BOOL NOT NULL DEFAULT 0,
CHANGE `password` `c_password` VARCHAR(500) NOT NULL DEFAULT '',
CHANGE `salt` `c_salt` VARCHAR(500) NOT NULL DEFAULT '',
CHANGE `reset` `c_reset` VARCHAR(500) NOT NULL DEFAULT '',
CHANGE `active` `c_active` BOOL NOT NULL DEFAULT 1,
CHANGE `lastversion` `c_lastversion` VARCHAR(20) NOT NULL DEFAULT '',
CHANGE `created` `c_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CHANGE `revised` `c_revised` TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_user_account
CHANGE `refid` `c_refid` VARCHAR(20) NOT NULL,
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `userid` `c_userid` VARCHAR(20) NOT NULL,
CHANGE `editor` `c_editor` BOOL NOT NULL DEFAULT 0,
CHANGE `admin` `c_admin` BOOL NOT NULL DEFAULT 0,
CHANGE `users` `c_users` BOOL NOT NULL DEFAULT 1,
CHANGE `analytics` `c_analytics` BOOL NOT NULL DEFAULT 0,
CHANGE `active` `c_active` BOOL NOT NULL DEFAULT 1,
CHANGE `created` `c_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CHANGE `revised` `c_revised` TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_user_activity
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `userid` `c_userid` VARCHAR(20) NOT NULL,
CHANGE `labelid` `c_spaceid` VARCHAR(20) NOT NULL,
CHANGE `documentid` `c_docid` VARCHAR(20) NOT NULL DEFAULT '',
CHANGE `pageid` `c_sectionid` VARCHAR(20) NOT NULL DEFAULT '',
CHANGE `sourcetype` `c_sourcetype` INT NOT NULL DEFAULT 0,
CHANGE `activitytype` `c_activitytype` INT NOT NULL DEFAULT 0,
CHANGE `metadata` `c_metadata` VARCHAR(1000) NOT NULL DEFAULT '',
CHANGE `created` `c_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_user_config
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `userid` `c_userid` VARCHAR(20) NOT NULL,
CHANGE `key` `c_key` CHAR(200) NOT NULL,
CHANGE `config` `c_config` JSON;
ALTER TABLE dmz_config
CHANGE `key` `c_key` CHAR(200) NOT NULL,
CHANGE `config` `c_config` JSON;
ALTER TABLE dmz_pin
CHANGE `refid` `c_refid` VARCHAR(20) NOT NULL,
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `userid` `c_userid` VARCHAR(20) DEFAULT '',
CHANGE `labelid` `c_spaceid` VARCHAR(20) DEFAULT '',
CHANGE `documentid` `c_docid` VARCHAR(20) DEFAULT '',
CHANGE `sequence` `c_sequence` INT UNSIGNED NOT NULL DEFAULT 99,
CHANGE `pin` `c_name` CHAR(100) NOT NULL DEFAULT '',
CHANGE `created` `c_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CHANGE `revised` `c_revised` TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_search
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `documentid` `c_docid` VARCHAR(20) NOT NULL,
CHANGE `itemid` `c_itemid` VARCHAR(20) NOT NULL DEFAULT '',
CHANGE `itemtype` `c_itemtype` VARCHAR(10) NOT NULL,
CHANGE `content` `c_content` LONGTEXT,
CHANGE `created` `c_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_audit_log
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `userid` `c_userid` VARCHAR(20) NOT NULL,
CHANGE `eventtype` `c_eventtype` VARCHAR(100) NOT NULL DEFAULT '',
CHANGE `ip` `c_ip` VARCHAR(39) NOT NULL DEFAULT '',
CHANGE `created` `c_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE dmz_action
CHANGE `refid` `c_refid` VARCHAR(20) NOT NULL,
CHANGE `orgid` `c_orgid` VARCHAR(20) NOT NULL,
CHANGE `documentid` `c_docid` VARCHAR(20) NOT NULL,
CHANGE `userid` `c_userid` VARCHAR(20) NOT NULL,
CHANGE `requestorid` `c_requestorid` VARCHAR(20) NOT NULL,
CHANGE `actiontype` `c_actiontype` INT NOT NULL DEFAULT 0,
CHANGE `note` `c_note` VARCHAR(2000) NOT NULL DEFAULT '',
CHANGE `requested` `c_requested` TIMESTAMP NULL,
CHANGE `due` `c_due` TIMESTAMP NULL,
CHANGE `completed` `c_completed` TIMESTAMP NULL,
CHANGE `iscomplete` `c_iscomplete` BOOL NOT NULL DEFAULT 0,
CHANGE `reftype` `c_reftype` CHAR(1) NOT NULL DEFAULT 'D',
CHANGE `reftypeid` `c_reftypeid` VARCHAR(20) NOT NULL,
CHANGE `created` `c_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CHANGE `revised` `c_revised` TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
-- deprecations
DROP TABLE IF EXISTS `participant`;

View file

@ -0,0 +1,6 @@
/* community edition */
-- add subscription
ALTER TABLE dmz_org ADD COLUMN `c_sub` JSON NULL AFTER `c_authconfig`;
-- deprecations

View file

@ -0,0 +1,37 @@
/* Community Edition */
-- Space labels provide name/color grouping
DROP TABLE IF EXISTS `dmz_space_label`;
CREATE TABLE IF NOT EXISTS `dmz_space_label` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`c_refid` VARCHAR(20) NOT NULL COLLATE utf8_bin,
`c_orgid` VARCHAR(20) NOT NULL COLLATE utf8_bin,
`c_name` VARCHAR(50) NOT NULL DEFAULT '',
`c_color` VARCHAR(10) NOT NULL DEFAULT '',
`c_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`c_revised` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
UNIQUE INDEX `idx_space_label_1` (`id` ASC),
INDEX `idx_space_label_2` (`c_refid` ASC),
INDEX `idx_space_label_3` (`c_orgid` ASC))
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
ENGINE = InnoDB;
-- Space table upgrade to support labelling, icon and summary stats
ALTER TABLE dmz_space ADD COLUMN `c_desc` VARCHAR(200) NOT NULL DEFAULT '' AFTER `c_name`;
ALTER TABLE dmz_space ADD COLUMN `c_labelid` VARCHAR(20) NOT NULL DEFAULT '' COLLATE utf8_bin AFTER `c_likes`;
ALTER TABLE dmz_space ADD COLUMN `c_icon` VARCHAR(20) NOT NULL DEFAULT '' AFTER `c_labelid`;
ALTER TABLE dmz_space ADD COLUMN `c_count_category` INT NOT NULL DEFAULT 0 AFTER `c_icon`;
ALTER TABLE dmz_space ADD COLUMN `c_count_content` INT NOT NULL DEFAULT 0 AFTER `c_count_category`;
-- Org/tenant upgrade to support theming and custom logo
ALTER TABLE dmz_org ADD COLUMN `c_theme` VARCHAR(20) NOT NULL DEFAULT '' AFTER `c_maxtags`;
ALTER TABLE dmz_org ADD COLUMN `c_logo` LONGBLOB AFTER `c_theme`;
-- Populate default values for new fields
UPDATE dmz_space s SET c_count_category=(SELECT COUNT(*) FROM dmz_category WHERE c_spaceid=s.c_refid);
UPDATE dmz_space s SET c_count_content=(SELECT COUNT(*) FROM dmz_doc WHERE c_spaceid=s.c_refid);
-- BUGFIX: Remove zombie group membership records
DELETE FROM dmz_group_member WHERE c_userid NOT IN (SELECT c_userid FROM dmz_user_account);
-- Deprecations

View file

@ -0,0 +1,6 @@
/* Community Edition */
-- BUGFIX: Increase column size
ALTER TABLE dmz_space MODIFY `c_icon` VARCHAR(50) NOT NULL DEFAULT '';
-- Deprecations

View file

@ -0,0 +1,4 @@
/* Community Edition */
-- Support per section attachments
ALTER TABLE dmz_doc_attachment ADD COLUMN `c_sectionid` VARCHAR(20) NOT NULL DEFAULT '' COLLATE utf8_bin AFTER `c_docid`;

View file

@ -0,0 +1,5 @@
/* Enterprise edition */
-- Feedback feature: support threaded comments and section references
ALTER TABLE dmz_doc_comment ADD COLUMN `c_replyto` VARCHAR(20) NOT NULL DEFAULT '' COLLATE utf8_bin AFTER `c_docid`;
ALTER TABLE dmz_doc_comment ADD COLUMN `c_sectionid` VARCHAR(20) NOT NULL DEFAULT '' COLLATE utf8_bin AFTER `c_docid`;

View file

@ -0,0 +1,5 @@
/* Community edition */
-- Indexes to improve performance
CREATE UNIQUE INDEX idx_doc_4 ON dmz_doc(c_orgid,c_refid);
CREATE UNIQUE INDEX idx_section_4 ON dmz_section(c_orgid,c_refid);

View file

@ -0,0 +1,7 @@
/* Community Edition */
-- Increase column sizes to support rich text data entry
ALTER TABLE dmz_org MODIFY `c_message` VARCHAR(800) NOT NULL DEFAULT '';
ALTER TABLE dmz_space MODIFY `c_desc` VARCHAR(800) NOT NULL DEFAULT '';
ALTER TABLE dmz_category MODIFY `c_name` VARCHAR(200) NOT NULL DEFAULT '';
ALTER TABLE dmz_category ADD COLUMN `c_default` BOOL NOT NULL DEFAULT 0 AFTER `c_name`;

View file

@ -0,0 +1,4 @@
/* Community Edition */
-- Allow for pinned documents per space.
ALTER TABLE dmz_doc ADD COLUMN `c_seq` INT NOT NULL DEFAULT 99999 AFTER `c_versionorder`;

View file

@ -0,0 +1,5 @@
/* Community Edition */
-- Local aware.
ALTER TABLE dmz_org ADD COLUMN `c_locale` VARCHAR(20) NOT NULL DEFAULT 'en-US';
ALTER TABLE dmz_user ADD COLUMN `c_locale` VARCHAR(20) NOT NULL DEFAULT 'en-US';

View file

@ -0,0 +1,479 @@
-- SQL to set up the Documize database
-- select * from information_schema.tables WHERE table_catalog='documize';
-- http://www.postgresqltutorial.com/postgresql-json/
-- https://en.wikibooks.org/wiki/Converting_MySQL_to_PostgreSQL
DROP TABLE IF EXISTS dmz_action;
CREATE TABLE dmz_action (
id bigserial NOT NULL,
c_refid varchar(20) COLLATE ucs_basic NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_userid varchar(20) COLLATE ucs_basic NOT NULL,
c_docid varchar(20) COLLATE ucs_basic NOT NULL,
c_requestorid varchar(20) COLLATE ucs_basic NOT NULL,
c_actiontype int NOT NULL DEFAULT '0',
c_note varchar(2000) COLLATE ucs_basic NOT NULL DEFAULT '',
c_requested timestamp NULL DEFAULT NULL,
c_due timestamp NULL DEFAULT NULL,
c_completed timestamp NULL DEFAULT NULL,
c_iscomplete bool NOT NULL DEFAULT '0',
c_reftype varchar(1) COLLATE ucs_basic NOT NULL DEFAULT 'D',
c_reftypeid varchar(20) COLLATE ucs_basic NOT NULL,
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
CREATE INDEX idx_action_1 ON dmz_action (c_refid);
CREATE INDEX idx_action_2 ON dmz_action (c_userid);
CREATE INDEX idx_action_3 ON dmz_action (c_docid);
CREATE INDEX idx_action_4 ON dmz_action (c_requestorid);
DROP TABLE IF EXISTS dmz_audit_log;
CREATE TABLE dmz_audit_log (
id bigserial NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_userid varchar(20) COLLATE ucs_basic NOT NULL,
c_eventtype varchar(100) COLLATE ucs_basic NOT NULL DEFAULT '',
c_ip varchar(39) COLLATE ucs_basic NOT NULL DEFAULT '',
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
CREATE INDEX idx_audit_log_1 ON dmz_audit_log (c_orgid);
CREATE INDEX idx_audit_log_2 ON dmz_audit_log (c_userid);
CREATE INDEX idx_audit_log_3 ON dmz_audit_log (c_eventtype);
DROP TABLE IF EXISTS dmz_category;
CREATE TABLE dmz_category (
id bigserial NOT NULL,
c_refid varchar(20) COLLATE ucs_basic NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_spaceid varchar(20) COLLATE ucs_basic NOT NULL,
c_name varchar(50) COLLATE ucs_basic NOT NULL,
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE (id)
);
CREATE INDEX idx_category_1 ON dmz_category (c_refid);
CREATE INDEX idx_category_2 ON dmz_category (c_orgid);
CREATE INDEX idx_category_3 ON dmz_category (c_orgid,c_spaceid);
DROP TABLE IF EXISTS dmz_category_member;
CREATE TABLE dmz_category_member (
id bigserial NOT NULL,
c_refid varchar(20) COLLATE ucs_basic NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_spaceid varchar(20) COLLATE ucs_basic NOT NULL,
c_categoryid varchar(20) COLLATE ucs_basic NOT NULL,
c_docid varchar(20) COLLATE ucs_basic NOT NULL,
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE (id)
);
CREATE INDEX idx_category_member_1 ON dmz_category_member (c_docid);
CREATE INDEX idx_category_member_2 ON dmz_category_member (c_orgid,c_docid);
CREATE INDEX idx_category_member_3 ON dmz_category_member (c_orgid,c_spaceid);
DROP TABLE IF EXISTS dmz_config;
CREATE TABLE dmz_config (
c_key varchar(200) COLLATE ucs_basic NOT NULL,
c_config json DEFAULT NULL,
UNIQUE (c_key)
);
DROP TABLE IF EXISTS dmz_doc;
CREATE TABLE dmz_doc (
id bigserial NOT NULL,
c_refid varchar(20) COLLATE ucs_basic NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_spaceid varchar(20) COLLATE ucs_basic NOT NULL,
c_userid varchar(20) COLLATE ucs_basic NOT NULL DEFAULT '',
c_job varchar(36) COLLATE ucs_basic NOT NULL DEFAULT '',
c_location varchar(2000) COLLATE ucs_basic NOT NULL DEFAULT '',
c_name varchar(2000) COLLATE ucs_basic NOT NULL DEFAULT '',
c_desc varchar(2000) COLLATE ucs_basic NOT NULL DEFAULT '',
c_slug varchar(2000) COLLATE ucs_basic NOT NULL DEFAULT '',
c_tags varchar(1000) COLLATE ucs_basic NOT NULL DEFAULT '',
c_template bool NOT NULL DEFAULT '0',
c_protection int NOT NULL DEFAULT '0',
c_approval int NOT NULL DEFAULT '0',
c_lifecycle int NOT NULL DEFAULT '1',
c_versioned bool NOT NULL DEFAULT '0',
c_versionid varchar(100) COLLATE ucs_basic NOT NULL DEFAULT '',
c_versionorder int NOT NULL DEFAULT '0',
c_groupid varchar(20) COLLATE ucs_basic NOT NULL DEFAULT '',
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (c_refid)
);
CREATE INDEX idx_doc_1 ON dmz_doc (id);
CREATE INDEX idx_doc_2 ON dmz_doc (c_orgid);
CREATE INDEX idx_doc_3 ON dmz_doc (c_spaceid);
DROP TABLE IF EXISTS dmz_doc_attachment;
CREATE TABLE dmz_doc_attachment (
id bigserial NOT NULL,
c_refid varchar(20) COLLATE ucs_basic NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_docid varchar(20) COLLATE ucs_basic NOT NULL,
c_job varchar(36) COLLATE ucs_basic NOT NULL,
c_fileid varchar(10) COLLATE ucs_basic NOT NULL,
c_filename varchar(255) COLLATE ucs_basic NOT NULL,
c_data BYTEA,
c_extension varchar(6) COLLATE ucs_basic NOT NULL,
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (c_refid)
);
CREATE INDEX idx_doc_attachment_1 ON dmz_doc_attachment (id);
CREATE INDEX idx_doc_attachment_2 ON dmz_doc_attachment (c_orgid);
CREATE INDEX idx_doc_attachment_3 ON dmz_doc_attachment (c_docid);
CREATE INDEX idx_doc_attachment_4 ON dmz_doc_attachment (c_job,c_fileid);
DROP TABLE IF EXISTS dmz_doc_comment;
CREATE TABLE dmz_doc_comment (
id bigserial NOT NULL,
c_refid varchar(20) COLLATE ucs_basic NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_docid varchar(20) COLLATE ucs_basic NOT NULL,
c_userid varchar(20) COLLATE ucs_basic DEFAULT '',
c_email varchar(250) COLLATE ucs_basic NOT NULL DEFAULT '',
c_feedback text COLLATE ucs_basic,
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
CREATE INDEX idx_doc_comment_1 ON dmz_doc_comment (c_refid);
DROP TABLE IF EXISTS dmz_doc_link;
CREATE TABLE dmz_doc_link (
id bigserial NOT NULL,
c_refid varchar(20) COLLATE ucs_basic NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_spaceid varchar(20) COLLATE ucs_basic NOT NULL,
c_userid varchar(20) COLLATE ucs_basic NOT NULL,
c_sourcedocid varchar(20) COLLATE ucs_basic NOT NULL,
c_sourcesectionid varchar(20) COLLATE ucs_basic NOT NULL,
c_type varchar(20) COLLATE ucs_basic NOT NULL,
c_targetdocid varchar(20) COLLATE ucs_basic NOT NULL,
c_targetid varchar(20) COLLATE ucs_basic NOT NULL DEFAULT '',
c_externalid varchar(1000) COLLATE ucs_basic NOT NULL DEFAULT '',
c_orphan bool NOT NULL DEFAULT '0',
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS dmz_doc_share;
CREATE TABLE dmz_doc_share (
id bigserial NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_docid varchar(20) COLLATE ucs_basic NOT NULL,
c_userid varchar(20) COLLATE ucs_basic DEFAULT '',
c_email varchar(250) COLLATE ucs_basic NOT NULL DEFAULT '',
c_message varchar(500) COLLATE ucs_basic NOT NULL DEFAULT '',
c_viewed varchar(500) COLLATE ucs_basic NOT NULL DEFAULT '',
c_secret varchar(250) COLLATE ucs_basic NOT NULL DEFAULT '',
c_expires varchar(20) COLLATE ucs_basic DEFAULT '',
c_active bool NOT NULL DEFAULT '1',
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS dmz_doc_vote;
CREATE TABLE dmz_doc_vote (
id bigserial NOT NULL,
c_refid varchar(20) COLLATE ucs_basic NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_docid varchar(20) COLLATE ucs_basic NOT NULL,
c_voter varchar(20) COLLATE ucs_basic NOT NULL DEFAULT '',
c_vote int NOT NULL DEFAULT '0',
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE (id)
);
CREATE INDEX idx_doc_vote_1 ON dmz_doc_vote (c_refid);
CREATE INDEX idx_doc_vote_2 ON dmz_doc_vote (c_docid);
CREATE INDEX idx_doc_vote_3 ON dmz_doc_vote (c_orgid);
CREATE INDEX idx_doc_vote_4 ON dmz_doc_vote (c_orgid,c_docid);
DROP TABLE IF EXISTS dmz_group;
CREATE TABLE dmz_group (
id bigserial NOT NULL,
c_refid varchar(20) COLLATE ucs_basic NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_name varchar(50) COLLATE ucs_basic NOT NULL DEFAULT '',
c_desc varchar(100) COLLATE ucs_basic DEFAULT '',
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE (id)
);
CREATE INDEX idx_group_1 ON dmz_group (c_refid);
CREATE INDEX idx_group_2 ON dmz_group (c_orgid);
DROP TABLE IF EXISTS dmz_group_member;
CREATE TABLE dmz_group_member (
id bigserial NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_groupid varchar(20) COLLATE ucs_basic NOT NULL,
c_userid varchar(20) COLLATE ucs_basic NOT NULL,
UNIQUE (id)
);
CREATE INDEX idx_group_member_1 ON dmz_group_member (c_groupid,c_userid);
CREATE INDEX idx_group_member_2 ON dmz_group_member (c_orgid,c_groupid,c_userid);
DROP TABLE IF EXISTS dmz_org;
CREATE TABLE dmz_org (
id bigserial NOT NULL,
c_refid varchar(20) COLLATE ucs_basic NOT NULL,
c_company varchar(500) COLLATE ucs_basic NOT NULL,
c_title varchar(500) COLLATE ucs_basic NOT NULL,
c_message varchar(500) COLLATE ucs_basic NOT NULL,
c_domain varchar(200) COLLATE ucs_basic NOT NULL DEFAULT '',
c_service varchar(200) COLLATE ucs_basic NOT NULL DEFAULT '',
c_email varchar(500) COLLATE ucs_basic NOT NULL DEFAULT '',
c_anonaccess bool NOT NULL DEFAULT '0',
c_authprovider varchar(20) COLLATE ucs_basic NOT NULL DEFAULT 'documize',
c_authconfig json DEFAULT NULL,
c_maxtags int NOT NULL DEFAULT '3',
c_verified bool NOT NULL DEFAULT '0',
c_serial varchar(50) COLLATE ucs_basic NOT NULL DEFAULT '',
c_active bool NOT NULL DEFAULT '1',
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (c_refid)
);
CREATE INDEX idx_org_1 ON dmz_org (id);
CREATE INDEX idx_org_2 ON dmz_org (c_domain);
DROP TABLE IF EXISTS dmz_permission;
CREATE TABLE dmz_permission (
id bigserial NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_who varchar(30) COLLATE ucs_basic NOT NULL,
c_whoid varchar(20) COLLATE ucs_basic NOT NULL DEFAULT '',
c_action varchar(30) COLLATE ucs_basic NOT NULL,
c_scope varchar(30) COLLATE ucs_basic NOT NULL,
c_location varchar(100) COLLATE ucs_basic NOT NULL,
c_refid varchar(20) COLLATE ucs_basic NOT NULL,
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE (id)
);
CREATE INDEX idx_permission_1 ON dmz_permission (c_orgid);
CREATE INDEX idx_permission_2 ON dmz_permission (c_orgid,c_who,c_whoid,c_location);
CREATE INDEX idx_permission_3 ON dmz_permission (c_orgid,c_who,c_whoid,c_location,c_action);
CREATE INDEX idx_permission_4 ON dmz_permission (c_orgid,c_location,c_refid);
CREATE INDEX idx_permission_5 ON dmz_permission (c_orgid,c_who,c_location,c_action);
DROP TABLE IF EXISTS dmz_pin;
CREATE TABLE dmz_pin (
id bigserial NOT NULL,
c_refid varchar(20) COLLATE ucs_basic NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_userid varchar(20) COLLATE ucs_basic DEFAULT '',
c_spaceid varchar(20) COLLATE ucs_basic DEFAULT '',
c_docid varchar(20) COLLATE ucs_basic DEFAULT '',
c_sequence BIGINT NOT NULL DEFAULT '99',
c_name varchar(100) COLLATE ucs_basic NOT NULL DEFAULT '',
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
CREATE INDEX idx_pin_1 ON dmz_pin (c_userid);
DROP TABLE IF EXISTS dmz_search;
CREATE TABLE dmz_search (
id bigserial NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_docid varchar(20) COLLATE ucs_basic NOT NULL,
c_itemid varchar(20) COLLATE ucs_basic NOT NULL DEFAULT '',
c_itemtype varchar(10) COLLATE ucs_basic NOT NULL,
c_content text COLLATE ucs_basic,
c_token TSVECTOR,
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE (id)
);
CREATE INDEX idx_search_1 ON dmz_search (c_orgid);
CREATE INDEX idx_search_2 ON dmz_search (c_docid);
CREATE INDEX idx_search_3 ON dmz_search USING GIN(c_token);
DROP TABLE IF EXISTS dmz_section;
CREATE TABLE dmz_section (
id bigserial NOT NULL,
c_refid varchar(20) COLLATE ucs_basic NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_docid varchar(20) COLLATE ucs_basic NOT NULL,
c_userid varchar(20) COLLATE ucs_basic NOT NULL DEFAULT '',
c_contenttype varchar(20) COLLATE ucs_basic NOT NULL DEFAULT 'wysiwyg',
c_type varchar(10) COLLATE ucs_basic NOT NULL DEFAULT 'section',
c_templateid varchar(20) COLLATE ucs_basic NOT NULL DEFAULT '',
c_level bigint NOT NULL,
c_sequence double precision NOT NULL,
c_name varchar(2000) COLLATE ucs_basic NOT NULL DEFAULT '',
c_body text COLLATE ucs_basic,
c_revisions bigint NOT NULL,
c_status int NOT NULL DEFAULT '0',
c_relativeid varchar(20) COLLATE ucs_basic NOT NULL DEFAULT '',
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (c_refid)
);
CREATE INDEX idx_section_1 ON dmz_section (id);
CREATE INDEX idx_section_2 ON dmz_section (c_orgid);
CREATE INDEX idx_section_3 ON dmz_section (c_docid);
DROP TABLE IF EXISTS dmz_section_meta;
CREATE TABLE dmz_section_meta (
id bigserial NOT NULL,
c_sectionid varchar(20) COLLATE ucs_basic NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_userid varchar(20) COLLATE ucs_basic NOT NULL DEFAULT '',
c_docid varchar(20) COLLATE ucs_basic NOT NULL,
c_rawbody BYTEA,
c_config json DEFAULT NULL,
c_external bool DEFAULT '0',
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (c_sectionid)
);
CREATE INDEX idx_section_meta_1 ON dmz_section_meta (id);
CREATE INDEX idx_section_meta_2 ON dmz_section_meta (c_sectionid);
CREATE INDEX idx_section_meta_3 ON dmz_section_meta (c_orgid);
CREATE INDEX idx_section_meta_4 ON dmz_section_meta (c_docid);
DROP TABLE IF EXISTS dmz_section_revision;
CREATE TABLE dmz_section_revision (
id bigserial NOT NULL,
c_refid varchar(20) COLLATE ucs_basic NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_docid varchar(20) COLLATE ucs_basic NOT NULL,
c_ownerid varchar(20) COLLATE ucs_basic DEFAULT '',
c_sectionid varchar(20) COLLATE ucs_basic NOT NULL,
c_userid varchar(20) COLLATE ucs_basic NOT NULL,
c_contenttype varchar(20) COLLATE ucs_basic NOT NULL DEFAULT 'wysiwyg',
c_type varchar(10) COLLATE ucs_basic NOT NULL DEFAULT 'section',
c_name varchar(2000) COLLATE ucs_basic NOT NULL DEFAULT '',
c_body text COLLATE ucs_basic,
c_rawbody BYTEA,
c_config json DEFAULT NULL,
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (c_refid)
);
CREATE INDEX idx_section_revision_1 ON dmz_section_revision (id);
CREATE INDEX idx_section_revision_2 ON dmz_section_revision (c_orgid);
CREATE INDEX idx_section_revision_3 ON dmz_section_revision (c_docid);
CREATE INDEX idx_section_revision_4 ON dmz_section_revision (c_sectionid);
DROP TABLE IF EXISTS dmz_section_template;
CREATE TABLE dmz_section_template (
id bigserial NOT NULL,
c_refid varchar(20) COLLATE ucs_basic NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_spaceid varchar(20) COLLATE ucs_basic DEFAULT '',
c_userid varchar(20) COLLATE ucs_basic DEFAULT '',
c_contenttype varchar(20) COLLATE ucs_basic NOT NULL DEFAULT 'wysiwyg',
c_type varchar(10) COLLATE ucs_basic NOT NULL DEFAULT 'section',
c_name varchar(2000) COLLATE ucs_basic NOT NULL DEFAULT '',
c_body text COLLATE ucs_basic,
c_desc varchar(2000) COLLATE ucs_basic NOT NULL DEFAULT '',
c_used bigint NOT NULL,
c_rawbody BYTEA,
c_config json DEFAULT NULL,
c_external bool DEFAULT '0',
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
CREATE INDEX idx_section_template_1 ON dmz_section_template (c_refid);
CREATE INDEX idx_section_template_2 ON dmz_section_template (c_spaceid);
DROP TABLE IF EXISTS dmz_space;
CREATE TABLE dmz_space (
id bigserial NOT NULL,
c_refid varchar(20) COLLATE ucs_basic NOT NULL,
c_name varchar(300) COLLATE ucs_basic NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_userid varchar(20) COLLATE ucs_basic NOT NULL DEFAULT '',
c_type int NOT NULL DEFAULT '1',
c_lifecycle int NOT NULL DEFAULT '1',
c_likes varchar(1000) COLLATE ucs_basic NOT NULL DEFAULT '',
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (c_refid)
);
CREATE INDEX idx_space_1 ON dmz_space (id);
CREATE INDEX idx_space_2 ON dmz_space (c_userid);
CREATE INDEX idx_space_3 ON dmz_space (c_orgid);
DROP TABLE IF EXISTS dmz_user;
CREATE TABLE dmz_user (
id bigserial NOT NULL,
c_refid varchar(20) COLLATE ucs_basic NOT NULL,
c_firstname varchar(500) COLLATE ucs_basic NOT NULL DEFAULT '',
c_lastname varchar(500) COLLATE ucs_basic NOT NULL DEFAULT '',
c_email varchar(500) COLLATE ucs_basic NOT NULL DEFAULT '',
c_initials varchar(20) COLLATE ucs_basic NOT NULL DEFAULT '',
c_globaladmin bool NOT NULL DEFAULT '0',
c_password varchar(500) COLLATE ucs_basic NOT NULL DEFAULT '',
c_salt varchar(500) COLLATE ucs_basic NOT NULL DEFAULT '',
c_reset varchar(500) COLLATE ucs_basic NOT NULL DEFAULT '',
c_active bool NOT NULL DEFAULT '1',
c_lastversion varchar(20) COLLATE ucs_basic NOT NULL DEFAULT '',
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (c_refid)
);
CREATE INDEX idx_user_1 ON dmz_user (id);
CREATE INDEX idx_user_2 ON dmz_user (c_email);
DROP TABLE IF EXISTS dmz_user_account;
CREATE TABLE dmz_user_account (
id bigserial NOT NULL,
c_refid varchar(20) COLLATE ucs_basic NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_userid varchar(20) COLLATE ucs_basic NOT NULL,
c_editor bool NOT NULL DEFAULT '0',
c_admin bool NOT NULL DEFAULT '0',
c_users bool NOT NULL DEFAULT '1',
c_analytics bool NOT NULL DEFAULT '0',
c_active bool NOT NULL DEFAULT '1',
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (c_refid)
);
CREATE INDEX idx_user_account_1 ON dmz_user_account (id);
CREATE INDEX idx_user_account_2 ON dmz_user_account (c_userid);
CREATE INDEX idx_user_account_3 ON dmz_user_account (c_orgid);
DROP TABLE IF EXISTS dmz_user_activity;
CREATE TABLE dmz_user_activity (
id bigserial NOT NULL,
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_userid varchar(20) COLLATE ucs_basic NOT NULL,
c_spaceid varchar(20) COLLATE ucs_basic NOT NULL,
c_docid varchar(20) COLLATE ucs_basic NOT NULL DEFAULT '',
c_sectionid varchar(20) COLLATE ucs_basic NOT NULL DEFAULT '',
c_sourcetype int NOT NULL DEFAULT '0',
c_activitytype int NOT NULL DEFAULT '0',
c_metadata varchar(1000) COLLATE ucs_basic NOT NULL DEFAULT '',
c_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
CREATE INDEX idx_user_activity_1 ON dmz_user_activity (c_orgid);
CREATE INDEX idx_user_activity_2 ON dmz_user_activity (c_userid);
CREATE INDEX idx_user_activity_3 ON dmz_user_activity (c_activitytype);
CREATE INDEX idx_user_activity_4 ON dmz_user_activity (c_orgid,c_docid,c_sourcetype);
CREATE INDEX idx_user_activity_5 ON dmz_user_activity (c_orgid,c_docid,c_userid,c_sourcetype);
DROP TABLE IF EXISTS dmz_user_config;
CREATE TABLE dmz_user_config (
c_orgid varchar(20) COLLATE ucs_basic NOT NULL,
c_userid varchar(20) COLLATE ucs_basic NOT NULL,
c_key varchar(200) COLLATE ucs_basic NOT NULL,
c_config json DEFAULT NULL,
UNIQUE (c_orgid,c_userid,c_key)
);
INSERT INTO dmz_config VALUES ('SMTP','{"userid": "","password": "","host": "","port": "","sender": ""}');
INSERT INTO dmz_config VALUES ('FILEPLUGINS', '[{"Comment": "Disable (or not) built-in html import (NOTE: no Plugin name)","Disabled": false,"API": "Convert","Actions": ["htm","html"]},{"Comment": "Disable (or not) built-in Documize API import used from SDK (NOTE: no Plugin name)","Disabled": false,"API": "Convert","Actions": ["documizeapi"]}]');
INSERT INTO dmz_config VALUES ('SECTION-TRELLO','{"appKey": ""}');
INSERT INTO dmz_config VALUES ('META','{"database": "0"}');

View file

@ -0,0 +1,6 @@
/* community edition */
-- add subscription
ALTER TABLE dmz_org ADD COLUMN c_sub JSON NULL;
-- deprecations

View file

@ -0,0 +1,36 @@
/* Community Edition */
-- Space labels provide name/color grouping
DROP TABLE IF EXISTS dmz_space_label;
CREATE TABLE dmz_space_label (
id bigserial NOT NULL,
c_refid VARCHAR(20) NOT NULL COLLATE ucs_basic,
c_orgid VARCHAR(20) NOT NULL COLLATE ucs_basic,
c_name VARCHAR(50) NOT NULL DEFAULT '',
c_color VARCHAR(10) NOT NULL DEFAULT '',
c_created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
c_revised TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (c_refid)
);
CREATE INDEX idx_space_label_1 ON dmz_space_label (id);
CREATE INDEX idx_space_label_2 ON dmz_space_label (c_orgid);
-- Space table upgrade to support label, icon and summary stats
ALTER TABLE dmz_space ADD COLUMN c_desc VARCHAR(200) NOT NULL DEFAULT '';
ALTER TABLE dmz_space ADD COLUMN c_labelid VARCHAR(20) NOT NULL DEFAULT '' COLLATE ucs_basic;
ALTER TABLE dmz_space ADD COLUMN c_icon VARCHAR(20) NOT NULL DEFAULT '';
ALTER TABLE dmz_space ADD COLUMN c_count_category INT NOT NULL DEFAULT 0;
ALTER TABLE dmz_space ADD COLUMN c_count_content INT NOT NULL DEFAULT 0;
-- Org/tenant upgrade to support theming and custom logo
ALTER TABLE dmz_org ADD COLUMN c_theme VARCHAR(20) NOT NULL DEFAULT '';
ALTER TABLE dmz_org ADD COLUMN c_logo BYTEA;
-- Populate default values for new fields
UPDATE dmz_space s SET c_count_category=(SELECT COUNT(*) FROM dmz_category WHERE c_spaceid=s.c_refid);
UPDATE dmz_space s SET c_count_content=(SELECT COUNT(*) FROM dmz_doc WHERE c_spaceid=s.c_refid);
-- BUGFIX: Remove zombie group membership records
DELETE FROM dmz_group_member WHERE c_userid NOT IN (SELECT c_userid FROM dmz_user_account);
-- Deprecations

View file

@ -0,0 +1,6 @@
/* Community Edition */
-- BUGFIX: Increase column size
ALTER TABLE dmz_space ALTER COLUMN c_icon TYPE VARCHAR(50);
-- Deprecations

View file

@ -0,0 +1,4 @@
/* Community Edition */
-- Support per section attachments
ALTER TABLE dmz_doc_attachment ADD COLUMN c_sectionid VARCHAR(20) NOT NULL DEFAULT '' COLLATE ucs_basic;

View file

@ -0,0 +1,5 @@
/* Enterprise edition */
-- Feedback feature: support threaded comments and section references
ALTER TABLE dmz_doc_comment ADD COLUMN c_replyto VARCHAR(20) NOT NULL DEFAULT '' COLLATE ucs_basic;
ALTER TABLE dmz_doc_comment ADD COLUMN c_sectionid VARCHAR(20) NOT NULL DEFAULT '' COLLATE ucs_basic;

View file

@ -0,0 +1,5 @@
/* Community edition */
-- Indexes to improve performance
CREATE UNIQUE INDEX idx_doc_4 ON dmz_doc (c_orgid,c_refid);
CREATE UNIQUE INDEX idx_section_4 ON dmz_section (c_orgid,c_refid);

View file

@ -0,0 +1,7 @@
/* Community Edition */
-- Increase column sizes to support rich text data entry
ALTER TABLE dmz_org ALTER COLUMN c_message TYPE VARCHAR(2000);
ALTER TABLE dmz_space ALTER COLUMN c_desc TYPE VARCHAR(2000);
ALTER TABLE dmz_category ALTER COLUMN c_name TYPE VARCHAR(200);
ALTER TABLE dmz_category ADD COLUMN c_default bool NOT NULL DEFAULT '0';

View file

@ -0,0 +1,5 @@
/* Community Edition */
-- Allow for pinned documents per space.
ALTER TABLE dmz_doc ADD COLUMN c_seq INT NOT NULL DEFAULT '99999';

View file

@ -0,0 +1,5 @@
/* Community Edition */
-- Local aware.
ALTER TABLE dmz_org ADD COLUMN c_locale VARCHAR(20) NOT NULL DEFAULT 'en-US';
ALTER TABLE dmz_user ADD COLUMN c_locale VARCHAR(20) NOT NULL DEFAULT 'en-US';

View file

@ -0,0 +1,469 @@
-- SQL to set up the Documize database
DROP TABLE IF EXISTS dmz_action;
CREATE TABLE dmz_action (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_userid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_docid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_requestorid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_actiontype INT NOT NULL DEFAULT '0',
c_note NVARCHAR(2000) NOT NULL DEFAULT '',
c_requested DATETIME2 NULL DEFAULT NULL,
c_due DATETIME2 NULL DEFAULT NULL,
c_completed DATETIME2 NULL DEFAULT NULL,
c_iscomplete BIT NOT NULL DEFAULT '0',
c_reftype NVARCHAR(1) NOT NULL DEFAULT 'D',
c_reftypeid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_action_1 ON dmz_action (c_refid);
CREATE INDEX idx_action_2 ON dmz_action (c_userid);
CREATE INDEX idx_action_3 ON dmz_action (c_docid);
CREATE INDEX idx_action_4 ON dmz_action (c_requestorid);
DROP TABLE IF EXISTS dmz_audit_log;
CREATE TABLE dmz_audit_log (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_userid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_eventtype NVARCHAR(100) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_ip NVARCHAR(39) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_audit_log_1 ON dmz_audit_log (c_orgid);
CREATE INDEX idx_audit_log_2 ON dmz_audit_log (c_userid);
CREATE INDEX idx_audit_log_3 ON dmz_audit_log (c_eventtype);
DROP TABLE IF EXISTS dmz_category;
CREATE TABLE dmz_category (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_spaceid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_name NVARCHAR(50) COLLATE Latin1_General_CS_AS NOT NULL,
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_category_1 ON dmz_category (c_refid);
CREATE INDEX idx_category_2 ON dmz_category (c_orgid);
CREATE INDEX idx_category_3 ON dmz_category (c_orgid,c_spaceid);
DROP TABLE IF EXISTS dmz_category_member;
CREATE TABLE dmz_category_member (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_spaceid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_categoryid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_docid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_category_member_1 ON dmz_category_member (c_docid);
CREATE INDEX idx_category_member_2 ON dmz_category_member (c_orgid,c_docid);
CREATE INDEX idx_category_member_3 ON dmz_category_member (c_orgid,c_spaceid);
DROP TABLE IF EXISTS dmz_config;
CREATE TABLE dmz_config (
c_key NVARCHAR(200) COLLATE Latin1_General_CS_AS NOT NULL,
c_config NVARCHAR(MAX) DEFAULT NULL
);
DROP TABLE IF EXISTS dmz_doc;
CREATE TABLE dmz_doc (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_spaceid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_userid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_job NVARCHAR(36) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_location NVARCHAR(2000) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_name NVARCHAR(2000) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_desc NVARCHAR(2000) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_slug NVARCHAR(2000) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_tags NVARCHAR(1000) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_template BIT NOT NULL DEFAULT '0',
c_protection INT NOT NULL DEFAULT '0',
c_approval INT NOT NULL DEFAULT '0',
c_lifecycle INT NOT NULL DEFAULT '1',
c_versioned BIT NOT NULL DEFAULT '0',
c_versionid NVARCHAR(100) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_versionorder INT NOT NULL DEFAULT '0',
c_groupid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_doc_1 ON dmz_doc (id);
CREATE INDEX idx_doc_2 ON dmz_doc (c_orgid);
CREATE INDEX idx_doc_3 ON dmz_doc (c_spaceid);
DROP TABLE IF EXISTS dmz_doc_attachment;
CREATE TABLE dmz_doc_attachment (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_docid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_job NVARCHAR(36) COLLATE Latin1_General_CS_AS NOT NULL,
c_fileid NVARCHAR(10) COLLATE Latin1_General_CS_AS NOT NULL,
c_filename NVARCHAR(255) COLLATE Latin1_General_CS_AS NOT NULL,
c_data VARBINARY(MAX),
c_extension NVARCHAR(6) COLLATE Latin1_General_CS_AS NOT NULL,
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_doc_attachment_1 ON dmz_doc_attachment (id);
CREATE INDEX idx_doc_attachment_2 ON dmz_doc_attachment (c_orgid);
CREATE INDEX idx_doc_attachment_3 ON dmz_doc_attachment (c_docid);
CREATE INDEX idx_doc_attachment_4 ON dmz_doc_attachment (c_job,c_fileid);
DROP TABLE IF EXISTS dmz_doc_comment;
CREATE TABLE dmz_doc_comment (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_docid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_userid NVARCHAR(20) COLLATE Latin1_General_CS_AS DEFAULT '',
c_email NVARCHAR(250) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_feedback NVARCHAR(MAX) COLLATE Latin1_General_CS_AS,
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_doc_comment_1 ON dmz_doc_comment (c_refid);
DROP TABLE IF EXISTS dmz_doc_link;
CREATE TABLE dmz_doc_link (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_spaceid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_userid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_sourcedocid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_sourcesectionid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_type NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_targetdocid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_targetid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_externalid NVARCHAR(1000) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_orphan BIT NOT NULL DEFAULT '0',
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
DROP TABLE IF EXISTS dmz_doc_share;
CREATE TABLE dmz_doc_share (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_docid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_userid NVARCHAR(20) COLLATE Latin1_General_CS_AS DEFAULT '',
c_email NVARCHAR(250) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_message NVARCHAR(500) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_viewed NVARCHAR(500) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_secret NVARCHAR(250) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_expires NVARCHAR(20) COLLATE Latin1_General_CS_AS DEFAULT '',
c_active BIT NOT NULL DEFAULT '1',
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
DROP TABLE IF EXISTS dmz_doc_vote;
CREATE TABLE dmz_doc_vote (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_docid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_voter NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_vote INT NOT NULL DEFAULT '0',
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_doc_vote_1 ON dmz_doc_vote (c_refid);
CREATE INDEX idx_doc_vote_2 ON dmz_doc_vote (c_docid);
CREATE INDEX idx_doc_vote_3 ON dmz_doc_vote (c_orgid);
CREATE INDEX idx_doc_vote_4 ON dmz_doc_vote (c_orgid,c_docid);
DROP TABLE IF EXISTS dmz_group;
CREATE TABLE dmz_group (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_name NVARCHAR(50) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_desc NVARCHAR(100) COLLATE Latin1_General_CS_AS DEFAULT '',
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_group_1 ON dmz_group (c_refid);
CREATE INDEX idx_group_2 ON dmz_group (c_orgid);
DROP TABLE IF EXISTS dmz_group_member;
CREATE TABLE dmz_group_member (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_groupid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_userid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL
);
CREATE INDEX idx_group_member_1 ON dmz_group_member (c_groupid,c_userid);
CREATE INDEX idx_group_member_2 ON dmz_group_member (c_orgid,c_groupid,c_userid);
DROP TABLE IF EXISTS dmz_org;
CREATE TABLE dmz_org (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_company NVARCHAR(500) COLLATE Latin1_General_CS_AS NOT NULL,
c_title NVARCHAR(500) COLLATE Latin1_General_CS_AS NOT NULL,
c_message NVARCHAR(500) COLLATE Latin1_General_CS_AS NOT NULL,
c_domain NVARCHAR(200) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_service NVARCHAR(200) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_email NVARCHAR(500) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_anonaccess BIT NOT NULL DEFAULT '0',
c_authprovider NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT 'documize',
c_authconfig NVARCHAR(MAX) DEFAULT NULL,
c_maxtags INT NOT NULL DEFAULT '3',
c_sub NVARCHAR(MAX) NULL,
c_theme NVARCHAR(20) NOT NULL DEFAULT '',
c_logo VARBINARY(MAX),
c_verified BIT NOT NULL DEFAULT '0',
c_serial NVARCHAR(50) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_active BIT NOT NULL DEFAULT '1',
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
);
CREATE INDEX idx_org_1 ON dmz_org (id);
CREATE INDEX idx_org_2 ON dmz_org (c_domain);
DROP TABLE IF EXISTS dmz_permission;
CREATE TABLE dmz_permission (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_who NVARCHAR(30) COLLATE Latin1_General_CS_AS NOT NULL,
c_whoid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_action NVARCHAR(30) COLLATE Latin1_General_CS_AS NOT NULL,
c_scope NVARCHAR(30) COLLATE Latin1_General_CS_AS NOT NULL,
c_location NVARCHAR(100) COLLATE Latin1_General_CS_AS NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_permission_1 ON dmz_permission (c_orgid);
CREATE INDEX idx_permission_2 ON dmz_permission (c_orgid,c_who,c_whoid,c_location);
CREATE INDEX idx_permission_3 ON dmz_permission (c_orgid,c_who,c_whoid,c_location,c_action);
CREATE INDEX idx_permission_4 ON dmz_permission (c_orgid,c_location,c_refid);
CREATE INDEX idx_permission_5 ON dmz_permission (c_orgid,c_who,c_location,c_action);
DROP TABLE IF EXISTS dmz_pin;
CREATE TABLE dmz_pin (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_userid NVARCHAR(20) COLLATE Latin1_General_CS_AS DEFAULT '',
c_spaceid NVARCHAR(20) COLLATE Latin1_General_CS_AS DEFAULT '',
c_docid NVARCHAR(20) COLLATE Latin1_General_CS_AS DEFAULT '',
c_sequence BIGINT NOT NULL DEFAULT '99',
c_name NVARCHAR(100) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_pin_1 ON dmz_pin (c_userid);
DROP TABLE IF EXISTS dmz_search;
CREATE TABLE dmz_search (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_docid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_itemid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_itemtype NVARCHAR(10) COLLATE Latin1_General_CS_AS NOT NULL,
c_content NVARCHAR(MAX) COLLATE Latin1_General_CS_AS,
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_search_1 ON dmz_search (c_orgid);
CREATE INDEX idx_search_2 ON dmz_search (c_docid);
DROP TABLE IF EXISTS dmz_section;
CREATE TABLE dmz_section (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_docid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_userid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_contenttype NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT 'wysiwyg',
c_type NVARCHAR(10) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT 'section',
c_templateid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_level bigint NOT NULL,
c_sequence double precision NOT NULL,
c_name NVARCHAR(2000) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_body NVARCHAR(MAX) COLLATE Latin1_General_CS_AS,
c_revisions bigint NOT NULL,
c_status INT NOT NULL DEFAULT '0',
c_relativeid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_section_1 ON dmz_section (id);
CREATE INDEX idx_section_2 ON dmz_section (c_orgid);
CREATE INDEX idx_section_3 ON dmz_section (c_docid);
DROP TABLE IF EXISTS dmz_section_meta;
CREATE TABLE dmz_section_meta (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_sectionid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_userid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_docid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_rawbody NVARCHAR(MAX),
c_config NVARCHAR(MAX) DEFAULT NULL,
c_external BIT DEFAULT '0',
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_section_meta_1 ON dmz_section_meta (id);
CREATE INDEX idx_section_meta_2 ON dmz_section_meta (c_sectionid);
CREATE INDEX idx_section_meta_3 ON dmz_section_meta (c_orgid);
CREATE INDEX idx_section_meta_4 ON dmz_section_meta (c_docid);
DROP TABLE IF EXISTS dmz_section_revision;
CREATE TABLE dmz_section_revision (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_docid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_ownerid NVARCHAR(20) COLLATE Latin1_General_CS_AS DEFAULT '',
c_sectionid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_userid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_contenttype NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT 'wysiwyg',
c_type NVARCHAR(10) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT 'section',
c_name NVARCHAR(2000) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_body NVARCHAR(MAX) COLLATE Latin1_General_CS_AS,
c_rawbody NVARCHAR(MAX),
c_config NVARCHAR(MAX) DEFAULT NULL,
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_section_revision_1 ON dmz_section_revision (id);
CREATE INDEX idx_section_revision_2 ON dmz_section_revision (c_orgid);
CREATE INDEX idx_section_revision_3 ON dmz_section_revision (c_docid);
CREATE INDEX idx_section_revision_4 ON dmz_section_revision (c_sectionid);
DROP TABLE IF EXISTS dmz_section_template;
CREATE TABLE dmz_section_template (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_spaceid NVARCHAR(20) COLLATE Latin1_General_CS_AS DEFAULT '',
c_userid NVARCHAR(20) COLLATE Latin1_General_CS_AS DEFAULT '',
c_contenttype NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT 'wysiwyg',
c_type NVARCHAR(10) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT 'section',
c_name NVARCHAR(2000) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_body NVARCHAR(MAX) COLLATE Latin1_General_CS_AS,
c_desc NVARCHAR(2000) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_used INT NOT NULL,
c_rawbody NVARCHAR(MAX),
c_config NVARCHAR(MAX) DEFAULT NULL,
c_external BIT DEFAULT '0',
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_section_template_1 ON dmz_section_template (c_refid);
CREATE INDEX idx_section_template_2 ON dmz_section_template (c_spaceid);
DROP TABLE IF EXISTS dmz_space;
CREATE TABLE dmz_space (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_name NVARCHAR(300) COLLATE Latin1_General_CS_AS NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_userid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_type INT NOT NULL DEFAULT '1',
c_lifecycle INT NOT NULL DEFAULT '1',
c_desc NVARCHAR(200) NOT NULL DEFAULT '',
c_labelid NVARCHAR(20) NOT NULL DEFAULT '' COLLATE Latin1_General_CS_AS,
c_likes NVARCHAR(1000) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_icon NVARCHAR(50) NOT NULL DEFAULT '',
c_count_category INT NOT NULL DEFAULT 0,
c_count_content INT NOT NULL DEFAULT 0,
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_space_1 ON dmz_space (id);
CREATE INDEX idx_space_2 ON dmz_space (c_userid);
CREATE INDEX idx_space_3 ON dmz_space (c_orgid);
DROP TABLE IF EXISTS dmz_space_label;
CREATE TABLE dmz_space_label (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_name NVARCHAR(50) NOT NULL DEFAULT '',
c_color NVARCHAR(10) NOT NULL DEFAULT '',
c_created DATETIME2 DEFAULT CURRENT_TIMESTAMP,
c_revised DATETIME2 DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_space_label_1 ON dmz_space_label (id);
CREATE INDEX idx_space_label_2 ON dmz_space_label (c_orgid);
DROP TABLE IF EXISTS dmz_user;
CREATE TABLE dmz_user (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_firstname NVARCHAR(500) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_lastname NVARCHAR(500) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_email NVARCHAR(500) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_initials NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_globaladmin BIT NOT NULL DEFAULT '0',
c_password NVARCHAR(500) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_salt NVARCHAR(500) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_reset NVARCHAR(500) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_active BIT NOT NULL DEFAULT '1',
c_lastversion NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_user_1 ON dmz_user (id);
CREATE INDEX idx_user_2 ON dmz_user (c_email);
DROP TABLE IF EXISTS dmz_user_account;
CREATE TABLE dmz_user_account (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_refid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_userid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_editor BIT NOT NULL DEFAULT '0',
c_admin BIT NOT NULL DEFAULT '0',
c_users BIT NOT NULL DEFAULT '1',
c_analytics BIT NOT NULL DEFAULT '0',
c_active BIT NOT NULL DEFAULT '1',
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP,
c_revised DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_user_account_1 ON dmz_user_account (id);
CREATE INDEX idx_user_account_2 ON dmz_user_account (c_userid);
CREATE INDEX idx_user_account_3 ON dmz_user_account (c_orgid);
DROP TABLE IF EXISTS dmz_user_activity;
CREATE TABLE dmz_user_activity (
id BIGINT PRIMARY KEY IDENTITY (1, 1) NOT NULL,
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_userid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_spaceid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_docid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_sectionid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_sourcetype INT NOT NULL DEFAULT '0',
c_activitytype INT NOT NULL DEFAULT '0',
c_metadata NVARCHAR(1000) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '',
c_created DATETIME2 NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_user_activity_1 ON dmz_user_activity (c_orgid);
CREATE INDEX idx_user_activity_2 ON dmz_user_activity (c_userid);
CREATE INDEX idx_user_activity_3 ON dmz_user_activity (c_activitytype);
CREATE INDEX idx_user_activity_4 ON dmz_user_activity (c_orgid,c_docid,c_sourcetype);
CREATE INDEX idx_user_activity_5 ON dmz_user_activity (c_orgid,c_docid,c_userid,c_sourcetype);
DROP TABLE IF EXISTS dmz_user_config;
CREATE TABLE dmz_user_config (
c_orgid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_userid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL,
c_key NVARCHAR(200) COLLATE Latin1_General_CS_AS NOT NULL,
c_config NVARCHAR(MAX) DEFAULT NULL
);
INSERT INTO dmz_config VALUES ('SMTP','{"userid": "","password": "","host": "","port": "","sender": ""}');
INSERT INTO dmz_config VALUES ('FILEPLUGINS', '[{"Comment": "Disable (or not) built-in html import (NOTE: no Plugin name)","Disabled": false,"API": "Convert","Actions": ["htm","html"]},{"Comment": "Disable (or not) built-in Documize API import used from SDK (NOTE: no Plugin name)","Disabled": false,"API": "Convert","Actions": ["documizeapi"]}]');
INSERT INTO dmz_config VALUES ('SECTION-TRELLO','{"appKey": ""}');
INSERT INTO dmz_config VALUES ('META','{"database": "0"}');

View file

@ -0,0 +1,4 @@
/* Community Edition */
-- Support per section attachments
ALTER TABLE dmz_doc_attachment ADD c_sectionid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '';

View file

@ -0,0 +1,5 @@
/* Enterprise edition */
-- Feedback feature: support threaded comments and section references
ALTER TABLE dmz_doc_comment ADD c_replyto NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '';
ALTER TABLE dmz_doc_comment ADD c_sectionid NVARCHAR(20) COLLATE Latin1_General_CS_AS NOT NULL DEFAULT '';

View file

@ -0,0 +1,16 @@
/* Community edition */
-- Fulltext search support
IF EXISTS (SELECT * FROM sysfulltextcatalogs ftc WHERE ftc.name = N'dmz_search_catalog')
DROP FULLTEXT CATALOG dmz_search_catalog;
CREATE FULLTEXT CATALOG dmz_search_catalog;
CREATE UNIQUE INDEX idx_doc_4 ON dmz_doc(c_refid);
CREATE UNIQUE INDEX idx_section_4 ON dmz_section(c_refid);
CREATE FULLTEXT INDEX ON dmz_doc (c_name, c_desc) KEY INDEX idx_doc_4 ON dmz_search_catalog
WITH CHANGE_TRACKING AUTO;
CREATE FULLTEXT INDEX ON dmz_section (c_name, c_body) KEY INDEX idx_section_4 ON dmz_search_catalog
WITH CHANGE_TRACKING AUTO;

View file

@ -0,0 +1,7 @@
/* Community edition */
-- Increase column sizes to support rich text data entry
ALTER TABLE dmz_org ALTER COLUMN c_message NVARCHAR(2000);
ALTER TABLE dmz_space ALTER COLUMN c_desc NVARCHAR(2000);
ALTER TABLE dmz_category ALTER COLUMN c_name NVARCHAR(200);
ALTER TABLE dmz_category ADD c_default BIT NOT NULL DEFAULT '0';

View file

@ -0,0 +1,4 @@
/* Community edition */
-- Allow for pinned documents per space.
ALTER TABLE dmz_doc ADD c_seq INT NOT NULL DEFAULT '99999';

View file

@ -0,0 +1,5 @@
/* Community edition */
-- Local aware.
ALTER TABLE dmz_org ADD c_locale NVARCHAR(20) NOT NULL DEFAULT 'en-US';
ALTER TABLE dmz_user ADD c_locale NVARCHAR(20) NOT NULL DEFAULT 'en-US';

View file

@ -0,0 +1,4 @@
/* Community edition */
-- Performance indexes
CREATE INDEX idx_action_5 ON dmz_action (c_orgid,c_userid,c_docid,c_actiontype,c_iscomplete,c_reftype,c_reftypeid);

View file

@ -0,0 +1,8 @@
/* Community edition */
-- Performance indexes
CREATE INDEX idx_action_6 ON dmz_action (c_orgid,c_reftypeid,c_reftype);
CREATE INDEX idx_action_7 ON dmz_action (c_orgid,c_refid);
CREATE INDEX idx_section_5 ON dmz_section (c_orgid,c_refid);

View file

@ -0,0 +1,6 @@
/* Community edition */
-- Performance indexes
CREATE INDEX idx_action_8 ON dmz_action (c_orgid,c_docid);
CREATE INDEX idx_user_3 ON dmz_user (c_refid);

View file

@ -0,0 +1,207 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
package database
import (
"encoding/json"
"encoding/xml"
"errors"
"net/http"
"time"
"github.com/documize/community/core/api/plugins"
"github.com/documize/community/core/env"
"github.com/documize/community/core/secrets"
"github.com/documize/community/core/stringutil"
"github.com/documize/community/core/uniqueid"
"github.com/documize/community/domain"
"github.com/documize/community/domain/store"
"github.com/documize/community/server/web"
)
// Handler contains the runtime information such as logging and database.
type Handler struct {
Runtime *env.Runtime
Store *store.Store
}
// Setup the tables in a blank database
func (h *Handler) Setup(w http.ResponseWriter, r *http.Request) {
defer func() {
target := "/setup"
status := http.StatusBadRequest
if h.Runtime.Flags.SiteMode == env.SiteModeNormal {
target = "/"
status = http.StatusOK
}
req, err := http.NewRequest("GET", target, nil)
if err != nil {
h.Runtime.Log.Error("database.Setup error in defer ", err)
}
http.Redirect(w, req, target, status)
}()
err := r.ParseForm()
if err != nil {
h.Runtime.Log.Error("database.Setup r.ParseForm()", err)
return
}
dbname := r.Form.Get("dbname")
dbhash := r.Form.Get("dbhash")
if dbname != web.SiteInfo.DBname || dbhash != web.SiteInfo.DBhash {
h.Runtime.Log.Error("database.Setup security credentials error ", errors.New("bad db name or validation code"))
return
}
details := onboardRequest{
URL: "",
Company: r.Form.Get("title"),
CompanyLong: r.Form.Get("title"),
Message: r.Form.Get("message"),
Email: r.Form.Get("email"),
Password: r.Form.Get("password"),
Firstname: r.Form.Get("firstname"),
Lastname: r.Form.Get("lastname"),
ActivationKey: r.Form.Get("activationKey"),
Revised: time.Now().UTC(),
}
if details.Company == "" ||
details.CompanyLong == "" ||
details.Message == "" ||
details.Email == "" ||
details.Password == "" ||
details.Firstname == "" ||
details.Lastname == "" {
h.Runtime.Log.Error("database.Setup error ", errors.New("required field in database set-up form blank"))
return
}
if err = InstallUpgrade(h.Runtime, false); err != nil {
h.Runtime.Log.Error("database.Setup migrate", err)
return
}
err = setupAccount(h.Runtime, details, secrets.GenerateSalt())
if err != nil {
h.Runtime.Log.Error("database.Setup setup account ", err)
return
}
h.Runtime.Flags.SiteMode = env.SiteModeNormal
err = plugins.Setup(h.Store)
if err != nil {
h.Runtime.Log.Error("database.Setup plugin setup failed", err)
}
}
// The result of completing the onboarding process.
type onboardRequest struct {
URL string
Company string
CompanyLong string
Message string
Email string
Password string
Firstname string
Lastname string
ActivationKey string
Revised time.Time
}
// setupAccount prepares the database for a newly onboard customer.
// Once done, they can then login and use Documize.
func setupAccount(rt *env.Runtime, completion onboardRequest, serial string) (err error) {
tx, err := rt.Db.Beginx()
if err != nil {
rt.Log.Error("setup - failed to get transaction", err)
return
}
salt := secrets.GenerateSalt()
password := secrets.GeneratePassword(completion.Password, salt)
// Process activation key if we have one.
activationKey := processActivationKey(rt, completion)
// Allocate organization to the user.
orgID := uniqueid.Generate()
_, err = tx.Exec(RebindParams("INSERT INTO dmz_org (c_refid, c_company, c_title, c_message, c_domain, c_email, c_serial, c_sub) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
rt.StoreProvider.Type()),
orgID, completion.Company, completion.CompanyLong, completion.Message, completion.URL, completion.Email, serial, activationKey)
if err != nil {
rt.Log.Error("INSERT INTO dmz_org failed", err)
rt.Rollback(tx)
return
}
// Create user.
userID := uniqueid.Generate()
_, err = tx.Exec(RebindParams("INSERT INTO dmz_user (c_refid, c_firstname, c_lastname, c_email, c_initials, c_salt, c_password, c_globaladmin) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", rt.StoreProvider.Type()),
userID, completion.Firstname, completion.Lastname, completion.Email, stringutil.MakeInitials(completion.Firstname, completion.Lastname), salt, password, true)
if err != nil {
rt.Log.Error("INSERT INTO dmz_user failed", err)
rt.Rollback(tx)
return
}
// Link user to organization.
accountID := uniqueid.Generate()
_, err = tx.Exec(RebindParams("INSERT INTO dmz_user_account (c_refid, c_userid, c_orgid, c_admin, c_editor, c_users, c_analytics) VALUES (?, ?, ?, ?, ?, ?, ?)", rt.StoreProvider.Type()),
accountID, userID, orgID, true, true, true, true)
if err != nil {
rt.Log.Error("INSERT INTO dmz_user_account failed", err)
rt.Rollback(tx)
return
}
// Finish up.
if err = tx.Commit(); err != nil {
rt.Log.Error("setup - unable to commit sql", err)
return
}
return
}
func processActivationKey(rt *env.Runtime, or onboardRequest) (key string) {
key = "{}"
if len(or.ActivationKey) == 0 {
return
}
j := domain.SubscriptionData{}
x := domain.SubscriptionXML{Key: "", Signature: ""}
err1 := xml.Unmarshal([]byte(or.ActivationKey), &x)
if err1 == nil {
j.Key = x.Key
j.Signature = x.Signature
} else {
rt.Log.Error("failed to XML unmarshal subscription XML", err1)
}
d, err2 := json.Marshal(j)
if err2 == nil {
key = string(d)
} else {
rt.Log.Error("failed to JSON marshal subscription XML", err2)
}
return
}

View file

@ -14,7 +14,7 @@
html {
-webkit-font-smoothing: antialiased;
}
body {
font-family: 'Open Sans', sans-serif;
background-color: #1b75bb;
@ -22,54 +22,54 @@
color: #ffffff;
padding-top: 50px;
}
.container {
max-width: 1200px;
margin: 0 auto;
text-align: center;
}
.logo {
margin: 0 15px;
}
.content {
margin: 0 15px;
}
.content > div {
margin: 50px 0;
}
.content h1 {
font-size: 24px;
font-weight: 400;
text-transform: uppercase;
margin: 0 0 30px;
}
.content p {
font-size: 18px;
line-height: 28px;
margin: 30px 0 0 0;
}
.content .image {
text-align: center;
}
.clearfix {
overflow: auto;
zoom: 1;
}
.btn-main {
border: 1px solid #ffffff;
padding: 12px 20px;
border-radius: 5px;
margin-left: 25px;
}
@media (min-width: 768px) {
body {
margin-top: 100px;
@ -102,7 +102,7 @@
<body>
<div class="container">
<div class="logo">
<img src="/assets/img/setup/logo.png" alt="Documize">
<img src="/assets/img/setup/logo.png" alt="Documize Community">
</div>
<div class="content clearfix">
<div class="image">
@ -110,11 +110,11 @@
</div>
<div class="text">
<h1>Database Error</h1>
<p>There seems to be a problem with the Documize database: <strong>{{.DBname}}</strong></p>
<p>There seems to be a problem with the Documize Community database: <strong>{{.DBname}}</strong></p>
<p><em>{{.Issue}}</em></p>
</div>
</div>
</div>
</body>
</html>
</html>

File diff suppressed because one or more lines are too long

108
core/env/command_line.go vendored Normal file
View file

@ -0,0 +1,108 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
// Package env provides runtime, server level setup and configuration
package env
import (
"flag"
"fmt"
"os"
"sort"
"strings"
"sync"
)
// prefix provides the prefix for all environment variables
const prefix = "DOCUMIZE"
const goInit = "(default)"
var flagList progFlags
var cliMutex sync.Mutex
type flagItem struct {
target *string
name, setter, value string
required bool
}
type progFlags struct {
items []flagItem
}
// Len is part of sort.Interface.
func (v *progFlags) Len() int {
return len(v.items)
}
// Swap is part of sort.Interface.
func (v *progFlags) Swap(i, j int) {
v.items[i], v.items[j] = v.items[j], v.items[i]
}
// Less is part of sort.Interface.
func (v *progFlags) Less(i, j int) bool {
return v.items[i].name < v.items[j].name
}
// register prepares flag for subsequent parsing
func register(target *string, name string, required bool, usage string) {
cliMutex.Lock()
defer cliMutex.Unlock()
name = strings.ToLower(strings.TrimSpace(name))
setter := prefix + strings.ToUpper(name)
value := os.Getenv(setter)
if value == "" {
value = *target // use the Go initialized value
setter = goInit
}
flag.StringVar(target, name, value, usage)
flagList.items = append(flagList.items, flagItem{target: target, name: name, required: required, value: value, setter: setter})
}
// parse loads flags from OS environment and command line switches
func parse(doFirst string) (ok bool) {
cliMutex.Lock()
defer cliMutex.Unlock()
flag.Parse()
sort.Sort(&flagList)
for pass := 1; pass <= 2; pass++ {
for vi, v := range flagList.items {
if (pass == 1 && v.name == doFirst) || (pass == 2 && v.name != doFirst) {
if v.value != *(v.target) || (v.value != "" && *(v.target) == "") {
flagList.items[vi].setter = "-" + v.name // v is a local copy, not the underlying data
}
if v.required {
if *(v.target) == "" {
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, "In order to run", os.Args[0], "the following must be provided:")
for _, vv := range flagList.items {
if vv.required {
fmt.Fprintf(os.Stderr, "* setting from environment variable '%s' or flag '-%s' or an application setting '%s', current value: '%s' set by '%s'\n",
prefix+strings.ToUpper(vv.name), vv.name, vv.name, *(vv.target), vv.setter)
}
}
fmt.Fprintln(os.Stderr)
flag.Usage()
return false
}
}
}
}
}
return true
}

138
core/env/flags.go vendored
View file

@ -12,25 +12,19 @@
// Package env provides runtime, server level setup and configuration
package env
import (
"flag"
"fmt"
"os"
"sort"
"strings"
"sync"
)
// Flags provides access to environment and command line switches for this program.
type Flags struct {
DBType string // database type
DBConn string // database connection string
Salt string // the salt string used to encode JWT tokens
DBType string // (optional) database type
SSLCertFile string // (optional) name of SSL certificate PEM file
SSLKeyFile string // (optional) name of SSL key PEM file
HTTPPort string // (optional) HTTP or HTTPS port
ForceHTTPPort2SSL string // (optional) HTTP that should be redirected to HTTPS
SSLCertFile string // (optional) name of SSL certificate PEM file
SSLKeyFile string // (optional) name of SSL key PEM file
TLSVersion string // (optional) minimum TLS version for SSL connections
SiteMode string // (optional) if 1 then serve offline web page
Location string // reserved
ConfigSource string // tells us if configuration info was obtained from command line or config file
}
// SSLEnabled returns true if both cert and key were provided at runtime.
@ -38,113 +32,27 @@ func (f *Flags) SSLEnabled() bool {
return f.SSLCertFile != "" && f.SSLKeyFile != ""
}
type flagItem struct {
target *string
name, setter, value string
required bool
// ConfigToml represents configuration file that contains all flags as per above.
type ConfigToml struct {
HTTP httpConfig `toml:"http"`
Database databaseConfig `toml:"database"`
Install installConfig `toml:"install"`
}
type progFlags struct {
items []flagItem
type httpConfig struct {
Port int
ForceSSLPort int
Cert string
Key string
TLSVersion string
}
// Len is part of sort.Interface.
func (v *progFlags) Len() int {
return len(v.items)
type databaseConfig struct {
Type string
Connection string
Salt string
}
// Swap is part of sort.Interface.
func (v *progFlags) Swap(i, j int) {
v.items[i], v.items[j] = v.items[j], v.items[i]
}
// Less is part of sort.Interface.
func (v *progFlags) Less(i, j int) bool {
return v.items[i].name < v.items[j].name
}
// prefix provides the prefix for all environment variables
const prefix = "DOCUMIZE"
const goInit = "(default)"
var flagList progFlags
var loadMutex sync.Mutex
// ParseFlags loads command line and OS environment variables required by the program to function.
func ParseFlags() (f Flags) {
var dbConn, dbType, jwtKey, siteMode, port, certFile, keyFile, forcePort2SSL string
register(&jwtKey, "salt", false, "the salt string used to encode JWT tokens, if not set a random value will be generated")
register(&certFile, "cert", false, "the cert.pem file used for https")
register(&keyFile, "key", false, "the key.pem file used for https")
register(&port, "port", false, "http/https port number")
register(&forcePort2SSL, "forcesslport", false, "redirect given http port number to TLS")
register(&siteMode, "offline", false, "set to '1' for OFFLINE mode")
register(&dbType, "dbtype", false, "set to database type mysql|percona|mariadb")
register(&dbConn, "db", true, `'username:password@protocol(hostname:port)/databasename" for example "fred:bloggs@tcp(localhost:3306)/documize"`)
parse("db")
f.DBConn = dbConn
f.ForceHTTPPort2SSL = forcePort2SSL
f.HTTPPort = port
f.Salt = jwtKey
f.SiteMode = siteMode
f.SSLCertFile = certFile
f.SSLKeyFile = keyFile
f.DBType = dbType
return f
}
// register prepares flag for subsequent parsing
func register(target *string, name string, required bool, usage string) {
loadMutex.Lock()
defer loadMutex.Unlock()
name = strings.ToLower(strings.TrimSpace(name))
setter := prefix + strings.ToUpper(name)
value := os.Getenv(setter)
if value == "" {
value = *target // use the Go initialized value
setter = goInit
}
flag.StringVar(target, name, value, usage)
flagList.items = append(flagList.items, flagItem{target: target, name: name, required: required, value: value, setter: setter})
}
// parse loads flags from OS environment and command line switches
func parse(doFirst string) {
loadMutex.Lock()
defer loadMutex.Unlock()
flag.Parse()
sort.Sort(&flagList)
for pass := 1; pass <= 2; pass++ {
for vi, v := range flagList.items {
if (pass == 1 && v.name == doFirst) || (pass == 2 && v.name != doFirst) {
if v.value != *(v.target) || (v.value != "" && *(v.target) == "") {
flagList.items[vi].setter = "-" + v.name // v is a local copy, not the underlying data
}
if v.required {
if *(v.target) == "" {
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, "In order to run", os.Args[0], "the following must be provided:")
for _, vv := range flagList.items {
if vv.required {
fmt.Fprintf(os.Stderr, "* setting from environment variable '%s' or flag '-%s' or an application setting '%s', current value: '%s' set by '%s'\n",
prefix+strings.ToUpper(vv.name), vv.name, vv.name, *(vv.target), vv.setter)
}
}
fmt.Fprintln(os.Stderr)
flag.Usage()
return
}
}
}
}
}
type installConfig struct {
Location string
}

1
core/env/logger.go vendored
View file

@ -15,6 +15,7 @@ package env
// Logger provides the interface for Documize compatible loggers.
type Logger interface {
Info(message string)
Infof(message string, a ...interface{})
Trace(message string)
Error(message string, err error)
// SetDB(l Logger, db *sqlx.DB) Logger

145
core/env/parser.go vendored Normal file
View file

@ -0,0 +1,145 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
// Package env provides runtime, server level setup and configuration
package env
import (
"fmt"
"os"
"strconv"
"strings"
"github.com/BurntSushi/toml"
)
// LoadConfig loads runtime parameters like port numbers and DB connections.
// We first check for -config switch that would point us towards a .CONF file.
// If not found, we then read parameters from command line and environment vars.
func LoadConfig() (f Flags, ok bool) {
// Check and process config file
f, ok = configFile()
// If not OK then get parameters from command line and environment variables.
if !ok {
f, ok = commandLineEnv()
}
// reserved
if len(f.Location) == 0 {
f.Location = "selfhost"
}
return
}
// configFile checks for the presence of zero or one command argument.
// If no arguments are provided then we look for and load documize.conf file.
// If one argument is provided then we load the specified config file.
// If more than one argument is provided then we exit as flags as have passed.
// checks to see if it is a TOML format config file.
func configFile() (f Flags, ok bool) {
ok = false
var configFile string
// First argument is always program being executed.
// No additional arguments means check for documize.conf file.
if len(os.Args) == 1 {
// No arguments, so we default to default config filename.
configFile = "documize.conf"
} else if len(os.Args) == 2 {
// Config filename passed in, so we use it.
configFile = os.Args[1]
} else {
// Too many arguments means flags passed in so we return.
return
}
// Does file exist?
if len(configFile) == 0 || !configFileExists(configFile) {
return
}
// Tell caller where the config came from.
f.ConfigSource = configFile
// We parse the TOML format config file.
var ct ConfigToml
if _, err := toml.DecodeFile(configFile, &ct); err != nil {
fmt.Println(err)
return
}
f.DBType = strings.ToLower(ct.Database.Type)
f.DBConn = ct.Database.Connection
f.Salt = ct.Database.Salt
f.HTTPPort = strconv.Itoa(ct.HTTP.Port)
f.ForceHTTPPort2SSL = strconv.Itoa(ct.HTTP.ForceSSLPort)
f.SSLCertFile = ct.HTTP.Cert
f.SSLKeyFile = ct.HTTP.Key
f.TLSVersion = ct.HTTP.TLSVersion
f.Location = strings.ToLower(ct.Install.Location)
if len(f.TLSVersion) == 0 {
f.TLSVersion = "1.3"
}
ok = true
return
}
// commandLineEnv loads command line and OS environment variables required by the program to function.
func commandLineEnv() (f Flags, ok bool) {
ok = true
var dbConn, dbType, jwtKey, siteMode, port, certFile, keyFile, forcePort2SSL, TLSVersion, location string
// register(&configFile, "salt", false, "the salt string used to encode JWT tokens, if not set a random value will be generated")
register(&jwtKey, "salt", false, "the salt string used to encode JWT tokens, if not set a random value will be generated")
register(&certFile, "cert", false, "the cert.pem file used for https")
register(&keyFile, "key", false, "the key.pem file used for https")
register(&port, "port", false, "http/https port number")
register(&forcePort2SSL, "forcesslport", false, "redirect given http port number to TLS")
register(&TLSVersion, "tlsversion", false, "select minimum TLS: 1.0, 1.1, 1.2, 1.3")
register(&siteMode, "offline", false, "set to '1' for OFFLINE mode")
register(&dbType, "dbtype", true, "specify the database provider: mysql|percona|mariadb|postgresql|sqlserver")
register(&dbConn, "db", true, `'database specific connection string for example "user:password@tcp(localhost:3306)/dbname"`)
register(&location, "location", false, `reserved`)
if !parse("db") {
ok = false
}
f.DBType = strings.ToLower(dbType)
f.DBConn = dbConn
f.ForceHTTPPort2SSL = forcePort2SSL
f.HTTPPort = port
f.Salt = jwtKey
f.SiteMode = siteMode
f.SSLCertFile = certFile
f.SSLKeyFile = keyFile
f.TLSVersion = TLSVersion
f.Location = strings.ToLower(location)
f.ConfigSource = "flags/environment"
if len(f.TLSVersion) == 0 {
f.TLSVersion = "1.3"
}
return f, ok
}
func configFileExists(fn string) bool {
info, err := os.Stat(fn)
if os.IsNotExist(err) {
return false
}
return !info.IsDir()
}

70
core/env/product.go vendored
View file

@ -1,70 +0,0 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
package env
import (
"fmt"
"time"
)
// ProdInfo describes a product
type ProdInfo struct {
Edition string
Title string
Version string
Major string
Minor string
Patch string
License License
}
// License holds details of product license.
type License struct {
Name string `json:"name"`
Email string `json:"email"`
Edition string `json:"edition"`
Start time.Time `json:"start"`
End time.Time `json:"end"`
Seats int `json:"seats"`
Trial bool `json:"trial"`
Valid bool
}
// IsEmpty determines if we have a license.
func (l *License) IsEmpty() bool {
return l.Seats == 0 && len(l.Name) == 0 && len(l.Email) == 0 && l.Start.Year() == 1 && l.End.Year() == 1
}
// Status returns formatted message stating if license is empty/populated and invalid/valid.
func (l *License) Status() string {
lp := "populated"
if l.IsEmpty() {
lp = "empty"
}
lv := "invalid"
if l.Valid {
lv = "valid"
}
return fmt.Sprintf("License is %s and %s", lp, lv)
}
// IsValid returns if license is valid
func (l *License) IsValid() bool {
return l.Valid == true
}
// LicenseData holds encrypted data and is unpacked into License.
type LicenseData struct {
Key string `json:"key"`
Signature string `json:"signature"`
}

117
core/env/provider.go vendored Normal file
View file

@ -0,0 +1,117 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
// Package env provides runtime, server level setup and configuration
package env
// StoreType represents name of database system
type StoreType string
const (
// StoreTypeMySQL is MySQL
StoreTypeMySQL StoreType = "MySQL"
// StoreTypePercona is Percona
StoreTypePercona StoreType = "Percona"
// StoreTypeMariaDB is MariaDB
StoreTypeMariaDB StoreType = "MariaDB"
// StoreTypePostgreSQL is PostgreSQL
StoreTypePostgreSQL StoreType = "PostgreSQL"
// StoreTypeSQLServer is Microsoft SQL Server
StoreTypeSQLServer StoreType = "SQLServer"
)
// StoreProvider defines a database provider.
type StoreProvider interface {
// Name of provider
Type() StoreType
// TypeVariant returns flavor of database provider.
TypeVariant() StoreType
// SQL driver name used to open DB connection.
DriverName() string
// Database connection string parameters that must be present before connecting to DB.
Params() map[string]string
// Example holds storage provider specific connection string format.
// used in error messages
Example() string
// DatabaseName holds the SQL database name where Documize tables live.
DatabaseName() string
// Make connection string with default parameters.
MakeConnectionString() string
// QueryMeta is how to extract version number, collation, character set from database provider.
QueryMeta() string
// QueryRecordVersionUpgrade returns database specific insert statement
// that records the database version number.
QueryRecordVersionUpgrade(version int) string
// QueryRecordVersionUpgrade returns database specific insert statement
// that records the database version number.
// For use on databases before The Great Schema Migration (v25, MySQL).
QueryRecordVersionUpgradeLegacy(version int) string
// QueryGetDatabaseVersion returns the schema version number.
QueryGetDatabaseVersion() string
// QueryGetDatabaseVersionLegacy returns the schema version number before The Great Schema Migration (v25, MySQL).
QueryGetDatabaseVersionLegacy() string
// QueryTableList returns a list tables in Documize database.
QueryTableList() string
// QueryDateInterval returns provider specific
// interval style date SQL.
QueryDateInterval(days int64) string
// JSONEmpty returns empty SQL JSON object.
// Typically used as 2nd parameter to COALESCE().
JSONEmpty() string
// JSONGetValue returns JSON attribute selection syntax.
// Typically used in SELECT <my_json_field> query.
JSONGetValue(column, attribute string) string
// VerfiyVersion checks to see if actual database meets
// minimum version requirements.
VerfiyVersion(dbVersion string) (versionOK bool, minVerRequired string)
// VerfiyCharacterCollation checks to see if actual database
// has correct character set and collation settings.
VerfiyCharacterCollation(charset, collation string) (charOK bool, requirements string)
// ConvertTimestamp returns SQL function to correctly convert
// ISO 8601 format (e.g. '2016-09-08T06:37:23Z') to SQL specific
// timestamp value (e.g. 2016-09-08 06:37:23).
// Must use ? for parameter placeholder character as DB layer
// will convert to database specific parameter placeholder character.
ConvertTimestamp() (statement string)
// IsTrue returns storage provider boolean TRUE:
// MySQL is 1, PostgresSQL is TRUE, SQL Server is 1
IsTrue() string
// IsFalse returns storage provider boolean FALSE:
// MySQL is 0, PostgresSQL is FALSE, SQL Server is 0
IsFalse() string
// RowLimit returns SQL for limited number of returned rows
RowLimit(max int) string
}

77
core/env/runtime.go vendored
View file

@ -12,41 +12,70 @@
// Package env provides runtime, server level setup and configuration
package env
import "github.com/jmoiron/sqlx"
import (
"context"
"database/sql"
"embed"
// Runtime provides access to database, logger and other server-level scoped objects.
// Use Context for per-request values.
type Runtime struct {
Flags Flags
Db *sqlx.DB
DbVariant DbVariant
Log Logger
Product ProdInfo
}
"github.com/documize/community/domain"
"github.com/jmoiron/sqlx"
)
const (
// SiteModeNormal serves app
SiteModeNormal = ""
// SiteModeOffline serves offline.html
SiteModeOffline = "1"
// SiteModeSetup tells Ember to serve setup route
SiteModeSetup = "2"
// SiteModeBadDB redirects to db-error.html page
SiteModeBadDB = "3"
)
// DbVariant details SQL database variant
type DbVariant string
// Runtime provides access to database, logger and other server-level scoped objects.
// Use Context for per-request values.
type Runtime struct {
Flags Flags
Db *sqlx.DB
StoreProvider StoreProvider
Log Logger
Product domain.Product
Assets embed.FS
}
const (
// DbVariantMySQL is MySQL
DbVariantMySQL DbVariant = "MySQL"
// DBVariantPercona is Percona
DBVariantPercona DbVariant = "Percona"
// DBVariantMariaDB is MariaDB
DBVariantMariaDB DbVariant = "MariaDB"
// DBVariantMSSQL is Microsoft SQL Server
DBVariantMSSQL DbVariant = "MSSQL"
// DBVariantPostgreSQL is PostgreSQL
DBVariantPostgreSQL DbVariant = "PostgreSQL"
)
// StartTx begins database transaction with given transaction isolation level.
// Any error encountered during this operation is logged to runtime logger.
func (r *Runtime) StartTx(i sql.IsolationLevel) (tx *sqlx.Tx, ok bool) {
tx, err := r.Db.BeginTxx(context.Background(), &sql.TxOptions{Isolation: i})
if err != nil {
r.Log.Error("unable to start database transaction", err)
return nil, false
}
return tx, true
}
// Rollback aborts active database transaction.
// Any error encountered during this operation is logged to runtime logger.
func (r *Runtime) Rollback(tx *sqlx.Tx) bool {
if err := tx.Commit(); err != nil {
r.Log.Error("unable to commit database transaction", err)
return false
}
return true
}
// Commit flushes pending changes to database.
// Any error encountered during this operation is logged to runtime logger.
func (r *Runtime) Commit(tx *sqlx.Tx) bool {
if err := tx.Commit(); err != nil {
r.Log.Error("unable to commit database transaction", err)
return false
}
return true
}

91
core/i18n/localize.go Normal file
View file

@ -0,0 +1,91 @@
package i18n
import (
"embed"
"encoding/json"
"fmt"
"strings"
"github.com/documize/community/core/asset"
"github.com/pkg/errors"
)
const (
DefaultLocale = "en-US"
)
var localeMap map[string]map[string]string
// SupportedLocales returns array of locales.
func SupportedLocales() (locales []string) {
locales = append(locales, "en-US")
locales = append(locales, "de-DE")
locales = append(locales, "zh-CN")
locales = append(locales, "pt-BR")
locales = append(locales, "fr-FR")
locales = append(locales, "ja-JP")
locales = append(locales, "it-IT")
locales = append(locales, "es-AR")
return
}
// Intialize will load language files
func Initialize(e embed.FS) (err error) {
localeMap = make(map[string]map[string]string)
locales := SupportedLocales()
for i := range locales {
content, _, err := asset.FetchStatic(e, "i18n/"+locales[i]+".json")
if err != nil {
err = errors.Wrap(err, fmt.Sprintf("missing locale %s", locales[i]))
return err
}
var payload interface{}
json.Unmarshal([]byte(content), &payload)
m := payload.(map[string]interface{})
translations := make(map[string]string)
for j := range m {
translations[j] = m[j].(string)
}
localeMap[locales[i]] = translations
}
return nil
}
// Localize will returns string value for given key using specified locale).
// e.g. locale = "en-US", key = "admin_billing"
//
// Replacements are for replacing string placeholders ({1} {2} {3}) with
// replacement text.
// e.g. "This is {1} example" --> replacements[0] will replace {1}
func Localize(locale string, key string, replacements ...string) (s string) {
l, ok := localeMap[locale]
if !ok {
// fallback
l = localeMap[DefaultLocale]
}
s, ok = l[key]
if !ok {
// missing translation key is echo'ed back
s = fmt.Sprintf("!! %s !!", key)
}
// placeholders are one-based: {1} {2} {3}
// replacements array is zero-based hence the +1 below
if len(replacements) > 0 {
for i := range replacements {
s = strings.Replace(s, fmt.Sprintf("{%d}", i+1), replacements[i], 1)
}
}
return
}

View file

@ -14,10 +14,9 @@ package osutil
import (
"bytes"
"errors"
"fmt"
"os/exec"
"time"
"github.com/documize/community/core/log"
)
var errTimeout = errors.New("conversion timelimit exceeded")
@ -39,7 +38,7 @@ func CommandWithTimeout(command *exec.Cmd, timeout time.Duration) ([]byte, error
select {
case <-time.After(timeout):
if err := command.Process.Kill(); err != nil {
log.Error("failed to kill: ", err)
fmt.Printf("failed to kill: %s", err.Error())
}
<-done // prevent memory leak
//fmt.Println("DEBUG timeout")

29
core/request/url.go Normal file
View file

@ -0,0 +1,29 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
// Package request provides HTTP request parsing functions.
package request
import (
"net/http"
"strings"
)
// IsSSL returns true if Referer header contains "https".
// If Referer header is empty we look at r.TLS setting.
func IsSSL(r *http.Request) bool {
rf := r.Referer()
if len(rf) > 1 {
return strings.HasPrefix(rf, "https")
}
return r.TLS != nil
}

View file

@ -46,6 +46,12 @@ func WriteServerError(w http.ResponseWriter, method string, err error) {
w.Write([]byte("{Error: 'Internal server error'}"))
}
// WriteError notifies HTTP client of general application error.
func WriteError(w http.ResponseWriter, method string) {
writeStatus(w, http.StatusBadRequest)
w.Write([]byte("{Error: 'Internal server error'}"))
}
// WriteDuplicateError notifies HTTP client of duplicate data that has been rejected.
func WriteDuplicateError(w http.ResponseWriter, method, entity string) {
writeStatus(w, http.StatusConflict)
@ -108,3 +114,17 @@ func WriteJSON(w http.ResponseWriter, v interface{}) {
j, _ := json.Marshal(v)
w.Write(j)
}
// WriteText to HTTP response
func WriteText(w http.ResponseWriter, data []byte) {
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
w.WriteHeader(http.StatusOK)
w.Write(data)
}
// WriteXML to HTTP response
func WriteXML(w http.ResponseWriter, data []byte) {
w.Header().Set("Content-Type", "application/xml; charset=utf-8")
w.WriteHeader(http.StatusOK)
w.Write(data)
}

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