codemation / easyauth

Create a centralized Authentication and Authorization token server. Easily secure FastAPI endpoints based on Users, Groups, Roles or Permissions with very little database usage.
https://easyauth.readthedocs.io/en/latest/
MIT License
553 stars 52 forks source link

Cannot start example server on Windows #87

Open LeoGitGuy opened 1 year ago

LeoGitGuy commented 1 year ago

When I try to start a basic server as described on the easyauth github page, I run into an error telling me this, i.e. "fcntl" cant be imported as it is only available on Linux.

Traceback (most recent call last): File "C:\Users\DELL\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "C:\Users\DELL\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\DELL\AppData\Local\Programs\Python\Python37\Scripts\gunicorn.exe\__main__.py", line 4, in <module> File "C:\Users\DELL\AppData\Local\Programs\Python\Python37\lib\site-packages\gunicorn\app\wsgiapp.py", line 9, in <module> from gunicorn.app.base import Application File "C:\Users\DELL\AppData\Local\Programs\Python\Python37\lib\site-packages\gunicorn\app\base.py", line 11, in <module> from gunicorn import util File "C:\Users\DELL\AppData\Local\Programs\Python\Python37\lib\site-packages\gunicorn\util.py", line 8, in <module> import fcntl

Any suggestion about how to fix this would help me a lot, I saw in the issues some people used this on windows before so I hope there might be a solution. Thanks!

daniel-kennedy commented 1 year ago

I, too, have this issue. The fcntl module is not present on Windows environment. My install moves beyond this point, however, but then quits with:

File "C:\fastapi\venv\lib\site-packages\easyrpc\proxy.py", line 523, in ws_client raise connection_error easyrpc.exceptions.ServerUnreachable: (ServerUnreachable(...), 'Proxy -> Server unreachable: server 127.0.0.1 - port: 8092')

I might have to move onto a different solution as I am under a time restraint.

codemation commented 1 year ago

Hi @daniel-kennedy easyauth is designed and tested to be deployed on linux, so within windows the results may be less predictable. I might suggest development within WSL or a container for better results.

daniel-kennedy commented 1 year ago

Hi @daniel-kennedy easyauth is designed and tested to be deployed on linux, so within windows the results may be less predictable. I might suggest development within WSL or a container for better results.

Thank you for the response. I willDockerize my API server. This is probably a better solution for my particular scenario. Many of us who develop in the public sector cannot avoid Windows servers no matter how much we would like to.

Thanks again, Dan