OpenSourceEBike / ebike_wireless_remote

ANT+ remote button
10 stars 8 forks source link

Add secret #28

Open stsdc opened 3 years ago

stsdc commented 3 years ago
  1. Despite you gave me access there is now settings tab :confused: (maybe there are some permissions, that You didn't give me?)
  2. We need a secure channel of communication so You can send me the key :closed_lock_with_key:
casainho commented 3 years ago

I gave you all the permissions, after that only the admin that It is advise I don´t give to anyone. Maybe you can write a point list of steps I should follow?

stsdc commented 3 years ago

Understandable.

@casainho read this.

image

Do as @charliebruce wrote:

You can encode your keys file with:

openssl base64 -in nRF5_SDK_16.0.0/components/ant/ant_key_manager/ant_key_manager_config.h -out my_encoded_secret

You'll then need to add the contents of my_encoded_secret file to the repo as a secret named ANT_KEY_MANAGER_CONFIG. I've tested this on my fork with the SDK default (all-zero) header.

Then restart the build action.

stsdc commented 3 years ago

We also have to remember that

Secrets are not passed to workflows that are triggered by a pull request from a fork.

That means that every PR from fork will fail. :thinking:

casainho commented 3 years ago

We can always go back to basics, where the header file with the key has all 000 and when building a public release, do it manually to edit the key on the header file...

stsdc commented 3 years ago

What about if we put zeros, so it will always build, but if it runs in an environment with a specified variable it will replace it with this variable?

charliebruce commented 3 years ago

You can in theory re-add the default zero key. I'm not certain if the Action overwrites, or ignores if the file already exists though.

https://github.com/charliebruce/ebike_wireless_remote/commit/72bbf9c811bfb910a93b65d890182df695485188

In practice, it might be better if forks failed to build until they add their own ANT keys though? Otherwise, could end up with the forker being confused by the fact that their fork behaves differently to the main repo. At least this way it's clear why the builds are failing.

casainho commented 3 years ago

So, any ideas how should we advance on this?

stsdc commented 3 years ago

So I will try test my approach on weekend on my repo and will tell you if it works. Just can You please tell me where to get this key?

casainho commented 3 years ago

Try this: #define ANT_PLUS_NETWORK_KEY {0xB9, 0xA5, 0x21, 0xFB, 0xBD, 0x72, 0xC3, 0x45} /*< The ANT+ network key. /

casainho commented 3 years ago

You can find here the ANT key: https://devzone.nordicsemi.com/f/nordic-q-a/68872/background-scanning https://devzone.nordicsemi.com/f/nordic-q-a/11880/hrm-demo-profile-doesn-t-work

rananna commented 3 years ago

Wow. This is the Nordic Dev Zone and Nordic is a key partner of Garmin. So much for respecting the Garmin adopter agreement!