summaryrefslogtreecommitdiffstats
path: root/README.md
blob: 2fdf72350c8eb48ac0dd0f63794891c4310b778b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# sear.c

[![Build Status](https://jenkins.sijanec.eu/job/sear.c/badge/icon)](https://jenkins.sijanec.eu/job/sear.c/)

sear.c is used as a lightweight replacement for [SearX](https://en.wikipedia.org/wiki/Searx) that proxies and caches search results
from the Google web search engine. The main advantages over SearX are speed and simplicity.

## instructions for debian and ubuntu systems

First add my software distribution repository [prog.sijanec.eu](https://prog.sijanec.eu) into your APT sources list.

```
apt install sear.c
service sear.c start
```

## requirements

* a POSIX system
* GNU C library
* GNU compiler collection (it's written in GNU C - it uses anonymous functions)
* GNU Make
* libxml2-dev (for the simple HTML/1.0 client and HTML parser)
* libmicrohttpd-dev (for serving results - use a reverse proxy, such as nginx, for HTTPS)
* xxd (for converting HTML pages into C arrays when compiling from source)

## compiling from source

```
make prepare
make
```

## instructions

* run the daemon - it starts listening on HTTP port 7327 (remember it by picturing phone keyboard buttons with letters SEAR (; )
* optional: create a reverse proxy for HTTPS
* navigate to [http://localhost:7327](http://localhost:7327) and do a couple of searches to see if everything works
* the horseshoe button redirects directly to the first result without wasting time on the results page. use if you feel lucky. (BP)
* check logs by navigating to /logs.html
* program also writes all logs to standard error

## a word about public instances

It's not recommended to run a public instance of sear.c yet, as google likes to prevent spam by using a captcha.

It's expected that I'll write a simple captcha forwarder so that users of public instances will solve captchas that are presented and keep the instance healthy.

Currently it's recommended to run private instances, protected by a password using a reverse HTTP proxy.

## screenshots

![screenshot in chromium 0](https://cdn.sijanec.eu/img/2021/04/sear.c_prtsc.png)
![screenshot in chromium 2](https://cdn.sijanec.eu/img/2021/04/sear.c_prtsc2.png)
![screenshot in chromium 3](https://cdn.sijanec.eu/img/2021/04/sear.c_prtsc3.png)
![screenshot in chromium 4](https://cdn.sijanec.eu/img/2021/04/sear.c_prtsc4.png)