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

Running Into Issue After Issue #5

Open
dinosaw opened this issue Dec 9, 2020 · 3 comments
Open

Running Into Issue After Issue #5

dinosaw opened this issue Dec 9, 2020 · 3 comments

Comments

@dinosaw
Copy link

dinosaw commented Dec 9, 2020

Hello,

After doing all the manual configuration for the files like traefik.toml and pihole.env etc, I attempt to run ./bootstrap.sh and get errors.

At first is stated:

# ./bootstrap.sh
  [INFO]  creating files for docker-compose...
creating /opt/skyhole/docker/vol/traefik/.htpasswd...
touch: cannot touch '/opt/skyhole/docker/vol/traefik/.htpasswd': No such file or directory

So I created that directory and ran it again but got:

# mkdir -p /opt/skyhole/docker/vol/traefik/

# ./bootstrap.sh
  [INFO]  creating files for docker-compose...
creating /opt/skyhole/docker/vol/traefik/.htpasswd...
./bootstrap.sh: line 62: htpasswd: command not found

Then I looked to see what package the htpasswd command is part of which was apache2-utils. I installed that and then ran bootstrap.sh again:

# ./bootstrap.sh
  [INFO]  creating files for docker-compose...
existing /opt/skyhole/docker/vol/traefik/.htpasswd...
existing /opt/skyhole/docker/vol/traefik/acme.json...
  [INFO]  getting runtime WAN IP configuration...
  [INFO]  beginning container creation...
./bootstrap.sh: line 106: docker-compose: command not found

Then I installed docker-compose and ran it again and got:

# ./bootstrap.sh
  [INFO]  creating files for docker-compose...
existing /opt/skyhole/docker/vol/traefik/.htpasswd...
creating /opt/skyhole/docker/vol/traefik/acme.json...
  [INFO]  getting runtime WAN IP configuration...
  [INFO]  beginning container creation...
ERROR:
        Can't find a suitable configuration file in this directory or any
        parent. Are you in the right directory?

        Supported filenames: docker-compose.yml, docker-compose.yaml

# pwd
/root/skyhole

# ls -l
total 24
-rwxr-xr-x 1 root root  4056 Dec  9 21:22 bootstrap.sh
drwxr-xr-x 5 root root  4096 Dec  9 21:30 docker
-rw-r--r-- 1 root root 15471 Dec  9 21:22 readme.md

# ls -l docker/
total 24
-rw-r--r-- 1 root root 9254 Dec  9 21:30 docker-compose.yaml
drwxr-xr-x 2 root root 4096 Dec  9 21:26 env
drwxr-xr-x 4 root root 4096 Dec  9 21:22 helpers
drwxr-xr-x 5 root root 4096 Dec  9 21:22 vol

So honestly it's just one error after another. Is this still a working application? Is there something I'm missing? Is there a list of pre-requisites needing to be installed before running bootstrap.sh other than the configuration files?

# cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"
NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
@kquinsland
Copy link
Owner

This hasn't been maintained, but likely does not need much work. Traefik 2.0 is probably the biggest breaking change, but you can get around that by using the old deprecated 1.x containers.

The bootstrap script is very opinionated and fragile; it was more of a 'guide' rather than a solution. It should work for you, but you must not deviate from any of the choices it assumes you've made. It's open source and you are therefore encouraged to make changes as needed (like, if you don't prefer putting in /opt...). As you've noticed, I just assume you've got some packages installed. I didn't do the dev work on this in a vacuum... htpasswd has been installed on most of my systems for years :/.

Your specific error is probably because /root/skyhole != /opt/skyhole


I've re-rolled the implementation a few times but not released as there's still a few issues w/ the Upstream pihole docker container that make things complicated:

basically, the current pihole docker implementation is an anti-pattern. It works and is easy, so it's remained popular. Popular things are seldom changed. Each re-write I do has not used docker, but the architecture is the same; just replace docker-compose for salt which puts everything in place. i install piHole, certbot and traefik and coredns all on bare metal and use systemd to keep it all running. Certbot fetches the TLS key pair and configures traefik and coreDNS rather than pulling the keys from treafik.

Eventually i'd like to get a single helm chart for k8 deployments but that requires a ton of work to de-compose the Franken-container that is the current pihole docker image.

@dinosaw
Copy link
Author

dinosaw commented Dec 9, 2020

Hello,

Thanks for the reply. I have moved it over to /opt which got me a little further, but still seeing this:

# ./bootstrap.sh
  [INFO]  creating files for docker-compose...
existing /opt/skyhole/docker/vol/traefik/.htpasswd...
existing /opt/skyhole/docker/vol/traefik/acme.json...
  [INFO]  getting runtime WAN IP configuration...
  [INFO]  beginning container creation...
ERROR: In file /opt/skyhole/docker/env/pi.public_ip.env: environment variable name '<html lang' may not contain whitespace.

This is that file's output:

# cat /opt/skyhole/docker/env/pi.public_ip.env
ServerIP=<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 403 (Forbidden)!!1</title>
  <style>
- - - - - - - - - - [SNIP] - - - - - - - - - -
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>403.</b> <ins>That’s an error.</ins>
  <p>Access is forbidden.  <ins>That’s all we know.</ins>

Since it complains about whitespace, I simply took out the lang=en and ran it again, but it looks like it places it right back into the file with the whitespace. Any idea how to get past this one?

@kquinsland
Copy link
Owner

the content of pi.public_ip.env should be just an IP address and nothing else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants