Web application to upload exam files to by SaveDownloadExam!
Project description
ExamUploader
A Web application to upload exam files to by SaveSumbitExam!
Installation
- Create the user
examuploader
, 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
chown examuploader:examuploader /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
file
# /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
and install and activate the serivices.
# Enable and start the service
systemctl daemon-reload
systemctl enable examuploader.service
systemctl start examuploader.service
Note
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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58dfa8e912a0f3161ae5cabcf3b9d7e6cbc87f177e70469f68fd3ac48e2430c4 |
|
MD5 | 966f7d1a71e79c2a9fc359f374ef7736 |
|
BLAKE2b-256 | 51b0bcab620fc072e22ad453937b210ffca28f409a68d72016711651ef3ae0b5 |
Close
Hashes for examuploader_sebastian_stigler-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f446827d6bbbcf759dd199c41e00cdb6deb5fa7354d4d45dd2c49072854f37ab |
|
MD5 | 1873b808acba3296880cc54c9e08145c |
|
BLAKE2b-256 | 9b2be16e587654735e735be2b7c2776b22c072a1fe10bc19aacb451af470337f |