expose icon indicating copy to clipboard operation
expose copied to clipboard

`--token=...` parameter for `expose share` command?

Open mrspence opened this issue 4 years ago • 9 comments

Hello there, fantastic resource!

Just setting it up as a small extra for local development, but wondering what I'm doing wrong?

Added the following command to my bash script:

docker run --init beyondcodegmbh/expose-server share http://website.local "$@"

It then tells me:

Authentication failed. Please check your authentication token and try again.

I have setup an account and sourced an auth token. How would you suggest I provide the token using docker run ...?

Was wondering about a --token=[token] parameter, but perhaps you know a better way to do this!

mrspence avatar Jan 08 '21 21:01 mrspence

Hi!

I've run on the same issue this morning, and you can solve it by providing a config file containing your token to the container.

If the config file is named expose-config.php, add -v $PWD/expose-config.php:/src/config/expose.php to the docker run command.

I hope it helps!

SelrahcD avatar Feb 20 '21 11:02 SelrahcD

As I'm not a Docker expert/user myself I'd appreciate any PRs that improve on the Docker configuration and documentation.

mpociot avatar Apr 13 '21 15:04 mpociot

Hi Marcel,

Would the --token parameter idea from @mrspence make sense for the project according to you?

It would serve more people than a solution oriented only to Docker users.

I'm not familiar with the project code at all and don't know how easy it could be to add but I could take a look if this is a solution you might consider.

SelrahcD avatar Apr 13 '21 16:04 SelrahcD

@SelrahcD's sweet fix with overriding via volumes should work well in the meantime, however this seems vulnerable to breaking the underlying code when updating (i.e. config options may be missing, folder structure may change e.t.c.)

A parameter or environmental variable would be better suited, but certainly requires an update on the docker image! 😅

(Btw cheers for your help @SelrahcD 👍👍)

mrspence avatar Apr 17 '21 21:04 mrspence

Isn't this the same as using the --auth= option?

mpociot avatar May 21 '21 15:05 mpociot

Is there any documentation on how to use the --auth= option?

MetalArend avatar Jun 30 '21 11:06 MetalArend

Hello, I think --token is needed because --auth is the basic auth for admin dashboard (if i understand the doc)

I'm currently stuck when i try to use expose on docker container as client and it's return me an authentication error: docker run --init beyondcodegmbh/expose-server share http://127.0.0.1:1880 Authentication failed. Please check your authentication token and try again. Register at https://expose.dev to get your free token. Connection to server closed.

If i read the config/expose.php file the username and password is only used to protect admin dashboard using basic http auth. https://github.com/beyondcode/expose/blob/master/config/expose.php#L331

So now when i try to run docker run expose share i need to "link" the container with my expose account using the token provided here: Capture d’écran 2022-05-03 175234

So actually using expose inside a docker container not work until I add my own token in my own Dockerfile following this file

RUN /src/expose token aaaa00000-1111-2222-3333-44444455555

Is somebody manage to use expose on docker containers one for client side and second for server side?

MkLHX avatar May 03 '22 15:05 MkLHX

I played around with expose's Docker setup and found a way to set the token without modifying the image or adding volumes.

Just override the default command with a Docker argument, executing two commands instead.

docker run --entrypoint bash beyondcodegmbh/expose-server:latest -c "./expose token xxx-xxx-xxx-xxx-xxx && ./expose share"

Jaid avatar Jun 11 '22 13:06 Jaid

Does this dockerized expose server work sharing local sites?

the --auth= flag seems to work but then the tunneling looks like not getting to my other dockerized apps, however if I run expose as a .phar it works as expected

BadChoice avatar Jul 29 '22 17:07 BadChoice

Same issue here @BadChoice anything ever develop from this? I'm trying to expose my Laravel app, I am using Sail as well, and I was using Sail's share feature but then was running issues to ports not being available for certain parts, so running the expose docker image now and trying to get it to expose my Laravel container.

smcgovern avatar Dec 22 '22 13:12 smcgovern

Closing this issue because it's old. Please feel free to open a new one if it's still relevant.

sschlein avatar Dec 21 '23 13:12 sschlein