Skip to content

Latest commit

 

History

History
executable file
·
115 lines (79 loc) · 2.51 KB

README.md

File metadata and controls

executable file
·
115 lines (79 loc) · 2.51 KB

🚀 Alternate Method for Linux Deployment Without SSH Access

This app allows you to deploy your application using GitHub Actions over http without requiring SSH access. The process involves sending your binary file to the server, where the app will receive it and execute the commands you specify.

Architecture Diagram

How to Build, Install and Run

Build

cd cmd
./build_script.sh
cd ..

Run App

Run Using PM2

cd build
pm2 start package.json
cd ..

Run Binary File Directly

cd build
./http-remote-access

If you're on Windows:

cd build
http-remote-access.exe

🌐 API Access

This server exposes three HTTP POST endpoints for uploading and running scripts with streaming logs.

Authentication

To enable API key authentication, set environment variable API_KEY before running the app.

export API_KEY="your-super-secret-token"
./http-remote-access

When API_KEY is set, every request must include one of these headers:

  • X-API-Key: <token>
  • Authorization: Bearer <token>

If API_KEY is empty, authentication is disabled.


1. POST /upload-only

Upload a ZIP file which will be extracted on the server.

  • Content-Type: multipart/form-data
  • Form fields:
    • file (required): ZIP file to upload and extract
    • target (required): target directory to extract the ZIP contents into

Example using curl:

curl -X POST http://<your-domain>/upload-only \
  -H "X-API-Key: <token>" \
  -F "file=@./your-archive.zip" \
  -F "target=/path/to/extract"

2. POST /upload-script

Upload a ZIP file, extract it, then run a shell script.

  • Content-Type: multipart/form-data
  • Form fields:
    • file (required): ZIP file to upload and extract
    • target (required): target directory to extract the ZIP contents into
    • script (required): shell command/script to run inside the target directory after extraction

Example using curl:

curl -X POST http://<your-domain>/upload-script \
  -H "X-API-Key: <token>" \
  -F "file=@./your-archive.zip" \
  -F "target=/path/to/extract" \
  -F "script=./deploy.sh"

3. POST /run-script

Run a shell script on the server without uploading anything.

  • Content-Type: multipart/form-data
  • Form fields:
    • script (required): shell command/script to execute

Example using curl:

curl -X POST http://<your-domain>/run-script \
  -H "X-API-Key: <token>" \
  -d "script=./deploy.sh" \