Rename Necronda server to Sesimos

This commit is contained in:
2022-08-18 14:17:12 +02:00
parent f361fce561
commit 2b4569aabe
32 changed files with 134 additions and 134 deletions

View File

@ -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);

View File

@ -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

View File

@ -1,5 +1,5 @@
/**
* Necronda Web Server
* sesimos - secure, simple, modern web server
* Compression interface
* src/lib/compress.c
* Lorenz Stechauner, 2021-05-05

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,5 +1,5 @@
/**
* Necronda Web Server
* sesimos - secure, simple, modern web server
* HTTP implementation
* src/lib/http.c
* Lorenz Stechauner, 2020-12-09

View File

@ -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&nbsp;web&nbsp;server"
# define SERVER_STR_HTML "Sesimos&nbsp;web&nbsp;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

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,5 +1,5 @@
/**
* Necronda Web Server
* sesimos - secure, simple, modern web server
* Utilities
* src/lib/utils.c
* Lorenz Stechauner, 2020-12-03

View File

@ -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

View File

@ -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"

View File

@ -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