This is my private thing that I use everyday, deployed at www.nevdelap.com/chat (behind auth), because it does exactly what I want and nothing else.
paru -Sy unzip
# Install micromamba using the package manager.
mkdir -p ~/reflex &&
cd ~/reflex &&
git clone [email protected]:nevdelap/droplet.git &&
git clone [email protected]:nevdelap/nevschat.git &&
cd nevschat &&
git submodule init &&
git submodule update &&
scripts/install_dev &&
micromamba activate nevschat
cd app &&
reflex run # Test at http://localhost:3000/
cd reflex &&
git fetch &&
git checkout v0.4.6 &&
cd .. &&
git add reflex &&
git commit -m 'Update reflex.' &&
pip install -e reflex
This shows scripts/lint
being run manually though it can be run automatically
with scripts/install_hooks
.
git add . &&
git commit -m 'whatever' &&
scripts/lint &&
git push --force origin HEAD:master --no-verify &&
git tag --force latest &&
git push --force origin latest --no-verify &&
ssh_droplet "cd ~/nevschat && scripts/deploy && sleep 30 && scripts/logs"
This is used as lpd
- lint, push, deploy.
#!/bin/bash
current_dir="$(basename "$(pwd)")"
if [[ "$current_dir" == "droplet" ]]; then
echo 'Pushing droplet.'
git push --force origin HEAD:master
git push --tags
ssh_droplet "
cd ~/droplet &&
git fetch &&
git checkout origin/master &&
chmod 0700 /etc/monit/monitrc &&
monit reload
"
elif [[ "$current_dir" == "nevschat" ]]; then
echo 'Linting, pushing, and deploying nevschat.'
scripts/lint &&
git push --force origin HEAD:master --no-verify &&
git tag --force latest &&
git push --force origin latest --no-verify &&
ssh_droplet "
cd ~/droplet &&
git fetch &&
git checkout origin/master &&
monit reload &&
cd ~/nevschat &&
scripts/deploy &&
sleep 30 &&
scripts/logs
"
fi
The OpenAI key is supplied in the OPENAI_API_KEY environment variable. It should be configured with a monthly budget and email notification when it is exceeded.
The Google TTS API key is supplied in the GOOGLE_TTS_KEY environment variable. It should be restricted to be usable only for the Cloud Text-to-Speech API, and only from the production and development IP addresses.
The DeepL auth key is supplied in the DEEPL_AUTH_KEY environment variable. So far I'm on the free tier so I haven't configured any restrictions on it yet.