Skip to content

Commit

Permalink
Added 'https-enable =' config-value
Browse files Browse the repository at this point in the history
to use 'MG_TLS=MG_TLS_BUILTIN' for HTTPS.
  • Loading branch information
gvanem committed Dec 7, 2024
1 parent 02f433e commit 0739dde
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 36 deletions.
1 change: 1 addition & 0 deletions dump1090.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ net-sbs-port = 30003 # TCP listening port for SBS

keep-alive = true # Enable `Connection: keep-alive' from HTTP clients.
show-hostname = false
https-enable = false # Enable HTTPS for Web-server
host-raw-in = tcp://localhost:30001 # Remote host/port for RAW input with `--net-active'.
host-raw-out = tcp://localhost:30002 # Remote host/port for RAW input with `--net-active'.
host-sbs-in = tcp://localhost:30003 # Remote host/port for SBS input with `--net-active'.
Expand Down
4 changes: 3 additions & 1 deletion src/Makefile.Windows
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ $(CC).args: $(THIS_FILE)

#
# Not needed since 'favicon.c' is not in 'make clean'.
# Cannot assume everybody has the 'xxd' program.
#
gen_favicons: favicon.png favicon.ico
$(call generate, favicon.c, //)
Expand Down Expand Up @@ -629,7 +630,7 @@ clean: docs_clean DLL_clean VS_clean
rm -f $(OBJ_DIR)/*.obj $(OBJ_DIR)/*.res
- @rmdir $(OBJ_DIR) 2>/dev/null

vclean realclean: clean
realclean vclean: clean
rm -f $(TARGETS) ../packed_test.exe ../sqlite3.exe ../web-pages.dll .depend.Windows
rm -fr $(OBJ_DIR)

Expand Down Expand Up @@ -991,6 +992,7 @@ CURSES_SRC = $(addprefix externals/Curses/, \
window.c)

$(OBJ_DIR)/amalgamation.obj: $(CURSES_SRC)
$(OBJ_DIR)/net_io.obj: server-cert-key.h

depend:
$(call generate, .depend.Windows, #)
Expand Down
1 change: 1 addition & 0 deletions src/dump1090.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ static const struct cfg_table config[] = {
{ "rtl-reset", ARG_ATOB, (void*) &Modes.rtlsdr.power_cycle },
{ "samplerate", ARG_FUNC, (void*) set_sample_rate },
{ "show-hostname", ARG_ATOB, (void*) &Modes.show_host_name },
{ "https-enable", ARG_ATOB, (void*) &Modes.https_enable },
{ "silent", ARG_ATOB, (void*) &Modes.silent },
{ "ppm", ARG_FUNC, (void*) set_ppm },
{ "host-raw-in", ARG_FUNC, (void*) set_host_port_raw_in },
Expand Down
3 changes: 3 additions & 0 deletions src/dump1090_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@
#define MG_ENABLE_FILE 1 /* For `opendir()` etc. */
#define MG_ENABLE_DIRLIST 0 /* No need for directory listings in HTTP */
#define MG_ENABLE_CUSTOM_MILLIS 1 /* Enable 64-bit tick-time */
#define MG_TLS 3 /* Enable MG_TLS_BUILTIN code */
#define MG_TLS_SSLKEYLOGFILE 1 /* Enable logging to `$(SSLKEYLOGFILE)` */

#define _CRT_RAND_S 1 /* To pull in 'rand_s()' */

/** Drop some stuff not needed in `externals/zip.c`:
Expand Down
2 changes: 2 additions & 0 deletions src/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ typedef struct statistics {
uint64_t HTTP_keep_alive_recv;
uint64_t HTTP_keep_alive_sent;
uint64_t HTTP_websockets;
uint64_t HTTP_tls_handshakes;
uint64_t HTTP_400_responses;
uint64_t HTTP_404_responses;
uint64_t HTTP_500_responses;
Expand Down Expand Up @@ -433,6 +434,7 @@ typedef struct global_data {
char *dns4; /**< Use default Windows DNSv4 server (not 8.8.8.8) */
char *dns6; /**< Or a IPv6 server */
bool show_host_name; /**< Try to show the hostname too in `net_str_addr()` */
bool https_enable; /**< Enable TLS (MG_TLS_BUILTIN) for HTTP server */

/** Aircraft history
*/
Expand Down
Loading

0 comments on commit 0739dde

Please sign in to comment.