hunter-packages / hunter-bot

Bot for Hunter package manager
BSD 2-Clause "Simplified" License
1 stars 2 forks source link

What is `github_webhook_secret`? #11

Open ruslo opened 8 years ago

ruslo commented 8 years ago

Where I can get this one?

Cyberunner23 commented 8 years ago

This one is generated automatically if its not already in the config, you can of course change it afterwards, you can also just remove it from the config and it will reset to some random value

Cyberunner23 commented 8 years ago

Essentially the whole state section can be deleted and the bot will still work though we shouldn't do that once we let it run for the main project. All values in this section is generated by the bot and some of them may be edited

ruslo commented 8 years ago

you can also just remove it from the config

No, it crash with the error if I don't have one.

This one is generated automatically

Can we get it on-the-fly while starting bot? It would be nice to not to store automatically generated info in config. Config is something user should fill.

Cyberunner23 commented 8 years ago

No, it crash with the error if I don't have one.

Umm... ok? Can I see the logs?

Can we get it on-the-fly while starting bot?

We could but without any persistence for that value we would have to make a new one and thus make a new set of webhooks (I think its only 20 sets per account max)

ruslo commented 8 years ago

Umm... ok? Can I see the logs?

Yes:

> ./target/debug/hunter-bot --config test-config.toml --log-dir _logs
**CRASH**: Error getting the value of "github_webhook_secret" from the config which is required: Key "github_webhook_secret" in section "[state]" does not exist.
ruslo commented 8 years ago

make a new set of webhooks

Can we ask information about existing webhooks from API? We don't have to set them each time.

Cyberunner23 commented 8 years ago

**CRASH**: Error getting the value of "github_webhook_secret" from the config which is required: Key "github_webhook_secret" in section "[state]" does not exist.

oops I might of added the required tag on that even if it shouldnt, should be fixed in a while

Can we ask information about existing webhooks from API? We don't have to set them each time.

we can but it wont give us the secret so if github sends us a webhook with that set, we would have no idea what secret to use when authenticating it

ruslo commented 8 years ago

we can but it wont give us the secret so if github sends us a webhook with that set, we would have no idea what secret to use when authenticating it

Got it, sounds reasonable.

What do you think about separating configs? I see automatic-secret, user-secret and user-public files for now.

Cyberunner23 commented 8 years ago

What do you think about separating configs? I see automatic-secret, user-secret and user-public files for now.

Well for the user files do we need to keep them separate? I don't see why we would need to keep them separate, unless we're going to publish the file?

ruslo commented 8 years ago

I don't see why we would need to keep them separate, unless we're going to publish the file?

Exactly. I may want to publish it and may want to add secret folder to .gitignore.

Cyberunner23 commented 8 years ago

Ok, that will work

Cyberunner23 commented 8 years ago

Pushed a fix for the crash on develop branch

ruslo commented 8 years ago

Pushed a fix for the crash on develop branch

Crash message gone, thanks