How to use with self-hosted GitLab?
Is it possible to use this extension/add-on with self-hosted GitLab?
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
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?
Scratch that. I see where you mean. I need to read up on what this setting is and what it means. Thank you!
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?
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!
@imthenachoman can you post the steps you followed to make it work with your gitlab server? Thanks!
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:
- Cloned the repo and uncommented the
<input id="gitlab-url" type="text" value="https://gitlab.com"/>line inoptions.html. - Added my GitLab's URL to
permissionsin themanifest.jsonfile - Loaded an unpacked extension in Chrome using the developer mode
@imthenachoman thanks!!