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

GitHub Enterprise support? #426

Closed
betacar opened this Issue Oct 7, 2014 · 5 comments

Comments

Projects
None yet
5 participants
@betacar

betacar commented Oct 7, 2014

We want to know if it's possible to run hound in an internal VM against our internal GHE instance.

@nickcampbell18

This comment has been minimized.

Show comment
Hide comment
@nickcampbell18

nickcampbell18 Oct 14, 2014

Yes, it is. We are using it internally at my company. You'll need to configure Octokit and OmniAuth to point at your internal github (https://gist.github.com/nickcampbell18/d31a7d1a6300bb488a61).

Depending on which version of GHE you're using, you might have some other issues, because Hound uses some experimental Github APIs which might not be available in your private instance.

nickcampbell18 commented Oct 14, 2014

Yes, it is. We are using it internally at my company. You'll need to configure Octokit and OmniAuth to point at your internal github (https://gist.github.com/nickcampbell18/d31a7d1a6300bb488a61).

Depending on which version of GHE you're using, you might have some other issues, because Hound uses some experimental Github APIs which might not be available in your private instance.

@salbertson

This comment has been minimized.

Show comment
Hide comment
@salbertson

salbertson Oct 15, 2014

Member

@nickcampbell18 yea, I think the only newer API that Hound uses is the organization membership stuff.

Member

salbertson commented Oct 15, 2014

@nickcampbell18 yea, I think the only newer API that Hound uses is the organization membership stuff.

@gylaz

This comment has been minimized.

Show comment
Hide comment
@gylaz

gylaz Jan 9, 2015

Member

We may support this in the future, but we have no actual plans.

Member

gylaz commented Jan 9, 2015

We may support this in the future, but we have no actual plans.

@gylaz gylaz closed this Jan 9, 2015

@opsidao

This comment has been minimized.

Show comment
Hide comment
@opsidao

opsidao Apr 11, 2018

For anyone stumbling upon this (and running their own instance of hound), I actually have it working with minimal changes to the code, here's the diff:

diff --git a/config/initializers/octokit.rb b/config/initializers/octokit.rb
new file mode 100644
index 0000000..4ab4f4d
--- /dev/null
+++ b/config/initializers/octokit.rb
@@ -0,0 +1,3 @@
+Octokit.configure do |c|
+  c.api_endpoint = "https://#{ENV["GHE_SERVER_NAME"]}/api/v3/"
+end
diff --git a/config/initializers/omni_auth.rb b/config/initializers/omni_auth.rb
index b74bb57..dc6a7f3 100644
--- a/config/initializers/omni_auth.rb
+++ b/config/initializers/omni_auth.rb
@@ -12,5 +12,10 @@ Rails.application.config.middleware.use OmniAuth::Builder do
     ENV['GITHUB_CLIENT_SECRET'],
     setup: setup,
     provider_ignores_state: true,
+    client_options: {
+      site: "https://#{ENV["GHE_SERVER_NAME"]}/api/v3",
+      authorize_url: "https://#{ENV["GHE_SERVER_NAME"]}/login/oauth/authorize",
+      token_url: "https://#{ENV["GHE_SERVER_NAME"]}/login/oauth/access_token",
+    }
   )
 end

I did this a long time ago so I'm not sure if there's something else that must be done, but I don't remember anything.

PS: Please, let me know if it's not ok to write something like this here and I will just remove my comment

opsidao commented Apr 11, 2018

For anyone stumbling upon this (and running their own instance of hound), I actually have it working with minimal changes to the code, here's the diff:

diff --git a/config/initializers/octokit.rb b/config/initializers/octokit.rb
new file mode 100644
index 0000000..4ab4f4d
--- /dev/null
+++ b/config/initializers/octokit.rb
@@ -0,0 +1,3 @@
+Octokit.configure do |c|
+  c.api_endpoint = "https://#{ENV["GHE_SERVER_NAME"]}/api/v3/"
+end
diff --git a/config/initializers/omni_auth.rb b/config/initializers/omni_auth.rb
index b74bb57..dc6a7f3 100644
--- a/config/initializers/omni_auth.rb
+++ b/config/initializers/omni_auth.rb
@@ -12,5 +12,10 @@ Rails.application.config.middleware.use OmniAuth::Builder do
     ENV['GITHUB_CLIENT_SECRET'],
     setup: setup,
     provider_ignores_state: true,
+    client_options: {
+      site: "https://#{ENV["GHE_SERVER_NAME"]}/api/v3",
+      authorize_url: "https://#{ENV["GHE_SERVER_NAME"]}/login/oauth/authorize",
+      token_url: "https://#{ENV["GHE_SERVER_NAME"]}/login/oauth/access_token",
+    }
   )
 end

I did this a long time ago so I'm not sure if there's something else that must be done, but I don't remember anything.

PS: Please, let me know if it's not ok to write something like this here and I will just remove my comment

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