diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml deleted file mode 100644 index 5e06efb..0000000 --- a/.github/dependabot.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -version: 2 -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: daily - time: "06:00" - - package-ecosystem: "pip" - directory: "/vscode" - schedule: - interval: daily - time: "06:00" diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 0000000..66059a2 --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,150 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "rebaseWhen": "behind-base-branch", + "dependencyDashboard": true, + "labels": ["dependencies", "no-stale"], + "commitMessagePrefix": "⬆️", + "commitMessageTopic": "{{depName}}", + "customManagers": [ + { + "customType": "regex", + "fileMatch": ["/Dockerfile$", "/build.yaml$"], + "matchStringsStrategy": "any", + "matchStrings": [ + "ARG BUILD_FROM=(?.*?):(?.*?)\\s+", + "(aarch64|amd64|armhf|armv7|i386):\\s[\"']?(?.*?):(?.*?)[\"']?\\s" + ], + "datasourceTemplate": "docker" + }, + { + "customType": "regex", + "fileMatch": ["/Dockerfile$"], + "matchStringsStrategy": "any", + "matchStrings": [ + "\\s\\s(?[a-z0-9][a-z0-9-]+)=(?[a-z0-9-:_+~.]+)\\s+" + ], + "versioningTemplate": "deb", + "datasourceTemplate": "repology", + "depNameTemplate": "debian_12/{{{replace 'openssh-client' 'openssh' package}}}" + }, + { + "customType": "regex", + "fileMatch": ["/Dockerfile$"], + "matchStrings": [ + "ARG CODE_SERVER_VERSION=[\"']?(?.+?)[\"']?\\s+" + ], + "datasourceTemplate": "github-releases", + "depNameTemplate": "cdr/code-server" + }, + { + "customType": "regex", + "fileMatch": ["/Dockerfile$"], + "matchStrings": [ + "ARG HA_CLI_VERSION=[\"']?(?.+?)[\"']?\\s+" + ], + "datasourceTemplate": "github-releases", + "depNameTemplate": "home-assistant/cli", + "versioningTemplate": "loose" + }, + { + "customType": "regex", + "fileMatch": ["vscode/vscode.extensions$"], + "matchStrings": ["emilast\\.LogFileHighlighter#(?.+)\\s"], + "datasourceTemplate": "github-releases", + "depNameTemplate": "emilast/vscode-logfile-highlighter" + }, + { + "customType": "regex", + "fileMatch": ["vscode/vscode.extensions$"], + "matchStrings": ["esbenp\\.prettier-vscode#(?.+)\\s"], + "datasourceTemplate": "github-releases", + "depNameTemplate": "prettier/prettier-vscode", + "extractVersionTemplate": "^v(?.*)$" + }, + { + "customType": "regex", + "fileMatch": ["vscode/vscode.extensions$"], + "matchStrings": ["ESPHome\\.esphome-vscode#(?.+)\\s"], + "datasourceTemplate": "github-releases", + "depNameTemplate": "esphome/esphome-vscode", + "versioningTemplate": "loose", + "extractVersionTemplate": "^v(?.*)$" + }, + { + "customType": "regex", + "fileMatch": ["vscode/vscode.extensions$"], + "matchStrings": [ + "keesschollaart\\.vscode-home-assistant#(?.+)\\s" + ], + "datasourceTemplate": "github-releases", + "depNameTemplate": "keesschollaart81/vscode-home-assistant", + "extractVersionTemplate": "^v(?.*)$" + }, + { + "customType": "regex", + "fileMatch": ["vscode/vscode.extensions$"], + "matchStrings": [ + "lukas-tr\\.materialdesignicons-intellisense#(?.+)\\s" + ], + "datasourceTemplate": "github-releases", + "depNameTemplate": "lukas-tr/vscode-materialdesignicons-intellisense", + "extractVersionTemplate": "^v(?.*)$" + }, + { + "customType": "regex", + "fileMatch": ["vscode/vscode.extensions$"], + "matchStrings": ["netcorext\\.uuid-generator#(?.+)\\s"], + "datasourceTemplate": "github-releases", + "depNameTemplate": "arenchen/vscode-uuid-generator" + }, + { + "customType": "regex", + "fileMatch": ["vscode/vscode.extensions$"], + "matchStrings": ["usernamehw\\.errorlens#(?.+)\\s"], + "datasourceTemplate": "github-releases", + "depNameTemplate": "usernamehw/vscode-error-lens", + "extractVersionTemplate": "^v(?.*)$" + } + ], + "packageRules": [ + { + "matchDatasources": ["repology"], + "automerge": true + }, + { + "groupName": "Add-on base image", + "matchDatasources": ["docker"] + }, + { + "groupName": "Add-on base image", + "matchDatasources": ["docker"], + "matchUpdateTypes": ["minor", "patch"], + "automerge": true + }, + { + "matchDatasources": ["github-releases"], + "matchDepNames": ["coder/code-server"], + "matchUpdateTypes": ["minor", "patch"], + "automerge": true + }, + { + "matchDatasources": ["github-releases"], + "matchDepNames": ["home-assistant/cli"], + "automerge": true + }, + { + "matchManagers": ["pip_requirements"], + "addLabels": ["python"] + }, + { + "matchManagers": ["pip_requirements"], + "matchDepTypes": ["dev"], + "rangeStrategy": "pin" + }, + { + "matchManagers": ["pip_requirements"], + "matchUpdateTypes": ["minor", "patch"], + "automerge": true + } + ] +} diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 9b224a5..21b20da 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -16,5 +16,4 @@ jobs: workflows: uses: hassio-addons/workflows/.github/workflows/addon-deploy.yaml@main secrets: - CAS_API_KEY: ${{ secrets.CAS_API_KEY }} DISPATCH_TOKEN: ${{ secrets.DISPATCH_TOKEN }} diff --git a/LICENSE.md b/LICENSE.md index f538997..04e4457 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ # MIT License -Copyright (c) 2019-2022 Franck Nijhof +Copyright (c) 2019-2025 Franck Nijhof Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 982ad79..82f1055 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ our [GitHub Repository][repository]. MIT License -Copyright (c) 2019-2022 Franck Nijhof +Copyright (c) 2019-2025 Franck Nijhof Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -122,7 +122,7 @@ SOFTWARE. [i386-shield]: https://img.shields.io/badge/i386-no-red.svg [issue]: https://github.com/hassio-addons/addon-vscode/issues [license-shield]: https://img.shields.io/github/license/hassio-addons/addon-vscode.svg -[maintenance-shield]: https://img.shields.io/maintenance/yes/2022.svg +[maintenance-shield]: https://img.shields.io/maintenance/yes/2025.svg [patreon-shield]: https://frenck.dev/wp-content/uploads/2019/12/patreon.png [patreon]: https://www.patreon.com/frenck [project-stage-shield]: https://img.shields.io/badge/project%20stage-production%20ready-brightgreen.svg diff --git a/vscode/.README.j2 b/vscode/.README.j2 index 90e3e28..54cbbe1 100644 --- a/vscode/.README.j2 +++ b/vscode/.README.j2 @@ -70,7 +70,7 @@ If you are more interested in stable releases of our add-ons: [forum]: https://community.home-assistant.io/t/home-assistant-community-add-on-visual-studio-code/107863?u=frenck [github-sponsors-shield]: https://frenck.dev/wp-content/uploads/2019/12/github_sponsor.png [github-sponsors]: https://github.com/sponsors/frenck -[maintenance-shield]: https://img.shields.io/maintenance/yes/2022.svg +[maintenance-shield]: https://img.shields.io/maintenance/yes/2025.svg [patreon-shield]: https://frenck.dev/wp-content/uploads/2019/12/patreon.png [patreon]: https://www.patreon.com/frenck [project-stage-shield]: https://img.shields.io/badge/project%20stage-production%20ready-brightgreen.svg diff --git a/vscode/DOCS.md b/vscode/DOCS.md index 6b58411..4670bf0 100644 --- a/vscode/DOCS.md +++ b/vscode/DOCS.md @@ -1,6 +1,6 @@ # Home Assistant Community Add-on: Studio Code Server -This add-on runs [code-server](https://github.com/cdr/code-server), which +This add-on runs [code-server](https://github.com/coder/code-server), which gives you a Visual Studio Code experience straight from the browser. It allows you to edit your Home Assistant configuration directly from your web browser, directly from within the Home Assistant frontend. @@ -154,7 +154,7 @@ check [the contributor's page][contributors]. MIT License -Copyright (c) 2019-2022 Franck Nijhof +Copyright (c) 2019-2025 Franck Nijhof Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -184,5 +184,5 @@ SOFTWARE. [issue]: https://github.com/hassio-addons/addon-vscode/issues [reddit]: https://reddit.com/r/homeassistant [releases]: https://github.com/hassio-addons/addon-vscode/releases -[semver]: http://semver.org/spec/v2.0.0 +[semver]: https://semver.org/spec/v2.0.0 [ubuntu-packages]: https://packages.ubuntu.com diff --git a/vscode/Dockerfile b/vscode/Dockerfile index d4022d6..4eea0cc 100755 --- a/vscode/Dockerfile +++ b/vscode/Dockerfile @@ -1,4 +1,4 @@ -ARG BUILD_FROM=ghcr.io/hassio-addons/debian-base:6.2.0 +ARG BUILD_FROM=ghcr.io/hassio-addons/debian-base:7.8.2 # hadolint ignore=DL3006 FROM ${BUILD_FROM} @@ -6,7 +6,8 @@ FROM ${BUILD_FROM} ENV \ LANG=en_US.UTF-8 \ LANGUAGE=en_US:en \ - LC_ALL=en_US.UTF-8 + LC_ALL=en_US.UTF-8 \ + PIP_BREAK_SYSTEM_PACKAGES=1 # Set shell SHELL ["/bin/bash", "-o", "pipefail", "-c"] @@ -19,32 +20,35 @@ COPY vscode.extensions /root/vscode.extensions # Setup base system ARG BUILD_ARCH=amd64 +ARG CODE_SERVER_VERSION="v4.99.3" +ARG HA_CLI_VERSION="4.38.0" # hadolint ignore=SC2181, DL3008 RUN \ apt-get update \ \ && apt-get install -y --no-install-recommends \ - ack=3.4.0-1 \ - libarchive-tools=3.4.3-2+deb11u1 \ + ack=3.6.0-1 \ + libarchive-tools=3.6.2-1+deb12u2 \ build-essential=12.9 \ - colordiff=1.0.18-1.1 \ - git=1:2.30.2-1 \ - iputils-ping=3:20210202-1 \ - locales=2.31-13+deb11u5 \ - mariadb-client=1:10.5.18-0+deb11u1 \ - mosquitto-clients=2.0.11-1 \ - net-tools=1.60+git20181103.0eebece-1 \ - nmap=7.91+dfsg1+really7.80+dfsg1-2 \ - openssh-client=1:8.4p1-5+deb11u1 \ - openssl=1.1.1n-0+deb11u3 \ - python3-dev=3.9.2-3 \ - python3=3.9.2-3 \ - unzip=6.0-26+deb11u1 \ - uuid-runtime=2.36.1-8+deb11u1 \ - wget=1.21-1+deb11u1 \ - zip=3.0-12 \ - zsh=5.8-6+deb11u1 \ - less=551-2 \ + colordiff=1.0.20-1 \ + git=1:2.39.5-0+deb12u2 \ + iputils-ping=3:20221126-1+deb12u1 \ + locales=2.36-9+deb12u7 \ + mariadb-client=1:10.11.11-0+deb12u1 \ + mosquitto-clients=2.0.11-1.2+deb12u1 \ + net-tools=2.10-0.1 \ + nmap=7.93+dfsg1-1 \ + openssh-client=1:9.2p1-2+deb12u5 \ + openssl=3.0.15-1~deb12u1 \ + python3-dev=3.11.2-1+b1 \ + python3-venv=3.11.2-1+b1 \ + python3=3.11.2-1+b1 \ + unzip=6.0-28 \ + uuid-runtime=2.38.1-5+deb12u1 \ + wget>=1.21.3-1+b2 \ + zip=3.0-13 \ + zsh=5.9-4+b5 \ + less=590-2.1~deb12u2 \ \ && sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \ && locale-gen \ @@ -54,14 +58,13 @@ RUN \ && if [[ "${BUILD_ARCH}" = "aarch64" ]]; then ARCH="arm64"; fi \ && if [[ "${BUILD_ARCH}" = "amd64" ]]; then ARCH="amd64"; fi \ && curl -J -L -o /tmp/code.tar.gz \ - "https://github.com/cdr/code-server/releases/download/v4.9.1/code-server-4.9.1-linux-${ARCH}.tar.gz" \ + "https://github.com/coder/code-server/releases/download/${CODE_SERVER_VERSION}/code-server-${CODE_SERVER_VERSION#v}-linux-${ARCH}.tar.gz" \ && mkdir -p /usr/local/lib/code-server \ && tar zxvf \ /tmp/code.tar.gz \ --strip 1 -C /usr/local/lib/code-server \ \ && ln -s /usr/local/lib/code-server/bin/code-server /usr/local/bin/code-server \ - && ln -s /usr/local/lib/code-server/bin/code-server /usr/local/bin/code \ \ && mkdir -p /root/.code-server/extensions \ && uuid=$(uuidgen) \ @@ -87,7 +90,7 @@ RUN \ && ls -la /usr/local/lib/code-server/lib/vscode/extensions/ \ \ && curl -L -s -o /usr/bin/ha \ - "https://github.com/home-assistant/cli/releases/download/4.23.0/ha_${BUILD_ARCH}" \ + "https://github.com/home-assistant/cli/releases/download/${HA_CLI_VERSION}/ha_${BUILD_ARCH}" \ && chmod a+x /usr/bin/ha \ \ && git clone --branch master --single-branch --depth 1 \ @@ -108,8 +111,8 @@ RUN \ && pip3 install --no-cache-dir -r /tmp/requirements.txt \ \ && apt-get purge -y --auto-remove \ - bsdtar \ build-essential \ + libarchive-tools \ python3-dev \ uuid-runtime \ \ @@ -127,6 +130,10 @@ RUN \ # Copy root filesystem COPY rootfs / +# Health check +HEALTHCHECK \ + CMD curl --fail http://127.0.0.1:1337/healthz || exit 1 + # Build arguments ARG BUILD_ARCH ARG BUILD_DATE diff --git a/vscode/build.yaml b/vscode/build.yaml index 73f6c5b..30d90d3 100644 --- a/vscode/build.yaml +++ b/vscode/build.yaml @@ -1,7 +1,7 @@ --- build_from: - aarch64: ghcr.io/hassio-addons/debian-base:6.2.0 - amd64: ghcr.io/hassio-addons/debian-base:6.2.0 + aarch64: ghcr.io/hassio-addons/debian-base:7.8.2 + amd64: ghcr.io/hassio-addons/debian-base:7.8.2 codenotary: base_image: codenotary@frenck.dev signer: codenotary@frenck.dev diff --git a/vscode/config.yaml b/vscode/config.yaml index a680dc1..0921ef8 100644 --- a/vscode/config.yaml +++ b/vscode/config.yaml @@ -19,12 +19,21 @@ hassio_api: true hassio_role: manager homeassistant_api: true map: - - config:rw - - ssl:rw - - addons:rw - - media:rw - - share:rw - - backup:rw + - type: addons + read_only: false + - type: all_addon_configs + read_only: false + - type: backup + read_only: false + - type: homeassistant_config + read_only: false + path: /config + - type: media + read_only: false + - type: share + read_only: false + - type: ssl + read_only: false services: - mysql:want - mqtt:want diff --git a/vscode/requirements.txt b/vscode/requirements.txt index 94649c7..0493acc 100644 --- a/vscode/requirements.txt +++ b/vscode/requirements.txt @@ -1,2 +1,2 @@ -esphome==2022.12.3 -yamllint==1.28.0 +esphome==2025.4.1 +yamllint==1.37.0 diff --git a/vscode/rootfs/etc/s6-overlay/s6-rc.d/code-server/finish b/vscode/rootfs/etc/s6-overlay/s6-rc.d/code-server/finish index fc23311..7dc933d 100755 --- a/vscode/rootfs/etc/s6-overlay/s6-rc.d/code-server/finish +++ b/vscode/rootfs/etc/s6-overlay/s6-rc.d/code-server/finish @@ -4,7 +4,6 @@ # Home Assistant Community Add-on: Studio Code Server # Take down the S6 supervision tree when the code server fails # ============================================================================== -declare exit_code readonly exit_code_container=$(