README.md (2068B)
1 # Gemini Universal Search (GUS) 2 3 4 ## Dependencies 5 6 Install the following packages 7 - Python (>= 3.11) including `distutils` and `python-dev` (aka headers) 8 - [poetry](https://python-poetry.org) 9 - gcc 10 - OpenSSL 11 - SQLite3 12 13 ## basic setup 14 15 1. Create a user who should run the service, e.g. `gus` 16 2. Clone this repo: `git clone https://git.sr.ht/~rwa/geminispace.info geminispace` 17 3. Run `poetry install` in this directory 18 19 20 ## Making an initial index 21 22 Make sure you have some gemini URLs for testing which are nicely 23 sandboxed to avoid indexing huge parts of the gemini space. 24 25 1. Create a "seed-requests.txt" file with your test gemini URLs 26 2. Run `poetry run crawl -d` (might take a few hours) 27 3. Run `poetry run build_index -d` 28 29 Now you'll have created `index.new` directory, rename it to `index`. 30 31 32 ## Running the frontend 33 34 1. Run `poetry run serve` 35 2. Navigate your gemini client to: "gemini://localhost/" 36 37 ### Running the frontend in production with systemd 38 39 1. Create a private key and TLS certificate (X.509 v3) for your host 40 2. Update `infra/gus.service` to match your needs: 41 - working directory 42 - domain 43 - certificate files 44 3. Copy `infra/gus.service` to `~/.config/systemd/user/` 45 4. Run the following commands to automatically start the daemon 46 - `systemctl --user daemon-reload` 47 - `systemctl --user enable gus` 48 - `systemctl --user start gus` 49 5. As root, run `loginctl enable-linger gus` 50 51 ## Running the crawl to update the index 52 53 1. Run `poetry run crawl` 54 2. Run `poetry run build_index` 55 3. Run `systemctl --user restart gus` 56 57 ### Running the crawl & indexer in production 58 59 1. set up a cron job with the following params: `0 9 * * * <path to your working dir>/infra/update_index.sh <path to your working dir>` 60 61 ## Running the test suite 62 63 Run: `poetry run pytest` 64 65 ## Troubleshooting 66 67 * restarting gus.service fails with an error that the bus has not been found when called in a cronjob 68 --> some env vars might be missing, prefix the cronjob command with `XDG_RUNTIME_DIR="/run/user/1000" DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"`