1

I am trying to use Electron Updater with a GitLab Private Repository.

Main Electron File (partial):

autoUpdater.requestHeaders = { 'PRIVATE-TOKEN': process.env.VUE_APP_GITLABSECRET }
autoUpdater.autoDownload = true

autoUpdater.setFeedURL({
  provider: 'generic',
  url: 'https://gitlab.com/SmellydogCoding/mchd-electronic-field-guide/-/jobs/artifacts/master/raw/dist_electron?job=build'
})

autoUpdater.on('checking-for-update', function () {
  console.log('Checking for update...')
})

When I start the app I get this error message:

Error: Error: Cannot parse update info from latest.yml in the latest release artifacts (https://gitlab.com/SmellydogCoding/mchd-electronic-field-guide/-/jobs/artifacts/master/raw/dist_electron/latest.yml?job=build): YAMLException: end of the stream or a document separator is expected at line 3, column 17:
    <head prefix="og: http://ogp.me/ns#">

What is happening is that the server is responding with a string of HTML, which is the Gitlab login page.

If I curl

--header 'PRIVATE-TOKEN': 'mygitlabprivatetoken' https://gitlab.com/SmellydogCoding/mchd-electronic-field-guide/-/jobs/artifacts/master/raw/dist_electron/latest.yml?job=build

The server returns:

Header

HTTP/1.1 302 Found
Server: nginx
Date: Tue, 19 Mar 2019 17:57:21 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 98
Cache-Control: no-cache
Location: https://gitlab.com/users/sign_in
Set-Cookie: _gitlab_session=da00cbc69f2d50ea4192f4e3002f84a9; path=/; secure; HttpOnly
X-Request-Id: dGkxtbboHy7
X-Runtime: 0.049129
Strict-Transport-Security: max-age=31536000
Content-Security-Policy: object-src 'none'; worker-src https://assets.gitlab-static.net https://gl-canary.freetls.fastly.net https://gitlab.com blob:; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://assets.gitlab-static.net https://gl-canary.freetls.fastly.net https://www.google.com/recaptcha/ https://www.recaptcha.net/ https://www.gstatic.com/recaptcha/ https://apis.google.com; style-src 'self' 'unsafe-inline' https://assets.gitlab-static.net https://gl-canary.freetls.fastly.net; img-src * data: blob:; frame-src 'self' https://www.google.com/recaptcha/ https://www.recaptcha.net/ https://content.googleapis.com https://content-compute.googleapis.com https://content-cloudbilling.googleapis.com https://content-cloudresourcemanager.googleapis.com https://*.codesandbox.io; frame-ancestors 'self'; connect-src 'self' https://assets.gitlab-static.net https://gl-canary.freetls.fastly.net wss://gitlab.com https://sentry.gitlab.net https://customers.gitlab.com https://snowplow.trx.gitlab.net

Body

<html><body>You are being <a href="https://gitlab.com/users/sign_in">redirected</a>.</body></html>

It seems like i'm not authenticating properly. I'm really not sure what i'm doing incorrectly.

SmellydogCoding
  • 414
  • 8
  • 23
  • You can give a look : https://gist.github.com/Slauta/5b2bcf9fa1f6f6a9443aa6b447bcae05 – Francis Robitaille Mar 20 '19 at 06:17
  • That's one of the first posts that I read. It is actually a little dated because the latest version of electron builder requires ```build: {}``` to be in a separate JSON file and not in ```package.json```. Also ```slauta93/electron-builder-win``` users Node6 and I need at least Node8 to use the Vue CLI. – SmellydogCoding Mar 20 '19 at 13:09
  • Are you using latest version of electron-updater? ans also are you using electron-builder to package and publish the artefact? – Francis Robitaille Mar 20 '19 at 19:58
  • Also, are you sure your artefact are really located to that url? `https://gitlab.com/SmellydogCoding/mchd-electronic-field-guide/-/jobs/artifacts/master/raw/dist_electron` – Francis Robitaille Mar 20 '19 at 20:03

0 Answers0