arangodb / arangodb-docker

Docker container for ArangoDB
Apache License 2.0
106 stars 32 forks source link

entrypoint.sh should set foxx-cli default server #84

Open pluma opened 4 years ago

pluma commented 4 years ago

Users probably aren't aware that they have to make sure foxx-cli talks to the endpoint 127.0.0.1:8999 or whatever arangod happens to be set to listen to during the init phase if they want their init scripts to work correctly.

To simplify this, entrypoint.sh should run the following:

foxx server set default tcp://127.0.0.1:$ARANGO_INIT_PORT

before looping over the files in the init scripts directory and then

foxx server remove default

right after the loop.

This is a DX papercut but it seems like a low-hanging fruit as we're already shipping the foxx-cli.

This means users can run this:

foxx install /myapp /myapp.zip

instead of this:

foxx install /myapp /myapp.zip -H tcp://127.0.0.1:$ARANGO_INIT_PORT

(and don't have to dig into the code to figure out $ARANGO_INIT_PORT is even a thing)

/cc @joerg84 FYI

pluma commented 4 years ago

Looks like this was actually implemented before and then removed? https://github.com/arangodb/arangodb-docker/commit/50f31d72dac9440550f94e2878b76875ed0ec0ce

@dothebart I can't seem to find any explanation for this change. Can you clarify?

pluma commented 4 years ago

If this is a permissions thing, we should just create the file manually (~/.foxxrc):

[server.default]
url=tcp://127.0.0.1:8999
database=_system
username=root
password=

Please don't remove Foxx-related features without telling me.