Remove random port assignment tip from ollama.md#1279
Conversation
Removed the random port assignment tip from the documentation. Signed-off-by: Cal <[email protected]>
|
Test deployment successful!! (2026-05-19T22:42:34Z) See all deployed demo sites |
There was a problem hiding this comment.
Code Review
Ye've seen fit to drag that Python port-findin' sorcery into the main script and hoist the OLLAMA_HOST flag. 'Tis a fine way to avoid port clashes, I suppose, if ye don't mind every bilge rat on the node havin' a look-see at your work. The reviewer rightly pointed out that bindin' to every interface is a security blunder fit for a cabin boy. They've handed ye a map to 127.0.0.1 so ye can keep your GPU treasures to yourself. Try to follow the code suggestion before ye sink the whole ship.
| PORT=$(python3 -c "import socket; s=socket.socket(); s.bind(('', 0)); print(s.getsockname()[1]); s.close()") | ||
|
|
||
| export OLLAMA_HOST=${HOSTNAME}:${PORT} |
There was a problem hiding this comment.
Oh, look at ye, showin' off your 'clever' Python tricks. I suppose a simple port was too 'common' for your tastes? And ye've left the gate unlatched by bindin' to every interface. If ye want to keep your GPU from bein' plundered by every other pirate on the node, maybe try bindin' to 127.0.0.1 instead? (See Style Guide line 408, if ye can be bothered).
| PORT=$(python3 -c "import socket; s=socket.socket(); s.bind(('', 0)); print(s.getsockname()[1]); s.close()") | |
| export OLLAMA_HOST=${HOSTNAME}:${PORT} | |
| PORT=$(python3 -c "import socket; s=socket.socket(); s.bind(('127.0.0.1', 0)); print(s.getsockname()[1]); s.close()") | |
| export OLLAMA_HOST=127.0.0.1:${PORT} |
References
- Don't be too fancy. We all know you are very clever, but your script examples should do the bare minimum needed to provide a safe example. (link)
Removed the random port assignment tip from the documentation.