User Tools

This is an old revision of the document!


LubeLogger

LubeLogger is an aSelf-Hosted, Open-Source, Unconventionally-Named Vehicle Maintenance Records and Fuel Mileage Tracker for your cars and vehicles.

Installation

Create a standard user to host the LubeLogger installation, then create a folder under /data/lubelogger to store the needed persistent data:

useradd -d /data/daemons/lubelogger -m lubelogger 
mkdir /data/lubelogger
chown lubelogger:lubelogger /data/lubelogger

Now, create the following docker-compose.yml as user lubelogger:

docker-compose.yml
---
version: "3.4"

services:
  app:
    image: ghcr.io/hargata/lubelogger:latest
    build: .
    environment:
      - LC_ALL=it_IT.UTF-8 # this will affect how numbers, currencies, and dates are formatted.
      - LANG=it_IT.UTF-8   # Same as above. 
#      - EnableAuth=false
    volumes:
      - /data/lubelogger/config:/App/config
      - /data/lubelogger/data:/App/data
      - /data/lubelogger/translations:/App/wwwroot/translations
      - /data/lubelogger/documents:/App/wwwroot/documents
      - /data/lubelogger/images:/App/wwwroot/images
      - /data/lubelogger/temp:/App/wwwroot/temp
      - /data/lubelogger/log:/App/log
      - /data/lubelogger/keys:/root/.aspnet/DataProtection-Keys
    ports:
      - 8485:8080

    networks:
      - lubelogger-net

networks:
  lubelogger-net: {}

Choose an available port, of course!

Now pull it:

podman compose pull

Authentication

Unfortunately, while it is possible to disable authentication, it will not work with SSO, so you cannot disable authentication and then have a simple SSO layer on top of it. This is quite annoying. I have opened a ticket on this here.

Enabling LubeLogger authentication is a bit of a mess. First of all, it starts with authentication disabled. As stated here you need to go to settings and enable authentication in order to create a root user and setup a password. Also note that to add users you must setup an email provider and have LubeLogger send out a token to the new user email address. Very annoying.

To setup the SSO (spoiler: i didnt managed to make it work), you need to setup the following environments in your docker compose:

MailConfig__EmailServer="" <- Email SMTP settings used only for configuring multiple users(to send their registration token and forgot password tokens)
MailConfig__EmailFrom="" <- Same as above.
MailConfig__Port=587 <- Same as above.
MailConfig__Username="" <- Same as above.
MailConfig__Password="" <- Same as above.
OpenIDConfig__Name=Authelia
OpenIDConfig__ClientId=lube
OpenIDConfig__ClientSecret=client-secret-string
OpenIDConfig__AuthURL=Authorization URL to the Provider's Login Page
OpenIDConfig__TokenURL=URL to retrieve user JWT from the Provider
OpenIDConfig__RedirectURL=https://lubelogger.mydomain.com/Login/RemoteAuth
OpenIDConfig__Scope="openid email"
OpenIDConfig__ValidateState=true/false(default: false) - whether LubeLogger should validate state.
OpenIDConfig__UsePKCE=true/false(default: false) - whether LubeLogger should use PKCE

My specific Authelia client setting is:

      - client_id: 'lube'
        client_name: 'LubeLogger'
        client_secret: 'client-secret-string'
        public: false
        authorization_policy: 'one_factor'
        pre_configured_consent_duration: 1M
        scopes:
          - openid
          - email
          - profile
        grant_types:
          - 'authorization_code'
        redirect_uris:
          - https://lubelogger.mydomain.com/Login/RemoteAuth
        userinfo_signed_response_alg: none
        token_endpoint_auth_method: 'client_secret_post'

I suggest you also setup email notification by creating a dedicated email address for LubeLogger to send out emails or you will not be able to add users.

I gave up, so far, to make this work and i just enabled LubeLogger authentication, without the SSO support.

Reverse Proxy

Running LubeLogger behind NGINX is easy, but it cannot be hosted (at the moment, see here) on a sub-path, so a sub-domain it must be. I assume you will host it under https://lubelogger.mydomain.com:

lubelogger.conf
server {
        server_name lubelogger.mydomain.com;
        listen 443 ssl; 
        listen 8443 ssl; 

        access_log /var/log/nginx/lubelogger.mydomain.com_access_log main;
        error_log /var/log/nginx/lubelogger.mydomain.com_error_log info;

         location / {
                proxy_pass http://127.0.0.1:8485;
                client_max_body_size               50000M;
                proxy_set_header Host              $http_host;
                proxy_set_header X-Real-IP         $remote_addr;
                proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header   Upgrade    $http_upgrade;
                proxy_set_header   Connection "upgrade";
    }
}

Running

To start it, and set it up on boot, as usual follow my indications Using Containers on Gentoo, so link the user-containers init script:

ln -s /etc/init.d/user-containers /etc/init.d/user-containers.lubelogger

and create the following config file:

/etc/conf.d/user-containers.lubelogger
USER=grist
DESCRIPTION="Track your can maintenance"

Add the service to the default runlevel and start it now:

rc-update add user-containers.lubelogger default
rc-service user-containers.lubelogger start

This website uses technical cookies only. No information is shared with anybody or used in any way but provide the website in your browser.

More information