Compare commits

...

2273 Commits

Author SHA1 Message Date
Johnny
fc7dc58720 chore: move archived route 2025-03-13 20:38:14 +08:00
Lincoln Nogueira
e8e393a9cb chore(i18n): tidy (#4497)
- sort all keys alphabetically for easier side-by-side translation

- remove keys from other locales that don't exist anymore in `en.json`

- remove keys from other locales that have missing {{interpolations}}

- add missing entries to pt-BR
2025-03-13 20:37:50 +08:00
XIN_____
1762496e79 chore: update zh-hans text for rename-tag (#4496)
* Update RenameTagDialog.tsx

Co-authored-by: kiss-fire <iamtaoxin@gmail.com>

* Update zh-Hans.json

Co-authored-by: kiss-fire <iamtaoxin@gmail.com>

---------

Co-authored-by: kiss-fire <iamtaoxin@gmail.com>
2025-03-13 20:00:22 +08:00
Johnny
34ab88348e chore: sort by pinned 2025-03-13 19:57:12 +08:00
Johnny
d794e6db76 chore: remove internal frontend cache 2025-03-13 11:23:27 +08:00
XIN_____
81e40d9b18 chore: update i18n for tag reame (#4493)
* feat: update i18n for zh-hans

* Update zh-Hans.json

---------

Co-authored-by: KissFire <53330905+kiss-fire@users.noreply.github.com>
2025-03-13 09:20:46 +08:00
Johnny
fc5962f6a4 feat: show pinned count 2025-03-12 23:33:51 +08:00
Johnny
fb3c17d0e9 chore: update mobile header 2025-03-12 22:21:22 +08:00
Johnny
0dfcb1a7c8 feat: total memo count 2025-03-12 22:15:46 +08:00
Johnny
3349311b51 chore: update frontend dependencies 2025-03-12 21:05:32 +08:00
Heiko
775673d17f fix: update README.md (#4492)
Fixed link for contribution
2025-03-12 20:35:10 +08:00
XIN_____
1edb9e6774 feat: update i18n for zh-hans (#4488)
* chore:memo filter support i18n for zh-hans

* feat: restore addFilter method value field in StatisticsView.tsx

* chore: change getFilterDisplayText for i18n

* chore: add string type in utils/i18n

* feat: using switch to avoid change TranslationType

* feat: eslint check

* feat: eslint fix
2025-03-12 16:54:04 +08:00
Simon
690f28bed8 feat: add loading spinner during file upload process (#4491)
* show LoaderIcon while uploading file

* fix spacing for eslint
2025-03-12 09:56:22 +08:00
Johnny
7a438be08d chore: update user stats 2025-03-12 09:14:43 +08:00
Johnny
e3a4f49c5c feat: implement creator_id factor 2025-03-11 22:00:57 +08:00
Johnny
ba52a786f9 chore: update canary image 2025-03-11 10:23:38 +08:00
wrrrzr
b0392954f4 Add executable permission to scripts/build.sh (#4486) 2025-03-11 09:00:42 +08:00
Johnny
7123a2cf51 chore: remove sort by pinned 2025-03-10 21:32:17 +08:00
Johnny
ff13e0f353 chore: add legacy plugin 2025-03-10 18:57:48 +08:00
Johnny
925e97882e feat: support pinned factor 2025-03-10 18:52:12 +08:00
Johnny
90119c1af8 refactor: move memo property 2025-03-07 22:53:35 +08:00
Johnny
3401def442 chore: simplify memo filters 2025-03-06 23:10:20 +08:00
Johnny
16a0872972 chore: enable auto compact by default 2025-03-06 23:02:12 +08:00
Johnny
56ad8ab3bd refactor: view store 2025-03-06 21:38:54 +08:00
Johnny
2e0467e3d1 fix: mobile header 2025-03-06 20:46:16 +08:00
Lincoln Nogueira
d7d3568ba4 chore(i18n): update pt-BR (#4471) 2025-03-06 09:21:44 +08:00
Johnny
c668073cf3 chore: update resource view 2025-03-05 23:08:44 +08:00
Johnny
92a44e26b9 chore: remove emoji regex 2025-03-04 22:56:46 +08:00
XIN_____
6ed6b86a75 chore: update i18n zh-hans (#4467)
* Update MemoDisplaySettingMenu.tsx

Masonry View

* Update en.json

* Update zh-Hans.json
2025-03-04 22:43:48 +08:00
Johnny
36d458fe88 chore: update masonry scale 2025-03-03 22:41:18 +08:00
Johnny
7592e5fe76 fix: masonry state 2025-03-03 09:23:40 +08:00
Johnny
d6be20b917 feat: implement masonry view 2025-03-02 23:27:12 +08:00
Johnny
a8713ec639 chore: update backend dependencies 2025-03-02 21:58:46 +08:00
Johnny
32da704be6 chore: update frontend dependencies 2025-03-02 21:55:55 +08:00
dependabot[bot]
858053e3b1 chore: bump @dnd-kit/sortable from 8.0.0 to 10.0.0 in /web (#4454)
Bumps [@dnd-kit/sortable](https://github.com/clauderic/dnd-kit/tree/HEAD/packages/sortable) from 8.0.0 to 10.0.0.
- [Release notes](https://github.com/clauderic/dnd-kit/releases)
- [Changelog](https://github.com/clauderic/dnd-kit/blob/master/packages/sortable/CHANGELOG.md)
- [Commits](https://github.com/clauderic/dnd-kit/commits/@dnd-kit/sortable@10.0.0/packages/sortable)

---
updated-dependencies:
- dependency-name: "@dnd-kit/sortable"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-02 17:47:19 +08:00
dependabot[bot]
b36e2b630a chore: bump @bufbuild/buf from 1.48.0 to 1.50.0 in /web (#4452)
Bumps [@bufbuild/buf](https://github.com/bufbuild/buf) from 1.48.0 to 1.50.0.
- [Release notes](https://github.com/bufbuild/buf/releases)
- [Changelog](https://github.com/bufbuild/buf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bufbuild/buf/compare/v1.48.0...v1.50.0)

---
updated-dependencies:
- dependency-name: "@bufbuild/buf"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-02 17:47:09 +08:00
dependabot[bot]
c24ad79b36 chore: bump vite from 6.0.6 to 6.2.0 in /web (#4451)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.0.6 to 6.2.0.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/create-vite@6.2.0/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-02 17:46:59 +08:00
dependabot[bot]
9a0a1f0baf chore: bump i18next from 24.2.0 to 24.2.2 in /web (#4453)
Bumps [i18next](https://github.com/i18next/i18next) from 24.2.0 to 24.2.2.
- [Release notes](https://github.com/i18next/i18next/releases)
- [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md)
- [Commits](https://github.com/i18next/i18next/compare/v24.2.0...v24.2.2)

---
updated-dependencies:
- dependency-name: i18next
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-02 17:46:50 +08:00
dependabot[bot]
8ab77442f5 chore: bump fuse.js from 7.0.0 to 7.1.0 in /web (#4455)
Bumps [fuse.js](https://github.com/krisk/Fuse) from 7.0.0 to 7.1.0.
- [Release notes](https://github.com/krisk/Fuse/releases)
- [Changelog](https://github.com/krisk/Fuse/blob/main/CHANGELOG.md)
- [Commits](https://github.com/krisk/Fuse/compare/v7.0.0...v7.1.0)

---
updated-dependencies:
- dependency-name: fuse.js
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-02 17:46:25 +08:00
dependabot[bot]
ea9db2ff56 chore: bump github.com/aws/aws-sdk-go-v2/credentials from 1.17.48 to 1.17.61 (#4460)
chore: bump github.com/aws/aws-sdk-go-v2/credentials

Bumps [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) from 1.17.48 to 1.17.61.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.48...credentials/v1.17.61)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/credentials
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-02 17:46:12 +08:00
Johnny
8acded1f23 chore: fix linter 2025-03-02 15:40:16 +08:00
Johnny
372fc3655a refactor: retire less 2025-03-02 15:34:21 +08:00
dependabot[bot]
4ed6862423 chore: bump pnpm/action-setup from 4.0.0 to 4.1.0 (#4456)
Bumps [pnpm/action-setup](https://github.com/pnpm/action-setup) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/pnpm/action-setup/releases)
- [Commits](https://github.com/pnpm/action-setup/compare/v4.0.0...v4.1.0)

---
updated-dependencies:
- dependency-name: pnpm/action-setup
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-02 12:21:42 +08:00
dependabot[bot]
69ea9eac94 chore: bump google.golang.org/protobuf from 1.35.2 to 1.36.5 (#4458)
Bumps google.golang.org/protobuf from 1.35.2 to 1.36.5.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-02 12:21:30 +08:00
dependabot[bot]
459e8e9589 chore: bump modernc.org/sqlite from 1.34.2 to 1.36.0 (#4457)
Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.34.2 to 1.36.0.
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.34.2...v1.36.0)

---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-02 12:21:17 +08:00
dependabot[bot]
d107373ae9 chore: bump github.com/google/cel-go from 0.23.2 to 0.24.1 (#4459)
Bumps [github.com/google/cel-go](https://github.com/google/cel-go) from 0.23.2 to 0.24.1.
- [Release notes](https://github.com/google/cel-go/releases)
- [Commits](https://github.com/google/cel-go/compare/v0.23.2...v0.24.1)

---
updated-dependencies:
- dependency-name: github.com/google/cel-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-02 12:21:06 +08:00
dependabot[bot]
4e5b9d39b3 chore: bump github.com/spf13/cobra from 1.8.1 to 1.9.1 (#4461)
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.8.1 to 1.9.1.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.8.1...v1.9.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-02 12:20:50 +08:00
xt
7651c454fd chore: chinese localization enhancements (#4450)
* Chinese localization enhancements

* Fix for eslint

* Chinese localization fixed
2025-02-28 17:45:50 +08:00
Johnny
5562282822 chore: update demo site 2025-02-27 23:05:43 +08:00
Johnny
47b41bce85 refactor: move memo relation definition 2025-02-27 15:28:36 +08:00
Johnny
ba98fddbaf chore: go mod tidy 2025-02-27 15:12:25 +08:00
Johnny
5bb4a300db chore: bump gomark 2025-02-27 15:10:39 +08:00
Johnny
012405f7fd refactor: user stats state 2025-02-26 22:58:22 +08:00
Johnny
81502d9092 fix: stats requests 2025-02-26 22:32:26 +08:00
Johnny
b897b243e5 feat: dynamic fetch user stats 2025-02-26 22:29:59 +08:00
Johnny
5d1075a647 refactor: update home layout 2025-02-26 22:14:07 +08:00
Johnny
0da3859878 chore: bump version to 0.24.1 2025-02-26 21:41:57 +08:00
Johnny
b56aa397b2 chore: update assets routes 2025-02-26 21:40:28 +08:00
Johnny
f60906ce33 chore: tweak vite config 2025-02-26 21:21:46 +08:00
nbb
5962c6d04b feat: optimize initial load performance by implementing lazy loading and code splitting (#4445) 2025-02-26 13:16:05 +08:00
Johnny
bef67638c1 chore: fix home route 2025-02-25 23:34:55 +08:00
Johnny
8e4e745ba9 chore: update navigation 2025-02-25 23:13:48 +08:00
XIN_____
3a7b24bd01 chore: add cursor-pointer to memo's display time (#4441)
feat: memo title add cursor-pointer when mouse hover
2025-02-25 10:13:04 +08:00
Johnny
271a8c8c28 refactor: home layout 2025-02-24 23:42:35 +08:00
Johnny
9107a941ca chore: update linter config 2025-02-24 22:21:07 +08:00
Johnny
f98c519834 fix: linter 2025-02-24 22:04:25 +08:00
Johnny
66a4b04454 chore: update readme 2025-02-24 22:01:36 +08:00
Johnny
0200ce7681 chore: upgrade golangci-lint 2025-02-24 21:50:39 +08:00
Johnny
bbca130d62 chore: bump golang version 2025-02-24 21:47:57 +08:00
XIN_____
a0fabaf012 chore: update cn-zh i18n (#4435) 2025-02-24 10:43:24 +08:00
Michael Baumgarten
9f01b451df feat: match sublist indentation when adding a new item (#4433)
* match sublist indentation

* recursively get last node

* fix linting issues
2025-02-22 20:48:39 +08:00
MHZ
964ae16851 feat: support YouTube video thumbnail in link preview (#4427) 2025-02-22 20:46:58 +08:00
MHZ
f17774cb3b feat: prevent attackers from exploiting redirect attack GetLinkMetadata API (#4428)
fix: Prevent attackers from exploiting redirect attack GetLinkMetadata API.
2025-02-21 17:29:17 +08:00
Johnny
bc97b66f36 fix: serial updates 2025-02-20 21:38:36 +08:00
johnnyjoy
f15fd42ed5 fix: inboxes state 2025-02-20 20:51:08 +08:00
johnnyjoy
7a685d6435 fix: fetch user by username 2025-02-20 20:43:28 +08:00
XIN_____
1ebe2e9aae chore: update chinese i18n for settings section (#4424) 2025-02-20 20:21:59 +08:00
Johnny
ea165db751 chore: update README.md 2025-02-20 17:43:47 +08:00
Johnny
c088c5b26a feat: render emoji from shortcut title 2025-02-19 22:13:32 +08:00
Johnny
37eceabc94 chore: fix memo view gap 2025-02-19 22:02:41 +08:00
Johnny
cdbaf805b7 chore: pnpm install 2025-02-19 22:00:12 +08:00
Johnny
e528203cde chore: remove unused deps 2025-02-19 21:59:45 +08:00
MHZ
f8c973c938 fix: prevent previewing internal network web pages. (#4421) 2025-02-19 21:55:24 +08:00
Johnny
2aaaef79f7 chore: fix tests 2025-02-18 22:32:30 +08:00
Johnny
2dc7766fd0 fix: content contains for postgres 2025-02-18 22:28:25 +08:00
taosin
00932d18f5 feat: update i18n zh-hans (#4416) 2025-02-18 10:47:01 +08:00
taosin
6fdfe6b118 chore: update chinese i18n (#4414) 2025-02-17 17:52:18 +08:00
ProjectOrangeJuice
9f25bb2034 feat: trim space on webhook url (#4411) 2025-02-17 10:16:01 +08:00
MHZ
174b8b048a feat: support blur processing for NSFW content with customizable NSFW tags (#4407) 2025-02-16 23:35:31 +08:00
Johnny
47a9b434e6 fix: translate in members section 2025-02-16 22:34:35 +08:00
Johnny
5686fdfb0a chore: handle redirect 2025-02-16 22:17:48 +08:00
Johnny
f5394a3e32 chore: update golangci config 2025-02-16 21:42:33 +08:00
Johnny
9299c216e2 chore: move migration to 0.24.0 2025-02-16 21:02:18 +08:00
taosin
a7fef80384 chore: update chinese i18n at member setting section (#4405) 2025-02-16 21:00:37 +08:00
Chris Dzombak
d25f355392 chore: allow storing resource references >256 chars long in mysql (#4408)
fix: allow storing resource references >256 chars long in mysql
2025-02-16 18:20:51 +08:00
boojack
04d7ba48e5 chore: remove default gzip middleware 2025-02-13 22:00:55 +08:00
Johnny
920b0f64f2 chore: extract auth footer 2025-02-12 22:05:58 +08:00
taosin
3c71ee9d7b chore: update i18n chinese (#4400) 2025-02-12 16:43:44 +08:00
xt
4cd2aa6f32 chore: chinese localization enhancements (#4397)
* Chinese localization enhancements

* Fix for eslint
2025-02-12 10:13:09 +08:00
Johnny
7a57b5c6e7 refactor: user store 2025-02-11 21:29:16 +08:00
Johnny
11b9c240e9 refactor: workspace setting store 2025-02-11 21:23:46 +08:00
Kevin Clark
e27f6f0c52 chore: update LICENSE (#4394)
This PR updates the Copyright information for memos.
Related to usememos/memos#4393
2025-02-11 15:45:20 +08:00
Johnny
9027430646 fix: store reactive 2025-02-10 22:20:07 +08:00
CyberSlinger
01a9bb2d49 feat: add zh hans text (#4384)
* feat: test dev push

* feat: add zh Hans text

* feat: restore readme

* feat: update zh hans text

* feat: add tag for properties label

* feat: updarte zh hans translation

* feat: add tab
2025-02-10 10:19:19 +08:00
Simon
c9edac9d5a chore: update i18n Ukrainian (#4385)
* Update uk.json

* Update uk.json

* Update uk.json

* Update uk.json

* Update uk.json

* Update uk.json

* Update uk.json
2025-02-10 10:18:55 +08:00
Martin Hartl
ae85dff5e4 chore: add id to RSS feed items (#4383) 2025-02-09 22:24:23 +08:00
Johnny
6abd51fe5a chore: update resource storage type comment 2025-02-09 12:56:30 +08:00
Johnny
49332851d4 chore: go mod tidy 2025-02-09 11:50:16 +08:00
Johnny
0a429a899f chore: remove version update activity 2025-02-09 11:48:53 +08:00
Johnny
983323ceef chore: remove debug code 2025-02-09 11:44:15 +08:00
Johnny
5a2f18da69 refactor(frontend): retire redux 2025-02-09 11:43:55 +08:00
johnnyjoy
13f6fa7b37 refactor: remove default visibility in workspace setting 2025-02-08 11:40:31 +08:00
Steven
9957f8e290 chore: move dsn output to dev mode 2025-02-07 20:59:14 +08:00
Steven
4dfe078f3e chore: tweak memo link is rss 2025-02-07 20:55:38 +08:00
Steven
f6ad49754a chore: update url of memo detail page 2025-02-07 20:51:04 +08:00
shungiku
8be0ddfb35 chore: add datepicker to calendar month (#4379)
Co-authored-by: shungiku <79780196+shungikuk@users.noreply.github.com>
2025-02-07 12:53:02 +08:00
Steven
e09819da53 chore: add MemoFilters to explore sidebar 2025-02-06 23:35:25 +08:00
Steven
2ed3e34636 refactor: update root layout 2025-02-06 23:20:37 +08:00
johnnyjoy
505fee1abb chore: add noreferrer to external links 2025-02-06 20:19:58 +08:00
johnnyjoy
3a3ffe633d chore: remove latest tag 2025-02-06 19:48:51 +08:00
johnnyjoy
0e303181a9 chore: update action's title 2025-02-06 19:45:05 +08:00
johnnyjoy
849bf66612 fix: remove outdated factor 2025-02-06 19:38:53 +08:00
𝗦𝗵𝗟𝗲𝗿𝗣
48988a8814 fea: improve Turkish Locales (#4375) 2025-02-06 19:11:02 +08:00
Steven
dfacb33abe chore: update release action by branch 2025-02-06 09:15:12 +08:00
Steven
84ef3558ab chore: update release action by branch 2025-02-06 09:12:42 +08:00
wzc90
3f33ccd906 fix: update 01__memo_pinned.sql (#4370) 2025-02-06 09:08:31 +08:00
Steven
7996586488 chore: fix migration script for sqlite 2025-02-05 20:56:46 +08:00
johnnyjoy
54a48b58d7 chore: remove random field 2025-02-05 20:48:27 +08:00
johnnyjoy
2a8c4cb750 chore: update styles 2025-02-05 20:30:22 +08:00
johnnyjoy
07336f0392 chore: update condition concat check 2025-02-05 20:07:38 +08:00
johnnyjoy
64dfadb538 chore: update readme 2025-02-05 19:51:09 +08:00
johnnyjoy
732a7d0bbf chore: add fa locale 2025-02-05 19:26:34 +08:00
spidtzz
d8b3a69c31 feat: add Farsi(Persian) localazation (#4364)
Add files via upload
2025-02-05 19:19:29 +08:00
shungiku
c2210b65ee fix: calendar coloring issue (#4352)
* fix: calendar coloring issue

* fix: calendar coloring issue

* fix: calendar coloring issue

* fix: calendar coloring issue

* fix: calendar coloring issue

* chore: adjust calendar color for dark theme
2025-02-05 11:13:25 +08:00
RoccoSmit
03267d6d37 feat: search for multiple words (#4362) 2025-02-04 21:04:36 +08:00
johnnyjoy
6c088e09d9 chore: fix import order 2025-02-03 18:35:16 +08:00
johnnyjoy
a7ca63434b feat: validate shortcut's filter 2025-02-03 18:34:31 +08:00
johnnyjoy
8f35086da7 chore: update docs link 2025-02-03 18:23:50 +08:00
johnnyjoy
ff04fdc459 feat: support more operators in filter 2025-02-03 18:23:09 +08:00
johnnyjoy
03189ee3b2 chore: remove corepack in dockerfile 2025-02-03 17:50:33 +08:00
johnnyjoy
f25acfe8e2 chore: fix linter 2025-02-03 17:34:46 +08:00
johnnyjoy
e0e735d14d feat: support memo filter for mysql and postgres 2025-02-03 17:14:53 +08:00
hchengting
0f8b7b7fe6 fix: show loader icon while refreshing (#4358) 2025-02-03 15:59:46 +08:00
johnnyjoy
503c892abf chore: buf generate 2025-02-03 15:09:37 +08:00
johnnyjoy
b734d429ec chore: fix linter warning 2025-02-03 13:08:13 +08:00
johnnyjoy
364f005ee5 fix: filter 2025-02-03 12:44:01 +08:00
johnnyjoy
2db86f6644 feat: implement shortcut components 2025-02-03 12:26:44 +08:00
johnnyjoy
3a085f3639 chore: fix filter tests 2025-02-03 12:01:34 +08:00
johnnyjoy
8e586d348e chore: fix tag filter 2025-02-03 11:45:26 +08:00
johnnyjoy
bf5a29524a chore: remove drop index 2025-02-03 11:45:15 +08:00
johnnyjoy
6682917931 chore: add validate only to create shortcut 2025-02-03 11:45:05 +08:00
johnnyjoy
81e8aed6ab chore: move part of memo filter 2025-02-02 20:28:24 +08:00
johnnyjoy
fafd6d81c7 chore: fix linter warning 2025-02-02 18:50:51 +08:00
johnnyjoy
be5e24c0eb refactor: renovate list memos endpoint 2025-02-02 18:43:26 +08:00
johnnyjoy
14c72fa7df feat: implement shortcuts 2025-02-02 17:11:52 +08:00
johnnyjoy
b9a0c56163 feat: support more factors in filter 2025-02-02 16:12:44 +08:00
johnnyjoy
2a392b8f8d chore: fix import order 2025-02-02 13:52:45 +08:00
johnnyjoy
f31800456e chore: fix import order 2025-02-02 13:52:29 +08:00
johnnyjoy
58a867e4da fix: linter warning 2025-02-02 13:50:36 +08:00
johnnyjoy
2d731c5cc5 feat: memo filter for sqlite 2025-02-02 13:35:57 +08:00
johnnyjoy
0af08d9c06 chore: add if exists to postgres 2025-02-02 13:19:56 +08:00
johnnyjoy
e6cd761787 chore: remove cgo 2025-02-02 13:07:11 +08:00
dependabot[bot]
66db662e33 chore: bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.66.3 to 1.75.2 (#4346)
chore: bump github.com/aws/aws-sdk-go-v2/service/s3

Bumps [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2) from 1.66.3 to 1.75.2.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.66.3...service/s3/v1.75.2)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/s3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-02 09:41:26 +08:00
dependabot[bot]
9f99a7de35 chore: bump @types/leaflet from 1.9.15 to 1.9.16 in /web (#4340)
Bumps [@types/leaflet](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/leaflet) from 1.9.15 to 1.9.16.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/leaflet)

---
updated-dependencies:
- dependency-name: "@types/leaflet"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-02 09:40:43 +08:00
dependabot[bot]
ed3923e1ba chore: bump typescript from 5.7.2 to 5.7.3 in /web (#4341)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.7.2 to 5.7.3.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.7.2...v5.7.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-02 09:40:30 +08:00
dependabot[bot]
0eed9d5839 chore: bump less from 4.2.1 to 4.2.2 in /web (#4342)
Bumps [less](https://github.com/less/less.js) from 4.2.1 to 4.2.2.
- [Release notes](https://github.com/less/less.js/releases)
- [Changelog](https://github.com/less/less.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/less/less.js/compare/v4.2.1...v4.2.2)

---
updated-dependencies:
- dependency-name: less
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-02 09:40:21 +08:00
dependabot[bot]
a80e407dc5 chore: bump @radix-ui/react-popover from 1.1.4 to 1.1.5 in /web (#4343)
Bumps [@radix-ui/react-popover](https://github.com/radix-ui/primitives) from 1.1.4 to 1.1.5.
- [Changelog](https://github.com/radix-ui/primitives/blob/main/release-process.md)
- [Commits](https://github.com/radix-ui/primitives/commits)

---
updated-dependencies:
- dependency-name: "@radix-ui/react-popover"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-02 09:40:13 +08:00
dependabot[bot]
2322f989ea chore: bump actions/stale from 9.0.0 to 9.1.0 (#4344)
Bumps [actions/stale](https://github.com/actions/stale) from 9.0.0 to 9.1.0.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v9.0.0...v9.1.0)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-02 09:40:04 +08:00
dependabot[bot]
00dd54bae4 chore: bump github.com/lithammer/shortuuid/v4 from 4.0.0 to 4.2.0 (#4345)
Bumps [github.com/lithammer/shortuuid/v4](https://github.com/lithammer/shortuuid) from 4.0.0 to 4.2.0.
- [Release notes](https://github.com/lithammer/shortuuid/releases)
- [Commits](https://github.com/lithammer/shortuuid/compare/v4.0.0...v4.2.0)

---
updated-dependencies:
- dependency-name: github.com/lithammer/shortuuid/v4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-02 09:39:55 +08:00
dependabot[bot]
e034254807 chore: bump github.com/google/cel-go from 0.22.1 to 0.23.2 (#4347)
Bumps [github.com/google/cel-go](https://github.com/google/cel-go) from 0.22.1 to 0.23.2.
- [Release notes](https://github.com/google/cel-go/releases)
- [Commits](https://github.com/google/cel-go/compare/v0.22.1...v0.23.2)

---
updated-dependencies:
- dependency-name: github.com/google/cel-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-02 09:39:42 +08:00
dependabot[bot]
1e9d8f7460 chore: bump golang.org/x/net from 0.33.0 to 0.34.0 (#4348)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.33.0 to 0.34.0.
- [Commits](https://github.com/golang/net/compare/v0.33.0...v0.34.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-02 09:39:33 +08:00
dependabot[bot]
cda5a5baa4 chore: bump github.com/aws/aws-sdk-go-v2 from 1.32.7 to 1.36.0 (#4349)
Bumps [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) from 1.32.7 to 1.36.0.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.32.7...v1.36.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-02 09:39:21 +08:00
dependabot[bot]
7a21391446 chore: bump @github/relative-time-element from 4.4.4 to 4.4.5 in /web (#4339)
Bumps [@github/relative-time-element](https://github.com/github/relative-time-element) from 4.4.4 to 4.4.5.
- [Release notes](https://github.com/github/relative-time-element/releases)
- [Commits](https://github.com/github/relative-time-element/compare/v4.4.4...v4.4.5)

---
updated-dependencies:
- dependency-name: "@github/relative-time-element"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-02 09:36:29 +08:00
Xiao Wei
37a81f9d28 fix: migrate sql error (#4338)
* fix: migrate sql error

sqlite not support postgres sql

* Apply suggestions from code review

---------

Co-authored-by: Johnny <yourselfhosted@gmail.com>
2025-02-01 22:11:17 +08:00
johnnyjoy
0b85cb567e chore(frontend): fix clsx 2025-02-01 22:04:29 +08:00
johnnyjoy
57014e392f feat: get user by username 2025-02-01 18:00:22 +08:00
johnnyjoy
45c16f9d52 chore: fix linter 2025-02-01 12:53:48 +08:00
johnnyjoy
0dcd0904e8 refactor: remove resource uid 2025-02-01 12:50:15 +08:00
johnnyjoy
97d12db3d5 refactor: renovate create memo 2025-02-01 11:48:22 +08:00
johnnyjoy
98aa0b73c5 refactor: retire memo uid 2025-02-01 11:28:07 +08:00
johnnyjoy
b0119f320a chore: tweak migration scripts 2025-02-01 11:19:36 +08:00
johnnyjoy
5e770dda52 refactor: memo name 2025-02-01 11:17:36 +08:00
RoccoSmit
2f4c5d7bc2 fix: cancel out of no changes save (#4335)
Cancel out of trying to save
2025-02-01 08:30:04 +08:00
johnnyjoy
9bd6d17864 chore: add migration script 2025-01-31 22:00:05 +08:00
johnnyjoy
39d4d4f4f3 chore: update migrate scripts 2025-01-31 21:05:20 +08:00
johnnyjoy
d605faeffa refactor: move pinned to memo 2025-01-31 20:58:18 +08:00
johnnyjoy
2058a8ab7b chore: move references to memo property 2025-01-31 14:18:07 +08:00
thehijacker
3fa690964e chore: update Slovenian translation (#4329)
Co-authored-by: Andrej Kralj <andrej.kralj@gmail.com>
2025-01-31 13:39:07 +08:00
Viacheslav Potoropin
7ed3a12a64 fix: internal error on pin/unpin (#4332) 2025-01-31 13:38:43 +08:00
Zero King
5ec3150e0e fix: use correct separator in migration file name (#4327)
Fixes: e913271f15 ("refactor: move tags from property to payload (#4229)")
2025-01-30 12:26:14 +08:00
johnnyjoy
75fd4223bf chore: bump version 2025-01-29 23:41:50 +08:00
changchiakai
9172e47c33 chore: update zh-Hant (#4324)
Update zh-Hant

Co-authored-by: changchiakai <changeric1031@gmail.com>
2025-01-29 09:56:20 +08:00
Philipp Mundhenk
63bbeb9ca3 chore: link to SSO Documentation (#4319)
* Update SSOSection.tsx

linked to SSO (links to Authentik, Authelia, Keycloak), instead of Keycloak only

* Update id.json

* Update uk.json

* Update fr.json

* Update pt-PT.json

* Update vi.json

* Update uk.json

* Update de.json

* Update en.json
2025-01-26 23:03:56 +08:00
Pavel Stržínek
0435a67aa7 feat: czech locale support (#4316) 2025-01-26 23:03:11 +08:00
johnnyjoy
0334a4845f chore: tweak calendar styles 2025-01-21 22:55:57 +08:00
johnnyjoy
ef3b7ac6ae chore: update tag icon 2025-01-21 22:55:35 +08:00
johnnyjoy
f9b1df5d13 fix: tags container 2025-01-21 22:46:09 +08:00
Comix
d9a92b2ef8 feat: support path style of s3 url (#4304)
Signed-off-by: ComixHe <ComixHe1895@outlook.com>
2025-01-21 18:02:21 +08:00
johnnyjoy
702c092289 chore: update auth message 2025-01-20 19:38:50 +08:00
johnnyjoy
409d64b839 chore: update memo comment in activity 2025-01-20 19:34:23 +08:00
johnnyjoy
f1308ddd27 refactor: update part of resource identifier 2025-01-19 23:03:22 +08:00
johnnyjoy
cda18a37c0 chore: remove docs 2025-01-19 10:50:49 +08:00
johnnyjoy
3c0d011085 chore(dev): update build guides 2025-01-19 10:46:35 +08:00
johnnyjoy
f1eacfefb0 chore(dev): update build directory 2025-01-19 10:33:04 +08:00
Steven
edc3f1d9d9 chore: retire unused memo view 2025-01-16 09:20:01 +08:00
Steven
147458347b chore: tweak user stats in frontend 2025-01-16 09:12:47 +08:00
johnnyjoy
6904dc16af chore: fix linter 2025-01-15 22:33:18 +08:00
johnnyjoy
c76ab87a0a refactor: update list user stats 2025-01-15 19:25:36 +08:00
Steven
8b65d248b1 fix: memo filter 2025-01-14 00:05:33 +08:00
johnnyjoy
ee96465be0 feat: list user stats 2025-01-13 23:14:44 +08:00
johnnyjoy
cde058c72a chore: tweak theme code 2025-01-13 19:46:06 +08:00
Query&mut NinjaStyle, &Ryder
94517490f5 fix: mermaid diagrams in dark mode (#4289)
* fix #4257 fixed ui for mermaid diagrams in dark mode

* fixed linting issues

* added dynamic color theme for mermaid diagrams

* now mermaid block uses theme according to the system as well when 'follow system' is selected

* refactored code for mermaid theme logic

* refactored mermaid code to use const instead of function call

---------

Co-authored-by: root <root@DESKTOP-G3MCU14>
2025-01-13 19:44:53 +08:00
johnnyjoy
d050a6fd46 chore: update user stats 2025-01-11 20:12:02 +08:00
johnnyjoy
34c26a394a feat: implement user stats endpoint 2025-01-11 16:59:22 +08:00
Steven
5ff8ab9a61 chore: polish creator definition 2025-01-10 23:39:50 +08:00
Steven
8b7e9f5443 chore: remove unused user id 2025-01-10 23:35:00 +08:00
RoccoSmit
3081015692 feat: date picker navigation (#4286)
Added month and year dropdowns
2025-01-10 22:46:08 +08:00
johnnyjoy
2cd524e4fa chore: fix buf format 2025-01-10 22:29:57 +08:00
johnnyjoy
a1be73cce3 chore: buf format 2025-01-10 22:26:19 +08:00
johnnyjoy
c1498a1844 chore: retire webhook state 2025-01-10 22:24:12 +08:00
johnnyjoy
2a861ea430 refactor: tweak resource state in api 2025-01-10 22:20:23 +08:00
johnnyjoy
1caaef1c5b chore: fix memo compact mode 2025-01-10 21:47:00 +08:00
Query&mut NinjaStyle, &Ryder
972ebbae2f fix: compact mode storage (#4279)
fix #4274 now when checkbox is toggled the memo remembers the compact state

Co-authored-by: root <root@DESKTOP-G3MCU14>
2025-01-10 20:43:46 +08:00
johnnyjoy
ac7121c21a chore: update archived page 2025-01-10 20:24:05 +08:00
johnnyjoy
5d40f38956 chore: fix name comments 2025-01-09 21:35:02 +08:00
Steven
840b16f041 chore: tweak back to top button 2025-01-08 22:59:08 +08:00
Steven
012ca1d780 fix: tag stats 2025-01-08 22:35:34 +08:00
johnnyjoy
d9d6f73330 chore: fix memo converter 2025-01-08 20:57:34 +08:00
johnnyjoy
65da94521d chore: buf generate 2025-01-08 20:29:20 +08:00
Pierre Quillery
cdadf133d0 chore: adding missing translations (#4273)
* Added missing translations strings (filters, about page, ...)

* Forgot one translation string.

* Fixed PR issues and added Access Token related missing translation strings.

* Fixed eslint issues.

* Fixed eslint issues #2.

* Fixed access token dialog translations, added missing webhook dialog translations.
2025-01-08 10:24:41 +08:00
Chris Curry
7b909fb772 feat: scroll to top (#4244) 2025-01-04 23:44:37 +08:00
Chris Curry
d81174ad7c feat: optimize filters sync (#4260)
* refactor: add bi-directional filters sync between filterStore and searchParams

* fix: tag redirection from memos detail page, https://github.com/usememos/memos/issues/4232
2025-01-04 23:42:49 +08:00
tungerno
e3d1967db8 chore: add missing german translations (#4268) 2025-01-04 23:42:29 +08:00
Pierre Quillery
50d09bb91e chore: added missing French translations (#4270)
Added missing French translations.
2025-01-04 23:42:09 +08:00
dependabot[bot]
828461d430 chore: bump golang.org/x/net from 0.30.0 to 0.33.0 (#4251)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.30.0 to 0.33.0.
- [Commits](https://github.com/golang/net/compare/v0.30.0...v0.33.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-02 10:23:29 +08:00
Chris Curry
e3b378b03b feat: persist memo filters with url query (#4239)
* feat: persist memo filters with url query

- Implemented synchronization of memo filters with URL search parameters.
- Enhanced memo store to manage current request state for fetching memos, allowing for request cancellation, avoiding the race conditions.

* refactor: update import
2025-01-02 10:23:15 +08:00
dependabot[bot]
0e1ac30462 chore: bump react-router-dom from 6.28.1 to 7.1.1 in /web (#4246)
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.28.1 to 7.1.1.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@7.1.1/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-02 09:45:25 +08:00
dependabot[bot]
94c47cc520 chore: bump i18next from 23.16.8 to 24.2.0 in /web (#4247)
Bumps [i18next](https://github.com/i18next/i18next) from 23.16.8 to 24.2.0.
- [Release notes](https://github.com/i18next/i18next/releases)
- [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md)
- [Commits](https://github.com/i18next/i18next/compare/v23.16.8...v24.2.0)

---
updated-dependencies:
- dependency-name: i18next
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-02 09:45:15 +08:00
dependabot[bot]
93f01f02e1 chore: bump @types/node from 22.10.2 to 22.10.3 in /web (#4248)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.10.2 to 22.10.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-02 09:45:05 +08:00
dependabot[bot]
fd257ba900 chore: bump @mui/joy from 5.0.0-beta.48 to 5.0.0-beta.51 in /web (#4249)
Bumps [@mui/joy](https://github.com/mui/material-ui/tree/HEAD/packages/mui-joy) from 5.0.0-beta.48 to 5.0.0-beta.51.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/HEAD/packages/mui-joy)

---
updated-dependencies:
- dependency-name: "@mui/joy"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-02 09:44:55 +08:00
dependabot[bot]
00df48e594 chore: bump google.golang.org/grpc from 1.67.1 to 1.69.2 (#4250)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.67.1 to 1.69.2.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.67.1...v1.69.2)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-02 09:44:44 +08:00
dependabot[bot]
00c7ea229c chore: bump github.com/aws/aws-sdk-go-v2/config from 1.28.2 to 1.28.7 (#4252)
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.28.2 to 1.28.7.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.28.2...config/v1.28.7)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-02 09:44:27 +08:00
dependabot[bot]
3b57b03e57 chore: bump golang.org/x/crypto from 0.29.0 to 0.31.0 (#4253)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.29.0 to 0.31.0.
- [Commits](https://github.com/golang/crypto/compare/v0.29.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-02 09:44:18 +08:00
dependabot[bot]
2b681bf594 chore: bump golang.org/x/mod from 0.21.0 to 0.22.0 (#4254)
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.21.0 to 0.22.0.
- [Commits](https://github.com/golang/mod/compare/v0.21.0...v0.22.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-02 09:44:08 +08:00
Steven
aff6b8707d chore: upgrade frontend dependencies 2025-01-01 07:59:56 +08:00
Chris Curry
bc0bac94ed refactor: enhance hyperlink handling in markdown shortcuts (#4238) 2024-12-30 17:46:24 +08:00
Hadley Rich
82b5c8ab07 feat: add sh entrypoint to allow MEMOS_DSN_FILE to load variable from secret (#4236)
Add sh entrypoint to allow MEMOS_DSN_FILE to load variable from secret
2024-12-30 17:46:02 +08:00
johnnyjoy
7817ad07f7 chore: fix linter 2024-12-30 09:18:11 +08:00
johnnyjoy
3220adbff9 refactor: split memo service 2024-12-26 20:13:05 +08:00
johnnyjoy
a78bfffb17 chore: add output only flag 2024-12-26 20:06:42 +08:00
johnnyjoy
541e07af8c chroe: rebuild memo references 2024-12-26 20:04:36 +08:00
johnnyjoy
3b0be442de chore: update memo payload runner schedule 2024-12-26 20:01:15 +08:00
johnnyjoy
41d9c9d76e fix: order list starts 2024-12-25 22:43:26 +08:00
Johnny
e913271f15 refactor: move tags from property to payload (#4229)
* refactor: move tags from property to payload

* chore: fix tests

* chore: drop memo tags

* chore: update

---------

Co-authored-by: Steven <stevenlgtm@gmail.com>
2024-12-24 15:23:15 +00:00
zjy4fun
f15346e615 fix: optimize memoMap generation logic to ensure memoMap count matche… (#4214)
fix: optimize memoMap generation logic to ensure memoMap count matches memos
2024-12-20 13:22:48 +08:00
zjy4fun
7a77b4ba38 chore: fix css location compatibility issues on Safari (#4215)
chore: fix location compatibility issues on Safari

closes https://github.com/usememos/memos/issues/4190
2024-12-20 13:21:59 +08:00
RoccoSmit
ce6ad4035d fix: limit the size of the resource list viewer (#4210)
Limit the size of the file upload box
2024-12-19 10:32:05 +08:00
Lincoln Nogueira
1c255d4e1f fix: panic on arm v5-v6-v7 builds (#4204)
- upgrade modernc.org/libc to v1.34.2

libc version on go.mod must match upstream's sqlite go.mod file to prevent similar issues.

https://pkg.go.dev/modernc.org/sqlite#hdr-Fragile_modernc_org_libc_dependency

```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGBUS: bus error code=0x2 addr=0x0 pc=0xdd8568]
```
2024-12-16 14:31:58 +08:00
Nikolay
ea394d89b2 fix: add server name change in mobile header (#4195)
* [fix] add server name change in  mobile header

* Update web/src/components/MobileHeader.tsx

* Update web/src/components/MobileHeader.tsx

* Apply suggestions from code review

---------

Co-authored-by: Николай Витальевич Никоноров <nnv@bitt.moe>
Co-authored-by: Johnny <yourselfhosted@gmail.com>
2024-12-13 13:23:16 +08:00
johnnyjoy
cb569c99fd chore: remove useCallback in fetching memo list 2024-12-07 12:26:21 +08:00
johnnyjoy
5a83f0c4fa chore: update frontend dependencies 2024-12-07 12:22:54 +08:00
johnnyjoy
f1d6a6766e chore: revert bump react version 2024-12-07 12:19:55 +08:00
johnnyjoy
0a5111e4b0 chore: update i18n types definition 2024-12-07 12:16:38 +08:00
Johnny
67f8811f3f chore: tweak bug report template 2024-12-07 11:48:02 +08:00
Steven
a97154e72d chore: bump react version 2024-12-06 22:16:18 +08:00
dependabot[bot]
dd15012661 chore: bump github.com/stretchr/testify from 1.9.0 to 1.10.0 (#4164)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-03 09:00:44 +08:00
dependabot[bot]
6e88b4203b chore: bump github.com/google/cel-go from 0.22.0 to 0.22.1 (#4165)
Bumps [github.com/google/cel-go](https://github.com/google/cel-go) from 0.22.0 to 0.22.1.
- [Release notes](https://github.com/google/cel-go/releases)
- [Commits](https://github.com/google/cel-go/compare/v0.22.0...v0.22.1)

---
updated-dependencies:
- dependency-name: github.com/google/cel-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-03 09:00:34 +08:00
dependabot[bot]
6cdc90bc97 chore: bump google.golang.org/protobuf from 1.35.1 to 1.35.2 (#4166)
Bumps google.golang.org/protobuf from 1.35.1 to 1.35.2.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-03 09:00:24 +08:00
dependabot[bot]
d06e67f57c chore: bump github.com/aws/aws-sdk-go-v2/credentials from 1.17.43 to 1.17.46 (#4167)
chore: bump github.com/aws/aws-sdk-go-v2/credentials

Bumps [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) from 1.17.43 to 1.17.46.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.43...credentials/v1.17.46)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/credentials
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-03 09:00:10 +08:00
dependabot[bot]
4e99de2692 chore: bump @bufbuild/buf from 1.46.0 to 1.47.2 in /web (#4169)
Bumps [@bufbuild/buf](https://github.com/bufbuild/buf) from 1.46.0 to 1.47.2.
- [Release notes](https://github.com/bufbuild/buf/releases)
- [Changelog](https://github.com/bufbuild/buf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bufbuild/buf/compare/v1.46.0...v1.47.2)

---
updated-dependencies:
- dependency-name: "@bufbuild/buf"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-03 08:59:59 +08:00
dependabot[bot]
edb8db9914 chore: bump @reduxjs/toolkit from 2.3.0 to 2.4.0 in /web (#4170)
Bumps [@reduxjs/toolkit](https://github.com/reduxjs/redux-toolkit) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/reduxjs/redux-toolkit/releases)
- [Commits](https://github.com/reduxjs/redux-toolkit/compare/v2.3.0...v2.4.0)

---
updated-dependencies:
- dependency-name: "@reduxjs/toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-03 08:59:48 +08:00
dependabot[bot]
1e28f7abb5 chore: bump tailwind-merge from 2.5.4 to 2.5.5 in /web (#4171)
Bumps [tailwind-merge](https://github.com/dcastil/tailwind-merge) from 2.5.4 to 2.5.5.
- [Release notes](https://github.com/dcastil/tailwind-merge/releases)
- [Commits](https://github.com/dcastil/tailwind-merge/compare/v2.5.4...v2.5.5)

---
updated-dependencies:
- dependency-name: tailwind-merge
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-03 08:59:38 +08:00
dependabot[bot]
56c9e94ac4 chore: bump class-variance-authority from 0.7.0 to 0.7.1 in /web (#4172)
Bumps [class-variance-authority](https://github.com/joe-bell/cva) from 0.7.0 to 0.7.1.
- [Release notes](https://github.com/joe-bell/cva/releases)
- [Commits](https://github.com/joe-bell/cva/compare/v0.7.0...v0.7.1)

---
updated-dependencies:
- dependency-name: class-variance-authority
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-03 08:59:27 +08:00
dependabot[bot]
790004463b chore: bump less from 4.2.0 to 4.2.1 in /web (#4173)
Bumps [less](https://github.com/less/less.js) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/less/less.js/releases)
- [Changelog](https://github.com/less/less.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/less/less.js/commits)

---
updated-dependencies:
- dependency-name: less
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-03 08:59:16 +08:00
dependabot[bot]
77e4d6f6f1 chore: bump golang.org/x/crypto from 0.28.0 to 0.29.0 (#4168)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.28.0 to 0.29.0.
- [Commits](https://github.com/golang/crypto/compare/v0.28.0...v0.29.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-03 08:49:13 +08:00
Cheng
2aa3795e50 fix: search conditions affected by pull-to-refresh (#4159) 2024-11-29 22:13:41 +08:00
Query&mut NinjaStyle, &Ryder
009f4956ac fix: check IdP for disallow password auth
* fix #4144 now when there is no sso then the Disallow password auth is disabled

* fixed the import issue

* attempt fixing linting issues

---------

Co-authored-by: pransh62390 <63577123+pransh62390@users.noreply.github.com>
2024-11-29 12:23:17 +08:00
KidLoveToPlay
73d13cb97b chore: style fix to #4151 (#4153)
* chore: apply styles to the correct month

* chore: style fix
2024-11-28 10:23:28 +08:00
KidLoveToPlay
97ef5a8871 chore: apply styles to the correct month (#4151) 2024-11-27 14:00:50 +08:00
Madhur Jodhwani
a51e363c7c chore: fix truncation of webhook url to avoid disappearance of Trash Icon (#4145)
* Fixed truncation of webhook url to avoid disappearance of Trash Icon

* fixing webhook truncation issue #4078

* Removing overflow-hidden

* resolving pipeline issues

* supporting on hover url display

---------

Co-authored-by: Madhur <madhur.jodhwani@accelya.com>
2024-11-25 14:19:04 +08:00
RoccoSmit
54ee2bf3ab feat: show less when memo expanded (#4143)
* Added show less action and language files

* Renaming type as suggested in pr review
2024-11-24 22:24:58 +08:00
johnnyjoy
2a1c0bba6c chore: remove unused reaction.proto 2024-11-21 23:08:03 +08:00
JP Hastings-Edrei
fcc4abf5b8 feat: remove RSS titles (#4140)
This removes the content of the <title> element in the RSS feeds that Memo produces.

Why remove? Every RSS client I can find shows the <title> next to the <description> when viewing an item. This creates a duplicate (but often trimmed, so less useful) version of <description> right above the actual text the user wants to read (often in a much larger font). It similarly makes lists of items in some clients extremely tall, as 128 characters is a lot of hard-to-read text — especially when Memos renders links as their URL in titles.

Why an empty tag? The RSS 1.0 and 2.0 specs require that a <title> element is present.

Examples from elsewhere:
- micro.blog uses an empty <title /> element: https://www.manton.org/feed.xml
- Bluesky omits the <title> element: https://bsky.app/profile/did%3Aplc%3Aqvzn322kmcvd7xtnips5xaun/rss
- Mastodon omits the <title> element: https://mastodon.social/@scalzi.rss
2024-11-20 22:31:32 +08:00
Steven
51c80c37d1 revert: tweak reaction_type column type for mysql 2024-11-20 20:37:35 +08:00
Steven
9f2c1b2556 chore: tweak reaction_type column type for mysql 2024-11-20 20:35:03 +08:00
Steven
104948ae40 chore: set pull to refresh with screen size 2024-11-20 20:28:49 +08:00
Steven
7b70c203cc chore: buf generate 2024-11-20 20:22:21 +08:00
nlfox
3cbccde67e feat: add pull to refresh for PagedMemoList (#4128) 2024-11-19 23:34:47 +08:00
johnnyjoy
1424036ccd chore: use for...of 2024-11-17 22:04:49 +08:00
Andy An
f6af564d4e feat: enhancement on UI/UX on user statistic view part. (#4122)
Enhancement on UI/UX on user statistic view part.
2024-11-17 09:47:41 +08:00
lcdgit
f00751a6e0 feat: allow to remove done items (#4126)
* add remove done items

* i18n en add

* bug fix

* add i18n

* Modify the description

* Modify the description

* Modify the description

* remove remove_done_check_items setting

* fix the static checks

* fix the static checks

---------

Co-authored-by: mozhu <lcl_em@163.com>
2024-11-17 09:33:39 +08:00
johnnyjoy
80785de900 chore: remove unused script 2024-11-14 22:12:00 +08:00
Steven
378b6a51c1 chore: tweak default reactions 2024-11-13 08:33:12 +08:00
Steven
f007185b8f chore: tweak form styles 2024-11-12 23:23:14 +08:00
RoccoSmit
142e97ab5a feat: navigate image view with keyboard keys (#4116)
* Navigate images with keyboard left and right keys

* Fix linting

* Adding missing "

* Added change to incorrect branch
2024-11-11 08:16:09 +08:00
RoccoSmit
bcd8856732 fix: added missing " (#4119)
Added missing "
2024-11-11 08:14:17 +08:00
johnnyjoy
45d4d391d8 fix: air script in windows 2024-11-07 23:34:39 +08:00
johnnyjoy
2f8d347310 Merge branch 'main' of https://github.com/usememos/memos 2024-11-07 23:32:49 +08:00
johnnyjoy
b4f9c09d85 chore: upgrade backend dependencies 2024-11-07 23:32:44 +08:00
Steven
5601daef40 chore: add semantic action 2024-11-06 21:15:53 +08:00
Steven
ad50aec2db chore: update activity calendar 2024-11-06 21:14:36 +08:00
RoccoSmit
3b25a6bbec fix: handle missing reaction (#4094)
* migration version

* Updated test to match with current version set in version.go file

* updated logic to check if migration should run for fresh install

* Update test to test for version number set in version.go

* fixed test

* Revert "fixed test"

This reverts commit 4004d0e92b.

* Revert "Update test to test for version number set in version.go"

This reverts commit d304add5d6.

* Revert "updated logic to check if migration should run for fresh install"

This reverts commit b44dca2194.

* Revert "Updated test to match with current version set in version.go file"

This reverts commit 3ad0d889b6.

* Revert "migration version"

This reverts commit b13cfc346a.

* Added default reaction if no reation found

* Fixed static check issue

* Use emoji
2024-11-06 21:11:26 +08:00
johnnyjoy
3786fb8db2 chore(dev): add code inspector plugin 2024-11-06 19:28:18 +08:00
Steven
67c1a46346 chore: remove html renderer sanitizes 2024-11-05 22:44:37 +08:00
Steven
57c00734e2 fix: frontend build 2024-11-05 21:15:13 +08:00
Ngô Quốc Đạt
e25792be9c chore: update vi translations (#4099) 2024-11-05 15:29:43 +08:00
Steven
f5a0827a3f chore: update explore translate of zh-hans 2024-11-04 21:38:34 +08:00
Steven
04c6e262c3 chore: align colors 2024-11-04 21:30:50 +08:00
Simon
f310207b9a chore: update i18n Ukrainian (#4096)
* Update uk.json

* Update uk.json
2024-11-04 20:04:20 +08:00
Steven
7b79c49414 chore: remove version tests 2024-11-03 22:55:09 +08:00
Steven
b547720aa8 chore: add id to i18n locales 2024-11-03 22:48:39 +08:00
kiraware
3542a79420 feat: add Bahasa Indonesia (id) translation (#4092) 2024-11-03 22:45:49 +08:00
johnnyjoy
227cc26cb9 chore: align table styles for access token section 2024-11-03 20:28:42 +08:00
Steven
f59daf839b chore: fix action 2024-11-02 20:00:00 +08:00
Steven
ae957439ec chore: update build action 2024-11-02 19:56:07 +08:00
Steven
4b28dfddb6 fix: visibility selector overflow 2024-11-02 13:39:08 +08:00
dependabot[bot]
648db7e82a chore: bump uuid from 10.0.0 to 11.0.2 in /web (#4086)
Bumps [uuid](https://github.com/uuidjs/uuid) from 10.0.0 to 11.0.2.
- [Release notes](https://github.com/uuidjs/uuid/releases)
- [Changelog](https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/uuidjs/uuid/compare/v10.0.0...v11.0.2)

---
updated-dependencies:
- dependency-name: uuid
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 11:58:31 +08:00
dependabot[bot]
bd4e4b632a chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.17.25 to 1.17.35 (#4084)
chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager

Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.17.25 to 1.17.35.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.25...credentials/v1.17.35)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 11:58:17 +08:00
dependabot[bot]
a449988a7e chore: bump golang.org/x/crypto from 0.27.0 to 0.28.0 (#4085)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.27.0 to 0.28.0.
- [Commits](https://github.com/golang/crypto/compare/v0.27.0...v0.28.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 10:39:40 +08:00
dependabot[bot]
6be36d268a chore: bump @types/node from 22.8.0 to 22.8.6 in /web (#4087)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.8.0 to 22.8.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 10:39:25 +08:00
dependabot[bot]
c1a13be778 chore: bump golang.org/x/net from 0.29.0 to 0.30.0 (#4082)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.29.0 to 0.30.0.
- [Commits](https://github.com/golang/net/compare/v0.29.0...v0.30.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 10:39:08 +08:00
dependabot[bot]
d2c4a9e7b6 chore: bump github.com/aws/aws-sdk-go-v2 from 1.31.0 to 1.32.3 (#4083)
Bumps [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) from 1.31.0 to 1.32.3.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.31.0...v1.32.3)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 10:38:58 +08:00
dependabot[bot]
bb9b6be19e chore: bump zustand from 4.5.5 to 5.0.1 in /web (#4090)
Bumps [zustand](https://github.com/pmndrs/zustand) from 4.5.5 to 5.0.1.
- [Release notes](https://github.com/pmndrs/zustand/releases)
- [Commits](https://github.com/pmndrs/zustand/compare/v4.5.5...v5.0.1)

---
updated-dependencies:
- dependency-name: zustand
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 10:38:39 +08:00
dependabot[bot]
183a22a928 chore: bump @bufbuild/buf from 1.45.0 to 1.46.0 in /web (#4088)
Bumps [@bufbuild/buf](https://github.com/bufbuild/buf) from 1.45.0 to 1.46.0.
- [Release notes](https://github.com/bufbuild/buf/releases)
- [Changelog](https://github.com/bufbuild/buf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bufbuild/buf/compare/v1.45.0...v1.46.0)

---
updated-dependencies:
- dependency-name: "@bufbuild/buf"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 10:38:04 +08:00
dependabot[bot]
aea814de83 chore: bump @bufbuild/protobuf from 2.2.0 to 2.2.2 in /web (#4089)
Bumps [@bufbuild/protobuf](https://github.com/bufbuild/protobuf-es/tree/HEAD/packages/protobuf) from 2.2.0 to 2.2.2.
- [Release notes](https://github.com/bufbuild/protobuf-es/releases)
- [Commits](https://github.com/bufbuild/protobuf-es/commits/v2.2.2/packages/protobuf)

---
updated-dependencies:
- dependency-name: "@bufbuild/protobuf"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 10:36:27 +08:00
Daniel Pinto
f44583e87d chore: allow some hardcoded strings to be translated (#4076)
Allow some hardcoded strings to be translated

Also add pt-PT translation for them
2024-11-02 10:36:11 +08:00
johnnyjoy
9a4fc2e015 chore: buf generate 2024-10-30 21:52:27 +08:00
Steven
67e474d4dd fix: linter warning 2024-10-30 20:19:08 +08:00
Steven
c12425329b chore: fix action buttons 2024-10-29 00:18:02 +08:00
Steven
db2b34a850 chore: update input source 2024-10-28 22:04:52 +08:00
Daniel Pinto
12bcf65f7d locale: Add pt-PT translations (#4064)
* locale: Add pt-PT translations

* fix str
2024-10-28 09:14:00 +08:00
Steven
f373d8e88c chore: update checkbox source 2024-10-27 10:19:06 +08:00
Steven
963706aebd refactor: update button source 2024-10-26 21:36:05 +08:00
Steven
8635aed138 chore: update dependencies 2024-10-25 21:55:00 +08:00
new-aspect
aa9649adf0 fix: automatic indentation follows previous lines in lists (#4048) (#4050)
* fix: automatic indentation follows previous lines in lists (#4048)

* fix: automatic indentation follows previous lines in lists (#4048)
change the position of this logic and recommit it
2024-10-25 19:16:59 +08:00
RoccoSmit
2851f11302 fix: use UTC date for calendar filter (#4046) 2024-10-23 22:52:20 +08:00
johnnyjoy
7e48d13834 fix: workspace setting state 2024-10-23 13:46:07 +08:00
Steven
4fcc682a15 chore: add beta badge to relation graph 2024-10-21 20:23:34 +08:00
Steven
f9fec56560 chore: fix date picker position 2024-10-20 17:08:01 +08:00
johnnyjoy
2ebf3f2615 chore: fix math styles 2024-10-19 21:40:24 +08:00
johnnyjoy
cf1be81de2 feat: use date-picker instead of raw datetime input 2024-10-19 21:30:02 +08:00
johnnyjoy
199d5680e6 chore: update inbox messages style 2024-10-19 21:01:02 +08:00
johnnyjoy
435bd5c44f fix: update relation graph checks 2024-10-19 20:53:53 +08:00
johnnyjoy
04d6329d0f feat: use hash router to sub-setting pages 2024-10-19 20:46:57 +08:00
johnnyjoy
085995ec3d chore: update setting title 2024-10-19 20:32:55 +08:00
johnnyjoy
c3cb3770cc chore: tweak function names 2024-10-19 16:13:33 +08:00
johnnyjoy
c2e820400e chore: regenerate api docs 2024-10-19 16:13:27 +08:00
d0zingcat
67dc9a3f0a chore: allow quick unpin (#4031)
Signed-off-by: d0zingcat <leewtang@gmail.com>
2024-10-19 16:05:14 +08:00
Matteo Vollero
19098940f7 chore: check currentUser and redirect to index if logged (#4021)
* If to check currentUser and redirect to index if logged

* Moved check into useEffect
2024-10-19 16:04:34 +08:00
d0zingcat
e5cb2037e4 feat: allow to disable markdown shortcuts (#4025)
* add settting to disable markdown keymap

Signed-off-by: d0zingcat <leewtang@gmail.com>

* rename disable markdown shortcuts

Signed-off-by: d0zingcat <leewtang@gmail.com>

* fix lint

Signed-off-by: d0zingcat <leewtang@gmail.com>

---------

Signed-off-by: d0zingcat <leewtang@gmail.com>
2024-10-16 23:27:54 +08:00
Steven
009534f1cf chore: fix linter warning 2024-10-16 23:11:34 +08:00
Steven
68c2bd3837 chore: update memo relations 2024-10-16 23:09:20 +08:00
Steven
82da20e1c3 feat: implement graph of relations 2024-10-15 23:31:44 +08:00
Steven
952428c15d chore: update default max height 2024-10-15 20:38:17 +08:00
Steven
cfe1765067 chore: tweak user statistics view 2024-10-15 20:30:24 +08:00
Steven
c4b52c68b5 fix: max height of memo content compact mode 2024-10-15 20:07:55 +08:00
Steven
317cf06579 chore: tweak demo data 2024-10-14 23:35:19 +08:00
Steven
14712b42fa chore: add pagination to list inboxes 2024-10-14 23:32:39 +08:00
Steven
b4d72e3349 fix: memo visibilities with filter 2024-10-14 21:31:44 +08:00
Steven
60a0ead0fa chore: add ka-GE locale 2024-10-14 20:31:45 +08:00
Aleksandre
69e93c1ab4 feat: support Georgian Language (#4016)
Create ge.json

Georgian language
2024-10-14 09:46:48 +08:00
Steven
b2f60758bc chore: update workspace setting in demo mode 2024-10-12 09:21:00 +08:00
Steven
74498a726e chore: update package 2024-10-11 21:35:25 +08:00
Steven
cab981c393 chore: fix linter errors 2024-10-11 21:27:08 +08:00
Steven
3370ecd4fc chore: ignore lint for tests 2024-10-11 21:22:04 +08:00
Steven
0a871b8960 chore: fix tests 2024-10-11 21:13:36 +08:00
RoccoSmit
35cf975e76 fix: apply system theme dynamically (#4010)
Remove appearance comparison
2024-10-11 21:05:52 +08:00
Steven
43d13a3edc chore: tweak linter 2024-10-11 21:05:07 +08:00
Steven
f467f1d9f6 chore: update cron package 2024-10-11 19:59:14 +08:00
Steven
0b6f24a21a chore: update task complete 2024-10-10 23:22:18 +08:00
Steven
d066d46f6e chore: tweak schema version 2024-10-10 22:30:46 +08:00
Steven
d54c8065b5 chore: update demo data 2024-10-10 22:04:41 +08:00
Steven
2acad978d1 chore(frontend): add reactions setting 2024-10-10 22:04:35 +08:00
Steven
e527b6a878 feat: move reaction type to setting 2024-10-10 21:06:32 +08:00
wjsoj
1f9d657065 feat: support set global Default memo visibility (#3989)
* feat: support set global Default memo visibility

* feat: Move to WorkspaceMemoRelatedSetting

* fix: goimports check failure

* chore: change item name to default_visibility

* fix: goimports check failure
2024-10-08 22:45:18 +08:00
Steven
dc15e8f30f chore: implement memo metadata store 2024-10-08 22:22:45 +08:00
johnnyjoy
831c254d64 fix: update user fields 2024-10-08 19:52:49 +08:00
Roman
310f147911 feat: allow single letter user id (#3991)
* Allow single letter user id.

They do work - I use one and login using Authelia, but then I am not able to update the profile to update avatar or add comment because "Invalid username: r" errors

* Add test for the util with uid matcher

* Move the test to separate directory

* Use goimports on the test file

* Rename the test for a mroe matching name, add failing test

* Update the regexp so that two letter work

---------

Co-authored-by: Roman Kamyk <roman@kamyk.me>
2024-10-08 13:47:24 +08:00
Steven
0b2f08ad15 fix: memo view 2024-10-07 01:57:37 +08:00
Steven
d11e7a3a9a chore: remove duplicated requests 2024-10-07 01:40:15 +08:00
Steven
c401a07933 chore: update dependencies 2024-10-02 22:22:21 +08:00
RoccoSmit
f0d43c9577 feat: add tag count to tree view (#3970)
* Add tag count to tree view

* Only display tag amounts > 1

* Updated tag amount var name to be more descriptive

* - Moved display logic to html in return
- Updated var names to closer match var passed in by TagSection component
2024-10-02 18:31:50 +08:00
dependabot[bot]
4ab06f5f11 chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.17.22 to 1.17.25 (#3978)
chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager

Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.17.22 to 1.17.25.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.22...credentials/v1.17.25)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 11:37:42 +08:00
dependabot[bot]
dab0f1907d chore: bump github.com/aws/aws-sdk-go-v2/config from 1.27.36 to 1.27.39 (#3976)
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.27.36 to 1.27.39.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.27.36...config/v1.27.39)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 11:37:33 +08:00
dependabot[bot]
e7949d0748 chore: bump vite from 5.4.7 to 5.4.8 in /web (#3981)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.7 to 5.4.8.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.8/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.8/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 11:37:16 +08:00
Xavier Hocquet
32123e0c21 feat: add month toggle on hover (#3972)
* Add month toggle on hover

* Lint
2024-10-02 11:37:05 +08:00
dependabot[bot]
4c0c7431c8 chore: bump google.golang.org/grpc from 1.67.0 to 1.67.1 (#3977)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.67.0 to 1.67.1.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.67.0...v1.67.1)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 11:36:12 +08:00
dependabot[bot]
25367bc000 chore: bump nice-grpc-web from 3.3.4 to 3.3.5 in /web (#3979)
Bumps [nice-grpc-web](https://github.com/deeplay-io/nice-grpc) from 3.3.4 to 3.3.5.
- [Release notes](https://github.com/deeplay-io/nice-grpc/releases)
- [Commits](https://github.com/deeplay-io/nice-grpc/compare/nice-grpc-web@3.3.4...nice-grpc-web@3.3.5)

---
updated-dependencies:
- dependency-name: nice-grpc-web
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 11:36:00 +08:00
dependabot[bot]
6cd86c0de1 chore: bump github.com/aws/aws-sdk-go-v2/credentials from 1.17.34 to 1.17.37 (#3975)
chore: bump github.com/aws/aws-sdk-go-v2/credentials

Bumps [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) from 1.17.34 to 1.17.37.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.34...credentials/v1.17.37)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/credentials
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 11:35:40 +08:00
dependabot[bot]
508146b052 chore: bump mermaid from 10.9.1 to 11.2.1 in /web (#3980)
Bumps [mermaid](https://github.com/mermaid-js/mermaid) from 10.9.1 to 11.2.1.
- [Release notes](https://github.com/mermaid-js/mermaid/releases)
- [Changelog](https://github.com/mermaid-js/mermaid/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/mermaid-js/mermaid/compare/v10.9.1...mermaid@11.2.1)

---
updated-dependencies:
- dependency-name: mermaid
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 11:35:28 +08:00
dependabot[bot]
143167386e chore: bump dompurify from 3.1.6 to 3.1.7 in /web (#3982)
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.1.6 to 3.1.7.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/3.1.6...3.1.7)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 07:43:34 +08:00
dependabot[bot]
938cfb4a69 chore: bump @types/node from 22.5.5 to 22.7.4 in /web (#3983)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.5.5 to 22.7.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 07:43:26 +08:00
dependabot[bot]
6965f0b89d chore: bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.63.0 to 1.63.3 (#3974)
chore: bump github.com/aws/aws-sdk-go-v2/service/s3

Bumps [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2) from 1.63.0 to 1.63.3.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.63.0...service/s3/v1.63.3)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/s3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 05:14:26 +08:00
ElTopo
0ba36ed7e0 chore: updated zh-Hans.json from current version of en.json (#3966) 2024-09-30 10:48:36 +08:00
Steven
771a977c9f chore: tweak words 2024-09-29 22:49:29 +08:00
Steven
69ad5178b3 chore: update MaxCallRecvMsgSize 2024-09-29 22:00:15 +08:00
Steven
2b86069f3b chore: update MaxRecvMsgSize 2024-09-29 21:58:06 +08:00
johnnyjoy
d5d37c1d59 chore: bump gomark version 2024-09-28 21:55:58 +08:00
Steven
cf4e660f41 chore: add memo location setting 2024-09-26 22:11:37 +08:00
Steven
95a50b6596 chore: tweak leaflet map 2024-09-26 22:04:05 +08:00
Steven
9c41c8d5c9 chore: fix marker icon 2024-09-26 09:20:33 +08:00
Steven
2837816ff7 chore: fix component state 2024-09-26 00:27:39 +08:00
Steven
b144faf43a feat: add location selector 2024-09-26 00:03:17 +08:00
Steven
63989ab365 feat: add location to memo payload 2024-09-25 21:48:54 +08:00
Steven
92c41458a9 chore: fix release action 2024-09-25 20:03:27 +08:00
Steven
a55afbd3ed chore: tweak build actions 2024-09-25 19:57:14 +08:00
boojack
9c4d25cc4d chore: update README.md 2024-09-25 19:47:12 +08:00
Steven
8b444be6ca chore: update tag search 2024-09-23 21:41:23 +08:00
Steven
171a89564e chore: tweak gen apidocs 2024-09-23 08:43:16 +08:00
RoccoSmit
6cbe957db2 fix: show future relative dates (#3946)
Show future relative dates
2024-09-22 22:24:46 +08:00
auphone
0711ac4ecb feat: allow mobile user zooming in image preview (#3880)
* Set viewport scalable in image preview dialog for mobile zooming and reset it on destroy

* Format with prettier

* move setViewportScalable() into useEffect

* use const instead of function
2024-09-22 21:48:01 +08:00
Steven
ea881338a9 chore: add gradient block to compact mode 2024-09-22 21:15:46 +08:00
johnnyjoy
7817947f66 fix: clean duplicated requests 2024-09-22 19:51:55 +08:00
johnnyjoy
1f7a90cec4 chore: add spinner to paged memo list 2024-09-22 19:41:27 +08:00
johnnyjoy
339c38750f refactor: paged memo list container 2024-09-22 19:30:39 +08:00
johnnyjoy
41976cb894 feat: update memo endpoints 2024-09-22 15:43:46 +08:00
johnnyjoy
c28516b35f chore: buf generate 2024-09-22 13:57:47 +08:00
Steven
ca213437e9 feat: implement nesting lists 2024-09-21 20:02:47 +08:00
johnnyjoy
7a4d54bb3c chore: update error messages 2024-09-21 18:23:30 +08:00
johnnyjoy
f102aeb9b9 chore: tweak golangci version 2024-09-21 18:10:05 +08:00
johnnyjoy
a6de047b64 chore: fix actions 2024-09-21 17:54:51 +08:00
johnnyjoy
9130d981fa chore: fix actions 2024-09-21 17:37:57 +08:00
johnnyjoy
b915eaa620 chore: bump dependencies 2024-09-21 17:36:53 +08:00
Johnny
a81d7b3260 chore: revert "perf: reduce image size by 21.3MB" (#3942)
Revert "perf: reduce image size by 21.3MB (#3849)"

This reverts commit 0156c7e11f.
2024-09-21 17:33:01 +08:00
johnnyjoy
8cdc956e59 chore: update ts proto 2024-09-21 17:25:57 +08:00
John Regan
46830e31ec buf: specify version of stephenh-ts-proto plugin (#3941) 2024-09-21 07:36:37 +08:00
Sriniwas
2db67118fc fix: case insensetive memo search for postgres (#3938)
fix:case insensetive memo search for postgres #3892
2024-09-19 23:14:51 +08:00
thehijacker
f6ebfdf7f9 feat: update Slovenian translation (#3935)
Updated Slovenian translation

Co-authored-by: Andrej Kralj <andrej.kralj@t-2.com>
2024-09-18 16:52:43 +08:00
Steven
ec2b59bff5 chore: bump gomark 2024-09-17 20:41:13 +08:00
Steven
d663313ca2 chore: fix frontend linter 2024-09-17 19:09:05 +08:00
Steven
fbe0251eed feat: impl list renderer 2024-09-17 19:03:10 +08:00
johnnyjoy
759f7c6171 chore: fix workspace setting tests 2024-09-14 08:27:37 +08:00
johnnyjoy
1da0752922 chore: add schema version to workspace setting 2024-09-14 08:23:39 +08:00
Zisu Zhang
b787d1c7b6 feat: support disable change username and nickname (#3911)
* feat: support disable change username and nickname

* chore: update UX
2024-09-12 13:45:04 +08:00
ti777777
6f3d5762ca fix: iframe rendering (#3916)
* fix iframe rendering

* fix eslint check
2024-09-12 08:54:33 +08:00
RoccoSmit
42bc769d5d fix: load server name and icon from settings (#3908) 2024-09-10 23:02:48 +08:00
Steven
4790e84b98 chore: use ratio instead of max width 2024-09-09 21:43:47 +08:00
Steven
76a9a343a5 chore: fix linter 2024-09-09 20:36:35 +08:00
RoccoSmit
f695e93f20 fix: update first day logic for months starting on Sunday (#3896)
* Update calendar logic to accomodate for months starting on Sunday

* Apply suggestions from code review

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2024-09-09 09:19:12 +08:00
RoccoSmit
05d5fb4b04 chore: use translations for calendar days (#3895)
Use translations for calendar days
2024-09-08 20:24:59 +08:00
Haohan Yang
044d46c36d chore: replace unmatchedEmailAndPasswordError with unmatchedUsernameAndPasswordError` (#3889)
replace unmatchedEmailAndPasswordError with unmatchedUsernameAndPasswordError
2024-09-07 23:17:20 +08:00
Steven
88db037204 chore: fix linter warnings 2024-09-04 23:31:28 +08:00
Steven
4209575244 chore: tweak folder naming style 2024-09-04 23:29:18 +08:00
onee-only
b664653306 test: add test for searching memos by tags (#3876) 2024-09-04 12:14:17 +08:00
Leo
95939ebcf1 fix: v0.22.5: start fail caused by incorrect migration file naming (#3873)
fix incorrect naming of migration file
2024-09-04 06:28:55 +08:00
Steven
9612c302c4 chore: bump version to v0.22.5 2024-09-03 22:17:46 +08:00
Steven
773ab96bd0 chore: update thumbnail generator 2024-09-03 22:09:02 +08:00
johnnyjoy
09586d032c chore: fix user checks 2024-09-03 20:48:23 +08:00
Steven
fe01d68d2a fix: user role checks 2024-09-03 08:07:31 +08:00
johnnyjoy
5bbf57ece4 chore: update comments of find memo 2024-09-02 21:27:55 +08:00
johnnyjoy
c5ef5b9040 chore: update readme 2024-09-02 21:25:42 +08:00
Johnny
971128af05 revert: chore: bump mermaid from 10.9.1 to 11.0.2 in /web (#3870)
Revert "chore: bump mermaid from 10.9.1 to 11.0.2 in /web (#3862)"

This reverts commit d13bb7648b.
2024-09-02 21:10:54 +08:00
johnnyjoy
40d59fc47a chore: fix user role checks 2024-09-02 21:04:25 +08:00
johnnyjoy
7a9f61967d feat: allow admin users to update other memos 2024-09-02 20:59:22 +08:00
johnnyjoy
8c6682bd77 chore: regenerate apidocs 2024-09-02 20:50:59 +08:00
dependabot[bot]
d13bb7648b chore: bump mermaid from 10.9.1 to 11.0.2 in /web (#3862)
Bumps [mermaid](https://github.com/mermaid-js/mermaid) from 10.9.1 to 11.0.2.
- [Release notes](https://github.com/mermaid-js/mermaid/releases)
- [Changelog](https://github.com/mermaid-js/mermaid/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/mermaid-js/mermaid/compare/v10.9.1...mermaid@11.0.2)

---
updated-dependencies:
- dependency-name: mermaid
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 20:46:36 +08:00
dependabot[bot]
0b1ca218ce chore: bump lucide-react from 0.419.0 to 0.437.0 in /web (#3860)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.419.0 to 0.437.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.437.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 13:07:54 +08:00
dependabot[bot]
7bce4f5d7b chore: bump @types/react from 18.3.4 to 18.3.5 in /web (#3859)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.3.4 to 18.3.5.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 13:07:45 +08:00
dependabot[bot]
c018af6249 chore: bump @types/node from 22.5.0 to 22.5.2 in /web (#3858)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.5.0 to 22.5.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 13:07:34 +08:00
dependabot[bot]
45d45d0936 chore: bump @bufbuild/buf from 1.38.0 to 1.39.0 in /web (#3861)
Bumps [@bufbuild/buf](https://github.com/bufbuild/buf) from 1.38.0 to 1.39.0.
- [Release notes](https://github.com/bufbuild/buf/releases)
- [Changelog](https://github.com/bufbuild/buf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bufbuild/buf/compare/v1.38.0...v1.39.0)

---
updated-dependencies:
- dependency-name: "@bufbuild/buf"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 13:07:18 +08:00
dependabot[bot]
04fad85afe chore: bump github.com/grpc-ecosystem/grpc-gateway/v2 from 2.21.0 to 2.22.0 (#3863)
chore: bump github.com/grpc-ecosystem/grpc-gateway/v2

Bumps [github.com/grpc-ecosystem/grpc-gateway/v2](https://github.com/grpc-ecosystem/grpc-gateway) from 2.21.0 to 2.22.0.
- [Release notes](https://github.com/grpc-ecosystem/grpc-gateway/releases)
- [Changelog](https://github.com/grpc-ecosystem/grpc-gateway/blob/main/.goreleaser.yml)
- [Commits](https://github.com/grpc-ecosystem/grpc-gateway/compare/v2.21.0...v2.22.0)

---
updated-dependencies:
- dependency-name: github.com/grpc-ecosystem/grpc-gateway/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 13:06:52 +08:00
dependabot[bot]
a654b12670 chore: bump golang.org/x/mod from 0.19.0 to 0.20.0 (#3864)
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.19.0 to 0.20.0.
- [Commits](https://github.com/golang/mod/compare/v0.19.0...v0.20.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 13:03:01 +08:00
dependabot[bot]
2fac11936b chore: bump golang.org/x/oauth2 from 0.21.0 to 0.22.0 (#3866)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.21.0 to 0.22.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.21.0...v0.22.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 13:02:53 +08:00
dependabot[bot]
acc6c29d01 chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.17.9 to 1.17.16 (#3867)
chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager

Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.17.9 to 1.17.16.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.17.9...credentials/v1.17.16)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 09:20:36 +08:00
Steven
be25fbe185 chore: tweak readme 2024-09-02 09:20:14 +08:00
Steven
4322bfa506 chore: tweak seed data 2024-09-01 22:51:02 +08:00
Steven
fa2b01cfb1 chore: tweak latest schema file name 2024-09-01 22:11:15 +08:00
aqyuki
35b0bd82f4 chore: migrate of Docker compose v2 (#3857)
chore: rename docker-compose.yaml and remove deprecated field
2024-09-01 22:08:57 +08:00
RoccoSmit
bfe57b9202 chore: set max thumbnail width to home/explore image max width (#3852)
* Set max thumbnail width to timeline img max width

* Prevent images less than thumbnail size from being scaled up

* Apply suggestions from code review

---------

Co-authored-by: boojack <24653555+boojack@users.noreply.github.com>
2024-08-31 03:37:07 +08:00
aqyuki
0156c7e11f perf: reduce image size by 21.3MB (#3849)
- Change base image to distroless (static-debian12)
- Remove unnecessary RUN instructions
- Add build options
  - add options to delete debug information
  - add options to remobe embedded paths
2024-08-30 19:36:34 +08:00
Steven
960af444fa chore: fix linter 2024-08-30 08:25:06 +08:00
Steven
20570fc771 refactor: resource thumbnail 2024-08-30 08:09:07 +08:00
RoccoSmit
9b1adfbbe9 feat: reintroducing thumbnails (#3821)
* Reintroducing thumbnails

* Aligned with linting rules

* making recomended code review change
- changed method names to start with lower case as they are not used outside of their package
- made receiver types for struct funcs to be pointers to not need to create copies

Trying to cover all linting issues
- converted slog warning to use attributes when logging warnings
- seperated imports to have package files in their own section

* Update go.mod

---------

Co-authored-by: boojack <24653555+boojack@users.noreply.github.com>
2024-08-29 21:01:57 +08:00
Steven
615aa94793 fix: base path of migrator 2024-08-29 20:40:50 +08:00
Steven
710961d336 chore: fix text color in dark mode 2024-08-29 20:39:24 +08:00
Steven
bb86482b71 chore: tweak setting name 2024-08-29 08:28:11 +08:00
Steven
f0abd792c7 chore: update auth service 2024-08-29 00:06:15 +08:00
Steven
1167df29d8 feat: add security related settings 2024-08-28 23:46:06 +08:00
Steven
4e5810e205 chore: update workspace setting section 2024-08-28 23:29:30 +08:00
Steven
a8ea28066e chore: retire export memos 2024-08-28 23:20:32 +08:00
Steven
9bea6e1eea chore: go mod tidy 2024-08-28 22:56:17 +08:00
Michel Heusschen
2dbf92f7f1 perf: reduce bundle size by 21% with direct icon imports (#3844) 2024-08-28 22:55:28 +08:00
Steven
d11bd30ec6 chore: tweak logger 2024-08-28 22:53:57 +08:00
Steven
de980fb7d7 chore: update setting display name 2024-08-28 22:44:13 +08:00
Steven
cce92f513c chore: tweak readme 2024-08-27 23:44:03 +08:00
Steven
7134ad4883 chore: fix migration history 2024-08-27 09:20:23 +08:00
Steven
fbdfaf85d9 chore: update migrator 2024-08-26 22:50:46 +08:00
Steven
ccd3fdcd38 chore: fix tests 2024-08-26 08:59:35 +08:00
Steven
70837f88cb chore: fix linter 2024-08-26 08:47:29 +08:00
Steven
525223c261 chore: add tests for migrator 2024-08-26 08:41:26 +08:00
Steven
96b9269cd3 chore: fix golangci linter 2024-08-24 22:38:22 +08:00
Steven
80f9b5b861 chore: fix golangci linter 2024-08-24 22:30:41 +08:00
Steven
fb23f43431 chore: update golangci config 2024-08-24 20:39:46 +08:00
RoccoSmit
eca9649be3 fix: cancel removes memo cache (#3826)
Clear local storage record of memo changes if chanes to a memo are cancelled
2024-08-24 06:48:16 +08:00
Steven
5f35ac5ca0 chore: update frontend dependencies 2024-08-22 23:38:11 +08:00
Steven
b376a20fb4 chore: tweak linter warnings 2024-08-20 08:25:34 +08:00
Steven
2999f472dd chore: fix typo 2024-08-20 08:17:27 +08:00
Steven
45ddd05c42 chore: tweak linter warning 2024-08-20 08:13:52 +08:00
Steven
d1280bc04f chore: implement memo property runner 2024-08-20 08:07:48 +08:00
Steven
f4d6675363 chore: add enable memo comment setting 2024-08-19 09:13:44 +08:00
Steven
3c5aa41a78 feat: implement week start day setting 2024-08-18 23:18:45 +08:00
Steven
06c460b476 chore: tweak linter warning 2024-08-16 08:15:59 +08:00
Steven
07012e3f60 chore: remove unused files 2024-08-16 08:14:02 +08:00
Steven
1b6685d7cf chore: tweak linter warning 2024-08-16 08:12:09 +08:00
Steven
710d1b304e chore: update dev mode 2024-08-16 08:08:26 +08:00
Steven
6e901fc940 refactor: store migrator 2024-08-16 08:07:30 +08:00
Steven
1ae3afc0ba chore: tweak memo relation popover 2024-08-14 23:15:04 +08:00
Jakub Wołynko
18db78172c feat: add translation for collapse/expand button and update polish locale (#3811)
add: collapse, expand, polish locale
2024-08-14 18:02:02 +08:00
Steven
aae3e8ae64 chore: update memo property checks 2024-08-13 23:29:40 +08:00
Steven
506d2ed8ca chore: tweak menu style 2024-08-13 23:28:02 +08:00
Steven
c3f381c8c5 chore: add instance url to profile 2024-08-13 22:16:43 +08:00
Steven
9a27fdf855 chore: tweak load more button 2024-08-12 23:52:23 +08:00
Steven
fc2cd43dc2 chore: tweak util tests 2024-08-12 23:44:04 +08:00
Mykal Machon
c0826c43b0 fix: explicitly disabling autocapitalize and spellcheck (#3797)
fix #3747: removing autocapitalize and spellcheck
2024-08-12 12:24:37 +08:00
Steven
724db203f7 chore: tweak seed data 2024-08-08 23:45:26 +08:00
Steven
04b4fa1d02 chore: tweak icon button container 2024-08-07 22:56:47 +08:00
Steven
61b8cee31d chore: retire preview markdown dialog 2024-08-07 22:48:16 +08:00
Steven
4ad6028681 refactor: use popover instead of dialog for memo relations 2024-08-07 22:44:39 +08:00
tiltshiftfocus
a5978e7657 fix: tag query for mysql (#3785) 2024-08-06 13:56:44 +08:00
Steven
158745704e feat: add memo display setting menu 2024-08-03 01:22:40 +08:00
dependabot[bot]
01819610c7 chore: bump modernc.org/sqlite from 1.30.2 to 1.31.1 (#3769)
Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.30.2 to 1.31.1.
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.30.2...v1.31.1)

---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-02 08:14:15 +08:00
dependabot[bot]
bc5e0b5daf chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.17.8 to 1.17.9 (#3770)
chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager

Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.17.8 to 1.17.9.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.17.8...config/v1.17.9)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-02 08:14:05 +08:00
dependabot[bot]
4924af5235 chore: bump github.com/grpc-ecosystem/grpc-gateway/v2 from 2.20.0 to 2.21.0 (#3771)
chore: bump github.com/grpc-ecosystem/grpc-gateway/v2

Bumps [github.com/grpc-ecosystem/grpc-gateway/v2](https://github.com/grpc-ecosystem/grpc-gateway) from 2.20.0 to 2.21.0.
- [Release notes](https://github.com/grpc-ecosystem/grpc-gateway/releases)
- [Changelog](https://github.com/grpc-ecosystem/grpc-gateway/blob/main/.goreleaser.yml)
- [Commits](https://github.com/grpc-ecosystem/grpc-gateway/compare/v2.20.0...v2.21.0)

---
updated-dependencies:
- dependency-name: github.com/grpc-ecosystem/grpc-gateway/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-02 08:13:55 +08:00
dependabot[bot]
12a9165852 chore: bump react-router-dom from 6.25.1 to 6.26.0 in /web (#3772)
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.25.1 to 6.26.0.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.26.0/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-02 08:13:44 +08:00
dependabot[bot]
1fcb867e0f chore: bump react-i18next from 14.1.3 to 15.0.0 in /web (#3774)
Bumps [react-i18next](https://github.com/i18next/react-i18next) from 14.1.3 to 15.0.0.
- [Changelog](https://github.com/i18next/react-i18next/blob/master/CHANGELOG.md)
- [Commits](https://github.com/i18next/react-i18next/compare/v14.1.3...v15.0.0)

---
updated-dependencies:
- dependency-name: react-i18next
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-02 08:13:35 +08:00
dependabot[bot]
222e9dfe58 chore: bump @types/node from 20.14.13 to 22.0.2 in /web (#3775)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.14.13 to 22.0.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-02 08:13:26 +08:00
dependabot[bot]
55a2e791aa chore: bump lucide-react from 0.399.0 to 0.419.0 in /web (#3773)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.399.0 to 0.419.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.419.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-02 08:01:36 +08:00
Steven
21f18f7c56 chore: tweak activity service definition 2024-08-01 23:40:16 +08:00
Steven
cc91b1e512 chore: buf generate 2024-08-01 22:03:07 +08:00
Steven
26fa172641 chore(frontend): add order by time asc 2024-07-31 23:51:20 +08:00
Steven
6184375cbb chore: upgrade frontend dependencies 2024-07-31 23:51:00 +08:00
Steven
07667257d5 feat: support order by time asc 2024-07-31 23:34:00 +08:00
Steven
ea70dd85bf chore: remove color in manifest 2024-07-31 23:09:13 +08:00
Steven
14194504ee chore: remove unused classnames 2024-07-29 23:12:27 +08:00
Steven
444ccc03ed chore: tweak default title 2024-07-29 23:09:46 +08:00
Noah Alderton
117077ac8f fix: dead link in README.md (#3750) 2024-07-28 17:41:47 +08:00
Steven
342b6ad696 chore: tweak seed data 2024-07-27 22:12:43 -04:00
Steven
a948555166 fix: release action 2024-07-27 21:21:09 -04:00
Steven
4870433289 chore: tweak release action 2024-07-27 21:07:15 -04:00
Steven
a1083e648f chore: fix resource display time 2024-07-27 20:54:42 -04:00
Steven
4b415e519e chore: tweak demo data 2024-07-28 00:24:16 +08:00
Steven
7564c40c8d chore: fix env init 2024-07-27 23:08:22 +08:00
Steven
8fd5365ac1 chore: tweak linter error 2024-07-27 22:19:53 +08:00
Steven
a50f3b9382 chore: fix memos sorting 2024-07-27 22:15:47 +08:00
Steven
5ad00c3a50 chore: fix env binding 2024-07-27 21:57:13 +08:00
Steven
8bf7cdfd31 feat: add password auth flag 2024-07-27 19:24:37 +08:00
Steven
b9006f8ce0 chore: tweak date utils 2024-07-27 17:21:22 +08:00
Steven
3d63d9d5fb chore: fix activity stats 2024-07-27 10:11:41 +08:00
Steven
139090fb8f chore: fix calendar timestamps 2024-07-27 09:47:12 +08:00
Steven
bdc257d837 chore: tweak release actions 2024-07-26 23:30:16 +08:00
Andrew Williams
c9c40bc876 chore: build release containers from tags rather than branches (#3739)
Fixes #3645, currently the release containers are build from the release branches, which are created in preparation for a release. This causes some users with automated CI/CD to either deploy a pre-release version or be notified of a release version before it has actually been released. 

This change switches the workflow to be triggered by tags, which are created on the release version.
2024-07-26 10:36:34 +08:00
Steven
edc3b578d6 feat: implement search multi tags 2024-07-26 08:40:40 +08:00
Steven
c6a09d9353 chore: update memo filter styles 2024-07-26 08:30:59 +08:00
Steven
cd38ec93ed feat: implement memo filters 2024-07-26 00:46:48 +08:00
Steven
b3b4aa9ddb chore: remove unused code 2024-07-24 23:53:07 +08:00
Steven
c5900b355e chore: tweak signup checks 2024-07-24 23:38:51 +08:00
Steven
553e8d09dd chore: update public default value to false 2024-07-24 23:34:19 +08:00
Steven
22ec0cf2e3 chore: bump version 2024-07-23 22:11:53 +08:00
Steven
44e56844f5 chore: tweak search resources 2024-07-22 15:33:02 +08:00
dependabot[bot]
95fa145665 chore: bump @types/node from 20.14.9 to 20.14.11 in /web (#3726)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.14.9 to 20.14.11.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 15:32:35 +08:00
dependabot[bot]
84e2d40481 chore: bump @typescript-eslint/parser from 7.16.0 to 7.16.1 in /web (#3727)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 7.16.0 to 7.16.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.16.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 10:05:36 +08:00
dependabot[bot]
582c360787 chore: bump dayjs from 1.11.11 to 1.11.12 in /web (#3728)
Bumps [dayjs](https://github.com/iamkun/dayjs) from 1.11.11 to 1.11.12.
- [Release notes](https://github.com/iamkun/dayjs/releases)
- [Changelog](https://github.com/iamkun/dayjs/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/iamkun/dayjs/compare/v1.11.11...v1.11.12)

---
updated-dependencies:
- dependency-name: dayjs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 10:05:26 +08:00
dependabot[bot]
756470099f chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.17.7 to 1.17.8 (#3729)
chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager

Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.17.7 to 1.17.8.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/v1.17.8/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.17.7...v1.17.8)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 10:05:15 +08:00
dependabot[bot]
0a6d7387d1 chore: bump vite from 5.3.1 to 5.3.4 in /web (#3730)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.3.1 to 5.3.4.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.3.4/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 10:05:01 +08:00
dependabot[bot]
511178389b chore: bump eslint-plugin-prettier from 5.1.3 to 5.2.1 in /web (#3731)
Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 5.1.3 to 5.2.1.
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v5.1.3...v5.2.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 10:04:49 +08:00
dependabot[bot]
e5c214ba5c chore: bump github.com/aws/aws-sdk-go-v2/config from 1.27.26 to 1.27.27 (#3732)
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.27.26 to 1.27.27.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.27.26...config/v1.27.27)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 10:04:23 +08:00
dependabot[bot]
7e7786077f chore: bump google.golang.org/grpc from 1.64.0 to 1.65.0 (#3733)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.64.0 to 1.65.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.64.0...v1.65.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 10:04:11 +08:00
dependabot[bot]
5f58bb368b chore: bump github.com/aws/aws-sdk-go-v2/credentials from 1.17.26 to 1.17.27 (#3734)
chore: bump github.com/aws/aws-sdk-go-v2/credentials

Bumps [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) from 1.17.26 to 1.17.27.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.26...credentials/v1.17.27)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/credentials
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 09:57:59 +08:00
Steven
c313596144 feat: update memo editor 2024-07-22 09:57:40 +08:00
Johnny
d2727e6825 chore: update dependabot schedule interval (#3725) 2024-07-21 20:49:42 +08:00
Steven
10c9bb081b chore: retire timeline page 2024-07-20 00:28:49 +08:00
Steven
17ecfb5cf5 fix: acl config 2024-07-19 20:54:51 +08:00
Steven
c4a24bead6 chore(frontend): tweak memo relations 2024-07-19 20:52:52 +08:00
andrigamerita
d264f45979 fix: code blocks of unknown languages cause HTML injection (#3711)
* fix: code blocks of unknown languages cause HTML injection

A code block of unknown language (that is, a language not treated as special by Memos and not handled by highlight.js) should fall back on rendering its plaintext content. However, the content is never properly escaped before it is appended to the DOM, and thus any string that happens to contain HTML is unsafely rendered. This commit fixes the issue by ensuring that, when none of the previous cases handle the text, any HTML entities are escaped first.

* Update CodeBlock.tsx to conform to eslint
2024-07-19 08:32:58 +08:00
andrigamerita
af952807c7 feat: write memo UID in file names when exporting to Markdown (#3712)
When using the "export to Markdown" feature in Memos, the files included in the ZIP folder don't feature any kind of reference to their alphanumeric UID from the server's database, which completely breaks the point of links inside the files made with the `[[memos/<uid>]]` format, since it's impossible to know which Markdown file this kind of string inside other files refers to.

This pull request modifies the ExportMemos server function, to add the UID of every memo immediately after the date in the filename. For example, an exported memo would now be called: `YYYY-MM-DDThh:mm:ss+hh:mm-AbcDefGhiJklMnoPqrStu1-PUBLIC.md`.
2024-07-19 07:14:31 +08:00
Steven
fefe2b0655 chore: fix build artifacts action 2024-07-17 23:16:09 +08:00
Steven
5704aaad08 chore: tweak embeded memo style 2024-07-17 22:48:22 +08:00
Steven
ef7e2151dc chore: update memo relation list 2024-07-17 21:40:43 +08:00
Steven
e2fd79200e feat: implement inline memo editor 2024-07-17 21:07:36 +08:00
Steven
956f21838d chore: fix popover z-index 2024-07-17 20:28:31 +08:00
Steven
878fea5f13 chore: use popover for update tag view setting 2024-07-17 08:46:52 +08:00
Steven
5a26b76511 chore: add memo content snippet 2024-07-17 08:18:37 +08:00
dependabot[bot]
0053977b14 chore: bump github.com/aws/aws-sdk-go-v2/config from 1.27.24 to 1.27.26 (#3691)
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.27.24 to 1.27.26.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.27.24...config/v1.27.26)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 22:26:20 +08:00
dependabot[bot]
e5c7571eb5 chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.17.4 to 1.17.7 (#3690)
chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager

Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.17.4 to 1.17.7.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/v1.17.7/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.17.4...v1.17.7)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 22:26:06 +08:00
dependabot[bot]
daca7193b5 chore: bump github.com/aws/aws-sdk-go-v2/credentials from 1.17.24 to 1.17.26 (#3693)
chore: bump github.com/aws/aws-sdk-go-v2/credentials

Bumps [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) from 1.17.24 to 1.17.26.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.24...credentials/v1.17.26)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/credentials
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 22:24:48 +08:00
dependabot[bot]
ca1d3b6eb1 chore: bump modernc.org/sqlite from 1.30.1 to 1.30.2 (#3692)
Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.30.1 to 1.30.2.
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.30.1...v1.30.2)

---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 22:24:34 +08:00
dependabot[bot]
fcdca5b270 chore: bump github.com/aws/aws-sdk-go-v2 from 1.30.1 to 1.30.3 (#3694)
Bumps [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) from 1.30.1 to 1.30.3.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.30.1...v1.30.3)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 22:23:46 +08:00
dependabot[bot]
07f79b9f7a chore: bump @mui/joy from 5.0.0-beta.36 to 5.0.0-beta.48 in /web (#3695)
Bumps [@mui/joy](https://github.com/mui/material-ui/tree/HEAD/packages/mui-joy) from 5.0.0-beta.36 to 5.0.0-beta.48.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/next/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/HEAD/packages/mui-joy)

---
updated-dependencies:
- dependency-name: "@mui/joy"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 22:23:26 +08:00
dependabot[bot]
41d9d3bc21 chore: bump prettier from 3.3.2 to 3.3.3 in /web (#3696)
Bumps [prettier](https://github.com/prettier/prettier) from 3.3.2 to 3.3.3.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.3.2...3.3.3)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 22:23:01 +08:00
dependabot[bot]
fae951ae2b chore: bump @typescript-eslint/eslint-plugin from 7.15.0 to 7.16.0 in /web (#3697)
chore: bump @typescript-eslint/eslint-plugin in /web

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 7.15.0 to 7.16.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.16.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 22:22:44 +08:00
Steven
446e38f15b fix: memo content snippet 2024-07-16 22:19:48 +08:00
dependabot[bot]
7c9f967a07 chore: bump dompurify from 3.1.5 to 3.1.6 in /web (#3698)
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.1.5 to 3.1.6.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/3.1.5...3.1.6)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 09:43:40 +08:00
dependabot[bot]
a5d36655e9 chore: bump tailwindcss from 3.4.4 to 3.4.5 in /web (#3699)
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.4.4 to 3.4.5.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/v3.4.5/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.4.4...v3.4.5)

---
updated-dependencies:
- dependency-name: tailwindcss
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 09:43:29 +08:00
Steven
f2cfc528a6 chore: introduce tag view option 2024-07-15 22:55:59 +08:00
Steven
260a4f89fc chore: buf generate 2024-07-15 22:32:59 +08:00
Johnny
9909fd8a6f feat: add snippet field to memo message (#3689) 2024-07-15 08:08:08 +08:00
Johnny
bcb8843245 chore: implement stringify markdown nodes endpoint (#3688) 2024-07-14 20:46:57 +08:00
Johnny
7c9e54afbd chore: update disallow public visibility setting name (#3687) 2024-07-14 20:23:19 +08:00
Steven
6825c1def4 fix: delete access token when sign out 2024-07-13 11:18:29 +08:00
Steven
f374169a2b feat: implement html element renderer 2024-07-13 11:06:51 +08:00
Johnny
4ff3b89a8e chore: update i18n from Weblate (#3680)
* Added translation using Weblate (Catalan)

* Translated using Weblate (Catalan)

Currently translated at 25.0% (65 of 260 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/ca/

* Translated using Weblate (French)

Currently translated at 100.0% (260 of 260 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/fr/

---------

Co-authored-by: Carles Mateu <carlesm@carlesm.com>
Co-authored-by: Ezmana <ezmana.land@gmail.com>
2024-07-12 22:22:59 +08:00
Johnny
5a196e2f1a feat: update gomark version (#3679) 2024-07-12 22:17:03 +08:00
Steven
9449886d60 chore: fix linter 2024-07-12 08:36:55 +08:00
Steven
457cf92cc1 feat(api): implement get resource by uid 2024-07-11 23:43:44 +08:00
Steven
1ab2c89408 feat(api): implement get memo by uid 2024-07-11 23:31:50 +08:00
dependabot[bot]
34e938a1e3 chore: bump typescript from 5.5.2 to 5.5.3 in /web (#3664)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.5.2 to 5.5.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.5.2...v5.5.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-09 23:00:45 +08:00
dependabot[bot]
b265445068 chore: bump golang.org/x/net from 0.26.0 to 0.27.0 (#3669)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.26.0 to 0.27.0.
- [Commits](https://github.com/golang/net/compare/v0.26.0...v0.27.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-09 22:59:52 +08:00
dependabot[bot]
37d13b5cbc chore: bump github.com/aws/aws-sdk-go-v2/config from 1.27.23 to 1.27.24 (#3667)
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.27.23 to 1.27.24.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.27.23...config/v1.27.24)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-09 22:59:45 +08:00
dependabot[bot]
fb4fdb326a chore: bump golang.org/x/crypto from 0.24.0 to 0.25.0 (#3668)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.24.0 to 0.25.0.
- [Commits](https://github.com/golang/crypto/compare/v0.24.0...v0.25.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-09 22:59:26 +08:00
dependabot[bot]
5623a0f065 chore: bump @typescript-eslint/parser from 7.14.1 to 7.16.0 in /web (#3672)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 7.14.1 to 7.16.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.16.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-09 22:59:12 +08:00
dependabot[bot]
b220f14bec chore: bump katex from 0.16.10 to 0.16.11 in /web (#3663)
Bumps [katex](https://github.com/KaTeX/KaTeX) from 0.16.10 to 0.16.11.
- [Release notes](https://github.com/KaTeX/KaTeX/releases)
- [Changelog](https://github.com/KaTeX/KaTeX/blob/main/CHANGELOG.md)
- [Commits](https://github.com/KaTeX/KaTeX/compare/v0.16.10...v0.16.11)

---
updated-dependencies:
- dependency-name: katex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-09 22:59:03 +08:00
dependabot[bot]
3e4b33fb28 chore: bump highlight.js from 11.9.0 to 11.10.0 in /web (#3665)
Bumps [highlight.js](https://github.com/highlightjs/highlight.js) from 11.9.0 to 11.10.0.
- [Release notes](https://github.com/highlightjs/highlight.js/releases)
- [Changelog](https://github.com/highlightjs/highlight.js/blob/main/CHANGES.md)
- [Commits](https://github.com/highlightjs/highlight.js/compare/11.9.0...11.10.0)

---
updated-dependencies:
- dependency-name: highlight.js
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-09 18:13:36 +08:00
dependabot[bot]
08a43d0faa chore: bump @typescript-eslint/eslint-plugin from 7.14.1 to 7.15.0 in /web (#3666)
chore: bump @typescript-eslint/eslint-plugin in /web

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 7.14.1 to 7.15.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.15.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-09 18:13:24 +08:00
dependabot[bot]
36795abacc chore: bump golang.org/x/mod from 0.18.0 to 0.19.0 (#3670)
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.18.0 to 0.19.0.
- [Commits](https://github.com/golang/mod/compare/v0.18.0...v0.19.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-09 18:12:49 +08:00
dependabot[bot]
9f7295a4ee chore: bump github.com/aws/aws-sdk-go-v2/credentials from 1.17.23 to 1.17.24 (#3671)
chore: bump github.com/aws/aws-sdk-go-v2/credentials

Bumps [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) from 1.17.23 to 1.17.24.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.23...credentials/v1.17.24)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/credentials
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-09 18:12:39 +08:00
Steven
626c972d9c chore: add properties to memo detail sidebar 2024-07-08 23:14:00 +08:00
Johnny
5e3ed201b4 fix: update mask of update memo (#3659) 2024-07-08 08:50:38 +08:00
Johnny
eccddb1154 chore: add create time to memo detail sidebar (#3657) 2024-07-07 23:09:48 +08:00
dependabot[bot]
a681b8e205 chore: bump github.com/aws/aws-sdk-go-v2/config from 1.27.21 to 1.27.23 (#3640)
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.27.21 to 1.27.23.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.27.21...config/v1.27.23)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-06 16:48:24 +08:00
dependabot[bot]
881809926e chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.17.1 to 1.17.4 (#3649)
chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager

Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.17.1 to 1.17.4.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/v1.17.4/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.17.1...v1.17.4)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-06 16:48:15 +08:00
Johnny
a98d16bcaa chore: update bug report template fields (#3656) 2024-07-06 14:16:44 +08:00
dependabot[bot]
46ca5bb8e7 chore: bump github.com/aws/aws-sdk-go-v2/credentials from 1.17.21 to 1.17.23 (#3637)
chore: bump github.com/aws/aws-sdk-go-v2/credentials

Bumps [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) from 1.17.21 to 1.17.23.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.21...credentials/v1.17.23)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/credentials
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-03 11:44:04 +08:00
dependabot[bot]
b1f12d54a0 chore: bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.56.1 to 1.57.1 (#3644)
chore: bump github.com/aws/aws-sdk-go-v2/service/s3

Bumps [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2) from 1.56.1 to 1.57.1.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.56.1...service/s3/v1.57.1)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/s3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 23:15:39 +08:00
Johnny
4d2b953e23 chore: add enable link preview setting to memo related settings (#3647) 2024-07-02 22:00:38 +08:00
dependabot[bot]
b57b6bae34 chore: bump postcss from 8.4.38 to 8.4.39 in /web (#3642)
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.38 to 8.4.39.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.38...8.4.39)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 08:25:51 +08:00
dependabot[bot]
90c67d5592 chore: bump @typescript-eslint/eslint-plugin from 7.13.1 to 7.14.1 in /web (#3641)
chore: bump @typescript-eslint/eslint-plugin in /web

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 7.13.1 to 7.14.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.14.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 08:25:38 +08:00
dependabot[bot]
4655c99c4e chore: bump @bufbuild/buf from 1.33.0 to 1.34.0 in /web (#3639)
Bumps [@bufbuild/buf](https://github.com/bufbuild/buf) from 1.33.0 to 1.34.0.
- [Release notes](https://github.com/bufbuild/buf/releases)
- [Changelog](https://github.com/bufbuild/buf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bufbuild/buf/compare/v1.33.0...v1.34.0)

---
updated-dependencies:
- dependency-name: "@bufbuild/buf"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 08:25:24 +08:00
dependabot[bot]
68e924e48c chore: bump @types/node from 20.14.2 to 20.14.9 in /web (#3638)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.14.2 to 20.14.9.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 08:25:13 +08:00
dependabot[bot]
ee61bc7861 chore: bump react-router-dom from 6.23.1 to 6.24.0 in /web (#3636)
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.23.1 to 6.24.0.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.24.0/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 08:25:02 +08:00
Steven
3782d412f5 chore: upgrade gomark 2024-07-01 23:28:36 +08:00
dependabot[bot]
de754079cc chore: bump zustand from 4.5.2 to 4.5.4 in /web (#3632)
Bumps [zustand](https://github.com/pmndrs/zustand) from 4.5.2 to 4.5.4.
- [Release notes](https://github.com/pmndrs/zustand/releases)
- [Commits](https://github.com/pmndrs/zustand/compare/v4.5.2...v4.5.4)

---
updated-dependencies:
- dependency-name: zustand
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 23:27:41 +08:00
dependabot[bot]
df0dcb553b chore: bump typescript from 5.4.5 to 5.5.2 in /web (#3633)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.4.5 to 5.5.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.4.5...v5.5.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 23:27:33 +08:00
dependabot[bot]
584d73659e chore: bump @reduxjs/toolkit from 2.2.5 to 2.2.6 in /web (#3634)
Bumps [@reduxjs/toolkit](https://github.com/reduxjs/redux-toolkit) from 2.2.5 to 2.2.6.
- [Release notes](https://github.com/reduxjs/redux-toolkit/releases)
- [Commits](https://github.com/reduxjs/redux-toolkit/compare/v2.2.5...v2.2.6)

---
updated-dependencies:
- dependency-name: "@reduxjs/toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 23:27:22 +08:00
dependabot[bot]
122710801a chore: bump protobufjs from 7.3.0 to 7.3.2 in /web (#3631)
Bumps [protobufjs](https://github.com/protobufjs/protobuf.js) from 7.3.0 to 7.3.2.
- [Release notes](https://github.com/protobufjs/protobuf.js/releases)
- [Changelog](https://github.com/protobufjs/protobuf.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.3.0...protobufjs-v7.3.2)

---
updated-dependencies:
- dependency-name: protobufjs
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 23:24:33 +08:00
Steven
1ad5d9bf0a chore: update confirm dialog 2024-07-01 23:22:39 +08:00
dependabot[bot]
4a3afffeef chore: bump lucide-react from 0.396.0 to 0.399.0 in /web (#3630)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.396.0 to 0.399.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.399.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 23:13:52 +08:00
Steven
291b815653 feat: implement memo detail sidebar 2024-07-01 23:06:10 +08:00
Steven
05c6edfe2f chore: tweak auth pages 2024-06-26 22:11:18 +08:00
dependabot[bot]
6325b3eef9 chore: bump @types/uuid from 9.0.8 to 10.0.0 in /web (#3616)
Bumps [@types/uuid](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/uuid) from 9.0.8 to 10.0.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/uuid)

---
updated-dependencies:
- dependency-name: "@types/uuid"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 08:11:39 +08:00
dependabot[bot]
80c57692e9 chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.16.24 to 1.17.1 (#3617)
chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager

Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.16.24 to 1.17.1.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/v1.17.1/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ram/v1.16.24...v1.17.1)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 08:11:29 +08:00
dependabot[bot]
5828632613 chore: bump @typescript-eslint/parser from 7.13.0 to 7.14.1 in /web (#3620)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 7.13.0 to 7.14.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.14.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 08:11:18 +08:00
Roman Lomonosov
b923988fd6 fix: can't change memo UID (#3621) 2024-06-26 07:18:00 +08:00
dependabot[bot]
9b090d909e chore: bump github.com/aws/aws-sdk-go-v2/config from 1.27.18 to 1.27.21 (#3612)
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.27.18 to 1.27.21.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.27.18...config/v1.27.21)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 22:31:27 +08:00
dependabot[bot]
6abc272709 chore: bump lucide-react from 0.395.0 to 0.396.0 in /web (#3614)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.395.0 to 0.396.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.396.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 22:31:12 +08:00
dependabot[bot]
3752e7b638 chore: bump eslint-plugin-react from 7.34.2 to 7.34.3 in /web (#3618)
Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.34.2 to 7.34.3.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.34.2...v7.34.3)

---
updated-dependencies:
- dependency-name: eslint-plugin-react
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 22:30:56 +08:00
dependabot[bot]
9ba2adb4c4 chore: bump @typescript-eslint/eslint-plugin from 7.13.0 to 7.13.1 in /web (#3619)
chore: bump @typescript-eslint/eslint-plugin in /web

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 7.13.0 to 7.13.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.13.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 22:30:39 +08:00
Zeng1998
4f4fe9b26b fix: add charset=utf-8 for text content resources (#3608)
Co-authored-by: = <=>
2024-06-24 23:01:19 +08:00
Johnny
ca463891f2 chore: fix linter warning for slog (#3604) 2024-06-22 16:39:40 +08:00
Mudkip
e33244e64b fix: PATCH requests on /api/v1 not working (#3600)
* fix: PATCH requests on /api/v1

* Update server/server.go

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2024-06-21 18:16:55 +08:00
steven
33cd3ed8e3 chore: bump version 2024-06-21 18:16:35 +08:00
Ryo
a09c669865 fix: allow cors for grpc gateway handler (#3574) 2024-06-21 18:13:59 +08:00
dependabot[bot]
759337996f chore: bump lucide-react from 0.383.0 to 0.395.0 in /web (#3584)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.383.0 to 0.395.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.395.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 22:11:05 +08:00
dependabot[bot]
cee1d4b1ed chore: bump @typescript-eslint/eslint-plugin from 7.12.0 to 7.13.0 in /web (#3585)
chore: bump @typescript-eslint/eslint-plugin in /web

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 7.12.0 to 7.13.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.13.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 22:10:51 +08:00
dependabot[bot]
77b92f675a chore: bump @bufbuild/buf from 1.32.2 to 1.33.0 in /web (#3586)
Bumps [@bufbuild/buf](https://github.com/bufbuild/buf) from 1.32.2 to 1.33.0.
- [Release notes](https://github.com/bufbuild/buf/releases)
- [Changelog](https://github.com/bufbuild/buf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bufbuild/buf/compare/v1.32.2...v1.33.0)

---
updated-dependencies:
- dependency-name: "@bufbuild/buf"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 22:10:38 +08:00
dependabot[bot]
795700b161 chore: bump vite from 5.2.13 to 5.3.1 in /web (#3587)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.2.13 to 5.3.1.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.3.1/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 22:10:28 +08:00
dependabot[bot]
513ff9d2b0 chore: bump prettier from 3.3.1 to 3.3.2 in /web (#3588)
Bumps [prettier](https://github.com/prettier/prettier) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.3.1...3.3.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 22:10:10 +08:00
dependabot[bot]
84692404e1 chore: bump golang.org/x/oauth2 from 0.20.0 to 0.21.0 (#3583)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.20.0 to 0.21.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.20.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 22:09:34 +08:00
dependabot[bot]
d5d0d14728 chore: bump github.com/gorilla/feeds from 1.1.2 to 1.2.0 (#3582)
Bumps [github.com/gorilla/feeds](https://github.com/gorilla/feeds) from 1.1.2 to 1.2.0.
- [Release notes](https://github.com/gorilla/feeds/releases)
- [Commits](https://github.com/gorilla/feeds/compare/v1.1.2...v1.2.0)

---
updated-dependencies:
- dependency-name: github.com/gorilla/feeds
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 22:09:02 +08:00
dependabot[bot]
9bec88eedc chore: bump github.com/spf13/cobra from 1.8.0 to 1.8.1 (#3581)
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.8.0...v1.8.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 22:08:53 +08:00
dependabot[bot]
1bf6db8154 chore: bump google.golang.org/protobuf from 1.34.1 to 1.34.2 (#3580)
Bumps google.golang.org/protobuf from 1.34.1 to 1.34.2.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 22:08:42 +08:00
dependabot[bot]
5fb649c3c3 chore: bump modernc.org/sqlite from 1.30.0 to 1.30.1 (#3579)
Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.30.0 to 1.30.1.
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.30.0...v1.30.1)

---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 22:08:30 +08:00
dependabot[bot]
b911e98e37 chore: bump docker/build-push-action from 5 to 6 (#3578)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 22:08:20 +08:00
Steven
0501f5198a chore: buf format 2024-06-19 22:07:51 +08:00
Johnny
736637a362 feat: add public flag instead of system setting to enable signup (#3589) 2024-06-19 22:03:12 +08:00
Steven
387bf48fc8 chore: update s3 config 2024-06-11 22:05:28 +08:00
dependabot[bot]
e9d027ca3e chore: bump @typescript-eslint/parser from 7.12.0 to 7.13.0 in /web (#3558)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 7.12.0 to 7.13.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.13.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-11 10:48:03 +08:00
dependabot[bot]
0c378ec291 chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.16.21 to 1.16.24 (#3547)
chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager

Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.16.21 to 1.16.24.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ram/v1.16.21...service/ram/v1.16.24)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-11 09:01:47 +08:00
dependabot[bot]
5836bf5a72 chore: bump golang.org/x/net from 0.25.0 to 0.26.0 (#3549)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.25.0 to 0.26.0.
- [Commits](https://github.com/golang/net/compare/v0.25.0...v0.26.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-11 08:59:43 +08:00
dependabot[bot]
7aba6bef21 chore: bump github.com/aws/aws-sdk-go-v2/config from 1.27.16 to 1.27.18 (#3550)
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.27.16 to 1.27.18.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.27.16...config/v1.27.18)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-11 08:59:32 +08:00
dependabot[bot]
f31a53caa7 chore: bump uuid from 9.0.1 to 10.0.0 in /web (#3556)
Bumps [uuid](https://github.com/uuidjs/uuid) from 9.0.1 to 10.0.0.
- [Changelog](https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/uuidjs/uuid/compare/v9.0.1...v10.0.0)

---
updated-dependencies:
- dependency-name: uuid
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-11 08:59:08 +08:00
dependabot[bot]
28624514d1 chore: bump goreleaser/goreleaser-action from 5 to 6 (#3551)
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 5 to 6.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](https://github.com/goreleaser/goreleaser-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 23:35:09 +08:00
dependabot[bot]
b42979edcc chore: bump golang.org/x/mod from 0.17.0 to 0.18.0 (#3548)
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.17.0 to 0.18.0.
- [Commits](https://github.com/golang/mod/compare/v0.17.0...v0.18.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 23:34:45 +08:00
dependabot[bot]
bc1b095812 chore: bump github.com/aws/aws-sdk-go-v2 from 1.27.0 to 1.27.2 (#3546)
Bumps [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) from 1.27.0 to 1.27.2.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.27.0...v1.27.2)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 23:34:24 +08:00
Ryo
2c819ace4e feat: return not found error instead internal error for local file not exist (#3543)
* chore: add `/.vscode` to `.gitignore`

* feat: return not found instead of internal for resource

* feat: check file not exist only if error not nil
2024-06-10 14:11:28 +08:00
andrigamerita
e4a09c407c feat: write memo visibility in file names when exporting (#3538)
When using the dedicated feature in Memos' user settings to export all memos to Markdown files inside a ZIP folder, the output doesn't feature any kind of distinction for memos by their set visibility.
While this is not a big issue for personal backups, it can reveal itself problematic if exporting the data to share it with other people, or maybe deploy to a static site generator, because there is nothing in the files that distinguishes public memos from private or workspace-restricted ones.

This pull request simply modifies the ExportMemos server function, to add the Visibility status to the end of every exported file name inside the ZIP, right after the date (which is left intact). For example, the file for a public memo would now be called: `YYYY-MM-DDThh:mm:ss+hh:mm-PUBLIC.md`.

An alternative solution would have been to write this information in a YAML header at the beginning of every Markdown file, but, since those are not used anywhere else in the software, I decided to stick with what is already used for export metadata, the filename.
2024-06-09 19:22:13 +08:00
Steven
da603053f2 chore: add th locale 2024-06-09 07:46:03 +08:00
boojack
edda6ea4bd chore: update i18n with Weblate (#3540)
* Added translation using Weblate (Thai)

* Translated using Weblate (Thai)

Currently translated at 100.0% (260 of 260 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/th/

---------

Co-authored-by: NeneNeko <lennon.rin@gmail.com>
2024-06-09 07:43:59 +08:00
boojack
7b7ecc2daa chore: update i18n with Weblate (#3533)
* Translated using Weblate (Japanese)

Currently translated at 100.0% (260 of 260 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/ja/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (260 of 260 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

---------

Co-authored-by: Somme4096 <somme4096@gmail.com>
Co-authored-by: Yuri <isyuricunha@duck.com>
2024-06-07 05:10:12 +08:00
Steven
fa4521e0c5 chore: update gomark source 2024-06-06 23:09:13 +08:00
Steven
076aa2f8aa chore: remove memo filter 2024-06-05 23:18:14 +08:00
Steven
f33571fec6 feat: update webhook request payload 2024-06-05 20:53:20 +08:00
Steven
d159975994 chore: update statistics view 2024-06-05 20:46:35 +08:00
Martin MacDonald
aec5927d31 feat: add hook for generating different date times (#3524)
* Added hook for generating different date times

* Fixed up logic to destructure the datetime params

---------

Co-authored-by: Martin MacDonald <martinmacdonald@Martins-MacBook-Pro.local>
2024-06-05 19:52:07 +08:00
Steven
7375b87967 chore: tweak tooltips 2024-06-05 08:51:04 +08:00
Steven
54539aa047 chore: tweak seed data 2024-06-05 08:48:46 +08:00
Steven
d0ac866eb1 chore: update statistics view 2024-06-05 08:48:40 +08:00
Steven
797f5a123c feat: add HasIncompleteTasks to memo property 2024-06-05 08:39:56 +08:00
Martin MacDonald
f0817f2762 chore: update fetch tags args (#3515)
* Centralised the logic for filters to apply to tagging and updated components to pass in those params needed

* Fixed linting issue

* Split out params from options

* Fixed linting errors

---------

Co-authored-by: Martin MacDonald <martinmacdonald@Martins-MacBook-Pro.local>
2024-06-05 08:06:01 +08:00
Martin MacDonald
2ebd5c64bd fix: copy by reference (#3517)
* Fixed issue with copy by reference

* Fixed linting issues

---------

Co-authored-by: Martin MacDonald <martinmacdonald@Martins-MacBook-Pro.local>
2024-06-05 08:04:50 +08:00
Martin MacDonald
0977acbc7f fix: update uniqby key (#3518)
* Used correct uniqby key

* Put back filter

---------

Co-authored-by: Martin MacDonald <martinmacdonald@Martins-MacBook-Pro.local>
2024-06-05 08:03:56 +08:00
Steven
e8ed437ca3 fix: purify html before render 2024-06-04 23:10:54 +08:00
Steven
2b49025f4a chore: update memo filters 2024-06-04 23:03:51 +08:00
Steven
bddfe00b5c chore: bump version 2024-06-04 20:51:53 +08:00
dependabot[bot]
aafddac65f chore: bump modernc.org/sqlite from 1.29.10 to 1.30.0 (#3510)
Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.29.10 to 1.30.0.
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.29.10...v1.30.0)

---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-04 07:18:07 +08:00
dependabot[bot]
b4113581b3 chore: bump github.com/spf13/viper from 1.18.2 to 1.19.0 (#3511)
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.18.2 to 1.19.0.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.18.2...v1.19.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-04 07:17:40 +08:00
Steven
e40b39033f chore: fix compact default value 2024-06-04 07:17:16 +08:00
Michael
616f306efe chore: update i18n with Weblate (#3509)
* Translated using Weblate (French)

Currently translated at 100.0% (260 of 260 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/fr/

* Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (260 of 260 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hant/

---------

Co-authored-by: Ezmana <ezmana.land@gmail.com>
Co-authored-by: ti777777 <ti12272198686@yahoo.com.tw>
2024-06-03 23:57:59 +08:00
Steven
370ac32344 chore: regenerate pnpm-local.yaml 2024-06-03 23:51:29 +08:00
Steven
20b8a97a88 chore: retire outdate scripts 2024-06-03 23:50:59 +08:00
dependabot[bot]
be6fc1ca4d chore: bump lucide-react from 0.378.0 to 0.383.0 in /web (#3507)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.378.0 to 0.383.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.383.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-03 23:40:00 +08:00
dependabot[bot]
c41d53b4b6 chore: bump @types/node from 20.12.12 to 20.14.0 in /web (#3504)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.12.12 to 20.14.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-03 23:38:03 +08:00
Martin MacDonald
760dee4159 feat: delete memo comments when memo is deleted (#3491)
* Added logic to delete memo relation and memo comments recursively when a memo is deleted

* Fixed logic to only target comment types and added removing of broken references

* Fixed linting errors

---------

Co-authored-by: Martin MacDonald <martinmacdonald@Martins-MacBook-Pro.local>
2024-06-03 19:50:13 +08:00
Steven
08d37acffa chore: tweak readme 2024-06-02 14:31:54 +08:00
Michael
c484b09c4c chore: update i18n with Weblate (#3499)
* Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (260 of 260 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (260 of 260 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/tr/

---------

Co-authored-by: Lincoln Nogueira <lincolnthalles@users.noreply.github.com>
Co-authored-by: Oğuz Han <h4n.3545@gmail.com>
2024-06-02 14:06:05 +08:00
Steven
2e0d5412b4 chore: tweak webhook payload 2024-06-01 23:46:00 +08:00
Steven
8c0bee3840 chore: tweak refresh button 2024-06-01 23:27:35 +08:00
Steven
78f6064530 chore: tweak goreleaser action 2024-06-01 10:04:39 +08:00
Steven
d7be24a0e1 chore: tweak goreleaser 2024-06-01 09:59:52 +08:00
Steven
5493f5f14e chore: regenerate dependencies 2024-06-01 09:58:47 +08:00
Steven
1dc686fa6c chore: update build artifacts 2024-06-01 09:49:47 +08:00
Steven
4e54ec38ff chore: update memo related settings 2024-06-01 09:05:09 +08:00
Steven
0657a1ef5b chore: fix memo editor cache 2024-06-01 08:48:54 +08:00
Michael
48546f05b3 chore: update i18n with Weblate (#3492)
* Translated using Weblate (Turkish)

Currently translated at 100.0% (259 of 259 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/tr/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (259 of 259 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

* Apply suggestions from code review

---------

Co-authored-by: Oğuz Han <h4n.3545@gmail.com>
Co-authored-by: Coisini-H <2972186196@qq.com>
2024-06-01 08:42:01 +08:00
Steven
08a9291964 chore: update timeline filters 2024-05-31 09:06:03 +08:00
Steven
98f2cf6397 chore: tweak linter 2024-05-30 07:23:16 +08:00
Steven
b1cc1255bb chore: tweak seed data 2024-05-30 07:21:10 +08:00
Steven
b215426623 chore: update general setting 2024-05-30 07:19:38 +08:00
Steven
423861d48c fix: create idp in postgres 2024-05-29 23:22:20 +08:00
Michael
f2b708c1b8 chore: update i18n with Weblate (#3483)
* Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (257 of 257 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (257 of 257 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/tr/

---------

Co-authored-by: Lincoln Nogueira <lincolnthalles@users.noreply.github.com>
Co-authored-by: Ramazan SANCAR <ramazansancar4545@gmail.com>
2024-05-29 23:20:11 +08:00
Steven
0f4b7c5f4a feat: add more memo settings 2024-05-29 23:17:53 +08:00
Steven
1894ef161f chore: fix content search 2024-05-29 22:04:37 +08:00
Michael
98eb57b370 chore: update translation files (#3481)
Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/

Co-authored-by: Hosted Weblate <hosted@weblate.org>
2024-05-29 08:05:14 +08:00
Steven
cf70867470 chore: update tag section 2024-05-29 08:03:01 +08:00
Steven
719c22fef8 chore: update i18n 2024-05-29 07:39:16 +08:00
Steven
6010139291 chore: remove unused 2024-05-29 07:36:51 +08:00
Steven
cbf556fee5 chore: fix memo cache key 2024-05-28 23:23:23 +08:00
Steven
93e848d170 chore: tweak root redirector 2024-05-28 19:59:29 +08:00
Steven
60b5b4815d chore: fix imports 2024-05-28 09:10:08 +08:00
dependabot[bot]
98bd4568e7 chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.16.20 to 1.16.21 (#3469)
chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager

Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.16.20 to 1.16.21.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ram/v1.16.20...service/ram/v1.16.21)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-28 09:07:42 +08:00
dependabot[bot]
c24225fd89 chore: bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.54.2 to 1.54.3 (#3471)
chore: bump github.com/aws/aws-sdk-go-v2/service/s3

Bumps [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2) from 1.54.2 to 1.54.3.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.54.2...service/s3/v1.54.3)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/s3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-28 09:06:53 +08:00
dependabot[bot]
5ea04ca596 chore: bump github.com/aws/aws-sdk-go-v2/config from 1.27.15 to 1.27.16 (#3472)
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.27.15 to 1.27.16.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.27.15...config/v1.27.16)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-28 09:06:45 +08:00
Steven
0275a65781 chore: add last visited page 2024-05-28 09:05:59 +08:00
dependabot[bot]
239f28c1e0 chore: bump @vitejs/plugin-react from 4.2.1 to 4.3.0 in /web (#3467)
Bumps [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/tree/HEAD/packages/plugin-react) from 4.2.1 to 4.3.0.
- [Release notes](https://github.com/vitejs/vite-plugin-react/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-react/commits/v4.3.0/packages/plugin-react)

---
updated-dependencies:
- dependency-name: "@vitejs/plugin-react"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-28 06:07:43 +08:00
dependabot[bot]
f78114da43 chore: bump github.com/aws/aws-sdk-go-v2/credentials from 1.17.15 to 1.17.16 (#3468)
chore: bump github.com/aws/aws-sdk-go-v2/credentials

Bumps [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) from 1.17.15 to 1.17.16.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.15...credentials/v1.17.16)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/credentials
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-27 23:37:05 +08:00
dependabot[bot]
75e76e1331 chore: bump @types/react from 18.3.2 to 18.3.3 in /web (#3466)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.3.2 to 18.3.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-27 23:36:53 +08:00
dependabot[bot]
9f83be1d48 chore: bump @typescript-eslint/parser from 7.9.0 to 7.10.0 in /web (#3465)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 7.9.0 to 7.10.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.10.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-27 23:36:43 +08:00
dependabot[bot]
250bdff4c5 chore: bump @bufbuild/buf from 1.32.0 to 1.32.1 in /web (#3464)
Bumps [@bufbuild/buf](https://github.com/bufbuild/buf) from 1.32.0 to 1.32.1.
- [Release notes](https://github.com/bufbuild/buf/releases)
- [Changelog](https://github.com/bufbuild/buf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bufbuild/buf/compare/v1.32.0...v1.32.1)

---
updated-dependencies:
- dependency-name: "@bufbuild/buf"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-27 23:36:33 +08:00
dependabot[bot]
b8d4720e5e chore: bump i18next from 23.11.4 to 23.11.5 in /web (#3463)
Bumps [i18next](https://github.com/i18next/i18next) from 23.11.4 to 23.11.5.
- [Release notes](https://github.com/i18next/i18next/releases)
- [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md)
- [Commits](https://github.com/i18next/i18next/compare/v23.11.4...v23.11.5)

---
updated-dependencies:
- dependency-name: i18next
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-27 23:36:24 +08:00
dependabot[bot]
3e11adc15b chore: bump modernc.org/sqlite from 1.29.9 to 1.29.10 (#3470)
Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.29.9 to 1.29.10.
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.29.9...v1.29.10)

---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-27 23:36:09 +08:00
Steven
e475f00ba1 chore: tweak seed data 2024-05-27 23:32:08 +08:00
Steven
f0e5a72271 feat: update search memo filter 2024-05-27 23:25:25 +08:00
Steven
ba0876a563 feat: update statistics view 2024-05-27 20:04:07 +08:00
Steven
a423dac12c chore: tweak memo property 2024-05-27 19:43:57 +08:00
Steven
2b4c2b23b2 chore: tweak linter 2024-05-26 21:39:34 +08:00
Ryo
784fcbb698 feat: add panic recovery middleware for grpc and echo server (#3459) 2024-05-26 21:38:59 +08:00
Steven
1ccfa81cf3 chore: tweak common function 2024-05-26 11:02:23 +08:00
Steven
a177800e83 chore: tweak error message 2024-05-25 11:05:35 +08:00
Steven
d39cacf1f9 chore: tweak readme 2024-05-25 11:01:54 +08:00
Michael
8233a6ba1c chore: translated using Weblate (Marathi) (#3451)
Translated using Weblate (Marathi)

Currently translated at 100.0% (255 of 255 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/mr/

Co-authored-by: quaintdev <accounts@rohanrd.xyz>
2024-05-25 05:44:20 +08:00
quaintdev
af71ac49bb feat(i18n): added marathi(mr) translations (#3449) 2024-05-25 05:43:37 +08:00
Steven
7d6dbb9487 fix: link hover handler 2024-05-22 23:25:04 +08:00
Steven
4070998f9f chore: fix linter 2024-05-22 21:55:13 +08:00
Steven
d3235f75f3 chore: tweak memo definition 2024-05-22 21:52:41 +08:00
Steven
e0600388b2 chore: implement memo property endpoint 2024-05-22 09:21:12 +08:00
Steven
16d3de63c2 chore: update resource binary endpoint 2024-05-21 21:25:21 +08:00
Michael
2c50d3469e chore: update i18n with weblate (#3435)
* Translated using Weblate (Ukrainian)

Currently translated at 58.0% (148 of 255 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/uk/

* Translated using Weblate (Ukrainian)

Currently translated at 58.0% (148 of 255 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/uk/

---------

Co-authored-by: LibreTranslate <noreply-mt-libretranslate@weblate.org>
Co-authored-by: Gregory Malets <gregory.malets@gmail.com>
2024-05-21 20:36:28 +08:00
Steven
b5d2ff6e28 chore: fix linter 2024-05-21 00:08:57 +08:00
dependabot[bot]
3616194d03 chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.16.17 to 1.16.20 (#3415)
chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager

Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.16.17 to 1.16.20.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ram/v1.16.17...service/ram/v1.16.20)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 00:04:02 +08:00
Steven
811c0757c4 chore: fix linter 2024-05-21 00:03:30 +08:00
dependabot[bot]
464b00ea0b chore: bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.53.2 to 1.54.2 (#3416)
chore: bump github.com/aws/aws-sdk-go-v2/service/s3

Bumps [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2) from 1.53.2 to 1.54.2.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.53.2...service/s3/v1.54.2)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/s3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 00:02:17 +08:00
dependabot[bot]
a1e610fd8e chore: bump github.com/grpc-ecosystem/grpc-gateway/v2 from 2.19.1 to 2.20.0 (#3417)
chore: bump github.com/grpc-ecosystem/grpc-gateway/v2

Bumps [github.com/grpc-ecosystem/grpc-gateway/v2](https://github.com/grpc-ecosystem/grpc-gateway) from 2.19.1 to 2.20.0.
- [Release notes](https://github.com/grpc-ecosystem/grpc-gateway/releases)
- [Changelog](https://github.com/grpc-ecosystem/grpc-gateway/blob/main/.goreleaser.yml)
- [Commits](https://github.com/grpc-ecosystem/grpc-gateway/compare/v2.19.1...v2.20.0)

---
updated-dependencies:
- dependency-name: github.com/grpc-ecosystem/grpc-gateway/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 00:02:08 +08:00
dependabot[bot]
e813853624 chore: bump google.golang.org/grpc from 1.63.2 to 1.64.0 (#3418)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.63.2 to 1.64.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.63.2...v1.64.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 00:00:52 +08:00
dependabot[bot]
b2f9496c96 chore: bump github.com/aws/aws-sdk-go-v2/config from 1.27.13 to 1.27.15 (#3414)
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.27.13 to 1.27.15.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.27.13...config/v1.27.15)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 00:00:27 +08:00
dependabot[bot]
f1392e220e chore: bump @typescript-eslint/parser from 7.8.0 to 7.9.0 in /web (#3423)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 7.8.0 to 7.9.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.9.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 00:00:06 +08:00
Steven
f37b34544b chore: update user access token checks 2024-05-20 22:32:42 +08:00
Steven
f54b05a521 chore: tweak comments 2024-05-20 22:15:51 +08:00
Steven
613c9e9416 chore: tweak version 2024-05-20 21:10:04 +08:00
Steven
fb15386db2 chore: remove access token after sign out 2024-05-20 08:53:29 +08:00
Steven
21838d0aae chore: fix editor autocomplete 2024-05-20 08:49:55 +08:00
Timothy
52ebfd703c fix: update resource with id (#3405)
* chore: update presign expires

* fix: update resource with id

---------

Co-authored-by: timothy <timothy123890511@gmail.com>
2024-05-19 23:18:03 +08:00
Michael
8f6d38719f chore: update i18n from Weblate (#3399)
* Added translation using Weblate (Marathi)

* Translated using Weblate (Marathi)

Currently translated at 22.7% (58 of 255 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/mr/

---------

Co-authored-by: quaintdev <accounts@rohanrd.xyz>
2024-05-19 09:16:13 +08:00
Steven
93d06bc0f0 chore: tweak readme 2024-05-19 09:15:46 +08:00
Steven
c25c57ab61 feat: support updating display time 2024-05-18 07:52:35 +08:00
Steven
b0aad6f694 chore: tweak resource payload 2024-05-17 08:50:02 +08:00
Steven
0c251f9ab8 chore: fix resource delete handler 2024-05-16 21:53:12 +08:00
wzc90
0a9212f815 fix: memo find for mysql(#3387)
* Update memo.go

* Update store/db/mysql/memo.go

Co-authored-by: boojack <stevenlgtm@gmail.com>

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2024-05-16 07:37:42 +08:00
Steven
537ae622d2 chore: filter inbox type 2024-05-15 23:22:23 +08:00
Steven
3e5e5b1f80 chore: fix search memos 2024-05-15 22:42:31 +08:00
wzc90
3ecbbf31a9 fix: migration scripts for mysql (#3384) 2024-05-15 17:34:59 +08:00
wzc90
deb1deb14c fix: resource create time format for mysql (#3381) 2024-05-15 15:51:43 +08:00
Steven
c8ff3fa2ee chore: fix uploading flag 2024-05-15 09:08:34 +08:00
dependabot[bot]
f67676ac43 chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.16.15 to 1.16.17 (#3367)
chore: bump github.com/aws/aws-sdk-go-v2/feature/s3/manager

Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.16.15 to 1.16.17.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.16.15...service/ram/v1.16.17)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 11:48:46 +08:00
dependabot[bot]
38c6c50681 chore: bump golangci/golangci-lint-action from 5 to 6 (#3365)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 5 to 6.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 11:46:44 +08:00
dependabot[bot]
74e0f5429a chore: bump pnpm/action-setup from 3.0.0 to 4.0.0 (#3366)
Bumps [pnpm/action-setup](https://github.com/pnpm/action-setup) from 3.0.0 to 4.0.0.
- [Release notes](https://github.com/pnpm/action-setup/releases)
- [Commits](https://github.com/pnpm/action-setup/compare/v3.0.0...v4.0.0)

---
updated-dependencies:
- dependency-name: pnpm/action-setup
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 11:46:35 +08:00
dependabot[bot]
3add70714f chore: bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.53.1 to 1.53.2 (#3369)
chore: bump github.com/aws/aws-sdk-go-v2/service/s3

Bumps [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2) from 1.53.1 to 1.53.2.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.53.1...service/s3/v1.53.2)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/s3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 11:46:28 +08:00
dependabot[bot]
78f0ae649a chore: bump golang.org/x/net from 0.24.0 to 0.25.0 (#3370)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.24.0 to 0.25.0.
- [Commits](https://github.com/golang/net/compare/v0.24.0...v0.25.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 08:12:52 +08:00
Steven
9265b8e2bd chore: update tags filter 2024-05-14 08:12:25 +08:00
Steven
2317204c50 fix: list idp 2024-05-14 07:04:17 +08:00
dependabot[bot]
32abc50af4 chore: bump github.com/aws/aws-sdk-go-v2/config from 1.27.11 to 1.27.13 (#3371) 2024-05-14 06:45:14 +08:00
Steven
0c673d49ef chore: retire memo tags 2024-05-13 22:12:56 +08:00
Steven
d3744ccfa3 chore: tweak seed data 2024-05-13 22:07:44 +08:00
Steven
c561362d62 feat: implement memo property 2024-05-13 22:04:37 +08:00
Steven
555b4fbe32 chore: update seed data 2024-05-13 20:27:24 +08:00
Steven
8948edf654 chore: impl memo payload definition 2024-05-13 20:24:11 +08:00
Steven
31e07c083d chore: fix types 2024-05-13 20:07:56 +08:00
Steven
b8763905ba chore: tweak naming 2024-05-13 20:03:04 +08:00
Michael
62705fed39 chore: translated using Weblate (French) (#3358)
Translated using Weblate (French)

Currently translated at 100.0% (255 of 255 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/fr/

Co-authored-by: Ezmana <ezmana.land@gmail.com>
2024-05-13 10:18:33 +08:00
Michael
6df3cf808e chore: update seed data 2024-05-13 10:15:30 +08:00
Michael
6c481743de chore: translated using Weblate (Turkish) (#3356)
Translated using Weblate (Turkish)

Currently translated at 100.0% (255 of 255 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/tr/

Co-authored-by: Oğuz Han <h4n.3545@gmail.com>
2024-05-13 08:10:15 +08:00
Steven
83b9ea45b9 chore: tweak dark mode styles 2024-05-13 08:09:32 +08:00
Steven
f79554371d chore: retire share dialog 2024-05-13 07:57:58 +08:00
Steven
eda1983964 chore: return workspace setting with default value 2024-05-12 13:32:26 +08:00
Steven
cf423026a5 chore: update store cache 2024-05-12 13:19:31 +08:00
Leo LI
93e8fa4912 fix: upgrade scripts for mysql
* Fix mysql db migration

* Update store/db/mysql/migration/prod/0.22/01__memo_tags.sql

* Update store/db/mysql/migration/prod/0.22/02__memo_payload.sql

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2024-05-12 12:34:21 +08:00
Steven
bb076ce486 chore: update list workspace settings 2024-05-12 08:09:14 +08:00
Steven
cf7718f8dc chore: update presign expires 2024-05-12 08:03:56 +08:00
Steven
29a22914cf fix: postgres upgrade script 2024-05-11 22:35:26 +08:00
Steven
087f60ba7b chore: fix user setting key checks 2024-05-11 21:14:21 +08:00
wzc90
d4157bcffa fix: upgrade scripts (#3347) 2024-05-11 17:43:13 +08:00
Michael
ee984a8872 chore: translated using Weblate (Chinese (Simplified)) (#3345)
Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (255 of 255 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

Co-authored-by: Coisini-H <2972186196@qq.com>
2024-05-11 16:00:33 +08:00
wzc90
80df8f8aed fix: upgrade scripts (#3344) 2024-05-11 15:38:14 +08:00
Michael
a15025303b chore: update i18n with Weblate (#3339)
* Translated using Weblate (Japanese)

Currently translated at 100.0% (255 of 255 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/ja/

* Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (255 of 255 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

* Translated using Weblate (Chinese (Traditional))

Currently translated at 99.6% (254 of 255 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hant/

---------

Co-authored-by: Somme4096 <somme4096@gmail.com>
Co-authored-by: Lincoln Nogueira <lincolnthalles@users.noreply.github.com>
2024-05-11 08:15:40 +08:00
Lincoln Nogueira
f45f673aec chore: respect supplied listening address (#3338) 2024-05-11 06:50:22 +08:00
Steven
f30599fbd2 chore: fix scripts 2024-05-10 23:23:15 +08:00
Steven
041f9b1beb chore: bump version 2024-05-10 23:02:57 +08:00
boojack
3fbc4d8539 feat: implement drag and drop for resource order in editor (#3337)
* Implement drag and drop for resource order in editor

* chore: update

* chore: update

* chore: update
2024-05-10 20:34:35 +08:00
Steven
5f207c8f0c fix: math overflow 2024-05-10 06:21:47 +08:00
Michael
fe5a0fe98a chore: update i18n with Weblate (#3335)
* Translated using Weblate (Japanese)

Currently translated at 100.0% (255 of 255 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/ja/

* Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (255 of 255 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/

---------

Co-authored-by: Somme4096 <somme4096@gmail.com>
Co-authored-by: Lincoln Nogueira <lincolnthalles@users.noreply.github.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
2024-05-09 22:40:27 +08:00
Steven
584c669068 chore: tweak max width 2024-05-09 22:10:27 +08:00
Steven
46a085f8df chore: add datepicker to timeline 2024-05-09 20:31:37 +08:00
Steven
e7a788fa71 chore: tweak memo detail page 2024-05-09 20:10:13 +08:00
Steven
942052b1ea chore: update grpc options 2024-05-09 20:08:18 +08:00
Steven
deae53c1f1 chore: add dayjs to fix datetime format in safari 2024-05-09 08:52:34 +08:00
Steven
1d99dad435 feat: update timeline page 2024-05-09 07:56:00 +08:00
Steven
33133ea1a3 chore: tweak searchbar styles 2024-05-08 22:50:13 +08:00
Steven
a4235bb4bf chore: tweak tags style 2024-05-08 22:31:22 +08:00
Steven
e0977e53f7 chore: remove unused route 2024-05-08 22:15:29 +08:00
Michael
4e12744811 chore: update translation files (#3332)
Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/

Co-authored-by: Hosted Weblate <hosted@weblate.org>
2024-05-08 21:35:19 +08:00
Steven
40a5503d45 chore: tweak i18n locales 2024-05-08 21:33:49 +08:00
Steven
16670b6b8d chore: tweak seed data 2024-05-08 20:08:53 +08:00
Michael
d57e7d5a0b chore: update translation files (#3331)
Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/

Co-authored-by: Hosted Weblate <hosted@weblate.org>
2024-05-08 20:06:05 +08:00
Steven
f7f4206fa1 chore: fix linter 2024-05-08 20:05:16 +08:00
Steven
292861be16 chore: retire tag store 2024-05-08 20:03:18 +08:00
Steven
d0655ece53 refactor: update memo tags 2024-05-08 20:03:01 +08:00
Steven
2c270438ec chore: update default service config 2024-05-08 06:57:53 +08:00
Jerwin Arnado
a9caecf479 fix: Set max height to 50vh for better viewing for larger screens. (#3330)
Feature: Set max height to 50vh for better viewing for larger screens.
2024-05-07 23:19:20 +08:00
Steven
d355e2c631 chore: tweak tags section 2024-05-07 22:11:46 +08:00
Steven
4950ea1c74 fix: grpc max message size 2024-05-07 22:10:27 +08:00
Steven
f9258e41a0 chore: tweak max width 2024-05-07 22:10:08 +08:00
steven
e16546f80a chore: handle legacy workspace setting 2024-05-07 22:07:44 +08:00
dependabot[bot]
a73f979f96 chore: bump lucide-react from 0.368.0 to 0.378.0 in /web (#3313)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.368.0 to 0.378.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.378.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 08:53:35 +08:00
dependabot[bot]
41549a6951 chore: bump @types/node from 20.12.9 to 20.12.10 in /web (#3323)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.12.9 to 20.12.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 08:53:18 +08:00
dependabot[bot]
1e8346290c chore: bump @mui/joy from 5.0.0-beta.32 to 5.0.0-beta.36 in /web (#3317)
Bumps [@mui/joy](https://github.com/mui/material-ui/tree/HEAD/packages/mui-joy) from 5.0.0-beta.32 to 5.0.0-beta.36.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/next/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/HEAD/packages/mui-joy)

---
updated-dependencies:
- dependency-name: "@mui/joy"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 08:53:06 +08:00
dependabot[bot]
6a2701ee83 chore: bump react-redux from 9.1.1 to 9.1.2 in /web (#3316) 2024-05-07 05:11:26 +08:00
dependabot[bot]
68fcf250a0 chore: bump google.golang.org/protobuf from 1.33.0 to 1.34.1 (#3318) 2024-05-07 05:11:15 +08:00
dependabot[bot]
5aaf0b88fd chore: bump golang.org/x/oauth2 from 0.19.0 to 0.20.0 (#3319) 2024-05-07 05:11:04 +08:00
dependabot[bot]
f9b0a2b693 chore: bump golang.org/x/crypto from 0.22.0 to 0.23.0 (#3320) 2024-05-07 05:10:52 +08:00
dependabot[bot]
bf07a2cfe6 chore: bump modernc.org/sqlite from 1.29.8 to 1.29.9 (#3321) 2024-05-07 05:10:40 +08:00
Steven
776664105a chore: tweak content length limit 2024-05-06 19:12:30 +08:00
Michael
b0ecb72eaa chore: translated using Weblate (Hungarian) (#3312)
Translated using Weblate (Hungarian)

Currently translated at 98.6% (299 of 303 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/hu/

Co-authored-by: Vermunds <33235701+Vermunds@users.noreply.github.com>
2024-05-06 08:03:52 +08:00
Steven
af1ad2f2db chore: add memo content length limit setting 2024-05-06 08:02:39 +08:00
Nabiel Omar Syarif
56ceba2dec fix: fix deleting tag from tag lists (#3311) 2024-05-06 07:38:15 +08:00
Steven
e32a585bbf chore: update resource dashboard 2024-05-06 07:37:48 +08:00
Steven
dfc0889a4f chore: tweak package name 2024-05-06 07:18:54 +08:00
Michael
da535c8dc6 chore: translated using Weblate (Chinese (Simplified)) (#3307)
Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (303 of 303 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

Co-authored-by: Sung Kim <1740603900@qq.com>
2024-05-04 11:52:26 +08:00
Steven
10c57167cc chore: remove unused flags 2024-05-03 07:16:07 +08:00
Steven
5742f9ca13 fix: seed data 2024-05-03 07:02:08 +08:00
Steven
e9831caca1 chore: remove unused field 2024-05-02 22:21:49 +08:00
Steven
b23b6302de chore: tweak linter 2024-05-02 22:10:50 +08:00
Steven
74145157a0 chore: add presign background service 2024-05-02 22:08:45 +08:00
Steven
05f73a2236 chore: tweak linter 2024-05-02 21:46:47 +08:00
Steven
775b79338d chore: update object in s3 2024-05-02 21:44:17 +08:00
Steven
26545c855c refactor: implement s3 storage 2024-05-02 21:28:06 +08:00
Michael
355ea352aa chore: translated using Weblate (Chinese (Traditional)) (#3304)
Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (303 of 303 strings)

Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (303 of 303 strings)


Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hant/
Translation: memos-i18n/i18n

Co-authored-by: Yuri <isyuricunha@duck.com>
2024-05-02 20:23:12 +08:00
Steven
144269fbbc chore: fix router 2024-05-01 12:44:18 +08:00
Steven
590b626052 chore: update upload resources button 2024-05-01 10:43:09 +08:00
Steven
832ad92bac chore: update gitignore 2024-05-01 10:31:26 +08:00
Steven
20dd3e17f7 chore: rename router package 2024-05-01 10:28:32 +08:00
Steven
8ae4bc95dc chore: migrate auth package 2024-05-01 10:26:46 +08:00
Steven
ff175bbb7e refactor: update resource binary request handler 2024-05-01 10:23:56 +08:00
Steven
6d3d71df30 chore: update frontend dependencies 2024-04-30 22:27:20 +08:00
Steven
d668794c7c chore: update build docker image actions 2024-04-30 22:21:46 +08:00
Steven
33f52320f7 fix: remove lazy import components 2024-04-30 22:06:47 +08:00
Steven
6295979592 chore: add user avatar route 2024-04-30 22:06:34 +08:00
Michael
cac6f42770 fix: server matchs 2024-04-30 10:18:04 +08:00
dependabot[bot]
00f1773495 chore: bump golangci/golangci-lint-action from 4 to 5 (#3298)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 4 to 5.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 23:28:15 +08:00
Steven
8a3845ff54 chore: remove external resource dialog 2024-04-29 22:57:47 +08:00
Steven
155c5baf2c refactor: add markdown service 2024-04-29 08:00:37 +08:00
Steven
4338234641 chore: retire storage related functions 2024-04-28 21:50:09 +08:00
Steven
320963098f refactor: update storage setting 2024-04-28 21:36:22 +08:00
Steven
f25c7d9b24 fix: serve frontend assets 2024-04-28 08:36:33 +08:00
Steven
d8aeec993c chore: replace classnames with clsx 2024-04-28 00:58:40 +08:00
Steven
1b291422e7 refactor: api version 2024-04-28 00:44:29 +08:00
Steven
8bba7f706e chore: update IME mode checks 2024-04-28 00:12:44 +08:00
Steven
f9942002f9 chore: fix linter 2024-04-27 23:36:57 +08:00
Steven
92872118b9 refactor: tweak api definition 2024-04-27 23:14:58 +08:00
Steven
9b66ef5e26 chore: tweak api definition 2024-04-27 22:02:15 +08:00
Steven
04c78e180c chore: update buf dependencies 2024-04-27 00:37:45 +08:00
Michael
cc2370e01e chore: update i18n with Weblate (#3287)
* Translated using Weblate (Japanese)

Currently translated at 91.0% (276 of 303 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/ja/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 99.6% (302 of 303 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

---------

Co-authored-by: mirukupc <mirukupc.jp@gmail.com>
Co-authored-by: Coisini-H <2972186196@qq.com>
2024-04-27 00:32:58 +08:00
Steven
7217605831 chore: update gitignore 2024-04-27 00:26:04 +08:00
Steven
a6a62eb79c chore: update gitignore 2024-04-27 00:25:47 +08:00
Steven
5f26c52b49 feat: add goreleaser 2024-04-27 00:22:27 +08:00
Steven
647602beac chore: update link preview 2024-04-25 21:01:13 +08:00
Steven
81d24f32a7 fix: memo comment keys 2024-04-25 09:10:11 +08:00
SkyWT
9bcd4f59a2 fix: editor IME composing event behavior (#3267)
* fix: editor IME composing event behavior

* fix: editor IME composing event behavior

* Update web/src/components/MemoEditor/hooks/useAutoComplete.ts

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2024-04-25 08:59:26 +08:00
Steven
205bf7ed0e chore: update link target 2024-04-24 22:02:11 +08:00
Steven
cdcb61da17 chore: fix update storage 2024-04-24 09:18:33 +08:00
Michael
7f9af9b12c chore: translated using Weblate (French) (#3272)
Translated using Weblate (French)

Currently translated at 99.6% (302 of 303 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/fr/

Co-authored-by: Alexis <alexisl61@outlook.fr>
2024-04-24 06:22:57 +08:00
dependabot[bot]
6b253247cb chore: bump modernc.org/sqlite from 1.29.7 to 1.29.8 (#3266)
Bumps [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) from 1.29.7 to 1.29.8.
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.29.7...v1.29.8)

---
updated-dependencies:
- dependency-name: modernc.org/sqlite
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 10:04:10 +08:00
Michael
761b4e115b chore: translated using Weblate (English) (#3259)
Translated using Weblate (English)

Currently translated at 100.0% (303 of 303 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/en/

Co-authored-by: noxonad <noxonad@proton.me>
2024-04-22 10:11:30 +08:00
Nabiel Omar Syarif
16f209eada fix: specify go toolchain in go.mod (fix #3252) (#3253) 2024-04-22 10:06:33 +08:00
刘明野
06a79a2e37 fix: tag dependencies (#3251)
fix: 修改tag名称后重新请求数据
2024-04-20 21:16:17 +08:00
Michael
330cc3dc89 chore: translated using Weblate (French) (#3249)
Translated using Weblate (French)

Currently translated at 99.6% (302 of 303 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/fr/

Co-authored-by: Alexis <alexisl61@outlook.fr>
2024-04-19 08:58:39 +08:00
Steven
e8dfd579c3 chore: update background services 2024-04-18 23:34:35 +08:00
Steven
2a93b8d720 chore: tweak linter 2024-04-18 21:44:46 +08:00
Steven
5d967f41d9 chore: update server 2024-04-18 21:41:00 +08:00
Steven
339fecbfff chore: allow search comments 2024-04-18 21:04:10 +08:00
Steven
2cdcd17ba3 chore: tweak linter 2024-04-17 09:00:16 +08:00
Steven
14d4cfd5a4 chore: tweak store methods name 2024-04-17 08:56:52 +08:00
Michael
00d25b12c1 chore: translated using Weblate (Russian) (#3245)
Translated using Weblate (Russian)

Currently translated at 90.4% (274 of 303 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/ru/

Co-authored-by: sergeybutakov <pushkagun@gmail.com>
2024-04-16 22:38:20 +08:00
Steven
95df647265 chore: tweak comments 2024-04-16 22:33:25 +08:00
Steven
f52e0e005a chore: update dependencies 2024-04-16 21:28:40 +08:00
Steven
70f3d131f6 chore: update pnpm version 2024-04-16 21:22:40 +08:00
Steven
f7f139d65a chore: tweak typo 2024-04-16 21:15:17 +08:00
coderwander
162521885c chore: fix some typos in comments (#3243)
Signed-off-by: coderwander <770732124@qq.com>
2024-04-16 21:14:38 +08:00
dependabot[bot]
b0b9513de7 chore: bump @types/react from 18.2.75 to 18.2.79 in /web (#3240)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.2.75 to 18.2.79.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 07:36:03 +08:00
dependabot[bot]
f221f9bfe9 chore: bump i18next from 23.11.1 to 23.11.2 in /web (#3235)
Bumps [i18next](https://github.com/i18next/i18next) from 23.11.1 to 23.11.2.
- [Release notes](https://github.com/i18next/i18next/releases)
- [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md)
- [Commits](https://github.com/i18next/i18next/compare/v23.11.1...v23.11.2)

---
updated-dependencies:
- dependency-name: i18next
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 07:08:40 +08:00
dependabot[bot]
e831fa8190 chore: bump react-redux from 9.1.0 to 9.1.1 in /web (#3234)
Bumps [react-redux](https://github.com/reduxjs/react-redux) from 9.1.0 to 9.1.1.
- [Release notes](https://github.com/reduxjs/react-redux/releases)
- [Changelog](https://github.com/reduxjs/react-redux/blob/master/CHANGELOG.md)
- [Commits](https://github.com/reduxjs/react-redux/compare/v9.1.0...v9.1.1)

---
updated-dependencies:
- dependency-name: react-redux
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 07:08:23 +08:00
dependabot[bot]
eae0b7115b chore: bump @types/react-dom from 18.2.24 to 18.2.25 in /web (#3233)
Bumps [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) from 18.2.24 to 18.2.25.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

---
updated-dependencies:
- dependency-name: "@types/react-dom"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 07:08:01 +08:00
dependabot[bot]
1f0fffda95 chore: bump lucide-react from 0.367.0 to 0.368.0 in /web (#3232)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.367.0 to 0.368.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.368.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 07:07:49 +08:00
Michael
404751f378 chore: update i18n with Weblate (#3230)
* Translated using Weblate (Turkish)

Currently translated at 100.0% (303 of 303 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/tr/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 99.6% (302 of 303 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

---------

Co-authored-by: Oğuz Han <h4n.3545@gmail.com>
Co-authored-by: Coisini-H <2972186196@qq.com>
2024-04-15 11:19:52 +08:00
Steven
f9dd29ae07 chore: tweak tag store 2024-04-14 22:20:09 +08:00
Steven
1f0bfd2169 chore: update tag store 2024-04-14 22:03:56 +08:00
Michael
4aa72306ff chore: update i18n with Weblate (#3227)
* Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (308 of 308 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 99.6% (307 of 308 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/

---------

Co-authored-by: Lincoln Nogueira <lincolnthalles@users.noreply.github.com>
Co-authored-by: Coisini-H <2972186196@qq.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
2024-04-14 21:27:55 +08:00
Eng Zer Jun
3b550a8ab8 chore: replace util.Min helper with built-in min (#3224) 2024-04-13 20:16:22 +08:00
Steven
cb7886dc49 chore: retire telegram integration in frontend 2024-04-13 12:42:34 +08:00
Steven
d00e4fdf17 chore: retire telegram plugin 2024-04-13 12:39:41 +08:00
Steven
9a2c423435 chore: update var-naming 2024-04-13 12:11:59 +08:00
Steven
49f8cfd5d1 chore: update jwt middleware 2024-04-13 12:10:57 +08:00
Steven
b27004daae chore: retire unused plugin 2024-04-13 12:09:32 +08:00
Steven
75359854cc chore: fix resource routes 2024-04-13 12:07:53 +08:00
Steven
cebc46adc7 chore: tweak store definition 2024-04-13 11:54:37 +08:00
Steven
6ee3b0f704 chore: go mod tidy 2024-04-13 11:02:29 +08:00
Steven
bbd206e893 chore: retire legacy api 2024-04-13 11:01:16 +08:00
Steven
cf4db17080 chore: fix linter 2024-04-13 10:53:39 +08:00
Steven
c373131b89 chore: migrate idp service 2024-04-13 10:50:25 +08:00
Steven
a77703260f chore: fix linter 2024-04-13 02:57:32 +08:00
Steven
8f51529c78 chore: implement storage service 2024-04-13 02:55:40 +08:00
Steven
707e5caf89 chore: update workspace setting store 2024-04-13 02:08:35 +08:00
Michael
17e8fc5408 chore: update i18n with Weblate (#3220)
* Translated using Weblate (Chinese (Simplified))

Currently translated at 98.0% (302 of 308 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 98.0% (302 of 308 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

---------

Co-authored-by: Coisini-H <2972186196@qq.com>
Co-authored-by: LibreTranslate <noreply-mt-libretranslate@weblate.org>
2024-04-12 22:45:12 +08:00
Steven
074e7cf71a chore: fix resource path 2024-04-12 08:57:34 +08:00
Steven
f5461264c5 chore: fix dialog background color 2024-04-12 08:44:19 +08:00
Michael
e2ae32063e chore: translated using Weblate (Turkish) (#3215)
Translated using Weblate (Turkish)

Currently translated at 100.0% (300 of 300 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/tr/

Co-authored-by: Oğuz Han <h4n.3545@gmail.com>
2024-04-12 08:36:38 +08:00
Steven
133951328b chore: fix linter 2024-04-12 08:36:02 +08:00
imikod
257b8add8c chore: localization improvements (#3213)
* localization improvements

* typo fix

* fix linting error
2024-04-12 08:35:14 +08:00
Steven
755d5b83c6 chore: retire legacy setting api 2024-04-12 08:32:54 +08:00
Steven
3088cabe10 chore: tweak linter 2024-04-11 17:58:49 +08:00
Steven
3e6e56b008 refactor: update workspace store definition 2024-04-11 17:53:00 +08:00
Steven
6d842711e2 chore: fix dependencies 2024-04-10 23:34:29 +08:00
dependabot[bot]
b84a0592bb chore: bump react-i18next from 11.18.6 to 14.1.0 in /web (#3210)
Bumps [react-i18next](https://github.com/i18next/react-i18next) from 11.18.6 to 14.1.0.
- [Changelog](https://github.com/i18next/react-i18next/blob/master/CHANGELOG.md)
- [Commits](https://github.com/i18next/react-i18next/compare/v11.18.6...v14.1.0)

---
updated-dependencies:
- dependency-name: react-i18next
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 23:28:11 +08:00
dependabot[bot]
581a64d5c1 chore: bump lucide-react from 0.309.0 to 0.367.0 in /web (#3208)
Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.309.0 to 0.367.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.367.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 23:27:34 +08:00
dependabot[bot]
4537411109 chore: bump @typescript-eslint/eslint-plugin from 6.21.0 to 7.0.0 in /web (#3207)
chore: bump @typescript-eslint/eslint-plugin in /web

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.21.0 to 7.0.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.0.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 23:26:53 +08:00
dependabot[bot]
d6b1326a2d chore: bump eslint-config-prettier from 8.10.0 to 9.1.0 in /web (#3206)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.10.0 to 9.1.0.
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.10.0...v9.1.0)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 23:26:36 +08:00
dependabot[bot]
9490e890c7 chore: bump i18next from 21.10.0 to 23.11.1 in /web (#3205)
Bumps [i18next](https://github.com/i18next/i18next) from 21.10.0 to 23.11.1.
- [Release notes](https://github.com/i18next/i18next/releases)
- [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md)
- [Commits](https://github.com/i18next/i18next/compare/v21.10.0...v23.11.1)

---
updated-dependencies:
- dependency-name: i18next
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 23:26:22 +08:00
dependabot[bot]
aed76165ea chore: bump @reduxjs/toolkit from 1.9.7 to 2.2.3 in /web (#3204)
Bumps [@reduxjs/toolkit](https://github.com/reduxjs/redux-toolkit) from 1.9.7 to 2.2.3.
- [Release notes](https://github.com/reduxjs/redux-toolkit/releases)
- [Commits](https://github.com/reduxjs/redux-toolkit/compare/v1.9.7...v2.2.3)

---
updated-dependencies:
- dependency-name: "@reduxjs/toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 23:26:11 +08:00
dependabot[bot]
51a90b0013 chore: bump golangci/golangci-lint-action from 3 to 4 (#3203)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3 to 4.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 23:25:53 +08:00
dependabot[bot]
7b1fe9fcfc chore: bump pnpm/action-setup from 2.4.0 to 3.0.0 (#3202)
Bumps [pnpm/action-setup](https://github.com/pnpm/action-setup) from 2.4.0 to 3.0.0.
- [Release notes](https://github.com/pnpm/action-setup/releases)
- [Commits](https://github.com/pnpm/action-setup/compare/v2.4.0...v3.0.0)

---
updated-dependencies:
- dependency-name: pnpm/action-setup
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 23:25:42 +08:00
Steven
ec67f1b3c9 chore: add dependabot 2024-04-10 23:24:17 +08:00
Steven
97cfab1758 chore: upgrade dependencies 2024-04-10 23:19:59 +08:00
Steven
eb251a097e chore: update workspace setting service 2024-04-10 23:01:01 +08:00
Steven
4c47e93fce chore: tweak workspace setting store 2024-04-10 22:31:55 +08:00
Michael
af954db473 chore: update i18n with Weblate (#3201)
* Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (299 of 299 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (299 of 299 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/tr/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (299 of 299 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (299 of 299 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

---------

Co-authored-by: Lincoln Nogueira <lincolnthalles@users.noreply.github.com>
Co-authored-by: Oğuz Han <h4n.3545@gmail.com>
Co-authored-by: Coisini-H <2972186196@qq.com>
Co-authored-by: Weblate Translation Memory <noreply-mt-weblate-translation-memory@weblate.org>
2024-04-10 22:05:31 +08:00
Steven
a376dc4dd6 chore: fix linter 2024-04-10 22:04:02 +08:00
Dubzer
8ee56bd29f feat: add code wrapping option on mobile devices (#3196)
* feat: add code wrapping option on mobile devices

* Minor changes

* oopsie
2024-04-10 22:03:47 +08:00
Steven
71c39ed554 chore: update workspace setting definition 2024-04-10 21:15:55 +08:00
Steven
c93b1efbae chore: update workspace setting store 2024-04-10 20:05:17 +08:00
Steven
58ae3217ff chore: update auth callback messages 2024-04-09 21:23:17 +08:00
Steven
6028838f03 chore: update component name 2024-04-09 20:51:09 +08:00
Michael
000b3a7a2c chore: update i18n with weblate (#3195)
Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/

Co-authored-by: Hosted Weblate <hosted@weblate.org>
2024-04-09 20:29:26 +08:00
Steven
bbdd40b2b0 chore: add placeholder to comment editor 2024-04-09 20:01:19 +08:00
imikod
8356ebc46b chore: improve localization (#3190)
* improve localization

* follow suggestion
2024-04-09 16:11:32 +08:00
Steven
fc95876617 chore: update memo creator display 2024-04-09 09:05:34 +08:00
Steven
b1e196bb4f fix: delete memo reaction 2024-04-08 20:52:46 +08:00
Steven
6d10251cbd feat: impl list syntax auto complete to editor 2024-04-08 20:42:53 +08:00
Steven
436a6cb084 chore: fix text truncate 2024-04-08 19:20:16 +08:00
imikod
90ed908d2e fix: set navigation icons to not shrink (#3186) 2024-04-08 10:16:52 +08:00
Steven
756ab71302 chore: tweak truncate styles 2024-04-07 23:30:28 +08:00
Steven
a6b09aa5b1 chore: add confirm dialog for disable password login setting 2024-04-07 23:22:59 +08:00
Steven
ff81ea602d chore: tweak error message 2024-04-07 22:35:02 +08:00
Steven
8101a5e0b1 chore: add origin flag to config cors 2024-04-07 22:15:15 +08:00
Michael
b5893aa60b chore: update i18n with Weblate (#3183)
* Translated using Weblate (French)

Currently translated at 100.0% (295 of 295 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/fr/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (295 of 295 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/tr/

---------

Co-authored-by: Ezmana <ezmana.land@gmail.com>
Co-authored-by: Oğuz Han <h4n.3545@gmail.com>
2024-04-07 10:13:12 +08:00
Steven
bedf3b3025 chore: tweak embedded memo styles 2024-04-02 23:32:43 +08:00
The Anh Nguyen
09ffa7b818 chore: fix memo link (#3173) 2024-04-02 07:13:58 +08:00
Steven
ba7dbc1fca chore: fix task node click handler 2024-04-01 21:38:18 +08:00
Steven
15ef57589e chore: go mod tidy 2024-04-01 21:35:58 +08:00
stayweek
5aa633948e chore: use the built-in slices library (#3172)
Signed-off-by: stayweek <jiangtengtao@outlook.com>
2024-04-01 17:16:29 +08:00
Steven
b1297f5d01 chore: tweak linter 2024-04-01 00:41:25 +08:00
Steven
33e9b13665 chore: tweak linter 2024-04-01 00:34:51 +08:00
Steven
b79f626a74 chore: fix memo comment inbox 2024-04-01 00:26:46 +08:00
Michael
ec35a42fb5 chore: update i18n with Weblate (#3168)
* Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (295 of 295 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (295 of 295 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

* Translated using Weblate (Chinese (Traditional))

Currently translated at 98.3% (290 of 295 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hant/

---------

Co-authored-by: Lincoln Nogueira <lincolnthalles@users.noreply.github.com>
Co-authored-by: Coisini-H <2972186196@qq.com>
2024-04-01 00:07:03 +08:00
Michael
98c9ab70e2 chore: update translation files (#3166)
Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/

Co-authored-by: Hosted Weblate <hosted@weblate.org>
2024-03-30 22:54:38 +08:00
Steven
edc7645086 chore: fix linter 2024-03-30 15:01:19 +08:00
Steven
cbebbca7d6 chore: add idp definition 2024-03-30 14:58:47 +08:00
Steven
4d62ed46cc chore: tweak words 2024-03-30 14:14:42 +08:00
Steven
bb10bb200c chore: implement search random memos 2024-03-30 13:50:18 +08:00
Steven
03c93785f4 chore: implement list random users 2024-03-30 13:29:48 +08:00
The Anh Nguyen
2fe6d606ec feat: handle restore memo when is in archived memo detail page (#3165) 2024-03-30 13:06:08 +08:00
Steven
c8baeb86ec chore: fix memo links 2024-03-30 13:04:40 +08:00
The Anh Nguyen
9a88e00df0 fix: link embedded content to uid instead of name (#3164) 2024-03-30 12:30:09 +08:00
Steven
54a3c25ebd chore: update memo resource name definition 2024-03-30 08:26:28 +08:00
Steven
d84a88e805 chore: fix linter 2024-03-30 00:05:19 +08:00
Steven
5ab845d92e chore: fix linter 2024-03-30 00:02:34 +08:00
Steven
4f7a6cd6cc chore: fix default logo url 2024-03-29 23:12:30 +08:00
Steven
c7aaf791e6 chore: tweak props naming 2024-03-29 22:49:19 +08:00
Michael
239348c403 chore: update i18n with Weblate (#3162)
* Translated using Weblate (Russian)

Currently translated at 85.1% (252 of 296 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/ru/

* Translated using Weblate (Vietnamese)

Currently translated at 91.8% (272 of 296 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/vi/

---------

Co-authored-by: LibreTranslate <noreply-mt-libretranslate@weblate.org>
Co-authored-by: The Anh Nguyen <anhntdev0@gmail.com>
2024-03-29 21:32:55 +08:00
Michael
9f803aa9bb chore: translated using Weblate (Russian) (#3161)
Translated using Weblate (Russian)

Currently translated at 85.1% (252 of 296 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/ru/

Co-authored-by: xyznetsov <invisiblesun2016@yandex.ru>
2024-03-29 21:29:49 +08:00
Steven
200a0d3e2b fix: memo relations 2024-03-29 21:27:38 +08:00
Steven
ea6628066d chore: update sidebar components 2024-03-29 09:16:55 +08:00
Steven
526f46807e chore: tweak user list display 2024-03-29 08:37:07 +08:00
Michael
bfaf06582c chore: translated using Weblate (Portuguese (Brazil)) (#3157)
Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (296 of 296 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

Co-authored-by: Lincoln Nogueira <lincolnthalles@users.noreply.github.com>
2024-03-29 08:20:56 +08:00
Steven
7331c598df fix: edit account dialog fields 2024-03-29 08:19:32 +08:00
The Anh Nguyen
f7a445ac8b chore: update Vietnamese translation (#3155) 2024-03-29 08:07:02 +08:00
Steven
90679cc33a chore: add explore sidebar 2024-03-29 00:01:45 +08:00
Steven
192ee7acc0 chore: fix memo link 2024-03-28 22:53:22 +08:00
Michael
7d94256a2a chore: update i18n with Weblate (#3152)
* Translated using Weblate (Chinese (Traditional))

Currently translated at 98.3% (291 of 296 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hant/

* Translated using Weblate (Chinese (Traditional))

Currently translated at 98.3% (291 of 296 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hant/

---------

Co-authored-by: Weblate Translation Memory <noreply-mt-weblate-translation-memory@weblate.org>
Co-authored-by: Coisini-H <2972186196@qq.com>
2024-03-28 22:51:50 +08:00
Michael
aed4c1392d chore: update i18n with Weblate (#3151)
* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (296 of 296 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

* Translated using Weblate (Chinese (Traditional))

Currently translated at 98.3% (291 of 296 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hant/

---------

Co-authored-by: Coisini-H <2972186196@qq.com>
2024-03-28 22:48:32 +08:00
Paul
3605efc4d1 chore: removed sanitization logic (#3147)
* removed sanitization logic

* to avoid lint err
2024-03-28 22:44:44 +08:00
Dubzer
a0846c2818 feat: add shortcut to edit the previous memo (#3122)
* Add shortcut to edit the previous memo

* Fix compilation

* Update web/src/components/MemoEditor/index.tsx

Co-authored-by: boojack <stevenlgtm@gmail.com>

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2024-03-27 21:46:29 +08:00
Steven
2ebea4dba9 chore: fix workspace profile api 2024-03-27 18:51:11 +08:00
Steven
16cfef32d6 chore: tweak statistics translation 2024-03-26 23:49:37 +08:00
Steven
f637deacfc chore: tweak tag list 2024-03-26 23:43:31 +08:00
Steven
a07805907b chore: fix action run 2024-03-26 22:46:17 +08:00
Steven
2e87da4927 chore: update frontend dependencies 2024-03-26 22:35:11 +08:00
Steven
d460e6bf41 fix: link node 2024-03-25 23:59:19 +08:00
Steven
e703b4f70d fix: resource v1 definition 2024-03-24 22:35:10 +08:00
Steven
be525fa3df chore: fix migration script 2024-03-23 01:03:11 +08:00
Steven
d1e8af48c0 chore: tweak memo view styles 2024-03-23 00:58:15 +08:00
Steven
005305cd9a chore: update relative time display 2024-03-22 08:12:08 +08:00
Steven
8fd1dff484 chore: update migration scripts 2024-03-21 22:24:39 +08:00
Steven
c5fa4fe304 chore: tweak imports order 2024-03-21 21:44:43 +08:00
Steven
8f37d7490c chore: fix linter 2024-03-21 21:42:44 +08:00
Steven
18d16abdb5 chore: update workspace service 2024-03-21 21:39:34 +08:00
Steven
1d83c68cb5 chore: update type definitions 2024-03-21 08:12:38 +08:00
Michael
861a1e4c9b chore: update i18n with Weblate (#3115)
* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (293 of 293 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (293 of 293 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

---------

Co-authored-by: Coisini-H <2972186196@qq.com>
Co-authored-by: Weblate Translation Memory <noreply-mt-weblate-translation-memory@weblate.org>
2024-03-20 21:42:08 +08:00
Steven
26e5b70483 chore: upgrade frontend dependencies 2024-03-20 21:32:06 +08:00
Steven
7c5261b5d2 chore: tweak resource definition 2024-03-20 21:17:04 +08:00
Steven
7cc8b951a3 refactor: update resource id naming 2024-03-20 20:39:16 +08:00
Steven
a3a4e37cb0 chore: update memo content styles 2024-03-20 09:07:54 +08:00
Steven
76c936357b chore: fix resource link 2024-03-20 08:51:32 +08:00
Steven
6db427e396 chore: update acl list 2024-03-20 08:18:43 +08:00
Steven
0a0ccbf6e1 chore: update acl list 2024-03-20 08:12:46 +08:00
Steven
96a7d0eb25 chore: tweak line height 2024-03-20 00:40:46 +08:00
Steven
ed89cb8310 chore: update memo relation definition 2024-03-19 21:53:44 +08:00
Steven
722e356044 chore: update memo store 2024-03-19 20:55:33 +08:00
Steven
efb15a0453 chore: tweak naming 2024-03-18 23:41:57 +08:00
Steven
5f2d6b22be chore: tweak memo structure 2024-03-18 23:23:53 +08:00
Steven
2dc8ed773c chore: tweak linter 2024-03-18 19:57:53 +08:00
Steven
86db6d0254 chore: tweak user api definition 2024-03-18 12:56:52 +08:00
Steven
f3fb5e0c60 chore: tweak route enum 2024-03-18 12:07:44 +08:00
Steven
1e43c8d84b chore: disallow update workspace setting in demo mode 2024-03-17 19:18:45 +08:00
Steven
cf207df672 chore: tweak link styles 2024-03-17 18:28:37 +08:00
Michael
5dd1251d1e chore: update i18n with Weblate (#3109)
* Translated using Weblate (Japanese)

Currently translated at 95.2% (279 of 293 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/ja/

* Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (293 of 293 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

---------

Co-authored-by: Somme4096 <somme4096@gmail.com>
Co-authored-by: Lincoln Nogueira <lincolnthalles@users.noreply.github.com>
2024-03-17 18:22:22 +08:00
sunxunle
ea104a5e54 chore: fix typo (#3106) 2024-03-17 09:52:04 +08:00
Steven
335a0312f2 chore: tweak link styles 2024-03-16 23:35:36 +08:00
Mehad Nadeem
9c1e2f8137 feat: implemented link previews (frontend files) (#3074)
* feat: implmented link previews (frontend files)

* chore: updated frontend side for Link Previews

* chore: updated frontend gen types with the renamed (server) service file

* fix: passing errors

* chore: switched to using generated type instead of separate fields

* fix: passing linter error

* chore: updated Link.tsx

* chore: using `useResponsiveWidth` to render for different devices

* chore: refactored Link.tsx
2024-03-16 22:51:16 +08:00
Steven
14479347d8 chore: remove demo checks 2024-03-15 09:05:02 +08:00
Steven
0f48cfbb4e chore: tweak padding styles 2024-03-15 08:52:11 +08:00
Steven
606a30640d fix: check username in signup 2024-03-15 08:37:58 +08:00
Steven
ab136e3310 chore: tweak styles 2024-03-15 00:12:22 +08:00
Michael
21af2a004d chore: translated using Weblate (French) (#3099)
Translated using Weblate (French)

Currently translated at 100.0% (293 of 293 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/fr/

Co-authored-by: Ezmana <ezmana.land@gmail.com>
2024-03-14 17:09:29 +08:00
Steven
115b5551b3 chore: tweak default avatar 2024-03-14 09:11:57 +08:00
Steven
15be18fa85 chore: update compace mode handler 2024-03-14 09:07:18 +08:00
Steven
9ce381abb9 chore: tweak user profile 2024-03-14 00:13:56 +08:00
Steven
2516431b20 chore: tweak memo content styles 2024-03-14 00:01:33 +08:00
Steven
ded4da07a3 feat: use @github/relative-time-element to display time 2024-03-13 23:47:34 +08:00
Steven
e795149186 chore: tweak memo view display 2024-03-13 22:30:59 +08:00
Steven
8fe6874b1b chore: add description field to user 2024-03-13 21:24:16 +08:00
boojack
7c1510e7a9 chore: update i18n with Weblate (#3090)
* Translated using Weblate (Spanish)

Currently translated at 95.4% (293 of 307 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/es/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (307 of 307 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/

---------

Co-authored-by: Hisiste <aditooliva@gmail.com>
Co-authored-by: keocheung <keocheung@outlook.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
2024-03-13 20:55:04 +08:00
Steven
e5fc107920 chore: tweak i18n locales 2024-03-13 20:51:19 +08:00
Steven
5d740c3813 chore: update link service 2024-03-13 20:25:27 +08:00
Mehad Nadeem
0abe20df72 feat: implemented link previews (server files) (#3073)
* feat: implmented link previews (server files)

* chore: updated variable name

* chore: renamed service file from `metadata_service.go` to `link_service.go`

* fix: passing errors

* fix: fixed linter warnong about `ctx`
2024-03-13 17:31:53 +08:00
Mehad Nadeem
4d41b68d4c feat: implemented link previews (proto files) (#3072)
* feat: implmented link previews (proto files)

* fix: passing proto linter errors

* chore: renamed MetadataService service in proto file.

* fix: removed unused files

* chore: removed meaningless comments from proto file
2024-03-13 16:52:59 +08:00
Lincoln Nogueira
7c87c1ff74 chore: update build scripts (#3085) 2024-03-13 08:50:56 +08:00
Steven
963c630428 chore: update readme with weblate 2024-03-13 08:25:38 +08:00
Steven
6b6edc3791 chore: update tg message handler 2024-03-12 22:48:53 +08:00
Mario Gómez
425e85f0f9 chore: fix spanish typos (#3083) 2024-03-12 21:48:02 +08:00
huajin tong
8e7f826ae6 chore: fix typo (#3080)
Signed-off-by: thirdkeyword <fliterdashen@gmail.com>
2024-03-12 17:05:49 +08:00
Michael
9ffc1515f4 chore: update i18n with Weblate (#3079)
* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (307 of 307 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (307 of 307 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

---------

Co-authored-by: Matsuri <matsuri@vmoe.info>
Co-authored-by: keocheung <keocheung@outlook.com>
2024-03-12 13:14:56 +08:00
steven
8cdc0c7ffa chore: add delete tag action 2024-03-09 17:26:58 +08:00
zty
999a05307e fix: body overflow styles #3056
Co-authored-by: zty <zty.dev@outlook.com>
2024-03-09 14:09:31 +08:00
steven
ed1954c58c chore: fix check setting value 2024-03-09 12:56:44 +08:00
steven
77bafba682 chore: update gomark.wasm 2024-03-09 12:47:20 +08:00
Michael
1540de2f44 chore: translated using Weblate (Korean) (#3060)
Translated using Weblate (Korean)

Currently translated at 95.1% (292 of 307 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/ko/

Co-authored-by: WonSeok <wonseok@duck.com>
2024-03-09 12:40:42 +08:00
Steven
ed4b48c54f chore: update gomark.wasm 2024-03-08 00:34:34 +08:00
Michael
706e749275 chore: translated using Weblate (Portuguese (Brazil)) (#3050)
Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (307 of 307 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

Co-authored-by: Lincoln Nogueira <lincolnthalles@users.noreply.github.com>
2024-03-07 11:38:24 +08:00
Steven
845999292a chore: update frontend dependencies 2024-03-06 23:33:00 +08:00
Michael
240da335c1 chore(i18n): update translation files (#3042)
Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/

Co-authored-by: Hosted Weblate <hosted@weblate.org>
2024-03-05 11:44:51 +08:00
Steven
f9f277695d chore: fix comment amount 2024-03-04 23:37:38 +08:00
Dubzer
6cbfbe9c07 chore: settings page improvements (#3034)
* Don't allow to select text on buttons in settings + refactoring

* Remove redundant useMemo

* Update web/src/pages/Setting.tsx

Co-authored-by: boojack <stevenlgtm@gmail.com>

* Rename other constants too

* Rename AdminSection to ADMIN_SECTIONS

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2024-03-04 23:33:43 +08:00
Steven
ec206104e5 chore: tweak i18n locale 2024-03-04 23:23:14 +08:00
Steven
342f341b3d chore: ignore import locale error 2024-03-04 13:16:55 +08:00
WonSeok
f46b64a17d fix: check disallow public memo in Telegram(#3036) (#3037) 2024-03-04 11:24:09 +08:00
Steven
7d5f603482 chore: update compact view 2024-03-04 11:21:48 +08:00
Dubzer
f0a521f5b8 feat: improve theming (#3032)
Add color-scheme and dark scrollbar styles
2024-03-04 09:35:40 +08:00
Steven
59314cdf80 chore: add compact mode to memo view 2024-03-04 01:11:34 +08:00
Steven
ac0315334d chore: update i18n locales imports 2024-03-04 00:05:27 +08:00
Steven
ac8a374ebd chore: bump version 2024-03-03 23:45:52 +08:00
Steven
95b02341eb chore: tweak logger 2024-03-03 23:45:32 +08:00
Steven
d34273b186 chore: update memo icons style 2024-03-03 16:41:03 +08:00
Steven
dcfb2b7de2 chore: tweak docs generate path 2024-03-03 15:05:42 +08:00
Steven
ebcf43c997 chore: update gomark.wasm 2024-03-03 14:56:40 +08:00
Steven
cfb50f19aa chore: tweak linter 2024-03-03 14:23:21 +08:00
Steven
e441e3882b chore: update error logger 2024-03-03 14:20:59 +08:00
Steven
c1da87a819 chore: update get request origin 2024-03-03 14:10:48 +08:00
jjaychen
3b089eeae3 fix: ignore "Tab" key down event when is composing in editor(#3026) (#3027) 2024-03-03 13:04:00 +08:00
Steven
9a8a1d017e chore: add comments icon 2024-03-02 11:29:21 +08:00
Steven
7e23ceb242 chore: fix frontend linter 2024-03-01 19:39:24 +08:00
Steven
898b3c3779 chore: update gomark.wasm 2024-03-01 19:31:00 +08:00
Steven
8eb01adb6f chore: go mod tidy 2024-02-29 23:56:20 +08:00
jg0312
621a8d4e20 chore: fix typo in build script's if statement (#3017)
missing 'i' in 'if' statement
2024-02-29 23:55:25 +08:00
Steven
dfa78cac49 chore: update logger 2024-02-29 23:54:43 +08:00
Steven
12f4d3a10d chore: tweak default page size 2024-02-29 23:42:06 +08:00
Steven
00788bd8f8 chore: update actions 2024-02-29 09:21:55 +08:00
Steven
5f2a624c0c chore: tweak imports order 2024-02-29 01:32:59 +08:00
Steven
3e50bee7da chore: move api directory 2024-02-29 01:16:43 +08:00
Steven
1aa75847d6 chore: upgrade gomark 2024-02-29 01:07:53 +08:00
Steven
89a270cede chore: add username to cache key 2024-02-28 00:34:55 +08:00
Xylit
5526355621 fix: dark mode tag selection and suggestion (#3004)
* fix: use correct higlight color on selecting a tag in darkmode

* fix: take scrolling into account in tab suggestion

Issue: When editing a long memo and editing a tag somewhere where the user has
to scroll down to, the tag suggestions would be out of place (too far down)
because the scrolling wouldn't be taken into account.

Fix: Substract the suggestions div by the scroll amount.

* fix: don't show tag suggestion when on '#'

Fixes this issue like this:
1. Text #tag text
        ^ backspace here
2. Text#tag text
       ^ space
3. Text #tag text
        ^ tag suggestion opens
2024-02-27 09:16:56 +08:00
ercd
1ae9bf23a0 fix: telegram callback query handler dereferencing nil pointer if memo not found (#3003)
* fix: telegram callback query handler dereferencing nil pointer if memo not found

* chore: add an answer to callback query if memo not found
2024-02-27 00:03:08 +08:00
Zhiyuan Zheng
51a7934616 fix: firefox/safari to redirect to /explore in HomeLayout (#3001) 2024-02-26 13:38:24 +08:00
Mr. Lin
8d08cfe1c9 fix: incorrectly checking whether registration is allowed in the login v1 api (#2998)
fix: Incorrectly checking whether registration is allowed in the login interface, resulting in the inability to log in through apiv1
2024-02-26 13:36:17 +08:00
Steven
b0f52ade7a chore: remove metric service 2024-02-24 23:32:39 +08:00
Steven
222d04fb22 chore: add fuse to get tag suggestions 2024-02-24 11:02:46 +08:00
Steven
68468927dd chore: tweak setting styles 2024-02-24 11:01:57 +08:00
Steven
dfe29ec766 chore: tweak route layout 2024-02-24 10:18:53 +08:00
Steven
db56e1b575 chore: fix user banner dropdown 2024-02-23 23:47:26 +08:00
Steven
5b92ac1775 chore: fix setting migrator 2024-02-23 09:16:34 +08:00
Steven
f2eb9f1b8f chore: fix get workspace setting 2024-02-23 09:11:39 +08:00
Steven
e602aeecc1 fix: update workspace general setting 2024-02-23 09:08:49 +08:00
Steven
ce133ad69b chore: retire unused workspace settings 2024-02-23 08:40:33 +08:00
Steven
e585578553 chore: tweak readme 2024-02-23 08:25:54 +08:00
Steven
4d9c929c32 chore: upgrade gomark 2024-02-23 08:22:39 +08:00
Steven
39bf850591 fix: embed memos callback 2024-02-22 23:17:15 +08:00
Steven
9cd835b979 chore: upgrade gomark wasm 2024-02-22 23:11:32 +08:00
Steven
0afdbe3332 chore: remove animation of spoiler 2024-02-22 19:25:24 +08:00
Steven
6b14d87521 chore: fix linter 2024-02-21 23:45:12 +08:00
Steven
51d58d3982 chore: add workspace setting migrator 2024-02-21 23:43:18 +08:00
Steven
4378816e44 chore: tweak i18n 2024-02-21 23:02:18 +08:00
Steven
e7bbd850b2 chore: tweak spoiler animation 2024-02-21 21:31:34 +08:00
Steven
c6162d3f38 chore: update dependencies 2024-02-21 21:24:31 +08:00
Steven
ce32206677 chore: remove unused system setting 2024-02-21 21:15:28 +08:00
Steven
50a3af3b29 chore: fix get general setting 2024-02-21 20:44:35 +08:00
Steven
80b64c02fd chore: tweak workspace setting seeds 2024-02-21 20:25:25 +08:00
Steven
13b911ebf0 chore: add spoiler node 2024-02-20 23:55:54 +08:00
Steven
4a6da91719 chore: fix serve frontend flag 2024-02-20 23:24:13 +08:00
Steven
fa62e8b59a chore: tweak linter errors 2024-02-20 23:07:42 +08:00
Steven
8e11826db1 chore: update workspace setting service 2024-02-20 23:02:01 +08:00
David Nguyen
e6d0c00cf6 chore: update vi.json (#2980) 2024-02-20 17:57:06 +08:00
Kristián
03d67d5a00 feat: add mermaid support in codeblock (#2971) 2024-02-19 15:10:58 +08:00
Kazuki H
a86117f613 feat: add new line if the cursor is on a character when adding a tag (#2960) 2024-02-19 08:54:47 +08:00
Søm
fc1a2cf2fc chore: update ja.json (#2966) 2024-02-17 09:31:52 +08:00
Steven
d22b772232 chore: add memo actions to memo detail page 2024-02-15 11:16:51 +08:00
Steven
f1ec5775a7 chore: update inbox props 2024-02-14 09:44:35 +08:00
Bryan
4aa4417d91 chore: allow all 20x response status code in webhook (#2947) 2024-02-13 09:30:48 +08:00
Steven
606e574e19 chore: update enum type 2024-02-13 09:30:28 +08:00
Brilliant Hanabi
ebe3678288 feat: add visibility select in ShareMemoDialog (#2941)
In ShareMemoDialog, user can change the visibility
of the memo, so that the memo can be set to public
to be viewed by anyone with the link.
2024-02-13 09:28:16 +08:00
Steven
b3ca9969c4 chore: tweak linter 2024-02-09 22:18:55 +08:00
Steven
3dddd3ec4c chore: tweak reaction store 2024-02-09 21:59:45 +08:00
Brilliant Hanabi
81aa9b107f feat: add notice when sharing private links in MemoDetail (#2942) 2024-02-09 09:30:01 +08:00
Steven
60efd3ac32 chore: tweak memo view 2024-02-08 22:52:49 +08:00
Steven
4081a6f5ad chore: add more reactions 2024-02-08 21:20:51 +08:00
Lincoln Nogueira
334e489867 chore: improve docker-compose.dev (#2938) 2024-02-08 16:28:43 +08:00
Steven
c7822515a1 chore: tweak view checks 2024-02-08 13:37:38 +08:00
Steven
d86f0bac8c chore: implement reaction frontend 2024-02-08 13:25:15 +08:00
Steven
e5f244cb50 chore: fix tests 2024-02-08 11:58:23 +08:00
Steven
3a5bc82d39 chore: implement reaction service 2024-02-08 11:54:59 +08:00
Steven
a4fa67cd18 chore: update dependencies 2024-02-08 08:13:42 +08:00
Steven
43a2d6ce09 chore: tweak user setting 2024-02-08 08:06:55 +08:00
Mehad Nadeem
d2434111b4 chore: impl compact mode setting (#2935)
* chore: backend/DB related files for compact view setting.

* fix: passing lint errors

* fix2: passing linter errors
2024-02-08 08:05:56 +08:00
Steven
559e427c50 chore: implement reaction store 2024-02-07 23:40:23 +08:00
Steven
99568236a3 chore: run buf generate 2024-02-07 21:51:30 +08:00
Mehad Nadeem
06fb2174c3 feat: add compact mode setting (Proto) (#2934)
* chore: proto related files for compact view setting.

* fix: pasing lint errors
2024-02-07 21:45:11 +08:00
Kazuki H
5ac17fc012 fix: displaying archived memos (#2933)
* fix: web: Archived: Show displayTime instead of updateTime

Archiving a memo is considered "updating" it, so the time it was
archived will be displayed, instead of the time it was created.

* fix: web: Archived: Add an option to fetch more memos

Just like on other pages, add a button to fetch more memos. Otherwise,
the user would only be able to load the latest 10 memos, as defined in
DEFAULT_MEMO_LIMIT.
2024-02-07 17:53:23 +08:00
Steven
a76b86f18a chore: fix highlight code 2024-02-06 20:59:17 +08:00
Steven
ded8001735 chore: fix v2 routes 2024-02-06 20:55:27 +08:00
Steven
185ec2ad2a chore: update inbox service 2024-02-06 19:46:25 +08:00
Steven
6b59c7670c chore: fix linter warning 2024-02-05 23:32:01 +08:00
Steven
434ef44f8c chore: add cookie builder 2024-02-05 23:28:29 +08:00
Steven
46ea16ef7e chore: fix cookie attrs 2024-02-05 22:14:58 +08:00
Steven
8f15e8773a chore: update cookie attrs 2024-02-05 21:42:23 +08:00
Steven
25efc33b24 chore: tweak timeline styles 2024-02-05 21:37:43 +08:00
Steven
ba460382b0 chore: remove type-gen script 2024-02-05 20:42:01 +08:00
Steven
e35225ff24 chore: fix resource url 2024-02-05 19:35:23 +08:00
Steven
397a7f00ef chore: add postinstall script 2024-02-05 19:29:47 +08:00
Steven
06eff151e7 chore: tweak memo find builder 2024-02-05 06:40:55 +08:00
Steven
c30d7ab8f3 chore: update cors middleware 2024-02-05 06:10:10 +08:00
Steven
ab4a670bec chore: add env example 2024-02-05 00:33:07 +08:00
Steven
ce663efc14 chore: update cookie attrs 2024-02-05 00:11:36 +08:00
Steven
9e72432f19 chore: tweak cookie attrs 2024-02-05 00:10:54 +08:00
Steven
b056c59dea chore: add vercel.json 2024-02-05 00:01:31 +08:00
Steven
15c90871d9 chore: update request base url 2024-02-04 23:48:26 +08:00
Steven
be899cd027 chore: update eslint config 2024-02-04 22:52:47 +08:00
Steven
8773a3d2c1 chore: tweak assets folder 2024-02-04 22:45:51 +08:00
Steven
d2603ee67b chore: upgrade frontend dependencies 2024-02-04 21:36:11 +08:00
Steven
c92507728a chore: tweak filter checks 2024-02-04 21:07:14 +08:00
Steven
eb4f7b47b7 chore: update memo find builder 2024-02-04 20:54:17 +08:00
Steven
1e07b70d23 chore: fix export memos 2024-02-04 20:20:14 +08:00
Athurg Gooth
b8a9783db5 fix: signin error notification is not shown (#2908)
fix signin error notification is not shown
2024-02-04 14:25:51 +08:00
Ikko Eltociear Ashimine
82e72813f9 chore: fix typo in About.tsx (#2899) 2024-02-04 08:33:13 +08:00
Steven
57510ddee5 chore: update readme with used resources 2024-02-03 23:42:24 +08:00
Steven
00c47a0673 chore: fix menu z-index 2024-02-03 23:17:03 +08:00
Steven
374f3f7d96 chore: fix filter initial state 2024-02-03 22:03:56 +08:00
Steven
8340e6b247 chore: upgrade gomark 2024-02-03 21:52:54 +08:00
Steven
7f5148d490 chore: clean dropdown 2024-02-01 21:56:08 +08:00
Steven
c522e1450a chore: update codeblock style 2024-02-01 21:38:28 +08:00
Steven
c342c464a2 chore: update services comment 2024-02-01 21:26:09 +08:00
Steven
f6f193af2d chore: format proto 2024-02-01 21:15:56 +08:00
Steven
dd06278692 feat: add batch upsert tags 2024-02-01 21:13:42 +08:00
Steven
fdd17ce849 chore: update memo content key 2024-02-01 20:40:43 +08:00
Elliot Chen
7cd3fcbc61 fix: wrong order of the timeline in the resource page & add webhook when create memos using Telegram bot (#2886)
* fix: wrong order in resource page timeline

* feat: add webhook when create memos using Telegram bot

* rename variables and fix typos for static checks
2024-02-01 20:24:58 +08:00
Steven
e78311b3af fix: initial gomark wasm 2024-02-01 19:39:41 +08:00
Steven
e3afad74ce fix: update initial wasm 2024-02-01 19:27:54 +08:00
Steven
554f93eccc fix: move initial wasm into app 2024-02-01 19:06:44 +08:00
Steven
79227021f5 chore: bump version 2024-01-31 23:08:33 +08:00
Steven
b4f2a3bd14 chore: remove migrator 2024-01-31 22:58:43 +08:00
Steven
0b4914d880 chore: update generated node types 2024-01-31 22:42:51 +08:00
Steven
2f0b0e0071 chore: remove node definition 2024-01-31 22:32:09 +08:00
Steven
8ce6a32aac feat: use gomark wasm in frontend 2024-01-31 22:25:24 +08:00
Wen Sun
3158c4b8b5 fix: role error in api/v2 when the first user registers (#2875)
Fix role error in api/v2 when the first user registers
2024-01-31 19:55:52 +08:00
Steven
30ae4140f3 chore: update gomark source 2024-01-31 19:01:08 +08:00
Lincoln Nogueira
279cba0e6b chore: greatly speed up migrator and lower memory usage (#2874)
* chore: add en-GB language

* chore: remove en-GB contents

* chore: prevent visitors from breaking demo
- prevent disabling password login
- prevent updating `memos-demo` user
- prevent setting additional style
- prevent setting additional script
- add some error feedback to system settings UI

* Revert "chore: add en-GB language"

This reverts commit 2716377b04.

* chore: speed-up migrator and lower memory usage
- remove all Store indirections
- query database directly with prepared statements

* chore: fix golangci-lint warnings
2024-01-31 16:45:21 +08:00
Lincoln Nogueira
52539fc130 chore: prevent visitors from breaking demo (#2869)
* chore: add en-GB language

* chore: remove en-GB contents

* chore: prevent visitors from breaking demo
- prevent disabling password login
- prevent updating `memos-demo` user
- prevent setting additional style
- prevent setting additional script
- add some error feedback to system settings UI

* Revert "chore: add en-GB language"

This reverts commit 2716377b04.
2024-01-31 13:16:31 +08:00
Steven
49e3eb107c chore: update gomark wasm 2024-01-31 00:25:01 +08:00
Lincoln Nogueira
e7d5dfe515 chore: add en-GB language (#2865)
* chore: add en-GB language

* chore: remove en-GB contents
2024-01-30 23:39:13 +08:00
Steven
28c7a75ea2 chore: fix import nodes 2024-01-30 22:15:05 +08:00
Steven
59d69a05fa feat: initial gomark wasm importer 2024-01-30 22:12:44 +08:00
Steven
ad2d492dec chore: move preview memo content 2024-01-30 22:10:17 +08:00
Elliot Chen
bee6f278ba fix: the same-storage check in the new pre-sign feature (#2860)
* fix: error check for the same oss-storage

* fix: conflict error2 variable in code refactor in s3.go

* chore: rename endpointUrl to endpointURL
2024-01-30 19:07:16 +08:00
Brilliant Hanabi
1bad0543d0 feat: add notice when sharing private links (#2809)
Co-authored-by: boojack <stevenlgtm@gmail.com>
2024-01-30 19:06:30 +08:00
Noah Alderton
73337331cb feat: export all user Memos as a .zip of Markdown files (#2854)
* Add gRPC Memos Export

* Update code style

* Add URL.revokeObjectURL

* Rename protobuf and ESLint fix

* Change MemosExport to ExportMemos
2024-01-30 16:42:54 +08:00
Wen Sun
50f7f131ea fix: month grouping error in timeline page (#2861) 2024-01-30 07:56:03 +08:00
Steven
a16bde23f7 chore: tweak variable name 2024-01-29 23:15:47 +08:00
Steven
c5a5f67fdb refactor: migrate auth service 2024-01-29 23:12:02 +08:00
Steven
de8db63811 chore: rename workspace setting service 2024-01-29 22:43:40 +08:00
Steven
dd9ee44a1f docs: regenerate swagger 2024-01-29 22:05:33 +08:00
Aleksandr Baryshnikov
fa17dce046 feat: pre-signed URL for S3 storage (#2855)
Adds automatically background refresh of all external links if they are belongs to the current blob (S3) storage. The feature is disabled by default in order to keep backward compatibility.

The background go-routine spawns once during startup and periodically signs and updates external links if that links belongs to current S3 storage.

The original idea was to sign external links on-demand, however, with current architecture it will require duplicated code in plenty of places. If do it, the changes will be quite invasive and in the end pointless: I believe, the architecture will be eventually updated to give more scalable way for pluggable storage. For example - Upload/Download interface without hard dependency on external link. There are stubs already, but I don't feel confident enough to change significant part of the application architecture.
2024-01-29 21:12:29 +08:00
Steven
cbcec80c5d chore: fix import order 2024-01-29 21:08:30 +08:00
Steven
2b7bd47b44 fix: rss routes 2024-01-29 21:04:35 +08:00
Steven
54c5039db3 chore: fix golang linter 2024-01-29 19:17:25 +08:00
Steven
af646ce2de refactor: move gomark 2024-01-29 19:14:46 +08:00
Steven
f4ac7ff529 chore: update memo resource url 2024-01-28 23:02:38 +08:00
Steven
55ecdae509 chore: fix auto link matcher 2024-01-28 22:13:19 +08:00
Steven
ef73299340 chore: update resource name migrator 2024-01-28 21:40:24 +08:00
Steven
8c6292925e chore: update code block styles 2024-01-28 15:41:11 +08:00
Steven
f05a89315c chore: fix list memos 2024-01-28 08:38:29 +08:00
Steven
a4452d8a2f chore: update linter rules 2024-01-28 08:17:11 +08:00
Steven
5e74394643 chore: add resource name migrator 2024-01-28 07:58:53 +08:00
Steven
f4e722c516 chore: remove latest tag 2024-01-28 07:46:08 +08:00
Steven
12275c6a34 chore: fix linter warning 2024-01-28 07:38:01 +08:00
Steven
21ef5a9bc0 chore: tweak workspace service 2024-01-28 07:35:42 +08:00
Steven
87b23940a6 chore: upgrade backend dependencies 2024-01-28 07:13:11 +08:00
Steven
11dd23f59b chore: tweak link checks 2024-01-28 07:04:35 +08:00
Lincoln Nogueira
887903b66b feat: add buf plugin to generate openapiv2 spec (#2843) 2024-01-28 06:16:37 +08:00
Steven
309fab222e chore: implement nested blockquote 2024-01-27 21:38:07 +08:00
Steven
1dc4f02b64 chore: update memo requests 2024-01-27 20:35:48 +08:00
Steven
8db90a040c chore: remove unused dependencies 2024-01-27 20:20:36 +08:00
Steven
932f636d84 chore: update codeblock renderer 2024-01-27 19:09:10 +08:00
Steven
ed32b20c9e chore: update frontend dependencies 2024-01-27 17:28:06 +08:00
Steven
10d709c167 chore: fix highlight cursor 2024-01-27 12:35:01 +08:00
Steven
8455114eef chore: fix list memos request 2024-01-27 11:17:59 +08:00
Steven
c26109cd36 chore: update list memos request 2024-01-27 11:14:17 +08:00
Steven
4b223c1e4c chore: update collapse sidebar 2024-01-27 05:27:42 +08:00
Steven
b9cbe6626f chore: update tag rename 2024-01-27 05:26:32 +08:00
Steven
566171783d chore: tweak embedded memo style 2024-01-26 23:33:40 +08:00
Steven
7edb3598ea chore: update default request limit 2024-01-26 23:03:10 +08:00
Steven
bc2d2d0cde feat: support set embedded content in UI 2024-01-26 22:51:57 +08:00
Steven
e1977df14b chore: remove check underscores 2024-01-26 21:23:36 +08:00
Wei Zhang
ddc89029b7 fix: use mysql to parse dsn (#2838)
Signed-off-by: Zhang Wei <kweizh@gmail.com>
2024-01-26 13:43:48 +08:00
Steven
f8b9a83d4a chore: tweak default value 2024-01-26 09:22:47 +08:00
Steven
2f16b7065a chore: tweak scripts 2024-01-26 09:15:27 +08:00
Steven
e5ff1829a5 chore: add Hungarian locale 2024-01-26 08:44:12 +08:00
Steven
d7889d9903 chore: tweak url filters 2024-01-26 08:39:53 +08:00
Steven
db3457e081 chore: bump version 2024-01-26 08:30:22 +08:00
Steven
4f2b00b4f3 chore: add migration scripts 2024-01-26 08:29:11 +08:00
Steven
79558028c0 feat: implement rename tag 2024-01-25 23:09:35 +08:00
Steven
70d1301dc3 chore: use filter in url params 2024-01-25 20:05:47 +08:00
Steven
6d5e1def76 chore: update member section 2024-01-25 19:49:39 +08:00
boojack
a5bc2d0ed6 chore: update i18n from Weblate (#2832)
* Added translation using Weblate (Hungarian)

* Translated using Weblate (Hungarian)

Currently translated at 0.3% (1 of 317 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/hu/

* Translated using Weblate (Hungarian)

Currently translated at 71.2% (226 of 317 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/hu/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/

* Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (316 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

* Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (316 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hant/

---------

Co-authored-by: Vermunds <com.github@weylus.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Lincoln Nogueira <lincolnthalles@users.noreply.github.com>
Co-authored-by: ti777777 <ti12272198686@yahoo.com.tw>
2024-01-25 19:36:02 +08:00
Steven
08ac60cc70 chore: update memo relation dialog 2024-01-25 08:59:10 +08:00
Mudkip
f654d3c90e fix: encode filename when using url prefix for resources (#2829)
* fix: encode filename when using url prefix for resources

* fix: only encode the last parts of filename

* fix: encode all parts in filepath
2024-01-24 11:28:26 +08:00
Steven
1b69b73eb9 chore: update calendar styles 2024-01-23 23:15:54 +08:00
Steven
3dbb254aeb chore: update referenced memo title from params 2024-01-23 21:54:15 +08:00
Steven
fdb1779a59 chore: implement referenced content renderer 2024-01-23 21:47:17 +08:00
Steven
a316e239ce chore: implement referenced content node 2024-01-23 21:40:59 +08:00
Steven
d7f02b94e5 chore: fix linter 2024-01-23 21:27:05 +08:00
Steven
d165d87288 refactor: markdown parser matchers 2024-01-23 21:23:40 +08:00
Steven
bf905bba86 chore: remove unused date picker 2024-01-22 22:50:27 +08:00
Brilliant Hanabi
3a129d5cfb fix: avoid making memos public when disabled (#2816)
* fix: avoid making memos public when disabled in v2

* fix: avoid making memos public when disabled in v1
2024-01-22 20:51:33 +08:00
ti777777
024a818e91 chore: update zh-Hant (#2815) 2024-01-21 23:50:44 +08:00
Steven
54a24833a7 chore: fix resource seeds 2024-01-21 21:36:31 +08:00
Steven
a620d140c5 chore: update embedded content renderers 2024-01-21 21:27:04 +08:00
Steven
370054e040 chore: implement collapsed navigation 2024-01-21 21:02:55 +08:00
Steven
fae0b4e900 chore: update memo relation style 2024-01-21 11:22:25 +08:00
Steven
c38404b5d5 chore: tweak get memo by name 2024-01-21 10:57:53 +08:00
Steven
4d48f50815 chore: use resource name in frontend 2024-01-21 10:55:49 +08:00
Steven
582cc6609c feat: add user-defined id to resource 2024-01-21 10:49:30 +08:00
Steven
40bd75c725 fix: create memo with resource name 2024-01-21 10:33:31 +08:00
Steven
b2fc3076f6 chore: update memo store 2024-01-21 01:23:55 +08:00
Steven
288527914b chore: migrate memo route 2024-01-21 01:23:44 +08:00
Steven
a2aea3747c chore: remove server tests 2024-01-20 23:51:24 +08:00
Steven
8382354ef7 feat: add user-defined name to memo 2024-01-20 23:48:35 +08:00
Steven
264e6e6e9c chore: tweak file name 2024-01-20 23:47:04 +08:00
Steven
eb72609ea3 chore: update memo editor cache key 2024-01-20 20:52:11 +08:00
Brilliant Hanabi
776785ac90 chore: update zh-Hans & zh-Hant translations (#2804) 2024-01-20 20:27:20 +08:00
Steven
d5f874e185 chore: handle resource not found 2024-01-20 12:47:43 +08:00
Steven
89d940d9b7 feat: implement params field for embedded content node 2024-01-20 12:41:08 +08:00
Mark Zhao
bd1cf62761 feat: enable iframe rendering in markdown code block (#2799)
* enable iframe rendering in code block

* fix eslint issue
2024-01-20 11:36:45 +08:00
Steven
196facfacd feat: implement embedded resource renderer 2024-01-20 09:17:31 +08:00
Steven
afe75fd9f2 chore: fix tokens split tests 2024-01-20 02:09:33 +08:00
Steven
8a34013558 feat: implement embedded memo renderer 2024-01-20 01:56:10 +08:00
Steven
67f5ac3657 feat: implement subscript and superscript renderer 2024-01-19 23:10:16 +08:00
Steven
7236552b6c feat: implement subscript and superscript parsers 2024-01-19 23:06:22 +08:00
Steven
1f5899d238 chore: update dependencies 2024-01-19 19:20:59 +08:00
Wen Sun
ec4884ea04 fix: incorrect timeline month display (#2792)
Fix incorrect timeline month display
2024-01-19 18:07:08 +08:00
Elliot Chen
2e0619b4dc feat: add a webhook action for deleted memos (#2791) 2024-01-19 09:56:00 +08:00
Steven
c9146bc749 chore: update code style 2024-01-19 07:06:28 +08:00
Steven
f5b5bd64bc chore: tweak datetime.ts 2024-01-18 22:18:56 +08:00
Steven
d31d9eb71c chore: remove unused nil checks 2024-01-18 19:23:45 +08:00
Steven
f28b654057 chore: fix setting nil checks 2024-01-18 19:20:48 +08:00
Steven
8738b68a44 chore: tweak readme 2024-01-18 19:06:49 +08:00
Steven
42381fa154 chore: add stable build action 2024-01-18 18:49:06 +08:00
Steven
22427101f8 chore: add stale issue action 2024-01-18 16:18:18 +08:00
Steven
2a4ebf5774 chore: add search bar in archived page 2024-01-18 15:28:37 +08:00
Steven
5172e4df7c chore: create memo visibility when creating 2024-01-18 15:20:22 +08:00
Steven
893dd2c85e chore: add disable filter to renderer context 2024-01-18 14:52:57 +08:00
Steven
d426f89cf0 chore: add time filter to timeline 2024-01-18 14:30:20 +08:00
Steven
7de3de5610 chore: fix go test warning 2024-01-18 11:45:59 +08:00
Steven
2856e66609 chore: fix go test 2024-01-18 11:42:57 +08:00
Steven
354011f994 chore: handle filter in user profile page 2024-01-18 11:38:45 +08:00
Steven
8ed827cd2d chore: update table node delimiter 2024-01-18 11:36:13 +08:00
Steven
05c0aeb789 feat: implement table renderer 2024-01-18 10:49:28 +08:00
Steven
aecffe3402 feat: implement table parser 2024-01-18 10:21:08 +08:00
Mehad Nadeem
70e6b2bb82 chore: added tooltip for vacuum button (#2778)
* chore: added tooltip for vacuum button

- At the moment only has text for English language therefore other JSON files need to be updated accordingly

* Update en.json
2024-01-18 08:09:49 +08:00
Steven
54296f0437 chore: update filter in timeline 2024-01-18 08:06:59 +08:00
Steven
8fcd9332f7 chore: tweak timeline styles 2024-01-17 22:32:58 +08:00
Steven
1857362d03 fix: locale and appearance setting 2024-01-17 22:16:12 +08:00
Steven
6d7186fc81 feat: rebuild timeline page 2024-01-17 21:59:49 +08:00
Wen Sun
e4488da96e fix: signup is not allowed if password login is disabled (#2776)
Signup is not allowed if password login is disabled

If password login is disabled in the system configuration, the "signup" in the "/auth" page disappears, but the user can manually enter "/auth/signup" to access the system by creating a new user.
2024-01-17 10:49:22 +08:00
Steven
cc43d06d33 chore: update memo stats response 2024-01-17 09:17:33 +08:00
Steven
9ffd827028 fix: appearance and locale initial value 2024-01-16 22:53:45 +08:00
Hanqin Guan
15e6542f0d fix: server overrides user's locale/appearance (#2771) 2024-01-16 18:21:08 +08:00
Noah Alderton
24bb3e096a fix: DatePicker by passing in Timezone to API (#2770)
* Fix DatePicker by passing in Timezone to API

* Add some clarity
2024-01-16 18:02:09 +08:00
Lincoln Nogueira
5bcbbd4c52 chore: fix store tests on Windows (#2769)
It's just a matter of explicitly closing the database, so that TempDir.removeAll doesn't fail.
2024-01-16 13:51:26 +08:00
Noah Alderton
ff13d977e9 feat: add URL paste handler (#2768)
* feat: Add URL paste handler

* Check if text highlighted for URL pasting
2024-01-16 10:06:16 +08:00
Wen Sun
1fdb8b7b01 fix: apply customized profile name in mobile header (#2723)
Fix mobile header title, apply customized profile name
2024-01-16 09:04:03 +08:00
Wen Sun
f1ee88c4e1 fix: display system logo in user banner if user not logged in (#2747)
Display system logo in user banner if user not logged in
2024-01-16 09:03:27 +08:00
Noah Alderton
b578afbc6a fix: DatePicker Local Date (#2766)
Fix DatePicker Local Date
2024-01-16 08:35:48 +08:00
Steven
ad94e8e3c6 feat: implement highlight renderer 2024-01-15 22:54:18 +08:00
Steven
3f4b361fad feat: implement highlight parser 2024-01-15 22:30:06 +08:00
Steven
46bd470640 chore: update favicon 2024-01-15 21:10:41 +08:00
Steven
fdbf2d8af2 chore: fix blockquote renderer 2024-01-15 20:41:37 +08:00
Steven
5a723f00fa chore: split editor keydown handler 2024-01-15 20:33:42 +08:00
Noah Alderton
728a9705ea feat: Markdown Editor Keyboard Shortcuts (#2763)
* Add bold and italic keyboard shortcut

* Add hyperlink keyboard shortcut support
2024-01-15 20:19:59 +08:00
THELOSTSOUL
cd3a98c095 fix: change use-set priority (#2760)
The user settings(locale, appearance) are not in use when restart broswer
2024-01-15 20:08:14 +08:00
Wen Sun
a22ad90174 fix: set memo resources error in mysql (#2761)
Fix error updating memo resources in mysql
2024-01-15 20:05:07 +08:00
Steven
5ebbed9115 chore: handle tag click 2024-01-15 08:15:34 +08:00
Steven
7ae4299df2 chore: implement create resource 2024-01-15 08:13:06 +08:00
Noah Alderton
3d23c01e26 feat: add additional favicon formats (#2752)
Add additional favicons
2024-01-15 07:54:33 +08:00
Lincoln Nogueira
089e04bcfd chore: use webp compression on logo (#2756)
- Logo size reduced from 310 KB to 36 KB.
- Point metadata image URL to local logo instead of remote
2024-01-14 22:21:03 +08:00
Steven
98762be1e5 feat: implement indent for list nodes 2024-01-14 22:19:03 +08:00
Steven
d44e74bd1e chore: update editor actions 2024-01-14 21:47:03 +08:00
Steven
8e0ce4d678 fix: list memos with pinned 2024-01-14 20:51:52 +08:00
Steven
45cf158508 chore: fix max width of home section 2024-01-14 20:25:45 +08:00
Anish Kelkar
7340ae15f7 chore: delete .vscode directory (#2693)
* Delete .vscode directory

* web/.vscode deleted
2024-01-14 20:12:57 +08:00
Steven
6db7ad76da chore: update tag selector 2024-01-13 16:26:42 +08:00
Steven
4a407668bc chore: tweak dialog close button 2024-01-13 15:33:23 +08:00
Steven
ab1fa44f00 feat: implement markdown buttons 2024-01-13 15:09:06 +08:00
Steven
cd0004cf88 chore: update icon version 2024-01-13 15:08:58 +08:00
Steven
667aaf06a0 chore: update dependencies 2024-01-13 14:33:50 +08:00
Steven
a8074d94e8 chore: update image attrs 2024-01-13 14:08:36 +08:00
Hanqin Guan
16e68fbfff fix: duplicated/reflexive relation in v2 api. (#2750) 2024-01-13 07:21:19 +08:00
Wen Sun
81942b3b98 chore: updating the default scopes of GitHub SSO (#2746)
Updating the default scopes of GitHub SSO

The scope of "user" in GitHub OAuth includes permissions to update a user's profile.
2024-01-12 14:02:11 +08:00
Athurg Gooth
a7cda28fc7 fix: filename with space (#2745) 2024-01-12 14:01:19 +08:00
Steven
0c52f1ee6a chore: tweak home style 2024-01-12 08:08:24 +08:00
Steven
1994c20c54 chore: tweak setting page 2024-01-11 22:25:05 +08:00
Steven
a1dda913c3 chore: fix tag selector position 2024-01-11 21:36:22 +08:00
Athurg Gooth
d626de1875 fix: pnpm install failed in docker (#2732)
fix pnpm install failed in docker
2024-01-11 21:29:55 +08:00
Wen Sun
6cfd94cc69 fix: deleting inbox records that senders have been deleted (#2743)
Deleting inbox records that senders have been deleted
2024-01-11 21:29:22 +08:00
Athurg Gooth
79b68222ff chore: set image loading to lazy (#2733)
set image loading to lazy to avoid concurrent problem
2024-01-11 10:27:18 +08:00
Steven
aaec46a39c chore: update find memo with updated time 2024-01-10 00:10:59 +08:00
Steven
9c663b1ba2 fix: merge mysql dsn with params 2024-01-10 00:03:47 +08:00
Steven
777ed899a3 chore: add memo uid 2024-01-08 21:48:26 +08:00
Steven
ddcf1d669d chore: add max content length 2024-01-08 21:17:21 +08:00
Steven
32d02ba022 chore: fix horizontal rule matcher 2024-01-08 21:00:45 +08:00
Steven
5449342016 fix: auto link converters 2024-01-08 20:57:44 +08:00
Noah Alderton
43e42079a4 feat: export Memos as Markdown FIles (#2716) 2024-01-08 11:40:50 +08:00
Steven
cafa7c5adc chore: update backend dependencies 2024-01-06 19:46:35 +08:00
Steven
1258c5a5b0 chore: update workspace setting proto 2024-01-06 19:46:21 +08:00
Steven
83141f9be2 chore: tweak navigation styles 2024-01-06 19:12:26 +08:00
Steven
4c59035757 chore: update about page 2024-01-06 19:01:11 +08:00
Steven
9459ae8265 chore: update postgres stmt builder 2024-01-06 17:12:10 +08:00
Steven
8893a302e2 chore: update logs 2024-01-06 16:58:58 +08:00
Steven
d67eaaaee2 chore: update database migrator 2024-01-06 16:55:13 +08:00
Steven
fd8333eeda chore: fix memo parent_id 2024-01-06 13:22:02 +08:00
Steven
f5a1739472 chore: update memo detail checks 2024-01-06 10:03:36 +08:00
Steven
a297cc3140 chore: exclude comments in memo list response 2024-01-06 09:48:11 +08:00
Steven
79c13c6f83 chore: fix edit memo params 2024-01-06 09:25:17 +08:00
Steven
8b9455d784 chore: fix memo resources position 2024-01-06 09:23:20 +08:00
Steven
501f8898f6 chore: fix postgres stmts 2024-01-05 21:27:16 +08:00
Steven
ee13927607 chore: fix restore tag node 2024-01-05 18:50:28 +08:00
Steven
d2a9aaa9d4 chore: update line break renderer 2024-01-05 09:18:37 +08:00
Steven
f563b58a85 chore: fix renderer props 2024-01-05 08:47:43 +08:00
Steven
ce2d37b90c chore: fix find sibling node 2024-01-05 08:43:30 +08:00
Steven
454cd4e24f feat: implement switchable task list node 2024-01-05 08:40:16 +08:00
Steven
6320d042c8 chore: update home padding styles 2024-01-04 22:50:46 +08:00
Steven
d7ed59581c chore: fix math block matcher 2024-01-04 21:50:13 +08:00
Steven
9593b0b091 chore: fix link rel field 2024-01-04 21:26:56 +08:00
Steven
ca53630410 chore: update drawer background 2024-01-04 21:11:22 +08:00
Steven
f484c38745 chore: fix dependencies 2024-01-04 20:07:53 +08:00
Steven
d12a2b0c38 feat: implement math expression parser 2024-01-04 20:05:29 +08:00
Steven
c842b921bc chore: update backend dependencies 2024-01-04 19:15:25 +08:00
Wen Sun
6b2eec86c2 fix: image upload failed with cloudflare R2 (#2704)
Fix image upload failed with cloudflare R2
2024-01-04 19:08:54 +08:00
Steven
2eba4e2cd4 chore: update version 2024-01-04 08:36:45 +08:00
Steven
73baeaa0ad chore: tweak dark mode styles 2024-01-04 08:32:14 +08:00
Steven
c58851bc97 chore: tweak accent color 2024-01-03 23:30:28 +08:00
Steven
96140f3875 chore: tweak dark mode styles 2024-01-03 23:12:50 +08:00
Lincoln Nogueira
369b8af109 chore: improve resource internal_path migrator (#2698)
* chore: improve internal path migrator
- handle mixed path styles
- handle Windows paths
- add tests

* chore: fix goimports error
2024-01-03 08:31:59 +08:00
Steven
914c0620c4 chore: add statistics view 2024-01-03 08:22:32 +08:00
Steven
138b69e36e chore: fix memo comment 2024-01-03 08:19:38 +08:00
Elliot Chen
3181c076b2 feat: add {uuid} in path template when using local storage or S3 (#2696)
Add {uuid} in path template when using local storage or S3

Add an addition tag `{uuid}` to the `replacePathTemplate`.

It is a workaround to leak the public links of a resource when using S3-based object storage. Currently, all resource blobs stored in S3 (R2, OSS) are set to be public. It is insecure as the resources for the private memos are also accessible on the Internet. Using an additional {uuid} might reduce this risk.

Meanwhile, it is also possible to avoid filename conflict
2024-01-02 20:57:55 +08:00
Noah Alderton
673809e07d fix: docker-compose.dev.yaml (#2695)
* Fix docker-compose.dev.yaml

* Add newline to .gitignore
2024-01-02 18:33:19 +08:00
Steven
f74fa97b4a chore: traverse nodes to upsert tags 2024-01-02 08:56:30 +08:00
Steven
c797099950 chore: update resource internal path migrator 2024-01-02 08:29:18 +08:00
Steven
0f8bfb6328 chore: update index.html 2023-12-29 08:28:17 +08:00
Steven
4cd01ece30 chore: update frontend metadata 2023-12-29 08:19:32 +08:00
Lincoln Nogueira
14b34edca3 chore: fix misuse of package path instead of filepath.path (#2684)
As stated by https://pkg.go.dev/path, "path" is mainly for URLs, "path.filepath" for file systems
2023-12-29 07:50:15 +08:00
Lincoln Nogueira
411e807dcc chore: use consistent relative paths for resources (#2683)
- always store resources with a relative path with forward slashes, which will be transformed as needed when the file is accessed

- fix an issue with thumbnail generation on Windows

- add several validations for local storage setting

- improve front-end error feedback when changing local storage

- add migrations to make existing resource paths relative (not needed, but improves database consistency)
2023-12-29 07:49:55 +08:00
Steven
ea87a1dc0c chore: update memo content props 2023-12-28 22:57:51 +08:00
Steven
46f7cffc7b feat: implement restore nodes 2023-12-28 22:35:39 +08:00
Steven
2a6f054876 chore: update auto link parser 2023-12-28 21:32:44 +08:00
Steven
30dca18b79 chore: fix suspense wrapper 2023-12-28 08:34:06 +08:00
Steven
09c195c752 chore: update backend dependencies 2023-12-28 08:28:50 +08:00
Steven
2ae6d94e2c chore: update frontend dependencies 2023-12-28 08:27:06 +08:00
Steven
9ee4b75bbd chore: tweak memo detail styles 2023-12-27 23:25:02 +08:00
Steven
cc40803b06 chore: update feature request template 2023-12-27 09:00:16 +08:00
Steven
a0a03b0389 chore: tweak list memos request 2023-12-27 08:54:00 +08:00
Steven
0dfc367e56 chore: start grpc server 2023-12-27 08:50:02 +08:00
Steven
c8d7f93dca feat: implement auto link parser 2023-12-27 08:44:51 +08:00
Steven
6fac116d8c chore: update user store 2023-12-26 23:05:33 +08:00
subks
f48ff102c9 fix: eslint check failure after fixing #2672 (#2673) 2023-12-26 21:46:26 +08:00
subks
bd5a0679ee fix: date format in share memo dialog (#2672)
fix: Date format in shareable Memo Images (#2668)
2023-12-26 17:50:09 +08:00
Steven
fcfb76a103 chore: remove user urlsets in sitemap 2023-12-23 19:35:46 +08:00
Steven
8e325f9986 chore: return username in user response 2023-12-23 19:23:39 +08:00
Steven
b8eaf1d57e chore: deprecate memo creation stats legacy api 2023-12-23 18:35:47 +08:00
Steven
42608cdd8f chore: fix server context 2023-12-23 17:59:15 +08:00
Steven
2cfa4c3b76 chore: tweak frontend routes register 2023-12-23 17:58:49 +08:00
Steven
aa136a2776 chore: remove vite pwa plugin 2023-12-23 17:42:13 +08:00
Steven
68413a5371 chore: update frontend service 2023-12-23 17:04:52 +08:00
Steven
638f17a02c chore: update scripts 2023-12-23 15:12:25 +08:00
Steven
273d6a6986 chore: update dockerfile 2023-12-23 14:13:40 +08:00
Steven
953141813c chore: regenerate pnpm lock file 2023-12-23 12:01:26 +08:00
Leyang
be2db3f170 feat: use vite plugin pwa for generate right sw.js (#2658)
Co-authored-by: boojack <stevenlgtm@gmail.com>
2023-12-23 12:00:03 +08:00
Steven
eefce6ade3 chore: implement webhook dispatch in v2 api 2023-12-23 11:17:35 +08:00
Steven
c6ebb5552e chore: add 403 page 2023-12-23 10:08:23 +08:00
Steven
4d64d4bf25 chore: upgrade frontend dependencies 2023-12-23 09:47:43 +08:00
Steven
2ee4d7d745 chore: add startTransition to links 2023-12-23 08:55:43 +08:00
Steven
1b81999329 chore: skip invalida setting checks 2023-12-23 08:55:23 +08:00
Steven
df5aeb6d88 chore: remove v1 prefix in store name 2023-12-23 08:48:11 +08:00
Steven
df3303dcd3 chore: update list users 2023-12-23 08:35:54 +08:00
Steven
c267074851 chore: prevent archive/delete current user 2023-12-23 08:05:05 +08:00
Steven
21874d0509 chore: fix navigation errors 2023-12-23 08:01:16 +08:00
Steven
7898df2876 chore: update issue templates 2023-12-23 08:00:59 +08:00
Steven
b2ec0d1217 chore: add skip cache requesting 2023-12-22 20:30:28 +08:00
Steven
5673e29e51 chore: compose memo in backend 2023-12-22 20:18:31 +08:00
Steven
feefaabce9 chore: update heatmap click handler 2023-12-22 20:07:17 +08:00
Steven
29b540ade3 chore: fix fetch memos 2023-12-22 19:47:46 +08:00
Steven
919f75af1a chore: update suspense loading 2023-12-22 19:27:09 +08:00
Steven
17e905085f chore: update acl config 2023-12-22 09:11:55 +08:00
Steven
34af969785 chore: fix list memos order by pinned 2023-12-22 09:09:03 +08:00
Steven
fd9c3ccbae chore: implement useMemoList store 2023-12-22 09:01:30 +08:00
Steven
a3feeceace chore: remove component v1 suffix 2023-12-22 08:29:02 +08:00
Steven
02265a6e1a chore: fix memo search 2023-12-22 00:31:29 +08:00
Steven
81524c38e9 chore: refactor memo module 2023-12-21 23:40:43 +08:00
Steven
671551bdc1 chore: update memo detail page 2023-12-21 22:42:06 +08:00
Steven
10c81ccba3 chore: fix type definition 2023-12-21 21:43:28 +08:00
Steven
9361613f23 chore: update timeline page 2023-12-21 21:24:08 +08:00
Athurg Gooth
b14334220f fix: trim the dirname of attachment send by telegram bot (#2651) 2023-12-21 09:47:57 +08:00
Athurg Gooth
f184d65267 fix: attachments send from telegram lost (#2650) 2023-12-21 09:47:25 +08:00
Steven
b64e2ff6ff chore: implement list memo resources api 2023-12-20 23:46:04 +08:00
Steven
cbdae24314 chore: update archived page 2023-12-20 23:23:26 +08:00
Steven
762cb25227 chore: update memo service 2023-12-20 23:14:15 +08:00
Steven
fc01a796f8 chore: fix demo seed data 2023-12-20 08:18:56 +08:00
Steven
feb700f325 chore: clear access token when user not found 2023-12-20 07:42:02 +08:00
Steven
5334fdf1b2 chore: use api v2 in archived page 2023-12-19 23:49:24 +08:00
Steven
abc14217f6 chore: tweak padding styles 2023-12-19 23:09:57 +08:00
Steven
af68cae6ea chore: regenerate swagger docs 2023-12-19 22:37:07 +08:00
Steven
e0cacfc6d6 chore: retire auto backup for sqlite 2023-12-19 22:34:06 +08:00
Steven
b575064d47 chore: tweak padding 2023-12-19 21:44:40 +08:00
Steven
6290234ad1 chore: fix button styles 2023-12-19 21:29:07 +08:00
Steven
aeed25648a chore: tweak drawer background 2023-12-19 08:55:21 +08:00
Steven
43e7506ed5 chore: fix react-uses import 2023-12-19 08:45:47 +08:00
Steven
a3a1bbe8de chore: tweak responsible styles 2023-12-19 08:41:41 +08:00
Steven
fe4ec0b156 chore: rename navigator 2023-12-19 00:13:22 +08:00
Steven
7c5fdd1b06 chore: remove demo banner 2023-12-18 23:46:48 +08:00
Steven
4d54463aeb chore: add mobile header 2023-12-18 23:33:09 +08:00
Steven
40bc8df63d chore: fix container height 2023-12-18 23:01:39 +08:00
Steven
61de7c8a32 chore: fix demo banner 2023-12-18 22:29:29 +08:00
Steven
d6656db20d feat: implement part of full-screen layout 2023-12-18 22:10:36 +08:00
Steven
15a091fe4c chore: fix offset params in explore page 2023-12-18 20:54:51 +08:00
Steven
d8a0528135 chore: tweak variable names 2023-12-18 20:47:29 +08:00
Steven
16fb5faebd chore: revert go mod update 2023-12-18 19:40:39 +08:00
Steven
2c4b5d75b3 chore: fix html escaping 2023-12-17 23:37:00 +08:00
Steven
770607f93f fix: add markdown service to acl 2023-12-17 11:37:38 +08:00
Steven
db0eff4743 chore: clean frontend dependencies 2023-12-17 11:25:10 +08:00
Steven
0793f96578 chore: update heading styles 2023-12-17 11:08:13 +08:00
Steven
8095d94c97 chore: deprecate marked 2023-12-17 11:02:16 +08:00
Steven
bcfcd59642 chore: deprecate old MemoContent 2023-12-17 10:58:22 +08:00
Steven
5d677c3c57 chore: implement node renderer components 2023-12-17 10:49:49 +08:00
Steven
28c0549705 feat: add markdown service 2023-12-17 09:53:22 +08:00
Steven
bb42042db4 chore: implement task list parser 2023-12-16 12:48:52 +08:00
Steven
1c7fb77e05 chore: update user setting names 2023-12-16 12:18:53 +08:00
Steven
e8ca2ea5a0 chore: rename renderer package 2023-12-16 11:57:36 +08:00
Steven
e43a445c34 chore: implement escaping character node 2023-12-16 11:47:29 +08:00
Steven
1237643028 chore: update parser tests 2023-12-16 11:34:55 +08:00
Steven
aee0e31b0a chore: update parser functions 2023-12-16 10:38:05 +08:00
Steven
47af632c79 chore: update inline parser 2023-12-16 10:09:20 +08:00
Steven
7b0ceee57b chore: update memo metadata description 2023-12-16 09:23:45 +08:00
Steven
bdc867d153 fix: heading render 2023-12-16 09:12:55 +08:00
Steven
6421fbc68a chore: implement list html render 2023-12-16 09:01:19 +08:00
Steven
b00443c222 chore: implement list nodes 2023-12-16 08:51:29 +08:00
Steven
a10b3d3821 chore: tweak custom profile 2023-12-15 22:57:53 +08:00
Steven
7735cfac31 chore: update seed data 2023-12-15 22:34:19 +08:00
Steven
749187e1e9 chore: update dockerfile 2023-12-15 21:46:11 +08:00
Steven
a9812592fe chore: tweak editor border styles 2023-12-15 21:35:31 +08:00
Steven
e4070f7753 chore: bump version 2023-12-15 21:11:04 +08:00
Steven
ff53187eae chore: add sitemap and robots routes 2023-12-15 20:18:01 +08:00
Steven
89ef9b8531 chore: add instance url system setting 2023-12-15 19:39:37 +08:00
Steven
56b55ad941 chore: update memo metadata 2023-12-15 19:13:56 +08:00
Steven
24672e0c5e chore: update memo metadata 2023-12-15 08:12:10 +08:00
Steven
52743017a3 chore: implement memo route 2023-12-15 07:32:49 +08:00
Steven
6cf7192d6a chore: add ssr placeholder in index.html 2023-12-14 23:29:42 +08:00
Steven
6763dab4e5 chore: handle newline in block parsers 2023-12-14 22:55:46 +08:00
Steven
e0290b94b4 chore: use gomark in rss api 2023-12-14 22:33:20 +08:00
Steven
242f64fa8e chore: implement html render 2023-12-14 22:21:23 +08:00
Steven
3edce174d6 chore: remove unused methods 2023-12-14 00:24:41 +08:00
Steven
5266a62685 chore: implement html renderer 2023-12-14 00:04:20 +08:00
Steven
43ef9eaced chore: implement part of html renderer 2023-12-13 23:50:05 +08:00
Steven
453707d18c feat: implement gomark parsers 2023-12-13 21:00:13 +08:00
Steven
2d9c5d16e1 chore: fix user string 2023-12-13 19:08:06 +08:00
Steven
b20e0097cf chore: implement part of nodes 2023-12-13 09:06:47 +08:00
Steven
dd83782522 chore: add line break node 2023-12-12 23:38:43 +08:00
Steven
aa3632e2ac chore: implement gomark skeleton 2023-12-12 23:24:02 +08:00
boojack
7f1f6f77a0 chore: update i18n with weblate (#2614)
* Translated using Weblate (French)

Currently translated at 100.0% (317 of 317 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/fr/

* Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (317 of 317 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

---------

Co-authored-by: Ezmana <ezmana.land@gmail.com>
Co-authored-by: Lincoln Nogueira <lincolnthalles@users.noreply.github.com>
2023-12-12 21:06:13 +08:00
Steven
7eb5be0a4e chore: fix update user 2023-12-12 20:01:31 +08:00
Steven
603a6a4971 chore: fix vacuum memo 2023-12-12 19:56:15 +08:00
Cologler
6bda64064e fix: delete one memo will delete all memos on pgsql (#2611)
fix: delete single memo will all memos on pgsql

Close #2605
2023-12-12 19:52:39 +08:00
Steven
ec7992553f chore: go mod update 2023-12-11 22:21:05 +08:00
Steven
e5de8c08f5 chore: clean debug code 2023-12-11 22:20:57 +08:00
Steven
c608877c3e chore: clean binary entries 2023-12-11 22:16:39 +08:00
Steven
52f399a154 chore: remove unused functions 2023-12-11 21:53:16 +08:00
Gabe Cook
88728906a8 fix(copydb): fix migration to Postgres (#2601)
* chore(copydb): Use query builder during setup

* fix(copydb): Fix migration to Postgres
2023-12-11 18:05:15 +08:00
boojack
0916ec35da chore: update i18n with Weblate (#2594)
* Translated using Weblate (French)

Currently translated at 100.0% (317 of 317 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/fr/

* Translated using Weblate (French)

Currently translated at 100.0% (317 of 317 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/fr/

---------

Co-authored-by: Ezmana <ezmana.land@gmail.com>
Co-authored-by: LibreTranslate <noreply-mt-libretranslate@weblate.org>
2023-12-10 15:49:29 +08:00
Steven
9f4f2e8e27 chore: fix user setting values 2023-12-10 11:57:31 +08:00
Steven
82009d3147 chore: tweak webhook section 2023-12-10 10:21:36 +08:00
Steven
0127e08a28 fix: data conflict handler 2023-12-10 10:07:26 +08:00
Steven
d275713aff chore: fix timestamp type in postgres 2023-12-09 23:19:57 +08:00
Steven
c50f4f4cb4 chore: update migration scripts 2023-12-09 22:18:05 +08:00
Steven
fa34a7af4b chore: tweak memo parent styles 2023-12-09 19:32:16 +08:00
Steven
77b75aa6c4 chore: tweak memo display 2023-12-09 18:57:59 +08:00
Steven
9faee68dab chore: code clean 2023-12-09 18:57:18 +08:00
Steven
4f05c972d5 chore: fix jwt acl 2023-12-09 16:17:11 +08:00
Steven
abda6ad041 chore: update latest schema 2023-12-09 12:05:45 +08:00
Steven
7fc7b19d64 chore: deprecate user setting legacy api 2023-12-08 22:41:47 +08:00
Steven
b2d898dc15 chore: fix import order 2023-12-08 22:06:42 +08:00
Steven
15425093af chore: skip user setting key checks 2023-12-08 22:05:43 +08:00
K.B.Dharun Krishna
b02aa2d5e5 chore: bump actions in workflows (#2588)
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2023-12-08 09:55:18 +08:00
steven
c68bfcc3b9 chore: fix user setting store 2023-12-08 09:54:32 +08:00
Athurg Gooth
2964cf93ab fix: visibility of user preference is empty (#2581)
Fix visibility of user preference is empty
2023-12-07 22:50:03 +08:00
Arnaud Brochard
787cf2a9fe feat: tables support (#2573)
* Tables support

* Linter fixes

* Regex Redos fix

* Fix empty row and variables proper naming

* Default cell style

* Now unncessary

* Support rows without a starting pipe char

* Striped rows

* Fix parsing issues

* Support tabs in separators
2023-12-07 22:49:49 +08:00
Athurg Gooth
ed190cd41e fix: visibility of memo editor is empty (#2580)
Fix visibility of memo editor is empty
2023-12-06 23:17:26 +08:00
Steven
33dda9bf87 chore: fix auth status checks 2023-12-06 23:03:24 +08:00
Steven
fa6693a7ae chore: update list memos 2023-12-06 22:44:49 +08:00
t.yang
055a327b5e fix: detail page user-avatar size have unexpected height (#2576)
Co-authored-by: tyangs.yang <tyangs.yang@hstong.com>
2023-12-06 10:58:33 +08:00
Athurg Gooth
aff1b47072 chore: remove debug log (#2582)
Remove debug log
2023-12-06 10:57:55 +08:00
Athurg Gooth
5f86769255 fix: field type of row_status for table webhook (#2579)
Fix field type of row_status for table webhook
2023-12-06 10:57:03 +08:00
Irving Ou
9c18960f47 feat: support Postgres (#2569)
* skeleton of postgres

skeleton

* Adding Postgres specific db schema sql

* user test passed

* memo store test passed

* tag is working

* update user setting test done

* activity test done

* idp test passed

* inbox test done

* memo_organizer, UNTESTED

* memo relation test passed

* webhook test passed

* system setting test passed

* passed storage test

* pass resource test

* migration_history done

* fix memo_relation_test

* fixing server memo_relation test

* passes memo relation server test

* paess memo test

* final manual testing done

* final fixes

* final fixes cleanup

* sync schema

* lint

* lint

* lint

* lint

* lint
2023-12-03 13:31:29 +08:00
Webysther Sperandio
484efbbfe2 chore: update manifest.json (#2568) 2023-12-01 16:43:48 +08:00
Steven
e83d483454 refactor(frontend): use auth service 2023-12-01 09:15:02 +08:00
Steven
b944418257 fix: register auth service 2023-12-01 09:13:32 +08:00
Steven
4ddd3caec7 chore: update user setting api 2023-12-01 09:03:30 +08:00
Steven
c1f55abaeb chore: update user setting api 2023-11-30 23:08:54 +08:00
Steven
fff42ebc0d fix: check auth status 2023-11-30 21:52:02 +08:00
Steven
2437419b7f fix: add auth status checks 2023-11-30 20:58:36 +08:00
boojack
e53cedaf14 chore: update i18n with weblate (#2562)
* Translated using Weblate (Polish)

Currently translated at 46.3% (147 of 317 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pl/

* Translated using Weblate (Polish)

Currently translated at 56.1% (178 of 317 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pl/

---------

Co-authored-by: igormakarowicz <igormakarowicz@gmail.com>
2023-11-30 19:34:50 +08:00
Steven
6d469fd997 chore: fix image size 2023-11-30 19:36:12 +08:00
boojack
9552cddc93 chore: update graph format 2023-11-29 09:00:29 +08:00
boojack
34181243e5 chore: update graph route 2023-11-28 23:06:19 +08:00
boojack
a0eb891132 chore: update contributor graph source 2023-11-28 22:31:34 +08:00
Steven
e136355408 chore: tweak setting button style 2023-11-28 21:15:24 +08:00
Steven
5069476dcc chore: add webhook metric 2023-11-28 21:15:10 +08:00
Steven
f950750d56 chore: tweak storage list title 2023-11-28 21:03:21 +08:00
Steven
0026f9e54f chore(frontend): add webhooks section 2023-11-28 20:52:48 +08:00
Steven
f8f73d117b chore: update healthz message 2023-11-26 23:33:34 +08:00
Steven
8586ebf098 chore: add /healthz endpoint 2023-11-26 23:06:50 +08:00
Steven
472afce98f chore: fix current user store 2023-11-25 22:58:17 +08:00
Steven
a12844f5db chore: tweak seed data 2023-11-25 10:34:54 +08:00
Steven
bc965f6afa chore: implement webhook dispatch in api v1 2023-11-25 10:31:58 +08:00
Steven
db95b94c9a chore: implement webhook service 2023-11-24 23:04:36 +08:00
Steven
1a5bce49c2 chore: implement webhook store 2023-11-24 22:45:38 +08:00
Steven
436eb0e591 chore: tweak s3 comments 2023-11-24 21:55:09 +08:00
Hou Xiaoxuan
e016244aba fix: remove ACL when set URLPrefix (#2532) 2023-11-23 23:20:11 +08:00
Steven
d317b03832 feat: add search box in resources dashboard 2023-11-23 22:12:15 +08:00
Athurg Gooth
3e138405b3 chore: remove the max height limit for single media (#2545)
Remove the max-height limit for single media
2023-11-23 09:59:33 +08:00
Steven
0dd0714ad0 chore: update security 2023-11-23 08:55:57 +08:00
Steven
45d7d0d5f6 chore: migrate get current user 2023-11-23 08:50:33 +08:00
boojack
c3db4ee236 chore: translated using Weblate (Portuguese (Brazil)) (#2543)
Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (316 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

Co-authored-by: Lincoln Nogueira <lincolnthalles@users.noreply.github.com>
2023-11-22 23:22:10 +08:00
Athurg Gooth
91296257fc chore: remove invalid access token from db (#2539)
Remove invalid access token from db
2023-11-22 23:20:45 +08:00
Steven
e5f660a006 chore: migrate update user 2023-11-22 23:11:29 +08:00
Steven
c0628ef95b chore: migrate create user 2023-11-22 22:58:04 +08:00
Steven
c0b5070e46 chore: migrate delete user 2023-11-22 22:52:19 +08:00
Steven
b1128fc786 chore: fix inline latext renderer 2023-11-22 22:38:03 +08:00
Steven
bcd8a5a7a9 chore: migrate get tag suggestions 2023-11-22 22:33:02 +08:00
boojack
0cf280fa9a chore: translated using Weblate (Croatian) (#2541)
Translated using Weblate (Croatian)

Currently translated at 92.7% (293 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/hr/

Co-authored-by: May Kittens Devour Your Soul <yoshimitsu002@gmail.com>
2023-11-22 19:22:12 +08:00
Steven
b11653658d chore: update readme 2023-11-21 20:39:48 +08:00
Cheng Jiang
adf96a47bb fix: correct some Chinese translation inaccuracy (#2536)
Signed-off-by: Cheng Jiang <gabriel.chengj@gmail.com>
2023-11-21 10:58:19 +08:00
Steven
6529375a8b chore: update seed data 2023-11-19 23:58:35 +08:00
Steven
e7e83874cd chore: upgrade version 2023-11-19 11:01:21 +08:00
Steven
7ef125e3af chore: update fetch tags 2023-11-19 11:01:04 +08:00
Steven
dfa14689e4 chore: add click away event to date picker 2023-11-19 10:41:08 +08:00
Steven
ec2995d64a chore: fix order by pinned 2023-11-19 09:42:59 +08:00
Steven
94c71cb834 chore: fix loading status 2023-11-19 09:38:04 +08:00
Steven
7f7ddf77b8 chore: update allow sign up default value 2023-11-18 12:51:07 +08:00
Steven
089cd3de87 chore: fix linter 2023-11-18 12:44:49 +08:00
zty
2d34615eac fix: parse inline latex as a inline element (#2525)
* fix:  parse inline latex as a inline element

* Update web/src/labs/marked/parser/InlineLatex.tsx

---------

Co-authored-by: zty <zty.dev@outlook.com>
Co-authored-by: boojack <stevenlgtm@gmail.com>
2023-11-18 12:41:33 +08:00
Steven
4da3c1d5e5 chore: fix update user 2023-11-18 12:37:24 +08:00
zty
4f222bca5c fix: keep content and query param on save when access token is invalid (#2524)
fix:
keep content on save when access token is invalid

Co-authored-by: zty <zty.dev@outlook.com>
2023-11-17 10:01:14 +08:00
Steven
0bb0407f46 chore: add overflow tips to tag 2023-11-17 08:22:47 +08:00
Zexi
8bc117bce9 feat: optimize media resource display (#2518)
* feat: optimize media resource display

* fix: type error

* Update web/src/components/MemoResourceListView.tsx

Co-authored-by: boojack <stevenlgtm@gmail.com>

* Update MemoResourceListView.tsx

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2023-11-17 08:03:26 +08:00
Athurg Gooth
afd0e72e37 chore: skip timeout for blob upload (#2516)
Skip timeout for blob upload
2023-11-15 17:23:56 +08:00
Vespa314
d758ba2702 fix: allow host role update user info (#2515) 2023-11-15 11:43:49 +08:00
Leyang
0f126ec217 docs: add obsidian plugin (#2512) 2023-11-14 23:22:54 +08:00
Steven
c1a6dc9bac chore: fix home sidebar max width 2023-11-14 23:23:05 +08:00
Athurg Gooth
6ee95a2c0c fix: clear localStorage while draft is empty (#2510)
* Clear localStorage while draft is empty

* change == into ===
2023-11-14 10:02:16 +08:00
Athurg Gooth
6814915c88 feat: backup file rotate (#2511)
Add support for rotate backup files
2023-11-13 22:12:25 +08:00
Athurg Gooth
52fdf8bccd fix: persist jwt expires by cookie (#2509)
fix pesist jwt expires by cookie
2023-11-13 13:52:04 +08:00
Mahoo Huang
f67757f606 feat: add editor auto focus preference (#2498)
* feat: add editor auto focus perference

* feat: set editor auto focus
2023-11-13 13:51:52 +08:00
ti777777
38f05fd6f2 chore: fix tag in http_getter.go (#2500)
Update http_getter.go

fix tag in  http_getter.go
2023-11-11 23:21:15 +08:00
Vespa314
65022beb0d fix: duplicate memo filter in user profile page (#2502) 2023-11-11 23:20:53 +08:00
swebdev
5d81338aca fix: demo banner link for self-hosting guide (#2499) 2023-11-11 19:15:24 +08:00
Steven
c288d49138 chore: fix decouple user name 2023-11-10 23:08:11 +08:00
Steven
0ea0645258 chore: add use reponsive width 2023-11-10 11:22:32 +08:00
steven
9227ca5b5b chore: update debounce ms 2023-11-09 08:52:02 +08:00
steven
eb6b0ddead chore: update navigation 2023-11-09 08:46:26 +08:00
Steven
dca90fb5d2 chore: update header 2023-11-09 08:27:46 +08:00
steven
172e27016b chore: upgrade frontend deps 2023-11-09 08:26:00 +08:00
steven
6da2ff7ffb chore: clean logs 2023-11-09 08:25:28 +08:00
Steven
6c433b452f chore: update user checks 2023-11-08 22:58:35 +08:00
Steven
65a34ee41a chore: update home sidebar 2023-11-08 22:18:12 +08:00
Steven
5ff0234c71 chore: update response styles 2023-11-08 22:10:15 +08:00
Steven
e76509a577 chore: update header menu style in mobile view 2023-11-08 22:00:49 +08:00
Steven
4499f45b67 chore: deprecate daily review offset local setting 2023-11-08 21:49:03 +08:00
boojack
504d1768f2 chore: update i18n with Weblate (#2492)
* Translated using Weblate (Chinese (Traditional))

Currently translated at 91.7% (290 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hant/

* Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (316 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hant/

---------

Co-authored-by: dwong33 <dwong@posteo.ch>
2023-11-08 13:02:24 +08:00
zty
caea065594 feat: add share btn in more-action (#2491)
Co-authored-by: zty <zty.dev@outlook.com>
2023-11-08 10:34:07 +08:00
Athurg Gooth
2ee426386a fix: skip system_setting check while copydb (#2490)
Skip system_setting check while copydb
2023-11-08 10:06:27 +08:00
boojack
9df05fe0fa chore: update i18n from Weblate (#2489)
* Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (316 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

* Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (316 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

---------

Co-authored-by: LibreTranslate <noreply-mt-libretranslate@weblate.org>
Co-authored-by: Lincoln Nogueira <lincolnthalles@users.noreply.github.com>
2023-11-07 22:39:27 +08:00
zty
184f79ef8e feat: support code in headings (#2488)
Co-authored-by: zty <zty.dev@outlook.com>
2023-11-07 22:38:38 +08:00
Athurg Gooth
35f0861d6e fix: prevent copydb to create a fresh memos (#2486)
Prevent copydb to create a fresh memos
2023-11-07 13:53:53 +08:00
Steven
c4d27e7a78 chore: update backend dependencies 2023-11-07 07:36:16 +08:00
Steven
7e545533cf chore: update resource cache control 2023-11-07 07:24:41 +08:00
Steven
32cafbff9b chore: add OverflowTip kit component 2023-11-07 07:20:17 +08:00
Steven
9c4f72c96e chore: update tooltips 2023-11-07 07:06:38 +08:00
Steven
5e4493b227 chore: remove debug codes 2023-11-06 23:20:26 +08:00
Steven
834b58fbbd feat: add version update inbox message 2023-11-06 22:53:55 +08:00
Steven
342d1aeefb fix: version checker 2023-11-06 22:33:12 +08:00
Steven
363c107359 chore: update frontend deps 2023-11-06 21:08:09 +08:00
boojack
0458269e15 revert: "chore: add frontend type definitions" (#2483)
Revert "chore: add frontend type definitions (#2482)"

This reverts commit 64d4db81ca.
2023-11-06 21:01:17 +08:00
boojack
64d4db81ca chore: add frontend type definitions (#2482)
chore: update
2023-11-06 21:00:42 +08:00
Steven
865cc997a4 chore: remove upgrade version banner 2023-11-06 20:51:59 +08:00
Steven
981bfe0464 feat: add version checker 2023-11-06 20:49:02 +08:00
Steven
695fb1e0ca chore: update migration history store 2023-11-06 08:33:31 +08:00
Steven
21ad6cc871 chore: update tag service creator 2023-11-06 08:05:07 +08:00
Steven
c24181b2be chore: fix jwt checks 2023-11-05 23:39:30 +08:00
Steven
39a0e69b04 chore: update function name 2023-11-05 23:28:09 +08:00
Steven
e60e47f76f chore: update user definition 2023-11-05 23:03:43 +08:00
Steven
e67820cabe chore: update list user api permission 2023-11-05 22:35:09 +08:00
Steven
3266c3a58a chore: update link styles 2023-11-05 22:26:09 +08:00
Steven
ef820a1138 chore: fix memo editor padding in daily review 2023-11-05 21:42:02 +08:00
Steven
137e64b0dd chore: update metrics 2023-11-05 21:41:47 +08:00
Steven
982b0285c9 chore: fix date picker 2023-11-05 16:02:51 +08:00
Steven
405fc2b4d2 chore: simplify find migration history 2023-11-05 15:49:57 +08:00
Steven
eacd3e1c17 chore: fix mysql latest schema 2023-11-05 15:38:45 +08:00
Christopher
a62f1e15a6 fix: private memos being public (#2480)
* fix(web/memo): filter out public option

Filter out the public option if we have disabled public memos

* feat(api/memo): sanity check for disabled public memos

In case something goes wrong, we check the system setting on the backend in order to valdiate if we can create a public memo

* refactor(web/memo): disable public option

Seems like a better option than removing it, as it looks werid if you are looking at a memo that is previously public

* fix(web/memo): use translation keys

* chore(web/editor): remove unsused tooltip

* revert(api/memo): sanity check

* fix(web/memo): allow admins to create public memos

* chore(web/memo): remove unused import

* fix(web/memo): check for both host and admin

* fix(web/memo): remove warning text from MemoDetail
2023-11-05 01:19:54 +08:00
Zexi
8b0083ffc5 fix: auto fetch more (#2472)
* fix: auto fetch more

* feat: use union type
2023-11-03 05:16:55 +08:00
Athurg Gooth
5d69d89627 feat: week from monday in heatmap for zh-Hans and ko (#2457)
* week from monday in heatmap for zh-Hans and ko

* optimize code
2023-10-31 12:06:14 +08:00
Athurg Gooth
b966c16dd5 fix: data too large for mysql (#2470)
* Extend some TEXT field to LONGTEXT in mysql

* move db migration version

* fix error in migrate SQL
2023-10-31 10:23:15 +08:00
Steven
97190645cc chore: update memo editor styles 2023-10-29 23:59:23 +08:00
Steven
c26417de70 chore: update docs links 2023-10-29 18:36:09 +08:00
Steven
f5c1e79195 chore: update about dialog 2023-10-28 15:17:33 +08:00
Steven
d02105ca30 chore: update i18n 2023-10-28 15:10:20 +08:00
Steven
44e50797ca chore: update go mods 2023-10-28 14:57:39 +08:00
Steven
7058f0c8c2 chore: add docs link in settings 2023-10-28 14:56:08 +08:00
Steven
f532ccdf94 chore: upgrade frontend deps 2023-10-28 14:55:57 +08:00
Steven
a6fcdfce05 chore: update memo comment i18n 2023-10-28 11:39:10 +08:00
Steven
dca712d273 chore: fix resource tests 2023-10-28 10:51:03 +08:00
Steven
ac81d856f6 chore: delete resource file sync 2023-10-28 10:42:39 +08:00
Steven
88fb79e458 chore: impl inbox store for mysql 2023-10-28 09:44:52 +08:00
Steven
480c53d7a2 chore: fix id converter 2023-10-28 09:04:32 +08:00
Steven
2b7d7c95a5 chore: update inbox detect 2023-10-28 09:02:02 +08:00
Steven
0ee938c38b chore: remove unused inbox status 2023-10-28 02:49:35 +08:00
Steven
3c36cc2953 feat: add inbox ui 2023-10-28 02:43:46 +08:00
Steven
79bb3253b6 chore: add activity service 2023-10-28 00:21:53 +08:00
Steven
18107248aa chore: rename list inbox 2023-10-28 00:08:42 +08:00
Athurg Gooth
4f1bb55e55 fix: metric env not affect (#2450)
fix metric env not affect
2023-10-27 23:26:23 +08:00
Athurg Gooth
20d3abb99a chore: downgrade log level for auto backup disable (#2454)
downgrade log level for auto backup disable
2023-10-27 23:25:51 +08:00
Steven
1b34119e60 chore: update activity store definition 2023-10-27 23:24:56 +08:00
Steven
9d2b785be6 chore: fix inbox test 2023-10-27 23:17:17 +08:00
Steven
36b4ba33fa chore: remove outdated activity definition 2023-10-27 23:11:56 +08:00
Steven
625ebbea1a chore: update proto linter action 2023-10-27 21:49:07 +08:00
Athurg Gooth
0f4e5857f0 chore: remove gRPC listener (#2456)
Disable gRPC listener
2023-10-27 21:38:17 +08:00
Athurg Gooth
76d955a69a chore: docker compose dev (#2458)
* add golang build cache volume to speedup build

* replace `lint` with `npm` to run more scripts

* wrap golangci-lint as entrypoint instead of command
2023-10-27 21:21:52 +08:00
Athurg Gooth
e41ea445c9 fix: missing relation after post comment (#2452)
fix missing relation after post comment
2023-10-27 10:12:25 +08:00
boojack
c952651dc1 chore: update i18n from Weblate (#2455)
* Translated using Weblate (Croatian)

Currently translated at 92.3% (290 of 314 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/hr/

* Translated using Weblate (Korean)

Currently translated at 100.0% (314 of 314 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/ko/

---------

Co-authored-by: May Kittens Devour Your Soul <yoshimitsu002@gmail.com>
Co-authored-by: nulta <un5450@naver.com>
2023-10-27 10:12:02 +08:00
Steven
58e771a1d7 chore: combine v2 services 2023-10-27 09:07:35 +08:00
Steven
e876ed3717 feat: impl part of inbox service 2023-10-27 09:01:17 +08:00
Steven
67d2e4ebcb chore: update method name 2023-10-27 08:36:43 +08:00
Steven
4ea78fa1a2 chore: impl inbox store methods 2023-10-27 08:17:58 +08:00
Steven
93b8e2211c chore: update dev latest schema 2023-10-27 01:18:00 +08:00
Steven
052216c471 chore: fix list activities typo 2023-10-27 01:11:41 +08:00
Steven
e5978a70f5 chore: initial inbox store model 2023-10-27 01:10:19 +08:00
Steven
59f0ee862d chore: fix viper default value 2023-10-27 00:49:58 +08:00
Athurg Gooth
215981dfde chore: remote context.Context pointer (#2448)
remote context.Context pointer
2023-10-26 20:21:44 +08:00
Athurg Gooth
bfdb33f26b chore: add a flag to change metric switch (#2447)
* add a flag to change metric switch

* change the default value of metric
2023-10-26 20:21:18 +08:00
Steven
5b3af827e1 chore: move common packages to internal 2023-10-26 09:02:50 +08:00
Steven
9859d77cba chore: update links 2023-10-26 09:00:36 +08:00
Athurg Gooth
064c930aed fix: validate username before create token (#2439)
Validate username before create token
2023-10-25 12:05:44 +08:00
Athurg Gooth
043357d7dc fix: list token for others failed (#2440)
Fix list token for others failed
2023-10-25 12:05:30 +08:00
Athurg Gooth
3a5deefe11 chore: disable NPM update notice while running lint (#2438)
Disable NPM update notice while running lint
2023-10-25 10:00:45 +08:00
Athurg Gooth
2c71371b29 chore: update @typescript-eslint to avoid WARNING (#2437)
Update @typescript-eslint to avoid WARNING
2023-10-25 10:00:30 +08:00
Steven
222e6b28b7 chore: update website links in readme 2023-10-25 07:43:52 +08:00
Athurg Gooth
496cde87b2 feat: list access tokens by admin (#2434)
* Allow admin user list access_tokens of anyone

* fix undefined variable

* Update api/v2/user_service.go

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2023-10-24 18:51:01 +08:00
Athurg Gooth
79bbe4b82a feat: support filter creator in /api/v2/memos (#2432)
* Add creator_id param in /api/v2/memos

* make creator_id optional
2023-10-23 21:32:58 +08:00
Zexi
035d71e07c fix: visibility translation (#2429)
* fix: visibility translation

* refactor: remove useless file

* feat: add visibility icon
2023-10-23 08:06:59 +08:00
Christopher
82effea070 tweak(web): use iconbutton for editor helpers (#2426) 2023-10-22 22:10:27 +08:00
Lincoln Nogueira
331f4dcc1b chore: update dev scripts (#2427)
- add type-gen
- remove some unused air settings
- restrict air monitoring to changed go files
2023-10-22 22:09:25 +08:00
Lincoln Nogueira
055b246857 chore: update ci (#2428)
- restrict codeql and backend tests from running on pull requests with unrelated files
- upgrade codeql: current version is generating a deprecation warning in logs
2023-10-22 22:08:38 +08:00
boojack
8fc9a318a4 chore: translated using Weblate (Portuguese (Brazil)) (#2422)
Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (314 of 314 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

Co-authored-by: Lincoln Nogueira <lincolnthalles@users.noreply.github.com>
2023-10-22 12:27:29 +08:00
MotH
9aed80a4fd feat: better tag suggestion (#2421)
Better Tag Suggestion
2023-10-22 09:15:25 +08:00
MotH
c31f306b5b fix: smaller logo file (#2418) 2023-10-22 05:51:37 +08:00
Steven
bfd2dbfee2 chore: fix update resource api 2023-10-21 12:41:55 +08:00
Steven
c42af95dd3 chore: fix update user 2023-10-21 12:22:23 +08:00
Steven
89a073adc0 chore: implement create user api v2 2023-10-21 12:19:06 +08:00
Steven
1c2d82a62f chore: remove major label 2023-10-21 09:36:50 +08:00
Steven
02f7a36fa4 chore: remove unsupported linux/arm/v7 2023-10-21 08:29:21 +08:00
Steven
a76f762196 chore: update memo share dialog 2023-10-21 08:19:25 +08:00
Steven
2c2955a229 chore: add back linux/arm/v7 2023-10-21 08:15:25 +08:00
Steven
d06d01cef2 chore: release mysql driver 2023-10-21 01:25:07 +08:00
boojack
4b91738f21 chore: translated using Weblate (Croatian) (#2413)
Translated using Weblate (Croatian)

Currently translated at 87.5% (274 of 313 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/hr/

Co-authored-by: May Kittens Devour Your Soul <yoshimitsu002@gmail.com>
2023-10-21 01:23:12 +08:00
Steven
12fd8f34be chore: fix styles 2023-10-21 01:23:21 +08:00
Steven
c2ab05d422 chore: fix member section style 2023-10-21 01:09:52 +08:00
Steven
7b25b8c1e1 feat: update daily review 2023-10-21 00:57:44 +08:00
Athurg Gooth
af7c0a76d0 fix: fail to update user's update_ts (#2410) 2023-10-20 19:10:38 +08:00
Athurg Gooth
664c9c4a7c chore: extend height of setting page (#2407)
Extend height of setting page
2023-10-20 17:41:37 +08:00
Athurg Gooth
fd5d51ee54 fix: some fields of profile leaked without auth (#2408)
* fix some fields of profile leaked without auth

* protect driver and dsn of profile
2023-10-20 17:41:21 +08:00
Steven
1b105db958 chore: fix field syntax 2023-10-20 08:52:16 +08:00
Steven
a541e8d3e3 chore: upgrade version 2023-10-20 08:49:58 +08:00
Steven
6f2ca6c87a chore: update find memo api 2023-10-20 08:48:52 +08:00
Steven
952539f817 chore: update memo editor dialog 2023-10-20 08:19:08 +08:00
Steven
c87b679f41 chore: add memo relation list 2023-10-19 21:26:38 +08:00
Baksi
e6b20c5246 chore: update Shortcuts link (#2405)
* Update Shortcuts

* Update README.md

* Update README.md
2023-10-19 04:56:59 -05:00
Athurg Gooth
0bfcff676c feat: add support for remember sign in (#2402) 2023-10-18 20:38:49 -05:00
Athurg Gooth
37601e5d03 chore: change the timeout value of golangci-lint (#2403) 2023-10-18 20:37:35 -05:00
Steven
21c70e7993 feat: update memo relations dialog 2023-10-19 00:18:07 +08:00
Athurg Gooth
22d331d6c4 chore: switch storage of selected date in DailyReview (#2399)
Switch storage of selected date in DailyReview
2023-10-18 09:06:34 -05:00
Steven
9bfb2d60b9 chore: tweak wording 2023-10-18 06:05:19 +08:00
Steven
203b2d9181 chore: fix container styles 2023-10-18 06:02:39 +08:00
boojack
ddc4566dcb chore: translated using Weblate (German) (#2396)
Translated using Weblate (German)

Currently translated at 99.6% (312 of 313 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/de/

Co-authored-by: Frank Emmerlich <femmdi2012@gmail.com>
2023-10-17 10:49:36 -05:00
Steven
1755c9dc79 chore: update button style 2023-10-17 23:49:26 +08:00
Steven
a5df36eff2 chore: update metrics 2023-10-17 23:44:16 +08:00
Athurg Gooth
e30d0c2dd0 fix: image width error while loading (#2394)
fix image width error while loading
2023-10-17 09:00:45 -05:00
boojack
213c2ea71b chore: translated with Weblate (German) (#2390)
Translated using Weblate (German)

Currently translated at 99.6% (312 of 313 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/de/

Co-authored-by: Frank Emmerlich <femmdi2012@gmail.com>
2023-10-16 11:21:11 -05:00
guopeng
73f59eaf09 fix: storage setting changed don't take effect (#2385)
* fix: Storage setting changed don't take effect

* fix: Storage setting changed don't take effect

* fix: Storage setting changed don't take effect
2023-10-16 08:07:21 -05:00
TianLun Song
c999d71455 chore: update iOS shortcut link (#2387)
* Update README.md

New shortcut for memos version 0.15.0 and above on IOS

* Update README.md

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2023-10-16 08:06:36 -05:00
Steven
5359d5a66d chore: add container-queries tailwind plugin 2023-10-14 14:13:55 +08:00
Steven
c58820fa64 chore: update username regexp 2023-10-14 13:42:27 +08:00
Steven
cfc5599334 chore: cleanup less files 2023-10-14 12:06:24 +08:00
Steven
c02f3c0a7d chore: remove less files in editor 2023-10-14 11:55:37 +08:00
Steven
dd83358850 chore: update some styles 2023-10-14 01:12:41 +08:00
Steven
d95a6ce898 chore: add ar locale item 2023-10-14 00:25:01 +08:00
boojack
7e80e14f16 chore: add Arabic from weblate (#2382)
* Added translation using Weblate (Arabic)

* Translated using Weblate (Arabic)

Currently translated at 46.6% (146 of 313 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/ar/

---------

Co-authored-by: Ali AlShaikh <Mi3LiX9@outlook.sa>
2023-10-13 11:11:56 -05:00
Steven
219304e38d chore: update frontend deps 2023-10-13 23:29:55 +08:00
Steven
20e5597104 chore: fix memo container max width 2023-10-13 23:26:56 +08:00
Athurg Gooth
ed2e299797 fix: invalid type convert in apiv2 (#2380)
fix invalid type convert in apiv2
2023-10-13 09:53:58 -05:00
boojack
bacc529391 chore: fix linter errors (#2381)
* chore: fix linter errors

* chore: update

* chore: update
2023-10-13 09:53:02 -05:00
Steven
ed1ff11e80 chore: update 2023-10-13 00:13:13 +08:00
Steven
a0f8e6987c chore: update go deps 2023-10-13 00:08:52 +08:00
Athurg Gooth
d3e32f0d5a chore: add latency in log (#2374)
* Print profile.Data in boot log

* Add latency in request log
2023-10-10 06:03:32 -05:00
Athurg Gooth
95bfcb8055 chore: print profile.Data in boot log (#2373)
Print profile.Data in boot log
2023-10-10 05:59:19 -05:00
Athurg Gooth
096c489eb3 feat: copy data between drivers (#2370)
* Add copydb command to copy data between drivers

* Check if table is empty before copy
2023-10-09 22:45:17 -05:00
boojack
b6425f9004 chore: update i18n with weblate (#2369)
* Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (315 of 315 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (315 of 315 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/

---------

Co-authored-by: Lincoln Nogueira <lincolnthalles@users.noreply.github.com>
Co-authored-by: Qing Long <longyinx@duck.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
2023-10-09 10:54:54 -05:00
Steven
ab2c86640b chore: move rate limiter to apiv1 2023-10-09 23:10:41 +08:00
Steven
1489feb054 chore: update common dialog default color 2023-10-09 23:08:52 +08:00
Steven
acdeabb861 chore: add issue template config.yml 2023-10-09 22:10:28 +08:00
Athurg Gooth
6bb6c043e5 feat: add support for ListMemoOrganizer (#2367)
* Add support for ListMemoOrganizer

* fix rows not close
2023-10-09 08:18:47 -05:00
Athurg Gooth
fa2bba51c1 feat: add support for ListActivity (#2365)
Add support for ListActivity
2023-10-09 08:18:33 -05:00
Steven
3822c26e32 chore: update memo props 2023-10-09 21:09:17 +08:00
Athurg Gooth
425b43b3bb fix: ListTag not support omit params (#2366)
fix ListTag not support omit params
2023-10-09 01:40:54 -05:00
Athurg Gooth
c00dac1bbf fix: index page failed with 429 (#2363) 2023-10-08 20:54:12 -05:00
Steven
3ff4d19782 chore: update initial global loader 2023-10-08 20:31:38 +08:00
Steven
31997936d6 chore: move resource public api 2023-10-08 19:40:30 +08:00
Athurg Gooth
287f1beb90 fix: create storage without some attributes (#2358) 2023-10-08 05:30:24 -05:00
Athurg Gooth
7680be1a2f fix: create user without some attributes (#2357) 2023-10-08 05:29:32 -05:00
Athurg Gooth
55e0fbf24e fix: create activity without some attributes (#2356) 2023-10-08 05:29:22 -05:00
Athurg Gooth
eaac17a236 fix: create memo without some attributes (#2355) 2023-10-08 05:29:12 -05:00
Athurg Gooth
1fbd568dfe fix: create resource without some attributes (#2354) 2023-10-08 05:29:03 -05:00
Athurg Gooth
c0619ef4a4 fix: CreateIdentityProvider without id (#2352) 2023-10-08 05:28:22 -05:00
Athurg Gooth
b2aa66b4fd fix: migration always in mysql (#2353) 2023-10-08 05:28:11 -05:00
boojack
dfaf2ee29c chore: update pnpm scripts (#2350)
* chore: update pnpm scripts

* chore: update development guide
2023-10-07 12:06:18 -05:00
Steven
b938c8d7b6 chore: only show comments in memo detail page 2023-10-08 00:42:02 +08:00
Steven
553de3cc7e fix: mysql syntax 2023-10-07 22:56:12 +08:00
Steven
73980e9644 chore: fix video element syntax 2023-10-07 22:01:07 +08:00
Athurg Gooth
087e631dd8 chore: optmize docker-compose.dev.yml (#2347)
Optmize docker-compose.dev.yml
2023-10-07 08:24:53 -05:00
boojack
76fb280720 chore: translated with Weblate (#2348)
Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (315 of 315 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

Co-authored-by: Qing Long <longyinx@duck.com>
2023-10-07 08:23:06 -05:00
Steven
6ffc09d86a chore: remove unused httpmeta getter api 2023-10-06 23:03:36 +08:00
白宦成
125c9c92eb chore: compress image and reduce 500kb in network (#2339)
feat: compress image and reduce 500kb in network
2023-10-06 07:45:17 -05:00
Steven
15eb95f964 chore: delete resource file synchronously 2023-10-06 19:02:40 +08:00
boojack
ed96d65645 chore: update i18n with weblate (#2338)
* Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (315 of 315 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (315 of 315 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

---------

Co-authored-by: Lincoln Nogueira <lincolnthalles@users.noreply.github.com>
Co-authored-by: Qing Long <longyinx@duck.com>
2023-10-06 05:29:50 -05:00
boojack
9c2f87ec2e chore: update i18n with weblate (#2337)
* Translated using Weblate (English)

Currently translated at 100.0% (315 of 315 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/en/

* Translated using Weblate (Portuguese (Brazil))

Currently translated at 98.4% (310 of 315 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

---------

Co-authored-by: Lincoln Nogueira <lincolnthalles@gmail.com>
2023-10-05 22:49:38 -05:00
Steven
19f6ed5530 chore: remove pr preview actions 2023-10-06 11:00:17 +08:00
Steven
57c5a92427 chore: update archived memo styles 2023-10-06 00:34:40 +08:00
Steven
9410570195 chore: update version 2023-10-06 00:34:38 +08:00
Steven
c0422dea5b chore: fix sqlite migrator 2023-10-06 00:34:06 +08:00
Steven
7791fb10d8 chore: update new db driver 2023-10-05 23:19:52 +08:00
Steven
a6ee61e96d chore: update package name 2023-10-05 23:11:29 +08:00
boojack
99d9bd2d75 chore: update i18n with weblate (#2333)
* Translated using Weblate (Dutch)

Currently translated at 85.7% (271 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/nl/

* Translated using Weblate (Portuguese (Brazil))

Currently translated at 85.4% (270 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/

* Translated using Weblate (German)

Currently translated at 88.9% (281 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/de/

* Translated using Weblate (Russian)

Currently translated at 86.7% (274 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/ru/

* Translated using Weblate (Japanese)

Currently translated at 90.8% (287 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/ja/

* Translated using Weblate (Croatian)

Currently translated at 86.3% (273 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/hr/

* Translated using Weblate (Hindi)

Currently translated at 68.0% (215 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/hi/

* Translated using Weblate (Italian)

Currently translated at 89.2% (282 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/it/

* Translated using Weblate (Korean)

Currently translated at 89.2% (282 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/ko/

* Translated using Weblate (Chinese (Traditional))

Currently translated at 90.8% (287 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hant/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 89.8% (284 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hans/

* Translated using Weblate (English)

Currently translated at 100.0% (316 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/en/

---------

Co-authored-by: Jasper Platenburg <jasperdgp@outlook.com>
Co-authored-by: memos <usememos@gmail.com>
2023-10-05 08:36:23 -05:00
boojack
e7aeca736b chore: update i18n with weblate (#2332)
* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/

* Translated using Weblate (Dutch)

Currently translated at 77.8% (246 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/nl/

* Translated using Weblate (Dutch)

Currently translated at 78.4% (248 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/nl/

* Translated using Weblate (Dutch)

Currently translated at 78.7% (249 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/nl/

* Translated using Weblate (Dutch)

Currently translated at 79.1% (250 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/nl/

* Translated using Weblate (Dutch)

Currently translated at 79.7% (252 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/nl/

* Translated using Weblate (Dutch)

Currently translated at 81.6% (258 of 316 strings)

Translation: memos-i18n/i18n
Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/nl/

---------

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Jasper Platenburg <jasperdgp@outlook.com>
2023-10-05 04:36:00 -05:00
Steven
e85f325eb2 chore: add tranlated status badge 2023-10-05 17:32:23 +08:00
Steven
7dcc5cbaf1 chore: fix mysql migrator 2023-10-05 17:11:28 +08:00
Steven
1cdd70e008 chore: update dark mode styles 2023-10-05 16:16:02 +08:00
Steven
6a11fc571d chore: update empty icon 2023-10-05 15:52:16 +08:00
Steven
771fe394fd chore: fix initial guide 2023-10-05 15:50:16 +08:00
Steven
d474d1abd0 chore: update store cache 2023-10-05 15:17:40 +08:00
Steven
576111741b chore: downgrade zustand 2023-10-05 15:13:02 +08:00
Steven
9ac44dfbd9 chore: update mui/joy version 2023-10-05 15:08:55 +08:00
Steven
110b53b899 chore: update frontend deps 2023-10-05 15:07:10 +08:00
Steven
42e8d51550 chore: update i18n 2023-10-05 15:07:03 +08:00
Steven
fd7043ea40 chore: fix editor cache 2023-10-05 14:20:35 +08:00
Steven
34ae9b0687 chore: update default storage back to database 2023-10-05 13:36:33 +08:00
Steven
077bf95425 chore: add pinned icon in status bar 2023-10-05 13:12:03 +08:00
Steven
e465b2f0e8 chore: update i18n for auth pages 2023-10-05 12:48:40 +08:00
Steven
01ff3f73f8 chore: update auth pages 2023-10-05 12:38:46 +08:00
Steven
8aae0d00cd chore: fix fetch comments 2023-10-05 08:58:44 +08:00
Steven
16dad8b00d chore: update logo 2023-10-05 08:40:25 +08:00
Steven
7dc4bc5714 chore: update resource service 2023-10-03 23:44:14 +08:00
K.B.Dharun Krishna
2e82ba50f2 chore: bump actions/checkout; actions/setup-go to v4 (#2325)
* chore: bump actions/checkout to v4

Signed-off-by: GitHub <noreply@github.com>

* chore: bump actions/setup-go to v4

Signed-off-by: GitHub <noreply@github.com>

---------

Signed-off-by: GitHub <noreply@github.com>
2023-10-03 16:58:47 +08:00
Steven
1542f3172a chore: update tag service 2023-10-03 09:39:39 +08:00
serverless83
69d575fd5b chore: update it.json translation (#2323)
Changed translation of "private" to "Privato" instead of "Privao" (missing the letter "t")

Signed-off-by: serverless83 <35410475+serverless83@users.noreply.github.com>
2023-10-02 20:01:16 -05:00
Steven
607fecf437 chore: update store tests 2023-10-03 00:47:34 +08:00
Steven
91f7839b31 chore: update memo detail styles 2023-10-03 00:25:22 +08:00
Steven
078bc164d5 chore: update memo relations view 2023-10-02 08:26:15 +08:00
Steven
70f464e6f2 chore: update frontend deps 2023-10-01 22:14:33 +08:00
Steven
e40621eb0f chore: implement memo content views 2023-10-01 22:14:25 +08:00
Steven
fd395e5661 chore: update list memo relations 2023-10-01 21:35:17 +08:00
Steven
be046cae8e chore: add parent field to memo 2023-10-01 16:27:40 +08:00
Steven
922de07751 feat: impl memo comment api 2023-10-01 14:44:10 +08:00
Steven
7549c807ac chore: update memo view activity 2023-10-01 14:14:33 +08:00
Steven
de5eccf9d6 chore: update icon styles 2023-09-30 02:06:30 +08:00
Steven
952225d1da chore: add back to top button 2023-09-30 02:04:13 +08:00
steven
a928c4f845 chore: update error format 2023-09-29 13:04:54 +08:00
Johan
73e189ea61 chore: update fr.json (#2304)
* Update fr.json

Updated some translations

Signed-off-by: Johan <45337552+LittleJ@users.noreply.github.com>

* Apply suggestions from code review

Signed-off-by: boojack <stevenlgtm@gmail.com>

---------

Signed-off-by: Johan <45337552+LittleJ@users.noreply.github.com>
Signed-off-by: boojack <stevenlgtm@gmail.com>
Co-authored-by: boojack <stevenlgtm@gmail.com>
2023-09-29 04:51:14 +00:00
steven
8168fb71a8 chore: update migrator 2023-09-29 12:47:49 +08:00
Steven
87ddeb2c79 chore: adjust store test for mysql 2023-09-29 09:15:54 +08:00
Athurg Gooth
255254eb69 feat: add some dev tools in the docker compose (#2309)
* Add some dev tools in the docker compose

* Merge tsc and lint
2023-09-28 14:54:11 +00:00
Athurg Gooth
c72f221fc0 feat: support mysql as backend storage driver (#2300)
* Rename checkDSN to checkDataDir

* Add option to set DSN and db driver

* Add mysql driver skeleton

* Add mysql container in compose for debug

* Add basic function for mysql driver

* Cleanup go mod with tidy

* Cleanup go.sum with tidy

* Add DeleteUser support for mysql driver

* Fix UpdateUser of mysql driver

* Add DeleteTag support for mysql driver

* Add DeleteResource support for mysql driver

* Add UpdateMemo and DeleteMemo support for mysql driver

* Add MemoRelation support for mysql driver

* Add MemoOrganizer support for mysql driver

* Add Idp support for mysql driver

* Add Storage support for mysql driver

* Add FindMemosVisibilityList support for mysql driver

* Add Vacuum support for mysql driver

* Add Migration support for mysql driver

* Add Migration support for mysql driver

* Fix ListMemo failed with referece

* Change Activity.CreateTs type in MySQL

* Change User.CreateTs type in MySQL

* Fix by golangci-lint

* Change Resource.CreateTs type in MySQL

* Change MigrationHistory.CreateTs type in MySQL

* Change Memo.CreateTs type in MySQL
2023-09-28 09:09:52 -05:00
CorrectRoadH
4ca2b551f5 chore: update seed data (#2311) 2023-09-28 09:03:32 -05:00
Athurg Gooth
5b6b2f0528 fix: apiv2 failed in container (#2307) 2023-09-28 05:45:45 -05:00
Steven
fbbfb11916 chore: adjust memo elements 2023-09-28 08:59:55 +08:00
Steven
c54febd024 chore: fix reset script 2023-09-27 18:55:26 +08:00
Athurg Gooth
5ebf920a61 chore: stop process on build error (#2295)
* Move migration and seed code into driver

* Stop process on build error
2023-09-27 11:56:39 +08:00
Athurg Gooth
5121e9f954 chore: move migration and seed code into driver (#2294)
Move migration and seed code into driver
2023-09-27 11:56:20 +08:00
Athurg Gooth
ca98367a0a chore: store vacuum and clean (#2293)
* Move all vacuum code into driver

* Remove db from Store
2023-09-26 20:27:31 -05:00
Steven
9abf294eed chore: update seed data 2023-09-27 09:13:56 +08:00
Athurg Gooth
9ce22e849c chore: move SQL code of Memo into Driver (#2292) 2023-09-27 00:57:12 +00:00
Athurg Gooth
58b84f83d1 chore: move SQL code of MemoOrganizer into Driver (#2291) 2023-09-26 19:54:50 -05:00
Athurg Gooth
acbde4fb2d chore: move SQL code of MemoRelation into Driver (#2290) 2023-09-26 19:43:46 -05:00
Steven
53090a7273 chore: show unused resources in dashboard 2023-09-27 08:09:30 +08:00
Steven
71ee299de7 chore: drop shortcut 2023-09-27 07:28:17 +08:00
Steven
9d1c9fc505 chore: regenerate swagger docs 2023-09-27 00:52:42 +08:00
Steven
03a0972712 chore: rename sqlite entry file name 2023-09-27 00:51:16 +08:00
Steven
0bddbba00e chore: fix frontend linter 2023-09-27 00:45:15 +08:00
Steven
6007f48b7d chore: retire memo resource relation table 2023-09-27 00:40:16 +08:00
Steven
4f10198ec0 chore: add tooltip to icon buttons 2023-09-26 23:48:34 +08:00
Steven
7722c41680 chore: add edit button to memo detail page 2023-09-26 23:46:58 +08:00
Steven
7cdc5c711c chore: update key of daily memo 2023-09-26 23:34:35 +08:00
Steven
4180cc3a3d refactor: migrate storage to driver 2023-09-26 19:43:55 +08:00
Steven
d6789550a0 refactor: migrate tag to driver 2023-09-26 19:37:22 +08:00
Steven
d68da34eec refactor: migrate idp to driver 2023-09-26 19:17:17 +08:00
Steven
63b55c4f65 chore: fix tests 2023-09-26 19:15:18 +08:00
Steven
96395b6d75 chore: rename package sqlite3 to sqlite 2023-09-26 19:07:14 +08:00
Athurg Gooth
d3a6fa50d6 chore: move sql code of Resource into driver (#2286)
Move sql code of Resource into driver
2023-09-26 19:04:07 +08:00
May Kittens Devour Your Soul
47f22a20ba chore: update Croatian (#2283)
* Add files via upload

Signed-off-by: May Kittens Devour Your Soul <yoshimitsu002@gmail.com>

* Update hr.json

Signed-off-by: May Kittens Devour Your Soul <yoshimitsu002@gmail.com>

* Update hr.json

Signed-off-by: May Kittens Devour Your Soul <yoshimitsu002@gmail.com>

* Delete web/src/css/prism.css

Signed-off-by: boojack <stevenlgtm@gmail.com>

---------

Signed-off-by: May Kittens Devour Your Soul <yoshimitsu002@gmail.com>
Signed-off-by: boojack <stevenlgtm@gmail.com>
Co-authored-by: boojack <stevenlgtm@gmail.com>
2023-09-26 19:03:50 +08:00
Athurg Gooth
14ec524805 chore: move sql code of UserSetting into Driver (#2282)
* Move SQL code of UserSetting into Driver

* Fix golang import issue
2023-09-26 19:02:48 +08:00
Athurg Gooth
fcba3ffa26 chore: move sql code of User into driver (#2281)
Move SQL code of User into Driver
2023-09-26 18:23:45 +08:00
Athurg Gooth
41eba71f0f chore: split sql to driver (#2279)
* Add new database interface for SQL operations

* Move SQL code of Activity into Database

* Rename `Database` into `Driver`

* Move SQL code of SystemSetting into Driver

* Fix store.New in text code

* Change database into driver in the variables

* Change sqlite3.New into sqlite3.NewDriver
2023-09-26 17:16:58 +08:00
Steven
85ed0202d8 chore: fix user request cache 2023-09-25 20:52:29 +08:00
Steven
745902e8b1 chore: update access token order 2023-09-25 20:14:01 +08:00
Steven
ad3487a9ac chore: update username matcher 2023-09-25 20:03:58 +08:00
Steven
8c2f89edc5 chore: update demo username 2023-09-25 09:10:39 +08:00
Steven
6cff920f0c chore: update user demo data 2023-09-23 20:41:47 +08:00
Steven
27f3f6fbf0 chore: upgrade version 2023-09-23 20:41:42 +08:00
Steven
89c24415a6 chore: update not found page 2023-09-23 20:39:01 +08:00
Steven
0d803bf45f chore: update dark mode styles 2023-09-23 20:30:47 +08:00
Steven
d4e54f343d feat: update memo detail page 2023-09-23 20:14:07 +08:00
Steven
08a81e79dd chore: update frontend deps 2023-09-23 17:55:26 +08:00
Steven
cad789e948 chore: update frontend deps 2023-09-21 23:41:05 +08:00
Steven
4de18cfab1 chore: remove unused deps 2023-09-20 21:24:46 +08:00
Steven
5cec1a71da chore: update access token generator 2023-09-20 20:48:34 +08:00
Steven
ae1e22931f chore: auto remove current access token when sign out 2023-09-20 19:24:26 +08:00
Steven
a60d4dee41 chore: remove lazy loading image 2023-09-19 23:06:30 +08:00
Steven
7da10cd367 chore: update telegram integration folder 2023-09-19 22:35:20 +08:00
Steven
6d45616dbe chore: add cors middleware 2023-09-19 20:34:25 +08:00
Fabian Wünderich
ad326147f1 chore: fix typo in german localization (#2256)
Fix typo in german localization

Signed-off-by: Fabian Wünderich <fabian@wuenderich.de>
2023-09-19 20:21:32 +08:00
Steven
465b173b36 chore: fix resource int type 2023-09-19 09:05:34 +08:00
Steven
9bf1979fa8 fix: list resources 2023-09-19 08:24:24 +08:00
Steven
0a811e19ba chore: remove arm/v7 form platforms 2023-09-19 00:34:27 +08:00
Steven
e119acb0e9 chore: remove unused platform of test image 2023-09-19 00:08:58 +08:00
Steven
0f1e87bd93 chore: update test image platforms 2023-09-18 23:28:28 +08:00
Steven
f9f2f549af chore: update dockerfile 2023-09-18 23:23:13 +08:00
Steven
d665adf78b chore: remove outdate build artifacts action 2023-09-18 22:56:39 +08:00
Steven
1c27824e58 chore: upgrade version 2023-09-18 22:54:44 +08:00
Steven
14adcb56da chore: update resource description 2023-09-18 22:46:24 +08:00
Steven
b452d63fa6 chore: skip compose memo error 2023-09-18 22:41:49 +08:00
Steven
e2b82929ab chore: fix daily review params 2023-09-18 22:38:52 +08:00
Steven
8fbd33be09 chore: update username matcher 2023-09-18 22:37:13 +08:00
Steven
bff41a8957 fix: invalid username checks 2023-09-18 22:34:31 +08:00
Steven
2375001453 chore: fix acl interceptor 2023-09-18 21:50:59 +08:00
Zeng1998
462f10ab60 feat: optimize the logic of the checkbox button. (#2227) 2023-09-18 20:37:28 +08:00
Vespa314
58026c52ea fix: heatmap show on wrong date (#2243)
fix: heatmap show wrong date
2023-09-18 13:53:16 +08:00
victorsch
97b434722c fix: content sanitization in getimage endpoint (#2241) 2023-09-18 12:45:26 +08:00
Steven
b22d236b19 chore: update golangci-lint version 2023-09-17 23:21:03 +08:00
Steven
cc809a5c06 chore: update github action trigger 2023-09-17 23:18:18 +08:00
Steven
cd0ea6558d chore: update golangci-lint config 2023-09-17 22:55:13 +08:00
Steven
9eb077c4af chore: update service clients 2023-09-17 21:12:23 +08:00
Steven
6eeee6b704 docs: add buf to development guide 2023-09-17 20:56:03 +08:00
boojack
b13042d644 chore: move buf generated code to gitignore (#2236) 2023-09-17 20:55:05 +08:00
Steven
d09e3c3658 chore: remove buf es generator 2023-09-17 20:14:45 +08:00
Steven
72ca4e74ee refactor: impl part of grpcweb 2023-09-17 19:20:03 +08:00
Steven
d5c1706e9c chore: update api middlewares 2023-09-17 18:11:13 +08:00
Steven
3a1f82effa fix: migration script 2023-09-16 14:10:51 +08:00
Steven
a3d7cc9392 fix: migration script 2023-09-16 14:01:05 +08:00
Steven
178a5c0130 chore: upgrade version to 0.15.0 2023-09-16 12:46:26 +08:00
Steven
b233eaea97 chore: update docs link 2023-09-16 12:25:57 +08:00
Steven
51137e01ef chore: update resource description 2023-09-16 11:53:16 +08:00
Steven
fb1490c183 feat: impl resources list page 2023-09-16 11:48:53 +08:00
Steven
4424c8a231 chore: add resource service definition 2023-09-16 00:11:07 +08:00
Steven
723e6bcdae refactor: update resources page 2023-09-15 22:25:07 +08:00
Steven
d1156aa755 chore: update account setting styles 2023-09-15 22:09:51 +08:00
Steven
4e49d3cb22 chore: update frontend deps 2023-09-15 21:50:50 +08:00
Athurg Gooth
13c7871d20 chore: update vite dev server proxy setting (#2222)
fix vite proxy setting to keep the request headers
2023-09-15 21:49:34 +08:00
Athurg Gooth
137c8f8a07 chore: better date picker (#2220)
* Add buttons to increase year in DatePicker

* Show month with padding 0 to keep DatePicker size
2023-09-15 21:48:52 +08:00
Athurg Gooth
0c0c72c3ca chore: optimize layout of image resources (#2221)
Optimize layout of image resource
2023-09-15 17:58:17 +08:00
steven
e6a90a8be8 chore: register reflection grpc server 2023-09-15 17:57:45 +08:00
Steven
e65282dcc5 chore: fix user state loader 2023-09-15 09:10:16 +08:00
Steven
28a1888163 chore: fix user seed data 2023-09-15 08:55:18 +08:00
Steven
8824ee9b9d chore: fix user state loader 2023-09-15 08:43:52 +08:00
Steven
936fe5ac9d chore: update state initial loader 2023-09-15 08:31:19 +08:00
Steven
f5802a7d82 chore: update access token ui 2023-09-15 08:18:30 +08:00
Steven
33d9c13b7e chore: remove openid field from user 2023-09-14 22:57:27 +08:00
Steven
42bd9b194b feat: impl user access token api 2023-09-14 20:16:17 +08:00
Athurg Gooth
41e26f56e9 chore: persist selected date of DailyReview page (#2219)
* Persist selected date of DailyReview page

* Use hook useLocalStorage instead of useState

* Update web/src/pages/DailyReview.tsx

Co-authored-by: boojack <stevenlgtm@gmail.com>
Signed-off-by: Athurg Gooth <athurg@gooth.org>

---------

Signed-off-by: Athurg Gooth <athurg@gooth.org>
Co-authored-by: boojack <stevenlgtm@gmail.com>
2023-09-14 19:57:44 +08:00
Steven
14aa3224ce chore: add readme about protobuf 2023-09-14 19:21:21 +08:00
Steven
8a796d12b4 chore: add user access token setting definition 2023-09-14 19:18:54 +08:00
Athurg Gooth
c87df8791b chore: optimize performance of /memo/stats (#2218)
Optimize performance of /memo/stats
2023-09-14 14:18:29 +08:00
Steven
f0f42aea9f chore: fix react use imports 2023-09-13 22:56:02 +08:00
Athurg Gooth
626ff5e3a7 feat: notify by telegram while new memo create by HTTP (#2215)
* Inject telegram bot into API service

* Add support for send telegram message

* Send notification by telegram while new memo post
2023-09-13 21:36:43 +08:00
Steven
36209eaef1 feat: add content cache for memo editor 2023-09-13 21:32:21 +08:00
Steven
d63715d4d9 feat: implement list memos filter 2023-09-13 20:42:44 +08:00
Kada Liao
9600fbb609 fix: multiple inline latex parsing (#2214) 2023-09-13 17:58:52 +08:00
Steven
04595a5fb1 chore: update resource icons 2023-09-13 09:12:51 +08:00
Kada Liao
9a0ada6756 feat: support LaTeX with react-katex (#2209)
feat: support latex

Co-authored-by: liaoxingyi <liaoxingyi@douban.com>
2023-09-12 23:53:46 +08:00
Steven
416e07cb1f fix: inject additional style and scripts 2023-09-12 23:43:32 +08:00
Steven
58429f88a0 fix: memo filter in daily review 2023-09-12 23:38:13 +08:00
Steven
439d88f06b chore: fix user avatar style 2023-09-12 23:35:10 +08:00
Steven
d165ad187c chore: pnpm update 2023-09-12 08:25:57 +08:00
Steven
319f679e30 chore: fix timestamp type 2023-09-10 23:52:35 +08:00
Steven
b6d1ded668 chore: adjust initial states 2023-09-10 23:44:06 +08:00
Steven
3ad0832516 chore: use user v2 api in frontend 2023-09-10 22:03:12 +08:00
Steven
93f062d0b9 chore: update user v2 api 2023-09-10 18:56:24 +08:00
Steven
866937787c chore: clean duplicated requests 2023-09-10 11:43:38 +08:00
Steven
ca336af4fa chore: update locale checks 2023-09-10 10:53:37 +08:00
Steven
7ec5d07cb8 chore: remove fullscreen button 2023-09-10 10:48:08 +08:00
Steven
2e79fe12e2 chore: remove helm folder 2023-09-10 10:39:46 +08:00
Steven
3df550927d chore: update user profile page 2023-09-10 10:33:22 +08:00
Willian Ricardo Da Silva
44be7201c0 chore: update pt-BR.json (#2196)
* chore: update pt-BR.json

* update import order
2023-09-07 09:23:12 +08:00
boojack
0d50f5bd08 chore: update comments (#2195) 2023-09-06 21:59:20 +08:00
boojack
8b1f7c52aa choer: add system setting api (#2194) 2023-09-06 21:54:12 +08:00
Athurg Gooth
9987337eca fix: all ID from int to int64 to avoid 32bits machine break (#2191)
Fix all ID from int to int64 to avoid 32bits machine break
2023-09-06 21:14:07 +08:00
Takuro Onoue
87a1d4633e chore: update ja.json (#2192)
* Update ja.json

I added the missing lines and translated.

* Update ja.json

I forgot to remove the comma at the end of the column.
I translated the untranslated portions.
2023-09-06 21:10:42 +08:00
boojack
c2aeec20b7 chore: upgrade deps version (#2181) 2023-08-27 16:08:39 +08:00
boojack
a5b3fb2a6a chore: move cron package to internal (#2180) 2023-08-26 23:13:03 +08:00
boojack
c67a69629e chore: update user menu items (#2179) 2023-08-26 23:11:45 +08:00
boojack
18fb02a1ec chore: update swag docs (#2178)
* chore: update swag docs

* chore: update
2023-08-26 08:07:43 +08:00
boojack
ad1822d308 chore: update db utils (#2177) 2023-08-26 07:33:45 +08:00
boojack
4af0d03e93 chore: add user profile page (#2175)
chore: some enhancements
2023-08-25 23:10:51 +08:00
boojack
8c312e647d chore: remove auto collapse setting (#2169) 2023-08-24 22:00:48 +08:00
boojack
d3bd3ddab0 chore: update some detail styles (#2168)
* chore: update some detail styls

* chore: update
2023-08-24 21:52:16 +08:00
Sandu Liviu Catalin
6c01e84099 feat: add configuration option to bind server to specific address (#2165) 2023-08-24 09:59:23 +08:00
boojack
b9b795bf0e chore: add react use (#2157)
* chore: add react use

* chore: update
2023-08-21 02:35:53 +08:00
boojack
19e7731abb chore: generate ts definition (#2156)
* chore: generate ts definition

* chore: update
2023-08-21 02:09:41 +08:00
ti777777
609b24f2ba chore: update zh-Hant.json (#2155)
Update zh-Hant.json

* removed unused entries
* updated the Traditional Chinese translation
2023-08-20 09:18:38 +08:00
Maciej Kasprzyk
735cfda768 fix: tag suggestions positioning (#2151) 2023-08-18 08:41:24 +08:00
Lincoln Nogueira
3f82729e9f chore: update build scripts (#2150)
update developer build scripts, bringing
feature parity between platforms.
2023-08-17 05:40:40 +08:00
Maciej Kasprzyk
077cfeb831 feat: improve tag suggestions (#2126)
* feat: make filtering case insensitive

* fix: wrong letter case when accepting suggestion

* refactor: wrap textarea in TagSuggestions

* fix: less styles not matching common-editor-inputer

* refactor: use explanatory const names for tested value in conditional checks

* feat: style highlighted option

* feat: handle down/up arrow keys

* feat: handle enter or tab to trigger autocomplete

* fix: wrong import

* fix: tab key adding whitespace after auto-completion

* fix: starting a note with a tag

* fix: close on escape

* refactor: early version of removed wrapping and children prop

* refactor: remove unnecessary return false

* refactor: finished rewriting to not wrap editor
2023-08-16 08:54:30 +08:00
boojack
95588542f9 chore: upgrade version to 0.14.4 (#2132) 2023-08-13 23:34:17 +08:00
boojack
dd529f845a fix: fetch tags in memo editor (#2131)
fix: fetch tag
2023-08-13 23:27:01 +08:00
boojack
9f8a0a8dd3 fix: lazy rendering checks (#2130) 2023-08-13 23:19:29 +08:00
boojack
e266d88edd chore: add acl config (#2128) 2023-08-13 00:06:03 +08:00
YuzeTT
0bb5f7f972 chore: update zh-Hans.json (#2127) 2023-08-12 21:34:01 +08:00
OKIAAAAA
012a5f4907 feat: add helm chart (#2095)
* add helm chart

* fix: remove unnecessary documents
2023-08-12 21:33:13 +08:00
YuNing Chen
409d686f7d chore: minor cleanup (#2124) 2023-08-11 22:34:08 +08:00
Jianwei Zhang
c835231d32 feat: add header into resource response (#2120)
Update - add header for get resource
2023-08-10 23:45:30 +08:00
boojack
723c444910 chore: update server tests (#2118) 2023-08-10 09:01:38 +08:00
boojack
35f2d399e2 chore: update api v1 docs (#2117)
* chore: update apiv1 docs

* chore: update
2023-08-09 22:30:27 +08:00
Lincoln Nogueira
4491c75135 feat: add SwaggerUI and v1 API docs (#2115)
* - 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
2023-08-09 21:53:06 +08:00
Chris Akring
513002ff60 chore: update zh-Hans translations for "Tag suggestions" (#2110) 2023-08-08 19:12:04 +08:00
boojack
9693940010 chore: update en locale (#2109) 2023-08-08 07:29:29 +08:00
Moris
8747c58c7d feat: fixed heat map colors, updated it.json (#2106)
* Update it.json

* Add files via upload

* Add files via upload
2023-08-08 07:13:35 +08:00
nulta
0fd791c02d feat: update Korean localization (#2105)
Update korean localization
2023-08-08 07:12:57 +08:00
Jasper Platenburg
3a804ce012 feat: update Dutch translation (#2107) 2023-08-08 07:12:43 +08:00
Ghost108
f864ec3730 chore: update de.json (#2101)
* Update de.json

I used the en.json as a template and translated it (german language)

* Update de.json

* Update de.json

* Update de.json

* Update de.json

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2023-08-07 20:09:48 +08:00
Chris Akring
9503f73115 feat: use user avatar in ShareMemoDialog (#2102)
fix: ShareMemoDialog use user avata
2023-08-07 19:40:43 +08:00
Derek Reiff
f9d1080a7d fix: minor spelling and wording changes for en and de (#2096)
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.
2023-08-07 11:26:57 +08:00
boojack
4d3e4358e8 chore: update docs (#2094) 2023-08-06 11:25:35 +08:00
boojack
843850675f chore: update image displays (#2093) 2023-08-06 10:42:30 +08:00
boojack
726300394b chore: update image checks (#2092) 2023-08-06 10:38:39 +08:00
boojack
5d5d8de9fe fix: get all memo api (#2091) 2023-08-06 10:14:30 +08:00
boojack
e097e8331e chore: upgrade version 0.14.3 (#2086) 2023-08-05 22:47:29 +08:00
boojack
7189ba40d3 feat: add lazy rendering in home page (#2085) 2023-08-05 22:14:17 +08:00
boojack
218159bf83 chore: remove openai setting section (#2084) 2023-08-05 21:39:12 +08:00
boojack
238f896907 feat: add system service (#2083)
* feat: add system service

* chore: update
2023-08-05 21:30:23 +08:00
boojack
270a529948 chore: update resource type checks (#2081) 2023-08-05 20:17:33 +08:00
boojack
cc400da44e fix: remove translate hook in code block (#2080) 2023-08-05 20:01:32 +08:00
boojack
3df9da91b4 chore: update get memo api (#2079) 2023-08-05 19:51:32 +08:00
boojack
57dd1fc49f chore: initial memo service definition (#2077)
* chore: initial memo service definition

* chore: update

* chore: update

* chore: update
2023-08-05 09:32:52 +08:00
boojack
7c5296cf35 chore: update id type to int32 (#2076) 2023-08-04 21:55:07 +08:00
boojack
cbe27923b3 chore: update commands (#2074) 2023-08-03 23:48:21 +08:00
boojack
aa26cc30d7 chore: remove memo chat components (#2073) 2023-08-03 23:37:46 +08:00
boojack
1ce82ba0d6 chore: remove shortcut related api (#2072) 2023-08-03 23:33:45 +08:00
boojack
d1b0b0da10 chore: remove shortcuts in frontend (#2071) 2023-08-03 23:28:38 +08:00
Athurg Gooth
11abc45440 feat: add command to move blob from local to db (#2026)
* Add `mvrss` command to move blob from local to db

* Add comment for mvrss command
2023-08-03 19:08:39 +08:00
boojack
b5a6f1f997 chore: regenerate pnpm lock file (#2056)
* chore: regenerate pnpm lock file

* chore: update

* chore: update
2023-08-02 20:20:34 +08:00
boojack
d114b630d2 feat: add prettier sort import plugin (#2058) 2023-07-31 22:26:45 +08:00
boojack
5f819fc86f chore: update auth middleware (#2057)
* chore: update auth middleware

* chore: update

* chore: update
2023-07-31 20:55:40 +08:00
boojack
cc3a47fc65 feat: impl auth interceptor (#2055)
* feat: impl auth interceptor

* chore: update

* chore: update

* chore: update
2023-07-30 23:49:10 +08:00
Maciej Kasprzyk
5d3ea57d82 feat: tag suggestions (#2036)
* feat: figure out how to read caret position

* feat: figure out how to read caret position

* feat: create and style Editor/TagSuggestions.txs

* feat: progress on detect when to show and hide

* feat: progress on when to show and hide and setting position

* feat: toggling and exact placement done

* fix: pnpm lock problems

* feat: filter suggestions by partially typed tag name

* style: prettier

* chore: add types package for textarea-caret

* feat: handle option click

* style: prettier

* style: reorder imports

Co-authored-by: boojack <stevenlgtm@gmail.com>

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2023-07-30 22:55:45 +08:00
Lilith
c1cbfd5766 feat: add system setting to disable password-based login (#2039)
* system setting to disable password login

* fix linter warning

* fix indentation warning

* Prohibit disable-password-login if no identity providers are configured

* Warnings and explicit confirmation when en-/disabling password-login

- Disabling password login now gives a warning and requires a second
  confirmation which needs to be explicitly typed.
- (Re)Enabling password login now also gives a simple warning.
- Removing an identity provider while password-login is disabled now
  also warns about possible problems.

* Fix formatting

* Fix code-style

---------

Co-authored-by: traumweh <5042134-traumweh@users.noreply.gitlab.com>
2023-07-30 21:22:02 +08:00
boojack
9ef0f8a901 feat: add user setting field (#2054) 2023-07-30 09:53:24 +08:00
boojack
470fe1df49 feat: implement part of user service (#2053)
* feat: implement part of user service

* chore: update

* chore: update
2023-07-30 01:35:00 +08:00
boojack
2107ac08d7 chore: add docs generator (#2052) 2023-07-30 00:12:16 +08:00
boojack
89ba2a6540 feat: implement part of tag service (#2051)
* feat: add grpc gateway tempalte

* chore: update

* chore: move directory

* chore: update
2023-07-30 00:00:49 +08:00
boojack
9cedb3cc6c chore: update github actions (#2050) 2023-07-29 20:59:22 +08:00
boojack
d0cfb62f35 chore: add tag service proto definition (#2049)
* chore: add tag proto definition

* chore: rename
2023-07-29 20:52:45 +08:00
boojack
9abf0eca1b feat: add buf configuration files and example proto (#2048)
* feat: add proto and buf configuration files

* chore: buf generate

* chore: update comments

* chore: go mod tidy
2023-07-29 19:44:09 +08:00
boojack
a6a1898c41 refactor: user v1 store (#2047) 2023-07-29 18:57:09 +08:00
boojack
f5793c142c revert: chore: update build docker image actions (#2046)
Revert "chore: update build docker image actions (#2045)"

This reverts commit 8f37c77dff.
2023-07-29 16:09:00 +08:00
boojack
8f37c77dff chore: update build docker image actions (#2045) 2023-07-29 15:59:23 +08:00
Gerald
28aecd86d3 fix: avoid content flash on auto collapse (#2042) 2023-07-29 09:04:34 +08:00
Gerald
95675cdf07 fix: show full content in detail page (#2041)
fix #1373 again
2023-07-28 15:52:50 +00:00
boojack
8328b5dd4a chore: upgrade version to 0.14.2 (#2035)
* chore: upgrade version to `0.14.2`

* chore: remove TestConcurrentReadWrite test
2023-07-26 22:42:38 +08:00
boojack
d8d6de9fca fix: get user by username api (#2034) 2023-07-26 22:41:21 +08:00
boojack
56c321aeaa revert: fix: exclude all punctuation chars except underscore in tags (#2033)
Revert "fix: exclude all punctuation chars except underscore in tags (#1974)"

This reverts commit 8c61531671.
2023-07-26 21:11:13 +08:00
Takuro Onoue
756e6a150c chore: update ja.json (#2032)
I think free means freedom, not freemiam.

Fixed some strange expressions in the heatmap section.

Added spaces before and after English words that are in Japanese sentences.
2023-07-26 20:53:14 +08:00
Takuro Onoue
828984c8ec chore: update ja.json (#2030)
Update ja.json

translated one part.
2023-07-26 08:57:53 +08:00
Harry Tran
9da0ca5cb3 feat: add search bar in archived and explore pages (#2025)
* feat: add search bar in archived and explore pages

* Update web/src/pages/Archived.tsx

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2023-07-24 11:09:30 +00:00
iMaeGoo
dc5f82ac9c feat: update chinese translate (#2023) 2023-07-24 19:08:46 +08:00
Ajay Kumbhare
d000083b41 fix: hashtag filter for Unicode characters (#2017) 2023-07-23 19:17:18 +08:00
Mason Sun
a9eb605b0f fix: auth api json format (#2021)
Update auth.go

api/v1/auth/相关接口未应用convertUserFromStore方法,会导致User对象获得类型存在问题,导致User定义的`json:`相关的字段转化失效。
导致输出json未被正确格式化
2023-07-23 19:11:29 +08:00
Ajay Kumbhare
5604129105 fix: empty state display issue with resourceList style Grid (#2018) 2023-07-23 19:10:33 +08:00
boojack
04b7a26c03 chore: fix request path (#2014) 2023-07-23 10:12:13 +08:00
boojack
28203bbaf9 chore: fix rss route (#2010) 2023-07-22 21:51:05 +08:00
boojack
9138ab8095 fix: rss route (#2008)
* fix: rss route

* chore: update
2023-07-22 12:58:17 +08:00
boojack
4231ec5a1a chore: upgrade version to 0.14.1 (#2004) 2023-07-22 09:58:03 +08:00
Ajay Kumbhare
55975a46d8 feat: add hindi language translation for i18n support (#2001) 2023-07-22 09:38:54 +08:00
Alexandr Tumaykin
1182545448 fix: add resource.clear to translate (#1999)
Co-authored-by: Александр Тумайкин <AATumaykin@tsum.ru>
2023-07-21 17:07:05 +08:00
Takuro Onoue
9f3c3ae094 chore: update ja.json (#1996)
It is strange to translate "about" as "Notes について". However, if we define "について" as "about", the sentence becomes "について Memos". It is better not to translate here.
2023-07-21 10:38:06 +08:00
boojack
4c33d8d762 chore: remove unused transaction in store (#1995)
* chore: remove unused transaction in store

* chore: update
2023-07-20 23:15:56 +08:00
Lincoln Nogueira
c8961ad489 fix: database is locked (#1992)
* fix: database is locked

The option "_journal_mode=WAL" is currently *not* being applied when
provided in the DSN.

This issue affects only new memos installations, not older ones where
the database journal was properly set to WAL mode by the previous sqlite
library go-sqlite3.

modernc.org/sqlite DSN parsing is different from go-sqlite3. It requires
the `_pragma=` prefix and even some options order matter.

https://gitlab.com/cznic/sqlite/-/issues/115

Closes #1985

* chore: upgraded notes on sqlite DSN
2023-07-20 20:51:25 +08:00
Alexandr Tumaykin
f91f09adea feat: use username instead of uid (#1977)
* #1916 replace userId to username

* resolve

---------

Co-authored-by: Александр Тумайкин <AATumaykin@tsum.ru>
2023-07-20 19:48:39 +08:00
Athurg Gooth
336b32004d feat: add AutoBackupInterval in SystemSetting (#1989)
Add AutoBackupInterval in SystemSetting page
2023-07-19 21:39:21 +08:00
Jerry Wang
7b5c13b712 fix: delete multiple resources
* fix: delete multiple resources, close #1986

* chore: remove useless comment
2023-07-19 21:36:02 +08:00
Jianwei Zhang
8bcc2bd715 fix: access token will expired after 24h (#1988) 2023-07-19 08:45:30 +08:00
Ajay Kumbhare
83b771d5cd fix: disable selection of future dates in daily review section (#1983)
* #1952 Fix incorrect localization key for sign-up failure message

* feat: add typeScript support to enforce valid translation keys

* feat: add typeScript support to enforce valid translation keys

* fix lint errors

* fix lint error

* chore: Disallow destructuring 't' from useTranslation

This commit adds a linting rule to disallow the destructuring of the 't' property from the result of the useTranslation function call. The no-restricted-syntax rule in the ESLint configuration has been updated to enforce this restriction. The intention is to promote alternative approaches like using the useTranslate hook for localization.

* fix: typo fixed for memoChat

* fix: copy code button toast message

Refactored the code for the "Copy Code" button to utilize i18 strings for displaying the success message. Replaced the hard-coded value with the appropriate i18 string "Code copied successfully."

* fix: #1980 disable selection of future dates in daily review section
2023-07-18 22:21:08 +08:00
EINDEX
8dbc63ed56 docs: add rowStatus parameter for memo api document (#1984)
add missing parameters for memo api
2023-07-18 22:20:22 +08:00
Felipe Martínez
8c61531671 fix: exclude all punctuation chars except underscore in tags (#1974)
* Change tag regex

* Update tests

* Add more tag tests
2023-07-18 01:53:07 +08:00
Ajay Kumbhare
b5d4b8eae8 fix: copy code button toast message (#1979)
* #1952 Fix incorrect localization key for sign-up failure message

* feat: add typeScript support to enforce valid translation keys

* feat: add typeScript support to enforce valid translation keys

* fix lint errors

* fix lint error

* chore: Disallow destructuring 't' from useTranslation

This commit adds a linting rule to disallow the destructuring of the 't' property from the result of the useTranslation function call. The no-restricted-syntax rule in the ESLint configuration has been updated to enforce this restriction. The intention is to promote alternative approaches like using the useTranslate hook for localization.

* fix: typo fixed for memoChat

* fix: copy code button toast message

Refactored the code for the "Copy Code" button to utilize i18 strings for displaying the success message. Replaced the hard-coded value with the appropriate i18 string "Code copied successfully."
2023-07-18 00:16:55 +08:00
Alexandr Tumaykin
e36e5823cd feat(security): disable access for anonymous users, when disablePublicMemos is true (#1966) 2023-07-17 09:12:53 +08:00
Ajay Kumbhare
4ac63ba1f0 chore: disallow destructuring 't' from useTranslation (#1973) 2023-07-16 21:26:26 +08:00
boojack
589b104671 chore: upgrade version to v0.14.0 (#1970)
* chore: upgrade version

* chore: update

* chore: update
2023-07-16 13:48:10 +08:00
boojack
220cba84ae chore: add dev guard for memo chat (#1968) 2023-07-16 13:02:52 +08:00
CorrectRoadH
032509ddba feat: save message to memo (#1940)
* feat: implment backend function

* feat: implment frontend component

* stash

* eslint

* eslint

* eslint

* delete node

* stash

* refactor the style

* eslint

* eslint

* eslint

* fix build error

* stash

* add dep

* feat: save message as memos

* eslint

* eslint

* Update web/src/components/MemosChat/MemosChatMessage.tsx

Co-authored-by: boojack <stevenlgtm@gmail.com>

* stash

* eslint

* eslint

* chore: change translate

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2023-07-16 11:51:30 +08:00
5idereal
054ef3dc8d chore: update Traditional Chinese translation (#1967) 2023-07-16 10:19:08 +08:00
boojack
2effacd0a6 chore: add api docs (#1965) 2023-07-15 23:30:20 +08:00
boojack
01f4780655 chore: update detail styles (#1964) 2023-07-15 22:57:57 +08:00
Alexandr Tumaykin
49dd90578b fix: add resource.clear to en.json (#1963) 2023-07-15 20:03:49 +08:00
Ajay Kumbhare
1780225da5 feat: add typeScript support to enforce valid translation keys (#1954)
* #1952 Fix incorrect localization key for sign-up failure message

* feat: add typeScript support to enforce valid translation keys

* feat: add typeScript support to enforce valid translation keys

* fix lint errors

* fix lint error
2023-07-15 10:27:37 +08:00
boojack
5e20094386 chore: add indexes (#1959) 2023-07-15 10:26:31 +08:00
boojack
40a30d46af chore: update db connection params (#1960) 2023-07-15 10:26:19 +08:00
Alexandr Tumaykin
6b17a27a13 feat: update russian translate and new translate message (#1958)
* feat: add russian translate and new translate message

* fix

---------

Co-authored-by: Александр Тумайкин <AATumaykin@tsum.ru>
2023-07-15 10:01:40 +08:00
Felipe Martínez
2a7104e564 fix: exclude commas in tags (#1957) 2023-07-15 10:00:35 +08:00
Ajay Kumbhare
8ca2dac184 fix: incorrect localization key for sign-up failure message (#1953) 2023-07-14 21:43:46 +08:00
Athurg Gooth
d9b3501fae feat: add support for auto backup db file (#1950)
Add support for auto backup db file
2023-07-14 20:05:07 +08:00
CorrectRoadH
39351970d0 feat: implement memo chat frontend (#1938)
* feat: implment backend function

* feat: implment frontend component

* stash

* eslint

* eslint

* eslint

* delete node

* stash

* refactor the style

* eslint

* eslint

* eslint

* fix build error

* add dep

* Update web/src/components/MemosChat/ConversationTab.tsx

Co-authored-by: boojack <stevenlgtm@gmail.com>

* Update web/src/components/MemosChat/ConversationTab.tsx

Co-authored-by: boojack <stevenlgtm@gmail.com>

* feat: change the name

* disable for vistor

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2023-07-14 13:09:21 +08:00
Athurg Gooth
06dbd87311 chore: split save resource asset (#1939)
* 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
2023-07-14 11:14:10 +08:00
Alexandr Tumaykin
c5a1f4c839 feat: format message from telegram and upload attachments (#1924)
* 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>
2023-07-14 00:18:44 +08:00
Ikko Eltociear Ashimine
f074bb1be2 docs: fix typo in deploy-with-render.md (#1946)
reliablity -> reliability
2023-07-14 00:00:23 +08:00
boojack
90e7d02e35 chore: update readme (#1947) 2023-07-14 00:00:08 +08:00
boojack
437e05bd2f chore: update header style (#1945) 2023-07-13 23:15:11 +08:00
Sergei Vassiljev
934f57c92f chore: update MemoRelationListView.tsx (#1933) 2023-07-13 19:42:50 +08:00
Athurg Gooth
3093f80d68 fix: visibility param override the user auth state (#1942)
fix visibility param override the user auth state
2023-07-13 15:20:15 +08:00
Athurg Gooth
11aa01ee2e fix: visibility param override the user auth state (#1941)
fix visibility param override the user auth state
2023-07-13 14:56:43 +08:00
CorrectRoadH
d8b6e92813 feat: implement memos chat backend function (#1934)
* feat: implment backend function

* eslint

* eslint

* eslint
2023-07-13 11:25:59 +08:00
Athurg Gooth
6adbb7419c chore: split Go binary and src for dev (#1932)
Split Go binary and src for dev
2023-07-12 15:39:56 +08:00
boojack
d4b88c6c86 chore: remove auto signout in auth page (#1927) 2023-07-12 00:16:32 +08:00
boojack
698380f940 chore: update seed data (#1928) 2023-07-12 00:16:19 +08:00
Cyang39
dcac442ebf chore: change dropdown's background color in dark mode (#1925)
#1919
2023-07-11 22:37:04 +08:00
boojack
da70917b08 chore: update auth page (#1920)
* chore: update auth page

* chore: update
2023-07-09 21:13:26 +08:00
boojack
0292f472e0 chore: add data empty placeholder (#1913) 2023-07-08 13:04:12 +08:00
boojack
7e391bd53d chore: remove resource public id (#1912)
* chore: remove resource public id

* chore: update
2023-07-08 11:29:50 +08:00
Peng Ding
2157651d17 update zh-Hans & zh-Hant translations (#1909) 2023-07-07 08:40:35 +08:00
boojack
0e05c62a3b chore: update common utils (#1908) 2023-07-06 22:53:38 +08:00
boojack
a7573d5705 refactor: migrate memo to apiv1 (#1907)
* refactor: migrate memo to apiv1

* chore: update

* chore: update

* chore: update

* chore: upate

* chore: update

* chore: update
2023-07-06 21:56:42 +08:00
boojack
1fa9f162a5 refactor: migrate resource to apiv1 (#1901) 2023-07-06 00:01:40 +08:00
Athurg Gooth
5ea561af3d feat: add support for purged resource link (#1897)
Add support for purged resource link
2023-07-05 21:56:13 +08:00
Athurg Gooth
2033b0c8fa fix: skip auth on /api/v1/status to avoid sign up while token invalid (#1895)
Skip auth on /api/v1/status to avoid sign up while token invalid
2023-07-05 13:55:04 +08:00
Athurg Gooth
1c07ae2650 fix: escape on resource filename (#1892)
add escape on resource filename
2023-07-04 10:06:11 +08:00
boojack
5b6c98582e refactor: migrate storage to apiv1 (#1890)
* refactor: migrate storage to apiv1

* chore: update

* chore: update

* chore: update
2023-07-04 10:05:57 +08:00
Athurg Gooth
0af14fc81a fix: invalid orientation of image thumbnail in Apple devices (#1891) 2023-07-04 09:05:56 +08:00
Athurg Gooth
833fd23820 fix: OpenID was disappear sometimes (#1886)
Fix openid was disapear sometimes
2023-07-03 19:10:24 +08:00
Jiraiya8
d46126c5c3 fix: header archived id (#1888)
Co-authored-by: qingbo <qingbo@jingling.group>
2023-07-03 19:09:59 +08:00
Athurg Gooth
811c3e8844 fix: auto expand height of setting page (#1885) 2023-07-03 13:35:55 +08:00
boojack
223404a240 chore: update memo seed data (#1884) 2023-07-02 23:58:02 +08:00
boojack
31373be172 chore: remove unused packages (#1880) 2023-07-02 19:41:56 +08:00
boojack
66e65e4dc1 refactor: migrate definition to api v1 (#1879)
* refactor: user api v1

* refactor: system setting to apiv1

* chore: remove unused definition

* chore: update

* chore: refactor: system setting

* chore: update

* refactor: migrate tag

* feat: migrate activity store

* refactor: migrate shortcut apiv1

* chore: update
2023-07-02 18:56:25 +08:00
Phong H
b84ecc4574 chore: update vi.json locale (#1878)
Co-authored-by: phong.bnh <phong.bnh@globalfactories.com>
2023-07-02 16:41:03 +08:00
boojack
9a8d43bf88 chore: update user store names (#1877)
* chore: update user store names

* chore: update
2023-07-02 14:27:23 +08:00
boojack
ca770c87d6 chore: upgrade version to v0.13.2 (#1873) 2023-07-01 18:01:51 +08:00
boojack
c83fd1de38 chore: update dialog overflow style (#1872) 2023-07-01 17:37:43 +08:00
boojack
db8b8f0d58 chore: remove unused kit components (#1871) 2023-07-01 12:34:37 +08:00
CorrectRoadH
30fae208c2 fix: pin memos of other people (#1870) 2023-07-01 12:04:49 +08:00
boojack
5fe644a3b6 chore: add jwt middleware in apiv1 (#1869) 2023-07-01 00:03:28 +08:00
CorrectRoadH
a108f5e212 fix: ignore internalpath field when creating resource (#1868)
* fix/to_valid_token

* eslint

* revert

* fix/invalid_internalpath_file_upload
2023-06-30 23:50:55 +08:00
CorrectRoadH
c9aa2eeb98 fix: validate access token (#1867)
* fix/to_valid_token

* eslint

* revert

* Update server/jwt.go

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2023-06-30 14:59:52 +00:00
Vespa314
63d6b6f9f9 chore: listMemos sort by id for memos post/update at the same time (#1866) 2023-06-30 22:56:31 +08:00
boojack
847b4605f4 chore: update dark mode style (#1864) 2023-06-30 08:40:13 +08:00
boojack
6b3748e2a3 chore: update setting page styles (#1863)
* chore: update setting page styles

* chore: update
2023-06-29 23:17:01 +08:00
boojack
6a78887f1d chore: update store types name (#1862) 2023-06-29 22:55:03 +08:00
boojack
7226a9ad47 chore: update idp store (#1856) 2023-06-26 23:46:01 +08:00
boojack
b44f2b5ffb chore: migrate user setting to api v1 package (#1855)
* chore: migrate to api v1 package

* chore: update
2023-06-26 23:06:53 +08:00
boojack
07e82c3f4a fix: schema migrate (#1846)
* fix: schema migrate

* chore: update
2023-06-20 12:18:04 +08:00
boojack
b34aded376 refactor: migration idp api (#1842)
* refactor: migration idp api

* chore: update
2023-06-17 22:35:17 +08:00
boojack
4ed9a3a0ea refactor: migrate auth routes to v1 package (#1841)
* feat: add api v1 packages

* chore: migrate auth to v1

* chore: update test
2023-06-17 21:25:46 +08:00
boojack
f1d85eeaec chore: upgrade pnpm version (#1833)
* chore: upgrade pnpm version

* chore: update
2023-06-15 22:35:41 +08:00
SedationH
1b0efc5548 fix: use ?? in className use (#1829) 2023-06-15 20:05:19 +08:00
May Kittens Devour Your Soul
6dca551164 chore: update hr.json (#1832)
Update hr.json

Updated Croatan [some fixes]
2023-06-15 19:27:13 +08:00
Athurg Gooth
7694597728 feat: Add suppport for tap to reload on PWA (#1827)
* Add suppport for tap to reload on PWA

* Clean empty className

* Move click event to site title

---------

Co-authored-by: Athurg Feng <athurg@gooth.org>
2023-06-14 22:33:46 +08:00
Athurg Gooth
4d59689126 feat: set memo visibility in telegram (#1824)
* 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>
2023-06-14 22:10:01 +08:00
May Kittens Devour Your Soul
8f7001cd9f feat: add croatian locale (#1822)
* Create hr.json

Croatian Language

* Update user_setting.go

* Update i18n.ts

* Update hr.json

* Update web/src/i18n.ts

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2023-06-14 22:09:19 +08:00
David Angel
781b1f7b3a chore: add classnames for easy logo/server name customizations via CSS. (#1828)
Update MemoDetail.tsx
2023-06-14 21:03:38 +08:00
Athurg Gooth
e6c9f2a00e feat: add support for download resource from link (#1800)
* 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>
2023-06-08 14:35:33 +00:00
Athurg Gooth
5d06c8093c fix: systemSetting in UI changed unexpectedly (#1812)
Fix systemSetting in UI changed unexpectedly

Co-authored-by: Athurg Feng <athurg@gooth.org>
2023-06-08 22:32:57 +08:00
kakik0u
c396cc9649 feat: add japanese locale (#1802)
* Add japanese

* Add japanese setting files

---------

Co-authored-by: barappe <121844712+barappe@users.noreply.github.com>
2023-06-08 13:50:48 +08:00
zhangpeng
ac5d8b47ca chore: modify the error message when registering a Host user (#1804)
* Modify the error message

* modify the error message
2023-06-07 12:12:23 +08:00
Athurg Gooth
77e8e9ebbd revert: fix: add public base path (#1748) (#1775) (#1806)
This reverts commit d205a7683a.
2023-06-07 10:07:30 +08:00
c14c6b3786 fix: user default 'Basic Setting' should follow server's setting (#1795)
fix: user default 'Basic Setting' should follow system setting
2023-06-07 00:38:50 +08:00
Athurg Gooth
c27c6cea13 fix: failed to upload OSS with S3 SDK (#1792)
Fix failed to upload OSS with S3 SDK

Co-authored-by: Athurg Feng <athurg@gooth.org>
2023-06-03 14:38:28 +08:00
boojack
11a385cda6 chore: update upgrade version view (#1791) 2023-06-03 14:32:04 +08:00
boojack
32e2f1d339 chore: update page routes (#1790)
chore: update routers
2023-06-03 13:03:22 +08:00
Athurg Gooth
69225b507b chore: clean Dockerfile to exclude musl-dev (#1787)
Clean Dockerfile to exclude musl-dev install

Co-authored-by: Athurg Feng <athurg@gooth.org>
2023-06-01 20:16:13 +08:00
-Shiken-
2f905eed0d chore: update zh-Hant.json (#1781)
* Update zh-Hant.json

follow these commits to complete zhTW translation:
96021e518a
8628d1e4b2
93d608f050
ce64894abe
845297ec03

* Update web/src/locales/zh-Hant.json

Co-authored-by: Zeng1998 <acan.coder@gmail.com>

* Fix json format error

---------

Co-authored-by: Zeng1998 <acan.coder@gmail.com>
Co-authored-by: Athurg Gooth <github@gooth.org>
2023-06-01 09:03:44 +08:00
Athurg Gooth
55cf19aa2e fix: copy-to-clipboard not works well in Safari (#1779)
* Fix copy-to-clipboard not works well in Safari

* Fix typescript type check failure

* Remove global copy inject in home page

---------

Co-authored-by: Athurg Feng <athurg@gooth.org>
2023-06-01 08:53:40 +08:00
boojack
dd8c10743d feat: memo editor dialog (#1772)
* feat: memo editor dialog

* chore: update mark

* chore: update
2023-05-30 20:23:26 +08:00
Athurg Gooth
25ce36e495 feat: resource visibility (#1777)
* 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>
2023-05-30 19:00:54 +08:00
Gener
d205a7683a fix: add public base path (#1748) (#1775) 2023-05-30 18:55:23 +08:00
Athurg Gooth
7e4d71cf58 fix: infinite loop in home page (#1773)
Fix infinite loop in home page

Co-authored-by: Athurg Feng <athurg@gooth.org>
2023-05-30 18:54:58 +08:00
Athurg Gooth
97df1a82c7 feat: add docker compose file for development (#1769)
* Add support to fetch devProxyServer from environment

* Add docker compose file for developer

---------

Co-authored-by: Athurg Feng <athurg@gooth.org>
2023-05-29 19:49:47 +08:00
Athurg Gooth
845297ec03 refactor: change all Robot to Bot (#1767)
* 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>
2023-05-29 19:49:05 +08:00
Athurg Gooth
ddf4cae537 feat: disable CGO_ENABLED (#1766)
* Replace mattn/go-sqlite3 with modernc.org/sqlite

* Disable CGO to make binary work without special c lib

* Replace mattn/go-sqlite3 with modernc.org/sqlite in testing code

* Tidy go module

---------

Co-authored-by: Athurg Feng <athurg@gooth.org>
2023-05-29 13:29:42 +08:00
Athurg Gooth
ce64894abe feat: add telegram proxy support (#1764)
* Add support for reverse proxy of telegram API

* Add Telegram API proxy hint

---------

Co-authored-by: Athurg Feng <athurg@gooth.org>
2023-05-29 13:29:21 +08:00
boojack
beb4d8ccb9 chore: order by updated ts in memo store (#1761) 2023-05-28 02:04:05 +08:00
boojack
e0e59c5831 feat: display memo with updated ts (#1760) 2023-05-28 01:50:09 +08:00
_Jellen
826541a714 feat: update korean localization (#1758) 2023-05-27 22:03:06 +08:00
boojack
c40aeb91e6 fix: patch memo row status (#1755) 2023-05-27 11:14:23 +08:00
boojack
2e34ce90a1 chore: upgrade version 0.13.1 (#1754) 2023-05-27 09:09:41 +08:00
GodMeowIceSun
93d608f050 feat(#1568): add "ask ai" section session splitting function (#1711)
* feat(#1568): Added "ask ai" section session splitting function

Added "ask ai" section session splitting function
Optimize the "ask ai" dialogue style

* fix(#1568): Fix wrong attribute "appearance"

* fix(#1568): Add ts type define

* fix(#1568): Add ts type define

* fix(#1568): Resolve the issue of components not being stretched when only user input is available

* feat(#1568): New session automatic switching function

* refactor(#1729): remove unused code

* feat(#1568): New Remove Session Function

New Remove Session Function
Rename some methods
2023-05-27 02:29:54 +08:00
boojack
ec26a9702d fix: sso templates (#1753) 2023-05-26 22:25:30 +08:00
boojack
dbe8aa1d3a chore: update telegram bot related section (#1750)
* chore: update telegram bot related section

* chore: update
2023-05-26 21:32:44 +08:00
Athurg Gooth
8628d1e4b2 feat: add Telegram bot config UI (#1747)
* 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>
2023-05-26 19:16:51 +08:00
Athurg Gooth
4ea5426e18 feat: add support for content search (#1728)
* Change MemoFind.ContentSearch to slice

* Add support for content search

* Change for go-simple sugguest

---------

Co-authored-by: Athurg Feng <athurg@gooth.org>
2023-05-26 18:51:18 +08:00
Athurg Gooth
1282fe732e feat: implement telegram bot plugin (#1740) 2023-05-26 09:43:51 +08:00
boojack
a07d11e820 feat: tag parser (#1745) 2023-05-26 09:05:17 +08:00
boojack
dbc85fe7e4 feat: image and link parser (#1744)
* feat: image and link parser

* chore: update
2023-05-26 08:43:37 +08:00
boojack
523ef2bba5 chore: update demo banner style (#1743) 2023-05-26 00:47:53 +08:00
boojack
de8014dfe8 feat: resource store cache (#1742) 2023-05-26 00:38:27 +08:00
deeshu
b42e5c3213 chore: update vscode setting enforcement for go111module="on" (#1738)
vscode setting enforcement for go111module to set on and availability of schema for go extension
2023-05-25 22:00:32 +08:00
boojack
ea728d232d refactor: memo store (#1741) 2023-05-25 21:50:37 +08:00
boojack
43819b021e chore: add demo banner (#1739) 2023-05-25 19:29:30 +08:00
boojack
e69f7c735b chore(revert): retire demo site (#1733)
Revert "chore: retire demo site (#1659)"

This reverts commit cd2bdab683.
2023-05-24 20:34:07 +08:00
Athurg Gooth
5e792236af fix: infinite loop while daily memos more than DEFAULT_MEMO_LIMIT (#1730)
Co-authored-by: Athurg Feng <athurg@gooth.org>
2023-05-24 20:22:16 +08:00
boojack
45c119627b chore: move flags into env variables (#1732) 2023-05-24 20:08:47 +08:00
boojack
65890bc257 feat: implement code block parser (#1727) 2023-05-24 00:31:37 +08:00
boojack
42c653e1a4 feat: implement paragraph and italic parsers (#1725) 2023-05-23 21:11:01 +08:00
boojack
8c34be92a6 feat(gomark): add bold parser (#1724) 2023-05-23 20:49:32 +08:00
boojack
fa53a2550a feat: add heading tokenizer (#1723) 2023-05-23 19:52:31 +08:00
Athurg Gooth
616b8b0ee6 feat: introduce publicid to filename template (#1713)
* 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>
2023-05-23 19:15:30 +08:00
Athurg Gooth
d24632682f chore: add volume define in Dockerfile to avoid data lose (#1718)
Add volume define in Dockerfile to protect data

Co-authored-by: Athurg Feng <athurg@gooth.org>
2023-05-23 18:50:17 +08:00
Athurg Gooth
3b1bab651a fix: system memo visibility was replace by user's setting (#1707)
Co-authored-by: Athurg Feng <athurg@gooth.org>
2023-05-22 12:15:00 +08:00
Athurg Gooth
0cea5ebaeb fix: concurrent counter operates (#1706)
Co-authored-by: Athurg Feng <athurg@gooth.org>
2023-05-22 11:08:49 +08:00
Zeng1998
1e4a867a9a fix: add thumbnail param only for internal link (#1701)
* fix: add thumbnail param using `URLSearchParams`

* update: add thumnail param only for internal link
2023-05-21 16:41:04 +08:00
CorrectRoadH
6bb0b4cd47 fix: pop search when touch textarea in Android Chrome (#1700)
* fix: pop search when touch textarea

* eslint
2023-05-21 16:31:50 +08:00
CorrectRoadH
56c6f603aa fix: md without search icon (#1699) 2023-05-21 16:28:30 +08:00
boojack
98b3a371f4 fix: patch memo visibility (#1695) 2023-05-21 11:51:13 +08:00
boojack
ba8e1e5dc2 chore: add available generator amount flag (#1696) 2023-05-21 11:50:57 +08:00
boojack
467f9080a1 feat: get or generate thumbnail image (#1691) 2023-05-20 22:08:07 +08:00
Athurg Gooth
0894bf13d2 fix: fail to open file while generate thumbnail (#1687)
* 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>
2023-05-20 14:33:59 +08:00
boojack
1d7627dd72 chore: upgrade version 0.13.0 (#1685)
* chore: upgrade version `0.13.0`

* chore: update
2023-05-20 10:16:19 +08:00
boojack
d80aa67c97 feat: parse markdown to html format in rss (#1683) 2023-05-20 10:00:21 +08:00
boojack
ae1d9adf65 fix: initial system locale (#1684) 2023-05-20 09:39:20 +08:00
boojack
b40571095d feat: update memo detail page (#1682)
* feat: update memo detail page

* chore: update
2023-05-20 08:39:39 +08:00
Athurg Gooth
04124a2ace feat: generate thumbnail while get and improve thumbnail quality (#1680)
* 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>
2023-05-19 20:07:39 +08:00
Athurg Gooth
2730b90512 feat: highlight the DatePicker's date (#1669)
Co-authored-by: Athurg Feng <athurg@gooth.org>
2023-05-19 08:36:08 +08:00
Athurg Gooth
34913cfc83 feat: show thumbnail in resource dashboard (#1666)
* Add image thumbnail instead of an icon

* Change thumbnail size of dashboard to fixed

* Fix for eslint-checks

* Fix for eslint-checks

* Replace css with tailwind

* Remove the parent div used for style

* Show preview while click on the resource

* Change for review Suggested by @Zeng1998

---------

Co-authored-by: Athurg Feng <athurg@gooth.org>
2023-05-19 08:31:32 +08:00
boojack
88799d469c chore: initial gomark plugin (#1678)
chore: initial gomark folder
2023-05-18 21:33:18 +08:00
boojack
a07d5d38d6 feat: memo relation part1 (#1677)
* feat: memo relation part1

* chore: update
2023-05-18 21:29:28 +08:00
Stephen Zhou
ca5859296a fix: resource url in rss (#1672) 2023-05-18 06:53:20 +08:00
boojack
1a8310f027 chore: update system setting default value (#1665) 2023-05-15 22:59:26 +08:00
Athurg Gooth
041be46732 Add support for image thumbnail (#1641)
* 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>
2023-05-15 22:42:12 +08:00
Zeng1998
9eafb6bfb5 chore: add the default value of MaxUploadSizeMiB (#1663) 2023-05-15 21:54:45 +08:00
Lincoln Nogueira
668a9e88c6 fix: File size exceeds allowed limit of 0 MiB (#1664)
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.
2023-05-15 21:54:13 +08:00
boojack
cd2bdab683 chore: retire demo site (#1659) 2023-05-14 23:35:31 +08:00
CorrectRoadH
d72b4e9a98 feat: filter support plain link (#1657)
* fix: unexpected empty lines when copying-pasting

* add ref

* feat: support to filter plain link

* eslint

* fix the typo

* fix the typo

* unified the import path
2023-05-14 23:17:18 +08:00
boojack
2cc5691efd chore: update memo relation types (#1658) 2023-05-14 23:17:05 +08:00
guanzi008
7726ed4245 feat: add build-artifacts.yml (#1583)
* Create main.yml

构建的单文件运行版本几个平台的Windows amd64 ,Linux amd64,Linux arm64

* Rename main.yml to build-artifacts.yml

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2023-05-13 14:52:50 +00:00
boojack
921d4b996d chore: update help button style (#1656) 2023-05-13 22:52:06 +08:00
Lincoln Nogueira
96021e518a feat: add max upload size setting to UI & UI improvements (#1646)
* 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
2023-05-13 22:27:28 +08:00
boojack
5c5199920e chore: seed data for new user (#1655) 2023-05-13 22:25:15 +08:00
CorrectRoadH
e1c809d6f1 fix: unexpected empty lines when copying-pasting (#1654) 2023-05-13 22:08:54 +08:00
Athurg Gooth
218009a5ec fix: wrong position of UsageStatItem's popup (#1647)
* fix: wrong position of UsageStatItem's popup

* Replace TAB into Space for eslint

---------

Co-authored-by: Athurg Feng <athurg@gooth.org>
2023-05-12 22:07:53 +08:00
Lincoln Nogueira
5340008ad7 feat: improve Windows support (#1645)
* 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
2023-05-10 08:03:55 +08:00
CorrectRoadH
700fe6b0e4 fix: return pinned status after edit (#1629)
* stash

* query pinned status after patch

* eslint

* refactor query

* eslint

* process specify case

* add test

* Update memo.go
2023-05-09 09:03:09 +08:00
boojack
9b8d69b2dd chore: add vacuum memo relation to dev guard (#1644)
* chore: add vacuum memo relation to dev guard

* chore: update
2023-05-09 09:02:59 +08:00
Zeng1998
84546ff11c chore: show server name instead of "MEMOS" (#1639) 2023-05-09 08:24:13 +08:00
Zeng1998
885a0ddad0 chore: add size for s3 resource (#1638) 2023-05-09 08:17:26 +08:00
Lincoln Nogueira
3b76c6792c feat: add preliminar Windows support (#1636)
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)
2023-05-09 08:16:38 +08:00
jonny
4605349bdc chore: update Chinese name translation (#1630) 2023-05-06 07:36:22 +08:00
Stephen Zhou
ff447ad22b feat: support file sorting when uploading (#1627) 2023-05-03 19:18:29 +08:00
Stephen Zhou
c081030d61 chore: lock pnpm version (#1628) 2023-05-03 19:14:21 +08:00
boojack
e3496ac1a2 refactor: memo editor components (#1625) 2023-05-03 19:13:37 +08:00
boojack
8911ea1619 chore: update related time format (#1621)
chore: update related time
2023-05-02 08:54:51 +08:00
boojack
34700a4c52 chore: check allow sign up setting in sso (#1620) 2023-05-02 08:45:03 +08:00
boojack
b6564bcd77 feat: implement memo relation server (#1618) 2023-05-01 16:09:41 +08:00
Peng Ding
6e6aae6649 feat: update zh-Hans translations and minor fixes in locale_updater.py (#1615)
* update zh-Hans translations

* minor update

* update instruction part

* print json_value for debugging purpose

* update post requests related

* machine translate with chunks to get around {{field}}
2023-05-01 13:27:08 +08:00
João Nuno Mota
b98f85d8a7 feat: add infinite scroll for memos (#1614)
Add infinite scroll for memos on home
2023-05-01 13:26:15 +08:00
João Nuno Mota
3314fe8b0e fix: failed eslint checks (#1616) 2023-05-01 08:38:35 +08:00
powersee
f12163bc94 feat: add linux/arm/v7 to docker build action (#1610) 2023-04-29 00:40:15 +08:00
CorrectRoadH
f7a1680f72 fix: only delete last file when select multiple files #1576 (#1578)
* fix the bug can't delete multiple files #1576

* using useEvent instead of useRef

* delete unused code

* delete unused code

* change hook file name

* refactor the useEvent

* delete unnecessary export

* fix import

* Apply suggestions from code review

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2023-04-28 16:17:08 +00:00
boojack
4603f414db chore: add system setting cache (#1609) 2023-04-28 00:02:54 +08:00
deeshu
884dca20b3 fix: reappearing of dialog should add body scrolling class (#1602)
When dialog is reappeared after being in a hidden state. Then reappeaning should block further body scrolling for consistent UX.
2023-04-27 07:16:15 +08:00
Max Malm
dbb544dc92 feat: read content from search params (#1607) 2023-04-27 07:15:40 +08:00
deeshu
3fad718807 fix: memo content availability for visitor mode (#1605) 2023-04-26 21:57:01 +08:00
boojack
fab8a71fd2 feat: implement memo relation store (#1598)
* feat: implement memo relation store

* chore: update
2023-04-25 23:27:38 +08:00
Barry
7776a6b7c6 docs: update readme with MemosGallery (#1590)
- add: https://github.com/BarryYangi/MemosGallery

A simple gallery static page based on the memos api, I think it might be useful for some people, so I just post it up. Close this if not necessary.
2023-04-25 22:27:02 +08:00
boojack
cd6ab61c2d chore: add memo_relation (#1585) 2023-04-25 22:26:45 +08:00
_Jellen
00f69d683a feat: update Korean translation (#1592)
Update Korean translation

- add missing keys
- polish some translations
- remove trailing whitespaces
2023-04-23 20:13:34 +08:00
boojack
0e70de4003 chore: split memo resource api (#1587) 2023-04-22 10:42:24 +08:00
boojack
35efa927b6 chore: update readme with docs (#1586) 2023-04-22 10:25:32 +08:00
Antzed
1ff03e87c2 docs: upgrade on fly.io (#1582) 2023-04-22 09:34:36 +08:00
boojack
edf934efbb chore: update memo style (#1581) 2023-04-21 14:46:41 +08:00
-Shiken-
d0815f586e feat: update zh-tw translation to latest file format (#1569)
* update zh-tw translation to latest file format

* Update zh-Hant.json

* Update web/src/locales/zh-Hant.json

---------

Co-authored-by: boojack <stevenlgtm@gmail.com>
2023-04-19 20:22:23 +08:00
Yang
685a23bce8 feat: add auto collapse feature for all memos issue #1463 (#1550)
* add auto collapse feature

* fix some styles

* pass eslint

---------

Co-authored-by: liyang <liyangg@umich.edu>
2023-04-18 10:05:36 +08:00
boojack
0aa7085303 chore: add enclosure to rss (#1559) 2023-04-17 23:26:56 +08:00
boojack
994d5dd891 feat: server tests (#1556)
* feat: server tests

* chore: update
2023-04-17 21:34:59 +08:00
deeshu
e62a94c05a feat: hiding dialog using X button should remove class "overflow-hidden" (#1555)
Hiding dialogs result in the body to stay frozen due to mounting behaviour of the dialog, but using 'X' button hides the dialog and won't let user scroll any further. Removing overflow behaviour during hiding procedure will improve User Experience.
2023-04-17 20:13:33 +08:00
Manu
2b83572641 fix: the broken install docs link (#1554) 2023-04-17 19:00:13 +08:00
boojack
5f8aae69e4 chore: update save button style (#1542) 2023-04-16 15:47:01 +08:00
777 changed files with 77680 additions and 30771 deletions

View File

@@ -1,11 +1,11 @@
name: Bug Report
description: Create a report to help us improve
description: If something isn't working as expected
labels: [bug]
body:
- type: markdown
attributes:
value: |
If you are reporting a new issue, make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead.
Before submitting a bug report, please check if the issue is already present in the issues. If it is, please add a reaction to the issue. If it isn't, please fill out the form below.
- type: textarea
attributes:
label: Describe the bug
@@ -24,8 +24,16 @@ body:
3. See error
validations:
required: true
- type: input
attributes:
label: |
The version of Memos you're using
description: |
Provide the version of Memos you're using. Please use the following format: `v0.22.0` instead of `stable` or `latest`.
validations:
required: true
- type: textarea
attributes:
label: Screenshots or additional context
description: |
Add screenshots or any other context about the problem.
If applicable, add screenshots to help explain your problem. And add any other context about the problem here. Such as the device you're using, etc.

1
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1 @@
blank_issues_enabled: false

View File

@@ -1,28 +1,36 @@
name: Feature Request
description: Suggest an idea for this project
description: If you have a suggestion for a new feature
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to suggest an idea for Memos!
- type: textarea
attributes:
label: Is your feature request related to a problem?
description: |
A clear and concise description of what the problem is.
placeholder: |
I'm always frustrated when [...]
validations:
required: true
Before submitting a feature request, please check if the issue is already present in the issues. If it is, please add a reaction to the issue. If it isn't, please fill out the form below.
- type: textarea
attributes:
label: Describe the solution you'd like
description: |
A clear and concise description of what you want to happen.
placeholder: |
It would be great if [...]
validations:
required: true
- type: dropdown
attributes:
label: Type of feature
description: What type of feature is this?
options:
- User Interface (UI)
- User Experience (UX)
- API
- Documentation
- Integrations
- Other
default: 0
validations:
required: true
- type: textarea
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request.
description: |
What are you trying to do? Why is this important to you?

20
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
version: 2
updates:
- package-ecosystem: "github-actions"
commit-message:
prefix: "chore"
directory: "/"
schedule:
interval: "monthly"
- package-ecosystem: npm
commit-message:
prefix: "chore"
directory: "/web"
schedule:
interval: "monthly"
- package-ecosystem: "gomod"
commit-message:
prefix: "chore"
directory: "/"
schedule:
interval: "monthly"

13
.github/semantic.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
enabled: true
# Only check PR title
titleOnly: true
types:
- feat
- fix
- refactor
- chore
- docs
- style
- test

View File

@@ -1,39 +1,44 @@
name: Backend Test
on:
push:
branches: [main]
pull_request:
branches:
- main
- "release/*.*.*"
paths:
- "go.mod"
- "go.sum"
- "**.go"
jobs:
go-static-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.24
check-latest: true
cache: true
- name: Verify go.mod is tidy
run: |
go mod tidy -go=1.19
go mod tidy -go=1.24
git diff --exit-code
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.52.0
args: -v --timeout=3m
version: v1.64.5
args: --verbose --timeout=3m
skip-cache: true
go-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.24
check-latest: true
cache: true
- name: Run all tests

View File

@@ -1,29 +1,29 @@
name: build-and-push-test-image
name: Build and Push Canary Image
on:
push:
branches: [main]
jobs:
build-and-push-test-image:
build-and-push-canary-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: neosmemo
password: ${{ secrets.DOCKER_NEOSMEMO_TOKEN }}
username: stevenlgtm
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
@@ -31,14 +31,14 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
install: true
version: v0.9.1
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
neosmemo/memos
@@ -46,11 +46,11 @@ jobs:
flavor: |
latest=false
tags: |
type=raw,value=test
type=raw,value=canary
- name: Build and Push
id: docker_build
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
context: ./
file: ./Dockerfile

View File

@@ -1,10 +1,10 @@
name: build-and-push-release-image
name: Build and Push Release Image by Branch
on:
push:
branches:
# Run on pushing branches like `release/1.0.0`
- "release/*.*.*"
# Run on pushing branches like 'release/1.0.0'.
- "release/*"
jobs:
build-and-push-release-image:
@@ -13,25 +13,25 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Extract build args
# Extract version from branch name
# Example: branch name `release/1.0.0` sets up env.VERSION=1.0.0
# Extract version from tag name
# Example: tag name `release/1.0.0` sets up env.VERSION=1.0.0
run: |
echo "VERSION=${GITHUB_REF_NAME#release/}" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: neosmemo
password: ${{ secrets.DOCKER_NEOSMEMO_TOKEN }}
username: stevenlgtm
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
@@ -39,27 +39,30 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
install: true
version: v0.9.1
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
neosmemo/memos
ghcr.io/usememos/memos
tags: |
type=raw,value=latest
type=semver,pattern={{version}},value=${{ env.VERSION }}
type=semver,pattern={{major}}.{{minor}},value=${{ env.VERSION }}
type=semver,pattern={{major}},value=${{ env.VERSION }}
type=raw,value=stable
flavor: |
latest=false
labels: |
org.opencontainers.image.version=${{ env.VERSION }}
- name: Build and Push
id: docker_build
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
context: ./
file: ./Dockerfile

View File

@@ -0,0 +1,71 @@
name: Build and Push Release Image by Tag
on:
push:
tags:
# Match stable versions, such as 'v1.0.0'.
- "v*.*.*"
jobs:
build-and-push-stable-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Extract build args
# Extract version number and check if it's an rc version
run: |
echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: stevenlgtm
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
install: true
version: v0.9.1
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
neosmemo/memos
ghcr.io/usememos/memos
tags: |
type=semver,pattern={{version}},value=${{ env.VERSION }}
type=semver,pattern={{major}}.{{minor}},value=${{ env.VERSION }}
type=raw,value=stable
flavor: |
latest=false
labels: |
org.opencontainers.image.version=${{ env.VERSION }}
- name: Build and Push
id: docker_build
uses: docker/build-push-action@v6
with:
context: ./
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

45
.github/workflows/build-artifacts.yml vendored Normal file
View File

@@ -0,0 +1,45 @@
name: Build Artifacts
on:
push:
tags:
- "*"
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: 1.24
check-latest: true
cache: true
- uses: pnpm/action-setup@v4.1.0
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: pnpm
cache-dependency-path: "web/pnpm-lock.yaml"
- run: pnpm install
working-directory: web
- run: pnpm release
working-directory: web
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
# 'latest', 'nightly', or a semver
version: latest
args: release --clean --skip=validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,68 +0,0 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ["go", "javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

View File

@@ -1,66 +0,0 @@
name: "E2E Test"
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: Build and Run Memos With E2E Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build Docker image
id: docker_build
uses: docker/build-push-action@v3
with:
context: ./
file: ./Dockerfile
platforms: linux/amd64
push: false
tags: neosmemo/memos:e2e
labels: neosmemo/memos:e2e
- name: Run Docker container
run: docker run -d -p 5230:5230 neosmemo/memos:e2e
- uses: pnpm/action-setup@v2.2.4
with:
version: 8.0.0
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
cache-dependency-path: ./web/pnpm-lock.yaml
- name: Install dependencies
working-directory: web
run: pnpm install
- name: Install Playwright Browsers
working-directory: web
run: npx playwright install --with-deps
- name: Run Playwright tests
working-directory: web
run: npx playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: web/playwright-report/
retention-days: 30
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-screenshot
path: web/playwright-screenshot/
retention-days: 30
- name: Stop Docker container
run: docker stop $(docker ps -q)

View File

@@ -1,22 +1,25 @@
name: Frontend Test
on:
push:
branches: [main]
pull_request:
branches:
- main
- "release/*.*.*"
paths:
- "web/**"
jobs:
eslint-checks:
static-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4.1.0
with:
version: 8.0.0
- uses: actions/setup-node@v3
version: 9
- uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "20"
cache: pnpm
cache-dependency-path: "web/pnpm-lock.yaml"
- run: pnpm install
@@ -24,17 +27,20 @@ jobs:
- name: Run eslint check
run: pnpm lint
working-directory: web
- name: Run type checks
run: pnpm type-check
working-directory: web
frontend-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4.1.0
with:
version: 8.0.0
- uses: actions/setup-node@v3
version: 9
- uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "20"
cache: pnpm
cache-dependency-path: "web/pnpm-lock.yaml"
- run: pnpm install

View File

@@ -1,8 +1,8 @@
name: 'issue-translator'
on:
issue_comment:
name: Issue Translator
on:
issue_comment:
types: [created]
issues:
issues:
types: [opened]
jobs:

33
.github/workflows/proto-linter.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: Protobuf Linter
on:
push:
branches: [main]
pull_request:
branches:
- main
paths:
- "proto/**"
jobs:
lint-protos:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup buf
uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ github.token }}
- name: buf lint
uses: bufbuild/buf-lint-action@v1
with:
input: "proto"
- name: buf format
run: |
if [[ $(buf format -d) ]]; then
echo "Run 'buf format -d'"
exit 1
fi

17
.github/workflows/stale.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
name: Close Stale Issues
on:
schedule:
- cron: "0 */8 * * *"
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/stale@v9.1.0
with:
days-before-issue-stale: 14
days-before-issue-close: 7

View File

@@ -1,85 +0,0 @@
name: Build PR Image
on:
pull_request:
types: [opened, synchronize, reopened, closed]
jobs:
build-memos:
name: Build and push `Memos`
runs-on: ubuntu-latest
outputs:
tags: ${{ steps.meta.outputs.tags }}
if: ${{ github.event.action != 'closed' }}
steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Generate UUID image name
id: uuid
run: echo "UUID_WORKER=$(uuidgen)" >> $GITHUB_ENV
- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: registry.uffizzi.com/${{ env.UUID_WORKER }}
tags: |
type=raw,value=60d
- name: Build and Push Image to registry.uffizzi.com - Uffizzi's ephemeral Registry
uses: docker/build-push-action@v3
with:
context: ./
file: Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
cache-from: type=gha
cache-to: type=gha, mode=max
render-compose-file:
name: Render Docker Compose File
# Pass output of this workflow to another triggered by `workflow_run` event.
runs-on: ubuntu-latest
needs:
- build-memos
outputs:
compose-file-cache-key: ${{ steps.hash.outputs.hash }}
steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Render Compose File
run: |
MEMOS_IMAGE=${{ needs.build-memos.outputs.tags }}
export MEMOS_IMAGE
# Render simple template from environment variables.
envsubst < docker-compose.uffizzi.yml > docker-compose.rendered.yml
cat docker-compose.rendered.yml
- name: Upload Rendered Compose File as Artifact
uses: actions/upload-artifact@v3
with:
name: preview-spec
path: docker-compose.rendered.yml
retention-days: 2
- name: Upload PR Event as Artifact
uses: actions/upload-artifact@v3
with:
name: preview-spec
path: ${{github.event_path}}
retention-days: 2
delete-preview:
name: Call for Preview Deletion
runs-on: ubuntu-latest
if: ${{ github.event.action == 'closed' }}
steps:
# If this PR is closing, we will not render a compose file nor pass it to the next workflow.
- name: Upload PR Event as Artifact
uses: actions/upload-artifact@v3
with:
name: preview-spec
path: ${{github.event_path}}
retention-days: 2

View File

@@ -1,88 +0,0 @@
name: Deploy Uffizzi Preview
on:
workflow_run:
workflows:
- "Build PR Image"
types:
- completed
jobs:
cache-compose-file:
name: Cache Compose File
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
outputs:
compose-file-cache-key: ${{ env.HASH }}
pr-number: ${{ env.PR_NUMBER }}
steps:
- name: 'Download artifacts'
# Fetch output (zip archive) from the workflow run that triggered this workflow.
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "preview-spec"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/preview-spec.zip`, Buffer.from(download.data));
- name: 'Unzip artifact'
run: unzip preview-spec.zip
- name: Read Event into ENV
run: |
echo 'EVENT_JSON<<EOF' >> $GITHUB_ENV
cat event.json >> $GITHUB_ENV
echo -e '\nEOF' >> $GITHUB_ENV
- name: Hash Rendered Compose File
id: hash
# If the previous workflow was triggered by a PR close event, we will not have a compose file artifact.
if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }}
run: echo "HASH=$(md5sum docker-compose.rendered.yml | awk '{ print $1 }')" >> $GITHUB_ENV
- name: Cache Rendered Compose File
if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }}
uses: actions/cache@v3
with:
path: docker-compose.rendered.yml
key: ${{ env.HASH }}
- name: Read PR Number From Event Object
id: pr
run: echo "PR_NUMBER=${{ fromJSON(env.EVENT_JSON).number }}" >> $GITHUB_ENV
- name: DEBUG - Print Job Outputs
if: ${{ runner.debug }}
run: |
echo "PR number: ${{ env.PR_NUMBER }}"
echo "Compose file hash: ${{ env.HASH }}"
cat event.json
deploy-uffizzi-preview:
name: Use Remote Workflow to Preview on Uffizzi
if: ${{ github.event.workflow_run.conclusion == 'success' }}
needs:
- cache-compose-file
uses: UffizziCloud/preview-action/.github/workflows/reusable.yaml@v2
with:
# If this workflow was triggered by a PR close event, cache-key will be an empty string
# and this reusable workflow will delete the preview deployment.
compose-file-cache-key: ${{ needs.cache-compose-file.outputs.compose-file-cache-key }}
compose-file-cache-path: docker-compose.rendered.yml
server: https://app.uffizzi.com
pr-number: ${{ needs.cache-compose-file.outputs.pr-number }}
permissions:
contents: read
pull-requests: write
id-token: write

11
.gitignore vendored
View File

@@ -1,6 +1,3 @@
# Air (hot reload) generated
.air
# temp folder
tmp
@@ -15,4 +12,10 @@ build
# Jetbrains
.idea
bin/air
# Docker Compose Environment File
.env
dist
# VSCode settings
.vscode

View File

@@ -1,5 +1,8 @@
run:
timeout: 10m
linters:
enable:
- errcheck
- goimports
- revive
- govet
@@ -10,17 +13,24 @@ linters:
- rowserrcheck
- nilerr
- godot
- forbidigo
- mirror
- bodyclose
issues:
exclude:
- Rollback
- fmt.Printf
- fmt.Print
linters-settings:
goimports:
# Put imports beginning with prefix after 3rd-party packages.
local-prefixes: github.com/usememos/memos
revive:
# Default to run all linters so that new rules in the future could automatically be added to the static check.
enable-all-rules: true
rules:
# The following rules are too strict and make coding harder. We do not enable them for now.
- name: file-header
disabled: true
- name: line-length-limit
@@ -51,14 +61,31 @@ linters-settings:
disabled: true
- name: early-return
disabled: true
- name: use-any
disabled: true
- name: exported
disabled: true
- name: unhandled-error
disabled: true
- name: if-return
disabled: true
- name: max-control-nesting
disabled: true
- name: redefines-builtin-id
disabled: true
gocritic:
disabled-checks:
- ifElseChain
govet:
settings:
printf:
funcs:
printf: # The name of the analyzer, run `go tool vet help` to see the list of all analyzers
funcs: # Run `go tool vet help printf` to see the full configuration of `printf`.
- common.Errorf
enable-all: true
disable:
- fieldalignment
- shadow
forbidigo:
forbid:
- 'fmt\.Errorf(# Please use errors\.Wrap\|Wrapf\|Errorf instead)?'
- 'ioutil\.ReadDir(# Please use os\.ReadDir)?'

36
.goreleaser.yaml Normal file
View File

@@ -0,0 +1,36 @@
version: 1
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
builds:
- main: ./bin/memos
binary: memos
goos:
- linux
- darwin
archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_{{ .Tag }}_{{ .Os }}_{{ .Arch }}
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
checksum:
disable: true
release:
draft: true
replace_existing_draft: true
make_latest: true
mode: replace
skip_upload: false

View File

@@ -1,3 +0,0 @@
{
"recommendations": ["golang.go"]
}

View File

@@ -1,12 +0,0 @@
{
"folders": [
{
"name": "server",
"path": "../"
},
{
"name": "web",
"path": "../web"
}
]
}

View File

@@ -1,5 +0,0 @@
{
"go.lintOnSave": "workspace",
"go.lintTool": "golangci-lint",
"go.inferGopath": false
}

View File

@@ -1,38 +1,41 @@
# Build frontend dist.
FROM node:18.12.1-alpine3.16 AS frontend
FROM node:20-alpine AS frontend
WORKDIR /frontend-build
COPY ./web/package.json ./web/pnpm-lock.yaml ./
COPY . .
RUN npm install -g pnpm && pnpm i --frozen-lockfile
COPY ./web/ .
WORKDIR /frontend-build/web
RUN npm install -g pnpm
RUN pnpm i --frozen-lockfile
RUN pnpm build
# Build backend exec file.
FROM golang:1.19.3-alpine3.16 AS backend
FROM golang:1.24-alpine AS backend
WORKDIR /backend-build
RUN apk update && apk add --no-cache gcc musl-dev
COPY . .
COPY --from=frontend /frontend-build/dist ./server/dist
COPY --from=frontend /frontend-build/web/dist /backend-build/server/router/frontend/dist
RUN go build -o memos ./main.go
RUN go build -o memos ./bin/memos/main.go
# Make workspace with above generated files.
FROM alpine:3.16 AS monolithic
FROM alpine:latest AS monolithic
WORKDIR /usr/local/memos
RUN apk add --no-cache tzdata
ENV TZ="UTC"
COPY --from=backend /backend-build/memos /usr/local/memos/
COPY entrypoint.sh /usr/local/memos/
EXPOSE 5230
# Directory to store the data, which can be referenced as the mounting point.
RUN mkdir -p /var/opt/memos
VOLUME /var/opt/memos
ENTRYPOINT ["./memos", "--mode", "prod", "--port", "5230"]
ENV MEMOS_MODE="prod"
ENV MEMOS_PORT="5230"
ENTRYPOINT ["./entrypoint.sh", "./memos"]

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2022 Memos
Copyright (c) 2025 Memos
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,62 +1,58 @@
# memos
# Memos - Open Source, Self-hosted, Your Notes, Your Way
<img height="72px" src="https://usememos.com/logo.webp" alt="✍️ memos" align="right" />
<img align="right" height="96px" src="https://www.usememos.com/logo-rounded.png" alt="Memos" />
A lightweight, self-hosted memo hub. Open Source and Free forever.
An open-source, self-hosted note-taking solution designed for seamless deployment and multi-platform access. Experience effortless plain text writing with pain-free, complemented by robust Markdown syntax support for enhanced formatting.
<a href="https://demo.usememos.com/">Live Demo</a> •
Discuss in <a href="https://t.me/+-_tNF1k70UU4ZTc9">Telegram</a> / <a href="https://discord.gg/tfPJa4UmAv">Discord</a>
<a href="https://www.usememos.com">Home Page</a> •
<a href="https://www.usememos.com/blog">Blogs</a>
<a href="https://www.usememos.com/docs">Docs</a> •
<a href="https://demo.usememos.com/">Live Demo</a>
<p>
<a href="https://github.com/usememos/memos/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/usememos/memos" /></a>
<a href="https://hub.docker.com/r/neosmemo/memos"><img alt="Docker pull" src="https://img.shields.io/docker/pulls/neosmemo/memos.svg"/></a>
<a href="https://hub.docker.com/r/neosmemo/memos"><img alt="Docker image size" src="https://img.shields.io/docker/image-size/neosmemo/memos?sort=semver"/></a>
<a href="https://discord.gg/tfPJa4UmAv"><img alt="Discord" src="https://img.shields.io/badge/discord-chat-5865f2?logo=discord&logoColor=f5f5f5" /></a>
</p>
![demo](https://usememos.com/demo.webp)
![demo](https://www.usememos.com/demo.png)
## Key points
## Features
- Open source and free forever
- Self-hosting with Docker in seconds
- Markdown support
- Customizable and sharable
- RESTful API for self-service
- **Privacy First** 🏡: Your data, your control. All runtime data is securely stored in your local database.
- **Create at Speed** ✍️: Write and save content as plain text for quick access, with Markdown support for fast formatting and easy sharing.
- **Lightweight but Powerful** ⚡: Built with Go and React.js, our app combines a compact architecture with powerful performance.
- **Customizable** 🧩: Personalize your experience by customizing the server name, icon, description, theme, and execution scripts.
- **Open Source** 🦦: Fully open source, with all code available on GitHub for transparency and collaboration.
- **Free to Use** 💸: Enjoy all features at no cost, no hidden fees, no subscriptions.
## Deploy with Docker in seconds
```bash
docker run -d --name memos -p 5230:5230 -v ~/.memos/:/var/opt/memos ghcr.io/usememos/memos:latest
docker run -d --name memos -p 5230:5230 -v ~/.memos/:/var/opt/memos neosmemo/memos:stable
```
> [!NOTE]
> This command is only applicable for Unix/Linux systems. For Windows, please refer to the detailed [documentation](https://www.usememos.com/docs/install/container-install#docker-on-windows).
>
> The `~/.memos/` directory will be used as the data directory on your local machine, while `/var/opt/memos` is the directory of the volume in Docker and should not be modified.
Learn more about [other installation methods](https://usememos.com/docs/install).
Learn more about [other installation methods](https://www.usememos.com/docs/install).
> [!WARNING]
> Memos is still under active development, so you may encounter bugs or breaking changes as we improve.
## Contribution
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. We greatly appreciate any contributions you make. Thank you for being a part of our community! 🥰
<a href="https://github.com/usememos/memos/graphs/contributors">
<img src="https://contrib.rocks/image?repo=usememos/memos" />
</a>
---
- [Moe Memos](https://memos.moe/) - Third party client for iOS and Android
- [lmm214/memos-bber](https://github.com/lmm214/memos-bber) - Chrome extension
- [Rabithua/memos_wmp](https://github.com/Rabithua/memos_wmp) - WeChat MiniProgram
- [qazxcdswe123/telegramMemoBot](https://github.com/qazxcdswe123/telegramMemoBot) - Telegram bot
- [eallion/memos.top](https://github.com/eallion/memos.top) - Static page rendered with the Memos API
- [eindex/logseq-memos-sync](https://github.com/EINDEX/logseq-memos-sync) - Logseq plugin
- [JakeLaoyu/memos-import-from-flomo](https://github.com/JakeLaoyu/memos-import-from-flomo) - Import data. Support from flomo, wechat reading
- [Send to memos](https://sharecuts.cn/shortcut/12640) - A shortcut for iOS
- [Memos Raycast Extension](https://www.raycast.com/JakeYu/memos) - Raycast extension
- [Memos Desktop](https://github.com/xudaolong/memos-desktop) - Third party client for MacOS and Windows
## Acknowledgements
- Thanks [Uffizzi](https://www.uffizzi.com/) for sponsoring preview environments for PRs.
Guide to [contribution](https://www.usememos.com/docs/contribution/development).
## Star history
[![Star History Chart](https://api.star-history.com/svg?repos=usememos/memos&type=Date)](https://star-history.com/#usememos/memos&Date)
## Other Projects
- [**Slash**](https://github.com/yourselfhosted/slash): An open source, self-hosted bookmarks and link sharing platform. Save and share your links very easily.
- [**Gomark**](https://github.com/usememos/gomark): A markdown parser written in Go for Memos. And its [WebAssembly version](https://github.com/usememos/gomark-wasm) is also available.

View File

@@ -4,4 +4,4 @@
Report security bugs via GitHub [issues](https://github.com/usememos/memos/issues).
For more information, please contact [stevenlgtm@gmail.com](stevenlgtm@gmail.com).
For more information, please contact [usememos@gmail.com](usememos@gmail.com).

View File

@@ -1,137 +0,0 @@
package api
import "github.com/usememos/memos/server/profile"
// ActivityType is the type for an activity.
type ActivityType string
const (
// User related.
// ActivityUserCreate is the type for creating users.
ActivityUserCreate ActivityType = "user.create"
// ActivityUserUpdate is the type for updating users.
ActivityUserUpdate ActivityType = "user.update"
// ActivityUserDelete is the type for deleting users.
ActivityUserDelete ActivityType = "user.delete"
// ActivityUserAuthSignIn is the type for user signin.
ActivityUserAuthSignIn ActivityType = "user.auth.signin"
// ActivityUserAuthSignUp is the type for user signup.
ActivityUserAuthSignUp ActivityType = "user.auth.signup"
// ActivityUserSettingUpdate is the type for updating user settings.
ActivityUserSettingUpdate ActivityType = "user.setting.update"
// Memo related.
// ActivityMemoCreate is the type for creating memos.
ActivityMemoCreate ActivityType = "memo.create"
// ActivityMemoUpdate is the type for updating memos.
ActivityMemoUpdate ActivityType = "memo.update"
// ActivityMemoDelete is the type for deleting memos.
ActivityMemoDelete ActivityType = "memo.delete"
// Shortcut related.
// ActivityShortcutCreate is the type for creating shortcuts.
ActivityShortcutCreate ActivityType = "shortcut.create"
// ActivityShortcutUpdate is the type for updating shortcuts.
ActivityShortcutUpdate ActivityType = "shortcut.update"
// ActivityShortcutDelete is the type for deleting shortcuts.
ActivityShortcutDelete ActivityType = "shortcut.delete"
// Resource related.
// ActivityResourceCreate is the type for creating resources.
ActivityResourceCreate ActivityType = "resource.create"
// ActivityResourceDelete is the type for deleting resources.
ActivityResourceDelete ActivityType = "resource.delete"
// Tag related.
// ActivityTagCreate is the type for creating tags.
ActivityTagCreate ActivityType = "tag.create"
// ActivityTagDelete is the type for deleting tags.
ActivityTagDelete ActivityType = "tag.delete"
// Server related.
// ActivityServerStart is the type for starting server.
ActivityServerStart ActivityType = "server.start"
)
// ActivityLevel is the level of activities.
type ActivityLevel string
const (
// ActivityInfo is the INFO level of activities.
ActivityInfo ActivityLevel = "INFO"
// ActivityWarn is the WARN level of activities.
ActivityWarn ActivityLevel = "WARN"
// ActivityError is the ERROR level of activities.
ActivityError ActivityLevel = "ERROR"
)
type ActivityUserCreatePayload struct {
UserID int `json:"userId"`
Username string `json:"username"`
Role Role `json:"role"`
}
type ActivityUserAuthSignInPayload struct {
UserID int `json:"userId"`
IP string `json:"ip"`
}
type ActivityUserAuthSignUpPayload struct {
Username string `json:"username"`
IP string `json:"ip"`
}
type ActivityMemoCreatePayload struct {
Content string `json:"content"`
Visibility string `json:"visibility"`
}
type ActivityShortcutCreatePayload struct {
Title string `json:"title"`
Payload string `json:"payload"`
}
type ActivityResourceCreatePayload struct {
Filename string `json:"filename"`
Type string `json:"type"`
Size int64 `json:"size"`
}
type ActivityTagCreatePayload struct {
TagName string `json:"tagName"`
}
type ActivityServerStartPayload struct {
ServerID string `json:"serverId"`
Profile *profile.Profile `json:"profile"`
}
type Activity struct {
ID int `json:"id"`
// Standard fields
CreatorID int `json:"creatorId"`
CreatedTs int64 `json:"createdTs"`
// Domain specific fields
Type ActivityType `json:"type"`
Level ActivityLevel `json:"level"`
Payload string `json:"payload"`
}
// ActivityCreate is the API message for creating an activity.
type ActivityCreate struct {
// Standard fields
CreatorID int
// Domain specific fields
Type ActivityType `json:"type"`
Level ActivityLevel
Payload string `json:"payload"`
}

View File

@@ -1,17 +0,0 @@
package api
type SignIn struct {
Username string `json:"username"`
Password string `json:"password"`
}
type SSOSignIn struct {
IdentityProviderID int `json:"identityProviderId"`
Code string `json:"code"`
RedirectURI string `json:"redirectUri"`
}
type SignUp struct {
Username string `json:"username"`
Password string `json:"password"`
}

View File

@@ -1,24 +0,0 @@
package api
// UnknownID is the ID for unknowns.
const UnknownID = -1
// RowStatus is the status for a row.
type RowStatus string
const (
// Normal is the status for a normal row.
Normal RowStatus = "NORMAL"
// Archived is the status for an archived row.
Archived RowStatus = "ARCHIVED"
)
func (e RowStatus) String() string {
switch e {
case Normal:
return "NORMAL"
case Archived:
return "ARCHIVED"
}
return ""
}

View File

@@ -1,58 +0,0 @@
package api
type IdentityProviderType string
const (
IdentityProviderOAuth2 IdentityProviderType = "OAUTH2"
)
type IdentityProviderConfig struct {
OAuth2Config *IdentityProviderOAuth2Config `json:"oauth2Config"`
}
type IdentityProviderOAuth2Config struct {
ClientID string `json:"clientId"`
ClientSecret string `json:"clientSecret"`
AuthURL string `json:"authUrl"`
TokenURL string `json:"tokenUrl"`
UserInfoURL string `json:"userInfoUrl"`
Scopes []string `json:"scopes"`
FieldMapping *FieldMapping `json:"fieldMapping"`
}
type FieldMapping struct {
Identifier string `json:"identifier"`
DisplayName string `json:"displayName"`
Email string `json:"email"`
}
type IdentityProvider struct {
ID int `json:"id"`
Name string `json:"name"`
Type IdentityProviderType `json:"type"`
IdentifierFilter string `json:"identifierFilter"`
Config *IdentityProviderConfig `json:"config"`
}
type IdentityProviderCreate struct {
Name string `json:"name"`
Type IdentityProviderType `json:"type"`
IdentifierFilter string `json:"identifierFilter"`
Config *IdentityProviderConfig `json:"config"`
}
type IdentityProviderFind struct {
ID *int
}
type IdentityProviderPatch struct {
ID int
Type IdentityProviderType `json:"type"`
Name *string `json:"name"`
IdentifierFilter *string `json:"identifierFilter"`
Config *IdentityProviderConfig `json:"config"`
}
type IdentityProviderDelete struct {
ID int
}

View File

@@ -1,97 +0,0 @@
package api
// MaxContentLength means the max memo content bytes is 1MB.
const MaxContentLength = 1 << 30
// Visibility is the type of a visibility.
type Visibility string
const (
// Public is the PUBLIC visibility.
Public Visibility = "PUBLIC"
// Protected is the PROTECTED visibility.
Protected Visibility = "PROTECTED"
// Private is the PRIVATE visibility.
Private Visibility = "PRIVATE"
)
func (e Visibility) String() string {
switch e {
case Public:
return "PUBLIC"
case Protected:
return "PROTECTED"
case Private:
return "PRIVATE"
}
return "PRIVATE"
}
type Memo struct {
ID int `json:"id"`
// Standard fields
RowStatus RowStatus `json:"rowStatus"`
CreatorID int `json:"creatorId"`
CreatedTs int64 `json:"createdTs"`
UpdatedTs int64 `json:"updatedTs"`
// Domain specific fields
Content string `json:"content"`
Visibility Visibility `json:"visibility"`
Pinned bool `json:"pinned"`
// Related fields
CreatorName string `json:"creatorName"`
ResourceList []*Resource `json:"resourceList"`
}
type MemoCreate struct {
// Standard fields
CreatorID int `json:"-"`
CreatedTs *int64 `json:"createdTs"`
// Domain specific fields
Visibility Visibility `json:"visibility"`
Content string `json:"content"`
// Related fields
ResourceIDList []int `json:"resourceIdList"`
}
type MemoPatch struct {
ID int `json:"-"`
// Standard fields
CreatedTs *int64 `json:"createdTs"`
UpdatedTs *int64
RowStatus *RowStatus `json:"rowStatus"`
// Domain specific fields
Content *string `json:"content"`
Visibility *Visibility `json:"visibility"`
// Related fields
ResourceIDList []int `json:"resourceIdList"`
}
type MemoFind struct {
ID *int
// Standard fields
RowStatus *RowStatus
CreatorID *int
// Domain specific fields
Pinned *bool
ContentSearch *string
VisibilityList []Visibility
// Pagination
Limit *int
Offset *int
}
type MemoDelete struct {
ID int
}

View File

@@ -1,26 +0,0 @@
package api
type MemoOrganizer struct {
ID int
// Domain specific fields
MemoID int
UserID int
Pinned bool
}
type MemoOrganizerUpsert struct {
MemoID int `json:"-"`
UserID int `json:"-"`
Pinned bool `json:"pinned"`
}
type MemoOrganizerFind struct {
MemoID int
UserID int
}
type MemoOrganizerDelete struct {
MemoID *int
UserID *int
}

View File

@@ -1,24 +0,0 @@
package api
type MemoResource struct {
MemoID int
ResourceID int
CreatedTs int64
UpdatedTs int64
}
type MemoResourceUpsert struct {
MemoID int `json:"-"`
ResourceID int
UpdatedTs *int64
}
type MemoResourceFind struct {
MemoID *int
ResourceID *int
}
type MemoResourceDelete struct {
MemoID *int
ResourceID *int
}

View File

@@ -1,69 +0,0 @@
package api
type Resource struct {
ID int `json:"id"`
// Standard fields
CreatorID int `json:"creatorId"`
CreatedTs int64 `json:"createdTs"`
UpdatedTs int64 `json:"updatedTs"`
// Domain specific fields
Filename string `json:"filename"`
Blob []byte `json:"-"`
InternalPath string `json:"internalPath"`
ExternalLink string `json:"externalLink"`
Type string `json:"type"`
Size int64 `json:"size"`
PublicID string `json:"publicId"`
// Related fields
LinkedMemoAmount int `json:"linkedMemoAmount"`
}
type ResourceCreate struct {
// Standard fields
CreatorID int `json:"-"`
// Domain specific fields
Filename string `json:"filename"`
Blob []byte `json:"-"`
InternalPath string `json:"internalPath"`
ExternalLink string `json:"externalLink"`
Type string `json:"type"`
Size int64 `json:"-"`
PublicID string `json:"publicId"`
}
type ResourceFind struct {
ID *int `json:"id"`
// Standard fields
CreatorID *int `json:"creatorId"`
// Domain specific fields
Filename *string `json:"filename"`
MemoID *int
PublicID *string `json:"publicId"`
GetBlob bool
// Pagination
Limit *int
Offset *int
}
type ResourcePatch struct {
ID int `json:"-"`
// Standard fields
UpdatedTs *int64
// Domain specific fields
Filename *string `json:"filename"`
ResetPublicID *bool `json:"resetPublicId"`
PublicID *string `json:"-"`
}
type ResourceDelete struct {
ID int
}

View File

@@ -1,53 +0,0 @@
package api
type Shortcut struct {
ID int `json:"id"`
// Standard fields
RowStatus RowStatus `json:"rowStatus"`
CreatorID int `json:"creatorId"`
CreatedTs int64 `json:"createdTs"`
UpdatedTs int64 `json:"updatedTs"`
// Domain specific fields
Title string `json:"title"`
Payload string `json:"payload"`
}
type ShortcutCreate struct {
// Standard fields
CreatorID int `json:"-"`
// Domain specific fields
Title string `json:"title"`
Payload string `json:"payload"`
}
type ShortcutPatch struct {
ID int `json:"-"`
// Standard fields
UpdatedTs *int64
RowStatus *RowStatus `json:"rowStatus"`
// Domain specific fields
Title *string `json:"title"`
Payload *string `json:"payload"`
}
type ShortcutFind struct {
ID *int
// Standard fields
CreatorID *int
// Domain specific fields
Title *string `json:"title"`
}
type ShortcutDelete struct {
ID *int
// Standard fields
CreatorID *int
}

View File

@@ -1,57 +0,0 @@
package api
const (
// LocalStorage means the storage service is local file system.
LocalStorage = -1
// DatabaseStorage means the storage service is database.
DatabaseStorage = 0
)
type StorageType string
const (
StorageS3 StorageType = "S3"
)
type StorageConfig struct {
S3Config *StorageS3Config `json:"s3Config"`
}
type StorageS3Config struct {
EndPoint string `json:"endPoint"`
Path string `json:"path"`
Region string `json:"region"`
AccessKey string `json:"accessKey"`
SecretKey string `json:"secretKey"`
Bucket string `json:"bucket"`
URLPrefix string `json:"urlPrefix"`
URLSuffix string `json:"urlSuffix"`
}
type Storage struct {
ID int `json:"id"`
Name string `json:"name"`
Type StorageType `json:"type"`
Config *StorageConfig `json:"config"`
}
type StorageCreate struct {
Name string `json:"name"`
Type StorageType `json:"type"`
Config *StorageConfig `json:"config"`
}
type StoragePatch struct {
ID int `json:"id"`
Type StorageType `json:"type"`
Name *string `json:"name"`
Config *StorageConfig `json:"config"`
}
type StorageFind struct {
ID *int `json:"id"`
}
type StorageDelete struct {
ID int `json:"id"`
}

View File

@@ -1,27 +0,0 @@
package api
import "github.com/usememos/memos/server/profile"
type SystemStatus struct {
Host *User `json:"host"`
Profile profile.Profile `json:"profile"`
DBSize int64 `json:"dbSize"`
// System settings
// Allow sign up.
AllowSignUp bool `json:"allowSignUp"`
// Ignore upgrade
IgnoreUpgrade bool `json:"ignoreUpgrade"`
// Disable public memos.
DisablePublicMemos bool `json:"disablePublicMemos"`
// Additional style.
AdditionalStyle string `json:"additionalStyle"`
// Additional script.
AdditionalScript string `json:"additionalScript"`
// Customized server profile, including server name and external url.
CustomizedProfile CustomizedProfile `json:"customizedProfile"`
// Storage service ID.
StorageServiceID int `json:"storageServiceId"`
// Local storage path
LocalStoragePath string `json:"localStoragePath"`
}

View File

@@ -1,180 +0,0 @@
package api
import (
"encoding/json"
"errors"
"fmt"
"golang.org/x/exp/slices"
)
type SystemSettingName string
const (
// SystemSettingServerIDName is the name of server id.
SystemSettingServerIDName SystemSettingName = "server-id"
// SystemSettingSecretSessionName is the name of secret session.
SystemSettingSecretSessionName SystemSettingName = "secret-session"
// SystemSettingAllowSignUpName is the name of allow signup setting.
SystemSettingAllowSignUpName SystemSettingName = "allow-signup"
// SystemSettingIgnoreUpgradeName is the name of ignore upgrade.
SystemSettingIgnoreUpgradeName SystemSettingName = "ignore-upgrade"
// SystemSettingDisablePublicMemosName is the name of disable public memos setting.
SystemSettingDisablePublicMemosName SystemSettingName = "disable-public-memos"
// SystemSettingAdditionalStyleName is the name of additional style.
SystemSettingAdditionalStyleName SystemSettingName = "additional-style"
// SystemSettingAdditionalScriptName is the name of additional script.
SystemSettingAdditionalScriptName SystemSettingName = "additional-script"
// SystemSettingCustomizedProfileName is the name of customized server profile.
SystemSettingCustomizedProfileName SystemSettingName = "customized-profile"
// SystemSettingStorageServiceIDName is the name of storage service ID.
SystemSettingStorageServiceIDName SystemSettingName = "storage-service-id"
// SystemSettingLocalStoragePathName is the name of local storage path.
SystemSettingLocalStoragePathName SystemSettingName = "local-storage-path"
// SystemSettingOpenAIConfigName is the name of OpenAI config.
SystemSettingOpenAIConfigName SystemSettingName = "openai-config"
)
// CustomizedProfile is the struct definition for SystemSettingCustomizedProfileName system setting item.
type CustomizedProfile struct {
// Name is the server name, default is `memos`
Name string `json:"name"`
// LogoURL is the url of logo image.
LogoURL string `json:"logoUrl"`
// Description is the server description.
Description string `json:"description"`
// Locale is the server default locale.
Locale string `json:"locale"`
// Appearance is the server default appearance.
Appearance string `json:"appearance"`
// ExternalURL is the external url of server. e.g. https://usermemos.com
ExternalURL string `json:"externalUrl"`
}
type OpenAIConfig struct {
Key string `json:"key"`
Host string `json:"host"`
}
func (key SystemSettingName) String() string {
switch key {
case SystemSettingServerIDName:
return "server-id"
case SystemSettingSecretSessionName:
return "secret-session"
case SystemSettingAllowSignUpName:
return "allow-signup"
case SystemSettingIgnoreUpgradeName:
return "ignore-upgrade"
case SystemSettingDisablePublicMemosName:
return "disable-public-memos"
case SystemSettingAdditionalStyleName:
return "additional-style"
case SystemSettingAdditionalScriptName:
return "additional-script"
case SystemSettingCustomizedProfileName:
return "customized-profile"
case SystemSettingStorageServiceIDName:
return "storage-service-id"
case SystemSettingLocalStoragePathName:
return "local-storage-path"
case SystemSettingOpenAIConfigName:
return "openai-config"
}
return ""
}
type SystemSetting struct {
Name SystemSettingName `json:"name"`
// Value is a JSON string with basic value.
Value string `json:"value"`
Description string `json:"description"`
}
type SystemSettingUpsert struct {
Name SystemSettingName `json:"name"`
Value string `json:"value"`
Description string `json:"description"`
}
func (upsert SystemSettingUpsert) Validate() error {
if upsert.Name == SystemSettingServerIDName {
return errors.New("update server id is not allowed")
} else if upsert.Name == SystemSettingAllowSignUpName {
value := false
err := json.Unmarshal([]byte(upsert.Value), &value)
if err != nil {
return fmt.Errorf("failed to unmarshal system setting allow signup value")
}
} else if upsert.Name == SystemSettingIgnoreUpgradeName {
value := false
err := json.Unmarshal([]byte(upsert.Value), &value)
if err != nil {
return fmt.Errorf("failed to unmarshal system setting ignore upgrade value")
}
} else if upsert.Name == SystemSettingDisablePublicMemosName {
value := false
err := json.Unmarshal([]byte(upsert.Value), &value)
if err != nil {
return fmt.Errorf("failed to unmarshal system setting disable public memos value")
}
} else if upsert.Name == SystemSettingAdditionalStyleName {
value := ""
err := json.Unmarshal([]byte(upsert.Value), &value)
if err != nil {
return fmt.Errorf("failed to unmarshal system setting additional style value")
}
} else if upsert.Name == SystemSettingAdditionalScriptName {
value := ""
err := json.Unmarshal([]byte(upsert.Value), &value)
if err != nil {
return fmt.Errorf("failed to unmarshal system setting additional script value")
}
} else if upsert.Name == SystemSettingCustomizedProfileName {
customizedProfile := CustomizedProfile{
Name: "memos",
LogoURL: "",
Description: "",
Locale: "en",
Appearance: "system",
ExternalURL: "",
}
err := json.Unmarshal([]byte(upsert.Value), &customizedProfile)
if err != nil {
return fmt.Errorf("failed to unmarshal system setting customized profile value")
}
if !slices.Contains(UserSettingLocaleValue, customizedProfile.Locale) {
return fmt.Errorf("invalid locale value")
}
if !slices.Contains(UserSettingAppearanceValue, customizedProfile.Appearance) {
return fmt.Errorf("invalid appearance value")
}
} else if upsert.Name == SystemSettingStorageServiceIDName {
value := DatabaseStorage
err := json.Unmarshal([]byte(upsert.Value), &value)
if err != nil {
return fmt.Errorf("failed to unmarshal system setting storage service id value")
}
return nil
} else if upsert.Name == SystemSettingLocalStoragePathName {
value := ""
err := json.Unmarshal([]byte(upsert.Value), &value)
if err != nil {
return fmt.Errorf("failed to unmarshal system setting local storage path value")
}
} else if upsert.Name == SystemSettingOpenAIConfigName {
value := OpenAIConfig{}
err := json.Unmarshal([]byte(upsert.Value), &value)
if err != nil {
return fmt.Errorf("failed to unmarshal system setting openai api config value")
}
} else {
return fmt.Errorf("invalid system setting name")
}
return nil
}
type SystemSettingFind struct {
Name SystemSettingName `json:"name"`
}

View File

@@ -1,20 +0,0 @@
package api
type Tag struct {
Name string
CreatorID int
}
type TagUpsert struct {
Name string
CreatorID int `json:"-"`
}
type TagFind struct {
CreatorID int
}
type TagDelete struct {
Name string `json:"name"`
CreatorID int
}

View File

@@ -1,158 +0,0 @@
package api
import (
"fmt"
"github.com/usememos/memos/common"
)
// Role is the type of a role.
type Role string
const (
// Host is the HOST role.
Host Role = "HOST"
// Admin is the ADMIN role.
Admin Role = "ADMIN"
// NormalUser is the USER role.
NormalUser Role = "USER"
)
func (e Role) String() string {
switch e {
case Host:
return "HOST"
case Admin:
return "ADMIN"
case NormalUser:
return "USER"
}
return "USER"
}
type User struct {
ID int `json:"id"`
// Standard fields
RowStatus RowStatus `json:"rowStatus"`
CreatedTs int64 `json:"createdTs"`
UpdatedTs int64 `json:"updatedTs"`
// Domain specific fields
Username string `json:"username"`
Role Role `json:"role"`
Email string `json:"email"`
Nickname string `json:"nickname"`
PasswordHash string `json:"-"`
OpenID string `json:"openId"`
AvatarURL string `json:"avatarUrl"`
UserSettingList []*UserSetting `json:"userSettingList"`
}
type UserCreate struct {
// Domain specific fields
Username string `json:"username"`
Role Role `json:"role"`
Email string `json:"email"`
Nickname string `json:"nickname"`
Password string `json:"password"`
PasswordHash string
OpenID string
}
func (create UserCreate) Validate() error {
if len(create.Username) < 3 {
return fmt.Errorf("username is too short, minimum length is 3")
}
if len(create.Username) > 32 {
return fmt.Errorf("username is too long, maximum length is 32")
}
if len(create.Password) < 3 {
return fmt.Errorf("password is too short, minimum length is 6")
}
if len(create.Password) > 512 {
return fmt.Errorf("password is too long, maximum length is 512")
}
if len(create.Nickname) > 64 {
return fmt.Errorf("nickname is too long, maximum length is 64")
}
if create.Email != "" {
if len(create.Email) > 256 {
return fmt.Errorf("email is too long, maximum length is 256")
}
if !common.ValidateEmail(create.Email) {
return fmt.Errorf("invalid email format")
}
}
return nil
}
type UserPatch struct {
ID int `json:"-"`
// Standard fields
UpdatedTs *int64
RowStatus *RowStatus `json:"rowStatus"`
// Domain specific fields
Username *string `json:"username"`
Email *string `json:"email"`
Nickname *string `json:"nickname"`
Password *string `json:"password"`
ResetOpenID *bool `json:"resetOpenId"`
AvatarURL *string `json:"avatarUrl"`
PasswordHash *string
OpenID *string
}
func (patch UserPatch) Validate() error {
if patch.Username != nil && len(*patch.Username) < 3 {
return fmt.Errorf("username is too short, minimum length is 3")
}
if patch.Username != nil && len(*patch.Username) > 32 {
return fmt.Errorf("username is too long, maximum length is 32")
}
if patch.Password != nil && len(*patch.Password) < 3 {
return fmt.Errorf("password is too short, minimum length is 6")
}
if patch.Password != nil && len(*patch.Password) > 512 {
return fmt.Errorf("password is too long, maximum length is 512")
}
if patch.Nickname != nil && len(*patch.Nickname) > 64 {
return fmt.Errorf("nickname is too long, maximum length is 64")
}
if patch.AvatarURL != nil {
if len(*patch.AvatarURL) > 2<<20 {
return fmt.Errorf("avatar is too large, maximum is 2MB")
}
}
if patch.Email != nil && *patch.Email != "" {
if len(*patch.Email) > 256 {
return fmt.Errorf("email is too long, maximum length is 256")
}
if !common.ValidateEmail(*patch.Email) {
return fmt.Errorf("invalid email format")
}
}
return nil
}
type UserFind struct {
ID *int `json:"id"`
// Standard fields
RowStatus *RowStatus `json:"rowStatus"`
// Domain specific fields
Username *string `json:"username"`
Role *Role
Email *string `json:"email"`
Nickname *string `json:"nickname"`
OpenID *string
}
type UserDelete struct {
ID int
}

View File

@@ -1,114 +0,0 @@
package api
import (
"encoding/json"
"fmt"
"golang.org/x/exp/slices"
)
type UserSettingKey string
const (
// UserSettingLocaleKey is the key type for user locale.
UserSettingLocaleKey UserSettingKey = "locale"
// UserSettingAppearanceKey is the key type for user appearance.
UserSettingAppearanceKey UserSettingKey = "appearance"
// UserSettingMemoVisibilityKey is the key type for user preference memo default visibility.
UserSettingMemoVisibilityKey UserSettingKey = "memo-visibility"
)
// String returns the string format of UserSettingKey type.
func (key UserSettingKey) String() string {
switch key {
case UserSettingLocaleKey:
return "locale"
case UserSettingAppearanceKey:
return "appearance"
case UserSettingMemoVisibilityKey:
return "memo-visibility"
}
return ""
}
var (
UserSettingLocaleValue = []string{
"de",
"en",
"es",
"fr",
"it",
"ko",
"nl",
"pl",
"pt-BR",
"ru",
"sl",
"sv",
"tr",
"uk",
"vi",
"zh-Hans",
"zh-Hant",
}
UserSettingAppearanceValue = []string{"system", "light", "dark"}
UserSettingMemoVisibilityValue = []Visibility{Private, Protected, Public}
)
type UserSetting struct {
UserID int
Key UserSettingKey `json:"key"`
// Value is a JSON string with basic value
Value string `json:"value"`
}
type UserSettingUpsert struct {
UserID int `json:"-"`
Key UserSettingKey `json:"key"`
Value string `json:"value"`
}
func (upsert UserSettingUpsert) Validate() error {
if upsert.Key == UserSettingLocaleKey {
localeValue := "en"
err := json.Unmarshal([]byte(upsert.Value), &localeValue)
if err != nil {
return fmt.Errorf("failed to unmarshal user setting locale value")
}
if !slices.Contains(UserSettingLocaleValue, localeValue) {
return fmt.Errorf("invalid user setting locale value")
}
} else if upsert.Key == UserSettingAppearanceKey {
appearanceValue := "system"
err := json.Unmarshal([]byte(upsert.Value), &appearanceValue)
if err != nil {
return fmt.Errorf("failed to unmarshal user setting appearance value")
}
if !slices.Contains(UserSettingAppearanceValue, appearanceValue) {
return fmt.Errorf("invalid user setting appearance value")
}
} else if upsert.Key == UserSettingMemoVisibilityKey {
memoVisibilityValue := Private
err := json.Unmarshal([]byte(upsert.Value), &memoVisibilityValue)
if err != nil {
return fmt.Errorf("failed to unmarshal user setting memo visibility value")
}
if !slices.Contains(UserSettingMemoVisibilityValue, memoVisibilityValue) {
return fmt.Errorf("invalid user setting memo visibility value")
}
} else {
return fmt.Errorf("invalid user setting key")
}
return nil
}
type UserSettingFind struct {
UserID int
Key UserSettingKey `json:"key"`
}
type UserSettingDelete struct {
UserID int
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 KiB

177
bin/memos/main.go Normal file
View File

@@ -0,0 +1,177 @@
package main
import (
"context"
"fmt"
"log/slog"
"net/http"
"os"
"os/signal"
"syscall"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/usememos/memos/server"
"github.com/usememos/memos/server/profile"
"github.com/usememos/memos/server/version"
"github.com/usememos/memos/store"
"github.com/usememos/memos/store/db"
)
const (
greetingBanner = `
███╗ ███╗███████╗███╗ ███╗ ██████╗ ███████╗
████╗ ████║██╔════╝████╗ ████║██╔═══██╗██╔════╝
██╔████╔██║█████╗ ██╔████╔██║██║ ██║███████╗
██║╚██╔╝██║██╔══╝ ██║╚██╔╝██║██║ ██║╚════██║
██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║╚██████╔╝███████║
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝
`
)
var (
rootCmd = &cobra.Command{
Use: "memos",
Short: `An open source, lightweight note-taking service. Easily capture and share your great thoughts.`,
Run: func(_ *cobra.Command, _ []string) {
instanceProfile := &profile.Profile{
Mode: viper.GetString("mode"),
Addr: viper.GetString("addr"),
Port: viper.GetInt("port"),
Data: viper.GetString("data"),
Driver: viper.GetString("driver"),
DSN: viper.GetString("dsn"),
InstanceURL: viper.GetString("instance-url"),
Version: version.GetCurrentVersion(viper.GetString("mode")),
}
if err := instanceProfile.Validate(); err != nil {
panic(err)
}
ctx, cancel := context.WithCancel(context.Background())
dbDriver, err := db.NewDBDriver(instanceProfile)
if err != nil {
cancel()
slog.Error("failed to create db driver", "error", err)
return
}
storeInstance := store.New(dbDriver, instanceProfile)
if err := storeInstance.Migrate(ctx); err != nil {
cancel()
slog.Error("failed to migrate", "error", err)
return
}
s, err := server.NewServer(ctx, instanceProfile, storeInstance)
if err != nil {
cancel()
slog.Error("failed to create server", "error", err)
return
}
c := make(chan os.Signal, 1)
// Trigger graceful shutdown on SIGINT or SIGTERM.
// The default signal sent by the `kill` command is SIGTERM,
// which is taken as the graceful shutdown signal for many systems, eg., Kubernetes, Gunicorn.
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
if err := s.Start(ctx); err != nil {
if err != http.ErrServerClosed {
slog.Error("failed to start server", "error", err)
cancel()
}
}
printGreetings(instanceProfile)
go func() {
<-c
s.Shutdown(ctx)
cancel()
}()
// Wait for CTRL-C.
<-ctx.Done()
},
}
)
func init() {
viper.SetDefault("mode", "dev")
viper.SetDefault("driver", "sqlite")
viper.SetDefault("port", 8081)
rootCmd.PersistentFlags().String("mode", "dev", `mode of server, can be "prod" or "dev" or "demo"`)
rootCmd.PersistentFlags().String("addr", "", "address of server")
rootCmd.PersistentFlags().Int("port", 8081, "port of server")
rootCmd.PersistentFlags().String("data", "", "data directory")
rootCmd.PersistentFlags().String("driver", "sqlite", "database driver")
rootCmd.PersistentFlags().String("dsn", "", "database source name(aka. DSN)")
rootCmd.PersistentFlags().String("instance-url", "", "the url of your memos instance")
if err := viper.BindPFlag("mode", rootCmd.PersistentFlags().Lookup("mode")); err != nil {
panic(err)
}
if err := viper.BindPFlag("addr", rootCmd.PersistentFlags().Lookup("addr")); err != nil {
panic(err)
}
if err := viper.BindPFlag("port", rootCmd.PersistentFlags().Lookup("port")); err != nil {
panic(err)
}
if err := viper.BindPFlag("data", rootCmd.PersistentFlags().Lookup("data")); err != nil {
panic(err)
}
if err := viper.BindPFlag("driver", rootCmd.PersistentFlags().Lookup("driver")); err != nil {
panic(err)
}
if err := viper.BindPFlag("dsn", rootCmd.PersistentFlags().Lookup("dsn")); err != nil {
panic(err)
}
if err := viper.BindPFlag("instance-url", rootCmd.PersistentFlags().Lookup("instance-url")); err != nil {
panic(err)
}
viper.SetEnvPrefix("memos")
viper.AutomaticEnv()
if err := viper.BindEnv("instance-url", "MEMOS_INSTANCE_URL"); err != nil {
panic(err)
}
}
func printGreetings(profile *profile.Profile) {
if profile.IsDev() {
println("Development mode is enabled")
println("DSN: ", profile.DSN)
}
fmt.Printf(`---
Server profile
version: %s
data: %s
addr: %s
port: %d
mode: %s
driver: %s
---
`, profile.Version, profile.Data, profile.Addr, profile.Port, profile.Mode, profile.Driver)
print(greetingBanner)
if len(profile.Addr) == 0 {
fmt.Printf("Version %s has been started on port %d\n", profile.Version, profile.Port)
} else {
fmt.Printf("Version %s has been started on address '%s' and port %d\n", profile.Version, profile.Addr, profile.Port)
}
fmt.Printf(`---
See more in:
👉Website: %s
👉GitHub: %s
---
`, "https://usememos.com", "https://github.com/usememos/memos")
}
func main() {
if err := rootCmd.Execute(); err != nil {
panic(err)
}
}

View File

@@ -1,166 +0,0 @@
package cmd
import (
"context"
"fmt"
"net/http"
"os"
"os/signal"
"syscall"
"time"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/usememos/memos/server"
_profile "github.com/usememos/memos/server/profile"
"github.com/usememos/memos/setup"
"github.com/usememos/memos/store"
"github.com/usememos/memos/store/db"
)
const (
greetingBanner = `
███╗ ███╗███████╗███╗ ███╗ ██████╗ ███████╗
████╗ ████║██╔════╝████╗ ████║██╔═══██╗██╔════╝
██╔████╔██║█████╗ ██╔████╔██║██║ ██║███████╗
██║╚██╔╝██║██╔══╝ ██║╚██╔╝██║██║ ██║╚════██║
██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║╚██████╔╝███████║
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝
`
)
var (
profile *_profile.Profile
mode string
port int
data string
rootCmd = &cobra.Command{
Use: "memos",
Short: `An open-source, self-hosted memo hub with knowledge management and social networking.`,
Run: func(_cmd *cobra.Command, _args []string) {
ctx, cancel := context.WithCancel(context.Background())
s, err := server.NewServer(ctx, profile)
if err != nil {
cancel()
fmt.Printf("failed to create server, error: %+v\n", err)
return
}
c := make(chan os.Signal, 1)
// Trigger graceful shutdown on SIGINT or SIGTERM.
// The default signal sent by the `kill` command is SIGTERM,
// which is taken as the graceful shutdown signal for many systems, eg., Kubernetes, Gunicorn.
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
go func() {
sig := <-c
fmt.Printf("%s received.\n", sig.String())
s.Shutdown(ctx)
cancel()
}()
println(greetingBanner)
fmt.Printf("Version %s has started at :%d\n", profile.Version, profile.Port)
if err := s.Start(ctx); err != nil {
if err != http.ErrServerClosed {
fmt.Printf("failed to start server, error: %+v\n", err)
cancel()
}
}
// Wait for CTRL-C.
<-ctx.Done()
},
}
setupCmd = &cobra.Command{
Use: "setup",
Short: "Make initial setup for memos",
Run: func(cmd *cobra.Command, _ []string) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
hostUsername, err := cmd.Flags().GetString(setupCmdFlagHostUsername)
if err != nil {
fmt.Printf("failed to get owner username, error: %+v\n", err)
return
}
hostPassword, err := cmd.Flags().GetString(setupCmdFlagHostPassword)
if err != nil {
fmt.Printf("failed to get owner password, error: %+v\n", err)
return
}
db := db.NewDB(profile)
if err := db.Open(ctx); err != nil {
fmt.Printf("failed to open db, error: %+v\n", err)
return
}
store := store.New(db.DBInstance, profile)
if err := setup.Execute(ctx, store, hostUsername, hostPassword); err != nil {
fmt.Printf("failed to setup, error: %+v\n", err)
return
}
},
}
)
func Execute() error {
return rootCmd.Execute()
}
func init() {
cobra.OnInitialize(initConfig)
rootCmd.PersistentFlags().StringVarP(&mode, "mode", "m", "demo", `mode of server, can be "prod" or "dev" or "demo"`)
rootCmd.PersistentFlags().IntVarP(&port, "port", "p", 8081, "port of server")
rootCmd.PersistentFlags().StringVarP(&data, "data", "d", "", "data directory")
err := viper.BindPFlag("mode", rootCmd.PersistentFlags().Lookup("mode"))
if err != nil {
panic(err)
}
err = viper.BindPFlag("port", rootCmd.PersistentFlags().Lookup("port"))
if err != nil {
panic(err)
}
err = viper.BindPFlag("data", rootCmd.PersistentFlags().Lookup("data"))
if err != nil {
panic(err)
}
viper.SetDefault("mode", "demo")
viper.SetDefault("port", 8081)
viper.SetEnvPrefix("memos")
setupCmd.Flags().String(setupCmdFlagHostUsername, "", "Owner username")
setupCmd.Flags().String(setupCmdFlagHostPassword, "", "Owner password")
rootCmd.AddCommand(setupCmd)
}
func initConfig() {
viper.AutomaticEnv()
var err error
profile, err = _profile.GetProfile()
if err != nil {
fmt.Printf("failed to get profile, error: %+v\n", err)
return
}
println("---")
println("Server profile")
println("dsn:", profile.DSN)
println("port:", profile.Port)
println("mode:", profile.Mode)
println("version:", profile.Version)
println("---")
}
const (
setupCmdFlagHostUsername = "host-username"
setupCmdFlagHostPassword = "host-password"
)

View File

@@ -1,72 +0,0 @@
package common
import (
"errors"
)
// Code is the error code.
type Code int
// Application error codes.
const (
// 0 ~ 99 general error.
Ok Code = 0
Internal Code = 1
NotAuthorized Code = 2
Invalid Code = 3
NotFound Code = 4
Conflict Code = 5
NotImplemented Code = 6
)
// Error represents an application-specific error. Application errors can be
// unwrapped by the caller to extract out the code & message.
//
// Any non-application error (such as a disk error) should be reported as an
// Internal error and the human user should only see "Internal error" as the
// message. These low-level internal error details should only be logged and
// reported to the operator of the application (not the end user).
type Error struct {
// Machine-readable error code.
Code Code
// Embedded error.
Err error
}
// Error implements the error interface. Not used by the application otherwise.
func (e *Error) Error() string {
return e.Err.Error()
}
// ErrorCode unwraps an application error and returns its code.
// Non-application errors always return EINTERNAL.
func ErrorCode(err error) Code {
var e *Error
if err == nil {
return Ok
} else if errors.As(err, &e) {
return e.Code
}
return Internal
}
// ErrorMessage unwraps an application error and returns its message.
// Non-application errors always return "Internal error".
func ErrorMessage(err error) string {
var e *Error
if err == nil {
return ""
} else if errors.As(err, &e) {
return e.Err.Error()
}
return "Internal error."
}
// Errorf is a helper function to return an Error with a given code and error.
func Errorf(code Code, err error) *Error {
return &Error{
Code: code,
Err: err,
}
}

View File

@@ -1,67 +0,0 @@
// Package log implements a simple logging package.
package log
import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
var (
// `gl` is the global logger.
// Other packages should use public methods such as Info/Error to do the logging.
// For other types of logging, e.g. logging to a separate file, they should use their own loggers.
gl *zap.Logger
gLevel zap.AtomicLevel
)
// Initializes the global console logger.
func init() {
gLevel = zap.NewAtomicLevelAt(zap.InfoLevel)
gl, _ = zap.Config{
Level: gLevel,
Development: true,
// Use "console" to print readable stacktrace.
Encoding: "console",
EncoderConfig: zap.NewDevelopmentEncoderConfig(),
OutputPaths: []string{"stderr"},
ErrorOutputPaths: []string{"stderr"},
}.Build(
// Skip one caller stack to locate the correct caller.
zap.AddCallerSkip(1),
)
}
// SetLevel wraps the zap Level's SetLevel method.
func SetLevel(level zapcore.Level) {
gLevel.SetLevel(level)
}
// EnabledLevel wraps the zap Level's Enabled method.
func EnabledLevel(level zapcore.Level) bool {
return gLevel.Enabled(level)
}
// Debug wraps the zap Logger's Debug method.
func Debug(msg string, fields ...zap.Field) {
gl.Debug(msg, fields...)
}
// Info wraps the zap Logger's Info method.
func Info(msg string, fields ...zap.Field) {
gl.Info(msg, fields...)
}
// Warn wraps the zap Logger's Warn method.
func Warn(msg string, fields ...zap.Field) {
gl.Warn(msg, fields...)
}
// Error wraps the zap Logger's Error method.
func Error(msg string, fields ...zap.Field) {
gl.Error(msg, fields...)
}
// Sync wraps the zap Logger's Sync method.
func Sync() {
_ = gl.Sync()
}

View File

@@ -1,17 +0,0 @@
version: "3.0"
# uffizzi integration
x-uffizzi:
ingress:
service: memos
port: 5230
services:
memos:
image: "${MEMOS_IMAGE}"
volumes:
- memos_volume:/var/opt/memos
command: ["--mode", "demo"]
volumes:
memos_volume:

View File

@@ -1,18 +0,0 @@
# Adding A Custom Theme
1. Open the Settings Dialog
2. Navigate to the System Tab
3. In the "Additional Styles" box add these lines of code:
```css
.memo-list-container {
background-color: #INSERT COLOR HERE;
}
.page-container {
background-color: #INSERT COLOR HERE;
}
```
It is recommended that you choose the same color for both options
4. Refresh the page and the background color of your memos app will successfully update to reflect your changes

View File

@@ -1,133 +0,0 @@
# A Beginner's Guide to Deploying Memos on Render.com
written by [AJ](https://memos.ajstephens.website/) (also a noob)
<img height="64px" src="https://usememos.com/logo-full.png" alt="✍️ memos" />
[Live Demo](https://demo.usememos.com) • [Official Website](https://usememos.com) • [Source Code](https://github.com/usememos/memos)
## Who is this guide for?
Someone who...
- doesn't have much experience with self hosting
- has a minimal understanding of docker
Someone who wants...
- to use memos
- to support the memos project
- a cost effective and simple way to host it on the cloud with reliablity and persistance
- to share memos with friends
## Requirements
- Can follow instructions
- Have 7ish USD a month on a debit/credit card
## Guide
Create an account at [Render](https://dashboard.render.com/register)
![ss1](https://i.imgur.com/l3K7aqC.png)
1. Go to your dashboard
[https://dashboard.render.com/](https://dashboard.render.com/)
2. Select New Web Service
![ss2](https://i.imgur.com/IIDdK2y.png)
3. Scroll down to "Public Git repository"
4. Paste in the link for the public git repository for memos (https://github.com/usememos/memos) and press continue
![ss3](https://i.imgur.com/OXoCWoJ.png)
5. Render will pre-fill most of the fields but you will need to create a unique name for your web service
6. Adjust region if you want to
7. Don't touch the "branch", "root directory", and "environment" fields
![ss4](https://i.imgur.com/v7Sw3fp.png)
8. Click "enter your payment information" and do so
![ss5](https://i.imgur.com/paKcQFl.png)
![ss6](https://i.imgur.com/JdcO1HC.png)
9. Select the starter plan ($7 a month - a requirement for persistant data - render's free instances spin down when inactive and lose all data)
10. Click "Create Web Service"
![ss7](https://i.imgur.com/MHe45J4.png)
11. Wait patiently while the _magic_ happens 🤷‍♂️
![ss8](https://i.imgur.com/h1PXHHJ.png)
12. After some time (~ 6 min for me) the build will finish and you will see the web service is live
![ss9](https://i.imgur.com/msapkRw.png)
13. Now it's time to add the disk so your data won't dissappear when the webservice redeploys (redeploys happen automatically when the public repo is updated)
14. Select the "Disks" tab on the left menu and then click "Add Disk"
![ss10](https://i.imgur.com/rGeI0bv.png)
15. Name your disk (can be whatever)
16. Set the "Mount Path" to `/var/opt/memos`
17. Set the disk size (default is 10GB but 1GB is plenty and can be increased at any time)
18. Click "Save"
![ss11](https://i.imgur.com/Jbg7O6q.png)
19. Wait...again...while the webservice redeploys with the persistant disk
![ss12](https://i.imgur.com/pTzpE34.png)
20. aaaand....we're back online!
![ss13](https://i.imgur.com/qdsFfSa.png)
21. Time to test! We're going to make sure everything is working correctly.
22. Click the link in the top left, it should look like `https://the-name-you-chose.onrender.com` - this is your self hosted memos link!
![ss14](https://i.imgur.com/cgzFSIn.png)
23. Create a Username and Password (remember these) then click "Sign up as Host"
![ss15](https://i.imgur.com/kuRStAj.png)
24. Create a test memo then click save
![ss16](https://i.imgur.com/Eh2AB44.png)
25. Sign out of your self-hosted memos
![ss17](https://i.imgur.com/0mMb88G.png)
26. Return to your Render dashboard, click the "Manual Deploy" dropdown button and click "Deploy latest commit" and wait until the webservice is live again (This is to test that your data is persistant)
![ss18](https://i.imgur.com/w1N7VTb.png)
27. Once the webservice is live go back to your self-hosted memos page and sign in! (If your memos screen looks different then something went wrong)
28. Once you're logged in, verify your test memo is still there after the redeploy
![ss19](https://i.imgur.com/dTcEQZS.png)
![ss20](https://i.imgur.com/VE2lu8H.png)
## 🎉Celebrate!🎉
You did it! Enjoy using memos!
Want to learn more or need more guidance? Join the community on [telegram](https://t.me/+-_tNF1k70UU4ZTc9) and [discord](https://discord.gg/tfPJa4UmAv).

View File

@@ -1,40 +0,0 @@
# Development
Memos is built with a curated tech stack. It is optimized for developer experience and is very easy to start working on the code:
1. It has no external dependency.
2. It requires zero config.
3. 1 command to start backend and 1 command to start frontend, both with live reload support.
## Tech Stack
![tech-stack](https://raw.githubusercontent.com/usememos/memos/main/assets/tech-stack.png)
## Prerequisites
- [Go](https://golang.org/doc/install)
- [Air](https://github.com/cosmtrek/air#installation) for backend live reload
- [Node.js](https://nodejs.org/)
- [pnpm](https://pnpm.io/installation)
## Steps
1. pull source code
```bash
git clone https://github.com/usememos/memos
```
2. start backend using air(with live reload)
```bash
air -c scripts/.air.toml
```
3. start frontend dev server
```bash
cd web && pnpm i && pnpm dev
```
Memos should now be running at [http://localhost:3001](http://localhost:3001) and change either frontend or backend code would trigger live reload.

View File

@@ -1,6 +0,0 @@
# Setup
After deploying and running Memos in `prod` mode, you should create "host" user. There are two ways to do this:
1. Navigate to the Memos application URL, such as `http://localhost:5230`, and follow the prompts to create a username and password for the "host" user.
2. Use the command `memos setup --host-username=$USERNAME --host-password=$PASSWORD --mode=prod` to set up the host user. This method may be more convenient for deploying through Ansible or other provisioning softwares.

27
entrypoint.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env sh
file_env() {
var="$1"
fileVar="${var}_FILE"
val_var="$(printenv "$var")"
val_fileVar="$(printenv "$fileVar")"
if [ -n "$val_var" ] && [ -n "$val_fileVar" ]; then
echo "error: both $var and $fileVar are set (but are exclusive)" >&2
exit 1
fi
if [ -n "$val_var" ]; then
val="$val_var"
elif [ -n "$val_fileVar" ]; then
val="$(cat "$val_fileVar")"
fi
export "$var"="$val"
unset "$fileVar"
}
file_env "MEMOS_DSN"
exec "$@"

152
go.mod
View File

@@ -1,76 +1,102 @@
module github.com/usememos/memos
go 1.19
go 1.24
require (
github.com/aws/aws-sdk-go-v2 v1.17.4
github.com/aws/aws-sdk-go-v2/config v1.18.12
github.com/aws/aws-sdk-go-v2/credentials v1.13.12
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.51
github.com/aws/aws-sdk-go-v2/service/s3 v1.30.3
github.com/google/uuid v1.3.0
github.com/gorilla/feeds v1.1.1
github.com/labstack/echo/v4 v4.9.0
github.com/mattn/go-sqlite3 v1.14.9
github.com/aws/aws-sdk-go-v2 v1.36.3
github.com/aws/aws-sdk-go-v2/config v1.29.8
github.com/aws/aws-sdk-go-v2/credentials v1.17.61
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.64
github.com/aws/aws-sdk-go-v2/service/s3 v1.78.0
github.com/go-sql-driver/mysql v1.9.0
github.com/google/cel-go v0.24.1
github.com/google/uuid v1.6.0
github.com/gorilla/feeds v1.2.0
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1
github.com/improbable-eng/grpc-web v0.15.0
github.com/joho/godotenv v1.5.1
github.com/labstack/echo/v4 v4.13.3
github.com/lib/pq v1.10.9
github.com/lithammer/shortuuid/v4 v4.2.0
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.6.1
github.com/spf13/viper v1.15.0
github.com/stretchr/testify v1.8.1
go.uber.org/zap v1.24.0
golang.org/x/crypto v0.1.0
golang.org/x/exp v0.0.0-20230111222715-75897c7a292a
golang.org/x/mod v0.6.0
golang.org/x/net v0.7.0
golang.org/x/oauth2 v0.5.0
github.com/spf13/cobra v1.9.1
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.10.0
github.com/usememos/gomark v0.0.0-20250227070400-97a73c2adb29
golang.org/x/crypto v0.35.0
golang.org/x/mod v0.23.0
golang.org/x/net v0.35.0
golang.org/x/oauth2 v0.27.0
google.golang.org/genproto/googleapis/api v0.0.0-20250227231956-55c901821b1e
google.golang.org/grpc v1.70.0
modernc.org/sqlite v1.36.0
)
require (
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.22 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.28 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.22 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.20 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.23 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.22 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.22 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.12.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.18.3 // indirect
github.com/aws/smithy-go v1.13.5 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/golang/protobuf v1.5.2 // indirect
cel.dev/expr v0.21.2 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/desertbit/timer v1.0.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/labstack/gommon v0.3.1 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/magiconair/properties v1.8.9 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.1 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/time v0.1.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rs/cors v1.11.1 // indirect
github.com/sagikazarmark/locafero v0.7.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.12.0 // indirect
github.com/spf13/cast v1.7.1 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20250228200357-dead58393ab7 // indirect
golang.org/x/image v0.24.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250227231956-55c901821b1e // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
modernc.org/libc v1.61.13 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.8.2 // indirect
nhooyr.io/websocket v1.8.17 // indirect
)
require (
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.10 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.34 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.6.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.15 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.15 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.25.0 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.29.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.33.16 // indirect
github.com/aws/smithy-go v1.22.3 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/disintegration/imaging v1.6.2
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/labstack/gommon v0.4.2 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/soheilhy/cmux v0.1.5
github.com/spf13/pflag v1.0.6 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/text v0.22.0 // indirect
golang.org/x/time v0.10.0 // indirect
google.golang.org/protobuf v1.36.5
gopkg.in/yaml.v3 v3.0.1 // indirect
)

948
go.sum

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
package util
import "regexp"
var (
UIDMatcher = regexp.MustCompile("^[a-zA-Z0-9]([a-zA-Z0-9-]{0,30}[a-zA-Z0-9])?$")
)

View File

@@ -1,14 +1,24 @@
package common
package util
import (
"crypto/rand"
"math/big"
"net/mail"
"strconv"
"strings"
"github.com/google/uuid"
)
// ConvertStringToInt32 converts a string to int32.
func ConvertStringToInt32(src string) (int32, error) {
parsed, err := strconv.ParseInt(src, 10, 32)
if err != nil {
return 0, err
}
return int32(parsed), nil
}
// HasPrefixes returns true if the string s has any of the given prefixes.
func HasPrefixes(src string, prefixes ...string) bool {
for _, prefix := range prefixes {
@@ -31,13 +41,6 @@ func GenUUID() string {
return uuid.New().String()
}
func Min(x, y int) int {
if x < y {
return x
}
return y
}
var letters = []rune("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
// RandomString returns a random string with length n.
@@ -58,3 +61,13 @@ func RandomString(n int) (string, error) {
}
return sb.String(), nil
}
// ReplaceString replaces all occurrences of old in slice with new.
func ReplaceString(slice []string, old, new string) []string {
for i, s := range slice {
if s == old {
slice[i] = new
}
}
return slice
}

View File

@@ -1,4 +1,4 @@
package common
package util
import (
"testing"
@@ -14,7 +14,7 @@ func TestValidateEmail(t *testing.T) {
want: true,
},
{
email: "@qq.com",
email: "@usememos.com",
want: false,
},
{

14
main.go
View File

@@ -1,14 +0,0 @@
package main
import (
_ "github.com/mattn/go-sqlite3"
"github.com/usememos/memos/cmd"
)
func main() {
err := cmd.Execute()
if err != nil {
panic(err)
}
}

1
plugin/cron/README.md Normal file
View File

@@ -0,0 +1 @@
Fork from https://github.com/robfig/cron

96
plugin/cron/chain.go Normal file
View File

@@ -0,0 +1,96 @@
package cron
import (
"errors"
"fmt"
"runtime"
"sync"
"time"
)
// JobWrapper decorates the given Job with some behavior.
type JobWrapper func(Job) Job
// Chain is a sequence of JobWrappers that decorates submitted jobs with
// cross-cutting behaviors like logging or synchronization.
type Chain struct {
wrappers []JobWrapper
}
// NewChain returns a Chain consisting of the given JobWrappers.
func NewChain(c ...JobWrapper) Chain {
return Chain{c}
}
// Then decorates the given job with all JobWrappers in the chain.
//
// This:
//
// NewChain(m1, m2, m3).Then(job)
//
// is equivalent to:
//
// m1(m2(m3(job)))
func (c Chain) Then(j Job) Job {
for i := range c.wrappers {
j = c.wrappers[len(c.wrappers)-i-1](j)
}
return j
}
// Recover panics in wrapped jobs and log them with the provided logger.
func Recover(logger Logger) JobWrapper {
return func(j Job) Job {
return FuncJob(func() {
defer func() {
if r := recover(); r != nil {
const size = 64 << 10
buf := make([]byte, size)
buf = buf[:runtime.Stack(buf, false)]
err, ok := r.(error)
if !ok {
err = errors.New("panic: " + fmt.Sprint(r))
}
logger.Error(err, "panic", "stack", "...\n"+string(buf))
}
}()
j.Run()
})
}
}
// DelayIfStillRunning serializes jobs, delaying subsequent runs until the
// previous one is complete. Jobs running after a delay of more than a minute
// have the delay logged at Info.
func DelayIfStillRunning(logger Logger) JobWrapper {
return func(j Job) Job {
var mu sync.Mutex
return FuncJob(func() {
start := time.Now()
mu.Lock()
defer mu.Unlock()
if dur := time.Since(start); dur > time.Minute {
logger.Info("delay", "duration", dur)
}
j.Run()
})
}
}
// SkipIfStillRunning skips an invocation of the Job if a previous invocation is
// still running. It logs skips to the given logger at Info level.
func SkipIfStillRunning(logger Logger) JobWrapper {
return func(j Job) Job {
var ch = make(chan struct{}, 1)
ch <- struct{}{}
return FuncJob(func() {
select {
case v := <-ch:
defer func() { ch <- v }()
j.Run()
default:
logger.Info("skip")
}
})
}
}

239
plugin/cron/chain_test.go Normal file
View File

@@ -0,0 +1,239 @@
//nolint:all
package cron
import (
"io"
"log"
"reflect"
"sync"
"testing"
"time"
)
func appendingJob(slice *[]int, value int) Job {
var m sync.Mutex
return FuncJob(func() {
m.Lock()
*slice = append(*slice, value)
m.Unlock()
})
}
func appendingWrapper(slice *[]int, value int) JobWrapper {
return func(j Job) Job {
return FuncJob(func() {
appendingJob(slice, value).Run()
j.Run()
})
}
}
func TestChain(t *testing.T) {
var nums []int
var (
append1 = appendingWrapper(&nums, 1)
append2 = appendingWrapper(&nums, 2)
append3 = appendingWrapper(&nums, 3)
append4 = appendingJob(&nums, 4)
)
NewChain(append1, append2, append3).Then(append4).Run()
if !reflect.DeepEqual(nums, []int{1, 2, 3, 4}) {
t.Error("unexpected order of calls:", nums)
}
}
func TestChainRecover(t *testing.T) {
panickingJob := FuncJob(func() {
panic("panickingJob panics")
})
t.Run("panic exits job by default", func(*testing.T) {
defer func() {
if err := recover(); err == nil {
t.Errorf("panic expected, but none received")
}
}()
NewChain().Then(panickingJob).
Run()
})
t.Run("Recovering JobWrapper recovers", func(*testing.T) {
NewChain(Recover(PrintfLogger(log.New(io.Discard, "", 0)))).
Then(panickingJob).
Run()
})
t.Run("composed with the *IfStillRunning wrappers", func(*testing.T) {
NewChain(Recover(PrintfLogger(log.New(io.Discard, "", 0)))).
Then(panickingJob).
Run()
})
}
type countJob struct {
m sync.Mutex
started int
done int
delay time.Duration
}
func (j *countJob) Run() {
j.m.Lock()
j.started++
j.m.Unlock()
time.Sleep(j.delay)
j.m.Lock()
j.done++
j.m.Unlock()
}
func (j *countJob) Started() int {
defer j.m.Unlock()
j.m.Lock()
return j.started
}
func (j *countJob) Done() int {
defer j.m.Unlock()
j.m.Lock()
return j.done
}
func TestChainDelayIfStillRunning(t *testing.T) {
t.Run("runs immediately", func(*testing.T) {
var j countJob
wrappedJob := NewChain(DelayIfStillRunning(DiscardLogger)).Then(&j)
go wrappedJob.Run()
time.Sleep(2 * time.Millisecond) // Give the job 2ms to complete.
if c := j.Done(); c != 1 {
t.Errorf("expected job run once, immediately, got %d", c)
}
})
t.Run("second run immediate if first done", func(*testing.T) {
var j countJob
wrappedJob := NewChain(DelayIfStillRunning(DiscardLogger)).Then(&j)
go func() {
go wrappedJob.Run()
time.Sleep(time.Millisecond)
go wrappedJob.Run()
}()
time.Sleep(3 * time.Millisecond) // Give both jobs 3ms to complete.
if c := j.Done(); c != 2 {
t.Errorf("expected job run twice, immediately, got %d", c)
}
})
t.Run("second run delayed if first not done", func(*testing.T) {
var j countJob
j.delay = 10 * time.Millisecond
wrappedJob := NewChain(DelayIfStillRunning(DiscardLogger)).Then(&j)
go func() {
go wrappedJob.Run()
time.Sleep(time.Millisecond)
go wrappedJob.Run()
}()
// After 5ms, the first job is still in progress, and the second job was
// run but should be waiting for it to finish.
time.Sleep(5 * time.Millisecond)
started, done := j.Started(), j.Done()
if started != 1 || done != 0 {
t.Error("expected first job started, but not finished, got", started, done)
}
// Verify that the second job completes.
time.Sleep(25 * time.Millisecond)
started, done = j.Started(), j.Done()
if started != 2 || done != 2 {
t.Error("expected both jobs done, got", started, done)
}
})
}
func TestChainSkipIfStillRunning(t *testing.T) {
t.Run("runs immediately", func(*testing.T) {
var j countJob
wrappedJob := NewChain(SkipIfStillRunning(DiscardLogger)).Then(&j)
go wrappedJob.Run()
time.Sleep(2 * time.Millisecond) // Give the job 2ms to complete.
if c := j.Done(); c != 1 {
t.Errorf("expected job run once, immediately, got %d", c)
}
})
t.Run("second run immediate if first done", func(*testing.T) {
var j countJob
wrappedJob := NewChain(SkipIfStillRunning(DiscardLogger)).Then(&j)
go func() {
go wrappedJob.Run()
time.Sleep(time.Millisecond)
go wrappedJob.Run()
}()
time.Sleep(3 * time.Millisecond) // Give both jobs 3ms to complete.
if c := j.Done(); c != 2 {
t.Errorf("expected job run twice, immediately, got %d", c)
}
})
t.Run("second run skipped if first not done", func(*testing.T) {
var j countJob
j.delay = 10 * time.Millisecond
wrappedJob := NewChain(SkipIfStillRunning(DiscardLogger)).Then(&j)
go func() {
go wrappedJob.Run()
time.Sleep(time.Millisecond)
go wrappedJob.Run()
}()
// After 5ms, the first job is still in progress, and the second job was
// aleady skipped.
time.Sleep(5 * time.Millisecond)
started, done := j.Started(), j.Done()
if started != 1 || done != 0 {
t.Error("expected first job started, but not finished, got", started, done)
}
// Verify that the first job completes and second does not run.
time.Sleep(25 * time.Millisecond)
started, done = j.Started(), j.Done()
if started != 1 || done != 1 {
t.Error("expected second job skipped, got", started, done)
}
})
t.Run("skip 10 jobs on rapid fire", func(*testing.T) {
var j countJob
j.delay = 10 * time.Millisecond
wrappedJob := NewChain(SkipIfStillRunning(DiscardLogger)).Then(&j)
for i := 0; i < 11; i++ {
go wrappedJob.Run()
}
time.Sleep(200 * time.Millisecond)
done := j.Done()
if done != 1 {
t.Error("expected 1 jobs executed, 10 jobs dropped, got", done)
}
})
t.Run("different jobs independent", func(*testing.T) {
var j1, j2 countJob
j1.delay = 10 * time.Millisecond
j2.delay = 10 * time.Millisecond
chain := NewChain(SkipIfStillRunning(DiscardLogger))
wrappedJob1 := chain.Then(&j1)
wrappedJob2 := chain.Then(&j2)
for i := 0; i < 11; i++ {
go wrappedJob1.Run()
go wrappedJob2.Run()
}
time.Sleep(100 * time.Millisecond)
var (
done1 = j1.Done()
done2 = j2.Done()
)
if done1 != 1 || done2 != 1 {
t.Error("expected both jobs executed once, got", done1, "and", done2)
}
})
}

View File

@@ -0,0 +1,27 @@
package cron
import "time"
// ConstantDelaySchedule represents a simple recurring duty cycle, e.g. "Every 5 minutes".
// It does not support jobs more frequent than once a second.
type ConstantDelaySchedule struct {
Delay time.Duration
}
// Every returns a crontab Schedule that activates once every duration.
// Delays of less than a second are not supported (will round up to 1 second).
// Any fields less than a Second are truncated.
func Every(duration time.Duration) ConstantDelaySchedule {
if duration < time.Second {
duration = time.Second
}
return ConstantDelaySchedule{
Delay: duration - time.Duration(duration.Nanoseconds())%time.Second,
}
}
// Next returns the next time this should be run.
// This rounds so that the next activation time will be on the second.
func (schedule ConstantDelaySchedule) Next(t time.Time) time.Time {
return t.Add(schedule.Delay - time.Duration(t.Nanosecond())*time.Nanosecond)
}

View File

@@ -0,0 +1,55 @@
//nolint:all
package cron
import (
"testing"
"time"
)
func TestConstantDelayNext(t *testing.T) {
tests := []struct {
time string
delay time.Duration
expected string
}{
// Simple cases
{"Mon Jul 9 14:45 2012", 15*time.Minute + 50*time.Nanosecond, "Mon Jul 9 15:00 2012"},
{"Mon Jul 9 14:59 2012", 15 * time.Minute, "Mon Jul 9 15:14 2012"},
{"Mon Jul 9 14:59:59 2012", 15 * time.Minute, "Mon Jul 9 15:14:59 2012"},
// Wrap around hours
{"Mon Jul 9 15:45 2012", 35 * time.Minute, "Mon Jul 9 16:20 2012"},
// Wrap around days
{"Mon Jul 9 23:46 2012", 14 * time.Minute, "Tue Jul 10 00:00 2012"},
{"Mon Jul 9 23:45 2012", 35 * time.Minute, "Tue Jul 10 00:20 2012"},
{"Mon Jul 9 23:35:51 2012", 44*time.Minute + 24*time.Second, "Tue Jul 10 00:20:15 2012"},
{"Mon Jul 9 23:35:51 2012", 25*time.Hour + 44*time.Minute + 24*time.Second, "Thu Jul 11 01:20:15 2012"},
// Wrap around months
{"Mon Jul 9 23:35 2012", 91*24*time.Hour + 25*time.Minute, "Thu Oct 9 00:00 2012"},
// Wrap around minute, hour, day, month, and year
{"Mon Dec 31 23:59:45 2012", 15 * time.Second, "Tue Jan 1 00:00:00 2013"},
// Round to nearest second on the delay
{"Mon Jul 9 14:45 2012", 15*time.Minute + 50*time.Nanosecond, "Mon Jul 9 15:00 2012"},
// Round up to 1 second if the duration is less.
{"Mon Jul 9 14:45:00 2012", 15 * time.Millisecond, "Mon Jul 9 14:45:01 2012"},
// Round to nearest second when calculating the next time.
{"Mon Jul 9 14:45:00.005 2012", 15 * time.Minute, "Mon Jul 9 15:00 2012"},
// Round to nearest second for both.
{"Mon Jul 9 14:45:00.005 2012", 15*time.Minute + 50*time.Nanosecond, "Mon Jul 9 15:00 2012"},
}
for _, c := range tests {
actual := Every(c.delay).Next(getTime(c.time))
expected := getTime(c.expected)
if actual != expected {
t.Errorf("%s, \"%s\": (expected) %v != %v (actual)", c.time, c.delay, expected, actual)
}
}
}

355
plugin/cron/cron.go Normal file
View File

@@ -0,0 +1,355 @@
package cron
import (
"context"
"sort"
"sync"
"time"
)
// Cron keeps track of any number of entries, invoking the associated func as
// specified by the schedule. It may be started, stopped, and the entries may
// be inspected while running.
type Cron struct {
entries []*Entry
chain Chain
stop chan struct{}
add chan *Entry
remove chan EntryID
snapshot chan chan []Entry
running bool
logger Logger
runningMu sync.Mutex
location *time.Location
parser ScheduleParser
nextID EntryID
jobWaiter sync.WaitGroup
}
// ScheduleParser is an interface for schedule spec parsers that return a Schedule.
type ScheduleParser interface {
Parse(spec string) (Schedule, error)
}
// Job is an interface for submitted cron jobs.
type Job interface {
Run()
}
// Schedule describes a job's duty cycle.
type Schedule interface {
// Next returns the next activation time, later than the given time.
// Next is invoked initially, and then each time the job is run.
Next(time.Time) time.Time
}
// EntryID identifies an entry within a Cron instance.
type EntryID int
// Entry consists of a schedule and the func to execute on that schedule.
type Entry struct {
// ID is the cron-assigned ID of this entry, which may be used to look up a
// snapshot or remove it.
ID EntryID
// Schedule on which this job should be run.
Schedule Schedule
// Next time the job will run, or the zero time if Cron has not been
// started or this entry's schedule is unsatisfiable
Next time.Time
// Prev is the last time this job was run, or the zero time if never.
Prev time.Time
// WrappedJob is the thing to run when the Schedule is activated.
WrappedJob Job
// Job is the thing that was submitted to cron.
// It is kept around so that user code that needs to get at the job later,
// e.g. via Entries() can do so.
Job Job
}
// Valid returns true if this is not the zero entry.
func (e Entry) Valid() bool { return e.ID != 0 }
// byTime is a wrapper for sorting the entry array by time
// (with zero time at the end).
type byTime []*Entry
func (s byTime) Len() int { return len(s) }
func (s byTime) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
func (s byTime) Less(i, j int) bool {
// Two zero times should return false.
// Otherwise, zero is "greater" than any other time.
// (To sort it at the end of the list.)
if s[i].Next.IsZero() {
return false
}
if s[j].Next.IsZero() {
return true
}
return s[i].Next.Before(s[j].Next)
}
// New returns a new Cron job runner, modified by the given options.
//
// Available Settings
//
// Time Zone
// Description: The time zone in which schedules are interpreted
// Default: time.Local
//
// Parser
// Description: Parser converts cron spec strings into cron.Schedules.
// Default: Accepts this spec: https://en.wikipedia.org/wiki/Cron
//
// Chain
// Description: Wrap submitted jobs to customize behavior.
// Default: A chain that recovers panics and logs them to stderr.
//
// See "cron.With*" to modify the default behavior.
func New(opts ...Option) *Cron {
c := &Cron{
entries: nil,
chain: NewChain(),
add: make(chan *Entry),
stop: make(chan struct{}),
snapshot: make(chan chan []Entry),
remove: make(chan EntryID),
running: false,
runningMu: sync.Mutex{},
logger: DefaultLogger,
location: time.Local,
parser: standardParser,
}
for _, opt := range opts {
opt(c)
}
return c
}
// FuncJob is a wrapper that turns a func() into a cron.Job.
type FuncJob func()
func (f FuncJob) Run() { f() }
// AddFunc adds a func to the Cron to be run on the given schedule.
// The spec is parsed using the time zone of this Cron instance as the default.
// An opaque ID is returned that can be used to later remove it.
func (c *Cron) AddFunc(spec string, cmd func()) (EntryID, error) {
return c.AddJob(spec, FuncJob(cmd))
}
// AddJob adds a Job to the Cron to be run on the given schedule.
// The spec is parsed using the time zone of this Cron instance as the default.
// An opaque ID is returned that can be used to later remove it.
func (c *Cron) AddJob(spec string, cmd Job) (EntryID, error) {
schedule, err := c.parser.Parse(spec)
if err != nil {
return 0, err
}
return c.Schedule(schedule, cmd), nil
}
// Schedule adds a Job to the Cron to be run on the given schedule.
// The job is wrapped with the configured Chain.
func (c *Cron) Schedule(schedule Schedule, cmd Job) EntryID {
c.runningMu.Lock()
defer c.runningMu.Unlock()
c.nextID++
entry := &Entry{
ID: c.nextID,
Schedule: schedule,
WrappedJob: c.chain.Then(cmd),
Job: cmd,
}
if !c.running {
c.entries = append(c.entries, entry)
} else {
c.add <- entry
}
return entry.ID
}
// Entries returns a snapshot of the cron entries.
func (c *Cron) Entries() []Entry {
c.runningMu.Lock()
defer c.runningMu.Unlock()
if c.running {
replyChan := make(chan []Entry, 1)
c.snapshot <- replyChan
return <-replyChan
}
return c.entrySnapshot()
}
// Location gets the time zone location.
func (c *Cron) Location() *time.Location {
return c.location
}
// Entry returns a snapshot of the given entry, or nil if it couldn't be found.
func (c *Cron) Entry(id EntryID) Entry {
for _, entry := range c.Entries() {
if id == entry.ID {
return entry
}
}
return Entry{}
}
// Remove an entry from being run in the future.
func (c *Cron) Remove(id EntryID) {
c.runningMu.Lock()
defer c.runningMu.Unlock()
if c.running {
c.remove <- id
} else {
c.removeEntry(id)
}
}
// Start the cron scheduler in its own goroutine, or no-op if already started.
func (c *Cron) Start() {
c.runningMu.Lock()
defer c.runningMu.Unlock()
if c.running {
return
}
c.running = true
go c.runScheduler()
}
// Run the cron scheduler, or no-op if already running.
func (c *Cron) Run() {
c.runningMu.Lock()
if c.running {
c.runningMu.Unlock()
return
}
c.running = true
c.runningMu.Unlock()
c.runScheduler()
}
// runScheduler runs the scheduler.. this is private just due to the need to synchronize
// access to the 'running' state variable.
func (c *Cron) runScheduler() {
c.logger.Info("start")
// Figure out the next activation times for each entry.
now := c.now()
for _, entry := range c.entries {
entry.Next = entry.Schedule.Next(now)
c.logger.Info("schedule", "now", now, "entry", entry.ID, "next", entry.Next)
}
for {
// Determine the next entry to run.
sort.Sort(byTime(c.entries))
var timer *time.Timer
if len(c.entries) == 0 || c.entries[0].Next.IsZero() {
// If there are no entries yet, just sleep - it still handles new entries
// and stop requests.
timer = time.NewTimer(100000 * time.Hour)
} else {
timer = time.NewTimer(c.entries[0].Next.Sub(now))
}
for {
select {
case now = <-timer.C:
now = now.In(c.location)
c.logger.Info("wake", "now", now)
// Run every entry whose next time was less than now
for _, e := range c.entries {
if e.Next.After(now) || e.Next.IsZero() {
break
}
c.startJob(e.WrappedJob)
e.Prev = e.Next
e.Next = e.Schedule.Next(now)
c.logger.Info("run", "now", now, "entry", e.ID, "next", e.Next)
}
case newEntry := <-c.add:
timer.Stop()
now = c.now()
newEntry.Next = newEntry.Schedule.Next(now)
c.entries = append(c.entries, newEntry)
c.logger.Info("added", "now", now, "entry", newEntry.ID, "next", newEntry.Next)
case replyChan := <-c.snapshot:
replyChan <- c.entrySnapshot()
continue
case <-c.stop:
timer.Stop()
c.logger.Info("stop")
return
case id := <-c.remove:
timer.Stop()
now = c.now()
c.removeEntry(id)
c.logger.Info("removed", "entry", id)
}
break
}
}
}
// startJob runs the given job in a new goroutine.
func (c *Cron) startJob(j Job) {
c.jobWaiter.Add(1)
go func() {
defer c.jobWaiter.Done()
j.Run()
}()
}
// now returns current time in c location.
func (c *Cron) now() time.Time {
return time.Now().In(c.location)
}
// Stop stops the cron scheduler if it is running; otherwise it does nothing.
// A context is returned so the caller can wait for running jobs to complete.
func (c *Cron) Stop() context.Context {
c.runningMu.Lock()
defer c.runningMu.Unlock()
if c.running {
c.stop <- struct{}{}
c.running = false
}
ctx, cancel := context.WithCancel(context.Background())
go func() {
c.jobWaiter.Wait()
cancel()
}()
return ctx
}
// entrySnapshot returns a copy of the current cron entry list.
func (c *Cron) entrySnapshot() []Entry {
var entries = make([]Entry, len(c.entries))
for i, e := range c.entries {
entries[i] = *e
}
return entries
}
func (c *Cron) removeEntry(id EntryID) {
var entries []*Entry
for _, e := range c.entries {
if e.ID != id {
entries = append(entries, e)
}
}
c.entries = entries
}

702
plugin/cron/cron_test.go Normal file
View File

@@ -0,0 +1,702 @@
//nolint:all
package cron
import (
"bytes"
"fmt"
"log"
"strings"
"sync"
"sync/atomic"
"testing"
"time"
)
// Many tests schedule a job for every second, and then wait at most a second
// for it to run. This amount is just slightly larger than 1 second to
// compensate for a few milliseconds of runtime.
const OneSecond = 1*time.Second + 50*time.Millisecond
type syncWriter struct {
wr bytes.Buffer
m sync.Mutex
}
func (sw *syncWriter) Write(data []byte) (n int, err error) {
sw.m.Lock()
n, err = sw.wr.Write(data)
sw.m.Unlock()
return
}
func (sw *syncWriter) String() string {
sw.m.Lock()
defer sw.m.Unlock()
return sw.wr.String()
}
func newBufLogger(sw *syncWriter) Logger {
return PrintfLogger(log.New(sw, "", log.LstdFlags))
}
func TestFuncPanicRecovery(t *testing.T) {
var buf syncWriter
cron := New(WithParser(secondParser),
WithChain(Recover(newBufLogger(&buf))))
cron.Start()
defer cron.Stop()
cron.AddFunc("* * * * * ?", func() {
panic("YOLO")
})
select {
case <-time.After(OneSecond):
if !strings.Contains(buf.String(), "YOLO") {
t.Error("expected a panic to be logged, got none")
}
return
}
}
type DummyJob struct{}
func (DummyJob) Run() {
panic("YOLO")
}
func TestJobPanicRecovery(t *testing.T) {
var job DummyJob
var buf syncWriter
cron := New(WithParser(secondParser),
WithChain(Recover(newBufLogger(&buf))))
cron.Start()
defer cron.Stop()
cron.AddJob("* * * * * ?", job)
select {
case <-time.After(OneSecond):
if !strings.Contains(buf.String(), "YOLO") {
t.Error("expected a panic to be logged, got none")
}
return
}
}
// Start and stop cron with no entries.
func TestNoEntries(t *testing.T) {
cron := newWithSeconds()
cron.Start()
select {
case <-time.After(OneSecond):
t.Fatal("expected cron will be stopped immediately")
case <-stop(cron):
}
}
// Start, stop, then add an entry. Verify entry doesn't run.
func TestStopCausesJobsToNotRun(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(1)
cron := newWithSeconds()
cron.Start()
cron.Stop()
cron.AddFunc("* * * * * ?", func() { wg.Done() })
select {
case <-time.After(OneSecond):
// No job ran!
case <-wait(wg):
t.Fatal("expected stopped cron does not run any job")
}
}
// Add a job, start cron, expect it runs.
func TestAddBeforeRunning(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(1)
cron := newWithSeconds()
cron.AddFunc("* * * * * ?", func() { wg.Done() })
cron.Start()
defer cron.Stop()
// Give cron 2 seconds to run our job (which is always activated).
select {
case <-time.After(OneSecond):
t.Fatal("expected job runs")
case <-wait(wg):
}
}
// Start cron, add a job, expect it runs.
func TestAddWhileRunning(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(1)
cron := newWithSeconds()
cron.Start()
defer cron.Stop()
cron.AddFunc("* * * * * ?", func() { wg.Done() })
select {
case <-time.After(OneSecond):
t.Fatal("expected job runs")
case <-wait(wg):
}
}
// Test for #34. Adding a job after calling start results in multiple job invocations
func TestAddWhileRunningWithDelay(t *testing.T) {
cron := newWithSeconds()
cron.Start()
defer cron.Stop()
time.Sleep(5 * time.Second)
var calls int64
cron.AddFunc("* * * * * *", func() { atomic.AddInt64(&calls, 1) })
<-time.After(OneSecond)
if atomic.LoadInt64(&calls) != 1 {
t.Errorf("called %d times, expected 1\n", calls)
}
}
// Add a job, remove a job, start cron, expect nothing runs.
func TestRemoveBeforeRunning(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(1)
cron := newWithSeconds()
id, _ := cron.AddFunc("* * * * * ?", func() { wg.Done() })
cron.Remove(id)
cron.Start()
defer cron.Stop()
select {
case <-time.After(OneSecond):
// Success, shouldn't run
case <-wait(wg):
t.FailNow()
}
}
// Start cron, add a job, remove it, expect it doesn't run.
func TestRemoveWhileRunning(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(1)
cron := newWithSeconds()
cron.Start()
defer cron.Stop()
id, _ := cron.AddFunc("* * * * * ?", func() { wg.Done() })
cron.Remove(id)
select {
case <-time.After(OneSecond):
case <-wait(wg):
t.FailNow()
}
}
// Test timing with Entries.
func TestSnapshotEntries(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(1)
cron := New()
cron.AddFunc("@every 2s", func() { wg.Done() })
cron.Start()
defer cron.Stop()
// Cron should fire in 2 seconds. After 1 second, call Entries.
select {
case <-time.After(OneSecond):
cron.Entries()
}
// Even though Entries was called, the cron should fire at the 2 second mark.
select {
case <-time.After(OneSecond):
t.Error("expected job runs at 2 second mark")
case <-wait(wg):
}
}
// Test that the entries are correctly sorted.
// Add a bunch of long-in-the-future entries, and an immediate entry, and ensure
// that the immediate entry runs immediately.
// Also: Test that multiple jobs run in the same instant.
func TestMultipleEntries(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(2)
cron := newWithSeconds()
cron.AddFunc("0 0 0 1 1 ?", func() {})
cron.AddFunc("* * * * * ?", func() { wg.Done() })
id1, _ := cron.AddFunc("* * * * * ?", func() { t.Fatal() })
id2, _ := cron.AddFunc("* * * * * ?", func() { t.Fatal() })
cron.AddFunc("0 0 0 31 12 ?", func() {})
cron.AddFunc("* * * * * ?", func() { wg.Done() })
cron.Remove(id1)
cron.Start()
cron.Remove(id2)
defer cron.Stop()
select {
case <-time.After(OneSecond):
t.Error("expected job run in proper order")
case <-wait(wg):
}
}
// Test running the same job twice.
func TestRunningJobTwice(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(2)
cron := newWithSeconds()
cron.AddFunc("0 0 0 1 1 ?", func() {})
cron.AddFunc("0 0 0 31 12 ?", func() {})
cron.AddFunc("* * * * * ?", func() { wg.Done() })
cron.Start()
defer cron.Stop()
select {
case <-time.After(2 * OneSecond):
t.Error("expected job fires 2 times")
case <-wait(wg):
}
}
func TestRunningMultipleSchedules(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(2)
cron := newWithSeconds()
cron.AddFunc("0 0 0 1 1 ?", func() {})
cron.AddFunc("0 0 0 31 12 ?", func() {})
cron.AddFunc("* * * * * ?", func() { wg.Done() })
cron.Schedule(Every(time.Minute), FuncJob(func() {}))
cron.Schedule(Every(time.Second), FuncJob(func() { wg.Done() }))
cron.Schedule(Every(time.Hour), FuncJob(func() {}))
cron.Start()
defer cron.Stop()
select {
case <-time.After(2 * OneSecond):
t.Error("expected job fires 2 times")
case <-wait(wg):
}
}
// Test that the cron is run in the local time zone (as opposed to UTC).
func TestLocalTimezone(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(2)
now := time.Now()
// FIX: Issue #205
// This calculation doesn't work in seconds 58 or 59.
// Take the easy way out and sleep.
if now.Second() >= 58 {
time.Sleep(2 * time.Second)
now = time.Now()
}
spec := fmt.Sprintf("%d,%d %d %d %d %d ?",
now.Second()+1, now.Second()+2, now.Minute(), now.Hour(), now.Day(), now.Month())
cron := newWithSeconds()
cron.AddFunc(spec, func() { wg.Done() })
cron.Start()
defer cron.Stop()
select {
case <-time.After(OneSecond * 2):
t.Error("expected job fires 2 times")
case <-wait(wg):
}
}
// Test that the cron is run in the given time zone (as opposed to local).
func TestNonLocalTimezone(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(2)
loc, err := time.LoadLocation("Atlantic/Cape_Verde")
if err != nil {
fmt.Printf("Failed to load time zone Atlantic/Cape_Verde: %+v", err)
t.Fail()
}
now := time.Now().In(loc)
// FIX: Issue #205
// This calculation doesn't work in seconds 58 or 59.
// Take the easy way out and sleep.
if now.Second() >= 58 {
time.Sleep(2 * time.Second)
now = time.Now().In(loc)
}
spec := fmt.Sprintf("%d,%d %d %d %d %d ?",
now.Second()+1, now.Second()+2, now.Minute(), now.Hour(), now.Day(), now.Month())
cron := New(WithLocation(loc), WithParser(secondParser))
cron.AddFunc(spec, func() { wg.Done() })
cron.Start()
defer cron.Stop()
select {
case <-time.After(OneSecond * 2):
t.Error("expected job fires 2 times")
case <-wait(wg):
}
}
// Test that calling stop before start silently returns without
// blocking the stop channel.
func TestStopWithoutStart(t *testing.T) {
cron := New()
cron.Stop()
}
type testJob struct {
wg *sync.WaitGroup
name string
}
func (t testJob) Run() {
t.wg.Done()
}
// Test that adding an invalid job spec returns an error
func TestInvalidJobSpec(t *testing.T) {
cron := New()
_, err := cron.AddJob("this will not parse", nil)
if err == nil {
t.Errorf("expected an error with invalid spec, got nil")
}
}
// Test blocking run method behaves as Start()
func TestBlockingRun(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(1)
cron := newWithSeconds()
cron.AddFunc("* * * * * ?", func() { wg.Done() })
var unblockChan = make(chan struct{})
go func() {
cron.Run()
close(unblockChan)
}()
defer cron.Stop()
select {
case <-time.After(OneSecond):
t.Error("expected job fires")
case <-unblockChan:
t.Error("expected that Run() blocks")
case <-wait(wg):
}
}
// Test that double-running is a no-op
func TestStartNoop(t *testing.T) {
var tickChan = make(chan struct{}, 2)
cron := newWithSeconds()
cron.AddFunc("* * * * * ?", func() {
tickChan <- struct{}{}
})
cron.Start()
defer cron.Stop()
// Wait for the first firing to ensure the runner is going
<-tickChan
cron.Start()
<-tickChan
// Fail if this job fires again in a short period, indicating a double-run
select {
case <-time.After(time.Millisecond):
case <-tickChan:
t.Error("expected job fires exactly twice")
}
}
// Simple test using Runnables.
func TestJob(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(1)
cron := newWithSeconds()
cron.AddJob("0 0 0 30 Feb ?", testJob{wg, "job0"})
cron.AddJob("0 0 0 1 1 ?", testJob{wg, "job1"})
job2, _ := cron.AddJob("* * * * * ?", testJob{wg, "job2"})
cron.AddJob("1 0 0 1 1 ?", testJob{wg, "job3"})
cron.Schedule(Every(5*time.Second+5*time.Nanosecond), testJob{wg, "job4"})
job5 := cron.Schedule(Every(5*time.Minute), testJob{wg, "job5"})
// Test getting an Entry pre-Start.
if actualName := cron.Entry(job2).Job.(testJob).name; actualName != "job2" {
t.Error("wrong job retrieved:", actualName)
}
if actualName := cron.Entry(job5).Job.(testJob).name; actualName != "job5" {
t.Error("wrong job retrieved:", actualName)
}
cron.Start()
defer cron.Stop()
select {
case <-time.After(OneSecond):
t.FailNow()
case <-wait(wg):
}
// Ensure the entries are in the right order.
expecteds := []string{"job2", "job4", "job5", "job1", "job3", "job0"}
var actuals []string
for _, entry := range cron.Entries() {
actuals = append(actuals, entry.Job.(testJob).name)
}
for i, expected := range expecteds {
if actuals[i] != expected {
t.Fatalf("Jobs not in the right order. (expected) %s != %s (actual)", expecteds, actuals)
}
}
// Test getting Entries.
if actualName := cron.Entry(job2).Job.(testJob).name; actualName != "job2" {
t.Error("wrong job retrieved:", actualName)
}
if actualName := cron.Entry(job5).Job.(testJob).name; actualName != "job5" {
t.Error("wrong job retrieved:", actualName)
}
}
// Issue #206
// Ensure that the next run of a job after removing an entry is accurate.
func TestScheduleAfterRemoval(t *testing.T) {
var wg1 sync.WaitGroup
var wg2 sync.WaitGroup
wg1.Add(1)
wg2.Add(1)
// The first time this job is run, set a timer and remove the other job
// 750ms later. Correct behavior would be to still run the job again in
// 250ms, but the bug would cause it to run instead 1s later.
var calls int
var mu sync.Mutex
cron := newWithSeconds()
hourJob := cron.Schedule(Every(time.Hour), FuncJob(func() {}))
cron.Schedule(Every(time.Second), FuncJob(func() {
mu.Lock()
defer mu.Unlock()
switch calls {
case 0:
wg1.Done()
calls++
case 1:
time.Sleep(750 * time.Millisecond)
cron.Remove(hourJob)
calls++
case 2:
calls++
wg2.Done()
case 3:
panic("unexpected 3rd call")
}
}))
cron.Start()
defer cron.Stop()
// the first run might be any length of time 0 - 1s, since the schedule
// rounds to the second. wait for the first run to true up.
wg1.Wait()
select {
case <-time.After(2 * OneSecond):
t.Error("expected job fires 2 times")
case <-wait(&wg2):
}
}
type ZeroSchedule struct{}
func (*ZeroSchedule) Next(time.Time) time.Time {
return time.Time{}
}
// Tests that job without time does not run
func TestJobWithZeroTimeDoesNotRun(t *testing.T) {
cron := newWithSeconds()
var calls int64
cron.AddFunc("* * * * * *", func() { atomic.AddInt64(&calls, 1) })
cron.Schedule(new(ZeroSchedule), FuncJob(func() { t.Error("expected zero task will not run") }))
cron.Start()
defer cron.Stop()
<-time.After(OneSecond)
if atomic.LoadInt64(&calls) != 1 {
t.Errorf("called %d times, expected 1\n", calls)
}
}
func TestStopAndWait(t *testing.T) {
t.Run("nothing running, returns immediately", func(*testing.T) {
cron := newWithSeconds()
cron.Start()
ctx := cron.Stop()
select {
case <-ctx.Done():
case <-time.After(time.Millisecond):
t.Error("context was not done immediately")
}
})
t.Run("repeated calls to Stop", func(*testing.T) {
cron := newWithSeconds()
cron.Start()
_ = cron.Stop()
time.Sleep(time.Millisecond)
ctx := cron.Stop()
select {
case <-ctx.Done():
case <-time.After(time.Millisecond):
t.Error("context was not done immediately")
}
})
t.Run("a couple fast jobs added, still returns immediately", func(*testing.T) {
cron := newWithSeconds()
cron.AddFunc("* * * * * *", func() {})
cron.Start()
cron.AddFunc("* * * * * *", func() {})
cron.AddFunc("* * * * * *", func() {})
cron.AddFunc("* * * * * *", func() {})
time.Sleep(time.Second)
ctx := cron.Stop()
select {
case <-ctx.Done():
case <-time.After(time.Millisecond):
t.Error("context was not done immediately")
}
})
t.Run("a couple fast jobs and a slow job added, waits for slow job", func(*testing.T) {
cron := newWithSeconds()
cron.AddFunc("* * * * * *", func() {})
cron.Start()
cron.AddFunc("* * * * * *", func() { time.Sleep(2 * time.Second) })
cron.AddFunc("* * * * * *", func() {})
time.Sleep(time.Second)
ctx := cron.Stop()
// Verify that it is not done for at least 750ms
select {
case <-ctx.Done():
t.Error("context was done too quickly immediately")
case <-time.After(750 * time.Millisecond):
// expected, because the job sleeping for 1 second is still running
}
// Verify that it IS done in the next 500ms (giving 250ms buffer)
select {
case <-ctx.Done():
// expected
case <-time.After(1500 * time.Millisecond):
t.Error("context not done after job should have completed")
}
})
t.Run("repeated calls to stop, waiting for completion and after", func(*testing.T) {
cron := newWithSeconds()
cron.AddFunc("* * * * * *", func() {})
cron.AddFunc("* * * * * *", func() { time.Sleep(2 * time.Second) })
cron.Start()
cron.AddFunc("* * * * * *", func() {})
time.Sleep(time.Second)
ctx := cron.Stop()
ctx2 := cron.Stop()
// Verify that it is not done for at least 1500ms
select {
case <-ctx.Done():
t.Error("context was done too quickly immediately")
case <-ctx2.Done():
t.Error("context2 was done too quickly immediately")
case <-time.After(1500 * time.Millisecond):
// expected, because the job sleeping for 2 seconds is still running
}
// Verify that it IS done in the next 1s (giving 500ms buffer)
select {
case <-ctx.Done():
// expected
case <-time.After(time.Second):
t.Error("context not done after job should have completed")
}
// Verify that ctx2 is also done.
select {
case <-ctx2.Done():
// expected
case <-time.After(time.Millisecond):
t.Error("context2 not done even though context1 is")
}
// Verify that a new context retrieved from stop is immediately done.
ctx3 := cron.Stop()
select {
case <-ctx3.Done():
// expected
case <-time.After(time.Millisecond):
t.Error("context not done even when cron Stop is completed")
}
})
}
func TestMultiThreadedStartAndStop(t *testing.T) {
cron := New()
go cron.Run()
time.Sleep(2 * time.Millisecond)
cron.Stop()
}
func wait(wg *sync.WaitGroup) chan bool {
ch := make(chan bool)
go func() {
wg.Wait()
ch <- true
}()
return ch
}
func stop(cron *Cron) chan bool {
ch := make(chan bool)
go func() {
cron.Stop()
ch <- true
}()
return ch
}
// newWithSeconds returns a Cron with the seconds field enabled.
func newWithSeconds() *Cron {
return New(WithParser(secondParser), WithChain())
}

86
plugin/cron/logger.go Normal file
View File

@@ -0,0 +1,86 @@
package cron
import (
"io"
"log"
"os"
"strings"
"time"
)
// DefaultLogger is used by Cron if none is specified.
var DefaultLogger = PrintfLogger(log.New(os.Stdout, "cron: ", log.LstdFlags))
// DiscardLogger can be used by callers to discard all log messages.
var DiscardLogger = PrintfLogger(log.New(io.Discard, "", 0))
// Logger is the interface used in this package for logging, so that any backend
// can be plugged in. It is a subset of the github.com/go-logr/logr interface.
type Logger interface {
// Info logs routine messages about cron's operation.
Info(msg string, keysAndValues ...interface{})
// Error logs an error condition.
Error(err error, msg string, keysAndValues ...interface{})
}
// PrintfLogger wraps a Printf-based logger (such as the standard library "log")
// into an implementation of the Logger interface which logs errors only.
func PrintfLogger(l interface{ Printf(string, ...interface{}) }) Logger {
return printfLogger{l, false}
}
// VerbosePrintfLogger wraps a Printf-based logger (such as the standard library
// "log") into an implementation of the Logger interface which logs everything.
func VerbosePrintfLogger(l interface{ Printf(string, ...interface{}) }) Logger {
return printfLogger{l, true}
}
type printfLogger struct {
logger interface{ Printf(string, ...interface{}) }
logInfo bool
}
func (pl printfLogger) Info(msg string, keysAndValues ...interface{}) {
if pl.logInfo {
keysAndValues = formatTimes(keysAndValues)
pl.logger.Printf(
formatString(len(keysAndValues)),
append([]interface{}{msg}, keysAndValues...)...)
}
}
func (pl printfLogger) Error(err error, msg string, keysAndValues ...interface{}) {
keysAndValues = formatTimes(keysAndValues)
pl.logger.Printf(
formatString(len(keysAndValues)+2),
append([]interface{}{msg, "error", err}, keysAndValues...)...)
}
// formatString returns a logfmt-like format string for the number of
// key/values.
func formatString(numKeysAndValues int) string {
var sb strings.Builder
sb.WriteString("%s")
if numKeysAndValues > 0 {
sb.WriteString(", ")
}
for i := 0; i < numKeysAndValues/2; i++ {
if i > 0 {
sb.WriteString(", ")
}
sb.WriteString("%v=%v")
}
return sb.String()
}
// formatTimes formats any time.Time values as RFC3339.
func formatTimes(keysAndValues []interface{}) []interface{} {
var formattedArgs []interface{}
for _, arg := range keysAndValues {
if t, ok := arg.(time.Time); ok {
arg = t.Format(time.RFC3339)
}
formattedArgs = append(formattedArgs, arg)
}
return formattedArgs
}

45
plugin/cron/option.go Normal file
View File

@@ -0,0 +1,45 @@
package cron
import (
"time"
)
// Option represents a modification to the default behavior of a Cron.
type Option func(*Cron)
// WithLocation overrides the timezone of the cron instance.
func WithLocation(loc *time.Location) Option {
return func(c *Cron) {
c.location = loc
}
}
// WithSeconds overrides the parser used for interpreting job schedules to
// include a seconds field as the first one.
func WithSeconds() Option {
return WithParser(NewParser(
Second | Minute | Hour | Dom | Month | Dow | Descriptor,
))
}
// WithParser overrides the parser used for interpreting job schedules.
func WithParser(p ScheduleParser) Option {
return func(c *Cron) {
c.parser = p
}
}
// WithChain specifies Job wrappers to apply to all jobs added to this cron.
// Refer to the Chain* functions in this package for provided wrappers.
func WithChain(wrappers ...JobWrapper) Option {
return func(c *Cron) {
c.chain = NewChain(wrappers...)
}
}
// WithLogger uses the provided logger.
func WithLogger(logger Logger) Option {
return func(c *Cron) {
c.logger = logger
}
}

View File

@@ -0,0 +1,43 @@
//nolint:all
package cron
import (
"log"
"strings"
"testing"
"time"
)
func TestWithLocation(t *testing.T) {
c := New(WithLocation(time.UTC))
if c.location != time.UTC {
t.Errorf("expected UTC, got %v", c.location)
}
}
func TestWithParser(t *testing.T) {
var parser = NewParser(Dow)
c := New(WithParser(parser))
if c.parser != parser {
t.Error("expected provided parser")
}
}
func TestWithVerboseLogger(t *testing.T) {
var buf syncWriter
var logger = log.New(&buf, "", log.LstdFlags)
c := New(WithLogger(VerbosePrintfLogger(logger)))
if c.logger.(printfLogger).logger != logger {
t.Error("expected provided logger")
}
c.AddFunc("@every 1s", func() {})
c.Start()
time.Sleep(OneSecond)
c.Stop()
out := buf.String()
if !strings.Contains(out, "schedule,") ||
!strings.Contains(out, "run,") {
t.Error("expected to see some actions, got:", out)
}
}

435
plugin/cron/parser.go Normal file
View File

@@ -0,0 +1,435 @@
package cron
import (
"math"
"strconv"
"strings"
"time"
"github.com/pkg/errors"
)
// Configuration options for creating a parser. Most options specify which
// fields should be included, while others enable features. If a field is not
// included the parser will assume a default value. These options do not change
// the order fields are parse in.
type ParseOption int
const (
Second ParseOption = 1 << iota // Seconds field, default 0
SecondOptional // Optional seconds field, default 0
Minute // Minutes field, default 0
Hour // Hours field, default 0
Dom // Day of month field, default *
Month // Month field, default *
Dow // Day of week field, default *
DowOptional // Optional day of week field, default *
Descriptor // Allow descriptors such as @monthly, @weekly, etc.
)
var places = []ParseOption{
Second,
Minute,
Hour,
Dom,
Month,
Dow,
}
var defaults = []string{
"0",
"0",
"0",
"*",
"*",
"*",
}
// A custom Parser that can be configured.
type Parser struct {
options ParseOption
}
// NewParser creates a Parser with custom options.
//
// It panics if more than one Optional is given, since it would be impossible to
// correctly infer which optional is provided or missing in general.
//
// Examples
//
// // Standard parser without descriptors
// specParser := NewParser(Minute | Hour | Dom | Month | Dow)
// sched, err := specParser.Parse("0 0 15 */3 *")
//
// // Same as above, just excludes time fields
// specParser := NewParser(Dom | Month | Dow)
// sched, err := specParser.Parse("15 */3 *")
//
// // Same as above, just makes Dow optional
// specParser := NewParser(Dom | Month | DowOptional)
// sched, err := specParser.Parse("15 */3")
func NewParser(options ParseOption) Parser {
optionals := 0
if options&DowOptional > 0 {
optionals++
}
if options&SecondOptional > 0 {
optionals++
}
if optionals > 1 {
panic("multiple optionals may not be configured")
}
return Parser{options}
}
// Parse returns a new crontab schedule representing the given spec.
// It returns a descriptive error if the spec is not valid.
// It accepts crontab specs and features configured by NewParser.
func (p Parser) Parse(spec string) (Schedule, error) {
if len(spec) == 0 {
return nil, errors.New("empty spec string")
}
// Extract timezone if present
var loc = time.Local
if strings.HasPrefix(spec, "TZ=") || strings.HasPrefix(spec, "CRON_TZ=") {
var err error
i := strings.Index(spec, " ")
eq := strings.Index(spec, "=")
if loc, err = time.LoadLocation(spec[eq+1 : i]); err != nil {
return nil, errors.Wrap(err, "provided bad location")
}
spec = strings.TrimSpace(spec[i:])
}
// Handle named schedules (descriptors), if configured
if strings.HasPrefix(spec, "@") {
if p.options&Descriptor == 0 {
return nil, errors.New("descriptors not enabled")
}
return parseDescriptor(spec, loc)
}
// Split on whitespace.
fields := strings.Fields(spec)
// Validate & fill in any omitted or optional fields
var err error
fields, err = normalizeFields(fields, p.options)
if err != nil {
return nil, err
}
field := func(field string, r bounds) uint64 {
if err != nil {
return 0
}
var bits uint64
bits, err = getField(field, r)
return bits
}
var (
second = field(fields[0], seconds)
minute = field(fields[1], minutes)
hour = field(fields[2], hours)
dayofmonth = field(fields[3], dom)
month = field(fields[4], months)
dayofweek = field(fields[5], dow)
)
if err != nil {
return nil, err
}
return &SpecSchedule{
Second: second,
Minute: minute,
Hour: hour,
Dom: dayofmonth,
Month: month,
Dow: dayofweek,
Location: loc,
}, nil
}
// normalizeFields takes a subset set of the time fields and returns the full set
// with defaults (zeroes) populated for unset fields.
//
// As part of performing this function, it also validates that the provided
// fields are compatible with the configured options.
func normalizeFields(fields []string, options ParseOption) ([]string, error) {
// Validate optionals & add their field to options
optionals := 0
if options&SecondOptional > 0 {
options |= Second
optionals++
}
if options&DowOptional > 0 {
options |= Dow
optionals++
}
if optionals > 1 {
return nil, errors.New("multiple optionals may not be configured")
}
// Figure out how many fields we need
max := 0
for _, place := range places {
if options&place > 0 {
max++
}
}
min := max - optionals
// Validate number of fields
if count := len(fields); count < min || count > max {
if min == max {
return nil, errors.New("incorrect number of fields")
}
return nil, errors.New("incorrect number of fields, expected " + strconv.Itoa(min) + "-" + strconv.Itoa(max))
}
// Populate the optional field if not provided
if min < max && len(fields) == min {
switch {
case options&DowOptional > 0:
fields = append(fields, defaults[5]) // TODO: improve access to default
case options&SecondOptional > 0:
fields = append([]string{defaults[0]}, fields...)
default:
return nil, errors.New("unexpected optional field")
}
}
// Populate all fields not part of options with their defaults
n := 0
expandedFields := make([]string, len(places))
copy(expandedFields, defaults)
for i, place := range places {
if options&place > 0 {
expandedFields[i] = fields[n]
n++
}
}
return expandedFields, nil
}
var standardParser = NewParser(
Minute | Hour | Dom | Month | Dow | Descriptor,
)
// ParseStandard returns a new crontab schedule representing the given
// standardSpec (https://en.wikipedia.org/wiki/Cron). It requires 5 entries
// representing: minute, hour, day of month, month and day of week, in that
// order. It returns a descriptive error if the spec is not valid.
//
// It accepts
// - Standard crontab specs, e.g. "* * * * ?"
// - Descriptors, e.g. "@midnight", "@every 1h30m"
func ParseStandard(standardSpec string) (Schedule, error) {
return standardParser.Parse(standardSpec)
}
// getField returns an Int with the bits set representing all of the times that
// the field represents or error parsing field value. A "field" is a comma-separated
// list of "ranges".
func getField(field string, r bounds) (uint64, error) {
var bits uint64
ranges := strings.FieldsFunc(field, func(r rune) bool { return r == ',' })
for _, expr := range ranges {
bit, err := getRange(expr, r)
if err != nil {
return bits, err
}
bits |= bit
}
return bits, nil
}
// getRange returns the bits indicated by the given expression:
//
// number | number "-" number [ "/" number ]
//
// or error parsing range.
func getRange(expr string, r bounds) (uint64, error) {
var (
start, end, step uint
rangeAndStep = strings.Split(expr, "/")
lowAndHigh = strings.Split(rangeAndStep[0], "-")
singleDigit = len(lowAndHigh) == 1
err error
)
var extra uint64
if lowAndHigh[0] == "*" || lowAndHigh[0] == "?" {
start = r.min
end = r.max
extra = starBit
} else {
start, err = parseIntOrName(lowAndHigh[0], r.names)
if err != nil {
return 0, err
}
switch len(lowAndHigh) {
case 1:
end = start
case 2:
end, err = parseIntOrName(lowAndHigh[1], r.names)
if err != nil {
return 0, err
}
default:
return 0, errors.New("too many hyphens: " + expr)
}
}
switch len(rangeAndStep) {
case 1:
step = 1
case 2:
step, err = mustParseInt(rangeAndStep[1])
if err != nil {
return 0, err
}
// Special handling: "N/step" means "N-max/step".
if singleDigit {
end = r.max
}
if step > 1 {
extra = 0
}
default:
return 0, errors.New("too many slashes: " + expr)
}
if start < r.min {
return 0, errors.New("beginning of range below minimum: " + expr)
}
if end > r.max {
return 0, errors.New("end of range above maximum: " + expr)
}
if start > end {
return 0, errors.New("beginning of range after end: " + expr)
}
if step == 0 {
return 0, errors.New("step cannot be zero: " + expr)
}
return getBits(start, end, step) | extra, nil
}
// parseIntOrName returns the (possibly-named) integer contained in expr.
func parseIntOrName(expr string, names map[string]uint) (uint, error) {
if names != nil {
if namedInt, ok := names[strings.ToLower(expr)]; ok {
return namedInt, nil
}
}
return mustParseInt(expr)
}
// mustParseInt parses the given expression as an int or returns an error.
func mustParseInt(expr string) (uint, error) {
num, err := strconv.Atoi(expr)
if err != nil {
return 0, errors.Wrap(err, "failed to parse number")
}
if num < 0 {
return 0, errors.New("number must be positive")
}
return uint(num), nil
}
// getBits sets all bits in the range [min, max], modulo the given step size.
func getBits(min, max, step uint) uint64 {
var bits uint64
// If step is 1, use shifts.
if step == 1 {
return ^(math.MaxUint64 << (max + 1)) & (math.MaxUint64 << min)
}
// Else, use a simple loop.
for i := min; i <= max; i += step {
bits |= 1 << i
}
return bits
}
// all returns all bits within the given bounds.
func all(r bounds) uint64 {
return getBits(r.min, r.max, 1) | starBit
}
// parseDescriptor returns a predefined schedule for the expression, or error if none matches.
func parseDescriptor(descriptor string, loc *time.Location) (Schedule, error) {
switch descriptor {
case "@yearly", "@annually":
return &SpecSchedule{
Second: 1 << seconds.min,
Minute: 1 << minutes.min,
Hour: 1 << hours.min,
Dom: 1 << dom.min,
Month: 1 << months.min,
Dow: all(dow),
Location: loc,
}, nil
case "@monthly":
return &SpecSchedule{
Second: 1 << seconds.min,
Minute: 1 << minutes.min,
Hour: 1 << hours.min,
Dom: 1 << dom.min,
Month: all(months),
Dow: all(dow),
Location: loc,
}, nil
case "@weekly":
return &SpecSchedule{
Second: 1 << seconds.min,
Minute: 1 << minutes.min,
Hour: 1 << hours.min,
Dom: all(dom),
Month: all(months),
Dow: 1 << dow.min,
Location: loc,
}, nil
case "@daily", "@midnight":
return &SpecSchedule{
Second: 1 << seconds.min,
Minute: 1 << minutes.min,
Hour: 1 << hours.min,
Dom: all(dom),
Month: all(months),
Dow: all(dow),
Location: loc,
}, nil
case "@hourly":
return &SpecSchedule{
Second: 1 << seconds.min,
Minute: 1 << minutes.min,
Hour: all(hours),
Dom: all(dom),
Month: all(months),
Dow: all(dow),
Location: loc,
}, nil
}
const every = "@every "
if strings.HasPrefix(descriptor, every) {
duration, err := time.ParseDuration(descriptor[len(every):])
if err != nil {
return nil, errors.Wrap(err, "failed to parse duration")
}
return Every(duration), nil
}
return nil, errors.New("unrecognized descriptor: " + descriptor)
}

384
plugin/cron/parser_test.go Normal file
View File

@@ -0,0 +1,384 @@
//nolint:all
package cron
import (
"reflect"
"strings"
"testing"
"time"
)
var secondParser = NewParser(Second | Minute | Hour | Dom | Month | DowOptional | Descriptor)
func TestRange(t *testing.T) {
zero := uint64(0)
ranges := []struct {
expr string
min, max uint
expected uint64
err string
}{
{"5", 0, 7, 1 << 5, ""},
{"0", 0, 7, 1 << 0, ""},
{"7", 0, 7, 1 << 7, ""},
{"5-5", 0, 7, 1 << 5, ""},
{"5-6", 0, 7, 1<<5 | 1<<6, ""},
{"5-7", 0, 7, 1<<5 | 1<<6 | 1<<7, ""},
{"5-6/2", 0, 7, 1 << 5, ""},
{"5-7/2", 0, 7, 1<<5 | 1<<7, ""},
{"5-7/1", 0, 7, 1<<5 | 1<<6 | 1<<7, ""},
{"*", 1, 3, 1<<1 | 1<<2 | 1<<3 | starBit, ""},
{"*/2", 1, 3, 1<<1 | 1<<3, ""},
{"5--5", 0, 0, zero, "too many hyphens"},
{"jan-x", 0, 0, zero, `failed to parse number: strconv.Atoi: parsing "jan": invalid syntax`},
{"2-x", 1, 5, zero, `failed to parse number: strconv.Atoi: parsing "x": invalid syntax`},
{"*/-12", 0, 0, zero, "number must be positive"},
{"*//2", 0, 0, zero, "too many slashes"},
{"1", 3, 5, zero, "below minimum"},
{"6", 3, 5, zero, "above maximum"},
{"5-3", 3, 5, zero, "beginning of range after end: 5-3"},
{"*/0", 0, 0, zero, "step cannot be zero: */0"},
}
for _, c := range ranges {
actual, err := getRange(c.expr, bounds{c.min, c.max, nil})
if len(c.err) != 0 && (err == nil || !strings.Contains(err.Error(), c.err)) {
t.Errorf("%s => expected %v, got %v", c.expr, c.err, err)
}
if len(c.err) == 0 && err != nil {
t.Errorf("%s => unexpected error %v", c.expr, err)
}
if actual != c.expected {
t.Errorf("%s => expected %d, got %d", c.expr, c.expected, actual)
}
}
}
func TestField(t *testing.T) {
fields := []struct {
expr string
min, max uint
expected uint64
}{
{"5", 1, 7, 1 << 5},
{"5,6", 1, 7, 1<<5 | 1<<6},
{"5,6,7", 1, 7, 1<<5 | 1<<6 | 1<<7},
{"1,5-7/2,3", 1, 7, 1<<1 | 1<<5 | 1<<7 | 1<<3},
}
for _, c := range fields {
actual, _ := getField(c.expr, bounds{c.min, c.max, nil})
if actual != c.expected {
t.Errorf("%s => expected %d, got %d", c.expr, c.expected, actual)
}
}
}
func TestAll(t *testing.T) {
allBits := []struct {
r bounds
expected uint64
}{
{minutes, 0xfffffffffffffff}, // 0-59: 60 ones
{hours, 0xffffff}, // 0-23: 24 ones
{dom, 0xfffffffe}, // 1-31: 31 ones, 1 zero
{months, 0x1ffe}, // 1-12: 12 ones, 1 zero
{dow, 0x7f}, // 0-6: 7 ones
}
for _, c := range allBits {
actual := all(c.r) // all() adds the starBit, so compensate for that..
if c.expected|starBit != actual {
t.Errorf("%d-%d/%d => expected %b, got %b",
c.r.min, c.r.max, 1, c.expected|starBit, actual)
}
}
}
func TestBits(t *testing.T) {
bits := []struct {
min, max, step uint
expected uint64
}{
{0, 0, 1, 0x1},
{1, 1, 1, 0x2},
{1, 5, 2, 0x2a}, // 101010
{1, 4, 2, 0xa}, // 1010
}
for _, c := range bits {
actual := getBits(c.min, c.max, c.step)
if c.expected != actual {
t.Errorf("%d-%d/%d => expected %b, got %b",
c.min, c.max, c.step, c.expected, actual)
}
}
}
func TestParseScheduleErrors(t *testing.T) {
var tests = []struct{ expr, err string }{
{"* 5 j * * *", `failed to parse number: strconv.Atoi: parsing "j": invalid syntax`},
{"@every Xm", "failed to parse duration"},
{"@unrecognized", "unrecognized descriptor"},
{"* * * *", "incorrect number of fields, expected 5-6"},
{"", "empty spec string"},
}
for _, c := range tests {
actual, err := secondParser.Parse(c.expr)
if err == nil || !strings.Contains(err.Error(), c.err) {
t.Errorf("%s => expected %v, got %v", c.expr, c.err, err)
}
if actual != nil {
t.Errorf("expected nil schedule on error, got %v", actual)
}
}
}
func TestParseSchedule(t *testing.T) {
tokyo, _ := time.LoadLocation("Asia/Tokyo")
entries := []struct {
parser Parser
expr string
expected Schedule
}{
{secondParser, "0 5 * * * *", every5min(time.Local)},
{standardParser, "5 * * * *", every5min(time.Local)},
{secondParser, "CRON_TZ=UTC 0 5 * * * *", every5min(time.UTC)},
{standardParser, "CRON_TZ=UTC 5 * * * *", every5min(time.UTC)},
{secondParser, "CRON_TZ=Asia/Tokyo 0 5 * * * *", every5min(tokyo)},
{secondParser, "@every 5m", ConstantDelaySchedule{5 * time.Minute}},
{secondParser, "@midnight", midnight(time.Local)},
{secondParser, "TZ=UTC @midnight", midnight(time.UTC)},
{secondParser, "TZ=Asia/Tokyo @midnight", midnight(tokyo)},
{secondParser, "@yearly", annual(time.Local)},
{secondParser, "@annually", annual(time.Local)},
{
parser: secondParser,
expr: "* 5 * * * *",
expected: &SpecSchedule{
Second: all(seconds),
Minute: 1 << 5,
Hour: all(hours),
Dom: all(dom),
Month: all(months),
Dow: all(dow),
Location: time.Local,
},
},
}
for _, c := range entries {
actual, err := c.parser.Parse(c.expr)
if err != nil {
t.Errorf("%s => unexpected error %v", c.expr, err)
}
if !reflect.DeepEqual(actual, c.expected) {
t.Errorf("%s => expected %b, got %b", c.expr, c.expected, actual)
}
}
}
func TestOptionalSecondSchedule(t *testing.T) {
parser := NewParser(SecondOptional | Minute | Hour | Dom | Month | Dow | Descriptor)
entries := []struct {
expr string
expected Schedule
}{
{"0 5 * * * *", every5min(time.Local)},
{"5 5 * * * *", every5min5s(time.Local)},
{"5 * * * *", every5min(time.Local)},
}
for _, c := range entries {
actual, err := parser.Parse(c.expr)
if err != nil {
t.Errorf("%s => unexpected error %v", c.expr, err)
}
if !reflect.DeepEqual(actual, c.expected) {
t.Errorf("%s => expected %b, got %b", c.expr, c.expected, actual)
}
}
}
func TestNormalizeFields(t *testing.T) {
tests := []struct {
name string
input []string
options ParseOption
expected []string
}{
{
"AllFields_NoOptional",
[]string{"0", "5", "*", "*", "*", "*"},
Second | Minute | Hour | Dom | Month | Dow | Descriptor,
[]string{"0", "5", "*", "*", "*", "*"},
},
{
"AllFields_SecondOptional_Provided",
[]string{"0", "5", "*", "*", "*", "*"},
SecondOptional | Minute | Hour | Dom | Month | Dow | Descriptor,
[]string{"0", "5", "*", "*", "*", "*"},
},
{
"AllFields_SecondOptional_NotProvided",
[]string{"5", "*", "*", "*", "*"},
SecondOptional | Minute | Hour | Dom | Month | Dow | Descriptor,
[]string{"0", "5", "*", "*", "*", "*"},
},
{
"SubsetFields_NoOptional",
[]string{"5", "15", "*"},
Hour | Dom | Month,
[]string{"0", "0", "5", "15", "*", "*"},
},
{
"SubsetFields_DowOptional_Provided",
[]string{"5", "15", "*", "4"},
Hour | Dom | Month | DowOptional,
[]string{"0", "0", "5", "15", "*", "4"},
},
{
"SubsetFields_DowOptional_NotProvided",
[]string{"5", "15", "*"},
Hour | Dom | Month | DowOptional,
[]string{"0", "0", "5", "15", "*", "*"},
},
{
"SubsetFields_SecondOptional_NotProvided",
[]string{"5", "15", "*"},
SecondOptional | Hour | Dom | Month,
[]string{"0", "0", "5", "15", "*", "*"},
},
}
for _, test := range tests {
t.Run(test.name, func(*testing.T) {
actual, err := normalizeFields(test.input, test.options)
if err != nil {
t.Errorf("unexpected error: %v", err)
}
if !reflect.DeepEqual(actual, test.expected) {
t.Errorf("expected %v, got %v", test.expected, actual)
}
})
}
}
func TestNormalizeFields_Errors(t *testing.T) {
tests := []struct {
name string
input []string
options ParseOption
err string
}{
{
"TwoOptionals",
[]string{"0", "5", "*", "*", "*", "*"},
SecondOptional | Minute | Hour | Dom | Month | DowOptional,
"",
},
{
"TooManyFields",
[]string{"0", "5", "*", "*"},
SecondOptional | Minute | Hour,
"",
},
{
"NoFields",
[]string{},
SecondOptional | Minute | Hour,
"",
},
{
"TooFewFields",
[]string{"*"},
SecondOptional | Minute | Hour,
"",
},
}
for _, test := range tests {
t.Run(test.name, func(*testing.T) {
actual, err := normalizeFields(test.input, test.options)
if err == nil {
t.Errorf("expected an error, got none. results: %v", actual)
}
if !strings.Contains(err.Error(), test.err) {
t.Errorf("expected error %q, got %q", test.err, err.Error())
}
})
}
}
func TestStandardSpecSchedule(t *testing.T) {
entries := []struct {
expr string
expected Schedule
err string
}{
{
expr: "5 * * * *",
expected: &SpecSchedule{1 << seconds.min, 1 << 5, all(hours), all(dom), all(months), all(dow), time.Local},
},
{
expr: "@every 5m",
expected: ConstantDelaySchedule{time.Duration(5) * time.Minute},
},
{
expr: "5 j * * *",
err: `failed to parse number: strconv.Atoi: parsing "j": invalid syntax`,
},
{
expr: "* * * *",
err: "incorrect number of fields",
},
}
for _, c := range entries {
actual, err := ParseStandard(c.expr)
if len(c.err) != 0 && (err == nil || !strings.Contains(err.Error(), c.err)) {
t.Errorf("%s => expected %v, got %v", c.expr, c.err, err)
}
if len(c.err) == 0 && err != nil {
t.Errorf("%s => unexpected error %v", c.expr, err)
}
if !reflect.DeepEqual(actual, c.expected) {
t.Errorf("%s => expected %b, got %b", c.expr, c.expected, actual)
}
}
}
func TestNoDescriptorParser(t *testing.T) {
parser := NewParser(Minute | Hour)
_, err := parser.Parse("@every 1m")
if err == nil {
t.Error("expected an error, got none")
}
}
func every5min(loc *time.Location) *SpecSchedule {
return &SpecSchedule{1 << 0, 1 << 5, all(hours), all(dom), all(months), all(dow), loc}
}
func every5min5s(loc *time.Location) *SpecSchedule {
return &SpecSchedule{1 << 5, 1 << 5, all(hours), all(dom), all(months), all(dow), loc}
}
func midnight(loc *time.Location) *SpecSchedule {
return &SpecSchedule{1, 1, 1, all(dom), all(months), all(dow), loc}
}
func annual(loc *time.Location) *SpecSchedule {
return &SpecSchedule{
Second: 1 << seconds.min,
Minute: 1 << minutes.min,
Hour: 1 << hours.min,
Dom: 1 << dom.min,
Month: 1 << months.min,
Dow: all(dow),
Location: loc,
}
}

188
plugin/cron/spec.go Normal file
View File

@@ -0,0 +1,188 @@
package cron
import "time"
// SpecSchedule specifies a duty cycle (to the second granularity), based on a
// traditional crontab specification. It is computed initially and stored as bit sets.
type SpecSchedule struct {
Second, Minute, Hour, Dom, Month, Dow uint64
// Override location for this schedule.
Location *time.Location
}
// bounds provides a range of acceptable values (plus a map of name to value).
type bounds struct {
min, max uint
names map[string]uint
}
// The bounds for each field.
var (
seconds = bounds{0, 59, nil}
minutes = bounds{0, 59, nil}
hours = bounds{0, 23, nil}
dom = bounds{1, 31, nil}
months = bounds{1, 12, map[string]uint{
"jan": 1,
"feb": 2,
"mar": 3,
"apr": 4,
"may": 5,
"jun": 6,
"jul": 7,
"aug": 8,
"sep": 9,
"oct": 10,
"nov": 11,
"dec": 12,
}}
dow = bounds{0, 6, map[string]uint{
"sun": 0,
"mon": 1,
"tue": 2,
"wed": 3,
"thu": 4,
"fri": 5,
"sat": 6,
}}
)
const (
// Set the top bit if a star was included in the expression.
starBit = 1 << 63
)
// Next returns the next time this schedule is activated, greater than the given
// time. If no time can be found to satisfy the schedule, return the zero time.
func (s *SpecSchedule) Next(t time.Time) time.Time {
// General approach
//
// For Month, Day, Hour, Minute, Second:
// Check if the time value matches. If yes, continue to the next field.
// If the field doesn't match the schedule, then increment the field until it matches.
// While incrementing the field, a wrap-around brings it back to the beginning
// of the field list (since it is necessary to re-verify previous field
// values)
// Convert the given time into the schedule's timezone, if one is specified.
// Save the original timezone so we can convert back after we find a time.
// Note that schedules without a time zone specified (time.Local) are treated
// as local to the time provided.
origLocation := t.Location()
loc := s.Location
if loc == time.Local {
loc = t.Location()
}
if s.Location != time.Local {
t = t.In(s.Location)
}
// Start at the earliest possible time (the upcoming second).
t = t.Add(1*time.Second - time.Duration(t.Nanosecond())*time.Nanosecond)
// This flag indicates whether a field has been incremented.
added := false
// If no time is found within five years, return zero.
yearLimit := t.Year() + 5
WRAP:
if t.Year() > yearLimit {
return time.Time{}
}
// Find the first applicable month.
// If it's this month, then do nothing.
for 1<<uint(t.Month())&s.Month == 0 {
// If we have to add a month, reset the other parts to 0.
if !added {
added = true
// Otherwise, set the date at the beginning (since the current time is irrelevant).
t = time.Date(t.Year(), t.Month(), 1, 0, 0, 0, 0, loc)
}
t = t.AddDate(0, 1, 0)
// Wrapped around.
if t.Month() == time.January {
goto WRAP
}
}
// Now get a day in that month.
//
// NOTE: This causes issues for daylight savings regimes where midnight does
// not exist. For example: Sao Paulo has DST that transforms midnight on
// 11/3 into 1am. Handle that by noticing when the Hour ends up != 0.
for !dayMatches(s, t) {
if !added {
added = true
t = time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, loc)
}
t = t.AddDate(0, 0, 1)
// Notice if the hour is no longer midnight due to DST.
// Add an hour if it's 23, subtract an hour if it's 1.
if t.Hour() != 0 {
if t.Hour() > 12 {
t = t.Add(time.Duration(24-t.Hour()) * time.Hour)
} else {
t = t.Add(time.Duration(-t.Hour()) * time.Hour)
}
}
if t.Day() == 1 {
goto WRAP
}
}
for 1<<uint(t.Hour())&s.Hour == 0 {
if !added {
added = true
t = time.Date(t.Year(), t.Month(), t.Day(), t.Hour(), 0, 0, 0, loc)
}
t = t.Add(1 * time.Hour)
if t.Hour() == 0 {
goto WRAP
}
}
for 1<<uint(t.Minute())&s.Minute == 0 {
if !added {
added = true
t = t.Truncate(time.Minute)
}
t = t.Add(1 * time.Minute)
if t.Minute() == 0 {
goto WRAP
}
}
for 1<<uint(t.Second())&s.Second == 0 {
if !added {
added = true
t = t.Truncate(time.Second)
}
t = t.Add(1 * time.Second)
if t.Second() == 0 {
goto WRAP
}
}
return t.In(origLocation)
}
// dayMatches returns true if the schedule's day-of-week and day-of-month
// restrictions are satisfied by the given time.
func dayMatches(s *SpecSchedule, t time.Time) bool {
var (
domMatch = 1<<uint(t.Day())&s.Dom > 0
dowMatch = 1<<uint(t.Weekday())&s.Dow > 0
)
if s.Dom&starBit > 0 || s.Dow&starBit > 0 {
return domMatch && dowMatch
}
return domMatch || dowMatch
}

301
plugin/cron/spec_test.go Normal file
View File

@@ -0,0 +1,301 @@
//nolint:all
package cron
import (
"strings"
"testing"
"time"
)
func TestActivation(t *testing.T) {
tests := []struct {
time, spec string
expected bool
}{
// Every fifteen minutes.
{"Mon Jul 9 15:00 2012", "0/15 * * * *", true},
{"Mon Jul 9 15:45 2012", "0/15 * * * *", true},
{"Mon Jul 9 15:40 2012", "0/15 * * * *", false},
// Every fifteen minutes, starting at 5 minutes.
{"Mon Jul 9 15:05 2012", "5/15 * * * *", true},
{"Mon Jul 9 15:20 2012", "5/15 * * * *", true},
{"Mon Jul 9 15:50 2012", "5/15 * * * *", true},
// Named months
{"Sun Jul 15 15:00 2012", "0/15 * * Jul *", true},
{"Sun Jul 15 15:00 2012", "0/15 * * Jun *", false},
// Everything set.
{"Sun Jul 15 08:30 2012", "30 08 ? Jul Sun", true},
{"Sun Jul 15 08:30 2012", "30 08 15 Jul ?", true},
{"Mon Jul 16 08:30 2012", "30 08 ? Jul Sun", false},
{"Mon Jul 16 08:30 2012", "30 08 15 Jul ?", false},
// Predefined schedules
{"Mon Jul 9 15:00 2012", "@hourly", true},
{"Mon Jul 9 15:04 2012", "@hourly", false},
{"Mon Jul 9 15:00 2012", "@daily", false},
{"Mon Jul 9 00:00 2012", "@daily", true},
{"Mon Jul 9 00:00 2012", "@weekly", false},
{"Sun Jul 8 00:00 2012", "@weekly", true},
{"Sun Jul 8 01:00 2012", "@weekly", false},
{"Sun Jul 8 00:00 2012", "@monthly", false},
{"Sun Jul 1 00:00 2012", "@monthly", true},
// Test interaction of DOW and DOM.
// If both are restricted, then only one needs to match.
{"Sun Jul 15 00:00 2012", "* * 1,15 * Sun", true},
{"Fri Jun 15 00:00 2012", "* * 1,15 * Sun", true},
{"Wed Aug 1 00:00 2012", "* * 1,15 * Sun", true},
{"Sun Jul 15 00:00 2012", "* * */10 * Sun", true}, // verifies #70
// However, if one has a star, then both need to match.
{"Sun Jul 15 00:00 2012", "* * * * Mon", false},
{"Mon Jul 9 00:00 2012", "* * 1,15 * *", false},
{"Sun Jul 15 00:00 2012", "* * 1,15 * *", true},
{"Sun Jul 15 00:00 2012", "* * */2 * Sun", true},
}
for _, test := range tests {
sched, err := ParseStandard(test.spec)
if err != nil {
t.Error(err)
continue
}
actual := sched.Next(getTime(test.time).Add(-1 * time.Second))
expected := getTime(test.time)
if test.expected && expected != actual || !test.expected && expected == actual {
t.Errorf("Fail evaluating %s on %s: (expected) %s != %s (actual)",
test.spec, test.time, expected, actual)
}
}
}
func TestNext(t *testing.T) {
runs := []struct {
time, spec string
expected string
}{
// Simple cases
{"Mon Jul 9 14:45 2012", "0 0/15 * * * *", "Mon Jul 9 15:00 2012"},
{"Mon Jul 9 14:59 2012", "0 0/15 * * * *", "Mon Jul 9 15:00 2012"},
{"Mon Jul 9 14:59:59 2012", "0 0/15 * * * *", "Mon Jul 9 15:00 2012"},
// Wrap around hours
{"Mon Jul 9 15:45 2012", "0 20-35/15 * * * *", "Mon Jul 9 16:20 2012"},
// Wrap around days
{"Mon Jul 9 23:46 2012", "0 */15 * * * *", "Tue Jul 10 00:00 2012"},
{"Mon Jul 9 23:45 2012", "0 20-35/15 * * * *", "Tue Jul 10 00:20 2012"},
{"Mon Jul 9 23:35:51 2012", "15/35 20-35/15 * * * *", "Tue Jul 10 00:20:15 2012"},
{"Mon Jul 9 23:35:51 2012", "15/35 20-35/15 1/2 * * *", "Tue Jul 10 01:20:15 2012"},
{"Mon Jul 9 23:35:51 2012", "15/35 20-35/15 10-12 * * *", "Tue Jul 10 10:20:15 2012"},
{"Mon Jul 9 23:35:51 2012", "15/35 20-35/15 1/2 */2 * *", "Thu Jul 11 01:20:15 2012"},
{"Mon Jul 9 23:35:51 2012", "15/35 20-35/15 * 9-20 * *", "Wed Jul 10 00:20:15 2012"},
{"Mon Jul 9 23:35:51 2012", "15/35 20-35/15 * 9-20 Jul *", "Wed Jul 10 00:20:15 2012"},
// Wrap around months
{"Mon Jul 9 23:35 2012", "0 0 0 9 Apr-Oct ?", "Thu Aug 9 00:00 2012"},
{"Mon Jul 9 23:35 2012", "0 0 0 */5 Apr,Aug,Oct Mon", "Tue Aug 1 00:00 2012"},
{"Mon Jul 9 23:35 2012", "0 0 0 */5 Oct Mon", "Mon Oct 1 00:00 2012"},
// Wrap around years
{"Mon Jul 9 23:35 2012", "0 0 0 * Feb Mon", "Mon Feb 4 00:00 2013"},
{"Mon Jul 9 23:35 2012", "0 0 0 * Feb Mon/2", "Fri Feb 1 00:00 2013"},
// Wrap around minute, hour, day, month, and year
{"Mon Dec 31 23:59:45 2012", "0 * * * * *", "Tue Jan 1 00:00:00 2013"},
// Leap year
{"Mon Jul 9 23:35 2012", "0 0 0 29 Feb ?", "Mon Feb 29 00:00 2016"},
// Daylight savings time 2am EST (-5) -> 3am EDT (-4)
{"2012-03-11T00:00:00-0500", "TZ=America/New_York 0 30 2 11 Mar ?", "2013-03-11T02:30:00-0400"},
// hourly job
{"2012-03-11T00:00:00-0500", "TZ=America/New_York 0 0 * * * ?", "2012-03-11T01:00:00-0500"},
{"2012-03-11T01:00:00-0500", "TZ=America/New_York 0 0 * * * ?", "2012-03-11T03:00:00-0400"},
{"2012-03-11T03:00:00-0400", "TZ=America/New_York 0 0 * * * ?", "2012-03-11T04:00:00-0400"},
{"2012-03-11T04:00:00-0400", "TZ=America/New_York 0 0 * * * ?", "2012-03-11T05:00:00-0400"},
// hourly job using CRON_TZ
{"2012-03-11T00:00:00-0500", "CRON_TZ=America/New_York 0 0 * * * ?", "2012-03-11T01:00:00-0500"},
{"2012-03-11T01:00:00-0500", "CRON_TZ=America/New_York 0 0 * * * ?", "2012-03-11T03:00:00-0400"},
{"2012-03-11T03:00:00-0400", "CRON_TZ=America/New_York 0 0 * * * ?", "2012-03-11T04:00:00-0400"},
{"2012-03-11T04:00:00-0400", "CRON_TZ=America/New_York 0 0 * * * ?", "2012-03-11T05:00:00-0400"},
// 1am nightly job
{"2012-03-11T00:00:00-0500", "TZ=America/New_York 0 0 1 * * ?", "2012-03-11T01:00:00-0500"},
{"2012-03-11T01:00:00-0500", "TZ=America/New_York 0 0 1 * * ?", "2012-03-12T01:00:00-0400"},
// 2am nightly job (skipped)
{"2012-03-11T00:00:00-0500", "TZ=America/New_York 0 0 2 * * ?", "2012-03-12T02:00:00-0400"},
// Daylight savings time 2am EDT (-4) => 1am EST (-5)
{"2012-11-04T00:00:00-0400", "TZ=America/New_York 0 30 2 04 Nov ?", "2012-11-04T02:30:00-0500"},
{"2012-11-04T01:45:00-0400", "TZ=America/New_York 0 30 1 04 Nov ?", "2012-11-04T01:30:00-0500"},
// hourly job
{"2012-11-04T00:00:00-0400", "TZ=America/New_York 0 0 * * * ?", "2012-11-04T01:00:00-0400"},
{"2012-11-04T01:00:00-0400", "TZ=America/New_York 0 0 * * * ?", "2012-11-04T01:00:00-0500"},
{"2012-11-04T01:00:00-0500", "TZ=America/New_York 0 0 * * * ?", "2012-11-04T02:00:00-0500"},
// 1am nightly job (runs twice)
{"2012-11-04T00:00:00-0400", "TZ=America/New_York 0 0 1 * * ?", "2012-11-04T01:00:00-0400"},
{"2012-11-04T01:00:00-0400", "TZ=America/New_York 0 0 1 * * ?", "2012-11-04T01:00:00-0500"},
{"2012-11-04T01:00:00-0500", "TZ=America/New_York 0 0 1 * * ?", "2012-11-05T01:00:00-0500"},
// 2am nightly job
{"2012-11-04T00:00:00-0400", "TZ=America/New_York 0 0 2 * * ?", "2012-11-04T02:00:00-0500"},
{"2012-11-04T02:00:00-0500", "TZ=America/New_York 0 0 2 * * ?", "2012-11-05T02:00:00-0500"},
// 3am nightly job
{"2012-11-04T00:00:00-0400", "TZ=America/New_York 0 0 3 * * ?", "2012-11-04T03:00:00-0500"},
{"2012-11-04T03:00:00-0500", "TZ=America/New_York 0 0 3 * * ?", "2012-11-05T03:00:00-0500"},
// hourly job
{"TZ=America/New_York 2012-11-04T00:00:00-0400", "0 0 * * * ?", "2012-11-04T01:00:00-0400"},
{"TZ=America/New_York 2012-11-04T01:00:00-0400", "0 0 * * * ?", "2012-11-04T01:00:00-0500"},
{"TZ=America/New_York 2012-11-04T01:00:00-0500", "0 0 * * * ?", "2012-11-04T02:00:00-0500"},
// 1am nightly job (runs twice)
{"TZ=America/New_York 2012-11-04T00:00:00-0400", "0 0 1 * * ?", "2012-11-04T01:00:00-0400"},
{"TZ=America/New_York 2012-11-04T01:00:00-0400", "0 0 1 * * ?", "2012-11-04T01:00:00-0500"},
{"TZ=America/New_York 2012-11-04T01:00:00-0500", "0 0 1 * * ?", "2012-11-05T01:00:00-0500"},
// 2am nightly job
{"TZ=America/New_York 2012-11-04T00:00:00-0400", "0 0 2 * * ?", "2012-11-04T02:00:00-0500"},
{"TZ=America/New_York 2012-11-04T02:00:00-0500", "0 0 2 * * ?", "2012-11-05T02:00:00-0500"},
// 3am nightly job
{"TZ=America/New_York 2012-11-04T00:00:00-0400", "0 0 3 * * ?", "2012-11-04T03:00:00-0500"},
{"TZ=America/New_York 2012-11-04T03:00:00-0500", "0 0 3 * * ?", "2012-11-05T03:00:00-0500"},
// Unsatisfiable
{"Mon Jul 9 23:35 2012", "0 0 0 30 Feb ?", ""},
{"Mon Jul 9 23:35 2012", "0 0 0 31 Apr ?", ""},
// Monthly job
{"TZ=America/New_York 2012-11-04T00:00:00-0400", "0 0 3 3 * ?", "2012-12-03T03:00:00-0500"},
// Test the scenario of DST resulting in midnight not being a valid time.
// https://github.com/robfig/cron/issues/157
{"2018-10-17T05:00:00-0400", "TZ=America/Sao_Paulo 0 0 9 10 * ?", "2018-11-10T06:00:00-0500"},
{"2018-02-14T05:00:00-0500", "TZ=America/Sao_Paulo 0 0 9 22 * ?", "2018-02-22T07:00:00-0500"},
}
for _, c := range runs {
sched, err := secondParser.Parse(c.spec)
if err != nil {
t.Error(err)
continue
}
actual := sched.Next(getTime(c.time))
expected := getTime(c.expected)
if !actual.Equal(expected) {
t.Errorf("%s, \"%s\": (expected) %v != %v (actual)", c.time, c.spec, expected, actual)
}
}
}
func TestErrors(t *testing.T) {
invalidSpecs := []string{
"xyz",
"60 0 * * *",
"0 60 * * *",
"0 0 * * XYZ",
}
for _, spec := range invalidSpecs {
_, err := ParseStandard(spec)
if err == nil {
t.Error("expected an error parsing: ", spec)
}
}
}
func getTime(value string) time.Time {
if value == "" {
return time.Time{}
}
var location = time.Local
if strings.HasPrefix(value, "TZ=") {
parts := strings.Fields(value)
loc, err := time.LoadLocation(parts[0][len("TZ="):])
if err != nil {
panic("could not parse location:" + err.Error())
}
location = loc
value = parts[1]
}
var layouts = []string{
"Mon Jan 2 15:04 2006",
"Mon Jan 2 15:04:05 2006",
}
for _, layout := range layouts {
if t, err := time.ParseInLocation(layout, value, location); err == nil {
return t
}
}
if t, err := time.ParseInLocation("2006-01-02T15:04:05-0700", value, location); err == nil {
return t
}
panic("could not parse time value " + value)
}
func TestNextWithTz(t *testing.T) {
runs := []struct {
time, spec string
expected string
}{
// Failing tests
{"2016-01-03T13:09:03+0530", "14 14 * * *", "2016-01-03T14:14:00+0530"},
{"2016-01-03T04:09:03+0530", "14 14 * * ?", "2016-01-03T14:14:00+0530"},
// Passing tests
{"2016-01-03T14:09:03+0530", "14 14 * * *", "2016-01-03T14:14:00+0530"},
{"2016-01-03T14:00:00+0530", "14 14 * * ?", "2016-01-03T14:14:00+0530"},
}
for _, c := range runs {
sched, err := ParseStandard(c.spec)
if err != nil {
t.Error(err)
continue
}
actual := sched.Next(getTimeTZ(c.time))
expected := getTimeTZ(c.expected)
if !actual.Equal(expected) {
t.Errorf("%s, \"%s\": (expected) %v != %v (actual)", c.time, c.spec, expected, actual)
}
}
}
func getTimeTZ(value string) time.Time {
if value == "" {
return time.Time{}
}
t, err := time.Parse("Mon Jan 2 15:04 2006", value)
if err != nil {
t, err = time.Parse("Mon Jan 2 15:04:05 2006", value)
if err != nil {
t, err = time.Parse("2006-01-02T15:04:05-0700", value)
if err != nil {
panic(err)
}
}
}
return t
}
// https://github.com/robfig/cron/issues/144
func TestSlash0NoHang(t *testing.T) {
schedule := "TZ=America/New_York 15/0 * * * *"
_, err := ParseStandard(schedule)
if err == nil {
t.Error("expected an error on 0 increment")
}
}

View File

@@ -0,0 +1,20 @@
package filter
import (
"strings"
)
type ConvertContext struct {
Buffer strings.Builder
Args []any
// The offset of the next argument in the condition string.
// Mainly using for PostgreSQL.
ArgsOffset int
}
func NewConvertContext() *ConvertContext {
return &ConvertContext{
Buffer: strings.Builder{},
Args: []any{},
}
}

39
plugin/filter/expr.go Normal file
View File

@@ -0,0 +1,39 @@
package filter
import (
"errors"
exprv1 "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
// GetConstValue returns the constant value of the expression.
func GetConstValue(expr *exprv1.Expr) (any, error) {
v, ok := expr.ExprKind.(*exprv1.Expr_ConstExpr)
if !ok {
return nil, errors.New("invalid constant expression")
}
switch v.ConstExpr.ConstantKind.(type) {
case *exprv1.Constant_StringValue:
return v.ConstExpr.GetStringValue(), nil
case *exprv1.Constant_Int64Value:
return v.ConstExpr.GetInt64Value(), nil
case *exprv1.Constant_Uint64Value:
return v.ConstExpr.GetUint64Value(), nil
case *exprv1.Constant_DoubleValue:
return v.ConstExpr.GetDoubleValue(), nil
case *exprv1.Constant_BoolValue:
return v.ConstExpr.GetBoolValue(), nil
default:
return nil, errors.New("unexpected constant type")
}
}
// GetIdentExprName returns the name of the identifier expression.
func GetIdentExprName(expr *exprv1.Expr) (string, error) {
_, ok := expr.ExprKind.(*exprv1.Expr_IdentExpr)
if !ok {
return "", errors.New("invalid identifier expression")
}
return expr.GetIdentExpr().GetName(), nil
}

34
plugin/filter/filter.go Normal file
View File

@@ -0,0 +1,34 @@
package filter
import (
"github.com/google/cel-go/cel"
"github.com/pkg/errors"
exprv1 "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
// MemoFilterCELAttributes are the CEL attributes for memo.
var MemoFilterCELAttributes = []cel.EnvOption{
cel.Variable("content", cel.StringType),
cel.Variable("creator_id", cel.IntType),
// As the built-in timestamp type is deprecated, we use string type for now.
// e.g., "2021-01-01T00:00:00Z"
cel.Variable("create_time", cel.StringType),
cel.Variable("pinned", cel.BoolType),
cel.Variable("tag", cel.StringType),
cel.Variable("update_time", cel.StringType),
cel.Variable("visibility", cel.StringType),
}
// Parse parses the filter string and returns the parsed expression.
// The filter string should be a CEL expression.
func Parse(filter string, opts ...cel.EnvOption) (expr *exprv1.ParsedExpr, err error) {
e, err := cel.NewEnv(opts...)
if err != nil {
return nil, errors.Wrap(err, "failed to create CEL environment")
}
ast, issues := e.Compile(filter)
if issues != nil {
return nil, errors.Errorf("failed to compile filter: %v", issues)
}
return cel.AstToParsedExpr(ast)
}

View File

@@ -1,19 +0,0 @@
package getter
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestGetHTMLMeta(t *testing.T) {
tests := []struct {
urlStr string
htmlMeta HTMLMeta
}{}
for _, test := range tests {
metadata, err := GetHTMLMeta(test.urlStr)
require.NoError(t, err)
require.Equal(t, test.htmlMeta, *metadata)
}
}

View File

@@ -1,4 +0,0 @@
// Package getter is using to get resources from url.
// * Get metadata for website;
// * Get image blob to avoid CORS;
package getter

View File

@@ -1,15 +1,31 @@
package getter
package httpgetter
import (
"fmt"
"io"
"net"
"net/http"
"net/url"
"github.com/pkg/errors"
"golang.org/x/net/html"
"golang.org/x/net/html/atom"
)
var ErrInternalIP = errors.New("internal IP addresses are not allowed")
var httpClient = &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
if err := validateURL(req.URL.String()); err != nil {
return errors.Wrap(err, "redirect to internal IP")
}
if len(via) >= 10 {
return errors.New("too many redirects")
}
return nil
},
}
type HTMLMeta struct {
Title string `json:"title"`
Description string `json:"description"`
@@ -17,11 +33,11 @@ type HTMLMeta struct {
}
func GetHTMLMeta(urlStr string) (*HTMLMeta, error) {
if _, err := url.Parse(urlStr); err != nil {
if err := validateURL(urlStr); err != nil {
return nil, err
}
response, err := http.Get(urlStr)
response, err := httpClient.Get(urlStr)
if err != nil {
return nil, err
}
@@ -32,10 +48,13 @@ func GetHTMLMeta(urlStr string) (*HTMLMeta, error) {
return nil, err
}
if mediatype != "text/html" {
return nil, fmt.Errorf("Wrong website mediatype")
return nil, errors.New("not a HTML page")
}
// TODO: limit the size of the response body
htmlMeta := extractHTMLMeta(response.Body)
enrichSiteMeta(response.Request.URL, htmlMeta)
return htmlMeta, nil
}
@@ -96,3 +115,52 @@ func extractMetaProperty(token html.Token, prop string) (content string, ok bool
}
return content, ok
}
func validateURL(urlStr string) error {
u, err := url.Parse(urlStr)
if err != nil {
return errors.New("invalid URL format")
}
if u.Scheme != "http" && u.Scheme != "https" {
return errors.New("only http/https protocols are allowed")
}
host := u.Hostname()
if host == "" {
return errors.New("empty hostname")
}
// check if the hostname is an IP
if ip := net.ParseIP(host); ip != nil {
if ip.IsLoopback() || ip.IsPrivate() || ip.IsLinkLocalUnicast() {
return errors.Wrap(ErrInternalIP, ip.String())
}
return nil
}
// check if it's a hostname, resolve it and check all returned IPs
ips, err := net.LookupIP(host)
if err != nil {
return errors.Errorf("failed to resolve hostname: %v", err)
}
for _, ip := range ips {
if ip.IsLoopback() || ip.IsPrivate() || ip.IsLinkLocalUnicast() {
return errors.Wrapf(ErrInternalIP, "host=%s, ip=%s", host, ip.String())
}
}
return nil
}
func enrichSiteMeta(url *url.URL, meta *HTMLMeta) {
if url.Hostname() == "www.youtube.com" {
if url.Path == "/watch" {
vid := url.Query().Get("v")
if vid != "" {
meta.Image = fmt.Sprintf("https://img.youtube.com/vi/%s/mqdefault.jpg", vid)
}
}
}
}

View File

@@ -0,0 +1,39 @@
package httpgetter
import (
"errors"
"strings"
"testing"
"github.com/stretchr/testify/require"
)
func TestGetHTMLMeta(t *testing.T) {
tests := []struct {
urlStr string
htmlMeta HTMLMeta
}{}
for _, test := range tests {
metadata, err := GetHTMLMeta(test.urlStr)
require.NoError(t, err)
require.Equal(t, test.htmlMeta, *metadata)
}
}
func TestGetHTMLMetaForInternal(t *testing.T) {
// test for internal IP
if _, err := GetHTMLMeta("http://192.168.0.1"); !errors.Is(err, ErrInternalIP) {
t.Errorf("Expected error for internal IP, got %v", err)
}
// test for resolved internal IP
if _, err := GetHTMLMeta("http://localhost"); !errors.Is(err, ErrInternalIP) {
t.Errorf("Expected error for resolved internal IP, got %v", err)
}
// test for redirected internal IP
// 49.232.126.226:1110 will redirects to 127.0.0.1
if _, err := GetHTMLMeta("http://49.232.126.226:1110"); !(errors.Is(err, ErrInternalIP) && strings.Contains(err.Error(), "redirect")) {
t.Errorf("Expected error for redirected internal IP, got %v", err)
}
}

View File

@@ -0,0 +1,4 @@
// Package httpgetter is using to get resources from url.
// * Get metadata for website;
// * Get image blob to avoid CORS;
package httpgetter

View File

@@ -1,7 +1,7 @@
package getter
package httpgetter
import (
"fmt"
"errors"
"io"
"net/http"
"net/url"
@@ -29,7 +29,7 @@ func GetImage(urlStr string) (*Image, error) {
return nil, err
}
if !strings.HasPrefix(mediatype, "image/") {
return nil, fmt.Errorf("Wrong image mediatype")
return nil, errors.New("Wrong image mediatype")
}
bodyBytes, err := io.ReadAll(response.Body)

View File

@@ -1,4 +1,4 @@
package getter
package httpgetter
import (
"mime"

View File

@@ -9,23 +9,24 @@ import (
"net/http"
"github.com/pkg/errors"
"github.com/usememos/memos/plugin/idp"
"github.com/usememos/memos/store"
"golang.org/x/oauth2"
"github.com/usememos/memos/plugin/idp"
storepb "github.com/usememos/memos/proto/gen/store"
)
// IdentityProvider represents an OAuth2 Identity Provider.
type IdentityProvider struct {
config *store.IdentityProviderOAuth2Config
config *storepb.OAuth2Config
}
// NewIdentityProvider initializes a new OAuth2 Identity Provider with the given configuration.
func NewIdentityProvider(config *store.IdentityProviderOAuth2Config) (*IdentityProvider, error) {
func NewIdentityProvider(config *storepb.OAuth2Config) (*IdentityProvider, error) {
for v, field := range map[string]string{
config.ClientID: "clientId",
config.ClientId: "clientId",
config.ClientSecret: "clientSecret",
config.TokenURL: "tokenUrl",
config.UserInfoURL: "userInfoUrl",
config.TokenUrl: "tokenUrl",
config.UserInfoUrl: "userInfoUrl",
config.FieldMapping.Identifier: "fieldMapping.identifier",
} {
if v == "" {
@@ -41,13 +42,13 @@ func NewIdentityProvider(config *store.IdentityProviderOAuth2Config) (*IdentityP
// ExchangeToken returns the exchanged OAuth2 token using the given authorization code.
func (p *IdentityProvider) ExchangeToken(ctx context.Context, redirectURL, code string) (string, error) {
conf := &oauth2.Config{
ClientID: p.config.ClientID,
ClientID: p.config.ClientId,
ClientSecret: p.config.ClientSecret,
RedirectURL: redirectURL,
Scopes: p.config.Scopes,
Endpoint: oauth2.Endpoint{
AuthURL: p.config.AuthURL,
TokenURL: p.config.TokenURL,
AuthURL: p.config.AuthUrl,
TokenURL: p.config.TokenUrl,
AuthStyle: oauth2.AuthStyleInParams,
},
}
@@ -68,7 +69,7 @@ func (p *IdentityProvider) ExchangeToken(ctx context.Context, redirectURL, code
// UserInfo returns the parsed user information using the given OAuth2 token.
func (p *IdentityProvider) UserInfo(token string) (*idp.IdentityProviderUserInfo, error) {
client := &http.Client{}
req, err := http.NewRequest(http.MethodGet, p.config.UserInfoURL, nil)
req, err := http.NewRequest(http.MethodGet, p.config.UserInfoUrl, nil)
if err != nil {
return nil, errors.Wrap(err, "failed to new http request")
}
@@ -82,6 +83,7 @@ func (p *IdentityProvider) UserInfo(token string) (*idp.IdentityProviderUserInfo
if err != nil {
return nil, errors.Wrap(err, "failed to read response body")
}
defer resp.Body.Close()
var claims map[string]any
err = json.Unmarshal(body, &claims)

View File

@@ -12,25 +12,26 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/usememos/memos/plugin/idp"
"github.com/usememos/memos/store"
storepb "github.com/usememos/memos/proto/gen/store"
)
func TestNewIdentityProvider(t *testing.T) {
tests := []struct {
name string
config *store.IdentityProviderOAuth2Config
config *storepb.OAuth2Config
containsErr string
}{
{
name: "no tokenUrl",
config: &store.IdentityProviderOAuth2Config{
ClientID: "test-client-id",
config: &storepb.OAuth2Config{
ClientId: "test-client-id",
ClientSecret: "test-client-secret",
AuthURL: "",
TokenURL: "",
UserInfoURL: "https://example.com/api/user",
FieldMapping: &store.FieldMapping{
AuthUrl: "",
TokenUrl: "",
UserInfoUrl: "https://example.com/api/user",
FieldMapping: &storepb.FieldMapping{
Identifier: "login",
},
},
@@ -38,13 +39,13 @@ func TestNewIdentityProvider(t *testing.T) {
},
{
name: "no userInfoUrl",
config: &store.IdentityProviderOAuth2Config{
ClientID: "test-client-id",
config: &storepb.OAuth2Config{
ClientId: "test-client-id",
ClientSecret: "test-client-secret",
AuthURL: "",
TokenURL: "https://example.com/token",
UserInfoURL: "",
FieldMapping: &store.FieldMapping{
AuthUrl: "",
TokenUrl: "https://example.com/token",
UserInfoUrl: "",
FieldMapping: &storepb.FieldMapping{
Identifier: "login",
},
},
@@ -52,13 +53,13 @@ func TestNewIdentityProvider(t *testing.T) {
},
{
name: "no field mapping identifier",
config: &store.IdentityProviderOAuth2Config{
ClientID: "test-client-id",
config: &storepb.OAuth2Config{
ClientId: "test-client-id",
ClientSecret: "test-client-secret",
AuthURL: "",
TokenURL: "https://example.com/token",
UserInfoURL: "https://example.com/api/user",
FieldMapping: &store.FieldMapping{
AuthUrl: "",
TokenUrl: "https://example.com/token",
UserInfoUrl: "https://example.com/api/user",
FieldMapping: &storepb.FieldMapping{
Identifier: "",
},
},
@@ -66,7 +67,7 @@ func TestNewIdentityProvider(t *testing.T) {
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
t.Run(test.name, func(*testing.T) {
_, err := NewIdentityProvider(test.config)
assert.ErrorContains(t, err, test.containsErr)
})
@@ -90,15 +91,14 @@ func newMockServer(t *testing.T, code, accessToken string, userinfo []byte) *htt
w.Header().Set("Content-Type", "application/json")
err = json.NewEncoder(w).Encode(map[string]any{
"access_token": accessToken,
"token_type": "Bearer",
"refresh_token": "test-refresh-token",
"expires_in": 3600,
"id_token": rawIDToken,
"access_token": accessToken,
"token_type": "Bearer",
"expires_in": 3600,
"id_token": rawIDToken,
})
require.NoError(t, err)
})
mux.HandleFunc("/oauth2/userinfo", func(w http.ResponseWriter, r *http.Request) {
mux.HandleFunc("/oauth2/userinfo", func(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "application/json")
_, err := w.Write(userinfo)
require.NoError(t, err)
@@ -132,12 +132,12 @@ func TestIdentityProvider(t *testing.T) {
s := newMockServer(t, testCode, testAccessToken, userInfo)
oauth2, err := NewIdentityProvider(
&store.IdentityProviderOAuth2Config{
ClientID: testClientID,
&storepb.OAuth2Config{
ClientId: testClientID,
ClientSecret: "test-client-secret",
TokenURL: fmt.Sprintf("%s/oauth2/token", s.URL),
UserInfoURL: fmt.Sprintf("%s/oauth2/userinfo", s.URL),
FieldMapping: &store.FieldMapping{
TokenUrl: fmt.Sprintf("%s/oauth2/token", s.URL),
UserInfoUrl: fmt.Sprintf("%s/oauth2/userinfo", s.URL),
FieldMapping: &storepb.FieldMapping{
Identifier: "sub",
DisplayName: "name",
Email: "email",

View File

@@ -1,88 +0,0 @@
package openai
import (
"bytes"
"encoding/json"
"errors"
"io"
"net/http"
"net/url"
)
type ChatCompletionMessage struct {
Role string `json:"role"`
Content string `json:"content"`
}
type ChatCompletionChoice struct {
Message *ChatCompletionMessage `json:"message"`
}
type ChatCompletionResponse struct {
Error any `json:"error"`
Model string `json:"model"`
Choices []ChatCompletionChoice `json:"choices"`
}
func PostChatCompletion(messages []ChatCompletionMessage, apiKey string, apiHost string) (string, error) {
if apiHost == "" {
apiHost = "https://api.openai.com"
}
url, err := url.JoinPath(apiHost, "/v1/chat/completions")
if err != nil {
return "", err
}
values := map[string]any{
"model": "gpt-3.5-turbo",
"messages": messages,
"max_tokens": 2000,
"temperature": 0,
"frequency_penalty": 0.0,
"presence_penalty": 0.0,
}
jsonValue, err := json.Marshal(values)
if err != nil {
return "", err
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonValue))
if err != nil {
return "", err
}
// Set the API key in the request header
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+apiKey)
// Send the request to OpenAI's API
client := http.Client{}
resp, err := client.Do(req)
if err != nil {
return "", err
}
defer resp.Body.Close()
// Read the response body
responseBody, err := io.ReadAll(resp.Body)
if err != nil {
return "", err
}
chatCompletionResponse := ChatCompletionResponse{}
err = json.Unmarshal(responseBody, &chatCompletionResponse)
if err != nil {
return "", err
}
if chatCompletionResponse.Error != nil {
errorBytes, err := json.Marshal(chatCompletionResponse.Error)
if err != nil {
return "", err
}
return "", errors.New(string(errorBytes))
}
if len(chatCompletionResponse.Choices) == 0 {
return "", nil
}
return chatCompletionResponse.Choices[0].Message.Content, nil
}

View File

@@ -1,83 +0,0 @@
package openai
import (
"bytes"
"encoding/json"
"errors"
"io"
"net/http"
"net/url"
)
type TextCompletionChoice struct {
Text string `json:"text"`
}
type TextCompletionResponse struct {
Error any `json:"error"`
Model string `json:"model"`
Choices []TextCompletionChoice `json:"choices"`
}
func PostTextCompletion(prompt string, apiKey string, apiHost string) (string, error) {
if apiHost == "" {
apiHost = "https://api.openai.com"
}
url, err := url.JoinPath(apiHost, "/v1/chat/completions")
if err != nil {
return "", err
}
values := map[string]any{
"model": "gpt-3.5-turbo",
"prompt": prompt,
"temperature": 0.5,
"max_tokens": 100,
"n": 1,
"stop": ".",
}
jsonValue, err := json.Marshal(values)
if err != nil {
return "", err
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonValue))
if err != nil {
return "", err
}
// Set the API key in the request header
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+apiKey)
// Send the request to OpenAI's API
client := http.Client{}
resp, err := client.Do(req)
if err != nil {
return "", err
}
defer resp.Body.Close()
// Read the response body
responseBody, err := io.ReadAll(resp.Body)
if err != nil {
return "", err
}
textCompletionResponse := TextCompletionResponse{}
err = json.Unmarshal(responseBody, &textCompletionResponse)
if err != nil {
return "", err
}
if textCompletionResponse.Error != nil {
errorBytes, err := json.Marshal(textCompletionResponse.Error)
if err != nil {
return "", err
}
return "", errors.New(string(errorBytes))
}
if len(textCompletionResponse.Choices) == 0 {
return "", nil
}
return textCompletionResponse.Choices[0].Text, nil
}

View File

@@ -2,79 +2,89 @@ package s3
import (
"context"
"fmt"
"io"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
s3config "github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/feature/s3/manager"
awss3 "github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/pkg/errors"
storepb "github.com/usememos/memos/proto/gen/store"
)
type Config struct {
AccessKey string
SecretKey string
Bucket string
EndPoint string
Region string
URLPrefix string
URLSuffix string
}
type Client struct {
Client *awss3.Client
Config *Config
Client *s3.Client
Bucket *string
}
func NewClient(ctx context.Context, config *Config) (*Client, error) {
resolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...any) (aws.Endpoint, error) {
return aws.Endpoint{
URL: config.EndPoint,
SigningRegion: config.Region,
// For some s3-compatible object stores, converting the hostname is not required,
// and not setting this option will result in not being able to access the corresponding object store address.
HostnameImmutable: true,
}, nil
})
awsConfig, err := s3config.LoadDefaultConfig(ctx,
s3config.WithEndpointResolverWithOptions(resolver),
s3config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(config.AccessKey, config.SecretKey, "")),
func NewClient(ctx context.Context, s3Config *storepb.StorageS3Config) (*Client, error) {
cfg, err := config.LoadDefaultConfig(ctx,
config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(s3Config.AccessKeyId, s3Config.AccessKeySecret, "")),
config.WithRegion(s3Config.Region),
)
if err != nil {
return nil, err
return nil, errors.Wrap(err, "failed to load s3 config")
}
client := awss3.NewFromConfig(awsConfig)
client := s3.NewFromConfig(cfg, func(o *s3.Options) {
o.BaseEndpoint = aws.String(s3Config.Endpoint)
o.UsePathStyle = s3Config.UsePathStyle
})
return &Client{
Client: client,
Config: config,
Bucket: aws.String(s3Config.Bucket),
}, nil
}
func (client *Client) UploadFile(ctx context.Context, filename string, fileType string, src io.Reader) (string, error) {
uploader := manager.NewUploader(client.Client)
uploadOutput, err := uploader.Upload(ctx, &awss3.PutObjectInput{
Bucket: aws.String(client.Config.Bucket),
Key: aws.String(filename),
Body: src,
// UploadObject uploads an object to S3.
func (c *Client) UploadObject(ctx context.Context, key string, fileType string, content io.Reader) (string, error) {
uploader := manager.NewUploader(c.Client)
putInput := s3.PutObjectInput{
Bucket: c.Bucket,
Key: aws.String(key),
ContentType: aws.String(fileType),
ACL: types.ObjectCannedACL(*aws.String("public-read")),
})
Body: content,
}
result, err := uploader.Upload(ctx, &putInput)
if err != nil {
return "", err
}
link := uploadOutput.Location
// If url prefix is set, use it as the file link.
if client.Config.URLPrefix != "" {
link = fmt.Sprintf("%s/%s%s", client.Config.URLPrefix, filename, client.Config.URLSuffix)
resultKey := result.Key
if resultKey == nil || *resultKey == "" {
return "", errors.New("failed to get file key")
}
if link == "" {
return "", fmt.Errorf("failed to get file link")
}
return link, nil
return *resultKey, nil
}
// PresignGetObject presigns an object in S3.
func (c *Client) PresignGetObject(ctx context.Context, key string) (string, error) {
presignClient := s3.NewPresignClient(c.Client)
presignResult, err := presignClient.PresignGetObject(ctx, &s3.GetObjectInput{
Bucket: aws.String(*c.Bucket),
Key: aws.String(key),
}, func(opts *s3.PresignOptions) {
// Set the expiration time of the presigned URL to 5 days.
// Reference: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html
opts.Expires = time.Duration(5 * 24 * time.Hour)
})
if err != nil {
return "", errors.Wrap(err, "failed to presign put object")
}
return presignResult.URL, nil
}
// DeleteObject deletes an object in S3.
func (c *Client) DeleteObject(ctx context.Context, key string) error {
_, err := c.Client.DeleteObject(ctx, &s3.DeleteObjectInput{
Bucket: c.Bucket,
Key: aws.String(key),
})
if err != nil {
return errors.Wrap(err, "failed to delete object")
}
return nil
}

65
plugin/webhook/webhook.go Normal file
View File

@@ -0,0 +1,65 @@
package webhook
import (
"bytes"
"encoding/json"
"io"
"net/http"
"time"
"github.com/pkg/errors"
"google.golang.org/protobuf/encoding/protojson"
v1pb "github.com/usememos/memos/proto/gen/api/v1"
)
var (
// timeout is the timeout for webhook request. Default to 30 seconds.
timeout = 30 * time.Second
)
// Post posts the message to webhook endpoint.
func Post(requestPayload *v1pb.WebhookRequestPayload) error {
body, err := protojson.Marshal(requestPayload)
if err != nil {
return errors.Wrapf(err, "failed to marshal webhook request to %s", requestPayload.Url)
}
req, err := http.NewRequest("POST", requestPayload.Url, bytes.NewBuffer(body))
if err != nil {
return errors.Wrapf(err, "failed to construct webhook request to %s", requestPayload.Url)
}
req.Header.Set("Content-Type", "application/json")
client := &http.Client{
Timeout: timeout,
}
resp, err := client.Do(req)
if err != nil {
return errors.Wrapf(err, "failed to post webhook to %s", requestPayload.Url)
}
b, err := io.ReadAll(resp.Body)
if err != nil {
return errors.Wrapf(err, "failed to read webhook response from %s", requestPayload.Url)
}
defer resp.Body.Close()
if resp.StatusCode < 200 || resp.StatusCode > 299 {
return errors.Errorf("failed to post webhook %s, status code: %d, response body: %s", requestPayload.Url, resp.StatusCode, b)
}
response := &struct {
Code int `json:"code"`
Message string `json:"message"`
}{}
if err := json.Unmarshal(b, response); err != nil {
return errors.Wrapf(err, "failed to unmarshal webhook response from %s", requestPayload.Url)
}
if response.Code != 0 {
return errors.Errorf("receive error code sent by webhook server, code %d, msg: %s", response.Code, response.Message)
}
return nil
}

View File

@@ -0,0 +1 @@
package webhook

17
proto/README.md Normal file
View File

@@ -0,0 +1,17 @@
# Guide
## Prerequisites
- [buf](https://docs.buf.build/installation)
## Generate
```sh
buf generate
```
## Format
```sh
buf format -w
```

3
proto/api/v1/README.md Normal file
View File

@@ -0,0 +1,3 @@
# Memos API Design
This API design should follow the guidelines and best practices outlined in the [Google API Improvement Proposals (AIPs)](https://google.aip.dev/).

View File

@@ -0,0 +1,57 @@
syntax = "proto3";
package memos.api.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/protobuf/timestamp.proto";
option go_package = "gen/api/v1";
service ActivityService {
// GetActivity returns the activity with the given id.
rpc GetActivity(GetActivityRequest) returns (Activity) {
option (google.api.http) = {get: "/api/v1/{name=activities/*}"};
option (google.api.method_signature) = "name";
}
}
message Activity {
// The name of the activity.
// Format: activities/{id}
string name = 1 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.field_behavior) = IDENTIFIER
];
// The name of the creator.
// Format: users/{user}
string creator = 2;
// The type of the activity.
string type = 3;
// The level of the activity.
string level = 4;
// The create time of the activity.
google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
// The payload of the activity.
ActivityPayload payload = 6;
}
message ActivityPayload {
ActivityMemoCommentPayload memo_comment = 1;
}
// ActivityMemoCommentPayload represents the payload of a memo comment activity.
message ActivityMemoCommentPayload {
// The memo name of comment.
// Refer to `Memo.name`.
string memo = 1;
// The name of related memo.
string related_memo = 2;
}
message GetActivityRequest {
// The name of the activity.
// Format: activities/{id}, id is the system generated auto-incremented id.
string name = 1;
}

View File

@@ -0,0 +1,65 @@
syntax = "proto3";
package memos.api.v1;
import "api/v1/user_service.proto";
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
option go_package = "gen/api/v1";
service AuthService {
// GetAuthStatus returns the current auth status of the user.
rpc GetAuthStatus(GetAuthStatusRequest) returns (User) {
option (google.api.http) = {post: "/api/v1/auth/status"};
}
// SignIn signs in the user with the given username and password.
rpc SignIn(SignInRequest) returns (User) {
option (google.api.http) = {post: "/api/v1/auth/signin"};
}
// SignInWithSSO signs in the user with the given SSO code.
rpc SignInWithSSO(SignInWithSSORequest) returns (User) {
option (google.api.http) = {post: "/api/v1/auth/signin/sso"};
}
// SignUp signs up the user with the given username and password.
rpc SignUp(SignUpRequest) returns (User) {
option (google.api.http) = {post: "/api/v1/auth/signup"};
}
// SignOut signs out the user.
rpc SignOut(SignOutRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {post: "/api/v1/auth/signout"};
}
}
message GetAuthStatusRequest {}
message GetAuthStatusResponse {
User user = 1;
}
message SignInRequest {
// The username to sign in with.
string username = 1;
// The password to sign in with.
string password = 2;
// Whether the session should never expire.
bool never_expire = 3;
}
message SignInWithSSORequest {
// The ID of the SSO provider.
int32 idp_id = 1;
// The code to sign in with.
string code = 2;
// The redirect URI.
string redirect_uri = 3;
}
message SignUpRequest {
// The username to sign up with.
string username = 1;
// The password to sign up with.
string password = 2;
}
message SignOutRequest {}

23
proto/api/v1/common.proto Normal file
View File

@@ -0,0 +1,23 @@
syntax = "proto3";
package memos.api.v1;
option go_package = "gen/api/v1";
enum State {
STATE_UNSPECIFIED = 0;
NORMAL = 1;
ARCHIVED = 2;
}
// Used internally for obfuscating the page token.
message PageToken {
int32 limit = 1;
int32 offset = 2;
}
enum Direction {
DIRECTION_UNSPECIFIED = 0;
ASC = 1;
DESC = 2;
}

View File

@@ -0,0 +1,112 @@
syntax = "proto3";
package memos.api.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
option go_package = "gen/api/v1";
service IdentityProviderService {
// ListIdentityProviders lists identity providers.
rpc ListIdentityProviders(ListIdentityProvidersRequest) returns (ListIdentityProvidersResponse) {
option (google.api.http) = {get: "/api/v1/identityProviders"};
}
// GetIdentityProvider gets an identity provider.
rpc GetIdentityProvider(GetIdentityProviderRequest) returns (IdentityProvider) {
option (google.api.http) = {get: "/api/v1/{name=identityProviders/*}"};
option (google.api.method_signature) = "name";
}
// CreateIdentityProvider creates an identity provider.
rpc CreateIdentityProvider(CreateIdentityProviderRequest) returns (IdentityProvider) {
option (google.api.http) = {
post: "/api/v1/identityProviders"
body: "identity_provider"
};
}
// UpdateIdentityProvider updates an identity provider.
rpc UpdateIdentityProvider(UpdateIdentityProviderRequest) returns (IdentityProvider) {
option (google.api.http) = {
patch: "/api/v1/{identity_provider.name=identityProviders/*}"
body: "identity_provider"
};
option (google.api.method_signature) = "identity_provider,update_mask";
}
// DeleteIdentityProvider deletes an identity provider.
rpc DeleteIdentityProvider(DeleteIdentityProviderRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {delete: "/api/v1/{name=identityProviders/*}"};
option (google.api.method_signature) = "name";
}
}
message IdentityProvider {
// The name of the identityProvider.
// Format: identityProviders/{id}, id is the system generated auto-incremented id.
string name = 1;
enum Type {
TYPE_UNSPECIFIED = 0;
OAUTH2 = 1;
}
Type type = 2;
string title = 3;
string identifier_filter = 4;
IdentityProviderConfig config = 5;
}
message IdentityProviderConfig {
oneof config {
OAuth2Config oauth2_config = 1;
}
}
message FieldMapping {
string identifier = 1;
string display_name = 2;
string email = 3;
}
message OAuth2Config {
string client_id = 1;
string client_secret = 2;
string auth_url = 3;
string token_url = 4;
string user_info_url = 5;
repeated string scopes = 6;
FieldMapping field_mapping = 7;
}
message ListIdentityProvidersRequest {}
message ListIdentityProvidersResponse {
repeated IdentityProvider identity_providers = 1;
}
message GetIdentityProviderRequest {
// The name of the identityProvider to get.
string name = 1;
}
message CreateIdentityProviderRequest {
// The identityProvider to create.
IdentityProvider identity_provider = 1;
}
message UpdateIdentityProviderRequest {
// The identityProvider to update.
IdentityProvider identity_provider = 1;
// The update mask applies to the resource. Only the top level fields of
// IdentityProvider are supported.
google.protobuf.FieldMask update_mask = 2;
}
message DeleteIdentityProviderRequest {
// The name of the identityProvider to delete.
string name = 1;
}

View File

@@ -0,0 +1,89 @@
syntax = "proto3";
package memos.api.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option go_package = "gen/api/v1";
service InboxService {
// ListInboxes lists inboxes for a user.
rpc ListInboxes(ListInboxesRequest) returns (ListInboxesResponse) {
option (google.api.http) = {get: "/api/v1/inboxes"};
}
// UpdateInbox updates an inbox.
rpc UpdateInbox(UpdateInboxRequest) returns (Inbox) {
option (google.api.http) = {
patch: "/api/v1/{inbox.name=inboxes/*}"
body: "inbox"
};
option (google.api.method_signature) = "inbox,update_mask";
}
// DeleteInbox deletes an inbox.
rpc DeleteInbox(DeleteInboxRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {delete: "/api/v1/{name=inboxes/*}"};
option (google.api.method_signature) = "name";
}
}
message Inbox {
// The name of the inbox.
// Format: inboxes/{id}, id is the system generated auto-incremented id.
string name = 1;
// Format: users/{user}
string sender = 2;
// Format: users/{user}
string receiver = 3;
enum Status {
STATUS_UNSPECIFIED = 0;
UNREAD = 1;
ARCHIVED = 2;
}
Status status = 4;
google.protobuf.Timestamp create_time = 5;
enum Type {
TYPE_UNSPECIFIED = 0;
MEMO_COMMENT = 1;
VERSION_UPDATE = 2;
}
Type type = 6;
optional int32 activity_id = 7;
}
message ListInboxesRequest {
// Format: users/{user}
string user = 1;
// The maximum number of inbox to return.
int32 page_size = 2;
// Provide this to retrieve the subsequent page.
string page_token = 3;
}
message ListInboxesResponse {
repeated Inbox inboxes = 1;
// A token, which can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
string next_page_token = 2;
}
message UpdateInboxRequest {
Inbox inbox = 1;
google.protobuf.FieldMask update_mask = 2;
}
message DeleteInboxRequest {
// The name of the inbox to delete.
string name = 1;
}

View File

@@ -0,0 +1,303 @@
syntax = "proto3";
package memos.api.v1;
import "google/api/annotations.proto";
option go_package = "gen/api/v1";
service MarkdownService {
// ParseMarkdown parses the given markdown content and returns a list of nodes.
rpc ParseMarkdown(ParseMarkdownRequest) returns (ParseMarkdownResponse) {
option (google.api.http) = {
post: "/api/v1/markdown:parse"
body: "*"
};
}
// RestoreMarkdownNodes restores the given nodes to markdown content.
rpc RestoreMarkdownNodes(RestoreMarkdownNodesRequest) returns (RestoreMarkdownNodesResponse) {
option (google.api.http) = {
post: "/api/v1/markdown/node:restore"
body: "*"
};
}
// StringifyMarkdownNodes stringify the given nodes to plain text content.
rpc StringifyMarkdownNodes(StringifyMarkdownNodesRequest) returns (StringifyMarkdownNodesResponse) {
option (google.api.http) = {
post: "/api/v1/markdown/node:stringify"
body: "*"
};
}
// GetLinkMetadata returns metadata for a given link.
rpc GetLinkMetadata(GetLinkMetadataRequest) returns (LinkMetadata) {
option (google.api.http) = {get: "/api/v1/markdown/link:metadata"};
}
}
message ParseMarkdownRequest {
string markdown = 1;
}
message ParseMarkdownResponse {
repeated Node nodes = 1;
}
message RestoreMarkdownNodesRequest {
repeated Node nodes = 1;
}
message RestoreMarkdownNodesResponse {
string markdown = 1;
}
message StringifyMarkdownNodesRequest {
repeated Node nodes = 1;
}
message StringifyMarkdownNodesResponse {
string plain_text = 1;
}
message GetLinkMetadataRequest {
string link = 1;
}
message LinkMetadata {
string title = 1;
string description = 2;
string image = 3;
}
enum NodeType {
NODE_UNSPECIFIED = 0;
// Block nodes.
LINE_BREAK = 1;
PARAGRAPH = 2;
CODE_BLOCK = 3;
HEADING = 4;
HORIZONTAL_RULE = 5;
BLOCKQUOTE = 6;
LIST = 7;
ORDERED_LIST_ITEM = 8;
UNORDERED_LIST_ITEM = 9;
TASK_LIST_ITEM = 10;
MATH_BLOCK = 11;
TABLE = 12;
EMBEDDED_CONTENT = 13;
// Inline nodes.
TEXT = 51;
BOLD = 52;
ITALIC = 53;
BOLD_ITALIC = 54;
CODE = 55;
IMAGE = 56;
LINK = 57;
AUTO_LINK = 58;
TAG = 59;
STRIKETHROUGH = 60;
ESCAPING_CHARACTER = 61;
MATH = 62;
HIGHLIGHT = 63;
SUBSCRIPT = 64;
SUPERSCRIPT = 65;
REFERENCED_CONTENT = 66;
SPOILER = 67;
HTML_ELEMENT = 68;
}
message Node {
NodeType type = 1;
oneof node {
// Block nodes.
LineBreakNode line_break_node = 11;
ParagraphNode paragraph_node = 12;
CodeBlockNode code_block_node = 13;
HeadingNode heading_node = 14;
HorizontalRuleNode horizontal_rule_node = 15;
BlockquoteNode blockquote_node = 16;
ListNode list_node = 17;
OrderedListItemNode ordered_list_item_node = 18;
UnorderedListItemNode unordered_list_item_node = 19;
TaskListItemNode task_list_item_node = 20;
MathBlockNode math_block_node = 21;
TableNode table_node = 22;
EmbeddedContentNode embedded_content_node = 23;
// Inline nodes.
TextNode text_node = 51;
BoldNode bold_node = 52;
ItalicNode italic_node = 53;
BoldItalicNode bold_italic_node = 54;
CodeNode code_node = 55;
ImageNode image_node = 56;
LinkNode link_node = 57;
AutoLinkNode auto_link_node = 58;
TagNode tag_node = 59;
StrikethroughNode strikethrough_node = 60;
EscapingCharacterNode escaping_character_node = 61;
MathNode math_node = 62;
HighlightNode highlight_node = 63;
SubscriptNode subscript_node = 64;
SuperscriptNode superscript_node = 65;
ReferencedContentNode referenced_content_node = 66;
SpoilerNode spoiler_node = 67;
HTMLElementNode html_element_node = 68;
}
}
message LineBreakNode {}
message ParagraphNode {
repeated Node children = 1;
}
message CodeBlockNode {
string language = 1;
string content = 2;
}
message HeadingNode {
int32 level = 1;
repeated Node children = 2;
}
message HorizontalRuleNode {
string symbol = 1;
}
message BlockquoteNode {
repeated Node children = 1;
}
message ListNode {
enum Kind {
KIND_UNSPECIFIED = 0;
ORDERED = 1;
UNORDERED = 2;
DESCRIPTION = 3;
}
Kind kind = 1;
int32 indent = 2;
repeated Node children = 3;
}
message OrderedListItemNode {
string number = 1;
int32 indent = 2;
repeated Node children = 3;
}
message UnorderedListItemNode {
string symbol = 1;
int32 indent = 2;
repeated Node children = 3;
}
message TaskListItemNode {
string symbol = 1;
int32 indent = 2;
bool complete = 3;
repeated Node children = 4;
}
message MathBlockNode {
string content = 1;
}
message TableNode {
repeated Node header = 1;
repeated string delimiter = 2;
message Row {
repeated Node cells = 1;
}
repeated Row rows = 3;
}
message EmbeddedContentNode {
string resource_name = 1;
string params = 2;
}
message TextNode {
string content = 1;
}
message BoldNode {
string symbol = 1;
repeated Node children = 2;
}
message ItalicNode {
string symbol = 1;
string content = 2;
}
message BoldItalicNode {
string symbol = 1;
string content = 2;
}
message CodeNode {
string content = 1;
}
message ImageNode {
string alt_text = 1;
string url = 2;
}
message LinkNode {
repeated Node content = 1;
string url = 2;
}
message AutoLinkNode {
string url = 1;
bool is_raw_text = 2;
}
message TagNode {
string content = 1;
}
message StrikethroughNode {
string content = 1;
}
message EscapingCharacterNode {
string symbol = 1;
}
message MathNode {
string content = 1;
}
message HighlightNode {
string content = 1;
}
message SubscriptNode {
string content = 1;
}
message SuperscriptNode {
string content = 1;
}
message ReferencedContentNode {
string resource_name = 1;
string params = 2;
}
message SpoilerNode {
string content = 1;
}
message HTMLElementNode {
string tag_name = 1;
map<string, string> attributes = 2;
}

View File

@@ -0,0 +1,363 @@
syntax = "proto3";
package memos.api.v1;
import "api/v1/common.proto";
import "api/v1/markdown_service.proto";
import "api/v1/reaction_service.proto";
import "api/v1/resource_service.proto";
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option go_package = "gen/api/v1";
service MemoService {
// CreateMemo creates a memo.
rpc CreateMemo(CreateMemoRequest) returns (Memo) {
option (google.api.http) = {
post: "/api/v1/memos"
body: "memo"
};
}
// ListMemos lists memos with pagination and filter.
rpc ListMemos(ListMemosRequest) returns (ListMemosResponse) {
option (google.api.http) = {
get: "/api/v1/memos"
additional_bindings: {get: "/api/v1/{parent=users/*}/memos"}
};
}
// GetMemo gets a memo.
rpc GetMemo(GetMemoRequest) returns (Memo) {
option (google.api.http) = {get: "/api/v1/{name=memos/*}"};
option (google.api.method_signature) = "name";
}
// UpdateMemo updates a memo.
rpc UpdateMemo(UpdateMemoRequest) returns (Memo) {
option (google.api.http) = {
patch: "/api/v1/{memo.name=memos/*}"
body: "memo"
};
option (google.api.method_signature) = "memo,update_mask";
}
// DeleteMemo deletes a memo.
rpc DeleteMemo(DeleteMemoRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {delete: "/api/v1/{name=memos/*}"};
option (google.api.method_signature) = "name";
}
// RenameMemoTag renames a tag for a memo.
rpc RenameMemoTag(RenameMemoTagRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
patch: "/api/v1/{parent=memos/*}/tags:rename"
body: "*"
};
}
// DeleteMemoTag deletes a tag for a memo.
rpc DeleteMemoTag(DeleteMemoTagRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {delete: "/api/v1/{parent=memos/*}/tags/{tag}"};
}
// SetMemoResources sets resources for a memo.
rpc SetMemoResources(SetMemoResourcesRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
patch: "/api/v1/{name=memos/*}/resources"
body: "*"
};
option (google.api.method_signature) = "name";
}
// ListMemoResources lists resources for a memo.
rpc ListMemoResources(ListMemoResourcesRequest) returns (ListMemoResourcesResponse) {
option (google.api.http) = {get: "/api/v1/{name=memos/*}/resources"};
option (google.api.method_signature) = "name";
}
// SetMemoRelations sets relations for a memo.
rpc SetMemoRelations(SetMemoRelationsRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
patch: "/api/v1/{name=memos/*}/relations"
body: "*"
};
option (google.api.method_signature) = "name";
}
// ListMemoRelations lists relations for a memo.
rpc ListMemoRelations(ListMemoRelationsRequest) returns (ListMemoRelationsResponse) {
option (google.api.http) = {get: "/api/v1/{name=memos/*}/relations"};
option (google.api.method_signature) = "name";
}
// CreateMemoComment creates a comment for a memo.
rpc CreateMemoComment(CreateMemoCommentRequest) returns (Memo) {
option (google.api.http) = {
post: "/api/v1/{name=memos/*}/comments"
body: "comment"
};
option (google.api.method_signature) = "name";
}
// ListMemoComments lists comments for a memo.
rpc ListMemoComments(ListMemoCommentsRequest) returns (ListMemoCommentsResponse) {
option (google.api.http) = {get: "/api/v1/{name=memos/*}/comments"};
option (google.api.method_signature) = "name";
}
// ListMemoReactions lists reactions for a memo.
rpc ListMemoReactions(ListMemoReactionsRequest) returns (ListMemoReactionsResponse) {
option (google.api.http) = {get: "/api/v1/{name=memos/*}/reactions"};
option (google.api.method_signature) = "name";
}
// UpsertMemoReaction upserts a reaction for a memo.
rpc UpsertMemoReaction(UpsertMemoReactionRequest) returns (Reaction) {
option (google.api.http) = {
post: "/api/v1/{name=memos/*}/reactions"
body: "*"
};
option (google.api.method_signature) = "name";
}
// DeleteMemoReaction deletes a reaction for a memo.
rpc DeleteMemoReaction(DeleteMemoReactionRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {delete: "/api/v1/reactions/{id}"};
option (google.api.method_signature) = "id";
}
}
enum Visibility {
VISIBILITY_UNSPECIFIED = 0;
PRIVATE = 1;
PROTECTED = 2;
PUBLIC = 3;
}
message Memo {
reserved 2;
// The name of the memo.
// Format: memos/{memo}, memo is the user defined id or uuid.
string name = 1 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.field_behavior) = IDENTIFIER
];
State state = 3;
// The name of the creator.
// Format: users/{user}
string creator = 4;
google.protobuf.Timestamp create_time = 5;
google.protobuf.Timestamp update_time = 6;
google.protobuf.Timestamp display_time = 7;
string content = 8;
repeated Node nodes = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
Visibility visibility = 10;
repeated string tags = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
bool pinned = 12;
repeated Resource resources = 14;
repeated MemoRelation relations = 15;
repeated Reaction reactions = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
Property property = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
// The name of the parent memo.
// Format: memos/{id}
optional string parent = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
// The snippet of the memo content. Plain text only.
string snippet = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
// The location of the memo.
optional Location location = 20;
message Property {
bool has_link = 1;
bool has_task_list = 2;
bool has_code = 3;
bool has_incomplete_tasks = 4;
}
}
message Location {
string placeholder = 1;
double latitude = 2;
double longitude = 3;
}
message CreateMemoRequest {
// The memo to create.
Memo memo = 1 [(google.api.field_behavior) = REQUIRED];
}
message ListMemosRequest {
// The parent is the owner of the memos.
// If not specified or `users/-`, it will list all memos.
string parent = 1;
// The maximum number of memos to return.
int32 page_size = 2;
// A page token, received from a previous `ListMemos` call.
// Provide this to retrieve the subsequent page.
string page_token = 3;
// The state of the memos to list.
// Default to `NORMAL`. Set to `ARCHIVED` to list archived memos.
State state = 4;
// What field to sort the results by.
// Default to display_time.
string sort = 5;
// The direction to sort the results by.
// Default to DESC.
Direction direction = 6;
// Filter is a CEL expression to filter memos.
// Refer to `Shortcut.filter`.
string filter = 7;
// [Deprecated] Old filter contains some specific conditions to filter memos.
// Format: "creator == 'users/{user}' && visibilities == ['PUBLIC', 'PROTECTED']"
string old_filter = 8;
}
message ListMemosResponse {
repeated Memo memos = 1;
// A token, which can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
string next_page_token = 2;
}
message GetMemoRequest {
// The name of the memo.
string name = 1;
}
message UpdateMemoRequest {
// The memo to update.
// The `name` field is required.
Memo memo = 1 [(google.api.field_behavior) = REQUIRED];
google.protobuf.FieldMask update_mask = 2;
}
message DeleteMemoRequest {
// The name of the memo.
string name = 1;
}
message RenameMemoTagRequest {
// The parent, who owns the tags.
// Format: memos/{id}. Use "memos/-" to rename all tags.
string parent = 1;
string old_tag = 2;
string new_tag = 3;
}
message DeleteMemoTagRequest {
// The parent, who owns the tags.
// Format: memos/{id}. Use "memos/-" to delete all tags.
string parent = 1;
string tag = 2;
bool delete_related_memos = 3;
}
message SetMemoResourcesRequest {
// The name of the memo.
string name = 1;
repeated Resource resources = 2;
}
message ListMemoResourcesRequest {
// The name of the memo.
string name = 1;
}
message ListMemoResourcesResponse {
repeated Resource resources = 1;
}
message MemoRelation {
Memo memo = 1;
Memo related_memo = 2;
enum Type {
TYPE_UNSPECIFIED = 0;
REFERENCE = 1;
COMMENT = 2;
}
Type type = 3;
message Memo {
// The name of the memo.
// Format: memos/{id}
string name = 1;
string uid = 2;
// The snippet of the memo content. Plain text only.
string snippet = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}
}
message SetMemoRelationsRequest {
// The name of the memo.
string name = 1;
repeated MemoRelation relations = 2;
}
message ListMemoRelationsRequest {
// The name of the memo.
string name = 1;
}
message ListMemoRelationsResponse {
repeated MemoRelation relations = 1;
}
message CreateMemoCommentRequest {
// The name of the memo.
string name = 1;
// The comment to create.
Memo comment = 2;
}
message ListMemoCommentsRequest {
// The name of the memo.
string name = 1;
}
message ListMemoCommentsResponse {
repeated Memo memos = 1;
}
message ListMemoReactionsRequest {
// The name of the memo.
string name = 1;
}
message ListMemoReactionsResponse {
repeated Reaction reactions = 1;
}
message UpsertMemoReactionRequest {
// The name of the memo.
string name = 1;
Reaction reaction = 2;
}
message DeleteMemoReactionRequest {
// The id of the reaction.
// Refer to the `Reaction.id`.
int32 id = 1;
}

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