Commit graph

208 commits

Author SHA1 Message Date
hulb
2b1ddd093d
replace assets generation with embed (#423) 2022-05-26 19:36:23 +02:00
hulb
8732fd7b6d
implement migration for mysql & postgres (#422) 2022-05-03 23:30:28 +02:00
Felipe Martin Garcia
ce8a172682
fix: bookmark content download (#413)
Fixed a bug where the content of the article would archive but the
reader version would not be saved due to variable passing. Also made the
code easier to follow by following return principles.

Fixes #406
2022-03-27 21:01:49 +02:00
Felipe Martin Garcia
0fe24d2598
fix: url modification when query param is empty (#411)
This commit fixes URL malformation when trying to remove the utm social
query parameters from an URL, which upon finishing and reconstructing
would attach the equal symbol even if the original URL didn't have it.

This is a known Go "bug" [1] that isn't going to be "fixed". I quote
that because server side should behave the same for `?a=&b=1` and
`?a&b=1` for the `a` parameter, but sometimes that's not the case.

[1]: https://github.com/golang/go/issues/20820

Fixes #409
2022-03-27 21:01:39 +02:00
Felipe Martin Garcia
81d52a2e24
feat: sqlite migrations (#398)
- Moved migrations from code to SQL files
- Using golang-migrate/v4
- Added a new CLI command: migrate
2022-03-26 08:33:57 +01:00
Tung Le
ca3cc11b2d
sqlite: remove unneeded LEFT JOIN to improve performance (#387)
* sqlite: remove unneeded LEFT JOIN to improve performance

* Fix handling join clause in GetBookmarks

* Revert changes in GetBookmarks
2022-03-10 23:32:58 +01:00
Felipe Martin Garcia
560a677f50
fix: trying to mkdir over an incorrect data path (#378) 2022-02-23 19:00:16 +01:00
Emmanuel Frecon
e1e2c7bfd8
Web Server and CI Improvements (#374)
* Fix for infinite redirect loop

path.Join trims the trailing slash if the path isn't /, use configured
root instead.

* Add repo root independence

This makes the workflows agnostic of the repository root, making it
possible to build in forked repos.

* Add HTTP request logging

* Fix proper RootPath handler

* Add logging for all resources

This adds proper logging for all resources, including errors. Logging
is on by default, but can be turned off.

* Report effective length of written data
2022-02-19 08:22:50 +01:00
n8225
2b4fd9f0cb
Remove unneeded alter table transactions from sqlite (#372) 2022-02-14 19:49:46 +01:00
Felipe Martin Garcia
0bd297d63c
fix: update bookmark on sqlite database (#367)
It used an update and insert at the same time, since the virtual table
cannot have constrants nor upserts we need to try an update the
bookmark content to check for it's existence, inserting it only if the
update fails (don't affect any rows).

This will need to be improved in the future, since not all bookmark
updates require modification of the content table (in my case, I was
testing only updating tags).
2022-02-13 21:28:40 +01:00
Felipe Martin Garcia
fb0bf38b7e
feat: async content download when creating via api (#368)
* feat: async content download when creating via api

Invoking the content download code in a goroutine after saving the
bookmark, this way we can return a response to the user quickly while
the webpage is donwloaded and archived.

Cache api endpont (/api/cache) remains untouched until I understand
the logic behind it.

Also updated the API endpoint for the extension, though I'm unsure why
there's a difference between the "regular" API and the webext API,
they should be using the same APIs.
2022-02-13 21:09:42 +01:00
Felipe Martin Garcia
a76b121098
fix: golangci-lint errors (#366) 2022-02-13 16:38:27 +01:00
Felipe M
2ca628b7fe
hotfix: fixes session duration from #346 2022-02-11 16:00:38 +01:00
Felipe Martin Garcia
d56993292b
fix: remember me session duration (#346)
- Default session duration is 1h
- Increased session duration (when remember me is checked) is
  increased to 30d.
2022-02-11 14:05:34 +01:00
n8225
f1c98a8e98
Update Dependencies and Replace mattn/go-sqlite with modernc.org/sqlite (#345)
* No more CGO

* Update all dependencies to current

* Only test against go 1.17.
2022-02-11 13:59:49 +01:00
Dean Jackson
4ff6ddd65a
Merge pull request #246 from Midek/master
update url also when offline mode
2020-08-06 22:28:04 +02:00
Dean Jackson
a0ce725167 Exit with non-zero status when add fails 2020-08-06 21:12:34 +02:00
Dean Jackson
acc86d74e2 Exit with non-zero status when add fails 2020-08-06 20:03:25 +02:00
Midov
3fe593d2e7 update url also when offline mode 2020-05-04 00:29:44 +02:00
Dean Jackson
32f9d2695f Explicit charset for MySQL connection 2019-12-13 08:52:26 +01:00
Dean Jackson
a5cb2c6e40 Fix login autofill
Add <form> element, as some browsers won't autofill fields
not contained in form.

Remove username and password bindings, and explicitly read
inputs instead. Some browsers do not fire onChange events
when a field is autofilled for security reasons, so Vue
bindings don't register the change.

https://github.com/facebook/react/issues/1159#issuecomment-506584346
2019-12-13 08:36:16 +01:00
Khoa Nguyen
d1d48ad788 wrap mime.TypeByExtension with preset mimetypes 2019-10-21 20:16:50 -07:00
Ninh Pham
98353369f7
Fix: grid layout on dialog 2019-10-14 10:51:11 +07:00
Radhi Fadlillah
7a2bcacf51 Fix: hasArchive icon gone after update bookmark 2019-10-13 08:37:10 +07:00
Radhi Fadlillah
7d938f3893 Fix: checkbox in dialog doesn't work 2019-10-13 08:22:17 +07:00
Ninh Pham
ef248c8fc4
Fix: Bookmark content displays Invalid Date if database is PostgreSQL #201 2019-10-12 20:15:11 +07:00
Radhi Fadlillah
d2906b126a Fix wrong cookie path 2019-10-11 14:14:17 +07:00
Ninh Pham
e41cea6642
Fix: Safari does not accept document.baseURI for cookie path 2019-10-11 13:28:25 +07:00
Radhi Fadlillah
0bc1b4a4cc Make sure archive use UTF-8 encoding 2019-10-09 20:49:26 +07:00
Radhi Fadlillah
a3e1563dff Move warc to another package 2019-10-09 20:10:12 +07:00
Radhi Fadlillah
9e962f0b2d Fix: now cookie set per subpath #39 2019-10-07 15:33:32 +07:00
Radhi Fadlillah
99d27930ea Initial support for subpath #39 2019-10-07 13:38:40 +07:00
Radhi Fadlillah
3077c7fbb8 Use tab instead of spaces 2019-10-04 16:51:08 +07:00
Radhi Fadlillah
bf974facdc Add border around table in content view 2019-10-04 16:36:41 +07:00
Radhi Fadlillah
52bb4d9d8a Prevent browser doing MIME sniffing #182 2019-10-04 07:22:37 +07:00
Radhi Fadlillah
9ba9d1eced Fix: wrong query in PostgreSQL 2019-10-03 21:47:03 +07:00
Radhi Fadlillah
a4dd1c8687 Specify character set when creating MySQL table #188 2019-10-03 21:02:25 +07:00
Radhi Fadlillah
28ee496a68 Fix title is empty when adding bookmark 2019-10-03 20:23:28 +07:00
Radhi Fadlillah
9f145e27ef Tidy up code for opening database 2019-09-26 06:24:49 +07:00
Radhi
c2eee1d59a
Merge pull request #170 from bvp/master
Initial PostgreSQL support
2019-09-25 11:22:22 +07:00
Radhi Fadlillah
b315c48acf Fix content with double braces not rendered #171 2019-09-25 07:32:03 +07:00
bvp
4eb86d60d7
Initial PostgreSQL support 2019-09-24 19:59:25 +03:00
Radhi Fadlillah
752d1ba4f6 In no-thumbnail mode, make margin more consistent 2019-09-24 21:59:17 +07:00
Radhi Fadlillah
a82b8820bd Add options to hide excerpt #166 2019-09-24 21:16:03 +07:00
Radhi Fadlillah
c77b17caf8 Use formatter in LESS files 2019-09-24 11:56:35 +07:00
Radhi Fadlillah
bccc70b3f8 Add option to hide thumbnail image #166 2019-09-24 09:47:50 +07:00
Radhi Fadlillah
3a9e53cc71 Initial unit test.. 2019-09-23 15:55:17 +07:00
Marko Korhonen
59a0594155
Fixed some typos 2019-09-23 10:43:29 +03:00
Radhi
7d3f8d712c
Merge pull request #164 from deanishe/fix-mysql-schema
Fix MySQL schema
2019-09-23 12:44:54 +07:00
Dean Jackson
988f2d6502 Use single quotes for better compatibility 2019-09-22 19:15:04 +02:00
Dean Jackson
ddf7c37208 Fix MySQL column definitions
- Add AUTO_INCREMENT to `id` fields
- Fix DEFAULT definitions on TEXT/BLOB fields

TEXT/BLOB field default values must be expressions:
https://dev.mysql.com/doc/refman/8.0/en/data-type-defaults.html
2019-09-22 18:58:26 +02:00
Dean Jackson
76a7856f80 Add specific size to bookmark_url key
MySQL can't index an entire TEXT field; the key must be truncated
https://stackoverflow.com/a/1827099
2019-09-22 18:49:11 +02:00
Dean Jackson
c55b1a3fef Default to webpage title, not URL, if user specifies no title 2019-09-22 18:36:36 +02:00
Radhi Fadlillah
fbd4e37643 Fix custom title and excerpt doesn't saved 2019-09-22 16:17:51 +07:00
Radhi Fadlillah
1d83468455 Fix when using extension bookmark doesn't archived 2019-09-22 15:58:26 +07:00
Radhi Fadlillah
018f33228a Fix import skipped when title missing #153 2019-09-22 10:55:22 +07:00
Radhi Fadlillah
df98c281d3 Make MySQL address changeable #156 2019-09-22 08:25:34 +07:00
Radhi Fadlillah
2eb6415fa8 Add check command 2019-09-21 16:30:39 +07:00
Radhi Fadlillah
0bf5772022 Remove unneeded local variables 2019-09-21 16:19:45 +07:00
Radhi Fadlillah
7e16b020d6 Minor gofmt change 2019-09-21 11:10:53 +07:00
Radhi Fadlillah
f68835fdef Minor improvement in cmd description 2019-09-20 17:27:49 +07:00
Radhi Fadlillah
64c62d6b12 Remove repeated code for archiving bookmarks 2019-09-20 16:48:57 +07:00
Radhi Fadlillah
2da0c7e297 Update readme to include web extension 2019-09-05 17:31:44 +07:00
Radhi Fadlillah
a5b4f78f10 Fix typo 2019-08-30 11:43:53 +07:00
Radhi Fadlillah
531c66c955 When session expired and user login, return him to previous page 2019-08-29 16:14:19 +07:00
Radhi Fadlillah
3f43424af0 Make search result share-able by URL 2019-08-29 15:44:03 +07:00
Radhi Fadlillah
89aad30a17 Fix: missing column while updating database 2019-08-29 09:45:45 +07:00
Radhi Fadlillah
af2949b2d9 Tagged and untagged shouldn't be able to renamed 2019-08-27 20:50:40 +07:00
Radhi Fadlillah
abcdfc9d13 Fix failed to rename tag in web interface 2019-08-27 20:42:13 +07:00
Radhi Fadlillah
63070d1b15 Add readme 2019-08-27 16:04:57 +07:00
Radhi Fadlillah
806a3cff40 Add flag to specify custom address 2019-08-27 12:36:24 +07:00
Radhi Fadlillah
c22f904bdd If there are no owner yet, allow to use default account 2019-08-22 14:34:36 +07:00
Radhi Fadlillah
6b39742a35 Make SQLite database compatible with old version 2019-08-22 14:27:38 +07:00
Radhi Fadlillah
02699ab460 Increase write timeout 2019-08-20 15:34:53 +07:00
Radhi Fadlillah
f50d0cca5d Better error handle in JS 2019-08-20 14:29:55 +07:00
Radhi Fadlillah
f62fd30f65 Set cache tag for thumbnail image 2019-08-20 14:29:38 +07:00
Radhi Fadlillah
39bf9840a2 Add API for web extension 2019-08-19 18:22:21 +07:00
Radhi Fadlillah
9616164356 Now session id can be put in cookie or http header 2019-08-13 22:13:38 +07:00
Radhi Fadlillah
86eb8d9a3e Make bookmark menu visible in mobile 2019-08-13 10:58:42 +07:00
Radhi Fadlillah
bd9d4b1d0c For now, ignore modified from import since we don't use it 2019-08-12 21:41:44 +07:00
Radhi Fadlillah
e55070ca77 Better style for empty bookmark message 2019-08-12 20:37:03 +07:00
Radhi Fadlillah
b6f6864ea5 Fix: shiori is a default owner 2019-08-12 20:26:29 +07:00
Radhi Fadlillah
0c4d75f773 Add basic account level management 2019-08-12 19:57:18 +07:00
Radhi Fadlillah
326f04d19e Add icon to show if bookmark archived and public 2019-08-12 11:53:41 +07:00
Radhi Fadlillah
2cb95c1238 Now cache image will uses archive 2019-08-12 09:02:59 +07:00
Radhi Fadlillah
4e76288e09 Add method to exclude or include some tags 2019-08-11 15:55:31 +07:00
Radhi Fadlillah
11c6680397 Add options to keep title and excerpt when update 2019-08-10 20:13:13 +07:00
Radhi Fadlillah
667e5b2e74 Initial MySQL support 2019-08-10 08:13:13 +07:00
Radhi Fadlillah
ad502c6749 Add portable mode 2019-08-09 10:19:43 +07:00
Radhi Fadlillah
20e89216f0 Add option to mark if bookmark archive is public 2019-08-08 20:16:25 +07:00
Radhi Fadlillah
54e02e5c76 Add edit URL on web interface 2019-08-08 11:00:48 +07:00
Radhi Fadlillah
36195dc202 Improve UX for renaming tags 2019-08-08 08:28:24 +07:00
Radhi Fadlillah
ea73eaff64 Add method for renaming tag 2019-08-07 23:30:17 +07:00
Radhi Fadlillah
690bda85f7 Make dialog closable using esc key 2019-08-07 17:38:53 +07:00
Radhi Fadlillah
dcef9162e4 Load initial page depending on submitted URL 2019-08-07 17:01:19 +07:00
Radhi Fadlillah
bc9aa7f634 Now search look at excerpt as well 2019-08-07 10:56:12 +07:00
Radhi Fadlillah
f79eb5c1dd Show localtime instead of UTC 2019-08-06 23:37:52 +07:00
Radhi Fadlillah
c8c29fe933 Fix: add rel=noopener on link that open new tab 2019-08-06 22:30:01 +07:00
Radhi Fadlillah
c62c33c5cd Fix: after add or update the archive is not accessible 2019-08-06 21:31:01 +07:00
Radhi Fadlillah
1399e0fc9f Fix: archive is never closed 2019-08-06 20:51:06 +07:00