Web dashboard for DSpace: summary stats, downloads, submitters, and ORCID sync views with admin-only access.
Short guide to run the app, configure environment, and install a systemd unit.
- Python 3.9+
- Access to DSpace REST API, Solr, and PostgreSQL
cd /opt/dspace-dashboard
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtCreate the environment file used by systemd:
sudo tee /etc/default/dspace-dashboard >/dev/null <<'EOF'
# Path to DSpace local.cfg
DSPACE_CONFIG_PATH=/dspace/config/local.cfg
# Flask session secret
SECRET_KEY=replace_with_random_64_chars
# Optional settings
CACHE_TTL_SECONDS=300
START_YEAR=2025
START_MONTH=1
# ORCID metadata field id (required, varies by DSpace instance)
ORCID_FIELD_ID=205
EOFCreate the unit file:
sudo tee /etc/systemd/system/dspace-dashboard.service >/dev/null <<'EOF'
[Unit]
Description=DSpace Dashboard (Flask via Gunicorn)
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=dspace
Group=dspace
WorkingDirectory=/opt/dspace-dashboard
EnvironmentFile=/etc/default/dspace-dashboard
# Gunicorn слушает localhost или 0.0.0.0
ExecStart=/opt/dspace-dashboard/venv/bin/gunicorn \
--workers 2 \
--threads 4 \
--timeout 60 \
--bind localhost:8088 \
app:app
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
EOFEnable and start:
sudo systemctl daemon-reload
sudo systemctl enable --now dspace-dashboardOpen http://localhost:8088 (or your reverse-proxy URL).
Logs:
sudo journalctl -u dspace-dashboard -fDashboard section "Редагування" uses events parsed from DSpace logs.
Use the long-running daemon for near-real-time updates:
cd /opt/dspace-dashboard
source .venv/bin/activate
python3 parser_daemon.py --log-glob "/dspace/log/dspace*.log" --log-level INFOSet these in /etc/default/dspace-dashboard (used by both the dashboard and parser services) to fine-tune behavior:
DSPACE_EDIT_LOG_GLOB— glob for log files (default/dspace/log/dspace.log).DSPACE_EDIT_POLL_SECONDS— sleep between iterations (default5).DSPACE_EDIT_PENDING_SECONDS— delay before confirming edit (default180).DSPACE_EDIT_DEDUPE_SECONDS— dedupe window for the same user+item edits (default60).DSPACE_SYSTEM_EVENT_RETENTION_HOURS— how long to keep workflow/system markers (default48).DSPACE_REQUEST_CONTEXT_RETENTION_SECONDS— in-memory request context TTL (default900).DSPACE_EDIT_LOG_LEVEL— log level for the daemon (INFO,DEBUG, etc.).
Create a companion unit that runs alongside the web app:
sudo tee /etc/systemd/system/dspace-dashboard-parser.service >/dev/null <<'EOF'
[Unit]
Description=DSpace Dashboard Item Edit Parser
After=network-online.target postgresql.service
Wants=network-online.target
[Service]
Type=simple
User=dspace
Group=dspace
WorkingDirectory=/opt/dspace-dashboard
EnvironmentFile=/etc/default/dspace-dashboard
ExecStart=/opt/dspace-dashboard/.venv/bin/python3 parser_daemon.py \
--log-glob "/dspace/log/dspace*.log"
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOFEnable and start the daemon (after deploying code and migrations):
sudo systemctl daemon-reload
sudo systemctl enable --now dspace-dashboard-parserFollow logs via sudo journalctl -u dspace-dashboard-parser -f.
Notes:
- daemon keeps parser state in PostgreSQL (inode + offset) and resumes automatically;
- only confirmed update events are counted (
ItemServiceImpl ::update_item:item_id=...); - after the first daemon run, refresh the dashboard page
/item-editsto populate charts.