#!/usr/bin/env bash # The development server on http://127.0.0.1:8040 without login, with the # invented demo people and their documents, against the database of # scripts/dev-db.sh. The documents lie in .dev/files (git ignores .dev/) under # a file key made on the first run. With VISA_DEV_S3=1 they lie in the bucket # of scripts/dev-garage.sh instead, as on the server; files that lay in # .dev/files before move there with # `./target/debug/visa files-migrate --from .dev/files` under the same settings. set -euo pipefail cd "$(dirname "$0")/.." export VISA_DATABASE_URL=${VISA_DATABASE_URL:-postgres://visa:visa-dev@127.0.0.1:55438/visa} export VISA_INSECURE_NO_LOGIN=1 export VISA_LISTEN=${VISA_LISTEN:-127.0.0.1:8040} mkdir -p .dev [ -s .dev/files.key ] || od -An -N32 -tx1 /dev/urandom | tr -d ' \n' > .dev/files.key # relative paths: a Windows build reads them the same export VISA_FILES_KEY_FILE=${VISA_FILES_KEY_FILE:-.dev/files.key} if [ "${VISA_DEV_S3:-}" = 1 ]; then bash scripts/dev-garage.sh # starts it when it is stopped . .dev/garage.env export VISA_S3_ENDPOINT=$VISA_TEST_S3_ENDPOINT export VISA_S3_BUCKET=$VISA_TEST_S3_BUCKET export VISA_S3_ACCESS_KEY_ID=$VISA_TEST_S3_ACCESS_KEY_ID export VISA_S3_SECRET_ACCESS_KEY_FILE=$VISA_TEST_S3_SECRET_FILE unset VISA_FILES_DIR else export VISA_FILES_DIR=${VISA_FILES_DIR:-.dev/files} fi cargo build -q ./target/debug/visa seed-demo exec ./target/debug/visa serve