opentracker-docker icon indicating copy to clipboard operation
opentracker-docker copied to clipboard

Unhandled error from config file

Open mirceaciu opened this issue 5 years ago • 3 comments

Any idea why it outputs this Unhandled line in config file: access.whitelist /etc/opentracker/whitelist.txt when after editing the conf file?

I've downloaded the git repo and uncommented the 37 line of the conf file access.whitelist /etc/opentracker/whitelist.txt. The image built without any issues but when I run it outputs that text. Container remains active, the file is present (checked with exec -it <cont> sh)

mirceaciu avatar Mar 03 '19 11:03 mirceaciu

It seems that I've made a mistake when creating this project.

To enable the blacklist or whitelist functionality the opentracker has to be build with modifications in the Makefile of the original project.

Therefore we must edit the Dockerfile beginning from L21:

&& git clone git://erdgeist.org/opentracker \
    && cd opentracker \
    && sed -i 's/#FEATURES+=-DWANT_ACCESSLIST_WHITE/FEATURES+=-DWANT_ACCESSLIST_WHITE/' Makefile \
    && make \

This will enable the whitelist functionality.

If you want to use the blacklist approach, you have to use following:

&& git clone git://erdgeist.org/opentracker \
    && cd opentracker \
    && sed -i 's/#FEATURES+=-DWANT_ACCESSLIST_BLACK/FEATURES+=-DWANT_ACCESSLIST_BLACK/' Makefile \
    && make \

Maybe I should restructure this project to use docker-compose with the services opentracker, opentracker_whitelist and opentracker_blacklist for ease of use.

Also I should reference the original codebase from erdgeist.org as a git submodule and trigger a travis build for the images to be build.

BTW: I'm open for PRs ;)

Lednerb avatar Mar 04 '19 14:03 Lednerb

I use this in my docker-compose.yml

  tracker:
    build:
      dockerfile: compose/opentracker/Dockerfile
      context: .
    ports:
      - 6969:6969
      - 6969:6969/udp
    volumes:
      - ~/api_file_server/opentracker:/etc/opentracker
    hostname: tracker
    container_name: tracker

And the Dockerfile now looks like this:

FROM alpine

WORKDIR /tmp

# All-in-One RUN for a very small image size (< 5 MB)
RUN apk add --no-cache \
	gcc \
	g++ \
	make \
	git \
	cvs \
	zlib-dev \
	&& cvs -d :pserver:[email protected]:/cvs -z9 co libowfat \
	&& cd libowfat \
	&& make \
	&& cd ../ \
	&& git clone git://erdgeist.org/opentracker \
		&& cd opentracker \
		&& sed -i 's/#FEATURES+=-DWANT_ACCESSLIST_WHITE/FEATURES+=-DWANT_ACCESSLIST_WHITE/' Makefile \
		&& make \
	&& mv /tmp/opentracker/opentracker /bin/ \
	&& apk del gcc g++ make git cvs zlib-dev \
	&& rm -rf /var/cache/apk/* /tmp/* 

COPY ./compose/opentracker/opentracker.conf /etc/opentracker/opentracker.conf
COPY ./compose/opentracker/whitelist.txt /etc/opentracker/whitelist.txt

EXPOSE 6969

CMD opentracker -f /etc/opentracker/opentracker.conf

I removed some of the whitespaces as docker would complain about them. I just built a new image, thanks for the reply.

p.s. I don't know much about the make process but I had to remove the space from +=- DWANT_AC to make it work. p.p.s maybe I will do a PR :D

mirceaciu avatar Mar 04 '19 18:03 mirceaciu

Thank you for your contribution! :+1:

The spaces were copy&paste errors, sorry for that. Fixed it in the original comment, too.


p.p.s maybe I will do a PR :D

That woulf be great!

Lednerb avatar Mar 05 '19 05:03 Lednerb