Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Pi-hole service #2628

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

cjnewbs
Copy link

@cjnewbs cjnewbs commented Jun 21, 2024

Summary

  • Added Pi-hole as requested here,
  • Set time-zone based on shell environment variable,
  • WEBPASSWORD auto-generated by coolify,
  • DNSMASQ_LISTENING=all requirered otherwise DNS queries are ignored by the docker version of Pi-hole,
  • I have mapped port 80 to 8080 as coolify is already listening on 80.

Questions:

  • Is it possible to remove the ip:53 from the links section as it's not something directly accessed by users,
  • Is it possible to change the ip:8080 link from the public-facing IP of coolify to the LAN IP as this should only really need to be accessed locally,
  • For the logo image I just grabbed the png from the Pi-hole website, is there a specific image size thats needed or is the one in the PR ok?

@cjnewbs cjnewbs force-pushed the feature/add-pihole-service branch from 87bdf18 to f05ba14 Compare June 21, 2024 23:14
@Thijmen
Copy link
Contributor

Thijmen commented Jun 22, 2024

I would suggest to let Traefik handle the reverse proxy. You can then make a service "publicly available" within Coolify to expose the public port. I can agree on port 53 though.

ports:
- '53:53/tcp'
- '53:53/udp'
- '8080:80'
Copy link
Contributor

@iamEvanYT iamEvanYT Jun 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be removed, and instead, let reverse proxy handle it.

add the key SERVICE_FQDN_PIHOLE_80 in environment, and coolify will automatically handle it.

example:

environment:
  - SERVICE_FQDN_PIHOLE_80

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Line 7 should be removed.

It is also safer to not expose the application port directly. Traefik can put some security in front of it if someone needs it.

@@ -0,0 +1,15 @@
services:
Copy link
Contributor

@martonsz martonsz Jun 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot to add the metadata that is mentioned here: https://coolify.io/docs/knowledge-base/add-a-service#metadata

The port part will tell Coolify which port to use when configuring the proxy.
Now you can skip the postfix_80 when using SERVICE_FQDN_PIHOLE

If you want to test your service you can do it in the dev mode mentioned here: https://github.com/coollabsio/coolify/blob/main/CONTRIBUTION.md#1-setup-your-development-environment

When the Coolify container is running you can generate a new service-templates.json. More info here: #2375 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested this locally. And the traefik proxy is still using port 53 when trying to reach the WEB UI.
This is because traefik defaults to automatically proxy to exposed ports and Coolify doesn't override this.

I even tried using the postfix _80 but it did not help.

I also tried to remove the ports: part from the docker-compose file. But traefik still sees the exposed ports that are hard coded into the original docker image. I.e. traefik will proxy to port 53.

I have to add labels manually to configure traefik. But that requires me to use the generated UID.

labels:
      - traefik.http.routers.http-0-t4wgc4w-pihole.service=pi-hole
      - traefik.http.services.pi-hole.loadbalancer.server.port=80

I thought I knew how Coolify did its magic. But it seems that I was wrong :(

@Rehaeel
Copy link

Rehaeel commented Jul 18, 2024

really keen on including that in my VPS. Come on, let's gooo

image

@peaklabs-dev peaklabs-dev added the ⚙️ Service Issues requesting or PRs adding/fixing service templates. label Aug 27, 2024
@VoQZHD
Copy link

VoQZHD commented Sep 16, 2024

Since you managed to get pi-hole working, could a similar template for adguard be a possibility?

Copy link

gitguardian bot commented Sep 19, 2024

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
- - GitHub App Keys ccbbfd8 database/seeders/GithubAppSeeder.php View secret
- - Generic Password e1bcae7 templates/compose/resend.yaml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@peaklabs-dev
Copy link
Member

@cjnewbs This template does not really work in its current state, could you please update it with a domain and the Coolify magic https://coolify.io/docs/contribute/service ? Thank you so much.

@peaklabs-dev peaklabs-dev added the 💤 Waiting for feedback Issues awaiting a response from the author. label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ Service Issues requesting or PRs adding/fixing service templates. 💤 Waiting for feedback Issues awaiting a response from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants