aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: cdca181643785f4d4ce6ebe436771c9c4a68b251 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!--
  -- Filename: README.md
  -- Startdate: 2022-02-11
  -->
# Overview
This is my proposed solution to my pastebin problem.

# Features

* Admin page which can list parents, children, and provide link to delete pastes.
* Editable titles
* "Reply to" pastes to make parent/children relationships
* UUIDs instead of sequential integer ID numbers
* Private pastes (accessible to admin, and to users with the whole link)
* Reverse-proxy autoconfiguration by visiting /set

# Using stackbin
## Installing

You can use flask for development servers, and uwsgi for production. For a production stack on CentOS 7:

    yum install nginx uwsgi uwsgi-logger-file python36-flask uwsgi-plugin-python36 python36-sqlalchemy python36-uwsgidecorators
    pip3 install --user flask-sqlalchemy pytimeparse

## Instructions

Configure the application with these two files, based on the `.example` files available in the source code:

* stackbin.conf
* stackbin.wsgi.ini

Generate new db.

    python3 initdb.py

Run server in development mode.

    FLASK_APP=stackbin.py FLASK_DEBUG=True flask run --host='0.0.0.0'

Run the server in a full wsgi environment for the cleanup timer to operate.

    ./stackbin.bin

If you use stackbin behind a reverse-proxy such as nginx with example file `stackbin.conf.nginx`, then you can have it autodetect the correct top-level path by visiting path:

    /set

This means that if your app is behind `http://example.com/stackbin/` then you would just visit once page:

    http://example.com/stackbin/set

# Improvements
I still need to work on these tasks:

## Development

* Protect the /admin/ page

## Release

* Deploy to prod

# Alternatives
This is a very diverged fork of [su27/flask-pastebin](https://github.com/su27/flask-pastebin) which itself was a fork of the original [mitsuhiko/pastebin](https://github.com/mitsuhiko/flask-pastebin). The original had a few additional features worth reviewing.

## Unresearched
https://github.com/yasoob/logit-bin
https://github.com/AWilliams17/PasteMate
https://github.com/bsamadi/flask-pastebin

## Attempted
https://github.com/Tygs/0bin sounds cool but it uses a stack I'm unfamiliar with and it had some issues and I didn't want to bother with it.
bgstack15