-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support https with certificate path options
http as a cargo build feature
- Loading branch information
1 parent
8ba781f
commit 81be74b
Showing
7 changed files
with
226 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,34 @@ | ||
### Pulse | ||
#### A work in progress information bot linking Discord and Github, with more to come | ||
## Pulse | ||
### A work in progress information bot linking Discord and Github, with more to come | ||
|
||
- for now uses a Discord webhook for only posting messages | ||
- recieves POST requests (e.g. from github webhooks) to be processed into custom messages, which are then POST'd to Discord | ||
- so we can format the Github POST content to our hearts content | ||
|
||
# To come | ||
### Roadmap | ||
|
||
- [ ] support for https POST reciepts (does work, just need actual certs, and to bundle them in) | ||
- [ ] verify POST's are from github using the webhook secret | ||
- [x] support for https POST receipts | ||
- [x] support for http POST receipts (as a cargo build option) | ||
- [x] verify POST's are from github using the webhook secret | ||
- [ ] Release formatting | ||
- [ ] Pre-release formatting | ||
|
||
### Setup | ||
|
||
### Example Google Cloud instance (free tier) | ||
|
||
### https certificate setup | ||
|
||
#### Self signed (useful for localhost testing) | ||
|
||
- You can use the bash script ```certs/gen.sh``` to generate a key/cert pair with openssl | ||
|
||
#### Production; from authority | ||
|
||
- get a domain (e.g. from squarespace) | ||
- create a custom DNS record, e.g. | ||
- ``` | ||
your.domain.somwhere A 1 hour google.cloud.instance.ip | ||
``` | ||
- Use [Let's Encrypts](https://letsencrypt.org/) recommendation of [certbot](https://certbot.eff.org/) it really is very easy | ||
- You will need to enable http in the cloud instance firewall for provisioning as well as https |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#[cfg(feature = "http")] | ||
use pulse::server_http::serve; | ||
|
||
#[cfg(feature = "http")] | ||
#[tokio::main] | ||
async fn main() { | ||
|
||
let args: Vec<String> = std::env::args().collect(); | ||
|
||
let token = if args.iter().any(|x| x == "-t") | ||
{ | ||
let i = args.iter().position(|x| x == "-t").unwrap(); | ||
|
||
if i+1 < args.len() | ||
{ | ||
args[i+1].clone() | ||
} | ||
else | ||
{ | ||
println!("Authentication token not provided, please provide -t token"); | ||
std::process::exit(1); | ||
} | ||
} | ||
else | ||
{ | ||
println!("Authentication token not provided, please provide -t token"); | ||
std::process::exit(1); | ||
}; | ||
|
||
serve(token).await; | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.