Commit graph

268 commits

Author SHA1 Message Date
Felipe M. ed7027e2ac
fixed nil references 2024-06-08 18:26:33 +02:00
Felipe M. 4386df7b40
test cleanup 2024-06-08 18:22:16 +02:00
Felipe M. 7618d4a79d
Cleanup database interface 2024-06-08 18:18:05 +02:00
Felipe M. 2ba22f2cfc
fix system account changes 2024-06-08 18:16:12 +02:00
Felipe M. 1dcf6016f2
Merge remote-tracking branch 'origin/master' into fmartingr/issue657 2024-06-08 18:08:06 +02:00
Felipe M. 3069f003b8
error handling 2024-06-08 18:07:10 +02:00
Felipe Martin 72aecd2b60
feat: new system info panel in webui settings (#926)
* frontend

* fixed Database.DBx return value

* api endpoint

* updated swagger

* fix openbsd variable dereference

* tests

* only load information if user is owner

* memory improvement for other routes
2024-06-08 17:48:55 +02:00
Felipe M. 9c480199e8
tests 2024-06-08 09:39:43 +02:00
Felipe M. b79340afa4
domain validation 2024-06-08 09:39:37 +02:00
Felipe M. eaf10f21f0
APIv1: Accounts
Fixes #657
2024-06-06 19:05:48 +02:00
Monirzadeh 2a231ecc37
feat: allow selecting light/dark/follow themes in the webui (#924)
* login page follow browser darkmode settings

* theme change based on selection in settings between follw system , light, dark

* content page follow settings and fix syntax error

* drop down menu color follow current theme

* version number follow theme in login page

* use footer instead of id for version

* replace space with tab

* move theme settings to the top of the list and fix typo

* remove duplicate code and use a function instead

* fix logic of change theme if you select follow system to not need reload anymore

* fix code style with make styles

* fix bug that eventlistener not remove when activate light or dark theme

* less js and add theme with patch by @fmartingr

* remove NightMode config and now everythings control with Theme

* error instead of log if invalid theme selected

Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>

* remove unneeded part and update swagger documents

---------

Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
2024-06-06 10:44:43 +02:00
Monirzadeh 47a0143d1a
fix: swagger document response type (#932) 2024-06-06 07:46:41 +02:00
Felipe Martin a1d7579b85
fix: incorrect original link in archive page (#931) 2024-06-05 21:56:34 +02:00
Felipe M. a90e01ad86
stylecheck 2024-06-04 23:30:54 +02:00
Felipe M. e126bee6a1
swagger 2024-06-04 23:26:42 +02:00
Felipe M. 6ba47227f0
apis, pointers, auth 2024-06-04 23:25:52 +02:00
Felipe M. a397c59ce0
updated api calls 2024-06-04 21:44:05 +02:00
Felipe M. 4f41104ead
Authorization 2024-06-04 21:43:58 +02:00
Felipe M. fee6cf7f9c
update account 2024-06-04 00:33:58 +02:00
Felipe M. 7c09384617
rename test 2024-06-03 23:50:16 +02:00
Felipe M. 0835804f63
more permissive assertion 2024-06-03 19:18:46 +02:00
Felipe M. 56f441e75a
make lint 2024-06-03 19:04:19 +02:00
Felipe M. 21d306641d
ListAccounts, password hash on domain 2024-06-03 18:57:31 +02:00
Felipe M. 8c02f9db87
fix from merge 2024-06-03 17:54:43 +02:00
Felipe M. da169fe80a
remove old accounts code 2024-06-03 17:54:19 +02:00
Felipe M. 14e54a4860
Merge remote-tracking branch 'origin/master' into fmartingr/issue657 2024-06-03 16:53:45 +02:00
Monirzadeh 6c94d56bf0
feat: Home button clear search query (#916)
* click on home will clear searchbox

* clearHome when mounted

* clearHomePage just when you are in homepage

* check clearHomePage signal out of clearHomePage method

* fix style
2024-05-26 15:33:17 +02:00
Felipe Martin 4de4799ef8
fix: ensure tmp folder is present on docker container (#910)
* chore: add logger to bookmark update cache

* ensure there's a tmp folder in the container
2024-05-15 17:02:59 +02:00
Felipe Martin a6e55705da
fix: not checking for nil-pointer errors on migrations (#906) 2024-05-12 19:07:16 +02:00
Monirzadeh eaa6f0ea2a
fix(sqlite): id column should be unique (#894)
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
2024-05-12 17:02:19 +02:00
Paco Esteban 02247b215b
refactor: allow specific sqlite engine for OpenBSD (#780)
* remove dependencies that use syscall.Syscall*

OpenBSD will be removing direct access to `syscall(2)` soon.
Shiori will stop working because of this, as some of its dependencies
rely heavily on the use of `syscall.Syscall*`, which ends up using
`syscall(2)`.  This commit removes those dependencies by reverting back
to use github.com/mattn/go-sqlite3 instead of modernc.org/sqlite to deal
with the sqlite database backend.

* add ~emersion/go-sqlite3-fts5

* enable cgo to check ci

* fts5 build flag

* split sqlite logic using build flags

* disable cgo again

* added ci test for bsd systems

* remove openbsd ci

* Revert "remove openbsd ci"

This reverts commit f394148385.

* fix makefile go_test_flags

---------

Co-authored-by: Felipe M <me@fmartingr.com>
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
2024-05-02 16:38:16 +02:00
Felipe Martin 31767f75e6
feat: new migrations system (#876)
* feat: new migration system

* use newFuncMigration

* database version -> database schema version

* column name

* use path instead of filepath for goembed

* simplified migrations, added backwards compatible migrations
2024-04-27 07:46:36 +02:00
Monirzadeh b8a357829d
feat: api endpoint to serve readable content (#885)
* add endpoint to serve readable content

* add id and modified time in response

* revert id and modified time

* remove public check status

* chnage 401 to 403

* add basic unittest for readable content

* check response in unittest

* update strcut name and move that above handler
2024-04-21 00:59:03 +02:00
Felipe Martin db313f5c62
fix: authentication flow should abort early (#888)
* fix: finish connection once we send auth response

* removed interface for now

* handle authentication in each route group

* tags api tests

* typo

* testutil improvements

* bookmarks api auth

* cache update requires owner
2024-04-13 19:45:03 +02:00
Felipe Martin ceb392d22e
fix: use relative path for all API calls (#872)
Fixes #870
2024-04-07 21:33:22 +02:00
Felipe Martin 48db805480
fix: remove unfinished endpoints (#877) 2024-04-07 21:24:51 +02:00
Felipe Martin 9c7483fd09
fix: override configuration from flags only if set (#865)
* fix: override configuration from flags only if set

* use helper func and test it
2024-03-30 08:33:05 +01:00
Zlendy 5a166906db
fix: use correct endpoint in rename tags operation (#868) 2024-03-25 23:54:55 +01:00
Felipe Martin 1ee762a161
fix: fix problems that may be raised from a 1.5.5 upgrade (#837)
* add missing flag to deprecated serve command

* docs references to initial account

* modify shiori serve references

* update dependencies

* remove serve from shiori -h docs output

* remove migrated routes

* fix faq heading levels

* downgrade go-epub to 1.2.0
2024-02-08 09:26:33 +01:00
Monirzadeh 82aa1e5080
fix: fixes path issues on windows (#829)
* return corrent path in windows with usiing path lib

* ci: run tests in windows and macos too

* avoid testing mysql/psql in windows and macos

* windows & macos matrix

* disable gotestfmt

* replace which in shell script

* handle error in test db removal

* fix expected path baseed on platform

* add leading seprator

* proper temporary storage dir and db cleanup

* fix failed to create destination dir file does not exist in windows

* move temp to /tmp

* update temp folder

* fix config tests in windows

* apply patch for db

* revert temp dir creation.

* unify account db tests pach

* remove TmpDir for sqlite tests

* try to force CGO disable with enviroment variable

* Remove unneeded log

Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>

* remove unneeded comment

Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>

* fix file path for download images

* change way to create temp directory

* use diffrent file name for each test

* fix typo

* fix absolute path in successful download image

* correct filename with png

* change test to download image from internet instead of local machine

* remvoe unneeded import

* remove os.RemoveAll(.env)

* unify variable names in unit test

* return CGO_ENABLED=0

* test other way to set enviroment variable

* try to set enviroment variable sepratly in macos and windows

* set enviroment variable before run commands in windows

* fix windows test name

* combine two workflow for windows and macos again

* fix typo

* remove env

* change env path

* cleanup unneeded env

* general CGO_ENABLED environ

* use absolute path to run fileserver instead of relative

* serve file test from internet shiori repository

* check file existance after download and unify varibale name from temp to tmpDir

* remove unneeded log

---------

Co-authored-by: Felipe M <me@fmartingr.com>
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
2024-02-05 10:21:23 +01:00
Felipe M. 795b39c986
deleteaccount (wip) 2024-02-04 12:45:46 +01:00
Felipe M. 463f16f361
list account and create account 2024-01-27 09:34:24 +01:00
Felipe Martin 7c13626a5b
fix: strict usage of shiori prefix for environment variables in configuration (#807)
* fix: disable direct os lookuper

* config.setdefaults call config.http.setdefaults

* tests

* log level default in local run server

* store log level in configuration
2023-12-30 00:46:29 +01:00
Felipe Martin cf7301c78f
Fixed lint errors after refactor (#806)
* removed git diff from swagger check script

* updated swagger docs

* removed ununsed calls
2023-12-28 18:37:19 +01:00
Felipe Martin cc7c75116d
refactor: migrate bookmark static pages to new http server (#775)
* migrate bookmark content route to new http server

* new archive page

* remove unused go generate comment

* database mock

* utils cleanup

* unused var

* domains refactor and tests

* fixed secret key type

* redirect to login on ui errors

* fixed archive folder with storage domain

* webroot documentation

* some bookmark route tests

* fixed error in bookmark domain for non existant bookmarks

* centralice errors

* add coverage data to unittests

* added tests, refactor storage to use afero

* removed mock to avoid increasing complexity

* using deps to copy files around

* remove config usage (to deps)

* remove handler-ui file
2023-12-28 18:18:32 +01:00
istiak101 f01f2dbc0d
fix: use noreferer to prevent exposing shiori instance url to archived websites (#802) 2023-12-27 11:59:16 +01:00
Monirzadeh d371ee6037
fix: typo in URL under documentation (#778) 2023-11-17 10:49:47 +01:00
cbe 7765e5bf42
chore: frontend formatting (#764)
* Install `prettier`

Ignore everything in the first step as I want to see the size of changes
that are going to happen first

* Configure prettier

- use tabs as the whole project prefers tabs
- ignore a bunch of files that shouldn't be formatted

* Check & format with prettier when compiling less

* Update docs to use bun

Since bun handles the dependencies used for the CSS compilation this
should be the preferred method from now on.

* Check actual result of prettier

* Use LF line endings

All files where formatted in LF and since it's most common in git repos
we should probably keep it this way

* Limit prettier to `internal/view/`

See pull request review
https://github.com/go-shiori/shiori/pull/764#pullrequestreview-1702935417

* Format code with prettier
2023-11-05 11:02:31 +01:00
Felipe M. 1d58455b53
chore: comment unused functions 2023-10-29 15:42:57 +01:00
cbe f16dd42e10
Make suggestion clickable in bookmark creation (#765)
This was especially noticeable when using the web app on mobile devices
as the suggestion looks like it's clickable. It should be also a little
bit more convenient UX-wise when it's allowed to be clicked in non-
mobile context as well.

Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
2023-10-29 15:26:39 +01:00