Run container
1. Get Repository
git clone https://github.com/rolestack/adow.git
cd auto-disable-opnsense-wireguard
2. Create Docker secret files
- API_KEY: (secret path is referenced in
docker-compose.yaml
) - API_SECRET: (secret path is referenced in
docker-compose.yaml
)
3. Configuration
.env
(seeenv.example
for reference)
# (Required) Health check URL
## This URL is used to check if the service is running
HEALTH_CHECK_URL='http://localhost:8080/health'
# (Required) OPNSense WireGuard API URL
## This URL is used to check the status of the WireGuard connection
## The API key and secret are used to authenticate with the OPNSense API
OPNSENSE_WIREGUARD_API_URL='https://opnsense.example.com/api/wireguard'
# (Required) OPNsense user api token
## This is the API token used to authenticate with the OPNSense API
## The token should have the necessary permissions to access the WireGuard status
## The token should be stored in a secure location
API_KEY_SECRET_NAME='api-key'
API_SECRET_SECRET_NAME='api-secret'
# (Optional) Mattermost alert
# MM_ENABLE='false' # Default
# (Required) Mattermost webhook URL and channel
MM_URL='https://mattermost.example.com/hooks/your_webhook_url'
MM_CHANNEL='alert-channel'
# (Optional) Check interval
## This is the interval(seconds) at which the service will check the WireGuard status
# CHECK_INTERVAL=30 # Default
# CHECK_INTERVAL=60
# (Optional) Timezone
TZ="Asia/Seoul"
# (Optional) Log path
## Default log config refer to below
# LOG_PATH='/var/log/adow' # Default
# (Optional) Log name
## This is the name of the log file
# LOG_NAME='adow.log' # Default
# (Optional) Log rotate
## This is the path where the log files will be stored(Daily)
# LOG_ROTATE=7 # Default
env.example
4. Run container
docker compose up -d