Comments (11)
Same shit with ngrok installed from snap on ubuntu 18 laptop:
$ ngrok authtoken <token>
ERROR: Failed to save authtoken to configuration file '/home/alex/.ngrok2/ngrok.yml': open /home/alex/.ngrok2/ngrok.yml: permission denied
And ok with unzipped one.
from docker-ngrok.
Would it be hard to programatically support changing env variable NGROK_AUTH ?
from docker-ngrok.
Ah thanks I cannot test this but it seems like an easy fix.
Normally the access right should be fine thanks to this line:
chown ngrok:ngrok /home/ngrok
Are you mounting volumes? Running as another user?
from docker-ngrok.
Thanks for the fast answer.
Here is my Dockerfile:
FROM wernight/ngrok:latest
ENV NGROK_AUTH 'auth_key'
CMD ["ngrok", "start", "--none"]
from docker-ngrok.
If you specify CMD
you cannot use environment variables. Updating README. Either using only environment variables, or use only the CMD
and put the token in the command-line.
from docker-ngrok.
Interesting, I would like the service to be started when the container launches, and don't want the users to manually run the command ngrok start --none.
Could you think of a workaround for it to work out-of-the box?
I tried putting in the CMD the auth key but didn't succeed for some reason...
Thanks a lot for your help!
from docker-ngrok.
NGROK_AUTH
does only generate a command-line like:
`ngrok http -authtoken=$TOKEN -log stdout`
from docker-ngrok.
Now I understand better thanks.
Still I would be very glad to be able to set the authtoken programmatically with an ENV variable NGROK_AUTH, because multiple devs are gonna use the same image, and the only change between each would be the auth token...
from docker-ngrok.
Do you think the other docker images of ngrok (including the ones you forked from) could work out for my use case ?
Thanks
from docker-ngrok.
I've seen none doing a ngrok start --none
. You can just create a Dockerfile and extend this one, or use docker-compose.yml
to write your environment.
from docker-ngrok.
Ah ha! I figure out the problem is.
I found the default config file's owner is root
, not ngrok
user.
/ $ ls -al /home/ngrok/.ngrok2/ngrok.yml
-rw-r--r-- 1 root root 23 Jul 4 07:38 /home/ngrok/.ngrok2/ngrok.yml
that will cause error for ngrok authtoken
command
My workaround fix
First, I make a Dockerfile for fix this issue
$ vi Dockerfile
content as follows
FROM wernight/ngrok:latest
USER root
RUN chown -R ngrok:ngrok /home/ngrok/
USER ngrok
(or change it to RUN chown ngrok:ngrok /home/ngrok/.ngrok2/ngrok.yml
)
Second, build it as new image
$ docker build . -t j/ngrok:latest
then use it
$ docker run --rm -it j/ngrok sh -c "ngrok authtoken MY_AUTH_TOKEN ; ngrok tcp 12345"
replace MY_AUTH_TOKEN
to yours
Maybe I solution is not the best answer, but works.
from docker-ngrok.
Related Issues (20)
- Periodically rebuild image HOT 3
- api/tunnels returns empty response when using auth HOT 1
- Does not support spaces in password
- I need help to expose NextCloudPi
- Add NGROK_LOOK_DOMAIN commit to dockerhub HOT 1
- Updating NGROK docker and other questions HOT 1
- Receive ngrok url HOT 5
- Request: image version tag
- authtoken is not respecting in container HOT 1
- Nginx is showing always after generating ngrok url
- Cannot link to webcontainer
- Update? HOT 1
- Inspect Option Support? HOT 1
- multiple ports HOT 1
- transfer maintainership to ngrok? HOT 3
- Add ARM64 (Apple Silicon) support HOT 2
- NGROK_AUTH not working HOT 4
- Add ARM64 (Apple Silicon) support HOT 1
- Ngrok
- ERROR: unknown shorthand flag: 'o' in -ostname=my-app.ngrok.io HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-ngrok.