A secure web service that executes CLI commands based on authenticated HTTP requests.
814
A secure web service that executes CLI commands based on authenticated HTTP requests.
Install Docker and Docker Compose on your Ubuntu system:
sudo apt-get update
sudo apt-get install docker.io docker-compose
get docker-compose.yaml file
download .env.example file and Configure your environment variables in .env file
Build and start the containers:
docker-compose up -d
The service will be available on port 80 (Nginx) and 3000 (direct access).
Install dependencies:
npm install
Configure your environment variables in .env:
Configure Nginx:
Install as a service (Ubuntu):
sudo chmod +x install-service.sh
sudo ./install-service.sh
This will:
Manual start (if not using service):
npm start
To trigger the CLI command, send a POST request to /api/trigger with your API key:
curl -X POST http://localhost/api/trigger \
-H "X-API-Key: your-api-key-here"
Access the health check endpoint:
curl http://localhost/health
# Start services
docker-compose up -d
# Stop services
docker-compose down
# View logs
docker-compose logs -f
# Rebuild and restart
docker-compose up -d --build
Once installed as a service, you can manage it using systemctl:
sudo systemctl start cicd-cli-controller # Start the service
sudo systemctl stop cicd-cli-controller # Stop the service
sudo systemctl restart cicd-cli-controller # Restart the service
sudo systemctl status cicd-cli-controller # Check service status
The project includes GitHub Actions workflow that automatically:
To set up GitHub Actions:
Add these secrets to your GitHub repository:
DOCKERHUB_USERNAME: Your Docker Hub usernameDOCKERHUB_TOKEN: Your Docker Hub access token (not password)Push to the main branch or create a tag to trigger the workflow
Content type
Image
Digest
sha256:20693768a…
Size
76.4 MB
Last updated
3 days ago
docker pull yiiman/api-cli:sha-53e03877c9e1ee015126567d557dbcf245d0cd8e