This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Nutritrace ====== [[https://github.com/TraceApps/nutritrace|Nutritrace]] ===== Installation ===== As usual, you need to create the **nutritrace** user: <code bash> useradd -d /data/daemons/nutritrace -m nutritrace </code> You will need also the proper folders setup: <code bash> mkdir /data/nutritrace mkdir /data/nutritrace/db mkdir /data/nutritrace/uploads chown nutritrace:nutritrace -R /data/nutritrace </code> Then, as user **nutritrace**, create the following docker compose yaml (see [[https://github.com/TraceApps/nutritrace#self-hosting-with-docker|here]]): <file - docker-compose.yml> services: nutritrace: image: ghcr.io/traceapps/nutritrace:latest container_name: nutritrace ports: - "3771:3001" volumes: - /data/nutritrace/db:/data/db - /data/nutritrace/uploads:/data/uploads environment: - DB_PATH=/data/db/nutritrace.db - UPLOADS_PATH=/data/uploads - JWT_SECRET=KjS1pf3uiZuX3AM/elCGIi5MvytkzOfZJW7LFUxi5O2hxczN8mfwpYaxQYjZMprK - SMTP_HOST= - SMTP_PORT= - SMTP_SECURE= - SMTP_USER= - SMTP_PASS= - SMTP_FROM= networks: - nutritrace-net networks: nutritrace-net: </file> Set a proper port (3771) for your needs, one that is free from all your other services. Double check the various volumes to point to your media collection properly. Populate the various SMTP variables if you want email invites, otherwise it will only produce invite links for new users. To generate the secret use: <code bash> openssl rand -base64 48 </code> Pull the images: <code bash> su - nutritrace podman compose pull </code> ===== Reverse Proxy ===== This is my recomended setup for NGINX: <file - nutritrace.conf> server { server_name nutri.mydomain.com; listen 8443 ssl; listen 443 ssl; access_log /var/log/nginx/nutri.mydomain.com_access_log main; error_log /var/log/nginx/nutri.mydomain.com_error_log info; location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_http_version 1.1; proxy_pass http://127.0.0.1:3771; proxy_redirect http:// https://; } include com.mydomain/certbot.conf; } </file> ===== Autostart ===== To start it, and set it up on boot, as usual follow my indications [[gentoo:containers|Using Containers on Gentoo]], so link the **user-containers** init script: <code> ln -s /etc/init.d/user-containers /etc/init.d/user-containers.nutritrace </code> and create the following config file: <file - /etc/conf.d/user-containers.nutritrace> USER=nutritrace DESCRIPTION="The nutritrace server" </file> Add the service to the default runlevel and start it now: <code bash> rc-update add user-containers.nutritrace default rc-service user-containers.nutritrace start </code> ===== Upgrade ===== Since it's using pdoman, stop the service then, as user **nutritrace**, run: <code bash> podman compose pull </code> and restart the service.