The primary interface for user interaction.
- Authy-API - Authentication API service
- Requirements
- Quick Start
- Docker Setup
- API Usage
- Admin UI Management
- Configuration
- Development
- API Documentation
- Resources
- Go 1.24.0+
- SQLite (SQLCipher optional, see Security)
- RabbitMQ (for worker service)
- Matrix Authentication Service (MAS) - See Matrix Client setup for configuration details
- Matrix Client - See Matrix Client repository for setup instructions
For SQLCipher support (encrypted database):
sudo apt-get update
sudo apt-get install -y libsqlite3-dev libsqlcipher-devgit clone https://github.com/shortmesh/Interface-API.git
cd Interface-API
make setup
make migrate-up
make run- Server: http://localhost:8080
- Swagger Docs: http://localhost:8080/docs/index.html
- Admin Dashboard: http://localhost:8080/admin
# Build
docker build -t interface-api .
# Run
docker run -d --name interface-api -p 8080:8080 \
-v $(pwd)/data:/app/data \
-v $(pwd)/.env:/app/.env \
interface-api
# View logs
docker logs -f interface-apiIf AUTO_MIGRATE is disabled, run migrations first:
docker run --rm -v $(pwd)/data:/app/data -v $(pwd)/.env:/app/.env interface-api ./migrate -action=upFor database encryption, add build arg and configure .env:
docker build --build-arg ENABLE_DB_ENCRYPTION=true -t interface-api .Set DISABLE_DB_ENCRYPTION=false and DB_ENCRYPTION_KEY in your .env.
version: '3.8'
services:
rabbitmq:
image: rabbitmq:3-management-alpine
ports:
- "5672:5672"
- "15672:15672"
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
migrate:
build: .
command: ./migrate -action=up
volumes:
- ./data:/app/data
- ./.env:/app/.env
depends_on:
- rabbitmq
api:
build: .
ports:
- "8080:8080"
volumes:
- ./data:/app/data
- ./.env:/app/.env
environment:
- HOST=0.0.0.0
- PORT=8080
- RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672/
depends_on:
- rabbitmq
- migratedocker-compose up -d
# View logs
docker-compose logs -f apiFor detailed information on using the API, see the API Usage Guide.
Access the web-based admin dashboard at http://localhost:8080/admin to manage Matrix tokens and devices through a graphical interface.
For detailed information on using the Admin UI, see the Admin UI Management Guide.
Note
default.env contains operational default values. Only modify if you know what you're doing.
Copy example.env to .env and configure as needed:
cp example.env .env
# Or use: make setup (auto-generates keys)Tip
Use make setup to automatically generate secure cryptographic keys
APP_MODE- Application mode:developmentorproduction- Production mode enforces HTTPS for server and external services (unless overridden)
- Development mode has relaxed security settings
HOST- Host address (default:127.0.0.1)PORT- Port (default:8080)
In production mode (APP_MODE=prod), the server requires HTTPS unless explicitly disabled:
TLS_CERT_FILE- Path to TLS certificate fileTLS_KEY_FILE- Path to TLS private key file
Warning
Use these overrides with caution in production
ALLOW_INSECURE_SERVER=true- Allow HTTP in production (use behind reverse proxy with TLS termination)ALLOW_INSECURE_EXTERNAL=true- Allow HTTP/WS for external services in productionDISABLE_DB_ENCRYPTION=true- Disable SQLCipher encryption (use standard SQLite for development)
The following environment variables must be set for the application to function properly:
Important
Auto-generated by make setup. Do not change after initial setup - will invalidate existing data.
HASH_KEY- HMAC key for tokens (generate:openssl rand -base64 32)DB_ENCRYPTION_KEY- SQLCipher key (generate:openssl rand -hex 32, required if encryption enabled)
CLIENT_ID- Client ID for API access (generate:openssl rand -hex 16)CLIENT_SECRET- Client secret for API access (generate:openssl rand -hex 32)
Important
These services must be set up and running before starting the Interface API. See Matrix Client repository for setup instructions for both MAS and the Matrix Client.
MAS_ADMIN_URL- MAS admin API URLADMIN_CLIENT_ID- Admin client ID for MASADMIN_CLIENT_SECRET- Admin client secret for MASMATRIX_CLIENT_URL- Matrix client URL
See example.env for all options.
make setup # Setup .env with auto-generated keys
make run # Start API server
make worker # Start message worker
make build # Build binaries
make test # Run tests
make docs # Generate Swagger docsNote
make run, make worker, and make build automatically detect the DISABLE_DB_ENCRYPTION setting in your .env and use the appropriate SQLite driver (SQLCipher or standard SQLite).
make migrate-up # Run pending
make migrate-down # Rollback last
make migrate-status # Show statusSee Migration Guide for details.
- Swagger UI: http://localhost:8080/docs/index.html
- Regenerate:
make docs