gstaff / flask-ngrok

A simple way to demo Flask apps from your machine.
Other
138 stars 58 forks source link

Virtualenv support #2

Closed VikashKothary closed 3 years ago

VikashKothary commented 5 years ago

I use flask inside a virtualenv (on a Linux machine) which causes the library to fail as it won't have the permission to write to /tmp/ngrok/ngrok.

Potentially could you save it in the virtualenv?

nejdetckenobi commented 5 years ago

Shouldn't /tmp's permissions be 1777 by default? Everyone should be able to write in that directory. If not, your directory permissions are incorrect, possibly.

VikashKothary commented 5 years ago

I've tried it in a MacBook and it has the same issue. I think that maybe due to the fact I used in inside a virtualenv works? Since it works otherwise.

Potentially allowing us to override the ngrok location could be a nice feature. Or changing it for a virtualenv compatible location.

nejdetckenobi commented 5 years ago

Can you post the results of the commands below?

ls -altrh /tmp/ngrok ls -altrh /tmp/

I'll check the default file permissions of ngrok binary after unzipping it...

RileyMShea commented 4 years ago

it overwrites the permissions on each run. So even though I chmod 777 the file it resets itself to -r----x--t 1411 /tmp/ngrok/ngrok on every python app.py

It seems to be fixed in the 0.0.26 33a2e70 release, but PyPi is still on 0.0.25

kivicode commented 4 years ago

You can fix it manualy by changing [python path]/site-packages/flask_ngrok.py line 29 os.chmod(executable, 777) into os.chmod(executable, 755)

shardul-shah commented 3 years ago

Any solution to this? It's a problem, especially on WSL.

hnguyentt commented 3 years ago

@shardul-shah as @RileyMShea pointed out, version 0.0.26 has fixed the problem. You can install from source rather than from PyPi: pip install git+https://github.com/gstaff/flask-ngrok. It worked for me!

shardul-shah commented 3 years ago

@nguyenhoa93 Why doesn't pip install flask-ngrok install version 0.0.26?

hnguyentt commented 3 years ago

@nguyenhoa93 Why doesn't pip install flask-ngrok install version 0.0.26?

pip install flask-ngrok will install the latest version of the package published on PyPi. You can see the latest version is now 0.0.25 here: https://pypi.org/project/flask-ngrok/#history

VikashKothary commented 3 years ago

@gstaff Can you deploy the latest release to PyPI?

shardul-shah commented 3 years ago

@VikashKothary Vikash is absolutely correct in asking for a PyPi 0.0.26 release.

Please deploy this release to PyPi so pip installs it - it greatly increases convenience. @gstaff

AlwaysBeCalm commented 8 months ago

@shardul-shah as @RileyMShea pointed out, version 0.0.26 has fixed the problem. You can install from source rather than from PyPi: pip install git+https://github.com/gstaff/flask-ngrok. It worked for me!

Thanks, a lot :rose: This fixed it for me