Updated submodule and README

master
denes 6 years ago
parent e10515affa
commit 8dbb43328b

@ -1,5 +1,28 @@
# webfish
# webfish
An HTTP server which bites on Gitea POST webhooks
It utilizes the http://matetelki.eu:3000/denes/cpp_utils library.
It utilizes the http://matetelki.eu:3000/denes/cpp_utils library.
```
usage: ./webfish <ARGS> [OPTIONS]
Required arguments:
-c STRING Client hostname to check
-f STRING File to execute on receiving a message
-s STRING Look for a line in the msg body with '"secret": "SECRET"'
Options:
-h, --help Prints this help message
-p INT Listenning port (default is 5050)
```
For example: `./webfish -c matetelki.eu -f ./hugo_updater.sh -s SECRET`
Todos:
- The `Content-Length: 1900` is disregarded. The secret is in the first chunk anyway:
- bad request? Reply & close connection.
- correct request? Reply after the first chunk, while the client is still talking.
- The `-h` does not work, only `./webfish -h, --help` :P
- The logging needs some tuning

@ -54,8 +54,11 @@ public:
TRACE;
m_buffer = std::string( (const char*) msgPart, msgLen );
/// @todo use it!
// not using getExpectedLength
/** @todo use it!
* We are very rude now:
* - bad request? Reply & close connection.
* - correct request? Reply after the first chunk, while the client is still talking
*/
onMessageReady();
return true;
}
@ -92,7 +95,7 @@ public:
}
} catch (const std::exception& e) {
LOG (Logger::ERR, e.what());
LOG (Logger::WARNING, e.what());
m_connection->send(reply.c_str(), reply.length());
m_buffer.clear();
dynamic_cast<TcpConnection*>(m_connection)->disconnect();

@ -1 +1 @@
Subproject commit 0250d43bbe8b46e021aeca2c6caae20745ed2513
Subproject commit 67ca668ff36577e70ca1a07564b8d6e81d9d6905
Loading…
Cancel
Save