- Notifications
You must be signed in to change notification settings - Fork0
License
NotificationsYou must be signed in to change notification settings
EIDA/stationbook
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This repository is deployed atorfeus-eu.org/stationbook.
Create env file with config using
cp src/stationbook/.env.sample src/stationbook/.env
and adjust as needed:SECRET_KEY='abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'DEBUG=FalseALLOWED_HOSTS=.localhost,127.0.0.1,0.0.0.0DATABASE_URL=sqlite:////data/stationbook/db/db.sqlite3EMAIL_BACKEND=django.core.mail.backends.console.EmailBackendCACHE_BACKEND=django.core.cache.backends.locmem.LocMemCacheCACHE_LOCATION='sb_cache'CACHE_TIME_SHORT=1800CACHE_TIME_MEDIUM=3600CACHE_TIME_LONG=43200SB_URL_BASE='stationbook/'CSRF_COOKIE_HTTPONLY = TrueCSRF_COOKIE_SECURE = TrueSESSION_COOKIE_HTTPONLY = TrueSESSION_COOKIE_SECURE = TrueHCAPTCHA_SITEKEY=''HCAPTCHA_SECRET=''
Create the virtual environment and install dependencies:
cd src/stationbookpython3.11 -m venv env&&source env/bin/activate&& pip install --upgrade pip&& pip install -r requirements.txt
Prepare the database migration and apply it (check
DATABASE_URL
insrc/stationbook/.env
):python manage.py makemigrationspython manage.py migrate
Create the super user:
python manage.py createsuperuser
Load the fixtures into the database:
python manage.py loaddata book.json
Run the test server:
python manage.py runserver 0.0.0.0:8080
# Build the imagedocker build. -t stationbook:latest# Run the container (replace PATH_TO_MEDIA and PATH_TO_DB accordingly)docker run -d --restart always \--user$(id -u):$(id -g) \-p 8010:80 \-v PATH_TO_MEDIA:/data/stationbook/media \-v PATH_TO_DB:/data/stationbook/db \--name stationbook \stationbook:latest
Below code can be used to synchronize with the EIDA nodes. EIDA nodes can be configured manually using admin panel or loaded from the fixtures.
python3 fdsn_sync.py
To automate the synchronization process,/stationbook/src/stationbook/fdsn_sync.py
can be executed via crontab:
# min hour day month weekday command0****cd /data/stationbook&& python fdsn_sync.py