diff --git a/Service%EF%BC%9AMeTube.md b/Service%EF%BC%9AMeTube.md new file mode 100644 index 0000000..1280268 --- /dev/null +++ b/Service%EF%BC%9AMeTube.md @@ -0,0 +1,68 @@ +# 安裝相關套件 + +```bash +apt update && apt install -y git nodejs npm curl ffmpeg +``` + +# 下載 MeTube + +```bash +git clone https://github.com/alexta69/metube.git +``` + +# 安裝 MeTube + +## 前端 + +```bash +cd ~/metube/ui && npm install && node_modules/.bin/ng build +``` + +## 後端 + +```bash +cd ~/metube && curl -LsSf https://astral.sh/uv/install.sh | sh && uv sync +``` + +設定環境變數 + +```bash +echo 'source $HOME/.local/bin/env' >> ~/.bashrc && source ~/.bashrc +``` + +# 執行 MeTube + +```bash +uv run python3 app/main.py +``` + +# 設計 MeTube 服務 + +```bash +nano /etc/systemd/system/metube.service +``` + +服務檔內容 + +```ini +[Unit] +Description=MeTube + +[Service] +Type=simple +WorkingDirectory=/root/metube +ExecStart=/root/.local/bin/uv run python3 app/main.py +Restart=always +User=root + +[Install] +WantedBy=multi-user.target +``` + +啟動服務 + +```bash +systemctl daemon-reload && systemctl enable metube.service && systemctl start metube.service +``` + +# 連接埠 8081 \ No newline at end of file