Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.
/ lifelogspd Public archive

LifelogSPDaemon - Data collection/editor.

License

Notifications You must be signed in to change notification settings

spech66/lifelogspd

Repository files navigation

lifelogspd

=> Version 2.0 at LifelogBB.

Go Report Card GoDoc

LifelogSPDaemon - Journal, weight, Strength training and endurance training tracker.

This daemon is intend for use in a local network. For securing the access use a proxy like nginx (see below)!

Status

  • Weight: ✔️
  • Weight chart: ✔️
  • Journal: ✔️
  • Strength training: ✔️
  • Strength training chart: ✔️
  • Endurance workout: ✔️
  • Endurance workout chart: ✔️

Selfhost with docker

  $ git clone https://github.com/spech66/lifelogspd
  $ cd lifelogspd 
  $ docker build . -t lifelogspd
  $ docker run -p 8066:8066 -v `pwd`/data:/app/data `pwd`/example.config.json:/app/config.json lifelogspd

Screenshots

Start Weight Weight Graph Strength training Endurance workout Journal

More screenshots

Build and run from source

Make sure you have the Go Programming Language tools set up an ready.

Linux

Checkout the code to your GOPATH directory, build the server and run it.

go get github.com/spech66/lifelogspd
cd $GOPATH/src/github.com/spech66/lifelogspd
go build
./lifelogspd -config example.config.json

Windows

Checkout the code to your GOPATH directory.

go get github.com/spech66/lifelogspd
cd %GOPATH%\src\github.com\spech66\lifelogspd
go build
lifelogspd.exe -config example.config.json

nginx reverse proxy with basic auth

This daemon is intend for use in a local network. Make sure that the server port (default 8066) is not exposed to the internet. In case you want to host this deamon in the internet set up nginx as a revery proxy for it using basic authentication.

sudo sh -c "echo -n 'admin:' >> /etc/nginx/.htpasswd"
sudo sh -c "openssl passwd -apr1 >> /etc/nginx/.htpasswd"
sudo vi /etc/nginx/sites-enabled/default
server {
        listen 8666;
        server_name _;
        auth_basic "LifelogSPDaemon";
        auth_basic_user_file /etc/nginx/.htpasswd;

        location / {
                proxy_pass http://localhost:8066;
        }
}

Linux (systemd) Service

Create service file at /etc/systemd/system/lifelog.service. Start with systemctl start lifelog. Autostart on boot with systemctl enable lifelog.

[Unit]
Description=LifelogSPDeamon
After=network.target

[Service]
Type=simple
ExecStart=/root/go/src/github.com/spech66/lifelogspd/lifelogspd -bind localhost:8066 -config /root/lifelogspd/config.json
Restart=always
# Consider creating a dedicated user here:
User=root
#Environment=
WorkingDirectory=/root/go/src/github.com/spech66/lifelogspd/

[Install]
WantedBy=multi-user.target

Dependencies

Development

  • Update Modules: go mod tidy
  • Run: go run . -config example.config.json