Comments (7)
Please better explain your scenario and use case. I bet you can solve this within the execute_command
script when include-command-output-in-response
is true.
from webhook.
OK, let's kepp it simple— every 5 minutes a new complicated image it is generated on the server, output.jpg
I need the webhook to display the latest image generated on the server, using webhook.
This is the setting:
{
"id": "itst",
"include-command-output-in-response": true,
"response-headers": [
{
"name": "Content-Type",
"value": "text/html"
}
],
"execute-command": "echo",
"pass-arguments-to-command": [
{
"source": "string",
"name": "<**meta1** http-equiv='Content-type' content='text/html; charset=utf-8'/><html style='height: 100%;'><head><title>test</title></head><body style='margin: 0px; height: 100%'><img style='-webkit-user-select:none; display:block; margin:auto; padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);' **src=output.jpg**''></body></html>"
}
]
}
from webhook.
Assuming a Linux host, try something like this:
{
"id": "itst",
"include-command-output-in-response": true,
"response-headers": [
{
"name": "Content-Type",
"value": "text/html"
}
],
"execute-command": "/path/to/showpage.sh",
"pass-arguments-to-command": [
{
"source": "string",
"name": "/path/to/output.jpg"
}
]
}
showpage.sh:
#!/usr/bin/bash
echo -n '<**meta1** http-equiv="Content-type" content="text/html; charset=utf-8"/><html style="height: 100%;"><head><title>test</title></head><body style="margin: 0px; height: 100%"><img style="-webkit-user-select:none; display:block; margin:auto; padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);" **src="data:/image/jpeg,'
base64 -w 0 $1
echo '**"></body></html>'
from webhook.
Thank you, I fix it like this, it works now:
#!/usr/bin/bash
echo -n '<meta http-equiv="Content-type" content="text/html; charset=utf-8"/><html style="height: 100%;"><head><title>test</title></head><body style="margin: 0px; height: 100%"><img style="-webkit-user-select:none; display:block; margin:auto; padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);" src="data:image/jpeg;base64,'
base64 -w 0 $1
echo '"></body></html>'
Not particularly elegant; it clutters the logs by logging every single image in its entirety.
from webhook.
Not particularly elegant; it clutters the logs by logging every single image in its entirety.
Where is this being logged? Unless you're running webhook
with debug enabled, it should not log the response body. Please explain.
from webhook.
I run it like this:
webhook -hooks wb.json -hotreload -logfile webhook.out -port 80&
I think anyone should run it like this. It is one of your strong points—at least for me was the deciding factor.
Maybe we should work on: command output, not to display the entire response body.
from webhook.
@actuariat,
I'm glad this issue is resolved for you.
I've opened a separate issue about adding the ability to control command output logging.
from webhook.
Related Issues (20)
- Vulnerabilities of dependency "gopkg.in/yaml.v2"
- webhook hook not running bash script HOT 6
- Bitbucket now supports webhook secrets 🥳 HOT 1
- I found that I can't use dot-notation to contain all sub-objects in my json
- I need to parse url for addr:port HOT 1
- Update `go` installation
- Ubuntu Webhooks is not reading the correct RVM ruby installed HOT 2
- Custom logging
- Webhook id is not being served in URL HOT 2
- how to set shell $PATH HOT 4
- Weird Cert issue when calling webhook from shell HOT 1
- pass-file-to-command as optional HOT 1
- Question - How long does the webhook service run
- Add hook property to control command output logging
- New WebHook, Docker, Env Support, Clean codebase 🎉
- amd64 does not works pre compiled? HOT 2
- How to properly display output in desired format to telegram? HOT 2
- Any chance of putting an arm64 version on the snap store?
- Is this project dead?
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 webhook.