mirror of
https://github.com/owntracks/recorder.git
synced 2026-05-05 02:36:45 +00:00
new recorder option --norec
This commit is contained in:
@@ -284,6 +284,11 @@ Note in particular the `--hosted` option: you specify neither a host name or a p
|
||||
|
||||
When the recorder has received a publish or two, visit it with your favorite Web browser by pointing your browser at `http://127.0.0.1:8083`.
|
||||
|
||||
### Recorder options
|
||||
|
||||
`--norec` disables writing of REC files, so no location history or other similar publishes are stored, and the Lua `otr_putrec()` function is not invoked even if it exists. What is stored are CARDS and PHOTOS, as well as the LAST location of a device. As such, the API's `/locations` endpoint becomes useless.
|
||||
|
||||
|
||||
## Design decisions
|
||||
|
||||
We took a number of decisions for the design of the recorder and its utilities:
|
||||
|
||||
@@ -306,6 +306,9 @@ static void putrec(struct udata *ud, time_t now, UT_string *reltopic, UT_string
|
||||
FILE *fp;
|
||||
int rc = 0;
|
||||
|
||||
if (ud->norec)
|
||||
return;
|
||||
|
||||
#ifdef WITH_LUA
|
||||
rc = hooks_norec(ud, UB(username), UB(device), string);
|
||||
#endif
|
||||
@@ -1002,6 +1005,7 @@ void usage(char *prog)
|
||||
#endif
|
||||
printf(" --precision ghash precision (dflt: %d)\n", GHASHPREC);
|
||||
printf(" --hosted use OwnTracks Hosted\n");
|
||||
printf(" --norec don't maintain REC files\n");
|
||||
printf("\n");
|
||||
printf("Options override these environment variables:\n");
|
||||
printf(" $OTR_HOST MQTT hostname\n");
|
||||
@@ -1045,6 +1049,7 @@ int main(int argc, char **argv)
|
||||
udata.skipdemo = TRUE;
|
||||
udata.revgeo = TRUE;
|
||||
udata.verbose = TRUE;
|
||||
udata.norec = FALSE;
|
||||
#ifdef WITH_LMDB
|
||||
udata.gc = NULL;
|
||||
udata.t2t = NULL; /* Topic to TID */
|
||||
@@ -1100,6 +1105,7 @@ int main(int argc, char **argv)
|
||||
{ "quiet", no_argument, 0, 8},
|
||||
{ "initialize", no_argument, 0, 9},
|
||||
{ "label", required_argument, 0, 10},
|
||||
{ "norec", no_argument, 0, 11},
|
||||
#ifdef WITH_LUA
|
||||
{ "lua-script", required_argument, 0, 7},
|
||||
#endif
|
||||
@@ -1117,6 +1123,9 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
|
||||
switch (ch) {
|
||||
case 11:
|
||||
udata.norec = TRUE;
|
||||
break;
|
||||
case 10:
|
||||
free(udata.label);
|
||||
udata.label = strdup(optarg);
|
||||
|
||||
1
udata.h
1
udata.h
@@ -19,6 +19,7 @@ struct udata {
|
||||
int revgeo; /* True (default) if we should do reverse Geo lookups */
|
||||
int qos; /* Subscribe QoS */
|
||||
int verbose; /* TRUE if print verbose messages to stdout */
|
||||
int norec; /* If TRUE, no .REC files are written to */
|
||||
#ifdef WITH_LMDB
|
||||
struct gcache *gc;
|
||||
struct gcache *t2t; /* topic to tid */
|
||||
|
||||
Reference in New Issue
Block a user