update addons

This commit is contained in:
ai-dev 2024-10-30 12:36:59 +01:00
parent e0569fd9c7
commit 2cb8ed4e75
39 changed files with 2196 additions and 28 deletions

View File

@ -1,8 +0,0 @@
---
build_from:
aarch64: ghcr.io/hassio-addons/base:16.3.4
amd64: ghcr.io/hassio-addons/base:16.3.4
armv7: ghcr.io/hassio-addons/base:16.3.4
codenotary:
base_image: codenotary@frenck.dev
signer: codenotary@frenck.dev

1
addon-prometheus/.github/CODEOWNERS vendored Normal file
View File

@ -0,0 +1 @@
.github/* @frenck

View File

@ -0,0 +1,133 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
frenck@frenck.dev.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][mozilla coc].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][faq]. Translations are available
at [https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
[mozilla coc]: https://github.com/mozilla/diversity
[faq]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations

View File

@ -0,0 +1,29 @@
# Contributing
When contributing to this repository, please first discuss the change you wish
to make via issue, email, or any other method with the owners of this repository
before making a change.
Please note we have a code of conduct, please follow it in all your interactions
with the project.
## Issues and feature requests
You've found a bug in the source code, a mistake in the documentation or maybe
you'd like a new feature? You can help us by submitting an issue to our
[GitHub Repository][github]. Before you create an issue, make sure you search
the archive, maybe your question was already answered.
Even better: You could submit a pull request with a fix / new feature!
## Pull request process
1. Search our repository for open or closed [pull requests][prs] that relates
to your submission. You don't want to duplicate effort.
1. You may merge the pull request in once you have the sign-off of two other
developers, or if you do not have permission to do that, you may request
the second reviewer to merge it for you.
[github]: https://github.com/hassio-addons/addon-prometheus/issues
[prs]: https://github.com/hassio-addons/addon-prometheus/pulls

2
addon-prometheus/.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,2 @@
---
ko_fi: mjrider

View File

@ -0,0 +1,20 @@
# Problem/Motivation
> (Why the issue was filed)
## Expected behavior
> (What you expected to happen)
## Actual behavior
> (What actually happened)
## Steps to reproduce
> (How can someone else make/see it happen)
## Proposed changes
> (If you have a proposed change, workaround or fix,
> describe the rationale behind it)

View File

@ -0,0 +1,9 @@
# Proposed Changes
> (Describe the changes and rationale behind them)
## Related Issues
> ([Github link][autolink-references] to related issues or pull requests)
[autolink-references]: https://help.github.com/articles/autolinked-references-and-urls/

1839
addon-prometheus/.github/SECURITY.md vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
time: "06:00"

View File

@ -0,0 +1,16 @@
---
name: CI
# yamllint disable-line rule:truthy
on:
push:
pull_request:
types:
- opened
- reopened
- synchronize
workflow_dispatch:
jobs:
workflows:
uses: hassio-addons/workflows/.github/workflows/addon-ci.yaml@main

View File

@ -0,0 +1,19 @@
---
name: Deploy
# yamllint disable-line rule:truthy
on:
release:
types:
- published
workflow_run:
workflows: ["CI"]
branches: [main]
types:
- completed
jobs:
workflows:
uses: hassio-addons/workflows/.github/workflows/addon-deploy.yaml@main
secrets:
DISPATCH_TOKEN: ${{ secrets.DISPATCH_TOKEN }}

View File

@ -0,0 +1,12 @@
---
name: Sync labels
# yamllint disable-line rule:truthy
on:
schedule:
- cron: "34 5 * * *"
workflow_dispatch:
jobs:
workflows:
uses: hassio-addons/workflows/.github/workflows/labels.yaml@main

View File

@ -0,0 +1,12 @@
---
name: Lock
# yamllint disable-line rule:truthy
on:
schedule:
- cron: "0 9 * * *"
workflow_dispatch:
jobs:
workflows:
uses: hassio-addons/workflows/.github/workflows/lock.yaml@main

View File

@ -0,0 +1,15 @@
---
name: PR Labels
# yamllint disable-line rule:truthy
on:
pull_request_target:
types:
- opened
- labeled
- unlabeled
- synchronize
jobs:
workflows:
uses: hassio-addons/workflows/.github/workflows/pr-labels.yaml@main

View File

@ -0,0 +1,12 @@
---
name: Release Drafter
# yamllint disable-line rule:truthy
on:
push:
branches:
- main
jobs:
workflows:
uses: hassio-addons/workflows/.github/workflows/release-drafter.yaml@main

View File

@ -0,0 +1,12 @@
---
name: Stale
# yamllint disable-line rule:truthy
on:
schedule:
- cron: "0 8 * * *"
workflow_dispatch:
jobs:
workflows:
uses: hassio-addons/workflows/.github/workflows/stale.yaml@main

View File

@ -23,6 +23,25 @@ The open platform for beautiful analytics and monitoring.
## About
*Update 2024-08-31*
This addon has been forked, and now updates prometheus to 2.54.1, as well `hassio-addons/base` being updated to 16.2.1. This addon now merges a yaml file named `prometheus.yaml` located in `/share/prometheus` with the configuration located within the container. This allows for (but not just) the targeting of a remote alert manager instance.
For example, the contents of `/share/prometheus/prometheus.yaml` could contain:
```yaml
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
- 1.3.3.7:9093
```
Which would then send alerts to an alert manager instance located at `http://1.3.3.7:9093`
---
....
[:books: Read the full add-on documentation][docs]

View File

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

View File

@ -1,4 +1,4 @@
ARG BUILD_FROM=ghcr.io/hassio-addons/base:16.3.4
ARG BUILD_FROM=ghcr.io/hassio-addons/base:16.2.1
# hadolint ignore=DL3006
FROM ${BUILD_FROM}
@ -7,7 +7,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Setup base system
ARG BUILD_ARCH=amd64
ENV PROMETHEUS_VERSION=2.55.0
ENV PROMETHEUS_VERSION=2.54.1
# Copy root filesystem
COPY rootfs /
@ -17,16 +17,19 @@ RUN \
ARCH="${BUILD_ARCH}" \
&& if [ "${BUILD_ARCH}" = "aarch64" ]; then ARCH="arm64"; fi \
\
&& apk --no-cache add yq \
--repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \
&& apk --no-cache add \
python3=3.10.5-r0 \
py3-idna=3.3-r2 \
py3-certifi=2021.10.8-r0 \
py3-chardet=4.0.0-r3 \
py3-yaml=6.0-r0 \
py3-urllib3=1.26.9-r0 \
py3-requests=2.27.1-r0 \
curl \
python3 \
py3-idna \
py3-certifi \
py3-chardet \
py3-yaml \
py3-urllib3 \
py3-requests \
&& apk --no-cache add --virtual .builddeps \
py-pip=22.1.1-r0 \
py-pip \
\
&& curl -J -L -o /tmp/prometheus.tar.gz \
"https://github.com/prometheus/prometheus/releases/download/v${PROMETHEUS_VERSION}/prometheus-${PROMETHEUS_VERSION}.linux-${ARCH}.tar.gz" \
@ -41,9 +44,10 @@ RUN \
&& rm -r prometheus-${PROMETHEUS_VERSION}.linux-${ARCH} \
&& chown -R prometheus:prometheus /etc/prometheus \
&& pip3 install \
--break-system-packages \
--no-cache-dir \
--prefer-binary \
--find-links "https://wheels.home-assistant.io/musllinux/" \
--find-links "https://wheels.home-assistant.io/alpine-3.15/${BUILD_ARCH}/" \
-r /opt/prometheus-configgen/requirements.txt \
\
&& apk --no-cache del .builddeps \
@ -62,15 +66,15 @@ LABEL \
io.hass.arch="${BUILD_ARCH}" \
io.hass.type="addon" \
io.hass.version=${BUILD_VERSION} \
maintainer="feres" \
maintainer="Martin George <marty@dingo.foo>" \
org.opencontainers.image.title="Prometheus" \
org.opencontainers.image.description="Cloud native metrics" \
org.opencontainers.image.vendor="Home Assistant local Add-ons" \
org.opencontainers.image.authors="Feres" \
org.opencontainers.image.vendor="Home Assistant Community Add-ons" \
org.opencontainers.image.authors="Martin George <marty@dingo.foo>" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.url="https://addons.community" \
org.opencontainers.image.source="https://github.com/hassio-addons/addon-prometheus" \
org.opencontainers.image.documentation="https://github.com/hassio-addons/addon-prometheus/blob/master/README.md" \
org.opencontainers.image.source="https://github.com/martydingo/homeassistant-addon-prometheus" \
org.opencontainers.image.documentation="https://github.com/martydingo/homeassistant-addon-prometheus/blob/main/README.md" \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.revision=${BUILD_REF} \
org.opencontainers.image.version=${BUILD_VERSION}

View File

@ -0,0 +1,8 @@
---
build_from:
aarch64: ghcr.io/hassio-addons/base:16.2.1
amd64: ghcr.io/hassio-addons/base:16.2.1
armv7: ghcr.io/hassio-addons/base:16.2.1
codenotary:
base_image: codenotary@frenck.dev
signer: codenotary@frenck.dev

View File

@ -3,8 +3,8 @@ name: Prometheus
version: dev
slug: prometheus
description: Cloud native metrics
url: https://github.com/hassio-addons/addon-prometheus
codenotary: codenotary@frenck.dev
url: https://github.com/martydingo/homeassistant-addon-prometheus
# codenotary: codenotary@frenck.dev
startup: services
ingress: true
ingress_port: 9090

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -8,3 +8,4 @@ echo "${SUPERVISOR_TOKEN}" > '/run/home-assistant.token'
mkdir -p /data/prometheus
find /data/prometheus -not -perm 0644 -type f -exec chmod 0660 {} \;
find /data/prometheus -not -perm 0755 -type d -exec chmod 0770 {} \;
chown -R prometheus:prometheus /data/prometheus

View File

@ -41,5 +41,6 @@ if ! bashio::fs.directory_exists /share/prometheus/targets; then
chown -R prometheus:prometheus /share/prometheus/targets
fi
yq -i eval-all '. as $item ireduce ({}; . * $item)' /etc/prometheus/prometheus.yml /share/prometheus/prometheus.yaml
# Run Prometheus
exec s6-setuidgid prometheus /usr/local/bin/prometheus "${options[@]}"

View File

@ -6,11 +6,11 @@ import os
import tempfile
import requests
from yamlinclude import YamlIncludeConstructor
from yaml_include import Constructor
def generateConfig():
YamlIncludeConstructor.add_to_loader_class(
Constructor.add_to_loader_class(
loader_class=yaml.FullLoader, base_dir="/share/prometheus/"
)

View File

@ -0,0 +1,3 @@
name: Prometheus
url: https://github.com/martydingo/homeassistant-addon-prometheus
maintainer: Martin George <marty@dingo.foo>