Commit Graph

191 Commits

Author SHA1 Message Date
JakobLichterfeld
fdf8185ce2 ci: add treefmt as code formatting multiplexer, refactor CI to avoid duplication, reorg CI into DevOps workflow (#4219)
* ci: add treefmt as code formatting multiplexer

* style: linter findings in entrypoint.sh script

* style: linter findings for yaml and yml

* style: linter findings for json files

* style: linter findings for nix files

* style: linter findings for js files

* style: linter findings for dashboards.sh

* style: linter findings for md and mdx files

* chore: remove unused clang formatter in treefmt config

* style: linter findings for mdx files

* ci: exclude Grafana dashboard JSON files from prettier formatting

* Revert "style: linter findings for json files"

This reverts commit f40c2e175992f66f887a3f4fc5aa1a1a89393147.

* ci: exclude Grafana dashboard JSON files from all formatting as we use the grafana export style

* style: linter findings for json files

* doc: update changelog

* ci(refactor): use composite action to avoid duplication in elixir workflow

* doc: update changelog

* ci: prevent workflow runs for certain conditions and allow scheduled runs

* ci(refactor): use reusable workflow to check paths

* ci(fix): correct output syntax for check_paths workflow and setting base branch

* ci(refactor): use reusable workflows for streamlined DevOps pipeline

* ci(fix): add write permission for packages in DevOps workflow

* ci(test): test DevOps workflow

* ci(test): test DevOps workflow

* ci(fix): Update condition for spell_check, ensure_linting, elixir, and ghcr_build workflows to reflect empty result instead of false

* ci: revert test DevOps

* ci(refactor): allow ghcr_build parallel to elixir test

* ci(refactor): Remove redundant check_paths job from elixir.yml, elixir_test.yml, and spell_check.yml workflows, check is done in devops.yml

* feat: add treefmt-nix to nix flake (#4219 - @JakobLichterfeld)

* ci: ensure proper linting via treefmt

* ci(test): test ensure_linting workflow

* ci(fix): checkout code for spell_checker to access file to check

* ci(fix): allow impure in ensure_linting workflow

* Revert "ci(test): test ensure_linting workflow"

This reverts commit a67b17ec098a628a8b093ec20b34b0e2696811cc.

* ci(fix): correct use of flake-utils for formatter and checks

Co-authored-by: scottbot95 <scottbot95@gmail.com>

* ci(fix): correct use of flake-utils for treefmt

Co-authored-by: scottbot95 <scottbot95@gmail.com>

* refactor: Remove unnecessary imports in flake

* ci(fix): correct syntax in flake

* ci(refactor): Remove unused code in flake.nix

* style: standardised style for input url in flake

* ci(fix): treefmt-nix config with existing options

* ci(feat): Add Nix binary cache and update treefmt command in CI workflow

* ci(refactor): Remove unused code in flake.nix

* fix: include devShell packages only on supported platforms

* fix: update hash for mix-deps package in flake.nix

* ci(fix): Update treefmt command in CI workflow

* ci(test): test ensure_linting workflow

* feat: ensure mix deps are present in devShell

* ci(feat): use flake-parts to enable treefmt-nix

* feat: use flake-parts

* fix: correct use of flake-parts for package build

* doc: update CI badge URL for devops workflow

* ci(fix): handle empty path filter output

* ci: remove --impure flag from treefmt command in CI workflow

* fix: correct treefmt.config settings in formatter.nix

* fix: correct flake-parts inputs, avoid with in imports

* fix: correct program name for mix-format in formatter.nix

* feat: devenv via flake-parts

* fix: correct use of legacy nix code with flake-parts

* ci(fix): correct nix develop command in ensure_linting.yml

* refactor: list imports explicitly in flake, rename folder to flake-modules to be precise

* style: use tabs for indent size to format sh

* style: use nixfmt-rfc-style

* Revert "style: use nixfmt-rfc-style"

This reverts commit 082056159e611c2c0639f8b4dc509446f5308a92.

* style: use nixfmt style

* fix: remove glibcLocales from optional dependencies to avoid  "A definition for option `packages."[definition 4-entry 16]"' is not of type `package'."

* fix: remove inotify-tools from optional dependencies to avoid  "A definition for option `packages."[definition 4-entry 16]"' is not of type `package'."

* fix: Remove inotify-tools and glibcLocales from optional dependencie

* fix: correct file paths in flake.nix to version

* fix: add ELIXIR_ERL_OPTIONS to shell environment to force utf8 locale

* fix: add LOCALE_ARCHIVE to shell environment in flake.nix

* Revert "fix: add LOCALE_ARCHIVE to shell environment in flake.nix"

This reverts commit d45f6e32eea1fcaf55cd03733e648cda4dbb764b.

* ci(refactor): rename workflow to elixir_dep_verification_and_static_analysis.yml to better reflect the intention,, remove duplicate checks

* ci(debug): debug locale settings

* Revert "ci(debug): debug locale settings"

This reverts commit 9b402f3c5f9b41ff4716dc4fc99f711fc9ef8135.

* Revert "fix: add ELIXIR_ERL_OPTIONS to shell environment to force utf8 locale"

This reverts commit d02419cba44055d55978ad36d23493d8790ce21b.

* fix: add LOCALE_ARCHIVE to shell environment in flake.nix

* Revert "fix: add LOCALE_ARCHIVE to shell environment in flake.nix"

This reverts commit 761b437e699d8381a0726dd969052b1e85c3f08f.

* fix: add LANG=C.UTF-8 to shell environment in flake.nix

* fix: add mix local.rebar and mix local.hex commands to flake.nix

* fix: pin devenv to version without unix socket bug

* chore: update nixpkgs to nixos-24.05 and update dependencies

* doc: add treefmt config comments

* ci: do not expose treefmt formatter programs in devshell

* fix: correct use of module option to enable PostgreSQL server in flake.nix

* Revert "chore: update nixpkgs to nixos-24.05 and update dependencies"

This reverts commit a6ea3f25aa393c32d9c2494b21e6330de2482496.

* feat: consistent use of erlang 26 and elixir 1_16 in flake

* ci: switch to macOS runner for linting workflow

* Revert "ci: do not expose treefmt formatter programs in devshell"

This reverts commit 1ecfa451dcf4199554a5d96d241ee846601862d9.

* Revert "ci: switch to macOS runner for linting workflow"

This reverts commit 7b430667d8737e5adf91f5ba59bbf83eb15bcb7a.

* ci: Remove nixpkgs channel specification in ensure_linting workflow

* ci(debug): Add debug output for PATH and NIX_PATH in flake.nix

* Revert "ci(debug): Add debug output for PATH and NIX_PATH in flake.nix"

This reverts commit 07faec5ddf88195969f89f3e74791d030c980b03.

* fix: avoid the need for impure for devenv

see #4245

* fix: remove invalid custom build.check for formatter and use default

* style: linter findings

* fix: Add emptyTest to avoid nix flake check test execution on non-Linux systems

* chore: Remove LANG=C.UTF-8 from enterShell in flake.nix

* ci(fix): Remove --impure flag from treefmt command in CI mode

* ci(fix): avoid impure mode in ensure_linting workflow

* style: linter findings

* ci(debug): debug elixir version and locale

* chore: Update flake.lock dependencies

* feat: use newer devenv as unix socket bug is fixed in upstream

https://github.com/cachix/devenv/issues/1497

* fix: set rebar3 path in devenv

* Revert "ci(debug): debug elixir version and locale"

This reverts commit 7ecdc77c163cd6ef9c913689c1f75e86ce8587cb.

* ci: re-enable path check in DevOps workflow

* doc: update Development and Contributing guide with nix and treefmt

* ci: use PostgreSQL 17

* style: linter findings

* ci(fix): ensure cache name in build action does not contain invalid characters to avoid invalid reference format

* doc: update changelog

* Revert "ci(fix): ensure cache name in build action does not contain invalid characters to avoid invalid reference format"

This reverts commit 02abb0359db4f22e5a28283476b3ced0d99729ff.

* ci: remove branch restriction for check_paths workflow to increase sec

* ci(fix): run ghcr build workflow only for specific conditions

- Ensure workflow only run if there are no changes to the .github folder
- Allow workflow to run on workflow call or PRs from forks
- Prevent duplicate runs for PRs from non-forks
- Avoid invalid reference format for cache name in PRs from our repository

* doc: update changelog

* fix: update hash for mix-deps package in flake.nix

* fix: disable flakeCheck for formatter, as mix format need the dep to be fetched beforehand

* ci(fix): run ghcr build workflow only for specific conditions

* fix: move nixosModules.default to top-level attribute set

* refactor: remove unnecessary config nesting in formatter.nix

* ci(fix): ensure version for buildx is set to correct name

---------

Co-authored-by: scottbot95 <scottbot95@gmail.com>
2024-10-14 08:54:10 +02:00
b1c1l1
97cfb79493 feat: Add URL_PATH environment variable for reverse proxy deployments (#3771)
* Add URL_PATH environment variable for reverse proxy deployments

For example, this can be used to run TeslaMate behind a reverse proxy, using a
URL path such as "/teslamate".

* gettext: update pot and po files

Generated using:
  mix gettext.extract --merge

* web: run mix format

* gettext: update pot and po files

Re-generating gettext files after running mix format.

Generated using:
  mix gettext.extract --merge
2024-03-25 09:21:34 +01:00
Brian May
2b5cdbdffd Add nix flake (#3485)
This will add support for nix flakes. Which really helps with my
development on nixos. This has two basic parts:

1. DEVELOPMENT

After this you can use the following commands on computer with nix and a
patched version of direnv:

direnv allow
devenv up

And it will automatically start and instance of postgresql and mosquitto
for development.

And the environment variables are already configured for teslamate.

So then can start teslamate with:

npm install --prefix ./assets && npm run deploy --prefix ./assets
iex -S mix phx.server

This part is all working as designed. And pretty simple and straight
forward.

2. NIX PACKAGE OF TESLA

This is 99% complete, but some pain points I haven't addressed yet.
Because I don't yet know of good solutions.

* There are two checksums in flake.nix that needs to be updated whenever
  mix.lock or package-lock.json changes.
2024-03-19 09:37:17 +01:00
Phillip Thurston
69e648a745 updated esbuild to resolve properly with esbuild-sass-plugin, and updated to nodejs 20 (#3477) 2023-11-22 09:11:05 +01:00
danieldegroot2
003634d6ca Use preferred tile.openstreetmap.org URL (#3368) 2023-11-12 18:05:07 +01:00
Adrian Kumpf
0fff146fcf Fix building assets 2023-06-10 23:33:48 +02:00
Adrian Kumpf
cc303cfdbc Update JS dependencies 2023-06-10 19:35:33 +02:00
Adrian Kumpf
c6a8039c4e Change esbuild target to es2017 2023-01-13 11:55:50 +01:00
Adrian Kumpf
e376402838 Update frontend dependencies 2023-01-13 11:54:47 +01:00
Adrian Kumpf
2405945d51 Bump dependencies 2022-07-15 11:18:01 +02:00
Adrian Kumpf
5e1ddce7af Bump dependencies 2022-06-24 11:07:03 +02:00
Adrian Kumpf
f51d651afe Upgrade dependencies 2022-05-20 12:19:43 +02:00
Adrian Kumpf
7d2a841f1f Bump deps 2022-04-04 14:24:04 +02:00
Adrian Kumpf
0d6e288c70 Encrypt API tokens (#2360)
Store API tokens encrypted in the database.

During the database migration a randomly generated key will be used encrypt the tokens if no ENCRYPTION_KEY environment variable was provided.

If the application is started without the presence of an ENCRYPTION_KEY (or if the key failed to decrypt the existing tokens), the UI will display a warning with further instructions.
2022-02-18 17:03:13 +01:00
Adrian Kumpf
d461292bc4 Update frontend deps 2022-02-18 16:57:09 +01:00
Adrian Kumpf
714529ff64 Update FE deps 2022-02-01 15:16:03 +01:00
James Bogosian
963831deee Enable zoom on live view of the car. (#2184)
* Enable zoom on live view of the car.

* Switch to using drag/pinch-to-zoom/scroll-to-zoom

* Remove data-zoom attrbiute as parameters are directly set in the JS.

* Directly set parameters for zoom instead of relying on attribute from DOM.

* Switch to use hover/tap to show/hide zoom control.
2022-01-21 19:28:20 +01:00
Adrian Kumpf
91316f0e8c Update FE deps 2022-01-01 16:29:44 +01:00
Adrian Kumpf
e09c8c458e Properly stop esbuild process 2021-12-13 17:29:55 +01:00
Adrian Kumpf
0e28af4581 Bump esbuild-sass-plugin 2021-12-13 16:16:48 +00:00
dependabot[bot]
e2f4fad422 Bump esbuild from 0.13.15 to 0.14.3 in /assets
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.13.15 to 0.14.3.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/master/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.13.15...v0.14.3)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-13 16:16:48 +00:00
dependabot[bot]
0ce133f0a0 Bump @mdi/font from 6.4.95 to 6.5.95 in /assets
Bumps [@mdi/font](https://github.com/Templarian/MaterialDesign-Webfont) from 6.4.95 to 6.5.95.
- [Release notes](https://github.com/Templarian/MaterialDesign-Webfont/releases)
- [Commits](https://github.com/Templarian/MaterialDesign-Webfont/compare/v6.4.95...v6.5.95)

---
updated-dependencies:
- dependency-name: "@mdi/font"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-13 15:50:24 +00:00
dependabot[bot]
ea592b2667 Bump sass from 1.44.0 to 1.45.0 in /assets
Bumps [sass](https://github.com/sass/dart-sass) from 1.44.0 to 1.45.0.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.44.0...1.45.0)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-13 15:50:02 +00:00
dependabot[bot]
1300e1c34f Bump esbuild-sass-plugin from 1.7.0 to 1.7.1 in /assets
Bumps [esbuild-sass-plugin](https://github.com/glromeo/esbuild-sass-plugin) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/glromeo/esbuild-sass-plugin/releases)
- [Commits](https://github.com/glromeo/esbuild-sass-plugin/compare/v1.7.0...v1.7.1)

---
updated-dependencies:
- dependency-name: esbuild-sass-plugin
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-13 15:42:55 +00:00
Adrian Kumpf
1425f82b49 Update dependencies 2021-10-31 16:18:23 +01:00
Adrian Kumpf
9e4c443dd4 Update package-lock.json 2021-09-29 19:41:10 +02:00
Adrian Kumpf
f823244a36 Update esbuild 2021-09-29 19:03:29 +02:00
Adrian Kumpf
48c25c29db Update package-lock.json 2021-09-24 23:56:22 +02:00
Adrian Kumpf
bf89e10b69 Update package-lock.json 2021-09-24 23:40:12 +02:00
Adrian Kumpf
796d0c8ef4 Update phoenix to 1.6.0 2021-09-24 22:39:26 +02:00
Adrian Kumpf
a2ef4131ee Update esbuild to 0.13.1 2021-09-23 12:35:24 +02:00
Adrian Kumpf
70468ea762 Migrate from webpack to esbuild 2021-09-22 22:07:14 +02:00
Adrian Kumpf
e15fef7216 Uprade phoenix_live_view to 0.16 2021-09-22 17:10:48 +02:00
Adrian Kumpf
f998ccca5b Update js dependencies 2021-06-30 16:10:55 +02:00
Adrian Kumpf
f66f397549 Update FE dependencies 2021-06-04 12:13:13 +02:00
Adrian Kumpf
827f5aa33d Support Tesla's captcha verification 2021-06-01 00:53:32 +02:00
Adrian Kumpf
ba254e84b8 Update FE dependencies 2021-04-26 10:30:07 +02:00
Adrian Kumpf
490037ecaa Update FE dependencies 2021-03-21 16:04:40 +01:00
Adrian Kumpf
ad959040d2 Bump dependencies 2021-03-10 20:59:15 +01:00
Adrian Kumpf
cc7c42dec7 Update dependencies 2021-02-21 10:55:39 +01:00
Adrian Kumpf
f05a5ada04 Update frontend dependencies 2021-01-31 18:53:24 +01:00
Adrian Kumpf
eb8f055978 Update js deps 2021-01-09 00:05:39 +01:00
Adrian Kumpf
5ebe952205 Format javascript and css files 2020-12-30 17:49:47 +01:00
Adrian Kumpf
e66894d028 Fix FunctionClauseError if import directory is not accessible
Addresses #1070
2020-12-29 20:32:20 +01:00
Adrian Kumpf
d825fc1723 Allow to use the legacy authentication API 2020-12-29 15:05:38 +01:00
Adrian Kumpf
917bade4d9 Show tooltip unless values are missing
Fixes #1111
2020-12-22 15:45:08 +01:00
Adrian Kumpf
bb7df800a5 Allow to enter MFA codes 2020-12-20 22:18:52 +01:00
Adrian Kumpf
9d5ddeaed7 Bump FE dependencies 2020-12-19 21:54:36 +01:00
Adrian Kumpf
1c94355e8b Bump js dependencies 2020-12-01 17:58:30 +01:00
Adrian Kumpf
823771964b Bump js dependencies 2020-11-05 11:02:34 +01:00