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

How to use with self-hosted GitLab? #117

Open
imthenachoman opened this issue Dec 8, 2019 · 8 comments
Open

How to use with self-hosted GitLab? #117

imthenachoman opened this issue Dec 8, 2019 · 8 comments

Comments

@imthenachoman
Copy link

Is it possible to use this extension/add-on with self-hosted GitLab?

@leonhartX
Copy link
Owner

Currently not supported since it will ask too ambitious permission, if you really need that, you can clone this repo, add permission to the manifest file and build the extension by yourself

@imthenachoman
Copy link
Author

I have never written an extension but would like to look into it.

When you say permission, what do you mean by that? What file do I need to look at? I saw in the code where you specify the GitLab URL so think adding a custom URL option is straight forward. Just not sure what the permission is for?

@imthenachoman
Copy link
Author

Scratch that. I see where you mean. I need to read up on what this setting is and what it means. Thank you!

@imthenachoman
Copy link
Author

So I cloned the repo and uncommented the <input id="gitlab-url" type="text" value="https://gitlab.com"/> line in options.html. I was able to login. But when I open a new script it says "Unknow Error" in the top, in a red box.

The spelling mistake helped because I only see two files with "Unknow": gas-api.js and gas-hub.js.

I modified both of them to narrow down and determined it is erroring on line 35 of gas-hub.js. I changed that line to include err.message:

Cannot read property 'forEach' of undefined

I am going to try to narrow down which forEach it is, unless you happen to have an idea where it might be failing?

@imthenachoman
Copy link
Author

Bleh. I figured it out.

jquery.min.js:6 Cross-Origin Read Blocking (CORB) blocked cross-origin response https://[internal gitlab URL]/api/v4/groups?per_page=25&private_token=[redacted] with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details.

Script editor is on https://script.google.com/ (internet) and it's trying to access our internal (intranet) gitlab environment.

Bollocks!

@Jlcasado
Copy link

Jlcasado commented Jun 4, 2020

@imthenachoman can you post the steps you followed to make it work with your gitlab server? Thanks!

@imthenachoman
Copy link
Author

I never got it working but that is because of my company's firewall rules.

I don't remember exactly what I did now but essentially:

  1. Cloned the repo and uncommented the <input id="gitlab-url" type="text" value="https://gitlab.com"/> line in options.html.
  2. Added my GitLab's URL to permissions in the manifest.json file
  3. Loaded an unpacked extension in Chrome using the developer mode

@Jlcasado
Copy link

Jlcasado commented Jun 8, 2020

@imthenachoman thanks!!

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

No branches or pull requests

3 participants