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

Install site plugin with custom url doesn't filter directory #3582

Closed
gquintana opened this Issue Aug 27, 2013 · 8 comments

Comments

Projects
None yet
2 participants
@gquintana
Copy link

gquintana commented Aug 27, 2013

  1. Download https://github.com/mobz/elasticsearch-head/zipball/master
  2. Copy downloaded file to target server /tmp/mobz-elasticsearch-head-0c2ac0b.zip
  3. Install plugin with command:
 bin/plugin --url file:/tmp/mobz-elasticsearch-head-0c2ac0b.zip --install head
  1. The plugins is installed in plugins/head/_site/mobz-elasticsearch-head-0c2ac0b/... instead of plugins/head/_site/...

The folder could be stripped because it's same as file name.

@javanna

This comment has been minimized.

Copy link
Member

javanna commented Aug 27, 2013

Right, the problem here is that we remove the top-level folder from the downloaded archive when we know we downloaded it from github, and we rely on a certain structure, which by the way sometimes changes (see #3551).

If you manually provide a zip file we don't know where it came from and we don't remove the top-level folder, but only extract the zip file under the _site folder.

Manually removing the top-level folder from the zip, or from the extracted directory would do the trick.

@ghost ghost assigned javanna Aug 27, 2013

@gquintana

This comment has been minimized.

Copy link
Author

gquintana commented Aug 27, 2013

Then another solution could be to add a download command to automate step 1:

bin/plugin --download mobz/elasticsearch-head

This could be done on any workstation and produce the appropriate zip file.

@javanna

This comment has been minimized.

Copy link
Member

javanna commented Aug 27, 2013

What would be the added value of automating the download without the install part, when we have the install command that does them both?

For instance if you execute:

bin/plugin -install mobz/elasticsearch-head

the elasticsearch-head will be downloaded from github, extracted properly and the plugin would be working without any manual work needed.

Maybe I'm missing the reason why you are manually downloading the archive from github and installing it through the plugin script. Can you elaborate on that?

@gquintana

This comment has been minimized.

Copy link
Author

gquintana commented Aug 28, 2013

Because the ElasticSearch server can not access to internet (secured network zone).

@javanna

This comment has been minimized.

Copy link
Member

javanna commented Aug 28, 2013

Ok I see what you mean, you would like to execute the -download from any machine that has access to the internet and the -install part on the elasticsearch server given the previously downloaded zip.

Thanks for clarifying that!

@javanna

This comment has been minimized.

Copy link
Member

javanna commented Aug 28, 2013

Having thought about this, I'd rather prefer to make the archive extraction smarter, so that it can detect that there is a top-level folder to remove, regardless of where the plugin came from. Looks like we can always do that whenever we have an archive that contains a single top-level folder. That would solve your issue without requiring to add the -download option.

javanna added a commit to javanna/elasticsearch that referenced this issue Sep 3, 2013

Improved logic that removes top-level folder from archives when needed
Whether we remove the top-level folder from the archive depends now on the zip itself and not on where it was downloaded from. That makes it work installing local files too.

Closes elastic#3582

@javanna javanna closed this in 45c8da3 Sep 3, 2013

javanna added a commit that referenced this issue Sep 3, 2013

Improved logic that removes top-level folder from archives when needed
Whether we remove the top-level folder from the archive depends now on the zip itself and not on where it was downloaded from. That makes it work installing local files too.

Closes #3582
@gquintana

This comment has been minimized.

Copy link
Author

gquintana commented Sep 3, 2013

Thanks for fixing that

@javanna

This comment has been minimized.

Copy link
Member

javanna commented Sep 3, 2013

Thank you for reporting this!

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

Improved logic that removes top-level folder from archives when needed
Whether we remove the top-level folder from the archive depends now on the zip itself and not on where it was downloaded from. That makes it work installing local files too.

Closes elastic#3582
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.