schort is a tiny link shortener written in python3 and flask
schort - It's just a tiny link shortener Installation instructions:
sudo mkdir -p /opt/schort
sudo groupadd schort
sudo useradd -d /opt/schort -g schort -M -s /sbin/nologin schort
sudo chown -R schort:schort /opt/schort
sudo -u schort git clone https://github.com/sqozz/schort.git /opt/schort
sudo chmod 770 /opt/schort/data
sudo -u schort virtualenv /opt/schort/venv
sudo -u schort -s
source ./venv/bin/activate
pip install -r requirements.txt
/usr/bin/uwsgi --master --daemonize /dev/null --disable-logging --plugin python39 --wsgi-file /opt/schort/schort.wsgi --post-buffering 1 --enable-threads --socket /tmp/uwsgi_schort.sock --processes 1 --fileserve-mode /opt/schort/schort.wsgi --pidfile /var/run/uwsgi_schort/schort.pid
server {
listen 80;
listen [::]:80;
server_name schort.your.domain;
sendfile on;
client_max_body_size 20M;
keepalive_timeout 0;
location / { try_files $uri @schort; }
location @schort {
include uwsgi_params;
uwsgi_pass unix:/tmp/uwsgi_schort.sock;
}
}
Requirements:
Module Explanation
Flask Flask handels all HTTP-stuff in this application
sqlite3 In gentoo this useflag needs to be set while compiling python3
µWSGI
The schort.wsgi file can be set as UWSGI_PROGRAM if you use uWSGI. Keep in mind, that the UWSGI_DIR needs to be set to the path where schort.py resists. This is because schort is not installed in a global scope. Since schort.wsgi imports schort.py it needs his workspace in the same folder.
Twice a month we will interview people behind open source businesses. We will talk about how they are building a business on top of open source projects.
We'll never share your email with anyone else.