Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

TeslaMate [megathread]

This site may earn commission on affiliate links.
@Durzel - do you know what version of Debian you are running? I have managed to get this working fine for v9, but for 10 the lets encrypt just doesn't work! -

@davidmc @simon.c - be interested to see if the below works for you?

This is what I did to make it work on v9

Create your free tier GCP instance:
Create Micro instance, enabling http and https (tick boxes) Debian 9, disk size 30gb: How to set up a free micro VPS on Google Cloud Platform

Setting up subdomains:
Create two subdomains for your domain (teslamate + grafana) and point the A NAME records to your public IP of the Micro VM

Wait for the DNS to propagate:
After creating the ANAME records, you will need to wait until the DNS has propagated, you can test this by pinging teslamate.YOURDOMAIN, when it comes back with the GCP IP you've put in, you're good to proceed.

Docker install
Open SSH (browser is fine from the VM screen)
Run the following commands;
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg2
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] Index of linux/debian/ $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce
sudo usermod -aG docker $USER

Docker compose install
sudo curl -L https://github.com/docker/compose/releases/download/1.26.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Now follow the instructions on TeslaMate: Advanced install with Traefik, Let's Encrypt & HTTP Basic Auth | TeslaMate

Launch with sudo docker-compose up

Once you've confirmed it works without errors, you can Ctrl+C to quit the compose session and restart it with docker-compose up -d
got to this bit and have a question:
Setting up subdomains:
Create two subdomains for your domain (teslamate + grafana) and point the A NAME records to your public IP of the Micro VM

I have created a domain name (www.ionos.co.uk) for £1 for a year, then it allows me to setup sub domains to which i now have 2. 1 for grafana & the other is teslamate.

I have my external ip from google and setup the VM instance (not ssh'd in yet).

where do i put the ip? im assuming i setup a CNAME (under the DNS option) against each (grafana & teslamate) and input the ip in there? options shown below:

DESTINATION OPTIONS

ion1.JPG


DNS ADD OPTIONS

ion2.JPG


CNAME shows this

ion3.JPG
 
got to this bit and have a question:
Setting up subdomains:
Create two subdomains for your domain (teslamate + grafana) and point the A NAME records to your public IP of the Micro VM

I have created a domain name (www.ionos.co.uk) for £1 for a year, then it allows me to setup sub domains to which i now have 2. 1 for grafana & the other is teslamate.

I have my external ip from google and setup the VM instance (not ssh'd in yet).

where do i put the ip? im assuming i setup a CNAME (under the DNS option) against each (grafana & teslamate) and input the ip in there? options shown below:

DESTINATION OPTIONS

View attachment 559527

DNS ADD OPTIONS

View attachment 559528

CNAME shows this

View attachment 559529

You want A, rather than CNAME
 
  • Like
Reactions: davidmc
@DaveW

I type this command:
sudo add-apt-repository "deb [arch=amd64] Index of linux/debian/ $(lsb_release -cs) stable"

Get this output when i run:

sudo apt update
E: Malformed entry 7 in list file /etc/apt/sources.list (URI parse)
E: The list of sources could not be read.

am i mistyping something?

before the first command above i type:

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

And get a response:
OK
 
Arrghh - The auto URL formatting on here has borked it!

Code:
Open SSH (browser is fine from the VM screen)
Run the following commands;
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg2
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce
sudo usermod -aG docker $USER

Should be the above @davidmc
 
  • Like
Reactions: Durzel and davidmc
Arrghh - The auto URL formatting on here has borked it!

Code:
Open SSH (browser is fine from the VM screen)
Run the following commands;
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg2
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce
sudo usermod -aG docker $USER

Should be the above @davidmc
Thx for this. will have a go :)
 
Arrghh - The auto URL formatting on here has borked it!

Code:
Open SSH (browser is fine from the VM screen)
Run the following commands;
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg2
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce
sudo usermod -aG docker $USER

Should be the above @davidmc
Above worked.

Got to the create docker-compose.yml

did the following:

nano docker-compose

entered the docker-compose.yml text, exit and saved

How to you then create the next 2? .env & .htpasswd

sorry being dumb here
 
@davidmc

Hopefully it was nano docker-compose.yml (just to make sure!)

Same thing for .env and .htpasswd

So;

nano .env

Put details in

nano .htpasswd

Put generated .htpasswd text in, use the link from the TeslaMate instructions :)
lol i just realised after i posted!!

did all and now get this

dm@tesladata:~$ docker-compose up

ERROR: Can't find a suitable configuration file in this directory or any parent. Are you in the right directory?
Supported filenames: docker-compose.yml, docker-compose.yaml

also the password generator, what details do you need to add in? or is in any and also what mode?

Thx @DaveW :D
 
Hold your horses there @davidmc on trying to run it if you haven't generated any content in the .htpasswd file - especially given you've pasted your domain in here :)

Htpasswd Generator – Create htpasswd - HostingCanada.org

Username and password on the form, SHA1 should be fine, it then generates an output of your username plus a hashed password, copy that line into the .htpasswd file

ls in the directory you are in and make sure the docker-compose file is actually docker-compose.yml (on your above text you missed off the .yml)
 
Hold your horses there @davidmc on trying to run it if you haven't generated any content in the .htpasswd file - especially given you've pasted your domain in here :)

Htpasswd Generator – Create htpasswd - HostingCanada.org

Username and password on the form, SHA1 should be fine, it then generates an output of your username plus a hashed password, copy that line into the .htpasswd file

ls in the directory you are in and make sure the docker-compose file is actually docker-compose.yml (on your above text you missed off the .yml)
what the dm@teslamate? luckily thats not it :p (i did change that bit before i posted
 
I misread the ionos URL thinking it was yours :)

Let me know how the above works, hopefully you'll be sorted soon.

I've got another guide to write now, how to get this monitored to make sure that the site is up and you are logged in (again, for free) :cool:
Its doing it thing :) loads of script happening

Also when it loads its asking for the login name and password at the screen below. im assuming its mine!:

d422ihk-99ecd1ae-e112-47c4-a68c-d8f17d4b0ebd.jpg
 
lol i just realised after i posted!!

did all and now get this

dm@tesladata:~$ docker-compose up

ERROR: Can't find a suitable configuration file in this directory or any parent. Are you in the right directory?
Supported filenames: docker-compose.yml, docker-compose.yaml

also the password generator, what details do you need to add in? or is in any and also what mode?

Thx @DaveW :D
That's because you need to restart the ssh instance after entering "sudo usermod -aG docker $USER" in order for docker to run without sudo, but I expect you ended up doing that later anyway if you managed to get it running. I'll give this one more go in a bit and see how I get on.
 
hmm

it asked for User name and pw first time (pop up box), and for some reason i got that wrong (forgot what i put in!).

reset pw in the HTpasswd site and file and now it says:

404 page not found :/

looking at the docker-compose up

i see this error:

proxy_1 | time="2020-07-02T14:09:06Z" level=error msg="error parsing BasicUser: teslamate:dm:{SHA}weirdpasswordhere" entryPointName=websecure routerName=teslamate@docker