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

OrientDB Studio does not work in strongbox-distribution #1251

Closed
4 tasks
steve-todorov opened this issue Apr 26, 2019 · 8 comments · Fixed by strongbox/strongbox-db#14
Closed
4 tasks

OrientDB Studio does not work in strongbox-distribution #1251

steve-todorov opened this issue Apr 26, 2019 · 8 comments · Fixed by strongbox/strongbox-db#14

Comments

@steve-todorov
Copy link
Member

steve-todorov commented Apr 26, 2019

Task Description

OrientDB Studio is not reachable at http://localhost:2480/studio/index.html when Strongbox is started from the strongbox-distribution.tar.gz. However, if you are starting it via cd strongbox-web-core && mvn spring-boot:run it's working as expected. It looks like OrientDB Studio is unable to locate the resources it needs.

We have added a smoke test for this.

Acceptance Test

  • Building the code with mvn clean install -Dintegration.tests still works.
  • Running mvn spring-boot:run in the strongbox-web-core still starts up the application correctly.
  • Building the code and running the strongbox-distribution from a zip or tar.gz still works and OrientDB Studio starts properly and is accessible.
  • The tests in the strongbox-web-integration-tests still run properly.

Task Relationships

This task is a follow-up of: #1087 , strongbox/strongbox-docs#22.

Help

Please join our chat and ping @steve-todorov or @carlspring when you create a PR so one of us can approve the testing stages in our CI.

@fuss86
Copy link
Contributor

fuss86 commented Apr 30, 2019

@steve-todorov , how did you try to run the distribution ? Using wrapper executable ?

  1. If we try to run the distribution as java -jar strongbox-distribution-1.0-SNAPSHOT/strongbox-1.0-SNAPSHOT/lib/strongbox-web-core-1.0-SNAPSHOT-spring-boot.jar then setenv.conf does not have effect and all values are taken from application.properties from strongbox-commons module.

  2. running windows executable wrapper-windows-x86-64.exe does not work

Screenshot_29

  1. running strongbox.bat works but the result is the same as in 1.

@cbrianhill
Copy link
Contributor

I've finally found the issue. For me, at least, the root DB path when I start strongbox from the distribution contains a relative path that uses .. to go back up the directory tree. You can see the line in OrientDB source code I'm referring to here:

https://github.com/orientechnologies/orientdb/blob/develop/server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/command/get/OServerCommandGetStaticContent.java#L249

@cbrianhill
Copy link
Contributor

cbrianhill commented May 1, 2019

After conversation with @carlspring, we will not invest in a major refactor of the wrapper, and we do not want to include strongbox-vault inside the application install directory because we want that directory to be independent to better support upgrades.

We discussed hard-coding the wrapper to use /opt/strongbox-vault as the default vault path upon installation, but this will break Windows installs. Our solution will be to update our docs for using OrientDB studio so that they instruct users to set the vault path as an absolute path as part of the enablement.

@carlspring
Copy link
Member

We should avoid hardcoding things at all cost. We should either consider submitting a patch to OrientDB, or think of a better way to do it.

@cbrianhill
Copy link
Contributor

This is now working from strongbox-distribution, with only the caveat that, when starting Strongbox with OrientDB Studio enabled, the path to strongbox-vault needs to be an absolute path without .. as a path segment.

Strongbox documentation at https://strongbox.github.io/developer-guide/getting-started-with-persistence.html has been updated to provide this instruction for our users.

The following issue has been raised on OrientDB, asking to loosen the upward directory traversal check: orientechnologies/orientdb#8859

@carlspring
Copy link
Member

Thanks for following up on this @cbrianhill ! :)

@sbespalov
Copy link
Member

@steve-todorov can you please verify the PR above?

@steve-todorov
Copy link
Member Author

@sbespalov It looks like your PR fixes it. Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants