Skip to content

Commit

Permalink
Merge branch 'teslamate-org:master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
t3hk0d3 authored Nov 27, 2023
2 parents 9e8e393 + 21f0ecc commit 07ba9c8
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 32 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/buildx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Buildx
uses: ./.github/actions/build
with:
is_dockerhub_pushed: '1'
is_dockerhub_pushed: "1"
docker_password: ${{ secrets.DOCKER_PASSWORD }}
repository_owner: ${{ github.repository_owner }}
repository: ${{ github.repository }}
Expand Down Expand Up @@ -75,6 +75,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: teslamate
password: ${{ secrets.DOCKER_PASSWORD }}

- uses: ./.github/actions/grafana
with:
tags: |
Expand Down
22 changes: 17 additions & 5 deletions .github/workflows/ghcr_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ on:
paths:
- "**/*"
- "!.github/**"
branches: ["ci"]
pull_request_target:
branches: ["master"]
branches: ["master", "ci"]
paths:
- "**/*"
- "!.github/**" # Important: Exclude PRs related to .github from auto-run
Expand Down Expand Up @@ -39,8 +40,14 @@ jobs:
runs-on: ${{ matrix.runs_on }}
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request_target' }}
- uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request_target' }}
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

- name: Buildx
uses: ./.github/actions/build
with:
Expand Down Expand Up @@ -76,8 +83,13 @@ jobs:
grafana:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request_target' }}
- uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request_target' }}
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

- name: Login to GitHub Container Registry
uses: docker/[email protected]
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/ghcr_purge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ permissions:
packages: write

jobs:
purge-pr-untagged:
name: Delete untagged images from ghcr.io
purge-pr-package:
name: Delete images from ghcr.io when PR is closed
runs-on: ubuntu-latest

steps:
- uses: chipkent/[email protected]
id: cleanup
continue-on-error: true
with:
package-name: ${{ github.event.repository.name }}
tag: pr-${{ github.event.pull_request.number }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/delete-package-versions@v4
if: job.steps.cleanup.status == success()
name: Delete untagged images from ghcr.io
continue-on-error: true
with:
package-name: "teslamate"
package-type: "container"
min-versions-to-keep: 0
delete-only-untagged-versions: "true"
token: ${{ secrets.GITHUB_TOKEN }}

purge-pr-package:
name: Delete image from ghcr.io
runs-on: ubuntu-latest

steps:
- uses: chipkent/[email protected]
with:
package-name: ${{ github.event.repository.name }}
tag: pr-${{ github.event.pull_request.number }}
github-token: ${{ secrets.GITHUB_TOKEN }}
44 changes: 42 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,54 @@

## [unreleased]

### New features

### Improvements and bug fixes

- grafana: support DATABASE_SSL_MODE (#3498 - @simonsmh)
- Support server_name_indication for ssl (#3497 - @simonsmh)
- grafana: Fix Dashboard dropdown link display (#3501 - @oivindoh)
- Ci: GHCR Purge success even if package doesn't exist (#3480 - @jlestel and #3504 - @JakobLichterfeld)

#### Dashboards

#### Translations

#### Documentation

## [1.28.1] - 2023-11-26

### New features

### Improvements and bug fixes

- Fix display version in settings

#### Dashboards

#### Translations

#### Documentation

## [1.28.0] - 2023-11-26

Note: First release as @teslamate-org organization.

### New features

- Added tire low pressure icon to teslamate web (#3424 - @NirKli)
- Add charging_state to VehicleSummary (#3471 - @brianmay)

### Improvements and bug fixes

- UI: sync meta theme-color with header background color for iOS status bar (#2840 - @libotony)
- Linting in dashboard links (#3443 - @jlestel)
- Update Grafana to 10.1.2 (#3455 - @swiffer)
- CI: Build PR images on GHCR, so every PR will have a dedicated dockerfile for testing purpose (#3445, #3480, #3481, #3491 -@jlestel)
- Update to Nodejs 20 (#3477 - @PhilThurston)
- Add credo lint support for static code analysis (#3452 - @brianmay)

#### dashboards
#### Dashboards

- Fix link to Charge Level dashboard (#3263 - @Sjorsa)
- Add LFP variants of Grafana dashboards (#3311 - @eden881)
Expand All @@ -26,6 +61,8 @@ Note: First release as @teslamate-org organization.

#### Translations

- There is nothing new here.

#### Documentation

- Gaussmeter units no longer for sale, #3419 - @LelandSindt
Expand All @@ -35,6 +72,7 @@ Note: First release as @teslamate-org organization.
- Update HA integration docs with TPMS sensors and examples (#2845 - @marspath)
- Fix code style in FreeBSD section (#3461 and #3462 - @ivanovd)
- Advise that docker-compose v1 is EOL and to upgrade to v2 (#3472 - @cwanja)
- Fix tpms bar sensors name in template for psi (#3490 - @virtualm2000)

## [1.27.4] - 2023-11-12

Expand Down Expand Up @@ -1702,7 +1740,9 @@ New users need to sign in via the web interface.

## [1.0.0] - 2019-07-25

[unreleased]: https://github.com/teslamate-org/teslamate/compare/v1.27.4...HEAD
[unreleased]: https://github.com/teslamate-org/teslamate/compare/v1.28.1...HEAD
[1.28.0]: https://github.com/teslamate-org/teslamate/compare/v1.28.0...v1.28.1
[1.28.0]: https://github.com/teslamate-org/teslamate/compare/v1.27.4...v1.28.0
[1.27.4]: https://github.com/adriankumpf/teslamate/compare/v1.27.3...v1.27.4
[1.27.3]: https://github.com/adriankumpf/teslamate/compare/v1.27.2...v1.27.3
[1.27.2]: https://github.com/adriankumpf/teslamate/compare/v1.27.1...v1.27.2
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.28.0-dev
1.28.2-dev
9 changes: 8 additions & 1 deletion config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,14 @@ case System.get_env("DATABASE_SSL") do
"noverify" ->
config :teslamate, TeslaMate.Repo,
ssl: true,
ssl_opts: [verify: :verify_none]
ssl_opts: [
server_name_indication:
to_charlist(
System.get_env("DATABASE_SSL_SNI") ||
Util.fetch_env!("DATABASE_HOST", all: "localhost")
),
verify: :verify_none
]

_false ->
config :teslamate, TeslaMate.Repo, ssl: false
Expand Down
5 changes: 3 additions & 2 deletions grafana/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ ENV GF_ANALYTICS_REPORTING_ENABLED=false \
GF_SECURITY_ADMIN_USER=admin \
GF_SECURITY_ALLOW_EMBEDDING=true \
GF_SECURITY_DISABLE_GRAVATAR=true \
GF_SECURITY_ANGULAR_SUPPORT_ENABLED=false \
GF_SECURITY_ANGULAR_SUPPORT_ENABLED=true \
GF_USERS_ALLOW_SIGN_UP=false \
DATABASE_PORT=5432
DATABASE_PORT=5432 \
DATABASE_SSL_MODE=disable

USER grafana

Expand Down
5 changes: 2 additions & 3 deletions grafana/datasource.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ datasources:
url: $DATABASE_HOST:$DATABASE_PORT
user: $DATABASE_USER
database: $DATABASE_NAME
password: ""
access: proxy
basicAuth: false
withCredentials: false
isDefault: true
secureJsonData:
password: $DATABASE_PASS
jsonData:
postgresVersion: 1000
sslmode: disable
postgresVersion: 1500
sslmode: $DATABASE_SSL_MODE
version: 1
editable: true
1 change: 1 addition & 0 deletions website/docs/configuration/environment_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ TeslaMate accepts the following environment variables for runtime configuration:
| **DATABASE_TIMEOUT** | The time in milliseconds to wait for database query calls to finish | 60000 |
| **DATABASE_SSL** | Set to `true` if SSL should be enabled or `noverify` if certificate verification should not be performed. | false |
| **DATABASE_SSL_CA_CERT_FILE** | Path to a file containing PEM-encoded CA certificates (required if `DATABASE_SSL` is set to `true`) | |
| **DATABASE_SSL_SNI** | set SNI for host undel ssl mode | |
| **DATABASE_IPV6** | Set to `true` if IPv6 should be used | false |
| **VIRTUAL_HOST** | Host part used for generating URLs throughout the app | localhost |
| **CHECK_ORIGIN** | Configures whether to check the origin header or not. May be `true` (**recommended**), `false` (_default_) or a comma-separated list of hosts that are allowed (e.g. `https://example.com,//another.com:8080`). Hosts also support wildcards. If `true`, it will check against the host value in `VIRTUAL_HOST`. | false |
Expand Down
8 changes: 4 additions & 4 deletions website/docs/integrations/home_assistant.md
Original file line number Diff line number Diff line change
Expand Up @@ -631,28 +631,28 @@ Don't forget to replace `<teslamate url>` and `<your tesla model>` with correct
unit_of_measurement: psi
icon_template: mdi:car-tire-alert
value_template: >
{{ (states('sensor.tesla_tpms_pressure_fl') | float * 14.50377) | round(2) }}
{{ (states('sensor.tesla_tpms_pressure_fl_bar') | float * 14.50377) | round(2) }}
tesla_tpms_pressure_fr_psi:
friendly_name: Front Right Tire Pressure (psi)
unit_of_measurement: psi
icon_template: mdi:car-tire-alert
value_template: >
{{ (states('sensor.tesla_tpms_pressure_fr') | float * 14.50377) | round(2) }}
{{ (states('sensor.tesla_tpms_pressure_fr_bar') | float * 14.50377) | round(2) }}
tesla_tpms_pressure_rl_psi:
friendly_name: Rear Left Tire Pressure (psi)
unit_of_measurement: psi
icon_template: mdi:car-tire-alert
value_template: >
{{ (states('sensor.tesla_tpms_pressure_rl') | float * 14.50377) | round(2) }}
{{ (states('sensor.tesla_tpms_pressure_rl_bar') | float * 14.50377) | round(2) }}
tesla_tpms_pressure_rr_psi:
friendly_name: Rear Right Tire Pressure (psi)
unit_of_measurement: psi
icon_template: mdi:car-tire-alert
value_template: >
{{ (states('sensor.tesla_tpms_pressure_rr') | float * 14.50377) | round(2) }}
{{ (states('sensor.tesla_tpms_pressure_rr_bar') | float * 14.50377) | round(2) }}
```

### binary_sensor.yaml (binary_sensor: section of configuration.yaml)
Expand Down

0 comments on commit 07ba9c8

Please sign in to comment.