Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: PaluMacil/dwn
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.0
Choose a base ref
...
head repository: PaluMacil/dwn
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 6,013 additions and 2,289 deletions.
  1. +2 −0 .gitattributes
  2. +6 −0 .gitignore
  3. +46 −20 .vscode/launch.json
  4. +11 −11 .vscode/settings.json
  5. +69 −69 DEVNOTES.md
  6. +10 −0 Dockerfile
  7. +21 −21 LICENSE
  8. +122 −8 README.md
  9. +0 −38 api/error.go
  10. +0 −34 api/groupapi/all.go
  11. +0 −28 api/groupapi/group.go
  12. +0 −39 api/groupapi/module.go
  13. +0 −65 api/groupapi/permission.go
  14. +0 −27 api/groupapi/user.go
  15. +0 −39 api/infoapi/module.go
  16. +0 −25 api/infoapi/permissions.go
  17. +0 −45 api/infoapi/serverinfo.go
  18. +0 −12 api/infoapi/stopserver.go
  19. +0 −59 api/route.go
  20. +0 −18 api/searchapi/index.go
  21. +0 −35 api/searchapi/module.go
  22. +0 −57 api/searchapi/user.go
  23. +0 −33 api/typeaheadapi/module.go
  24. +0 −36 api/typeaheadapi/user.go
  25. +0 −27 api/userapi/all.go
  26. +0 −33 api/userapi/group.go
  27. +0 −11 api/userapi/logout.go
  28. +0 −33 api/userapi/me.go
  29. +0 −43 api/userapi/module.go
  30. +0 −39 api/userapi/sessions.go
  31. +0 −57 api/userapi/user.go
  32. +0 −54 api/usergroupapi/add.go
  33. +0 −37 api/usergroupapi/module.go
  34. +0 −37 api/usergroupapi/remove.go
  35. +43 −20 application/app.go
  36. +0 −151 auth/auth.go
  37. +0 −65 auth/current.go
  38. +0 −44 auth/google.go
  39. +0 −10 auth/tag.go
  40. +51 −0 cmd/gamescrape/README.md
  41. +125 −0 cmd/gamescrape/config.go
  42. +41 −0 cmd/gamescrape/default.go
  43. +48 −0 cmd/gamescrape/error.go
  44. +27 −0 cmd/gamescrape/files.go
  45. +29 −0 cmd/gamescrape/main.go
  46. +15 −0 cmd/gamescrape/retry.go
  47. +24 −0 cmd/gamescrape/shared.go
  48. +0 −44 configuration/config.go
  49. +0 −49 configuration/env/env.go
  50. +34 −11 database/db.go
  51. +0 −50 database/providers.go
  52. +0 −90 database/repo/session.go
  53. +0 −46 database/repo/setupinfo.go
  54. +0 −81 database/search/userindex.go
  55. +0 −10 database/searchers.go
  56. +202 −0 database/store/badgerstore/badger.go
  57. +13 −0 database/store/badgerstore/options.go
  58. +12 −0 database/store/badgerstore/options_windows.go
  59. +40 −0 database/store/identity.go
  60. +0 −150 database/stores/badgerstore/badger.go
  61. +0 −15 database/stores/badgerstore/gob.go
  62. +0 −16 database/stores/badgerstore/util.go
  63. +0 −127 dwn/models.go
  64. +58 −0 go.mod
  65. +816 −0 go.sum
  66. +10 −5 main.go
  67. +97 −0 module/configuration/api/credential.go
  68. +21 −0 module/configuration/api/routes.go
  69. +7 −0 module/configuration/gob.go
  70. +139 −0 module/configuration/models.go
  71. +18 −0 module/configuration/providers.go
  72. +129 −0 module/configuration/repo/config.go
  73. +65 −0 module/configuration/repo/credential.go
  74. +1 −0 module/core/api/account.go
  75. +149 −0 module/core/api/email.go
  76. +79 −0 module/core/api/groups.go
  77. +100 −0 module/core/api/permissions.go
  78. +79 −0 module/core/api/routes.go
  79. +146 −0 module/core/api/sessions.go
  80. +139 −0 module/core/api/usergroups.go
  81. +125 −0 module/core/api/users.go
  82. +89 −0 module/core/current.go
  83. +12 −0 module/core/gob.go
  84. +60 −0 module/core/group.go
  85. +7 −0 module/core/me.go
  86. +17 −15 {dwn → module/core}/permission.go
  87. +54 −0 module/core/providers.go
  88. +17 −16 {database → module/core}/repo/group.go
  89. +184 −0 module/core/repo/session.go
  90. +25 −24 {database → module/core}/repo/user.go
  91. +17 −19 {database → module/core}/repo/usergroup.go
  92. +166 −0 module/core/search/userindex.go
  93. +12 −0 module/core/searchers.go
  94. +80 −0 module/core/session.go
  95. +102 −0 module/core/user.go
  96. +24 −0 module/core/usergroup.go
  97. +29 −0 module/dashboard/api/board.go
  98. +13 −0 module/dashboard/api/routes.go
  99. +15 −0 module/dashboard/dashboard.go
  100. +9 −0 module/dashboard/favorite.go
  101. +4 −0 module/dashboard/owner.go
  102. +4 −0 module/dashboard/participant.go
  103. +39 −0 module/dashboard/project.go
  104. +22 −0 module/dashboard/providers.go
  105. +20 −0 module/dashboard/repo/dashboard.go
  106. +61 −0 module/dashboard/repo/project.go
  107. +26 −0 module/echo/echo.go
  108. +86 −0 module/echo/history.go
  109. +24 −0 module/echo/shared.go
  110. +12 −0 module/gamelibrary/providers.go
  111. +54 −0 module/logutil/models.go
  112. +17 −0 module/logutil/providers.go
  113. +49 −0 module/logutil/repo/config.go
  114. +20 −0 module/logutil/repo/entry.go
  115. +149 −0 module/oauth/api/flow.go
  116. +18 −0 module/oauth/api/routes.go
  117. +52 −0 module/oauth/google.go
  118. +19 −0 module/registration/api/routes.go
  119. +73 −0 module/registration/api/user.go
  120. +74 −0 module/registration/api/verify.go
  121. +56 −0 module/registration/creation.go
  122. +77 −0 module/server/api/info.go
  123. +13 −0 module/server/api/routes.go
  124. +9 −0 module/setup/gob.go
  125. +23 −0 module/setup/models.go
  126. +11 −0 module/setup/providers.go
  127. +167 −0 module/setup/repo/initialization.go
  128. +79 −0 module/shopping/api/csv.go
  129. +86 −0 module/shopping/api/items.go
  130. +23 −0 module/shopping/api/routes.go
  131. +9 −0 module/shopping/gob.go
  132. +27 −0 module/shopping/models.go
  133. +12 −0 module/shopping/providers.go
  134. +59 −0 module/shopping/repo/item.go
  135. +14 −0 module/typeahead/api/routes.go
  136. +39 −0 module/typeahead/api/users.go
  137. +0 −100 setup/setup.go
  138. +61 −8 spa/spa.go
  139. +49 −0 webserver/errs/error.go
  140. +20 −0 webserver/errs/error_test.go
  141. +40 −0 webserver/handler/404.go
  142. +125 −0 webserver/handler/route.go
  143. +90 −33 webserver/webserver.go
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.go -text
*.mod -text
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
*.exe
*.exe~
/dwn

# data
*.db
*.db.lock
data-test/
data/
*-bak.txt

# compiled output
/dist
/tmp
/out-tsc
debug
debug.test
dwn-server

# dependencies
/node_modules
66 changes: 46 additions & 20 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,47 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "debug",
"remotePath": "",
"port": 2345,
"host": "127.0.0.1",
"program": "${workspaceRoot}",
"env": {},
"args": [],
"showLog": true
}
]
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "DWN",
"type": "go",
"request": "launch",
"mode": "debug",
"remotePath": "",
"port": 2345,
"host": "127.0.0.1",
"program": "${workspaceRoot}",
"env": {},
"args": [],
"showLog": true
},
{
"name": "gamescrape",
"type": "go",
"request": "launch",
"mode": "debug",
"remotePath": "",
"port": 2345,
"host": "127.0.0.1",
"program": "${workspaceRoot}/cmd/gamescrape",
"env": {},
"args": [],
"showLog": true
},
{
"name": "retry",
"type": "go",
"request": "launch",
"mode": "debug",
"remotePath": "",
"port": 2345,
"host": "127.0.0.1",
"program": "${workspaceRoot}/cmd/gamescrape",
"env": {},
"args": ["retry"],
"showLog": true
}
]
}
22 changes: 11 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"go.lintTool": "gometalinter",
"go.lintFlags": [
"--exclude=\"\bexported \\w+ (\\S*['.]*)([a-zA-Z'.*]*) should have comment or be unexported\b\""
],
"cSpell.words": [
"data",
"dgraph",
"storer",
"tmpl"
]
{
"go.lintTool": "gometalinter",
"go.lintFlags": [
"--exclude=\"\bexported \\w+ (\\S*['.]*)([a-zA-Z'.*]*) should have comment or be unexported\b\""
],
"cSpell.words": [
"data",
"dgraph",
"storer",
"tmpl"
]
}
138 changes: 69 additions & 69 deletions DEVNOTES.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
Waiting long time after starting oauth will cause response of

Code exchange failed with 'oauth2: cannot fetch token: 400 Bad Request
Response: {
"error" : "invalid_grant",
"error_description" : "Bad Request"
}'


Badger repro:
Start db, close
start db, panic
start db, truncate, panic
now badger should complain that pointer is to beginning of database, which means whole thing is corrupt

Game library
scoring tools
list of games
mark want to play (unmarked when played)
mark favorites (stays marked)
mark as played
save wishlist
respond to wishlist

Alerts
Expiration
ExpirationActions (e.g. delete or archive alert, lock account)
alerttypes
one time (some system alerts should never be sent an additional time)
user dismissable (usually true, but some only by event, such as verifying an email)
chat
tip
comment reply
post reply
mention
tenant comment
tenant action
site admin (flagged post, server restart)

photo album

file manager
file access: owner only, authenticated (or maybe this is "user" membership), group only
tags (maybe use bleve to return files by tag), bleve should also index file ext, upload user disp name and email, date range
feeds photo albums, profile pictures, images for blogging, downloads, and amazon summary project

forum

blog
stores pre-calculated summary snippets of last X number of posts
post

auth
site registration (non-oauth)
email verification
pw retry lockout (per ip? both ip and overall?)
two factor (mandatory for admins)
session timeout
heartbeat via websockets

pinned content (pin a vault, project, page, etc)

chat

projects: small projects that don't have their own domain but that I want to put behind the auth and data storage of DWN
amazon storage: summary data of one's Amazon history that parses Amazon order CSV, removes duplicates, and shows history (table and charts)
journal: micro blogging only visible to you
personal crm: business card and contact info storage
friend schedule tracker: show if a friend with a weird shift schedule is working
Waiting long time after starting oauth will cause response of

Code exchange failed with 'oauth2: cannot fetch token: 400 Bad Request
Response: {
"error" : "invalid_grant",
"error_description" : "Bad Request"
}'


Badger repro:
Start db, close
start db, panic
start db, truncate, panic
now badger should complain that pointer is to beginning of database, which means whole thing is corrupt

Game library
scoring tools
list of games
mark want to play (unmarked when played)
mark favorites (stays marked)
mark as played
save wishlist
respond to wishlist

Alerts
Expiration
ExpirationActions (e.g. delete or archive alert, lock account)
alerttypes
one time (some system alerts should never be sent an additional time)
user dismissable (usually true, but some only by event, such as verifying an email)
chat
tip
comment reply
post reply
mention
tenant comment
tenant action
site admin (flagged post, server restart)

photo album

file manager
file access: owner only, authenticated (or maybe this is "user" membership), group only
tags (maybe use bleve to return files by tag), bleve should also index file ext, upload user disp name and email, date range
feeds photo albums, profile pictures, images for blogging, downloads, and amazon summary project

forum

blog
stores pre-calculated summary snippets of last X number of posts
post

auth
site registration (non-oauth)
email verification
pw retry lockout (per ip? both ip and overall?)
two factor (mandatory for admins)
session timeout
heartbeat via websockets

pinned content (pin a vault, project, page, etc)

chat

projects: small projects that don't have their own domain but that I want to put behind the auth and data storage of DWN
amazon storage: summary data of one's Amazon history that parses Amazon order CSV, removes duplicates, and shows history (table and charts)
journal: micro blogging only visible to you
personal crm: business card and contact info storage
friend schedule tracker: show if a friend with a weird shift schedule is working

10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM golang as build-server
ADD . /go/src/dwn
WORKDIR /go/src/dwn
RUN go build -o dwn-server

FROM ubuntu
COPY --from=build-server /go/src/dwn/dwn-server /opt/dwn/dwn-server
COPY --from=build-server /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

CMD ["/opt/dwn/dwn-server", "prod"]
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) 2017 Dan Wolf

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License
Copyright (c) 2017 Dan Wolf
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading