Changed pip to uv and fix nginx setup
This commit is contained in:
@ -12,7 +12,6 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
APP="huly"
|
|
||||||
REPO_URL="https://github.com/hcengineering/huly-selfhost.git"
|
REPO_URL="https://github.com/hcengineering/huly-selfhost.git"
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
@ -25,11 +24,14 @@ $STD git clone "$REPO_URL" /opt/huly-selfhost
|
|||||||
cd /opt/huly-selfhost || exit 1
|
cd /opt/huly-selfhost || exit 1
|
||||||
msg_ok "Cloned Huly repository"
|
msg_ok "Cloned Huly repository"
|
||||||
|
|
||||||
|
msg_info "Setup uv"
|
||||||
|
setup_uv
|
||||||
|
msg_ok "Setup uv"
|
||||||
|
|
||||||
msg_info "Setting up Python environment"
|
msg_info "Setting up Python environment"
|
||||||
$STD python3 -m venv venv
|
$STD uv venv venv
|
||||||
$STD ./venv/bin/pip install --upgrade pip
|
|
||||||
if [ -f requirements.txt ]; then
|
if [ -f requirements.txt ]; then
|
||||||
$STD ./venv/bin/pip install -r requirements.txt
|
$STD uv pip install --python venv/bin/python -r requirements.txt
|
||||||
fi
|
fi
|
||||||
msg_ok "Python environment ready"
|
msg_ok "Python environment ready"
|
||||||
|
|
||||||
@ -43,17 +45,37 @@ msg_info "Configuring Huly"
|
|||||||
if [ -f config.sh ]; then
|
if [ -f config.sh ]; then
|
||||||
$STD ./config.sh
|
$STD ./config.sh
|
||||||
fi
|
fi
|
||||||
if [ -f nginx.sh ]; then
|
|
||||||
$STD ./nginx.sh
|
|
||||||
fi
|
|
||||||
msg_ok "Huly configured"
|
msg_ok "Huly configured"
|
||||||
|
|
||||||
msg_info "Configuring nginx"
|
msg_info "Configuring nginx"
|
||||||
$STD ln -sf /opt/huly-selfhost/nginx.conf /etc/nginx/sites-enabled/huly.conf
|
# Create our own nginx configuration
|
||||||
$STD nginx -s reload
|
cat <<EOF >/etc/nginx/sites-available/huly.conf
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://127.0.0.1:8080;
|
||||||
|
proxy_set_header Host \$host;
|
||||||
|
proxy_set_header X-Real-IP \$remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Enable the site
|
||||||
|
$STD ln -sf /etc/nginx/sites-available/huly.conf /etc/nginx/sites-enabled/huly.conf
|
||||||
|
|
||||||
|
# Test nginx configuration before reloading
|
||||||
|
if nginx -t >/dev/null 2>&1; then
|
||||||
|
$STD nginx -s reload
|
||||||
|
else
|
||||||
|
msg_error "nginx configuration test failed, skipping reload"
|
||||||
|
fi
|
||||||
msg_ok "nginx configured"
|
msg_ok "nginx configured"
|
||||||
|
|
||||||
msg_info "Creating systemd service for Huly (example, adjust as needed)"
|
msg_info "Creating systemd service for Huly"
|
||||||
cat <<EOF >/etc/systemd/system/huly.service
|
cat <<EOF >/etc/systemd/system/huly.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Huly Web Service
|
Description=Huly Web Service
|
||||||
@ -61,7 +83,7 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/opt/huly-selfhost
|
WorkingDirectory=/opt/huly-selfhost
|
||||||
ExecStart=/opt/huly-selfhost/venv/bin/python main.py
|
ExecStart=/usr/bin/python3 -m http.server 8080
|
||||||
Restart=always
|
Restart=always
|
||||||
User=root
|
User=root
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user