Pastin is a pastebin service written in Python 3 using Flask.
- Clone repository to local computer and go into it
git clone https://github.com/pastebin-fi/pastin.git
cd pastin/
Docker:
- Edit
docker-compose.yml
- Start the service
docker-compose up
Normal:
- Install required packages
pip install -r requirements.txt
- Copy file
defconfig.ini
toconfig.ini
and make required changes - Database configuration is in Environment variables. Here is an example
.env
-file:
DB_USER = root
DB_PASSWORD = password
DB_HOST = localhost
DB_DB = pastin
- Run the following command (run this also when updating pastin):
flask db upgrade
- Run the server
flask run
- [optional] if you want to create large pastes run command
SET @@global.sql_mode= '';
on SQL server.
In order to easily switch between branches, there is the script checkout.sh. This script modifies config.ini to use a database called pastin_branch, where branch is the name of the branch to which you are switching. The name of the database of the master branch is just pastin. You must yourself create the databases and grant your database user privileges to them.
To switch to another branch, use
./checkout.sh <branch>