Bläddra i källkod

Pixel server (#87)

Macley 2 år sedan
förälder
incheckning
ad981db952

+ 1 - 1
docs/AppList.md

@@ -4,7 +4,6 @@ List of all apps included in this project with info related to it.
 
 |**Arm32:**          |**Arm64:**|**Amd64:**|**Total:**|
 |:-------------------|:--------:|:--------:|:--------:|
-| 171 apps | 186 apps | 184 apps | 186 apps |
 
 ---
 
@@ -133,6 +132,7 @@ List of all apps included in this project with info related to it.
 |[Pi-Hole](https://pi-hole.net/)|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|Container| [![](../build/images/blue_doc_icon.png)](https://github.com/pi-hole/docker-pi-hole/#running-pi-hole-docker) | [![](../build/images/red_doc_icon.png)](../docs/pi-hole.md) |  |  |
 |[Pi-Hole-Unbound](https://pi-hole.net/)|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|Container| [![](../build/images/blue_doc_icon.png)](https://github.com/chriscrowe/docker-pihole-unbound/tree/master/one-container) | [![](../build/images/red_doc_icon.png)](../docs/pi-hole.md) |  |  |
 |[Piwigo](http://piwigo.org/)|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|Container| [![](../build/images/blue_doc_icon.png)](https://docs.linuxserver.io/images/docker-piwigo) |  |  |  |
+|[Pixel-server](http://www.penguintutor.com/projects/pixel-server)|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|Container| [![](../build/images/blue_doc_icon.png)](https://github.com/Macleykun/pixel-server) | [![](../build/images/red_doc_icon.png)](../docs/pixel-server_setup.md) | [![](../build/images/script_icon.png)](../tools/install_pixel-server.sh) |  |
 |[Plex](https://www.plex.tv/)|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|Container| [![](../build/images/blue_doc_icon.png)](https://docs.linuxserver.io/images/docker-plex) |  |  |  |
 |[PostgreSQL](https://www.postgresql.org/)|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|Container| [![](../build/images/blue_doc_icon.png)](https://hub.docker.com/_/postgres/) |  |  |  |
 |[Pritunl](https://pritunl.com/)|:x:|:heavy_check_mark:|:heavy_check_mark:|Stack| [![](../build/images/blue_doc_icon.png)](https://hub.docker.com/r/goofball222/pritunl) |  |  |  |

+ 52 - 0
docs/pixel-server_setup.md

@@ -0,0 +1,52 @@
+# Run the preInstallScript
+
+Before deploying go to [Post Installation](#post-installation) section and run the preInstallScript for the pixel-server container.
+
+Or you can run these commands (just do this once!)
+
+```bash
+echo "Enabling spi and i2c communication"
+sudo raspi-config nonint do_spi 0
+sudo raspi-config nonint do_i2c 0
+echo "Creating directory..."
+sudo mkdir /portainer/Files/AppData/Config/pixel-server/
+echo "Downloading config files and configuring partly"
+sudo touch /portainer/Files/AppData/Config/pixel-server/users.cfg 
+sudo sh -c "echo 'network_allow_auth = 0.0.0.0' > /portainer/Files/AppData/Config/pixel-server/auth.cfg"
+sudo wget https://raw.githubusercontent.com/penguintutor/pixel-server/main/defaults.cfg -O /portainer/Files/AppData/Config/pixel-server/pixelserver.cfg
+echo "Done You are ready to goto next step in the install document"
+```
+
+Now you can deploy the pixel-server container, but do return back to this document to configure a user so you can login into the dashboard on port 85.
+
+To configure a user run the following in your terminal:
+
+```bash
+docker exec -it pixel-server sh -c 'python3 createadmin.py <username> <password> >> users.cfg'
+docker restart pixel-server
+```
+
+Replace `<username>` and `<password>` with the account you wish to use. You can now login into the container using the IP of the host on port 85.
+
+## Configuring
+
+While you're technically set, you do need to configure the pixel-server how to communicate with your RGB device. You can do this by clicking on the Settings button.
+
+You should set:
+
+- the Number of LEDS.
+- GPIO Pin No (use <https://pinout.xyz/> you want to input the number next to GPIO on the right (not the left)).
+- Brightness (default should be good, but take small steps when setting this value, requires restart of the container!).
+- LED Strip (Very important that you choose the right type, otherwise you're RGB device will show the wrong colors).
+
+## Automation
+
+You can use cron inside the container aswell. You can enable Cheerlights by doing:
+
+```bash
+docker exec -it pixel-server crontab -e
+```
+
+And add: `*/5     *       *       *       *       wget -q -O /opt/pixel-server/customlight.cfg http://api.thingspeak.com/channels/1417/field/2/last.txt`
+
+Save and exit out of the file and container.

+ 35 - 0
pi-hosted_template/template/portainer-v2.json

@@ -4760,6 +4760,41 @@
 			],
 			"note": "<h3>Template created by Pi-Hosted Series</h3><b>Check our Github page: <a href=\"https://github.com/pi-hosted/pi-hosted\" target=\"_blank\">https://github.com/pi-hosted/pi-hosted</a></b><br><br><b>Official Webpage: </b><a href=\"http://piwigo.org/\" target=\"_blank\">http://piwigo.org/</a><br><b>Official Docker Documentation: </b><a href=\"https://docs.linuxserver.io/images/docker-piwigo\" target=\"_blank\">https://docs.linuxserver.io/images/docker-piwigo</a><br><br><br>"
 		},
+		{
+			"categories": [
+				"Other"
+			],
+			"description": "Wireless control of PixelStrips or NeoPixels using a web graphical interface running on a Raspberry Pi.",
+			"image": "macley/pixel-server:latest",
+			"logo": "https://lirp.cdn-website.com/c73f56a6/dms3rep/multi/opt/ir.appnice.controlpad_512x512-640w.png",
+			"name": "pixel-server",
+			"platform": "linux",
+			"ports": [
+				"85:80/tcp"
+			],
+			"restart_policy": "unless-stopped",
+			"title": "Pixel-server",
+			"type": 1,
+			"volumes": [
+				{
+					"bind": "/portainer/Files/AppData/Config/pixel-server/auth.cfg",
+					"container": "/opt/pixel-server/auth.cfg"
+				},
+				{
+					"bind": "/portainer/Files/AppData/Config/pixel-server/pixelserver.cfg",
+					"container": "/opt/pixel-server/pixelserver.cfg"
+				},
+				{
+					"bind": "/portainer/Files/AppData/Config/pixel-server/users.cfg",
+					"container": "/opt/pixel-server/users.cfg"
+				},
+				{
+					"container": "/etc/crontabs/"
+				}
+			],
+			"privileged": true,
+			"note": "<h3>Template created by Pi-Hosted Series</h3><b>Check our Github page: <a href=\"https://github.com/pi-hosted/pi-hosted\" target=\"_blank\">https://github.com/pi-hosted/pi-hosted</a></b><br><br><b>Official Webpage: </b><a href=\"http://www.penguintutor.com/projects/pixel-server\" target=\"_blank\">http://www.penguintutor.com/projects/pixel-server</a><br><b>Official Docker Documentation: </b><a href=\"https://github.com/Macleykun/pixel-server\" target=\"_blank\">https://github.com/Macleykun/pixel-server</a><br><b>Pi-Hosted dedicated documentation: </b><a href=\"https://github.com/pi-hosted/pi-hosted/blob/master/docs/pixel-server_setup.md\" target=\"_blank\">pixel-server_setup.md</a><br><br><b><a href=\"https://github.com/pi-hosted/pi-hosted/blob/master/tools/install_pixel-server.sh\" target=\"_blank\">Pre-installation script</a> must be RAN before you install: </b>wget -qO- https://raw.githubusercontent.com/pi-hosted/pi-hosted/master/tools/install_pixel-server.sh | bash<br><br>"
+		},
 		{
 			"categories": [
 				"Video",

+ 40 - 0
template/apps/pixel-server.json

@@ -0,0 +1,40 @@
+{
+	"categories": [
+		"Other"
+	],
+	"description": "Wireless control of PixelStrips or NeoPixels using a web graphical interface running on a Raspberry Pi.",
+	"image_arm32": "macley/pixel-server:latest",
+	"image_arm64": "macley/pixel-server:latest",
+	"image_amd64": "macley/pixel-server:latest",
+	"logo": "https://lirp.cdn-website.com/c73f56a6/dms3rep/multi/opt/ir.appnice.controlpad_512x512-640w.png",
+	"name": "pixel-server",
+	"officialDoc": "https://github.com/Macleykun/pixel-server",
+    "piHostedDoc": "pixel-server_setup.md",
+    "preInstallScript": "install_pixel-server.sh",
+	"platform": "linux",
+	"ports": [
+		"85:80/tcp"
+	],
+	"restart_policy": "unless-stopped",
+	"title": "Pixel-server",
+	"type": 1,
+	"volumes": [
+		{
+			"bind": "/portainer/Files/AppData/Config/pixel-server/auth.cfg",
+			"container": "/opt/pixel-server/auth.cfg"
+		},
+		{
+			"bind": "/portainer/Files/AppData/Config/pixel-server/pixelserver.cfg",
+			"container": "/opt/pixel-server/pixelserver.cfg"
+		},
+		{
+			"bind": "/portainer/Files/AppData/Config/pixel-server/users.cfg",
+			"container": "/opt/pixel-server/users.cfg"
+		},
+		{
+			"container": "/etc/crontabs/"
+		}
+	],
+	"privileged": true,
+	"webpage": "http://www.penguintutor.com/projects/pixel-server"
+}

+ 35 - 0
template/portainer-v2-amd64.json

@@ -5411,6 +5411,41 @@
 			],
 			"note": "<h3>Template created by Pi-Hosted Series</h3><b>Check our Github page: <a href=\"https://github.com/pi-hosted/pi-hosted\" target=\"_blank\">https://github.com/pi-hosted/pi-hosted</a></b><br><br><b>Official Webpage: </b><a href=\"http://piwigo.org/\" target=\"_blank\">http://piwigo.org/</a><br><b>Official Docker Documentation: </b><a href=\"https://docs.linuxserver.io/images/docker-piwigo\" target=\"_blank\">https://docs.linuxserver.io/images/docker-piwigo</a><br><br><br>"
 		},
+		{
+			"categories": [
+				"Other"
+			],
+			"description": "Wireless control of PixelStrips or NeoPixels using a web graphical interface running on a Raspberry Pi.",
+			"image": "macley/pixel-server:latest",
+			"logo": "https://lirp.cdn-website.com/c73f56a6/dms3rep/multi/opt/ir.appnice.controlpad_512x512-640w.png",
+			"name": "pixel-server",
+			"platform": "linux",
+			"ports": [
+				"85:80/tcp"
+			],
+			"restart_policy": "unless-stopped",
+			"title": "Pixel-server",
+			"type": 1,
+			"volumes": [
+				{
+					"bind": "/portainer/Files/AppData/Config/pixel-server/auth.cfg",
+					"container": "/opt/pixel-server/auth.cfg"
+				},
+				{
+					"bind": "/portainer/Files/AppData/Config/pixel-server/pixelserver.cfg",
+					"container": "/opt/pixel-server/pixelserver.cfg"
+				},
+				{
+					"bind": "/portainer/Files/AppData/Config/pixel-server/users.cfg",
+					"container": "/opt/pixel-server/users.cfg"
+				},
+				{
+					"container": "/etc/crontabs/"
+				}
+			],
+			"privileged": true,
+			"note": "<h3>Template created by Pi-Hosted Series</h3><b>Check our Github page: <a href=\"https://github.com/pi-hosted/pi-hosted\" target=\"_blank\">https://github.com/pi-hosted/pi-hosted</a></b><br><br><b>Official Webpage: </b><a href=\"http://www.penguintutor.com/projects/pixel-server\" target=\"_blank\">http://www.penguintutor.com/projects/pixel-server</a><br><b>Official Docker Documentation: </b><a href=\"https://github.com/Macleykun/pixel-server\" target=\"_blank\">https://github.com/Macleykun/pixel-server</a><br><b>Pi-Hosted dedicated documentation: </b><a href=\"https://github.com/pi-hosted/pi-hosted/blob/master/docs/pixel-server_setup.md\" target=\"_blank\">pixel-server_setup.md</a><br><br><b><a href=\"https://github.com/pi-hosted/pi-hosted/blob/master/tools/install_pixel-server.sh\" target=\"_blank\">Pre-installation script</a> must be RAN before you install: </b>wget -qO- https://raw.githubusercontent.com/pi-hosted/pi-hosted/master/tools/install_pixel-server.sh | bash<br><br>"
+		},
 		{
 			"categories": [
 				"Video",

+ 35 - 0
template/portainer-v2-arm32.json

@@ -4760,6 +4760,41 @@
 			],
 			"note": "<h3>Template created by Pi-Hosted Series</h3><b>Check our Github page: <a href=\"https://github.com/pi-hosted/pi-hosted\" target=\"_blank\">https://github.com/pi-hosted/pi-hosted</a></b><br><br><b>Official Webpage: </b><a href=\"http://piwigo.org/\" target=\"_blank\">http://piwigo.org/</a><br><b>Official Docker Documentation: </b><a href=\"https://docs.linuxserver.io/images/docker-piwigo\" target=\"_blank\">https://docs.linuxserver.io/images/docker-piwigo</a><br><br><br>"
 		},
+		{
+			"categories": [
+				"Other"
+			],
+			"description": "Wireless control of PixelStrips or NeoPixels using a web graphical interface running on a Raspberry Pi.",
+			"image": "macley/pixel-server:latest",
+			"logo": "https://lirp.cdn-website.com/c73f56a6/dms3rep/multi/opt/ir.appnice.controlpad_512x512-640w.png",
+			"name": "pixel-server",
+			"platform": "linux",
+			"ports": [
+				"85:80/tcp"
+			],
+			"restart_policy": "unless-stopped",
+			"title": "Pixel-server",
+			"type": 1,
+			"volumes": [
+				{
+					"bind": "/portainer/Files/AppData/Config/pixel-server/auth.cfg",
+					"container": "/opt/pixel-server/auth.cfg"
+				},
+				{
+					"bind": "/portainer/Files/AppData/Config/pixel-server/pixelserver.cfg",
+					"container": "/opt/pixel-server/pixelserver.cfg"
+				},
+				{
+					"bind": "/portainer/Files/AppData/Config/pixel-server/users.cfg",
+					"container": "/opt/pixel-server/users.cfg"
+				},
+				{
+					"container": "/etc/crontabs/"
+				}
+			],
+			"privileged": true,
+			"note": "<h3>Template created by Pi-Hosted Series</h3><b>Check our Github page: <a href=\"https://github.com/pi-hosted/pi-hosted\" target=\"_blank\">https://github.com/pi-hosted/pi-hosted</a></b><br><br><b>Official Webpage: </b><a href=\"http://www.penguintutor.com/projects/pixel-server\" target=\"_blank\">http://www.penguintutor.com/projects/pixel-server</a><br><b>Official Docker Documentation: </b><a href=\"https://github.com/Macleykun/pixel-server\" target=\"_blank\">https://github.com/Macleykun/pixel-server</a><br><b>Pi-Hosted dedicated documentation: </b><a href=\"https://github.com/pi-hosted/pi-hosted/blob/master/docs/pixel-server_setup.md\" target=\"_blank\">pixel-server_setup.md</a><br><br><b><a href=\"https://github.com/pi-hosted/pi-hosted/blob/master/tools/install_pixel-server.sh\" target=\"_blank\">Pre-installation script</a> must be RAN before you install: </b>wget -qO- https://raw.githubusercontent.com/pi-hosted/pi-hosted/master/tools/install_pixel-server.sh | bash<br><br>"
+		},
 		{
 			"categories": [
 				"Video",

+ 35 - 0
template/portainer-v2-arm64.json

@@ -5435,6 +5435,41 @@
 			],
 			"note": "<h3>Template created by Pi-Hosted Series</h3><b>Check our Github page: <a href=\"https://github.com/pi-hosted/pi-hosted\" target=\"_blank\">https://github.com/pi-hosted/pi-hosted</a></b><br><br><b>Official Webpage: </b><a href=\"http://piwigo.org/\" target=\"_blank\">http://piwigo.org/</a><br><b>Official Docker Documentation: </b><a href=\"https://docs.linuxserver.io/images/docker-piwigo\" target=\"_blank\">https://docs.linuxserver.io/images/docker-piwigo</a><br><br><br>"
 		},
+		{
+			"categories": [
+				"Other"
+			],
+			"description": "Wireless control of PixelStrips or NeoPixels using a web graphical interface running on a Raspberry Pi.",
+			"image": "macley/pixel-server:latest",
+			"logo": "https://lirp.cdn-website.com/c73f56a6/dms3rep/multi/opt/ir.appnice.controlpad_512x512-640w.png",
+			"name": "pixel-server",
+			"platform": "linux",
+			"ports": [
+				"85:80/tcp"
+			],
+			"restart_policy": "unless-stopped",
+			"title": "Pixel-server",
+			"type": 1,
+			"volumes": [
+				{
+					"bind": "/portainer/Files/AppData/Config/pixel-server/auth.cfg",
+					"container": "/opt/pixel-server/auth.cfg"
+				},
+				{
+					"bind": "/portainer/Files/AppData/Config/pixel-server/pixelserver.cfg",
+					"container": "/opt/pixel-server/pixelserver.cfg"
+				},
+				{
+					"bind": "/portainer/Files/AppData/Config/pixel-server/users.cfg",
+					"container": "/opt/pixel-server/users.cfg"
+				},
+				{
+					"container": "/etc/crontabs/"
+				}
+			],
+			"privileged": true,
+			"note": "<h3>Template created by Pi-Hosted Series</h3><b>Check our Github page: <a href=\"https://github.com/pi-hosted/pi-hosted\" target=\"_blank\">https://github.com/pi-hosted/pi-hosted</a></b><br><br><b>Official Webpage: </b><a href=\"http://www.penguintutor.com/projects/pixel-server\" target=\"_blank\">http://www.penguintutor.com/projects/pixel-server</a><br><b>Official Docker Documentation: </b><a href=\"https://github.com/Macleykun/pixel-server\" target=\"_blank\">https://github.com/Macleykun/pixel-server</a><br><b>Pi-Hosted dedicated documentation: </b><a href=\"https://github.com/pi-hosted/pi-hosted/blob/master/docs/pixel-server_setup.md\" target=\"_blank\">pixel-server_setup.md</a><br><br><b><a href=\"https://github.com/pi-hosted/pi-hosted/blob/master/tools/install_pixel-server.sh\" target=\"_blank\">Pre-installation script</a> must be RAN before you install: </b>wget -qO- https://raw.githubusercontent.com/pi-hosted/pi-hosted/master/tools/install_pixel-server.sh | bash<br><br>"
+		},
 		{
 			"categories": [
 				"Video",

+ 17 - 0
tools/install_pixel-server.sh

@@ -0,0 +1,17 @@
+#!/bin/bash
+
+function error {
+  echo -e "\\e[91m$1\\e[39m"
+  exit 1
+}
+
+echo "Enabling spi and i2c communication"
+sudo raspi-config nonint do_spi 0
+sudo raspi-config nonint do_i2c 0
+echo "Creating directory..."
+sudo mkdir /portainer/Files/AppData/Config/pixel-server/
+echo "Downloading config files and configuring partly"
+sudo touch /portainer/Files/AppData/Config/pixel-server/users.cfg 
+sudo sh -c "echo 'network_allow_auth = 0.0.0.0' > /portainer/Files/AppData/Config/pixel-server/auth.cfg"
+sudo wget https://raw.githubusercontent.com/penguintutor/pixel-server/main/defaults.cfg -O /portainer/Files/AppData/Config/pixel-server/pixelserver.cfg
+echo "Done You are ready to goto next step in the install document"