A small project to gather internet-stats from a fritz-box
The .env.template
file acts as a template for the needed .env
file.
Because of some current limitations you have to copy that file to all underlying components to be able to use the values that are set up there.
The scripts are written in Python 3, so you have to install Python v3.
To prepare your environment, run the following from the ./src/scripts/
directory:
pip install --no-cache-dir -r requirements.txt
To run it, run the following from the ./src/scripts/
directory:
python exec.py
As exec.py
kinda acts like a chron-job that runs every morning at 3 AM, to debug, you'd have to change the interval when the underlying script is called.
Alternatively you can also run the underlying script directly, by runnin the following from the ./src/scripts/
directory:
python -c 'import fritzy; fritzy.execute()'
The server portion is written using NodeJS version 18, so you have to install NodeJS v18 or later.
To prepare your environment, run the following from the ./src/server/
directory:
npm install
To run the server locally, you simply have to run the following from the ./src/server/
:
node server.js
The website is simply written in vanilla JavaScript, HTML and CSS. So to run it, you simply have to open the ./src/website/index.html
file in your favourite browser.
To host the website in a docker-container NGINX is used.
To setup your fritz-box and fritzy to enable gathering data from the web, you have to do the following:
- Enable "MyFRITZ!" and create an account under
https://fritz.box/#mfSet
(Internet -> MyFRTIZ! Account) - Enable internet-access for that account and choose which users can access your fritz-box from the internet
- For this you can optionally create a new user under
https://fritz.box/#user
(System -> FRITZ!Box Users). The user has to have all permissions enabled (except for "Access to NAS contents" and "VPN") and needs to be allowed to connect from the internet - Under
https://fritz.box/#mfSet
(Internet -> MyFRTIZ! Account) you should also enable "Internet access to the FRITZ!Box via HTTPS enabled" - To connect to your fritz-box you can now use the address presented under "MyFRITZ! internet access". This is the address you have to use in your
.env
inFRITZ_BASE_URL
- If you created a separate user for the internet-access you have to place that user-name and password in your
.env
underFRITZ_USER
andFRITZ_PASSWORD
- Other values in your
.env
don't need to be changed, so you're good to go. Enjoy! 🚀
first you have to rename .env.template
to .env
and enter the values that fit your needs.
to run you simply have to use docker-compose
like so:
docker compose -f ./src/docker-compose.yml up --build -d
to stop the docker-containers simply use:
docker compose -f ./src/docker-compose.yml stop
and to remove the docker-containers entirely use:
docker compose -f ./src/docker-compose.yml down