Metadata-Version: 2.4
Name: eego
Version: 2026.2.3
Summary: Easter-eggs internet search engine
Author-email: Alix Chevallier <achevallier@easter-eggs.com>, Florent Angebault <fangebault@easter-eggs.com>
License: AGPL-3.0-or-later
Keywords: xapian,search engine
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE.md
Dynamic: license-file

# EEGO

Because Xapian doesn't support multiple writers on its databases, the API side should only be executed on a single worker.

## Configuration

Install and adjust `eego.toml` into `/etc`.

## Quickstart

### Start eego API using uwsgi

```shell
cd src/ && flask --app eego.wsgi run --reload
```

## Usage

```shell
cd src/
python -m eego.cli --help
```

## Tooling

```shell
invoke
```

## Dependencies

On Debian 12.

```shell
apt install \
    xapian-tools python3-flask python3-xapian python3-cbor2 \
    python3-pypdf python3-pycryptodome python3-pypandoc python3-pypandoc \
    python3-requests python3-ldap python3-dateutil python3-humanize python3-tenacity
```

### Development dependencies

```shell
apt install \
	git \
	flake8 \
	isort \
	black \
	yamllint \
	mypy python3-typeshed \
	pylint \
	python3-invoke \
	python3-pytest python3-pytest-cov
```

### Development environment

#### Using venv

```shell
git clone git@gitlab.easter-eggs.com:ee/eego.git
cd eego
python3 -m venv --system-site-packages venv
cp eego.toml eego.dev.toml
echo "export EEGO_CONFIG_PATH=$(realpath eego.dev.toml)" >> venv/bin/activate
./venv/bin/python -m pip install -e .
```

To run injectors:

```shell
source venv/bin/activate
eego -v inject ${INJECTOR?}
```

#### Using Docker

Retrieve LDAP config & data LDIF dump from LDAP master (petunia) and put them in `docker/ldap/backups/` directory:

```shell
# Dump slapd config
ssh eeadmin@10.0.0.20 sudo slapcat -b cn=config | \
	awk '
		# Remove LDAP databases use for slave push replication
		/^dn: .*olcDatabase=\{[0-9]+\}ldap,cn=config$/ {
			while (getline > 0 && $0 !~ /^$/) {}
			next
		}

		# Remove SSL certificate stuff
		/^(olcTLSCertificateFile|olcTLSCertificateKeyFile|olcTLSCACertificateFile): / { skip=1; next }
		skip && /^ / { next }
		skip && /^[^ ]/ { skip=0 }

		# Print other lines
		{ print }
	' > docker/ldap/backups/config.ldif
# Dump LDAP directory data
ssh eeadmin@10.0.0.20 sudo slapcat -b o=easter-eggs > docker/ldap/backups/data.ldif
```

Create database directory:

```shell
mkdir -p db/default
```

Start docker compose project:

```shell
docker compose up
```

Once start, you can access to the search web UI at http://localhost:8000 and the API at http://localhost:8000/api/v1.

To run LDAP indexation, adjust `bind_password` in the file `eego.docker.toml` and run:

```shell
docker compose exec web eego -v inject ldap
```

## License

EEGO is published under [the AGPLv3+](LICENSE.md).
