File tree Expand file tree Collapse file tree 7 files changed +100
-9
lines changed Expand file tree Collapse file tree 7 files changed +100
-9
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,14 @@ PYTHON = python3
2
2
FLASK = flask
3
3
SQLITE = sqlite3
4
4
5
- default : test
5
+ default : install
6
6
7
7
test ::
8
8
test/all.sh
9
9
10
+ install :: venv
11
+ . ./venv/bin/activate && pip3 install -r requirements.txt
12
+
10
13
venv :
11
14
$(PYTHON ) -m venv $@
12
15
Original file line number Diff line number Diff line change
1
+ # Agreper - minimal, no-JS forum software
2
+
3
+ Agreper is a forum board with a focus on being easy to set up and manage.
4
+
5
+ ## Features
6
+
7
+ ## Install & running
8
+
9
+ ### Linux
10
+
11
+ First clone or [ download the latest release] ( todo ) .
12
+
13
+ Then setup with:
14
+
15
+ ```
16
+ make
17
+ ./init_sqlite.sh forum.db
18
+ ```
19
+
20
+ Lastly, run with:
21
+
22
+ ```
23
+ ./run_sqlite.sh forum.db forum.pid
24
+ ```
25
+
26
+ You will need a proxy such as nginx to access the forum on the public internet.
Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ PYTHON=python3
5
5
6
6
set -e
7
7
8
- if [ $# != 1 ]
8
+ if [ $# -le 1 ]
9
9
then
10
- echo " Usage: $0 <file>" >&2
10
+ echo " Usage: $0 <file> [--no-admin] " >&2
11
11
exit 1
12
12
fi
13
13
17
17
exit 1
18
18
fi
19
19
20
- read -p ' Admin username: ' username
21
- read -sp ' Admin password: ' password
20
+ if [ " $2 " != --no-admin ]
21
+ then
22
+ read -p ' Admin username: ' username
23
+ read -sp ' Admin password: ' password
24
+ fi
22
25
23
26
password=$( $PYTHON tool.py password " $password " )
24
27
time=$( $PYTHON -c ' import time; print(time.time_ns())' )
Original file line number Diff line number Diff line change
1
+ argon2-cffi == 21.3.0
2
+ argon2-cffi-bindings == 21.2.0
3
+ cffi == 1.15.1
4
+ click == 8.1.3
5
+ Flask == 2.2.2
6
+ gunicorn == 20.1.0
7
+ importlib-metadata == 5.0.0
8
+ itsdangerous == 2.1.2
9
+ Jinja2 == 3.1.2
10
+ MarkupSafe == 2.1.1
11
+ passlib == 1.7.4
12
+ pycparser == 2.21
13
+ Werkzeug == 2.2.2
14
+ zipp == 3.8.1
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- # This script is intended for dev environments only.
4
- touch main.py
3
+ set -e
4
+
5
+ if [ -z " $SERVER " ]
6
+ then
7
+ echo " SERVER is not set" >&2
8
+ exit 1
9
+ fi
10
+
11
+ case " $SERVER " in
12
+ dev)
13
+ touch main.py
14
+ ;;
15
+ gunicorn)
16
+ if [ -z " $PID " ]
17
+ then
18
+ echo " PID is not set" >&2
19
+ exit 1
20
+ fi
21
+ kill -hup $( cat " $PID " )
22
+ ;;
23
+ * )
24
+ echo " Unsupported $SERVER " >&2
25
+ exit 1
26
+ ;;
27
+ esac
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -e
4
+
5
+ if [ ! -e venv ]
6
+ then
7
+ echo " venv not found, did you run make?" >&2
8
+ exit 1
9
+ fi
10
+
11
+ if [ $# != 2 ]
12
+ then
13
+ echo " Usage: $0 <file.db> <pid file>" >&2
14
+ exit 1
15
+ fi
16
+
17
+ export DB=" $1 "
18
+ export SERVER=gunicorn
19
+ export PID=" $2 "
20
+ exec gunicorn -w 4 ' main:app' --pid=" $PID " -b 0.0.0.0:8000
Original file line number Diff line number Diff line change @@ -15,8 +15,10 @@ db=$tmp/forum.db
15
15
. $base /../venv/bin/activate
16
16
17
17
# initialize db
18
- $base /../init_sqlite.sh $db
18
+ $base /../init_sqlite.sh $db --no-admin
19
19
$SQLITE $db < $base /init_db.txt
20
20
cd $base /..
21
21
22
- DB=$db $FLASK --app main --debug run
22
+ export DB=$db
23
+ export SERVER=dev
24
+ $FLASK --app main --debug run
You can’t perform that action at this time.
0 commit comments