Commit Graph

548 Commits (5962c6d04b241c23bb2a2290db25a06211a86e40)

Author SHA1 Message Date
Steven fa62e8b59a chore: tweak linter errors 1 year ago
Steven 8e11826db1 chore: update workspace setting service 1 year ago
Steven b3ca9969c4 chore: tweak linter 1 year ago
Steven 3dddd3ec4c chore: tweak reaction store 1 year ago
Steven 4081a6f5ad chore: add more reactions 1 year ago
Steven 3a5bc82d39 chore: implement reaction service 1 year ago
Steven 43a2d6ce09 chore: tweak user setting 1 year ago
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
1 year ago
Steven 559e427c50 chore: implement reaction store 1 year ago
Steven b4f2a3bd14 chore: remove migrator 1 year ago
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
1 year ago
Steven de8db63811 chore: rename workspace setting service 1 year ago
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.
1 year ago
Steven ef73299340 chore: update resource name migrator 1 year ago
Steven f05a89315c chore: fix list memos 1 year ago
Steven 5e74394643 chore: add resource name migrator 1 year ago
Wei Zhang ddc89029b7
fix: use mysql to parse dsn (#2838)
Signed-off-by: Zhang Wei <kweizh@gmail.com>
1 year ago
Steven f8b9a83d4a chore: tweak default value 1 year ago
Steven 2f16b7065a chore: tweak scripts 1 year ago
Steven 4f2b00b4f3 chore: add migration scripts 1 year ago
Steven 54a24833a7 chore: fix resource seeds 1 year ago
Steven 582cc6609c feat: add user-defined id to resource 1 year ago
Steven b2fc3076f6 chore: update memo store 1 year ago
Steven 8382354ef7 feat: add user-defined name to memo 1 year ago
Steven d426f89cf0 chore: add time filter to timeline 1 year ago
Wen Sun a22ad90174
fix: set memo resources error in mysql (#2761)
Fix error updating memo resources in mysql
1 year ago
Steven 8e0ce4d678 fix: list memos with pinned 1 year ago
Wen Sun 6cfd94cc69
fix: deleting inbox records that senders have been deleted (#2743)
Deleting inbox records that senders have been deleted
1 year ago
Steven 9c663b1ba2 fix: merge mysql dsn with params 1 year ago
Steven 9459ae8265 chore: update postgres stmt builder 1 year ago
Steven d67eaaaee2 chore: update database migrator 1 year ago
Steven fd8333eeda chore: fix memo parent_id 1 year ago
Steven a297cc3140 chore: exclude comments in memo list response 1 year ago
Steven 8b9455d784 chore: fix memo resources position 1 year ago
Steven 501f8898f6 chore: fix postgres stmts 1 year ago
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
1 year ago
Steven c797099950 chore: update resource internal path migrator 1 year ago
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)
1 year ago
Steven 02265a6e1a chore: fix memo search 1 year ago
Athurg Gooth f184d65267
fix: attachments send from telegram lost (#2650) 1 year ago
Steven 762cb25227 chore: update memo service 1 year ago
Steven fc01a796f8 chore: fix demo seed data 1 year ago
Steven e0cacfc6d6 chore: retire auto backup for sqlite 1 year ago
Steven a3a1bbe8de chore: tweak responsible styles 1 year ago
Steven fe4ec0b156 chore: rename navigator 1 year ago
Steven 7c5fdd1b06 chore: remove demo banner 1 year ago
Steven d8a0528135 chore: tweak variable names 1 year ago
Steven 2c4b5d75b3 chore: fix html escaping 1 year ago
Steven 1c7fb77e05 chore: update user setting names 1 year ago
Steven 47af632c79 chore: update inline parser 1 year ago
Steven 7735cfac31 chore: update seed data 1 year ago
Steven 2d9c5d16e1 chore: fix user string 1 year ago
Steven 7eb5be0a4e chore: fix update user 1 year ago
Steven 603a6a4971 chore: fix vacuum memo 1 year ago
Cologler 6bda64064e
fix: delete one memo will delete all memos on pgsql (#2611)
fix: delete single memo will all memos on pgsql

Close #2605
1 year ago
Steven c608877c3e chore: clean binary entries 1 year ago
Steven 52f399a154 chore: remove unused functions 1 year ago
Steven 9f4f2e8e27 chore: fix user setting values 1 year ago
Steven 0127e08a28 fix: data conflict handler 1 year ago
Steven d275713aff chore: fix timestamp type in postgres 1 year ago
Steven c50f4f4cb4 chore: update migration scripts 1 year ago
Steven abda6ad041 chore: update latest schema 1 year ago
Steven 7fc7b19d64 chore: deprecate user setting legacy api 1 year ago
Steven b2d898dc15 chore: fix import order 1 year ago
Steven 15425093af chore: skip user setting key checks 1 year ago
steven c68bfcc3b9 chore: fix user setting store 1 year ago
Steven fa6693a7ae chore: update list memos 1 year ago
Athurg Gooth 5f86769255
fix: field type of row_status for table webhook (#2579)
Fix field type of row_status for table webhook
1 year ago
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
1 year ago
Steven a12844f5db chore: tweak seed data 1 year ago
Steven 1a5bce49c2 chore: implement webhook store 1 year ago
Athurg Gooth 91296257fc
chore: remove invalid access token from db (#2539)
Remove invalid access token from db
1 year ago
Steven 6529375a8b chore: update seed data 1 year ago
Steven ec2995d64a chore: fix order by pinned 1 year ago
Steven 981bfe0464 feat: add version checker 1 year ago
Steven 695fb1e0ca chore: update migration history store 1 year ago
Steven 405fc2b4d2 chore: simplify find migration history 1 year ago
Steven eacd3e1c17 chore: fix mysql latest schema 1 year ago
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
1 year ago
Steven dca712d273 chore: fix resource tests 1 year ago
Steven ac81d856f6 chore: delete resource file sync 1 year ago
Steven 88fb79e458 chore: impl inbox store for mysql 1 year ago
Steven 0ee938c38b chore: remove unused inbox status 1 year ago
Steven 3c36cc2953 feat: add inbox ui 1 year ago
Steven 79bb3253b6 chore: add activity service 1 year ago
Steven 18107248aa chore: rename list inbox 1 year ago
Steven 1b34119e60 chore: update activity store definition 1 year ago
Steven 67d2e4ebcb chore: update method name 1 year ago
Steven 4ea78fa1a2 chore: impl inbox store methods 1 year ago
Steven 93b8e2211c chore: update dev latest schema 1 year ago
Steven 052216c471 chore: fix list activities typo 1 year ago
Steven e5978a70f5 chore: initial inbox store model 1 year ago
Athurg Gooth 215981dfde
chore: remote context.Context pointer (#2448)
remote context.Context pointer
1 year ago
Steven 5b3af827e1 chore: move common packages to internal 1 year ago
Steven d06d01cef2 chore: release mysql driver 1 year ago
Athurg Gooth af7c0a76d0
fix: fail to update user's update_ts (#2410) 1 year ago
Steven 1b105db958 chore: fix field syntax 1 year ago
Steven 6f2ca6c87a chore: update find memo api 1 year ago
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
1 year ago
Athurg Gooth 6bb6c043e5
feat: add support for ListMemoOrganizer (#2367)
* Add support for ListMemoOrganizer

* fix rows not close
1 year ago
Athurg Gooth fa2bba51c1
feat: add support for ListActivity (#2365)
Add support for ListActivity
1 year ago
Athurg Gooth 425b43b3bb
fix: ListTag not support omit params (#2366)
fix ListTag not support omit params
1 year ago
Athurg Gooth 287f1beb90
fix: create storage without some attributes (#2358) 1 year ago
Athurg Gooth 7680be1a2f
fix: create user without some attributes (#2357) 1 year ago
Athurg Gooth 55e0fbf24e
fix: create activity without some attributes (#2356) 1 year ago
Athurg Gooth eaac17a236
fix: create memo without some attributes (#2355) 1 year ago
Athurg Gooth 1fbd568dfe
fix: create resource without some attributes (#2354) 1 year ago
Athurg Gooth c0619ef4a4
fix: CreateIdentityProvider without id (#2352) 1 year ago
Athurg Gooth b2aa66b4fd
fix: migration always in mysql (#2353) 1 year ago
Steven b938c8d7b6 chore: only show comments in memo detail page 1 year ago
Steven 553de3cc7e fix: mysql syntax 1 year ago
Steven c0422dea5b chore: fix sqlite migrator 1 year ago
Steven 7791fb10d8 chore: update new db driver 1 year ago
Steven a6ee61e96d chore: update package name 1 year ago
Steven 7dcc5cbaf1 chore: fix mysql migrator 1 year ago
Steven d474d1abd0 chore: update store cache 1 year ago
Steven fd395e5661 chore: update list memo relations 1 year ago
Steven be046cae8e chore: add parent field to memo 1 year ago
Steven 922de07751 feat: impl memo comment api 1 year ago
steven a928c4f845 chore: update error format 1 year ago
steven 8168fb71a8 chore: update migrator 1 year ago
Steven 87ddeb2c79 chore: adjust store test for mysql 1 year ago
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
1 year ago
CorrectRoadH 4ca2b551f5
chore: update seed data (#2311) 1 year ago
Steven c54febd024 chore: fix reset script 1 year ago
Athurg Gooth 5121e9f954
chore: move migration and seed code into driver (#2294)
Move migration and seed code into driver
1 year ago
Athurg Gooth ca98367a0a
chore: store vacuum and clean (#2293)
* Move all vacuum code into driver

* Remove db from Store
1 year ago
Steven 9abf294eed chore: update seed data 1 year ago
Athurg Gooth 9ce22e849c
chore: move SQL code of Memo into Driver (#2292) 1 year ago
Athurg Gooth 58b84f83d1
chore: move SQL code of MemoOrganizer into Driver (#2291) 1 year ago
Athurg Gooth acbde4fb2d
chore: move SQL code of MemoRelation into Driver (#2290) 1 year ago
Steven 71ee299de7 chore: drop shortcut 1 year ago
Steven 03a0972712 chore: rename sqlite entry file name 1 year ago
Steven 6007f48b7d chore: retire memo resource relation table 1 year ago
Steven 4180cc3a3d refactor: migrate storage to driver 1 year ago
Steven d6789550a0 refactor: migrate tag to driver 1 year ago
Steven d68da34eec refactor: migrate idp to driver 1 year ago
Steven 96395b6d75 chore: rename package `sqlite3` to `sqlite` 1 year ago
Athurg Gooth d3a6fa50d6
chore: move sql code of Resource into driver (#2286)
Move sql code of Resource into driver
1 year ago
Athurg Gooth 14ec524805
chore: move sql code of UserSetting into Driver (#2282)
* Move SQL code of UserSetting into Driver

* Fix golang import issue
1 year ago
Athurg Gooth fcba3ffa26
chore: move sql code of User into driver (#2281)
Move SQL code of User into Driver
1 year ago
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
1 year ago
Steven 8c2f89edc5 chore: update demo username 1 year ago
Steven 6cff920f0c chore: update user demo data 1 year ago
Steven 465b173b36 chore: fix resource int type 1 year ago
Steven 9bf1979fa8 fix: list resources 1 year ago
Steven cd0ea6558d chore: update golangci-lint config 1 year ago
Steven 3a1f82effa fix: migration script 1 year ago
Steven a3d7cc9392 fix: migration script 1 year ago
Steven fb1490c183 feat: impl resources list page 1 year ago
Steven 4424c8a231 chore: add resource service definition 1 year ago
Steven 28a1888163 chore: fix user seed data 1 year ago
Steven f5802a7d82 chore: update access token ui 1 year ago
Steven 33d9c13b7e chore: remove openid field from user 1 year ago
Steven 42bd9b194b feat: impl user access token api 1 year ago
Steven d63715d4d9 feat: implement list memos filter 1 year ago
Steven 93f062d0b9 chore: update user v2 api 1 year ago
boojack ad1822d308
chore: update db utils (#2177) 2 years ago
boojack 4af0d03e93
chore: add user profile page (#2175)
chore: some enhancements
2 years ago
YuNing Chen 409d686f7d
chore: minor cleanup (#2124) 2 years ago
boojack 7c5296cf35
chore: update id type to int32 (#2076) 2 years ago
boojack 1ce82ba0d6
chore: remove shortcut related api (#2072) 2 years ago
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
2 years ago
boojack 4c33d8d762
chore: remove unused transaction in store (#1995)
* chore: remove unused transaction in store

* chore: update
2 years ago
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
2 years ago
boojack 5e20094386
chore: add indexes (#1959) 2 years ago
boojack 40a30d46af
chore: update db connection params (#1960) 2 years ago
Athurg Gooth d9b3501fae
feat: add support for auto backup db file (#1950)
Add support for auto backup db file
2 years ago
boojack 698380f940
chore: update seed data (#1928) 2 years ago
boojack 7e391bd53d
chore: remove resource public id (#1912)
* chore: remove resource public id

* chore: update
2 years ago
boojack 0e05c62a3b
chore: update common utils (#1908) 2 years ago
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
2 years ago
boojack 1fa9f162a5
refactor: migrate resource to apiv1 (#1901) 2 years ago
boojack 5b6c98582e
refactor: migrate storage to apiv1 (#1890)
* refactor: migrate storage to apiv1

* chore: update

* chore: update

* chore: update
2 years ago
boojack 223404a240
chore: update memo seed data (#1884) 2 years ago
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
2 years ago
boojack 9a8d43bf88
chore: update user store names (#1877)
* chore: update user store names

* chore: update
2 years ago
Vespa314 63d6b6f9f9
chore: listMemos sort by id for memos post/update at the same time (#1866) 2 years ago
boojack 6a78887f1d
chore: update store types name (#1862) 2 years ago
boojack 7226a9ad47
chore: update idp store (#1856) 2 years ago
boojack b44f2b5ffb
chore: migrate user setting to api v1 package (#1855)
* chore: migrate to api v1 package

* chore: update
2 years ago
boojack 07e82c3f4a
fix: schema migrate (#1846)
* fix: schema migrate

* chore: update
2 years ago
boojack b34aded376
refactor: migration idp api (#1842)
* refactor: migration idp api

* chore: update
2 years ago
boojack 4ed9a3a0ea
refactor: migrate auth routes to v1 package (#1841)
* feat: add api v1 packages

* chore: migrate auth to v1

* chore: update test
2 years ago
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>
2 years ago
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>
2 years ago
boojack beb4d8ccb9
chore: order by updated ts in memo store (#1761) 2 years ago
boojack c40aeb91e6
fix: patch memo row status (#1755) 2 years ago
boojack 2e34ce90a1
chore: upgrade version `0.13.1` (#1754) 2 years ago
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>
2 years ago
Athurg Gooth 1282fe732e
feat: implement telegram bot plugin (#1740) 2 years ago
boojack de8014dfe8
feat: resource store cache (#1742) 2 years ago
boojack ea728d232d
refactor: memo store (#1741) 2 years ago
boojack 1d7627dd72
chore: upgrade version `0.13.0` (#1685)
* chore: upgrade version `0.13.0`

* chore: update
2 years ago
boojack a07d5d38d6
feat: memo relation part1 (#1677)
* feat: memo relation part1

* chore: update
2 years ago
boojack 1a8310f027
chore: update system setting default value (#1665) 2 years ago
Zeng1998 9eafb6bfb5
chore: add the default value of MaxUploadSizeMiB (#1663) 2 years ago
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
2 years ago
boojack 5c5199920e
chore: seed data for new user (#1655) 2 years ago
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
2 years ago