···11+# Run this dockerfile from the top level of the indigo git repository like:
22+#
33+# podman build -f ./cmd/palomar/Dockerfile -t palomar .
44+55+### Compile stage
66+FROM golang:1.20-alpine3.17 AS build-env
77+RUN apk add --no-cache build-base make git
88+99+ADD . /dockerbuild
1010+WORKDIR /dockerbuild
1111+1212+# timezone data for alpine builds
1313+RUN GIT_VERSION=$(git describe --tags --long --always) && \
1414+ go build -tags timetzdata -ldflags="-X github.com/bluesky-social/indigo/version.Version=$GIT_VERSION" -o /palomar ./cmd/palomar
1515+1616+### Run stage
1717+FROM alpine:3.17
1818+1919+RUN apk add --no-cache --update dumb-init ca-certificates
2020+ENTRYPOINT ["dumb-init", "--"]
2121+2222+WORKDIR /
2323+RUN mkdir -p data/palomar
2424+COPY --from=build-env /palomar /
2525+2626+# small things to make golang binaries work well under alpine
2727+ENV GODEBUG=netdns=go
2828+ENV TZ=Etc/UTC
2929+3030+EXPOSE 2470
3131+3232+CMD ["/palomar", "run"]
3333+3434+LABEL org.opencontainers.image.source=https://github.com/bluesky-social/indigo
3535+LABEL org.opencontainers.image.description="atproto Search Service (for app.bsky Lexicon)"
3636+LABEL org.opencontainers.image.licenses=MIT
+50
cmd/palomar/README.md
···11+# thecloud (working title)
22+33+An elasticsearch frontend and ATP repo crawler meant to provide search services
44+for the bluesky network.
55+66+## Building
77+88+```
99+go build
1010+```
1111+1212+## Setup
1313+1414+You will need a running elasticsearch instance (or cluster) for indexing, and
1515+valid credentials for the PDS you wish to index against.
1616+1717+The following environment variables should be set:
1818+- `ATP_BGS_HOST`
1919+ - The url of the bluesky BGS, e.g. `https://bgs.staging.bsky.dev`
2020+- `ELASTIC_HTTPS_FINGERPRINT`
2121+ - if using a self signed cert for your elasticsearch deployment, this must be set
2222+- `ELASTIC_USERNAME`
2323+ - elasticsearch username, defaults to `elastic`
2424+- `ELASTIC_PASSWORD`
2525+ - password for elasticsearch auth
2626+- `ELASTIC_HOSTS`
2727+ - comma separated list of elasticsearch endpoints
2828+- `READONLY`
2929+ - To be set only if the instance should act as a readonly HTTP server (no indexing)
3030+3131+## Running
3232+3333+After ensuring the env is properly configured, run:
3434+3535+```
3636+./thecloud run
3737+```
3838+3939+## Indexing
4040+For now, there isnt an easy way to get updates from the PDS, so to keep the
4141+index up to date you will periodcally need to scrape the data.
4242+4343+## API
4444+4545+### `/index/:did`
4646+Index the content in the given users repo. Keeps track of the last repo update
4747+and only fetches incremental changes
4848+4949+### `/search?q=QUERY`
5050+Very simple case-insensitive search results from across the entire app.