summaryrefslogtreecommitdiff
path: root/README
blob: eac1b80491d1be9f53a6b71053d996b0e5365614 (plain)
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
Dedicated syntax highlighting server for cgit.

Use a simple HTTP server to highlight source for cgit. Improves performance
compared to invoking python on every request.

Requirements:

- Python 3.5.3+ (for aiohttp and asyncio.get_running_loop)
- aiohttp
- pygments

Usage:

1. Run `make install`.
2. Set /usr/local/lib/cgit/syntax-highlighting-server.py to run at boot. This
   can be done by `systemctl enable syntax-highlighting` on systemd machines.
3. Set your cgit source filter to syntax-highlighting-client.sh.

Security:

aiohttp is not designed with security in mind. Slow clients can easily cause
excessive memory usage by sending very large highlighting requests, or by
opening a large number of connections and abandoning them. Therefore,
cgit-syntax-highlighting SHOULD NOT be exposed to the public Internet.
Suggestions are accepted for more lightweight asynchronous Python HTTP server
libraries.