Commit graph

10 commits

Author SHA1 Message Date
Monirzadeh 75395c6793
chore: check for avx2 processor feature when trying to run bun (#920)
* check avx2 when use bun

* change enviroment variable to just BUN

* better massage

Co-authored-by: Mario Rugiero <mrugiero@gmail.com>

* simpler method

* add missing reverse if

* patch with @fmartingr to check that in linux only

---------

Co-authored-by: Mario Rugiero <mrugiero@gmail.com>
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
2024-05-29 23:30:28 +02:00
Felipe Martin 647945c54e
ci: unify local and ci docker workflows (#907)
* deps: go to 1.22.3

* removed ci dockerfile

* add make buildx

* updated dockerfile

* ci uses make buildx command

* commented upx for the future

* disable openbsd/arm tests

* wip

* put dist file in dist path

* removed unused make command

* build-local to speed up local tests

* don't clean when buildx

* podman workaround

* manually define source files for tests
2024-05-14 08:01:52 +02: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 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
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
Monirzadeh c6aabc49f1
fix: styles-check and swag-check monitor just needed directory not project root (#747)
* styles-check just work on less and css directory

* just cheack css directory

* make swag-check just monitor generated files
2023-10-09 18:02:05 +02:00
Felipe Martin 4df7e1dd8e
feat: build css from less files locally (#735)
* build less using lessc and bun

* build

* make styles-check

* Added workflow to check updates

* avoid embed less files

* docs

* updated tests to reflect changes

* typo

* fixed archive page css

* call styles check on pull requests

* comments in style.less

* fix archive styles affecting other pages

* minify using clean-css

* Split archive.css and style.css

* Updated docs
2023-09-16 19:58:55 +02:00
Felipe Martin 9082f98f41
deps: upgrade to Go 1.21 (#698)
* 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
2023-09-16 08:20:55 +02:00
Felipe Martin 8b015a3850
Swagger improvements (#666)
* 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
2023-08-12 08:38:52 +02:00
Felipe Martin 6f19c12c95
Start working on new REST API. Refactor logic in domains. (#497)
* added 404 template

* added auth domain

* added embed file for frontend

* added base config and dependencies

* added basic new http server

* added separated server command

* updated go modules

* removed modd file

* Added shortcut to send internal server error response

* Added JWT support to Auth Domain

* Added JWT support to API

* docs: added comments to response struct

* naming

* inline returns

* updated dependencies

* production logger

* bookmarks endpoint

* reverted old views api path

* frontend for api v1

* proper 404 error (not working atm)

* use response

* removed 404 html

* server error handler

* login and basic auth

* adjusted session duration

* properly retrieve tags

* properly delete bookmark

* cleanup

* archiver domain

* debug routes

* bookmark routes

* expiration by parameter

* move to logrus

* logout

* frontend cache

* updated dependencies

* http: migrated to gin

* linted

* Added version command

* unit tests, docs

* response test utils and tests

* remove logout handler

* auth

* createtag

* improved http test utilities

* assert message equals

* Remove 1.19 from test matrix

* moved api to v1 folder

* docs: contribute docs

* updated makefile

* updated usage docs

* warn in server command

* updaed docs with shiori version command

* Updated documentation

* deps: update
2023-07-17 14:30:18 +01:00