diff --git a/Makefile b/Makefile index 7d127a2..dcc5e7b 100644 --- a/Makefile +++ b/Makefile @@ -11,16 +11,16 @@ packages: @echo "Finished downloading!" permit: - sudo setcap 'cap_net_bind_service=+ep' "$(shell pwd)/bin/necronda-server" + sudo setcap 'cap_net_bind_service=+ep' "$(shell pwd)/bin/sesimos" compile: @mkdir -p bin - $(CC) src/lib/*.c -o bin/libnecrondaserver.so --shared -fPIC $(CFLAGS) $(LIBS) - $(CC) src/server.c src/client.c -o bin/necronda-server $(CFLAGS) $(LIBS) \ - -Lbin -lnecrondaserver -Wl,-rpath=$(shell pwd)/bin + $(CC) src/lib/*.c -o bin/libsesimos.so --shared -fPIC $(CFLAGS) $(LIBS) + $(CC) src/server.c src/client.c -o bin/sesimos $(CFLAGS) $(LIBS) \ + -Lbin -lsesimos -Wl,-rpath=$(shell pwd)/bin compile-prod: @mkdir -p bin - $(CC) src/lib/*.c -o bin/libnecrondaserver.so --shared -fPIC $(CFLAGS) $(LIBS) $(DEBIAN_OPTS) -O3 - $(CC) src/server.c src/client.c -o bin/necronda-server $(CFLAGS) $(LIBS) $(DEBIAN_OPTS) -O3 \ - -Lbin -lnecrondaserver -Wl,-rpath=$(shell pwd)/bin + $(CC) src/lib/*.c -o bin/libsesimos.so --shared -fPIC $(CFLAGS) $(LIBS) $(DEBIAN_OPTS) -O3 + $(CC) src/server.c src/client.c -o bin/sesimos $(CFLAGS) $(LIBS) $(DEBIAN_OPTS) -O3 \ + -Lbin -lsesimos -Wl,-rpath=$(shell pwd)/bin diff --git a/README.md b/README.md index a303b35..5045177 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -Necronda web server -=================== +Sesimos – Secure, simple, modern web server +=========================================== ## Features diff --git a/src/client.c b/src/client.c index e7de31b..49bd59f 100644 --- a/src/client.c +++ b/src/client.c @@ -1,11 +1,11 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * Client connection and request handlers * src/client.c * Lorenz Stechauner, 2020-12-03 */ -#include "necronda.h" +#include "defs.h" #include "client.h" #include "server.h" @@ -374,7 +374,7 @@ int client_request_handler(sock *client, unsigned long client_num, unsigned int } else { int mode; if (strcmp(uri.filename + strlen(uri.filename) - 4, ".ncr") == 0) { - mode = FASTCGI_NECRONDA; + mode = FASTCGI_SESIMOS; } else if (strcmp(uri.filename + strlen(uri.filename) - 4, ".php") == 0) { mode = FASTCGI_PHP; } else { diff --git a/src/client.h b/src/client.h index c0953e0..60008bf 100644 --- a/src/client.h +++ b/src/client.h @@ -1,12 +1,12 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * Client connection and request handlers (header file) * src/client.h * Lorenz Stechauner, 2022-08-16 */ -#ifndef NECRONDA_SERVER_NECRONDA_CLIENT_H -#define NECRONDA_SERVER_NECRONDA_CLIENT_H +#ifndef SESIMOS_CLIENT_H +#define SESIMOS_CLIENT_H #include "lib/config.h" #include "lib/sock.h" @@ -17,4 +17,4 @@ host_config *get_host_config(const char *host); int client_handler(sock *client, unsigned long client_num, struct sockaddr_in6 *client_addr); -#endif //NECRONDA_SERVER_NECRONDA_CLIENT_H +#endif //SESIMOS_CLIENT_H diff --git a/src/defs.h b/src/defs.h new file mode 100644 index 0000000..a5d2f21 --- /dev/null +++ b/src/defs.h @@ -0,0 +1,25 @@ +/** + * sesimos - secure, simple, modern web server + * Definitions + * src/defs.h + * Lorenz Stechauner, 2021-05-04 + */ + +#ifndef SESIMOS_DEF_H +#define SESIMOS_DEF_H + +#define SERVER_VERSION "4.5" +#define SERVER_STR "Sesimos/" SERVER_VERSION +#define SERVER_STR_HTML "Sesimos web server " SERVER_VERSION + +#define CHUNK_SIZE 8192 + +#ifndef DEFAULT_HOST +# define DEFAULT_HOST "www.necronda.net" +#endif + +#ifndef SERVER_NAME +# define SERVER_NAME DEFAULT_HOST +#endif + +#endif //SESIMOS_DEF_H diff --git a/src/lib/cache.c b/src/lib/cache.c index 9fa74bc..e52bfff 100644 --- a/src/lib/cache.c +++ b/src/lib/cache.c @@ -1,5 +1,5 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * File cache implementation * src/lib/cache.c * Lorenz Stechauner, 2020-12-19 @@ -59,17 +59,17 @@ int cache_process() { } cache = shm_rw; - if (mkdir("/var/necronda/", 0755) < 0 && errno != EEXIST) { - fprintf(stderr, ERR_STR "Unable to create directory '/var/necronda/': %s" CLR_STR "\n", strerror(errno)); + if (mkdir("/var/sesimos/", 0755) < 0 && errno != EEXIST) { + fprintf(stderr, ERR_STR "Unable to create directory '/var/sesimos/': %s" CLR_STR "\n", strerror(errno)); return -3; } - if (mkdir("/var/necronda/server/", 0755) < 0 && errno != EEXIST) { - fprintf(stderr, ERR_STR "Unable to create directory '/var/necronda/server/': %s" CLR_STR "\n", strerror(errno)); + if (mkdir("/var/sesimos/server/", 0755) < 0 && errno != EEXIST) { + fprintf(stderr, ERR_STR "Unable to create directory '/var/sesimos/server/': %s" CLR_STR "\n", strerror(errno)); return -3; } - FILE *cache_file = fopen("/var/necronda/server/cache", "rb"); + FILE *cache_file = fopen("/var/sesimos/server/cache", "rb"); if (cache_file != NULL) { fread(cache, sizeof(cache_entry), CACHE_ENTRIES, cache_file); fclose(cache_file); @@ -104,13 +104,13 @@ int cache_process() { FILE *comp_file_gz = NULL; FILE *comp_file_br = NULL; if (compress) { - sprintf(buf, "%.*s/.necronda-server", cache[i].webroot_len, cache[i].filename); + sprintf(buf, "%.*s/.sesimos", cache[i].webroot_len, cache[i].filename); if (mkdir(buf, 0755) != 0 && errno != EEXIST) { fprintf(stderr, ERR_STR "Unable to create directory %s: %s" CLR_STR "\n", buf, strerror(errno)); goto comp_err; } - sprintf(buf, "%.*s/.necronda-server/cache", cache[i].webroot_len, cache[i].filename); + sprintf(buf, "%.*s/.sesimos/cache", cache[i].webroot_len, cache[i].filename); if (mkdir(buf, 0700) != 0 && errno != EEXIST) { fprintf(stderr, ERR_STR "Unable to create directory %s: %s" CLR_STR "\n", buf, strerror(errno)); goto comp_err; @@ -125,10 +125,10 @@ int cache_process() { buf[strlen(rel_path)] = 0; p_len_gz = snprintf(filename_comp_gz, sizeof(filename_comp_gz), - "%.*s/.necronda-server/cache/%s.gz", + "%.*s/.sesimos/cache/%s.gz", cache[i].webroot_len, cache[i].filename, buf); p_len_br = snprintf(filename_comp_br, sizeof(filename_comp_br), - "%.*s/.necronda-server/cache/%s.br", + "%.*s/.sesimos/cache/%s.br", cache[i].webroot_len, cache[i].filename, buf); if (p_len_gz < 0 || p_len_gz >= sizeof(filename_comp_gz) || p_len_br < 0 || p_len_br >= sizeof(filename_comp_br)) @@ -203,7 +203,7 @@ int cache_process() { if (cache_changed) { cache_changed = 0; - cache_file = fopen("/var/necronda/server/cache", "wb"); + cache_file = fopen("/var/sesimos/server/cache", "wb"); if (cache_file == NULL) { fprintf(stderr, ERR_STR "Unable to open cache file: %s" CLR_STR "\n", strerror(errno)); free(buf); diff --git a/src/lib/cache.h b/src/lib/cache.h index 3d5583b..1453e7f 100644 --- a/src/lib/cache.h +++ b/src/lib/cache.h @@ -1,12 +1,12 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * File cache implementation (header file) * src/lib/cache.h * Lorenz Stechauner, 2020-12-19 */ -#ifndef NECRONDA_SERVER_CACHE_H -#define NECRONDA_SERVER_CACHE_H +#ifndef SESIMOS_CACHE_H +#define SESIMOS_CACHE_H #include "uri.h" @@ -46,4 +46,4 @@ int cache_filename_comp_invalid(const char *filename); int uri_cache_init(http_uri *uri); -#endif //NECRONDA_SERVER_CACHE_H +#endif //SESIMOS_CACHE_H diff --git a/src/lib/compress.c b/src/lib/compress.c index 7db2f63..f3ef5ff 100644 --- a/src/lib/compress.c +++ b/src/lib/compress.c @@ -1,5 +1,5 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * Compression interface * src/lib/compress.c * Lorenz Stechauner, 2021-05-05 diff --git a/src/lib/compress.h b/src/lib/compress.h index 3ddcb17..a31c9e9 100644 --- a/src/lib/compress.h +++ b/src/lib/compress.h @@ -1,12 +1,12 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * Compression interface (header file) * src/lib/compress.h * Lorenz Stechauner, 2021-05-05 */ -#ifndef NECRONDA_SERVER_COMPRESS_H -#define NECRONDA_SERVER_COMPRESS_H +#ifndef SESIMOS_COMPRESS_H +#define SESIMOS_COMPRESS_H #include <zlib.h> #include <brotli/encode.h> @@ -34,4 +34,4 @@ int compress_compress_mode(compress_ctx *ctx, int mode, const char *in, unsigned int compress_free(compress_ctx *ctx); -#endif //NECRONDA_SERVER_COMPRESS_H +#endif //SESIMOS_COMPRESS_H diff --git a/src/lib/config.c b/src/lib/config.c index f2b2f45..eb13f47 100644 --- a/src/lib/config.c +++ b/src/lib/config.c @@ -1,5 +1,5 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * Configuration file loader * src/lib/config.c * Lorenz Stechauner, 2021-01-05 diff --git a/src/lib/config.h b/src/lib/config.h index 6006cd0..21d1cf6 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -1,12 +1,12 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * Configuration file loader (header file) * src/lib/config.h * Lorenz Stechauner, 2021-01-05 */ -#ifndef NECRONDA_SERVER_CONFIG_H -#define NECRONDA_SERVER_CONFIG_H +#ifndef SESIMOS_CONFIG_H +#define SESIMOS_CONFIG_H #include "uri.h" @@ -19,7 +19,7 @@ #define CONFIG_TYPE_REVERSE_PROXY 2 #ifndef DEFAULT_CONFIG_FILE -# define DEFAULT_CONFIG_FILE "/etc/necronda/server.conf" +# define DEFAULT_CONFIG_FILE "/etc/sesimos/sesimos.conf" #endif @@ -61,4 +61,4 @@ int config_load(const char *filename); int config_unload(); -#endif //NECRONDA_SERVER_CONFIG_H +#endif //SESIMOS_CONFIG_H diff --git a/src/lib/fastcgi.c b/src/lib/fastcgi.c index f4a2b2f..276a110 100644 --- a/src/lib/fastcgi.c +++ b/src/lib/fastcgi.c @@ -1,5 +1,5 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * FastCGI interface implementation * src/lib/fastcgi.c * Lorenz Stechauner, 2020-12-26 @@ -73,8 +73,8 @@ int fastcgi_init(fastcgi_conn *conn, int mode, unsigned int client_num, unsigned conn->socket = fcgi_sock; struct sockaddr_un sock_addr = {AF_UNIX}; - if (conn->mode == FASTCGI_NECRONDA) { - snprintf(sock_addr.sun_path, sizeof(sock_addr.sun_path) - 1, "%s", NECRONDA_BACKEND_SOCKET); + if (conn->mode == FASTCGI_SESIMOS) { + snprintf(sock_addr.sun_path, sizeof(sock_addr.sun_path) - 1, "%s", SESIMOS_BACKEND_SOCKET); } else if (conn->mode == FASTCGI_PHP) { snprintf(sock_addr.sun_path, sizeof(sock_addr.sun_path) - 1, "%s", PHP_FPM_SOCKET); } @@ -344,7 +344,7 @@ int fastcgi_header(fastcgi_conn *conn, http_res *res, char *err_msg) { free(content); return 1; } else if (header.type == FCGI_STDERR) { - // TODO implement Necronda backend error handling + // TODO implement Sesimos backend error handling if (conn->mode == FASTCGI_PHP) { err = err || fastcgi_php_error(conn, content, content_len, err_msg); } @@ -485,7 +485,7 @@ int fastcgi_send(fastcgi_conn *conn, sock *client, int flags) { return 0; } else if (header.type == FCGI_STDERR) { - // TODO implement Necronda backend error handling + // TODO implement Sesimos backend error handling if (conn->mode == FASTCGI_PHP) { fastcgi_php_error(conn, content, content_len, buf0); } @@ -571,7 +571,7 @@ int fastcgi_dump(fastcgi_conn *conn, char *buf, long len) { return 0; } else if (header.type == FCGI_STDERR) { - // TODO implement Necronda backend error handling + // TODO implement Sesimos backend error handling if (conn->mode == FASTCGI_PHP) { fastcgi_php_error(conn, content, content_len, buf0); } diff --git a/src/lib/fastcgi.h b/src/lib/fastcgi.h index 29008b5..c26e6c4 100644 --- a/src/lib/fastcgi.h +++ b/src/lib/fastcgi.h @@ -1,12 +1,12 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * FastCGI interface implementation (header file) * src/lib/fastcgi.h * Lorenz Stechauner, 2020-12-26 */ -#ifndef NECRONDA_SERVER_FASTCGI_H -#define NECRONDA_SERVER_FASTCGI_H +#ifndef SESIMOS_FASTCGI_H +#define SESIMOS_FASTCGI_H #include "include/fastcgi.h" #include "http.h" @@ -19,13 +19,13 @@ #define FASTCGI_COMPRESS_HOLD 8 #define FASTCGI_PHP 1 -#define FASTCGI_NECRONDA 2 +#define FASTCGI_SESIMOS 2 #ifndef PHP_FPM_SOCKET # define PHP_FPM_SOCKET "/var/run/php-fpm/php-fpm.sock" #endif -#define NECRONDA_BACKEND_SOCKET "/var/run/necronda/necronda-backend.sock" +#define SESIMOS_BACKEND_SOCKET "/var/run/sesimos/backend.sock" typedef struct { int mode; @@ -54,4 +54,4 @@ int fastcgi_dump(fastcgi_conn *conn, char *buf, long len); int fastcgi_receive(fastcgi_conn *conn, sock *client, unsigned long len); -#endif //NECRONDA_SERVER_FASTCGI_H +#endif //SESIMOS_FASTCGI_H diff --git a/src/lib/geoip.c b/src/lib/geoip.c index 80cb0c3..652d130 100644 --- a/src/lib/geoip.c +++ b/src/lib/geoip.c @@ -1,5 +1,5 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * MaxMind GeoIP Database interface * src/lib/geoip.c * Lorenz Stechauner, 2021-05-04 diff --git a/src/lib/geoip.h b/src/lib/geoip.h index eb000df..7ffc96e 100644 --- a/src/lib/geoip.h +++ b/src/lib/geoip.h @@ -1,13 +1,13 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * MaxMind GeoIP Database interface (header file) * src/lib/geoip.h * Lorenz Stechauner, 2021-05-04 */ -#ifndef NECRONDA_SERVER_GEOIP_H -#define NECRONDA_SERVER_GEOIP_H +#ifndef SESIMOS_GEOIP_H +#define SESIMOS_GEOIP_H #include <maxminddb.h> @@ -15,4 +15,4 @@ MMDB_entry_data_list_s *mmdb_json(MMDB_entry_data_list_s *list, char *str, long *str_off, long str_len); -#endif //NECRONDA_SERVER_GEOIP_H +#endif //SESIMOS_GEOIP_H diff --git a/src/lib/http.c b/src/lib/http.c index 4ccbc73..3445e10 100644 --- a/src/lib/http.c +++ b/src/lib/http.c @@ -1,5 +1,5 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * HTTP implementation * src/lib/http.c * Lorenz Stechauner, 2020-12-09 diff --git a/src/lib/http.h b/src/lib/http.h index d0e5589..3ae65c6 100644 --- a/src/lib/http.h +++ b/src/lib/http.h @@ -1,12 +1,12 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * HTTP implementation (header file) * src/lib/http.h * Lorenz Stechauner, 2020-12-09 */ -#ifndef NECRONDA_SERVER_HTTP_H -#define NECRONDA_SERVER_HTTP_H +#ifndef SESIMOS_HTTP_H +#define SESIMOS_HTTP_H #include "sock.h" @@ -39,11 +39,11 @@ #define HTTP_MAX_HEADER_FIELD_NUM 64 #ifndef SERVER_STR -# define SERVER_STR "Necronda" +# define SERVER_STR "Sesimos" #endif #ifndef SERVER_STR_HTML -# define SERVER_STR_HTML "Necronda web server" +# define SERVER_STR_HTML "Sesimos web server" #endif typedef struct { @@ -179,4 +179,4 @@ const http_doc_info *http_get_status_info(const http_status *status); int http_get_compression(const http_req *req, const http_res *res); -#endif //NECRONDA_SERVER_HTTP_H +#endif //SESIMOS_HTTP_H diff --git a/src/lib/http_static.c b/src/lib/http_static.c index 537d5bd..896fe6b 100644 --- a/src/lib/http_static.c +++ b/src/lib/http_static.c @@ -1,11 +1,11 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * HTTP static implementation * src/lib/http_static.c * Lorenz Stechauner, 2021-05-03 */ -#include "../necronda.h" +#include "../defs.h" #include "http.h" diff --git a/src/lib/include/fastcgi.h b/src/lib/include/fastcgi.h index 993ed3a..dad21e9 100644 --- a/src/lib/include/fastcgi.h +++ b/src/lib/include/fastcgi.h @@ -1,12 +1,12 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * FastCGI header file * src/lib/include/fastcgi.h * Lorenz Stechauner, 2021-05-03 */ -#ifndef NECRONDA_SERVER_EXTERN_FASTCGI_H -#define NECRONDA_SERVER_EXTERN_FASTCGI_H +#ifndef SESIMOS_EXTERN_FASTCGI_H +#define SESIMOS_EXTERN_FASTCGI_H /* * Listening socket file number @@ -119,4 +119,4 @@ typedef struct { FCGI_UnknownTypeBody body; } FCGI_UnknownTypeRecord; -#endif //NECRONDA_SERVER_EXTERN_FASTCGI_H +#endif //SESIMOS_EXTERN_FASTCGI_H diff --git a/src/lib/rev_proxy.c b/src/lib/rev_proxy.c index 8b64601..9ed7d89 100644 --- a/src/lib/rev_proxy.c +++ b/src/lib/rev_proxy.c @@ -1,11 +1,11 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * Reverse proxy * src/lib/rev_proxy.c * Lorenz Stechauner, 2021-01-07 */ -#include "../necronda.h" +#include "../defs.h" #include "../server.h" #include "rev_proxy.h" #include "utils.h" diff --git a/src/lib/rev_proxy.h b/src/lib/rev_proxy.h index fed4ead..521692d 100644 --- a/src/lib/rev_proxy.h +++ b/src/lib/rev_proxy.h @@ -1,12 +1,12 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * Reverse proxy (header file) * src/lib/rev_proxy.h * Lorenz Stechauner, 2021-01-07 */ -#ifndef NECRONDA_SERVER_REV_PROXY_H -#define NECRONDA_SERVER_REV_PROXY_H +#ifndef SESIMOS_REV_PROXY_H +#define SESIMOS_REV_PROXY_H #define REV_PROXY_CHUNKED 1 #define REV_PROXY_COMPRESS_GZ 2 @@ -35,4 +35,4 @@ int rev_proxy_send(sock *client, unsigned long len_to_send, int flags); int rev_proxy_dump(char *buf, long len); -#endif //NECRONDA_SERVER_REV_PROXY_H +#endif //SESIMOS_REV_PROXY_H diff --git a/src/lib/sock.c b/src/lib/sock.c index ba79cd5..850b0c1 100644 --- a/src/lib/sock.c +++ b/src/lib/sock.c @@ -1,5 +1,5 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * Basic TCP and TLS socket * src/lib/sock.c * Lorenz Stechauner, 2021-01-07 diff --git a/src/lib/sock.h b/src/lib/sock.h index ba89d6d..0fb4b5a 100644 --- a/src/lib/sock.h +++ b/src/lib/sock.h @@ -1,12 +1,12 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * Basic TCP and TLS socket (header file) * src/lib/sock.h * Lorenz Stechauner, 2021-01-07 */ -#ifndef NECRONDA_SERVER_SOCK_H -#define NECRONDA_SERVER_SOCK_H +#ifndef SESIMOS_SOCK_H +#define SESIMOS_SOCK_H #include <openssl/crypto.h> #include <sys/socket.h> @@ -44,4 +44,4 @@ int sock_poll_read(sock *sockets[], sock *readable[], int n_sock, int timeout_ms int sock_poll_write(sock *sockets[], sock *writable[], int n_sock, int timeout_ms); -#endif //NECRONDA_SERVER_SOCK_H +#endif //SESIMOS_SOCK_H diff --git a/src/lib/uri.c b/src/lib/uri.c index 1e5c10c..13e7c85 100644 --- a/src/lib/uri.c +++ b/src/lib/uri.c @@ -1,5 +1,5 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * URI and path handlers * src/lib/uri.c * Lorenz Stechauner, 2020-12-13 diff --git a/src/lib/uri.h b/src/lib/uri.h index 9a26329..102a107 100644 --- a/src/lib/uri.h +++ b/src/lib/uri.h @@ -1,12 +1,12 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * URI and path handlers (header file) * src/lib/uri.h * Lorenz Stechauner, 2020-12-13 */ -#ifndef NECRONDA_SERVER_URI_H -#define NECRONDA_SERVER_URI_H +#ifndef SESIMOS_URI_H +#define SESIMOS_URI_H #include <sys/stat.h> @@ -44,4 +44,4 @@ int uri_init_cache(http_uri *uri); void uri_free(http_uri *uri); -#endif //NECRONDA_SERVER_URI_H +#endif //SESIMOS_URI_H diff --git a/src/lib/utils.c b/src/lib/utils.c index dc29307..e2f8320 100644 --- a/src/lib/utils.c +++ b/src/lib/utils.c @@ -1,5 +1,5 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * Utilities * src/lib/utils.c * Lorenz Stechauner, 2020-12-03 diff --git a/src/lib/utils.h b/src/lib/utils.h index f6afa55..d9079cb 100644 --- a/src/lib/utils.h +++ b/src/lib/utils.h @@ -1,12 +1,12 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * Utilities (header file) * src/lib/utils.h * Lorenz Stechauner, 2020-12-03 */ -#ifndef NECRONDA_SERVER_UTILS_H -#define NECRONDA_SERVER_UTILS_H +#ifndef SESIMOS_UTILS_H +#define SESIMOS_UTILS_H #include <stdio.h> @@ -52,4 +52,4 @@ int str_trim_lws(char **start, char **end); int base64_encode(void *data, unsigned long data_len, char *output, unsigned long *output_len); -#endif //NECRONDA_SERVER_UTILS_H +#endif //SESIMOS_UTILS_H diff --git a/src/lib/websocket.c b/src/lib/websocket.c index 0bd3955..822f126 100644 --- a/src/lib/websocket.c +++ b/src/lib/websocket.c @@ -1,11 +1,11 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * WebSocket reverse proxy * src/lib/websocket.c * Lorenz Stechauner, 2022-08-16 */ -#include "../necronda.h" +#include "../defs.h" #include "websocket.h" #include "utils.h" diff --git a/src/lib/websocket.h b/src/lib/websocket.h index 250efce..a414525 100644 --- a/src/lib/websocket.h +++ b/src/lib/websocket.h @@ -1,12 +1,12 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * WebSocket reverse proxy (header file) * src/lib/websocket.h * Lorenz Stechauner, 2022-08-16 */ -#ifndef NECRONDA_SERVER_WEBSOCKET_H -#define NECRONDA_SERVER_WEBSOCKET_H +#ifndef SESIMOS_WEBSOCKET_H +#define SESIMOS_WEBSOCKET_H #include "sock.h" @@ -33,4 +33,4 @@ int ws_send_frame_header(sock *s, ws_frame *frame); int ws_handle_connection(sock *s1, sock *s2); -#endif // NECRONDA_SERVER_WEBSOCKET_H +#endif //SESIMOS_WEBSOCKET_H diff --git a/src/necronda.h b/src/necronda.h deleted file mode 100644 index 6ca8a7a..0000000 --- a/src/necronda.h +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Necronda Web Server - * Definitions - * src/necronda.h - * Lorenz Stechauner, 2021-05-04 - */ - -#ifndef NECRONDA_SERVER_NECRONDA_H -#define NECRONDA_SERVER_NECRONDA_H - -#define NECRONDA_VERSION "4.5" -#define SERVER_STR "Necronda/" NECRONDA_VERSION -#define SERVER_STR_HTML "Necronda web server " NECRONDA_VERSION - -#define CHUNK_SIZE 8192 - -#ifndef DEFAULT_HOST -# define DEFAULT_HOST "www.necronda.net" -#endif - -#ifndef SERVER_NAME -# define SERVER_NAME DEFAULT_HOST -#endif - -#endif //NECRONDA_SERVER_NECRONDA_H diff --git a/src/server.c b/src/server.c index 1f11dfa..667c2f4 100644 --- a/src/server.c +++ b/src/server.c @@ -1,13 +1,13 @@ /** - * Necronda Web Server + * Sesimos - secure, simple, modern web server * Main executable - * src/necronda-server.c + * src/server.c * Lorenz Stechauner, 2020-12-03 */ #define _POSIX_C_SOURCE 199309L -#include "necronda.h" +#include "defs.h" #include "server.h" #include "client.h" @@ -178,7 +178,7 @@ int main(int argc, const char *argv[]) { fprintf(stderr, ERR_STR "Unable to set stdout to line-buffered mode: %s" CLR_STR, strerror(errno)); return 1; } - printf("Necronda Web Server " NECRONDA_VERSION "\n"); + printf("Sesimos web server " SERVER_VERSION "\n"); ret = config_init(); if (ret != 0) { @@ -189,7 +189,7 @@ int main(int argc, const char *argv[]) { for (int i = 1; i < argc; i++) { const char *arg = argv[i]; if (strcmp(arg, "-h") == 0 || strcmp(arg, "--help") == 0) { - printf("Usage: necronda-server [-h] [-c <CONFIG-FILE>]\n" + printf("Usage: sesimos [-h] [-c <CONFIG-FILE>]\n" "\n" "Options:\n" " -c, --config <CONFIG-FILE> path to the config file. If not provided, default will be used\n" diff --git a/src/server.h b/src/server.h index 157ca03..2253a86 100644 --- a/src/server.h +++ b/src/server.h @@ -1,12 +1,12 @@ /** - * Necronda Web Server + * sesimos - secure, simple, modern web server * Main executable (header file) - * src/necronda-server.h + * src/server.h * Lorenz Stechauner, 2020-12-03 */ -#ifndef NECRONDA_SERVER_SERVER_H -#define NECRONDA_SERVER_SERVER_H +#ifndef SESIMOS_SERVER_H +#define SESIMOS_SERVER_H #include <sys/time.h> #include <maxminddb.h> @@ -30,4 +30,4 @@ extern char *log_client_prefix, *log_conn_prefix, *log_req_prefix, *client_geoip extern char *client_addr_str, *client_addr_str_ptr, *server_addr_str, *server_addr_str_ptr, *client_host_str; extern struct timeval client_timeout; -#endif //NECRONDA_SERVER_SERVER_H +#endif //SESIMOS_SERVER_H