Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: surreal start --allow-funcs <path> will use <path> as the value for the argument #3965

Open
2 tasks done
liusong1111 opened this issue Apr 30, 2024 · 1 comment
Open
2 tasks done
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@liusong1111
Copy link

Describe the bug

If I run:

surreal start --allow-funcs file:/db

I want start surreal with file storage allowing all funcs, but surreal starts with memory storage.

Steps to reproduce

Finally I found the root cause.

surreal start -h prints:

 --allow-funcs [<ALLOW_FUNCS>...]  Allow execution of all functions. Optionally, you can provide a comma-separated list of function names to allow [env:
                                        SURREAL_CAPS_ALLOW_FUNC=] [default: ]

It says --allow-funcs accepts zero or one argument. zero argument means allow-all-funcs.

The command line:

surreal start --allow-funcs file:/db

It seems that surreal takes file:/db as argument of --allow-funcs, not the [PATH] part.

The annoying thing is: surreal didn't report any error or warning.

Expected behaviour

I suggest use --allow-all-funcs or --allow-funcs <ALLOW_FUNCS>.

The same as --allow-net, --deny-funcs, --deny-net.

Another approch is change the cli pattern to surreal start [PATH] [OPTIONS], disallow usage of surreal start [OPTIONS] [PATH], and change Documentation everywhere(like https://hub.docker.com/r/surrealdb/surrealdb), and report clear error message if possible.

SurrealDB version

v1.4.2

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@liusong1111 liusong1111 added bug Something isn't working triage This issue is new labels Apr 30, 2024
@liusong1111
Copy link
Author

btw, run in docker with user 65532 should be treated as a bug, otherwise it will frustrate new users:

#3468
surrealdb/docs.surrealdb.com#315

@sgirones sgirones added good first issue Good for newcomers and removed triage This issue is new labels May 1, 2024
@sgirones sgirones changed the title Bug: surreal start --allow-funcs [<ALLOW_FUNCS>...] is ugly designed Bug: surreal start --allow-funcs <path> will use <path> as the value for the argument May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants