Lightweight Flask app providing a searchable home page and a proxy endpoint to the ALICE CCDB with simple in‑memory caching.
- Browse & filter CCDB subfolders (/)
- Proxy CCDB paths (/ccdb/)
- Header forwarding (Accept, Browse-Limit, Time-Machine)
- Client-side object/table filtering & timestamp validity view
- Server-side validation of limits & timestamps
| Variable | Default | Description |
|---|---|---|
| FLASK_DEBUG | 0 | Enable Flask debug mode when set to 1 |
| LOG_LEVEL | WARNING | Python logging level (DEBUG, INFO, etc.) |
| QUIET | 0 | Suppress werkzeug access logs when 1 |
| MAX_BROWSE_LIMIT | 1000000 | Absolute upper cap for Browse-Limit |
Python 3.10+ See requirements.txt.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python3 app.py
App runs on http://0.0.0.0:8000
Use Gunicorn for production. Do not use the Flask dev server.
Run locally with Gunicorn:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
LOG_LEVEL=INFO QUIET=1 gunicorn -b 0.0.0.0:8000 -w 2 -k gthread --threads 8 --timeout 60 ccdb_proxy:app
- Open http://localhost:8000
- Keep it running with tmux/screen.
- Install into /opt/aliceql and create a venv:
sudo mkdir -p /opt/aliceql && sudo chown "$USER":"$USER" /opt/aliceql
cp -r . /opt/aliceql
cd /opt/aliceql
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
- Create /etc/systemd/system/aliceql.service:
[Unit]
Description=AliceQL CCDB Proxy
After=network.target
[Service]
WorkingDirectory=/opt/aliceql
Environment=LOG_LEVEL=INFO
Environment=QUIET=1
Environment=MAX_BROWSE_LIMIT=1000000
ExecStart=/opt/aliceql/.venv/bin/gunicorn -b 0.0.0.0:8000 -w 2 -k gthread --threads 8 --timeout 60 ccdb_proxy:app
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
- Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable --now aliceql
- Verify:
curl -f http://127.0.0.1:8000/ | head
- Set LOG_LEVEL=INFO and QUIET=1 in production.
- Adjust workers/threads for your CPU and traffic.