Comments (3)
Thanks for queuing me in @K0p1-Git.
I haven't looked into this in-depth yet but I'll explore this more.
My initial answer:
To the best of my knowledge, I may be incorrect here but you basically create the app in slack, copy the webhook to the script and then add the app to the channel (that gives authorization to post in said channel). If you had the app added to multiple channels, I believe that's where the channel name designation matters.
I will look into this more on my spare time but that's my initial answer. Hope that somewhat answers your question.
from cloudflare-ddns-updater.
Hey @northportio, if its possible do take a look at this.
from cloudflare-ddns-updater.
@northportio Yep! You're correct however...(Hey! Just my two cents opinion down here)
Afaik, because of security scopes, Webhooks are usually tied to a specific channel. Each webhooks uri is unique, no matter the app, destination channel etc. (You can try create a duplicate webhook, and see that the request uri is different even thought they post to the same channel, from the same app etc)
To implement channel name designation, i think the following steps must be done.
An user needs to go to here. Create an app, and go to OAuth & Permissions
, then setup the necessary OAuth permission scopes like channels:read
for reading available channels, and chat:write
for sending messages.
Then copy the bot user oauth token, it usually starts with xoxb-<...>
.
Then post request code shall be like:
#!/bin/bash
slack_api_url="https://slack.com/api/chat.postMessage"
slack_app_token="your-bot-user-oauth-token-here"
slack_channel="general"
slack=$(curl -s -X POST $slack_api_url \
-H "Authorization: Bearer $slack_app_token" \
-H "Content-type: application/json; charset=UTF-8" \
--data "{\"channel\":\"$slack_channel\",\"text\": \"Hello world! I'm sending message to $slack_channel channel.\"}")
If you're interested, you can learn more here!
from cloudflare-ddns-updater.
Related Issues (20)
- TTL=auto HOT 3
- TXT spf1 updater HOT 1
- Cloudflare ip not updating HOT 2
- Add cron designations HOT 1
- [Question] HOT 3
- Support for multiple records [Reference @jeidnx comment on 24th Jan] HOT 10
- [Discussion] remove the ttl and proxy variables HOT 4
- DDNS Updater: Failed to find a valid IP HOT 4
- Could not route to /client/v4/zones/XXXX/dns_records, perhaps your object identifier is invalid?" HOT 1
- it opens my admin router?? HOT 1
- where to find the url used for updating my dynamic ip HOT 1
- What am i doing wrong?? [Clouldflare's API does not support domains with a .cf, .ga, .gq, .ml, or .tk] HOT 2
- Script does nothing HOT 1
- I would like to add a Telegram Notification HOT 1
- Can't use 2 record names at the same time. HOT 1
- Automatically updated ip address (subdomain) differes from the ip of the main domain
- Possibility to take IP from another gateway
- Works on Raspberry Pi, but not on Mac
- Ensure Cloudflare is returning a valid IP address before comparing old_ip to current IP HOT 2
- Hope there will be IPv6 support HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloudflare-ddns-updater.