GithubHelp home page GithubHelp logo

mainzelm / eblocker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eblocker/eblocker

0.0 1.0 0.0 8.29 MB

eBlocker's UI, REST and ICAP server

License: European Union Public License 1.2

Shell 1.33% Java 62.59% Perl 0.05% HTML 13.36% CSS 0.02% JavaScript 22.08% Ruby 0.01% SCSS 0.55%

eblocker's Introduction

eBlocker backend and UI

Prerequisites

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.

Dependencies

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

Build and test backend and frontend

cd $SRC
git clone https://github.com/eblocker/eblocker.git
cd eblocker
mvn test

Configure backend

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

Start Redis DB

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 backend

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/.

Miscellaneous

Create a new device

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.

Update lists

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/

Create SSL errors

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.

Reset local development environment

To reset the local development environment up to the point where the activation wizard appears:

  1. Stop the icapserver and the Redis server
  2. Remove the Redis DB $src/redis/dump.rdb
  3. Remove the file /opt/eblocker-icap/registration/registration.properties

eblocker's People

Contributors

bprinz avatar cakebomb999 avatar dependabot[bot] avatar eblosug avatar mainzelm avatar tomy-eb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.