diff --git a/.env.sample b/.env.sample index 754c227..d1ff225 100644 --- a/.env.sample +++ b/.env.sample @@ -1,37 +1,59 @@ NODE_ENV=development APP_SALT=RANDOM_SEED -DB_FILE=database.sqlite + DB_NAME=retro-pilot DB_USER=root DB_PASS=root -DB_HOST=db # If using docker compose, this should match the container service name +# If using docker compose, this should match the container service name +DB_HOST=db DB_PORT=5432 -DB_FORCE_SYNC=false # Whether or not to DROP all tables and recreate to match the current models +# Whether or not to DROP all tables and recreate to match the current models +DB_FORCE_SYNC=false + ALLOW_REGISTRATION=true AUTH_2FA_ISSUER=RetroPilot + HTTP_INTERFACE=0.0.0.0 HTTP_PORT=3000 -CAN_SEND_MAIL=true # Set to false to skip sending mail, all attempted mail is logged under DEBUG -SMTP_HOST="localhost" # credentials for smtp server to send account registration mails. if not filled in, get the generated tokens from the server.log manually + +# Set to false to skip sending mail, all attempted mail is logged under DEBUG +CAN_SEND_MAIL=true +# credentials for smtp server to send account registration mails. if not filled in, get the generated tokens from the server.log manually +SMTP_HOST="localhost" SMTP_PORT=25 SMTP_USER=root SMTP_PASS= SMTP_FROM="no-reply@retropilot.org" -BASE_URL="http://192.168.1.165:3000/" # base url of the retropilot server -BASE_UPLOAD_URL="http://192.168.1.165:3000/backend/post_upload" # base url sent to devices for POSTing drives & logs -BASE_DRIVE_DOWNLOAD_URL="http://192.168.1.165:3000/realdata/" # base download url for drive & log data -BASE_DRIVE_DOWNLOAD_PATH_MAPPING="/realdata" # path mapping of above download url for expressjs, prefix with "/" -STORAGE_PATH="realdata/"# relative or absolute ( "/..." for absolute path ) + +# base url of the retropilot server +BASE_URL="http://192.168.1.165:3000/" +# base url sent to devices for POSTing drives & logs +BASE_UPLOAD_URL="http://192.168.1.165:3000/backend/post_upload" +# base download url for drive & log data +BASE_DRIVE_DOWNLOAD_URL="http://192.168.1.165:3000/realdata/" +# path mapping of above download url for expressjs, prefix with "/" +BASE_DRIVE_DOWNLOAD_PATH_MAPPING="/realdata" +# relative or absolute ( "/..." for absolute path ) +STORAGE_PATH="realdata/" CABANA_URL="http://192.168.1.165:3000/cabana/index.html" + DEVICE_STORAGE_QUOTA_MB=200000 DEVICE_EXPIRATION_DAYS=30 + WELCOME_MESSAGE="<><><><><><><><><><><><><><><><><><><><><><>
2022 RetroPilot" + USE_USER_ADMIN_API=0 + CLIENT_SOCKET_PORT=81 CLIENT_SOCKET_HOST="0.0.0.0" -ATHENA_ENABLED=1 # Enables Athena service -ATHENA_SECURE=1 # Disables crypto on Websocket server - use for testing on local network, change ATHENA_HOST in openpilot to ws:// instead of wss:// -ATHENA_API_RATE_LIMIT=100 # Maxmium hits to /realtime/* per 30s + +# Enables Athena service +ATHENA_ENABLED=1 +# Disables crypto on Websocket server - use for testing on local network, change ATHENA_HOST in openpilot to ws:// instead of wss:// +ATHENA_SECURE=1 +# Maxmium hits to /realtime/* per 30s +ATHENA_API_RATE_LIMIT=100 ATHENA_SOCKET_HOST="0.0.0.0" ATHENA_SOCKET_PORT=4040 -ATHENA_SOCKET_HEARTBEAT_FREQ=5000 # Higher the number = lower traffic, varies on how many devices are connected +# Higher the number = lower traffic, varies on how many devices are connected +ATHENA_SOCKET_HEARTBEAT_FREQ=5000 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7df7d1f..5f3ed94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,6 @@ jobs: - name: Build Docker image run: docker build -t retropilot-server:latest . - name: Run linter - run: docker run --rm -v $(pwd)/config.sample.js:/app/config.js retropilot-server:latest npm run lint + run: docker run --rm retropilot-server:latest npm run lint # - name: Run tests # run: docker run --rm -v $(pwd)/config.sample.js:/app/config.js retropilot-server:latest npm test diff --git a/.gitignore b/.gitignore index 47070dd..40a000b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,8 +10,6 @@ node_modules/ # Data realdata database -*.sqlite -test/.devKeys # Miscellaneous .DS_Store diff --git a/docker-compose.yml b/docker-compose.yml index a9ccfc3..4b56620 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,10 +6,14 @@ services: depends_on: - db volumes: - - ./:/app + - retropilot-realdata:/realdata ports: - "3000:3000" - "4040:4040" + env_file: + - .env + environment: + - STORAGE_PATH=/realdata worker: build: . command: npm run worker @@ -17,7 +21,11 @@ services: depends_on: - db volumes: - - ./:/app + - retropilot-realdata:/realdata + env_file: + - .env + environment: + - STORAGE_PATH=/realdata db: image: postgres:14-bullseye restart: always @@ -25,8 +33,12 @@ services: - '5438:5432' volumes: - ./sql/create_tables.sql:/docker-entrypoint-initdb.d/create_tables.sql - - ./data/postgres:/var/lib/postgresql/data + - retropilot-db:/var/lib/postgresql/data environment: POSTGRES_USER: ${DB_USER} POSTGRES_PASSWORD: ${DB_PASS} POSTGRES_DB: ${DB_NAME} + +volumes: + retropilot-realdata: + retropilot-db: