Skip to content
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Add -k flag and https to 2 examples #933

Merged
merged 7 commits into from
Jan 4, 2016
Merged

Conversation

mellybess
Copy link
Contributor

In a recent customer question (in Front, so no thread available 😦) @davideg @brainstarr and I found that the example commands were missing a -k flag, and needed to be via https. The steps we documented for the customer are here.

I'm not sure if this needs to be updated for each example on the page, but I can test that if needed.

I also removed a version number from a link to the Enterprise docs so that it redirects to the latest version.

/cc @github/api, @github/docs-platform, and @github/copy

@@ -69,7 +69,7 @@ For a list of the available settings, see [the `/setup/api/settings` endpoint](#
### Example

``` command-line
$ curl -L -X POST 'http://<em>hostname</em>:<em>admin_port</em>/setup/api/start' -F license=@<em>/path/to/github-enterprise.ghl</em> -F "password=<em>your-amazing-password</em>" -F settings=&lt;<em>/path/to/settings.json</em>
$ curl -L -X -k POST 'https://<em>hostname</em>:<em>admin_port</em>/setup/api/start' -F license=@<em>/path/to/github-enterprise.ghl</em> -F "password=<em>your-amazing-password</em>" -F settings=&lt;<em>/path/to/settings.json</em>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the flag order might matter here since POST is an argument to -X. Should this be -X POST -k ...?

@@ -69,7 +69,7 @@ For a list of the available settings, see [the `/setup/api/settings` endpoint](#
### Example

``` command-line
$ curl -L -X POST 'http://<em>hostname</em>:<em>admin_port</em>/setup/api/start' -F license=@<em>/path/to/github-enterprise.ghl</em> -F "password=<em>your-amazing-password</em>" -F settings=&lt;<em>/path/to/settings.json</em>
$ curl -L -X POST -k 'https://<em>hostname</em>:<em>admin_port</em>/setup/api/start' -F license=@<em>/path/to/github-enterprise.ghl</em> -F "password=<em>your-amazing-password</em>" -F settings=&lt;<em>/path/to/settings.json</em>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is allowing insecure connections something you'd want to promote via documentation? Passing in the -k flag will ignore any SSL warnings (such as mismatching certificates) and allow the connection to proceed anyway which has some potential security concerns. Personally, if I was sending my GitHub license or credentials across the wire I'd definitely like to ensure the host I am connecting to is who I intend it to be. However, on the flip side of that, I do realise a lot of places that setup on their internal network won't bother with valid certificates so ¯\_(ツ)_/¯.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jacobbednarz GitHub Enterprise provides a self-signed certificate. For many, I assume the lack of -k blocks these admins from using curl to work with the API.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enterprise customers should configure a proper certificate though and that is strongly recommended. I would be in favor of not adding -k and only add a comment for using it if absolutely necessary. Always adding as a blanket solution is not a good idea.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I think adding a comment explaining the -k option is the right approach.

@gjtorikian
Copy link
Contributor

I'm not sure if this needs to be updated for each example on the page, but I can test that if needed.

I just tested it; looks like curl to HTTP will not work. I used the maintenance settings check as it's one of the few GET requests on there.

I did not pass -k, but I don't really know the intricacies of the cert dance. It's interesting to note also that this was pointed out to need to be HTTPS but we didn't change it. 😓

If you could change the other examples to https that would be great! I am not sure if they need -k or not but verifying that would be cool. 👍

@@ -47,6 +47,8 @@ When using this endpoint, your Enterprise instance must have a password set. Thi
1. If you're working directly with the API before accessing the web interface, you must pass in the password parameter to set your password.
2. If you set up your instance via the web interface before accessing the API, your calls to this endpoint do not need the password parameter.

You may also need to use the `-k` flag, as GitHub Enterprise uses a self-signed certificate before you [enable your own SSL certificate](https://help.github.com/enterprise/admin/guides/installation/dns-hostname-subdomain-isolation-and-ssl/#ssl).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make it clear that the -k flag applies to using curl.

@mellybess
Copy link
Contributor Author

I've added a note about needing the -k flag and updated http to https in the examples.

@pengwynn @github/docs-platform @github/copy is this 👍 to merge?

s/sicne/since/
@@ -47,6 +47,8 @@ When using this endpoint, your Enterprise instance must have a password set. Thi
1. If you're working directly with the API before accessing the web interface, you must pass in the password parameter to set your password.
2. If you set up your instance via the web interface before accessing the API, your calls to this endpoint do not need the password parameter.

You may also need to add the `-k` flag when using `curl`, since GitHub Enterprise uses a self-signed certificate before you [add your own SSL certificate](https://help.github.com/enterprise/admin/guides/installation/dns-hostname-subdomain-isolation-and-ssl/#ssl).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mellybess I would add a small bit about what the -k flag does or at least add a link to http://curl.haxx.se/docs/manpage.html#-k (not sure if linking out to external pages in these docs is cool or not).

Also since this tip applies when using any self-signed certificate it could apply to all endpoints. I'm wondering if it would make sense to move it up towards the top of the document after the tip section.

pengwynn added a commit that referenced this pull request Jan 4, 2016
@pengwynn pengwynn merged commit 309e10b into master Jan 4, 2016
@pengwynn pengwynn deleted the management-console-update branch January 4, 2016 18:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy