ncarlier / readflow

readflow is a news-reading (or read-it-later) solution focused on versatility and simplicity.
https://about.readflow.app
GNU Affero General Public License v3.0
413 stars 33 forks source link

Is this repository compatible with Windows? #49

Open curiosport opened 2 years ago

curiosport commented 2 years ago

Well I managed to make some progress in the compilation but the ui with npm I can't build it in Windows, should I do it with linux?

ncarlier commented 2 years ago

The user interface is a classic Node JS project and should be compatible with Windows. What is your error message?

curiosport commented 2 years ago

@ncarlier I had an error that react-scripts is missing with npm, so I fixed it this way:

npm i react-scripts --legacy-peer-deps
npm start

I also had a problem with the file:

"readflow/ui/package.json"

In the line:

"lint": "eslint './src/**/*.{ts,tsx}'"

Basically the error was telling me that no file was found that met that criteria, I solved it this way:

"lint": "eslint \"./src/**/*.{ts,tsx}\""

Anyway, I managed to run the server but the problem is that I can't use the forum without going through the authentication system, are there any test users?

On the other hand, what should I do if what I want is to use another authentication system completely different, is there documentation for that or can you give me a small example?

curiosport commented 2 years ago

Oh, I forgot to mention that I also had a problem with the cache package, specifically this file: "readflow/pkg/cache/cache/cache.go"

In the instruction: cache, err = boltcache.New(size, u.Path)

I got an error like os.Open cannot find file [u.Path]

Apparently u.Path has the path format as in linux, so I made a workaround like this:

func New(conn string, size int) (Cache, error) {
    [...]
    cacheFileName := filepath.ToSlash(
        os.TempDir() + string(os.PathSeparator) + "readflow.cache",
    )
    cache, err = boltcache.New(size, cacheFileName)
    [...]
}

As you can see it is not an efficient solution but it is useful while testing.

ncarlier commented 2 years ago

Thank you very much for reporting these problems. I fixed cache loading by cleaning the path according to the OS and I update the lint cmd. Regarding node dependencies I will update all dependencies and deal with the breaking changes.

Regarding your authentication problem, you have to build the user interface with some configuration:

# if using OIDC provider such as Okta, Google, Auth0, Microsoft, ...
export REACT_APP_AUTHORITY=https://your_sub_domain.okta.com
# or if using a Reverse Proxy such as Traefik, NGINX, Apache, ...
# username will be extracted form one of those HTTP headers: `X-WEBAUTH-USER`, `X-Auth-Username`, `Remote-User`, `Remote-Name`
export REACT_APP_AUTHORITY=mock
npm run build

More info here: https://github.com/ncarlier/readflow/blob/master/ui/README.md

curiosport commented 2 years ago

@ncarlier I meant to use my own authentication system, so I will not use any of these:

Okta, Google, Auth0, Microsoft, ...
Traefik, NGINX, Apache, ...

I imagine mock is the way to go, could you tell me the .go files that do the validation when using mock? I'll see if I can adapt the code.

ncarlier commented 2 years ago

I don't know what your authentication system is but for your information, there are very good self-hosted OpenID Connect solutions (Keycloak, Hydra, ...)

The authentication using the proxy is handled by this middleware: https://github.com/ncarlier/readflow/blob/master/pkg/middleware/proxy-auth.go