c-icap(8)

๐Ÿ’– c-icap โ€” the ICAP filtering server ๐Ÿ’–

okay so bestie, welcome to c-icap(8), part of the System Manager's Manual situation. this is the main character of ICAP servers and we're gonna get you fully caught up. no cap.


โœจ NAME โœจ

c-icap โ€” the ICAP filtering server, aka the whole point of this page ๐Ÿซถ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

c-icap [ -V ] [ -VV ] [ -f  config-file ] [ -N ] [ -d  debug-level ] [ -D ]

look at her. so simple. so powerful. ๐Ÿ’…


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

c-icap is an implementation of an ICAP server. that's the vibe. it can be used with HTTP proxies that support the ICAP protocol, and ngl โ€” most of the commercial HTTP proxies must support the ICAP protocol, so she plays well with basically everyone. โœจ


๐ŸŽ€ OPTIONS ๐ŸŽ€

  • -V โ€” prints the version. quick little flex. ๐Ÿ‘‘
  • -VV โ€” prints build informations. yes, informations. she's thorough, she's giving receipts. ๐Ÿ“‹
  • -f config-file โ€” specifies the configuration file, so you're not stuck with the default one.
  • -N โ€” do not run as a daemon. she stays right there with you in the foreground, holding your hand. ๐Ÿซถ
  • -d level โ€” specifies the debug level. dial in how much she tells you.
  • -D โ€” print debug info to stdout. straight to your terminal, no filter, we love transparency. ๐Ÿ’–

๐Ÿ’œ FILES ๐Ÿ’œ

  • /etc/c-icap/c-icap.conf โ€” the main configuration file. the blueprint. the master doc.
  • /etc/c-icap/c-icap.magic โ€” in this file are defined the types of files and the groups of file types. it's literally the vibes file. ๐Ÿ”ฎ
  • /var/run/c-icap.pid โ€” by default c-icap writes its pid in this file. the path of this file can be changed using the PidFile configuration parameter in the c-icap.conf file.
  • /var/run/c-icap.ctl โ€” the commands socket. this file is used to send commands to the icap server from the command line. for information about implemented commands, look below in the "Implemented commands" sub-section ๐Ÿ‘‡

๐ŸŒˆ NOTES ๐ŸŒˆ

๐Ÿ’… Implemented commands

currently the following commands are implemented:

  • stop โ€” the c-icap will shutdown. bye bestie ๐Ÿ˜ญ
  • reconfigure โ€” the service will reread the config file without the need to stop and restart the c-icap server. the services will be reinitialized. glow-up without the downtime, periodt. โœจ
  • relog โ€” this command causes c-icap to close and reopen the log files. this is very useful for log rotation. iconic behavior fr fr.

services and modules can define their own commands. yes, they can add their own little signature moves. ๐Ÿ’ซ

Examples:

to reconfigure c-icap:

echo -n "reconfigure" > /var/run/c-icap.ctl

to rotate access log:

mv /var/log/c-icap/access.log /var/log/c-icap/access.log.1
echo -n "relog" > /var/run/c-icap.ctl

๐Ÿ” Lookup tables

lookup tables are simple read-only databases. ๐Ÿ“š a lookup table can be defined in the c-icap.conf file using the form:

type:path

where the type is the type of lookup table and path is the extra information required to use the table (e.g. file path). currently the following lookup table types are defined internally by c-icap:

  • file โ€” simple text file databases. the database records are stored in text files in the form:
key[: value1, value2 ...]

example path definition:

file:/path/to/the/file.txt
  • hash โ€” similar to file lookup tables but c-icap uses fast hashes for searching. speed. efficiency. she ate. ๐Ÿ”ฅ

example path definition:

hash:/path/to/the/file.txt
  • regex โ€” similar to the file lookup tables but the keys are regular expressions in the form /regex/flags. for possible flags values please read the 'Regex expressions' paragraph in this manual. iykyk. ๐Ÿ‘€

example regex lookup table data:

/^[a-m].*/i: group1
/^[n-z].*/i: group2

example path definition:

regex:/path/to/the/file.txt

๐Ÿงš Regex expressions

the c-icap regex expressions have the form /regex_definition/flags where "flags" is one or more letters, each of them expressing a flag. yes, one letter = one flag. she's efficient like that. โœจ

Common flags

  • g โ€” this flag forces the score multiplied by the number of regex expression matches. for example, if the expression matches 5 times and the defined score value is 10, then the final score will be 50. math is mathing. ๐Ÿ”ข
  • i โ€” do caseless matching. she doesn't care about your capital letters. ๐Ÿ’…
  • m โ€” match-any-character operators don't match a newline, and ^$ operators do not match newlines within data.

PCRE flags (only if the module is compiled using the pcre library)

if the module was compiled using the pcre library, the following flags can be used:

  • s (PCRE_DOTALL) โ€” matches anything including NL
  • x (PCRE_EXTENDED) โ€” ignore whitespace and # comments
  • A (PCRE_ANCHORED) โ€” force pattern anchoring
  • D (PCRE_DOLLAR_ENDONLY) โ€” $ not to match newline at end
  • U (PCRE_UNGREEDY) โ€” invert greediness of quantifiers
  • X (PCRE_EXTRA) โ€” PCRE extra features
  • u (PCRE_UTF8) โ€” run in UTF-8 mode

โญ Runtime information

someone can retrieve runtime information using the info service. ๐Ÿ‘‘ the information includes bytes received and transmitted, active services, information about service usage and many other things. the information is provided in HTML and text format.

Example:

retrieve runtime information from command line:

c-icap-client -i localhost -s "info?view=text" -req "a_url"

๐Ÿ“ SEE ALSO ๐Ÿ“

c-icap-client(8) c-icap-stretch(8) c-icap-config(8) c-icap-libicapapi-config(8) c-icap-mkbdb(8)

the whole friend group. go read them all, they're all slaying in their own lanes. ๐Ÿ’–


๐Ÿ’€ BUGS ๐Ÿ’€

Many...

yes. that's it. that's the whole section. she said what she said. ๐Ÿ˜ญ๐Ÿ™ˆ


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Tsantilas Christos


and that's the whole page bestie, you're officially caught up on c-icap(8) โœจ this was c_icap 0.6.5 from the System Manager's Manual, dated... well, whenever she dropped, and honestly she's timeless. mwah. ๐Ÿ’…๐Ÿ’–

๐Ÿ“ฆ where this page comes from