Go to file
Matthias Portzel 6408c3db55 Fix bug that prevented editing alt-text
* If there was already an uploaded file, it doesn't get re-uploaded when editing, and doesn't show up in request.FILES. The file name is still in thought.media so we can use that to tell if there's a image and if we should allow media_alt
2022-03-29 13:27:49 -04:00
main Fix bug that prevented editing alt-text 2022-03-29 13:27:49 -04:00
templates/search Search but it actually works 2021-12-22 23:13:27 -08:00
whispermaphone Search results are chronological 2022-03-11 21:14:37 -05:00
.gitignore Remove unused requirements and update README 2022-02-07 13:48:15 -05:00
LICENSE Lower case disclaimer in license because we are not savages 2022-03-02 23:01:42 -05:00
README Remove unused requirements and update README 2022-02-07 13:48:15 -05:00
jetforce_app.py Refactor timezone logic into methods of Thought 2021-10-12 09:11:24 -04:00
manage.py Initial Commit 2020-09-05 22:27:11 -04:00
requirements.txt Update to Django 4.0 2022-02-08 12:21:28 -05:00

README

# WhisperMaPhone

## Copyright

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

```sh
# Clone
git clone https://tildegit.org/Matthias/WhisperMaPhone
cd WhisperMaPhone

# Create a virtual environment
# Python 3 should go without saying in 2021
python -m venv venv

# Activate
. ./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
    sh install_xapain.sh <version>

    ./manage.py rebuild_index

# Otherwise, disable xapian by patching settings.py like so
    patch whispermaphone/settings.py <<EOF
54,55c54
<         "ENGINE": "xapian_backend.XapianEngine",
<         "PATH": str(BASE_DIR /  "xapian_index")
---
>         "ENGINE": "haystack.backends.simple_backend.SimpleEngine"
EOF


```