Remove unused requirements and update README

* Remove bleach and Markdown which were used for server-side markdown
* Update README with hypothetical self-hosting steps
* Remove install_xapian from version control (since I can't license it)
This commit is contained in:
Matthias Portzel 2022-02-07 13:48:15 -05:00
parent 7da4921d32
commit 3eec639e45
4 changed files with 29 additions and 8 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@
/log
/xapian_index
/xapian-haystack
/install_xapian.sh
stale_outputs_checked
__pycache__
*.iml

29
README
View File

@ -2,7 +2,22 @@
## Copyright
This code (but not the name or text) for this project is released into the public domain (as specified in the file LICENSE).
The code in this repository is released into the public domain (as specified in the file LICENSE).
## Notes for running yourself
First off, this is not necessarily recommended. Making it easy for other people to host was not a priority in designing this project. You should be prepared to maintain your own fork and edit the source to suit your own needs. The About page is not applicable to you, for instance.
Running in production requires a WSGI host, which is way beyond the scope of this README to set up.
Since both production and my local development instance have a large (500+) number of posts, behavior with a small number of posts is untested and undefined. I do know that the system assumes that there is at least one post, and the main page will error if that's not the case. Pull requests (or emailed git patches) to fix this or similar bugs would be accepted.
Disabling pagination is possible by editing ./main/pagination.py.
After cloning, you should create a `.env` to define environment variables. Read whispermaphone/settings.py.
You can generate a SECRET_KEY with `python3 -c "import secrets; print(''.join([secrets.choice('abcdefghijklmnopqrstuvwxyz0123456789\!@#$%^&*(-_=+)') for i in range(50)]))"`.
To post, go to /post manually.
## Installing
@ -19,23 +34,29 @@ python -m venv venv
. ./venv/bin/activate
# Install Requirements
# Note: This includes all requirements used by me at any point
# For a minimal (just django) install, you can leave off
# `xapian-haystack` (used for advanced search) and `jetforce`, used for Gemini mirroring
pip install -r requirements.txt
# To install xapian to power /search:
curl -OL https://tildegit.org/matthias/xapian-haystack/raw/branch/master/install_xapian.sh
# NOTE: make sure the virtual enviroment is enabled before running this
# Check the latest version of xapian from https://github.com/xapian/xapian/tags
. install_xapain <version>
sh install_xapain.sh <version>
./manage.py rebuild_index
# Otherwise, disable xapian by patching settings.py like so
patch whispermaphone/settings.py <<EOF
patch whispermaphone/settings.py <<EOF
54,55c54
< "ENGINE": "xapian_backend.XapianEngine",
< "PATH": str(BASE_DIR / "xapian_index")
---
> "ENGINE": "haystack.backends.simple_backend.SimpleEngine"
EOF
```

View File

@ -1,9 +1,9 @@
Django~=3.2
python-magic~=0.4.22
bleach~=3.3.0
Pygments~=2.8.1
Markdown~=3.3.4
jetforce
python-decouple
jetforce
django-haystack
git+https://tildegit.org/matthias/xapian-haystack.git

View File

@ -24,7 +24,6 @@ BASE_DIR = Path(__file__).resolve().parent.parent
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = config("SECRET_KEY", default="qdm4_0b)3^)k$6r($!o^a7&0l#^6)@g2wr!x0r40ii@9otfnwo")
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = config("DEBUG", default=True, cast=bool)
PASSWORD = config("PASSWORD", default="password")