Show pageBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== OwnTracks ====== ===== Installation ===== $ curl http://repo.owntracks.org/repo.owntracks.org.gpg.key | sudo apt-key add - $ echo "deb http://repo.owntracks.org/debian stretch main" | sudo tee /etc/apt/sources.list.d/owntracks.list > /dev/null $ sudo apt-get update $ sudo apt-get install build-essential linux-headers-$(uname -r) libcurl4-openssl-dev libmosquitto-dev liblua5.2-dev libsodium-dev libconfig-dev $ sudo apt-get install ot-recorder mosquitto $ ot-recorder 'owntracks/#' --http-host 0.0.0.0 $ sudo install -m444 /usr/share/doc/ot-recorder/ot-recorder.service /etc/systemd/system/ot-recorder.service ==== Mosquitto ==== $ sudo /etc/init.d/mosquitto start # /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf ===== Nginx ===== server { listen 80; server_name localhost; location / { root html; index index.html index.htm; } # Proxy and upgrade WebSocket connection location /owntracks/ws { rewrite ^/owntracks/(.*) /$1 break; # proxy_pass http://127.0.0.1:8083; proxy_pass http://localhost:8083; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location /owntracks/ { proxy_pass http://127.0.0.1:8083/; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; } # OwnTracks Recorder Views location /owntracks/view/ { proxy_buffering off; # Chrome proxy_pass http://127.0.0.1:8083/view/; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_f$ proxy_set_header X-Real-IP $remote_addr; } location /owntracks/static/ { proxy_pass http://127.0.0.1:8083/static/; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_f$ proxy_set_header X-Real-IP $remote_addr; } # HTTP Mode location /owntracks/pub { auth_basic "OwnTracks pub"; auth_basic_user_file /usr/local/etc/nginx/owntracks.htpasswd; proxy_pass http://127.0.0.1:8083/pub; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_fo$ proxy_set_header X-Real-IP $remote_addr; # Optionally force Recorder to use username from Basic # authentication user. Whether or not client sets # X-Limit-U and/or uses ?u= parameter, the user will # be set to $remote_user. proxy_set_header X-Limit-U $remote_user; } } ===== Restricting Access ===== $ sudo apt-get install apache2-utils $ sudo htpasswd -c /etc/nginx/.htpasswd user1 $ sudo htpasswd /etc/nginx/.htpasswd user2 $ cat /etc/nginx/.htpasswd # user1:$apr1$... # user2:$apr1$... < /etc/nginx/sites-available/sample > server { ... auth_basic "Admin"; auth_basic_user_file /etc/nginx/.htpasswd; } selfhosted/owntracks.txt Last modified: 2023/07/03 01:49by hli