Skip to content
This repository was archived by the owner on Nov 12, 2024. It is now read-only.
/ web-backend Public archive
forked from fi-ksi/web-backend

Backend for KSI web written in Python.

License

Notifications You must be signed in to change notification settings

fi-naskoc/web-backend

This branch is 2 commits ahead of, 67 commits behind fi-ksi/web-backend:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5c171a7 · Nov 12, 2024
Sep 2, 2023
Oct 7, 2015
Aug 7, 2024
Aug 7, 2024
Aug 7, 2024
Jul 10, 2024
Sep 1, 2021
Nov 25, 2018
Sep 10, 2023
Apr 5, 2016
Nov 12, 2024
Aug 7, 2024
Feb 24, 2024
Jul 30, 2022
Sep 17, 2017
Aug 1, 2022
Aug 10, 2016
May 21, 2024
Aug 1, 2022

Repository files navigation

Backend for Naskoc web

⚠️⚠️ As of 2024-11-12 this repo is fully depreceated as it was merged with the repository for fi-ksi/web-backend. ⚠️⚠️

https://naskoc.fi.muni.cz

Running with docker

The backend can be run inside a docker container for testing purposes. To build and start backend with database to be stored in your ~/ksi-be execute ./.docker/build.sh --run ~/ksi-db ~/ksi-data. Already built docker images can be started by running ./.docker/start.sh ~/ksi-db ~/ksi-data or docker start -i ksi-be if it was started at least one time before.

Though most of the API works out-of-the box, it is possible that you will run into unexpected errors. If so, please create Issue with report and reproduction steps.

Software needed

  • Python 3.7+
  • virtualenv
  • packages from requirements.txt
  • isolate

Installation

  1. Clone this repository.
  2. Run init-makedirs.sh.
  3. Install virtualenv & packages into ksi-py3-venv directory.
    virtualenv -p python3 ksi-py3-venv
    source ksi-py3-venv/bin/activate
    pip3 install -r requirements.txt
    
  4. Enter db url into config.py file. Format is the same as specified in config.py.dist
  5. Uncomment part of the app.py, which creates database structure.
  6. Run the server, comment the database-create-section in run.py
  7. Install isolate with box directory /tmp/box.
  8. Bind-mount /etc directory to /opt/etc (this is required for sandbox to work):
    $ mount --bind /etc /opt/etc
    
    Do not forget to add it to /etc/fstab.
  9. Optional: make /tmp tmpfs.
  10. Optional: ensure the server will be started after system boots up (run ./runner start).

Server control

  • To start server run: ./runner start.
  • To stop server run: ./runner stop.
  • The runner script must be executed in server`s root directory.
  • Logs are stored in /var/log/gunicorn/*.

About

Backend for KSI web written in Python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.0%
  • Other 1.0%