https://github.com/kleo/bitsky
Bitbucket to Skype webhook
https://github.com/kleo/bitsky
bitbucket skype webhook
Last synced: 8 months ago
JSON representation
Bitbucket to Skype webhook
- Host: GitHub
- URL: https://github.com/kleo/bitsky
- Owner: kleo
- License: gpl-3.0
- Created: 2024-05-19T08:23:35.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-01T14:58:30.000Z (almost 2 years ago)
- Last Synced: 2024-08-01T16:52:36.509Z (almost 2 years ago)
- Topics: bitbucket, skype, webhook
- Language: Python
- Homepage:
- Size: 650 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bitsky
Bitbucket to Skype webhook
## Configure credentials
1. Create an account for Skype
2. Create a Skype group
3. Invite other users to the newly created Skype group
4. Find `ConversationId` on web.skype.com using Network Tools on your browser

4. Add email, password and group to `src/config.ini`
```
[config]
email = user@email.com
password = supersecretpassword
group = 12:34567890abcdefghijklmnopqrstuvwx@thread.skype
```
You can also add multiple accounts. For example on using Uptime Kuma
```
uptime_email = uptime-kuma@email.com
uptime_password = supersecretpassword
uptime_group = 19:2345ab6cd6789e0f1g23h4h5i6j7890c@thread.skype
```
## Development
Simulate webhook trigger from Bitbucket
```
$ git clone https://github.com/kleo/bitsky
$ cd bitsky
$ python -m venv --copies venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ python src/bitsky.py
$ curl http://localhost:5000/build -H 'Content-Type:application/json' -d @requests/build/build-inprogress.json
```
## Port forward
Using ngrok for bitbucket webhook testing
```
$ ngrok http 5000
$ curl https://123a-45-678-901-234.ngrok-free.app/build -H 'Content-Type:application/json' -d @requests/build/build-successful.json
```
Copy ngrok url to Bitbucket Repository > Webhooks > Edit webhook
## Build Docker image
docker build and push
```
$ docker build -t registry.example.com/bitsky:latest .
$ docker push registry.example.com/bitsky:latest
```
## Run using Docker
```
$ docker pull registry.example.com/bitsky:latest
$ docker run --restart=always -p 127.0.0.1:8000:80 registry.example.com/bitsky:latest
```
## Reverse proxy configuration
Using Caddy
```
webhook.example.com {
reverse_proxy /push 127.0.0.1:8000
reverse_proxy /build 127.0.0.1:8000
reverse_proxy /pr 127.0.0.1:8000
reverse_proxy /health 127.0.0.1:8000
# reverse_proxy /uptime 127.0.0.1:8000
log {
output file /var/log/webhook.example.com.log {
roll_size 10mb
roll_keep 20
roll_keep_for 720h
}
}
}
```
## Screenshots
Build sucessful

Build failed

Open pull request

## Acknowledgements
[Terrance](https://github.com/Terrance) author of [SkPy](https://github.com/Terrance/SkPy)
## TODO
- Support Bitbucket webhook secret
- Support other triggers