Web application to upload exam files to by SaveDownloadExam!
Project description
ExamUploader
A Web application to upload exam files to by SaveDownloadExam!
Installation
- Create the user
examuuploader
, create some directories in its home-directory and revoke other users access to them.
# as user root:
adduser --disabled-password examuploader
mkdir /home/examuploader/{etc,secrets,upload}
chmod o-rwx /home/examuploader -R
- As user
examuploader
create a virtualenv within its home-directory and install the ExamUploader within.
# as user examuploader:
cd ~
python3 -m venv venv
. ./venv/bin/activate
pip install examuploader-sebastian-stigler
- Create a config file, where you specify the
upload_path
and a list of courses, that are allowed to upload files. Within the each course you specify the course name (which is used as the name of the subdirectory in theupload_path
for it) and a list of jupyterhub usernames of thestudents
in this course either directly or as a name prefix by appending an asteriks to the end (and only the end) of it. Make sure, that the course name follows the pattern^[a-z0-9-]+$
and the student name (prefix) follows the pattern^[a-zA-Z0-9-]+$
.
# as user examuploader
# /home/examuploader/etc/config.yaml
upload_path: /home/examuploader/upload
courses:
- name: python101
students:
- heinz
- python101-*
- Create a
systemd service
.
# /etc/systemd/system/examuploader.service
# systemd service file to start the examuploader
[Unit]
Description=ExamUploader backend
Wants=network.target
Documentation=https://in-stigler.htw-aalen.de/gitea/tools/examuploader
[Service]
Type=simple
User=examuploader
Group=examuploader
WorkingDirectory=/home/examuploader
Environment="EXAM_UPLOADER_SECRETS_DIR=/home/examuploader/secrets"
Environment="EXAM_UPLOADER_CONFIG=/home/examuploader/etc/config.yaml"
ExecStart=/home/examuploader/venv/bin/uvicorn examuploader.main:app --host 127.0.0.1 --port 8000 --workers 3
# Use SIGINT to stop
KillSignal=SIGINT
# Auto restart on crash
Restart=on-failure
RestartSec=20
# Tag things in the log
SyslogIdentifier=ExamUploader
#StandardOutput=syslog
[Install]
WantedBy=multi-user.target
# Enable and start the service
systemctl deamon-reload
systemctl enable examuploader.service
systemctl start examuploader.service
Note {#pyscaffold-notes}
This project has been set up using PyScaffold 4.5. For details and usage information on PyScaffold see https://pyscaffold.org/.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for examuploader-sebastian-stigler-0.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbd7ca8b2fd99a69cddc84e8d088ad3b51c01fa1d4b5dbb8b8c614ee87c20bcd |
|
MD5 | d8b820a535a07f041385ac5b51702340 |
|
BLAKE2b-256 | fd29664d4c2082d7509385c4afab1c401d0cc2043f9cedebb531d4331cd6f066 |
Close
Hashes for examuploader_sebastian_stigler-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b521a2fcfdc95037b9db3d0153e030f313b41677a697f3238762db25dd8550ea |
|
MD5 | d6c7acbc2d694ef7609facfd16ecf1c2 |
|
BLAKE2b-256 | 4c982a67f367900f1f73cdde33fb116c74623b696ac2ac6e26392e63f2c9bae2 |