Compare commits

...

7 Commits

Author SHA1 Message Date
bert hubert 9eb0527eee remove scary error, update docs a bit 2022-09-05 17:08:46 +02:00
bert hubert 2a789cbdf3 spiff up readme 2022-09-05 16:54:30 +02:00
bert hubert 5da5775c1a tested the OSX instructions 2022-09-05 16:49:15 +02:00
bert hubert 7b646aadb0 document how to start terminal 2022-09-05 16:37:16 +02:00
bert hubert 96a1852db8 improve OSX instructions 2022-09-05 16:34:42 +02:00
bert hubert fa2079fca1 make us build in the right place 2022-09-05 16:25:00 +02:00
bert hubert a93aa69756 make it possible to run without a configuration file 2022-09-05 16:04:50 +02:00
4 changed files with 42 additions and 15 deletions

View File

@ -9,16 +9,7 @@ set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard to use")
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
#add_library(support STATIC ext/powerblog/h2o-pp.cc
# ext/powerblog/ext/simplesocket/swrappers.cc
# ext/powerblog/ext/simplesocket/comboaddress.cc
# ext/powerblog/ext/simplesocket/sclasses.cc
# ext/fmt-7.1.3/src/format.cc)
#target_include_directories(support PUBLIC ext/powerblog/ext/simplesocket ext/powerblog/ext ext/fmt-7.1.3/include/)
#target_link_libraries(support PUBLIC -lh2o-evloop -lssl -lcrypto Threads::Threads)
add_custom_target(Work ALL DEPENDS configs.hh)
add_executable(teller teller.cc ext/lpm.c)
target_link_libraries(teller -lpcaudio -lpthread)
@ -29,6 +20,9 @@ target_link_libraries(testrunner -lpcaudio)
enable_testing()
add_test(testname testrunner)
add_custom_command(
OUTPUT configs.hh
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/make-built-in-config.sh ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS teller.conf trackers.conf
)
enable_testing()
add_test(testname testrunner)

View File

@ -11,6 +11,26 @@ Demo video [in this tweet](https://twitter.com/bert_hu_bert/status/1561466204602
[Blog post with more videos](https://berthub.eu/articles/posts/tracker-beeper/)
## Installing on OSX:
If need be, install Homebrew via https://brew.sh/ as this will allow you to
compile new software. To do so, copy paste the instruction under 'Install
Homebrew' into the terminal app ([Apple
help](https://support.apple.com/guide/terminal/open-or-quit-terminal-apd5265185d-f365-44cb-8b09-71a064a42125/mac)). This might take quite a while.
It will also ask for your password.
Then run:
```
brew tap robertjakub/teller
brew install --HEAD googerteller
```
To then start the noise, enter:
```
sudo tcpdump -nql | teller
```
And it should work. For the last command, it may also again ask you to enter your
password.
## How to compile
This will currently only work on Unix derived systems (like Linux, OSX and
FreeBSD).

12
make-built-in-config.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
cd $1
(
echo \#pragma once
echo 'constexpr char tellertoml[]=R"('
cat teller.conf
echo ')";'
echo 'constexpr char trackerstoml[]=R"('
cat trackers.conf
echo ')";'
) > configs.hh

View File

@ -7,6 +7,7 @@
#include <pcaudiolib/audio.h>
#include "ext/toml.hpp"
#include "lpmwrapper.hh"
#include "configs.hh"
using namespace std;
@ -73,12 +74,12 @@ int main(int argc, char** argv)
{
trackertbl = toml::parse_file("trackers.conf");
conftbl = toml::parse_file("teller.conf");
// std::cout << tbl << "\n";
}
catch (const toml::parse_error& err)
{
std::cerr << "Parsing failed:\n" << err << "\n";
return 1;
std::cerr << "Could not read configuration files, using built-in defaults" <<endl;
trackertbl = toml::parse(trackerstoml);
conftbl = toml::parse(tellertoml);
}
map<string, TrackerConf> trackerdb;