Skip to content

Commit

Permalink
add /status page
Browse files Browse the repository at this point in the history
  • Loading branch information
freddy36 committed Mar 14, 2024
1 parent 06793b9 commit 31e8cba
Show file tree
Hide file tree
Showing 6 changed files with 337 additions and 3 deletions.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ else
CFLAGS += -DGIT_VER=\"$(VERSION)\"
endif

ifndef WITH_JSON
$(info enabeling JSON support)
$(info if you don't want JSON support run)
$(info make WITH_JSON=0)
WITH_JSON = 1
endif

CFLAGS += -DWITH_JSON=$(WITH_JSON)

RM = /bin/rm -f
Q = @

Expand All @@ -23,6 +32,10 @@ else
LIBS = -lpthread -lm -lrt
endif

ifeq "$(WITH_JSON)" "1"
LIBS += -ljson-c
endif

FUNCS_DIR = libfuncs
FUNCS_LIB = $(FUNCS_DIR)/libfuncs.a

Expand Down
18 changes: 17 additions & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ is used in production in couple of small DVB-C networks.

Installation
============
mptsd do not depend on any external libraries. There are two source code
mptsd has no hard dependencies on any external libraries. There are two source code
dependancies that come with mptsd - libfuncs and libtsfuncs.
The JSON-C library is used for some optional functionality but can be disabled.

Make sure your kernel has CONFIG_HIGH_RES_TIMERS enabled. Otherwise sleep
timeout probably won't be able to calibrate itself and mptsd will not work.
Expand Down Expand Up @@ -43,6 +44,14 @@ mptsd was tested and found to be working ok with Dektec DTE-3114 & HiDes UT-100C
To enable RTP output instead of plain UDP for network streams,
specify the SSRC identifier via the -s flag (must be != 0).

Integrated Webserver
=========
When mptsd is started with the -p option, it will start a webserver at the
specified port.

If JSON support is enabled, sending a GET request to /status.json will return a
JSON file containing various details about the configuration and statistics.

Development
===========
The development is tracked using git. The repository is hosted at github
Expand All @@ -54,11 +63,18 @@ to get it, run the following command:
OR
git submodule update --recursive --remote // if you like to checkout HEAD submodules.


Compiling
=========
mptsd can use the JSON-C library.
On debian based systems it can be installed using
`sudo apt install libjson-c-dev`

After cloning the git repository as described in Development section
just run `make`.

If you don't want JSON support run `make WITH_JSON=0`

Releases
========
Official releases can be downloaded from tsdecrypt home page which is:
Expand Down
7 changes: 5 additions & 2 deletions mptsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@

#define PROGRAM_NAME "ux-mptsd"

#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)

#ifdef BUILD_ID
const char *program_id = PROGRAM_NAME " " GIT_VER " build " BUILD_ID;
const char *program_id = PROGRAM_NAME " " GIT_VER " build " BUILD_ID " WITH_JSON=" STR(WITH_JSON);
#else
const char *program_id = PROGRAM_NAME " " GIT_VER;
const char *program_id = PROGRAM_NAME " " GIT_VER " WITH_JSON=" WITH_JSON;
#endif

char *server_sig = PROGRAM_NAME;
Expand Down
Loading

0 comments on commit 31e8cba

Please sign in to comment.