Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this repository compatible with Windows? #49

Open
curiosport opened this issue Sep 10, 2022 · 6 comments
Open

Is this repository compatible with Windows? #49

curiosport opened this issue Sep 10, 2022 · 6 comments

Comments

@curiosport
Copy link

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
Copy link
Owner

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

@curiosport
Copy link
Author

curiosport commented Sep 12, 2022

@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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

@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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants