my fork of notfire's qna
admin | ||
boilerplate | ||
css | ||
migrations | ||
.gitignore | ||
config.example.php | ||
emoji.php | ||
fetch.php | ||
index.php | ||
README.md | ||
send.php | ||
setup.php | ||
TODO.md |
trinkey's fork of notfire's qna
added features:
- fedi emoji support
- easier custom css
- rewrote a lot of it to make it less Jank™ and a little bit more efficient
- you can edit content warnings as an administrator instead of just your own response
- you can change the max length for questions and content warnings
- you can change the format of posts to fedi
how to set up (debian):
-
install php and whatnot (
sudo apt install postgresql php php-pgsql php-curl
) -
create the database
sudo -iu postgres
psql
CREATE DATABASE db_name;
- change postgres password if needed:
ALTER USER postgres WITH PASSWORD 'new_password';
-
set up your config (
cp config.example.php config.php
then edit it as you need) -
initialize the database (
php setup.php
) -
for nginx: idk this config works for me:
location = /qna { return 301 https://example.com/qna/index.php; } location = /qna/ { return 301 https://example.com/qna/index.php; } location ~ /qna/.+\.php$ { root /path/to; index qna/index.php; include fastcgi.conf; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/run/php/php8.1-fpm.sock; fastcgi_index qna/index.php; } location = /qna/css/custom.css { alias /path/to/custom.css; } location /qna/css { alias /path/to/qna/css; } location /qna/ { return 404; }
for local testing:
php -S localhost:8000
if these steps don't work for you ... well that sucks. good luck
original readme:
to set up, generally:
- make a database in postgres
- set up config.php based off of the example
- run
php setup.php
to create the database table