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

Fixed xml parse to be compatible with newer unraid version #60

Merged
merged 1 commit into from
Nov 26, 2022

Conversation

Phil-Barker
Copy link
Contributor

The ParseDockerTemplate.sh script was failing to find Volumes, in the new XML format used by latest versions of Unraid.

This also impacts ports and envars as they have moved along with volumes into Config elements

I am no expert bash programmer, but I have made some updates and tested that they work

xxx@XXX:~# ./ParseDockerTemplate.sh -yv /boot/config/plugins/dockerMan/templates-user/my-pihole.xml
Dry-Run: Will not start dockers, just parse xml and build command.
Name: pihole
Found Net:  --net="br0"
Found IP:  --ip="xx.xx.xx.xx"
Found Privilege:  --privileged="true"
Found Environment:  -e PIHOLE_DNS_="1.1.1.1;8.8.8.8;"
Found Environment:  -e TZ="Europe/London"
Found Environment:  -e WEBPASSWORD="xxxxxxxxxxxxx"
Found Environment:  -e INTERFACE="br0"
Found Environment:  -e ServerIP="xx.xx.xx.xx"
Found Environment:  -e ServerIPv6=""
Found Environment:  -e IPv6="False"
Found Environment:  -e DNSMASQ_LISTENING="all"
Found Environment:  -e WEBUIBOXEDLAYOUT="boxed"
Found TimeZone:  -e TZ=""
Found Port:  -p 53:53/tcp
Found Port:  -p 53:53/udp
Found Port:  -p 67:67/udp
Found Port:  -p 7080:80/tcp
Found Port:  -p 7443:443/tcp
Found volume:  -v "/mnt/cache/appdata/pihole/pihole/":"/etc/pihole/":rw
Found volume:  -v "/mnt/user/appdata/pihole/dnsmasq.d/":"/etc/dnsmasq.d/":rw
Found Extra params:  --cap-add=NET_ADMIN --restart=unless-stopped
Found Repo:  pihole/pihole:latest
/usr/bin/docker run -d --name="pihole" --net="br0" --ip="xx.xx.xx.xx" --privileged="true" -e PIHOLE_DNS_="1.1.1.1;8.8.8.8;" -e TZ="Europe/London" -e WEBPASSWORD="xxxxxxxxxxxxx" -e INTERFACE="br0" -e ServerIP="xx.xx.xx.xx" -e ServerIPv6="" -e IPv6="False" -e DNSMASQ_LISTENING="all" -e WEBUIBOXEDLAYOUT="boxed" -e TZ="" -p 53:53/tcp -p 53:53/udp -p 67:67/udp -p 7080:80/tcp -p 7443:443/tcp -v "/mnt/cache/appdata/pihole/pihole/":"/etc/pihole/":rw -v "/mnt/user/appdata/pihole/dnsmasq.d/":"/etc/dnsmasq.d/":rw --cap-add=NET_ADMIN --restart=unless-stopped pihole/pihole:latest

I hope this helps but obviously feel free to change it if there's a nicer way of doing it

@elmerfds
Copy link
Owner

From a quick look this looks good but can't test it myself just yet.

The only problem I can think of is for users still on an older version of Unraid, need to find a way to use the old version of ParseDockerTemplate.sh

@elmerfds
Copy link
Owner

Less elegant solution for now, created a new branch for users on the older version of Unraid.

I'll merge your pull request now, thanks for your help

@elmerfds elmerfds merged commit a773936 into elmerfds:master Nov 26, 2022
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

Successfully merging this pull request may close these issues.

2 participants