Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ on:
branches:
- master

permissions:
contents: read
packages: write
attestations: write
id-token: write

jobs:
changes:
runs-on: ubuntu-latest
Expand All @@ -22,6 +28,8 @@ jobs:
- '.github/workflows/pr-build.yml'
- '.github/workflows/release.yml'
- '.github/workflows/reusable-docker-build.yml'
- '.github/workflows/reusable-pre-commit.yml'
- '.pre-commit-config.yaml'
- 'pkg/**'
- 'main.go'
- 'go.*'
Expand Down Expand Up @@ -53,3 +61,11 @@ jobs:
needs: changes
if: ${{ needs.changes.outputs.src == 'true' }}
uses: ./.github/workflows/reusable-unittests.yml

pre-commit:
needs: changes
if: ${{ needs.changes.outputs.src == 'true' }}
uses: ./.github/workflows/reusable-pre-commit.yml
with:
base_sha: ${{ github.event.pull_request.base.sha }}
head_sha: ${{ github.event.pull_request.head.sha }}
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
2 changes: 1 addition & 1 deletion .github/workflows/reusable-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
packages: write
attestations: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/reusable-pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Reusable Pre-commit

on:
workflow_call:
inputs:
base_sha:
required: true
type: string
head_sha:
required: true
type: string

permissions:
contents: read

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: pre-commit/action@v3.0.1
with:
extra_args: --from-ref ${{ inputs.base_sha }} --to-ref ${{ inputs.head_sha }}
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer

- repo: https://github.com/golangci/golangci-lint
rev: v2.12.2
hooks:
- id: golangci-lint
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ WORKDIR /app
COPY --from=builder /app/plugnpin .

CMD [ "./plugnpin" ]

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ as local DNS/CNAME records in **Pi-Hole** (or DNS Rewrites in **AdGuard Home**)
PlugNPiN discovers services by scanning for Docker containers that have the following labels:

- `plugNPiN.ip` - The IP address and port of the container (e.g., `192.168.1.100:8080`).
- `plugNPiN.url` - The desired URL for the service (e.g., `my-service.local`).
Multiple domains are supported and should be comma-separated,
- `plugNPiN.url` - The desired URL for the service (e.g., `my-service.local`).
Multiple domains are supported and should be comma-separated,
for example `domain1.local,domain2.local`.

The application operates in two complementary modes to keep your services synchronized:
Expand Down
8 changes: 4 additions & 4 deletions docs/assets/logo_full.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/assets/logo_full_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/assets/logo_full_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/assets/logo_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion docs/css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
[data-md-color-scheme="slate"] {
--md-code-fg-color: #DEDEDE;
}

4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ See [Optional Environment Variables](./configuration.md#optional).
PlugNPiN discovers services by scanning for Docker containers that have the following labels:

- `plugNPiN.ip` - The IP address and port of the container (e.g., `192.168.1.100:8080`).
- `plugNPiN.url` - The desired URL for the service (e.g., `my-service.local`).
Multiple domains are supported (since version [:octicons-tag-24: 0.10.0](https://github.com/DeepSpace2/plugnpin/releases/tag/v0.10.0){ .md-tag target="_blank" }) and should be comma-separated,
- `plugNPiN.url` - The desired URL for the service (e.g., `my-service.local`).
Multiple domains are supported (since version [:octicons-tag-24: 0.10.0](https://github.com/DeepSpace2/plugnpin/releases/tag/v0.10.0){ .md-tag target="_blank" }) and should be comma-separated,
for example `domain1.local,domain2.local`.

The application operates in two complementary modes to keep your services synchronized:
Expand Down
2 changes: 1 addition & 1 deletion docs/js/anchor-jump-highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function isElementInsideTable(element) {
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function(e) {

const targetId = this.getAttribute('href').substring(1);
let targetElement = document.getElementById(targetId);

Expand Down
14 changes: 7 additions & 7 deletions docs/js/copy-to-clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ document$.subscribe(function() {

const wrapper = document.createElement("span");
wrapper.classList.add("copy-to-clipboard-wrapper");

code.parentNode.insertBefore(wrapper, code);
wrapper.appendChild(code);

const button = document.createElement("button");
button.type = "button";
button.setAttribute("aria-label", "Copy to clipboard");
button.setAttribute("title", "Copy to clipboard");
button.classList.add("copy-to-clipboard-button");
button.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1Z"/></svg>';

wrapper.appendChild(button);

button.addEventListener("click", (e) => {
e.preventDefault();
e.stopPropagation();

const textToCopy = code.textContent.trim();

const fallbackCopy = () => {
const textArea = document.createElement("textarea");
textArea.value = textToCopy;
Expand Down Expand Up @@ -64,10 +64,10 @@ document$.subscribe(function() {

function showSuccess(button) {
const originalHTML = button.innerHTML;

button.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21 7 9 19l-5.5-5.5 1.41-1.41L9 16.17 19.59 5.59 21 7Z"/></svg>';
button.classList.add("copy-success");

setTimeout(() => {
button.innerHTML = originalHTML;
button.classList.remove("copy-success");
Expand Down
5 changes: 2 additions & 3 deletions docs/monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

[:octicons-tag-24: 1.0.0](https://github.com/DeepSpace2/plugnpin/releases/tag/v1.0.0){ .md-tag target="_blank" }

PlugNPiN optionally exposes runtime and application metrics in Prometheus format
PlugNPiN optionally exposes runtime and application metrics in Prometheus format
by using the `METRICS` environment variable ([Configuration → Environment Variables](./configuration.md#optional)).

By default the metrics endpoint is available at `http://<plugnpin-host>:9100/metrics`
By default the metrics endpoint is available at `http://<plugnpin-host>:9100/metrics`
and the port can be set with the `METRICS_SERVER_PORT` environment variable.

### Example Prometheus Scrape Configuration
Expand All @@ -18,4 +18,3 @@ scrape_configs:
static_configs:
- targets: ["<plugnpin-host>:9100"]
```

2 changes: 1 addition & 1 deletion docs/theme/overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% block outdated %}
You're not viewing the latest version.
<a href="{{ '../' ~ base_url }}">
<a href="{{ '../' ~ base_url }}">
<strong>Click here to go to latest.</strong>
</a>
{% endblock %}
Loading