From 5398969c4df8af7a59f377d14fa376b058572149 Mon Sep 17 00:00:00 2001 From: Michael McVady Date: Sun, 15 Aug 2021 01:59:05 +0000 Subject: Initial commit --- .gitignore | 6 ++++++ conf/build.conf | 34 ++++++++++++++++++++++++++++++++++ conf/clog.conf | 16 ++++++++++++++++ src/clog.c | 11 +++++++++++ 4 files changed, 67 insertions(+) create mode 100644 .gitignore create mode 100644 conf/build.conf create mode 100644 conf/clog.conf create mode 100644 src/clog.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..697dcca --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +*.o +.flavor +.objs +clog.so +assets.h +cert diff --git a/conf/build.conf b/conf/build.conf new file mode 100644 index 0000000..c75c9f2 --- /dev/null +++ b/conf/build.conf @@ -0,0 +1,34 @@ +# clog build config +# You can switch flavors using: kodev flavor [newflavor] + +# Set to yes if you wish to produce a single binary instead +# of a dynamic library. If you set this to yes you must also +# set kore_source together with kore_flavor. +#single_binary=no +#kore_source=/home/joris/src/kore +#kore_flavor= + +# The flags below are shared between flavors +cflags=-Wall -Wmissing-declarations -Wshadow +cflags=-Wstrict-prototypes -Wmissing-prototypes +cflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +cxxflags=-Wall -Wmissing-declarations -Wshadow +cxxflags=-Wpointer-arith -Wcast-qual -Wsign-compare + +# Mime types for assets served via the builtin asset_serve_* +#mime_add=txt:text/plain; charset=utf-8 +#mime_add=png:image/png +#mime_add=html:text/html; charset=utf-8 + +dev { + # These flags are added to the shared ones when + # you build the "dev" flavor. + cflags=-g + cxxflags=-g +} + +#prod { +# You can specify additional flags here which are only +# included if you build with the "prod" flavor. +#} diff --git a/conf/clog.conf b/conf/clog.conf new file mode 100644 index 0000000..4264beb --- /dev/null +++ b/conf/clog.conf @@ -0,0 +1,16 @@ +# clog configuration + +server tls { + bind 127.0.0.1 8888 +} + +load ./clog.so + +domain * { + attach tls + + certfile cert/server.pem + certkey cert/key.pem + + route / page +} diff --git a/src/clog.c b/src/clog.c new file mode 100644 index 0000000..7205d87 --- /dev/null +++ b/src/clog.c @@ -0,0 +1,11 @@ +#include +#include + +int page(struct http_request *); + +int +page(struct http_request *req) +{ + http_response(req, 200, NULL, 0); + return (KORE_RESULT_OK); +} -- cgit v1.2.3