Skip to content

Latest commit

 

History

History
138 lines (96 loc) · 3.13 KB

File metadata and controls

138 lines (96 loc) · 3.13 KB

Installation

To run Airstation on your machine, there are two ways: using Docker (recommended) or building it yourself using the Go compiler for server, Node.js with npm for web clients and also have FFmpeg installed on your system.

Docker

  1. Clone Airstation repository

    git clone https://github.com/cheatsnake/airstation.git
    cd ./airstation
  2. Setup environment variables

    Next you need an .env file with secret keys

    touch .env

    Inside this file you must define 2 variables:

    AIRSTATION_SECRET_KEY=
    AIRSTATION_JWT_SIGN=
    

    AIRSTATION_SECRET_KEY - the secret key you need to log in to the station control panel
    AIRSTATION_JWT_SIGN - the key to sign the JWT session

    Use random string generator with a length of at least 10 characters for these variables!

  3. Build a docker image and start a new container

    docker compose up -d

And finally you can see:

To stop the container, just type:

docker compose down

Docker Compose

You can get pre-built image from Docker Hub and run it quickly with custom docker-compose.yml file as shown bellow:

# docker-compose.yml
services:
  airstation:
    image: cheatsnake/airstation:latest
    ports:
      - "7331:7331"
    volumes:
      - airstation-data:/app/storage
      - ./static:/app/static
    restart: unless-stopped
    environment:
      AIRSTATION_SECRET_KEY: ${AIRSTATION_SECRET_KEY:-PASTE_YOUR_OWN_KEY}
      AIRSTATION_JWT_SIGN: ${AIRSTATION_JWT_SIGN:-PASTE_RANDOM_STRING}
    healthcheck:
      test: ["CMD", "wget", "--spider", "-q", "http://localhost:7331/"]
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 10s

volumes:
  airstation-data:

Don't forget to modify environment variables inside this file or via your own .env file in the same directory as the docker-compose.yml

Build from source

  1. Follow steps 1 and 2 from the previous section

  2. Install dependencies

npm ci --prefix ./web/player
npm ci --prefix ./web/studio
  1. Build web clients
npm run build --prefix ./web/player
npm run build --prefix ./web/studio
  1. Build server
go build ./cmd/main.go
  1. Run app
./main

Make sure you have FFmpeg installed on your system.

See the result on http://localhost:7331 and http://localhost:7331/studio/ (extra slash matters!)

Development mode

To run the application in development mode, start each part of the application using the commands below:

npm run dev --prefix ./web/player
npm run dev --prefix ./web/studio
go run ./cmd/main.go