Skip to content

ibz/usocial

Repository files navigation

Read more at usocial.me.

Running usocial

The recommended way to run usocial on Umbrel and Citadel is to install it from the respective dashboard.

If you want to run usocial on your laptop, home server or VPS, check the instructions here.

If you want to debug or edit the code, keep reading.

Setting up the development environment

  1. Clone the repo

    git clone https://github.com/ibz/usocial.git && cd usocial

  2. Set up a venv

    python3 -m venv venv
    source venv/bin/activate
    pip install --upgrade pip
    pip install -e .
    
  3. Create an "instance" directory which will store your database and config file.

    mkdir instance

  4. Generate a secret key (this is required by Flask for CSRF protection)

    echo "SECRET_KEY = '"`python3 -c 'import os;print(os.urandom(12).hex())'`"'" > instance/config.py

  5. Export the environment variables (FLASK_APP is required, FLASK_ENV makes Flask automatically restart when you edit a file)

    export FLASK_APP=usocial.main FLASK_ENV=development

  6. Create the database (this will also create the default user, "me", without a password)

    flask create-db

  7. Run the app locally

    flask run