icpc-webprint/README.md

104 lines
4.7 KiB
Markdown

# ICPC-WEBPRINT
This platform helps contest participants to print their code using no drivers, only web application in any browser. Supports authorization, printing PDF for administrators and teachers.
Platform was already used on some events, like "The FPMI Cup : February, 2025" and "MIPT Open Programming Championship : April, 2025".
## Instalation
### Environment and Service
Both RX and TX servers have the same way to install dependencies. First, be sure to have venv globally installed on your system:
```bash
apt install python3-venv
# or
python3 -m pip install venv
```
After that create virtual environment:
```
cd print-tx # and then print-rx
python3 -m venv .venv
```
Enter environment and install dependencies from `requirements.txt`:
```
source .venv/bin/activate
python3 -m pip install -r requirements.txt
```
Great! Now you have working system. You can start your project either running
```
python3 -m gunicorn wsgi_back:app -c gunicorn.py
```
in venv, or creating services on your Linux. Template could be found in `example.serivce` file. After that you can start your web app with running:
```
systemctl start example.service
```
### Setting Secrets
Change secret code, that is used to access RX server from TX in `server-tx.json` and `server-rx.json`.
Change salt and session secret key in `server-tx/app/config.py`:
```
_SALT = '$2b$12$DE09JKsqy6Ii/zAxEAA5n.' #edit
_SECRET_SESSION_KEY = "GAZAKBAYEV-AHMET-PROJECT" #edit
```
You can also to set super admin user (it can add and remove others):
```
_SUPER_ADMINS = ( #edit
"god"
)
```
Accounts with login:password like "god:god" will be checked and created if not exist, when application start.
### Setting ports
You can set port of TX part in file `gunicorn.py`, and RX part in config file `server-rx.json`. Using TX interface, in admin panel, you can configure RX server and get `server-rx.json` to load it.
### Setting default printer
Learn more about `lp` service in Linux ([Wiki](https://ru.wikipedia.org/wiki/Lp)).
## Features
- Four groups: Super Admin, Admin (create and remove users, set configuration), Tutor (print PDF and code), Team Member (default, print only code)
- Print code & PDF
- Create & Delete users
- Statistic of printed pages & last printing time of member
- Setting RX server using UI
- Setting TX configuration: PDF Watermark and limits.
## Setting user group
Groups are just team names! Use `$root` for Admins, `$tutor$` for Teachers and other names for members.
## Interface
### Team Member
![Team Member](https://cloud.gazakbayev.net/index.php/apps/files_sharing/publicpreview/gqzmo9S8KFGcQLi?file=/member_view.png&fileId=62728&x=2880&y=1800&a=true&etag=112840f341b1c0419ddb384ee1c54d9c)
![Limit Example](https://cloud.gazakbayev.net/index.php/apps/files_sharing/publicpreview/gqzmo9S8KFGcQLi?file=/limit_realization.png&fileId=62726&x=2880&y=1800&a=true&etag=b2a38e2f507cce30f4ece5a1d2d203e5)
### Tutor
![Tutor](https://cloud.gazakbayev.net/index.php/apps/files_sharing/publicpreview/gqzmo9S8KFGcQLi?file=/tutor_view.png&fileId=62729&x=2880&y=1800&a=true&etag=d8c90831ce28b0fa1056efc9bdb4e940)
### Админ Панель
![View1](https://cloud.gazakbayev.net/index.php/apps/files_sharing/publicpreview/gqzmo9S8KFGcQLi?file=/admin_panel_view1.png&fileId=62724&x=2880&y=1800&a=true&etag=21a34169474060c299a3e4c74c5b6076)
![View2](https://cloud.gazakbayev.net/index.php/apps/files_sharing/publicpreview/gqzmo9S8KFGcQLi?file=/admin_panel_view2.png&fileId=62722&x=2880&y=1800&a=true&etag=48ba6f4ff8f0b1ce9679a2ec06bb1391)
![View3](https://cloud.gazakbayev.net/index.php/apps/files_sharing/publicpreview/gqzmo9S8KFGcQLi?file=/admin_panel_view3.png&fileId=62720&x=2880&y=1800&a=true&etag=3e47f48910e457564c8ae692fca12506)
![View4](https://cloud.gazakbayev.net/index.php/apps/files_sharing/publicpreview/gqzmo9S8KFGcQLi?file=/admin_panel_view4.png&fileId=62721&x=2880&y=1800&a=true&etag=58a0d96be70a9af936510a24682dea6c)
### Создание и Редактирование пользователя
![Create](https://cloud.gazakbayev.net/index.php/apps/files_sharing/publicpreview/gqzmo9S8KFGcQLi?file=/create_user.png&fileId=62723&x=2880&y=1800&a=true&etag=d29264a65fc01ac2aafa06fdd0139040)
![Create Result](https://cloud.gazakbayev.net/index.php/apps/files_sharing/publicpreview/gqzmo9S8KFGcQLi?file=/create_user_created.png&fileId=62725&x=2880&y=1800&a=true&etag=af5b7e8672570468acbd81ba6a675e3f)
![Update](https://cloud.gazakbayev.net/index.php/apps/files_sharing/publicpreview/gqzmo9S8KFGcQLi?file=/edit_user.png&fileId=62727&x=2880&y=1800&a=true&etag=551dcadc3402e7555a7d701269cd0b94)
Просмотреть данную галерею можно на [NextCloud](https://cloud.gazakbayev.net/index.php/s/gqzmo9S8KFGcQLi?dir=/) автора.