From cdfdcfe2c98d1abea9bc87f8fccae0e1b3c47b3e Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 29 Apr 2023 22:25:21 +0200 Subject: add a default SQLite database path --- Dockerfile | 2 +- src/const.h | 1 + src/server_main.c | 7 +------ 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index b72f6a9..995f4a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,4 +35,4 @@ ENV PATH="$install_dir/bin:${PATH}" WORKDIR "$install_dir/bin" ENTRYPOINT ["/sbin/tini", "--"] -CMD ["cimple-server", "--sqlite", "/var/lib/cimple/cimple.sqlite"] +CMD ["cimple-server"] diff --git a/src/const.h b/src/const.h index f5a2b99..c762dbe 100644 --- a/src/const.h +++ b/src/const.h @@ -12,6 +12,7 @@ #define DEFAULT_HOST "127.0.0.1" #endif #define DEFAULT_PORT "5556" +#define DEFAULT_SQLITE_PATH "/var/lib/cimple/cimple.sqlite" #define CMD_CI_RUN "run" #define CMD_NEW_WORKER "new-worker" diff --git a/src/server_main.c b/src/server_main.c index cdd73b3..332ae17 100644 --- a/src/server_main.c +++ b/src/server_main.c @@ -13,7 +13,7 @@ static struct settings default_settings() { - struct settings settings = {DEFAULT_PORT, NULL}; + struct settings settings = {DEFAULT_PORT, DEFAULT_SQLITE_PATH}; return settings; } @@ -56,11 +56,6 @@ static int parse_settings(struct settings *settings, int argc, char *argv[]) } } - if (!settings->sqlite_path) { - exit_with_usage_err("must specify the path to a SQLite database"); - return -1; - } - return 0; } -- cgit v1.2.3