You need Java 11, Maven and Redis.
In the following sections it is assumed that you install everything below a source directory, e.g.
export SRC=/home/user/src
However, some files must be installed unter /opt
.
Build projects:
- eblocker-top
- eblocker-crypto
- eblocker-registration-api
- netty-icap
- RestExpress
Clone each of the above projects from https://github.com/eblocker.
cd $SRC
git clone https://github.com/eblocker/eblocker-top.git
git clone https://github.com/eblocker/eblocker-crypto.git
git clone https://github.com/eblocker/eblocker-registration-api.git
git clone https://github.com/eblocker/netty-icap.git
git clone https://github.com/eblocker/RestExpress.git
In each project:
mvn install
cd $SRC
git clone https://github.com/eblocker/eblocker.git
cd eblocker
mvn test
Create these directories and make sure you can write to them:
mkdir /opt/eblocker-icap
mkdir /opt/eblocker-icap/conf
mkdir /opt/eblocker-icap/keys
mkdir /opt/eblocker-icap/network
mkdir /opt/eblocker-icap/registration
mkdir /opt/eblocker-icap/tmp
mkdir /opt/eblocker-network
mkdir /opt/eblocker-network/bin
mkdir /opt/eblocker-lists
mkdir /opt/eblocker-lists/lists
Create the following configuration file:
/opt/eblocker-icap/conf/configuration.properties
Content:
documentRoot=/home/user/src/eblocker/eblocker-ui/build
redis.snapshot.directory=/home/user/src/redis
# only if your network interface is not eth0:
network.interface.name=ethXYZ
# only necessary on macOS:
system.path.cpu.info=/home/user/src/eblocker/eblocker-icapserver/src/test/resources/test-data/cpuinfo.txt
Create the following shell script and make it executable:
/opt/eblocker-network/bin/script_wrapper
Content:
#!/bin/sh
exit 0
Create a directory for the redis DB and start the redis-server
process there:
mkdir $SRC/redis
cd $SRC/redis
redis-server
Set the key gateway
to your router's IP address, e.g.
redis-cli set gateway 192.168.1.1
Start class eblocker/eblocker-icapserver/src/main/java/org/eblocker/server/app/EblockerServerApp.java
from your IDE.
You can also start this class with Maven:
cd $SRC/eblocker/eblocker-icapserver
mvn exec:exec
Now you should be able to access the settings app at http://localhost:3000/.
Publish a new ARP_IN event:
redis-cli PUBLISH arp:in "2/a483e7511cef/172.20.10.8/a483e7511c88/172.20.10.5"
where the first IP is from your local subnet (the second IP does not matter). For even more devices, you need to change the MAC and the first IP.
Fork/clone eblocker-lists and run
mvn package -Pupdate-lists
After that, copy the result to your local installation:
rm -r /opt/eblocker-lists/lists
cp -r target/package/eblocker-lists/lists /opt/eblocker-lists/
You can use the following script to simulate the detection of an SSL error:
NOW=`date +"%Y/%m/%d %T"`
if [ -z "$1" ]
then
STAMP=`date +%Y-%m-%d-%H-%M-%S`
DOMAIN="$STAMP-autogen.com"
else
DOMAIN=$1
fi
/bin/echo "$NOW kid1| eblkr: 20:X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY log_addr: 172.20.10.6:57608 host: 169.50.46.74 sni: $DOMAIN cert: FOO" >> /var/log/squid/cache.log
Either pass a domain name as argument or let the script generate a name based on the current timestamp.
To reset the local development environment up to the point where the activation wizard appears:
- Stop the icapserver and the Redis server
- Remove the Redis DB
$src/redis/dump.rdb
- Remove the file
/opt/eblocker-icap/registration/registration.properties