* - Refactor several API routes from anonymous functions to regular definitions. Required to add parseable documentation comments.
- Add API documentation comments using Swag Declarative Comments Format
- Add echo-swagger to serve Swagger-UI at /api/index.html
- Fix error response from extraneous parameter resourceId to relatedMemoId in DELETE("/memo/:memoId/relation/:relatedMemoId/type/:relationType")
- Add an auto-generated ./docs/api/v1.md for quick reference on repo (generated by swagger-markdown)
- Add auxiliary scripts to generate docs.go and swagger.yaml
* fix: golangci-lint errors
* fix: go fmt flag in swag scripts
Minor spelling and wording changes
I went through some of english and german localizations to correct or add minor things.
Added `invalid-tag-name` to json. Which also means it should be translated elsewhere.
* Move resource blob save into a independent function
* Support save resouce blob from Telegram like HTTP API
* Support save resouce blob download from URL to LocalStorage or S3
* fix typo
* feat: format message from telegram and download documents
* fix: remove bool in expression
* refactor: convert to markdown
* refactor: resolve remarks and add support new message types
* refactor: resolve remarks
* feat: add test for mime type
---------
Co-authored-by: Александр Тумайкин <AATumaykin@tsum.ru>
* Add telegram.Bot in MessageHandler
* Change single message handler like group messages
* Move message notify wrapper from plugin to server
* Add keyboard buttons on Telegram reply message
* Add support to telegram CallbackQuery update
* Set visibility in callbackQuery
* Change original reply message after callbackQuery
---------
Co-authored-by: Athurg Feng <athurg@gooth.org>
* Add support for download resource from link
* Parse external link and add file ext name from mime info
* Add zh-Hans locale for `download-link`
* fix typo on code and comments
* Update server/resource.go
---------
Co-authored-by: Athurg Feng <athurg@gooth.org>
Co-authored-by: boojack <stevenlgtm@gmail.com>
* Add method to query visibility list by memoIDs
* Add function to get visibility by resourceID
* Check resource visibility in /r/:resourceId/:publicId/:filename
* Check resource visibility in /r/:resourceId/:publicId
---------
Co-authored-by: Athurg Feng <athurg@gooth.org>
* Change all `Robot` to `Bot`
* Change all `r` of `Bot` to `b`
* Change `Robot` to `bot` in comments
* Fix typo
---------
Co-authored-by: Athurg Feng <athurg@gooth.org>
* Add retry wait for telegram.GetUpdates
* Add support to set telegram robot token from UI
* Change validator of UserSettingTelegramUserID
* Add support to set telegram user id from UI
* Fix typescript check
* Add validator for SystemSettingTelegramRobotTokenName
* Optimize error notice while config telegram params
* Change for review
* Fix telegram user id could not be empty
* Fix telegram robot could not be empty
* Fix for eslint (again)
* Update web/src/components/Settings/SystemSection.tsx
---------
Co-authored-by: Athurg Feng <athurg@gooth.org>
Co-authored-by: boojack <stevenlgtm@gmail.com>
* Add support for `publicid` in PathTemplate
* Use `publicid` by default instead of `filename` in filesystem
* Fix blank string of `systemSettingLocalStoragePath` affect incorrectly
* Add ext name to compatible with OS's preview
* Optimize code for systemSettingLocalStoragePath empty
---------
Co-authored-by: Athurg Feng <athurg@gooth.org>
* Fix fail to open file while generate thumbnail
* Fix for Uncontrolled data used in path expression check
---------
Co-authored-by: Athurg Feng <athurg@gooth.org>
* Use disintegration/imaging to optimize thumbnail quality
* Generate thumbnail if not exists while GET it
* Changes for `go mod tidy`
* Changes for golang comments lint
---------
Co-authored-by: Athurg Feng <athurg@gooth.org>
* Add a common function for resize image blob
* Auto generate thumbnail for image resources
* Auto thumbnail support for fetch image resources
* Add support for image thumbnail in view
* Fix missing error check
* Fix es-lint check
* Fix uncontrolled data used in path expression
* Remove thumbnail while origin resource been deleted
* Change the thumbnail's storage path
---------
Co-authored-by: Athurg Feng <athurg@gooth.org>
fix: File size exceeds allowed limit of 0 MiB
This could happen in databases without "max-upload-size-mib" setting.
Now, both the front-end and the back-end will start with a default
limit of 32 MiB, even if the key is absent.
It is still possible to disable uploads by setting the value to 0.
* Add preliminar Windows support for both
development and production environments.
Default profile.Data will be set to "C:\ProgramData\memos" on Windows.
Folder will be created if it does not exist, as this behavior is
expected for Windows applications.
System service installation can be achieved with third-party tools,
explained in docs/windows-service.md.
Not sure if it's worth using https://github.com/kardianos/service
to make service support built-in.
This could be a nice addition alongside #1583 (add Windows artifacts)
* feat: improve Windows support
- Fix local file storage path handling on Windows
- Improve Windows dev script
* feat: add max upload size setting to UI & more
- feat: add max upload size setting to UI
- feat: max upload size setting is checked on UI during upload,
but also enforced by the server
- fix: overflowing mobile layout for Create SSO, Create Storage
and other Settings dialogs
- feat: add HelpButton component with some links to docs were appropriate
- remove LearnMore component in favor of HelpButton
- refactor: change some if/else to switch statements
- refactor: inline some err == nil checks
! Existing databases without the new setting 'max-upload-size-mib'
will show an upload error, but this can be user-fixed by simply
setting the value on system settings UI.
* improvements requested by @boojack
* Add preliminar Windows support for both
development and production environments.
Default profile.Data will be set to "C:\ProgramData\memos" on Windows.
Folder will be created if it does not exist, as this behavior is
expected for Windows applications.
System service installation can be achieved with third-party tools,
explained in docs/windows-service.md.
Not sure if it's worth using https://github.com/kardianos/service
to make service support built-in.
This could be a nice addition alongside #1583 (add Windows artifacts)
* feat: improve Windows support
- Fix local file storage path handling on Windows
- Improve Windows dev script
Add preliminar Windows support for both
development and production environments.
Default profile.Data will be set to "C:\ProgramData\memos" on Windows.
Folder will be created if it does not exist, as this behavior is
expected for Windows applications.
System service installation can be achieved with third-party tools,
explained in docs/windows-service.md.
Not sure if it's worth using https://github.com/kardianos/service
to make service support built-in.
This could be a nice addition alongside #1583 (add Windows artifacts)
* Add option to hide Ask AI and update dev version
* Fix formatting according to eslint
* Replace option to hide Ask AI with auto hiding based on config
* Fix golangci-lint errors
* Remove showAskAI logic from OpenAPI
* feat: add support for resource page on frontend
* [WIP]feat: add backend support for limit and offset search
* feat: add reducer to add resource
* support fetch all resource when first search
* beautify the fetch ui
* restore file
* feat: add all resource before clear resource
* eslint
* i18n
* chore:change the nane
* chore: change the name of param
* eslint
* feat: setIsComplete to true when first loading resource fully
* fix the bug of fetch
* feat change finally to then
* feat: add await and async to clear and search
* feat: return all resource when fetch
* chore: change variable name
* Update web/src/pages/ResourcesDashboard.tsx
Co-authored-by: boojack <stevenlgtm@gmail.com>
* fix missing const value
---------
Co-authored-by: boojack <stevenlgtm@gmail.com>
* fix
* fix bug
* changes
* Revert "changes"
This reverts commit 2b2084c7bd.
* should close the toast if its error also
* no internal errors + sso
* change the text to Incorrect login credentials, please try again
* feat(system): support for disabling public memos
* fix(web/editor): set visibility to private on disabled public memos
* feat(server/memo): find/check if public memos are disabled
* fix(server/memo): handle error for finding system error
* fix(server/memo): unmarshal visiblity when getting system settings
* chore(web): move side effect imports to end
* Update memo.go
---------
Co-authored-by: boojack <stevenlgtm@gmail.com>