Skip to content

Instantly share code, notes, and snippets.

@jrconlin
Created December 11, 2025 18:45
Show Gist options
  • Select an option

  • Save jrconlin/100f38cf2e9c0e26ddf4d33d1c358fa6 to your computer and use it in GitHub Desktop.

Select an option

Save jrconlin/100f38cf2e9c0e26ddf4d33d1c358fa6 to your computer and use it in GitHub Desktop.
Bash run script to start Autopush/Autoendpoint with configuration loading
#!/bin/bash
# Start an Autopush executable with logging
# The first argument (if specified) is the executable to run
# The second argument (if specified) is the data storage type to use.
# If you wish to use a different logging level than `trace`, use
# the `LOG_LEVEL` environment variable. (e.g.
#
# ```
# LOG_LEVEL=info bash run.bash autoendpoint
# ```
#
# This script presumes that you have configuration files declared in
# a `config` subdirectory that match the `application`_`data storage`.toml naming
# convention.
#
ulimit -s 64000
APP=${1:-autoconnect}
DB=${2:-bigtable}
if [ "$INDOCKER" == "1"]; then
HOST=$(ip route | awk '/default/ { print $3}')
else
HOST=localhost
fi
FEATURES="--features=$DB"
#
LOG_LEVEL=${LOG_LEVEL:-trace}
RUST_LOG=autopush=$LOG_LEVEL,autopush_common=$LOG_LEVEL,autoendpoint=$LOG_LEVEL,autoconnect=$LOG_LEVEL,slog_mozlog_json=info,warn
#
# For sanity sake, display the command we're trying to run.
echo RUST_LOG=$RUST_LOG cargo run --bin $APP $FEATURES $XTRA -- --config=configs/$APP\_$DB.toml
#RUST_LOG=$RUST_LOG cargo run --bin $APP $FEATURES $XTRA -- --config=configs/$APP\_$DB.toml
RUST_LOG=$RUST_LOG cargo run --bin $APP $FEATURES $XTRA -- --config=configs/${APP}_${DB}.toml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment