Configurable docroot

This commit is contained in:
Jan-Piet Mens 2015-09-11 15:48:56 +02:00
parent 7388894539
commit 7910e2249c
4 changed files with 10 additions and 4 deletions

View File

@ -43,7 +43,7 @@ ifneq ($(APIKEY),)
CFLAGS += -DAPIKEY="\"$(APIKEY)\""
endif
CFLAGS += -DSTORAGEDEFAULT=\"$(STORAGEDEFAULT)\"
CFLAGS += -DSTORAGEDEFAULT=\"$(STORAGEDEFAULT)\" -DDOCROOT=\"$(DOCROOT)\"
@ -92,6 +92,8 @@ mdb/liblmdb.a:
install: ot-recorder ocat
mkdir -p $(BUILDROOT)$(INSTALLDIR)/{bin,sbin}
mkdir -p $(STORAGEDEFAULT)
mkdir -p $(BUILDROOT)$(STORAGEDEFAULT)
mkdir -p $(BUILDROOT)$(DOCROOT)
cp -R wdocs $(BUILDROOT)$(DOCROOT)/
install --mode 0755 ot-recorder $(BUILDROOT)$(INSTALLDIR)/sbin
install --mode 0755 ocat $(BUILDROOT)$(INSTALLDIR)/bin

View File

@ -15,6 +15,9 @@ HAVE_PING ?= yes
# exist and be writeable by recorder (and readable by ocat)
STORAGEDEFAULT = "/var/spool/owntracks/recorder/store"
# Where should the recorder find its document root (HTTP)?
DOCROOT = "/var/spool/owntracks/recorder/wdocs"
# Define the precision for reverse-geo lookups. The higher
# the number, the more granular reverse-geo will be:
#

1
ocat.c
View File

@ -169,6 +169,7 @@ void print_versioninfo()
printf("\tHAVE_PING = yes\n");
#endif
printf("\tSTORAGEDEFAULT = \"%s\"\n", STORAGEDEFAULT);
printf("\tDOCROOT = \"%s\"\n", DOCROOT);
printf("\tGHASHPREC = %d\n", GHASHPREC);
printf("\tDEFAULT_HISTORY_HOURS = %d\n", DEFAULT_HISTORY_HOURS);
printf("\tJSON_INDENT = \"%s\"\n", (JSON_INDENT) ? JSON_INDENT : "NULL");

View File

@ -704,7 +704,7 @@ void usage(char *prog)
#ifdef HAVE_HTTP
printf(" --http-host <host> HTTP addr to bind to (localhost)\n");
printf(" --http-port <port> -A HTTP port (8083)\n");
printf(" --doc-root <directory> document root (./wdocs)\n");
printf(" --doc-root <directory> document root (%s)\n", DOCROOT);
#endif
printf(" --precision ghash precision (dflt: %d)\n", GHASHPREC);
printf("\n");
@ -732,7 +732,7 @@ int main(int argc, char **argv)
UT_string *clientid;
#ifdef HAVE_HTTP
int http_port = 8083;
char *doc_root = "./wdocs";
char *doc_root = DOCROOT;
char *http_host = "localhost";
#endif
char *progname = *argv;