* 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