Problems signing my Panel Plugin

Hey Guys,

I’ve just created my own little panel plugin which works fine for me!
Now I’m interested in publishing this plugin (at first private).
For this I have to sign it as written in this tutorial here: Sign a plugin | Grafana Labs
but I don’t have a MANIFEST.txt in my dist directory?

Do I have to write these lines into this file or what do I have to do?

export GRAFANA_API_KEY=<YOUR_API_KEY>
npx @grafana/toolkit plugin:sign --rootUrls https://example.com/grafana

Can anyone help me please?

Greetings and Thanks!

The MANIFEST.txt is generated by the plugin:sign command. Private plugins are mainly meant for plugins that are only used in-house for company-specific things. The private signature will only be valid for the Grafana instances listed by the rootUrls flags.

If you’d like to publish the plugin for others to use, you’d need to request either a community or a commercial plugin by submitting the plugin to the plugin repository.

Yes this is our use case. I only develop a plugin for in house use.

I also created my API KEY but I don’t know where to set my variable with
export GRAFANA_API_KEY=<YOUR_API_KEY>

It needs to be set in the same terminal that you run the plugin:sign command. If you’d like, you can also run it in the same command:

GRAFANA_API_KEY=<YOUR_API_KEY> npx @grafana/toolkit plugin:sign --rootUrls https://example.com/grafana

My problem is I’m working on Windows. So the UNIX export command doesn’t exist.
I tried it with the setx command but it doesn’t work either.

My Windows is a bit rusty unfortunately. What terminal are you using? Command Prompt? Powershell?

What errors are you seeing?

Please also note that the API key you’re using needs to be generated from the owner of the plugin, i.e. the first part of the plugin ID. For example, if the plugin ID is myorg-mega-panel, the API key needs to be generated by the myorg Grafana Cloud account.

I’m using Powershell

My error is currently this:
`Error: You must enter a GRAFANA_API_KEY to sign the plugin manifest

at Object. (C:\Users\mpbec\AppData\Roaming\npm-cache_npx\8448\node_modules@grafana\toolkit\src\plugins\manifest.js:144:31)

at step (C:\Users\mpbec\AppData\Roaming\npm-cache_npx\8448\node_modules@grafana\toolkit\node_modules\tslib\tslib.js:143:27)

at Object.next (C:\Users\mpbec\AppData\Roaming\npm-cache_npx\8448\node_modules@grafana\toolkit\node_modules\tslib\tslib.js:124:57)

at C:\Users\mpbec\AppData\Roaming\npm-cache_npx\8448\node_modules@grafana\toolkit\node_modules\tslib\tslib.js:117:75

at new Promise ()

at Object.__awaiter (C:\Users\mpbec\AppData\Roaming\npm-cache_npx\8448\node_modules@grafana\toolkit\node_modules\tslib\tslib.js:113:16)

at Object.signManifest (C:\Users\mpbec\AppData\Roaming\npm-cache_npx\8448\node_modules@grafana\toolkit\src\plugins\manifest.js:137:20)

at C:\Users\mpbec\AppData\Roaming\npm-cache_npx\8448\node_modules@grafana\toolkit\src\cli\tasks\plugin.sign.js:31:53

at step (C:\Users\mpbec\AppData\Roaming\npm-cache_npx\8448\node_modules@grafana\toolkit\node_modules\tslib\tslib.js:143:27)

at Object.next (C:\Users\mpbec\AppData\Roaming\npm-cache_npx\8448\node_modules@grafana\toolkit\node_modules\tslib\tslib.js:124:57)

at fulfilled (C:\Users\mpbec\AppData\Roaming\npm-cache_npx\8448\node_modules@grafana\toolkit\node_modules\tslib\tslib.js:114:62)`

This error occurs also with my changed plugin ID. (changed in src/plugin.json)

I also tried changing the secret key in my custom.ini file which hasn’t changed anything.

For ease, you can download a bash client and use that. On a windows system, GIT Bash will do just fine. Tested it this morning

Just use SET in a command prompt on Windows.

SET GRAFANA_API_KEY=eywpeoiruweiour…==

No quotes

Cheers,
Paul

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.