* 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>
* fix: disable direct os lookuper
* config.setdefaults call config.http.setdefaults
* tests
* log level default in local run server
* store log level in configuration
* 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
* Adding docs on how to install with Kubernetes manifests.
* docs: community section
---------
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
Co-authored-by: Felipe M <me@fmartingr.com>
* 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
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>
* add new api
* UI use new API
* remove legacy route
* fix request to new api destination and read that response
* feat: allow authentication using cookies
* fix: return proper error on validatesession
* typo: secret key envionment variable in makefile
* serve ebook file with new api
* cache update use new api path
* add skipexist and batch download use same route as cache
* fix bug - update hasebook status
* remove unneeded part of code
* add swagger documentation
* fix swagger documentation
* fix swagger response
* better statuscode
* fix swagger documentation
* covert to snake_case
* recover coverage.txt that remove
---------
Co-authored-by: Felipe M <me@fmartingr.com>
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
* add shiori save to android device share menu
* better section for community contributions
* add new line
* fix typo
* fix typo
* fix typo
---------
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
* fix: Actions in overlays on mobile hard to press
Buttons on mobile devices could've been cut off, depending on the browsers
chrome size which rendered them either completely off-screen or at least hard
to reach. Using `dvh` (dynamic viewport height) should fix this issue for
most newer browsers.
* fix: provide fallback values for newer dynamic viewport units
Since `dvh` and `dvw` are rather new and required an up-to-date browser
providing percentage values is a bit safer
---------
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
* create needed field in sqlite database
* update account model
* update Account struct for save Account options
* update sqlite database return account settings
* save configure in sqlite as text and return that
* read configure from user account and defualt configure for shiori
* add api/ui for update settings in database user can save settings in database (in sqlite database)
* check configures be in json format before save in database
* support MariaDB
* fix wrong comment
* support PostgreSQL
* revert unneeded change in new logic
* change configures to config
* change SaveAccount to SaveAccountSettings
* add migrate database scripts
* change default in migration scrtipts
* update model
* read config field as json from database
* fix parse value config value & update config update
* update default value for new user
* update settings variable name to reflect database value in UI
* fix typo
* not panic if user not exist and update worng comment
* visitor user can update there settings now
* remove unneeded loading dialog
* fix typo
* update function for pg and mysql
* remove IsJson
* move scan method to model
* simplify jsonify
* simplify assignees value to account.Config
* missing part of function
* fix some typo and unneeded field in struct
* add down migrate script for all database
* change createEbook to CreateEbook
* use json instead of text in mysql and postgres
* implement
* remove unneeded part
* remove unneeded jsonify in code
* return SelectContext and GetContext
* remove defualt config in reques for new user it will be set in backend
* New API
* remove legacy API
* remove validateSessionWithoutOwnerStatus
* remove Jsonify function don't need that anymore
* add unit test for database
* update migrate script name
* change put to patch
* return PUT
* fix Patch problem and now use PATCH instead of PUT
* remove unneeded retuen
* more cleaner code for request new settings
* fix bug to handle string in Scan method thanks to fmartingr
* fix Authorization & use GetAccount & remove username from request
* shiori-settings remove and it read from shiori-account
* add swagger documentation
* API unit test
* fix typo
* remove unneeded coment
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
* better Documentation
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
* shiori-toke remove on logout
* fix typo
* add unit test check update config in database
* update swag documentation
* fix swag formaing error
---------
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
* resize dialogbox with drag corner of box
* update style.css
* resizable just for more than full HD display
* fix size for initial size for small and big size
* full screen dialog box on mobile device - wider dialogbox on device
* remvoe custom-dialog.css that combine with style.css
* disable resize for moile device
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
* use new generated style.css
* not limit minimum size to 400px
* set default value in .custom-dialog
---------
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
* go 1.21
* update dependencies
* Updated direct dependencies
* -count=1 to test flags
* group dependabot updates into one PR
* get swag version from go.mod
* show changes in swagger check
* go mod tidy
* updated swag generated files
* use go version from go.mod
* remove stray \
* proper grep
* generate ebook get dstPath
* Archive and ebook can recover if download faild
* recover thumb if download faild
* thumb image create just if image processing is sucssesful
* create epub in tmp if it sucssesful copy to destination
* archive file create in tmp if it successful move to destination
* move to destination as function
* update ebook download api and remove .epub from file name
* report faild item to user
* not show dialog if error not happen
* update thumbnail based on last status of bookmark fix#524
* better warning massage
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
* tmpFile without .epub
* MoveToDestination change to MoveFileToDestination
* return .epub
* log if downloadBookImage return error
* fix bug remove imgPath just if download last image be unsuccessful
* update old unit test
* add processing.go unit test
* small massage for report failded item to the user
* add some more unit test and samplefile
* use sample image in unit test
* use local sample file and unit test not need internet connection anymore
* update error to user and log that too
* add more comment
* update comment
* change variable name parentDir to dstDir
* more simpler error handling
* remove unneeded defer
* remvoe unneeded epubWriter.Close()
* more readable unit test in processing
* more readable unit test for ebooks
* delete all defer os.RemoveAll from unit tests
* Better comment
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
* Better Error output
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
* fix err.String() method
---------
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
* refactor: swagger docs into a folder
* added scripts for the swaggger tasks
* check version and fmt
* CI
* formatted swag comments
* using custom delims
* revert custom delims
* swag 1.16.1
* update swagger docs
* avoid make swagger output
* swagger check
* test
* swag-fmt
* swagger run
* gofmt
* avoid swag-fmt check for now due to inconsistencies with gofmt
* re-enabled by using go fmt afterwards
* use newer swag in CI
* add gopath to path
* using go binary instead of unset env
* alternative
* correct swag version
* formatted
* formatted
* correct go fmt command
* make swagger
* swagger-check -> swag-check
* run swag-check on lint