μlogger (ulogger) is a lifelogging tool for Android devices which provides a simple way to keep track of your daily activities. It allows you to log your location, calls, SMS, and other activities on your device. μlogger uses a server-client architecture, where the device with the app installed runs a client and sends the log data to a server for storage and analysis.
In this tutorial, we will guide you through the steps to install μlogger server on POP! OS latest.
Before starting, make sure you have the following prerequisites:
As usual, it is recommended to have the latest packages installed on your system before proceeding to any installation. To do this, run the following command:
sudo apt update && sudo apt upgrade -y
μlogger server is written in Python and requires some packages to be installed on your system. To install these dependencies, we will use the apt
package manager. Run this command:
sudo apt install -y python3 python3-dev python3-pip libpq-dev postgresql libcairo2 libcairo2-dev libjpeg-dev libtiff-dev libgif-dev libwebp-dev libopenjp2-7-dev liblcms2-dev liborc-0.4-dev libxml2-dev libxslt1-dev libffi-dev libssl-dev
μlogger requires a PostgreSQL database to store its data. To configure PostgreSQL, follow these steps:
Switch to the postgres user account:
sudo su - postgres
Start the PostgreSQL command prompt:
psql
Once you are inside the PostgreSQL console, create a new user for μlogger:
CREATE USER ulogger WITH PASSWORD 'password';
Replace 'password' with a strong password of your choice.
Create a new database and grant all privileges to the ulogger user:
CREATE DATABASE ulogger_db OWNER ulogger;
GRANT ALL PRIVILEGES ON DATABASE ulogger_db TO ulogger;
Exit the PostgreSQL console:
\q
Switch back to your user account:
exit
In this step, we will download the μlogger server source code from GitHub and configure it.
Create a new directory for μlogger:
mkdir ~/ulogger
Change to the new directory:
cd ~/ulogger
Clone the μlogger server repository:
git clone https://github.com/bfabiszewski/ulogger-server.git
Change to the server directory:
cd ulogger-server/server
Create a new virtual environment for the server:
python3 -m venv env
Activate the virtual environment:
source env/bin/activate
Install the required Python packages:
pip3 install --upgrade pip
pip3 install -r requirements.txt
Copy the configuration file:
cp ulogger_server/config_example.py ulogger_server/config.py
Edit the configuration file:
nano ulogger_server/config.py
Set the following parameters:
SQLALCHEMY_DATABASE_URI
: The connection string to the PostgreSQL database you created earlier.
SQLALCHEMY_DATABASE_URI = 'postgresql://ulogger:password@localhost:5432/ulogger_db'
Replace 'password' with the password you set for the ulogger user earlier.
SECRET_KEY
: A secret string that is used to secure the sessions and cookies. You can use a random string or generate one using a tool like this.
AUTH_ENABLED
: Set this variable to False to disable authentication. This is not recommended.
Create the database tables:
python3 manage.py db migrate
python3 manage.py db upgrade
Deactivate the virtual environment:
deactivate
In this step, we will start the μlogger server.
Change to the server directory:
cd ~/ulogger/ulogger-server/server
Activate the virtual environment:
source env/bin/activate
Start the server:
python3 manage.py runserver
If everything is configured correctly, you should see the following output:
* Serving Flask app "ulogger_server" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
Press CTRL+C
to stop the server.
Deactivate the virtual environment:
deactivate
By default, the μlogger server is running on http://127.0.0.1:5000
. If you want to access the server from other devices, you need to configure a reverse proxy.
Install Nginx:
sudo apt install -y nginx
Configure Nginx:
sudo nano /etc/nginx/sites-available/ulogger
Add the following configuration:
server {
listen 80;
server_name your_domain.com;
location / {
proxy_pass http://127.0.0.1:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Replace your_domain.com
with your domain name or IP address.
Remove the default Nginx site:
sudo rm /etc/nginx/sites-enabled/default
Enable the μlogger site:
sudo ln -s /etc/nginx/sites-available/ulogger /etc/nginx/sites-enabled/
Test the Nginx configuration:
sudo nginx -t
If the configuration is OK, restart Nginx:
sudo systemctl restart nginx
Now that everything is set up, you can access the μlogger web interface by browsing to your domain name or IP address in your web browser.
That's it! You have successfully installed and configured μlogger server on POP! OS latest. You can now begin tracking your daily activities using the μlogger app on your Android device.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!