Add README

This commit is contained in:
2026-03-08 12:05:52 -06:00
parent 408ba800d7
commit 660799a074

96
README.md Normal file
View File

@@ -0,0 +1,96 @@
# Protocast
Casts laser computer screens to the LCARS1 display above Trotec at Protospace.
## Theory
Start and stop Protocast shortcuts on the desktop of each laser PC run a PowerShell script that sends POST requests to the script running on LCARS.
The shortcut sends ie. `machine=trotec` POST data to `/cast` route to start casting. The script runs a `xtightvncviewer -viewonly -fullscreen [IP]` command via subprocess to VNC into the respective machine.
A POST to `/stop` runs `killall xtightvncviewer`.
## Setup
### Script
Log into display computer, clone script:
```
$ ssh protospace@10.139.88.128
$ sudo apt install git python3 python3-pip python3-virtualenv supervisor xtightvncviewer
$ git clone https://github.com/Protospace/protocast.git
$ cd protocast/
$ virtualenv -p python3 env
$ . env/bin/activate
(env) $ pip install -r requirements.txt
(env) $ python main.py
```
To deploy, edit `/etc/supervisor/conf.d/protocast.conf`:
```
[program:protocast]
user=protospace
directory=/home/protospace/protocast
command=/home/protospace/protocast/env/bin/python -u main.py
stopsignal=INT
stopasgroup=true
killasgroup=true
autostart=true
autorestart=true
stderr_logfile=/var/log/protocast.log
stderr_logfile_maxbytes=10MB
stdout_logfile=/var/log/protocast.log
stdout_logfile_maxbytes=10MB
```
Load config:
```
$ sudo supervisorctl reread; sudo supervisorctl update
```
### Windows Computer
Setting up a pc for casting to the display above the trotec:
- Example case is "xtool" - change to accomodate actual machine name (ex: "108mediapc")
- Assumes the machine is already on the Windows domain
Step 1: Assign the computer a static IP:
- Get the ethernet MAC address
- Go to pfsense
- Grant the machine a static IP in it's vlan if not already done so (steps not described here)
*Note that if not already static, the IP cannot remain the same as it is, as static IPs cannot be granted from the general DHCP Pool with pfsense. (unnkown if the new "Kea" dhcp server for pfsense can do this, however it is feature-incomplete and has issues known to current IT admins of PS as of 2026-03-08, remain on ISC dhcp server for the time being.
Step 2: Install tightVNC server:
- Grab tightVNC server from https://www.tightvnc.com/download.php
- Install, in "Complete" mode
- At the next prompt, check "Run only as a system service, disable user application mode"
- When prompted, uncheck password, check no password *** SUBJECT TO CHANGE, THIS PROCESS IS BEING LOOKED AT FOR IMPROVEMENT**
Step 3: Copy the files:
*At time of writing, ensure to use the "xtool" computer as the source for this step, as it has fixes for improved security in newer Powershell versions, required in Windows 11, possibly in newer patches in Windows 10 as well) -- these fixes are yet to be applied to other machines (2026-03-08)*
- Copy `C:\windows\psfiles\protocast*` files from another machine to this machine's `C:\windows\psfiles` folder
- Copy the Protocast ON and Protocast OFF files from another machine to this machine's `C:\Users\Public\Desktop\` folder (the "all users" desktop, otherwise it would only appear on *your user's* desktop
- Right-Click protocast.cmd (shortcut) in `C:\windows\psfiles` and click properties
- change the name after the space to a unique name for this machine (all lowercase, no spaces, should indicate the machine's purpose not the exact machine name, as should remain the same if the machine is replaced with a new PC. Ex: "108mediapc", click OK
- Right click "Protocast ON" (shortcut) in `C:\Users\Public\Desktop\` and repeat the step above with the same name.
- Right click "protocast.ps1" (Powershell script) in `C:\windows\psfiles\` and edit the file (notepad is fine)
- in the param section, add a new valid string for the name you chose in previous steps, ex: `[ValidateSet("thunder", "xtool", "trotec", "stop")]` becomes `[ValidateSet("thunder", "xtool", "trotec", "108mediapc", "stop")]`
- in the switch ($Action) section, copy another PC's section ("{...}") to create the new entry, if machines from multiple areas of the shop exist, choose one to copy from that already casts to the screen that you wish this new computer to cast to.
- In your pasted copy, update the name in the two places (first line of the copied section, and the "machine" = "xyz" line, again, using the same name chosen previously.
Step 4: Ensure auto-stop on logout applies (AD):
If the computer is not in the "Laser Computers OU" in AD, a GPO for a logoff script to run the "Off" command on user logout will need to be created that applies to this machine -- this is not a default on all machines as this script doesn't exist on most machines (possible improvement in the future -- compatible script that does nothing could be used as a placeholder, allowing the GPO to "run everywhere by default"). Copy from the existing Group Policy applying in the Laser Computers OU, ensuring to scope to only the computer(s) that have protocast set up, and the default "authenticated users" scope item is removed. After doing this step, run a "gpupdate /force" on the target computer and reboot it.
Step 5: update the display linux machine's scripts to know new computer:
- edit `main.py` and add an `elif` case for the machine's name that gets sent by the shortcut
- duplicate the `def cast_thunder()` function and make it specific to the new machine that was added
- make sure the IP address matches the one assigned earlier