<commit_before>=encoding utf8

=head1 NAME

go-camo - Go version of Camo server


=head1 SYNOPSIS

B<go-camo> [I<OPTIONS>] [I<OPTION-ARGUMENTS>]


=head1 DESCRIPTION

B<go-camo> is an implementation of Camo in Go.

Camo is a special type of image proxy that proxies non-secure images over
SSL/TLS. This prevents mixed content warnings on secure pages.

It works in conjunction with back-end code to rewrite image URLs and sign them
with an HMAC.


=head1 OPTIONS

=over

=item B<-c, --config> <file-name>

JSON config file. See L<CONFIG_JSON|"CONFIG_JSON">

=item B<-k, --key> <hmac-key>

The HMAC key to use.

=item B<--stats>

Enable stats collection and reporting functionality.

If stats flag is provided, then the service will track bytes and clients
served, and offer them up at an http endpoint /status via HTPT GET request.

See L<STATS|"STATS"> for more info.

=item B<--max-size> <size>

Max response image size in KB. Default: 5120

=item B<--timeout> <time>

Timeout value for upstream response. Format is "4s" where I<s> means seconds.
Default: 4s

=item B<--no-follow>

Disable following upstream redirects.

=item B<--listen> <address-port>

Address and port to listen to, as a string of "address:port".
Default: "0.0.0.0:8080"

=item B<--ssl-listen> <address-port>

Address and port to listen via SSL to, as a string of "address:port".

=item B<--ssl-key> <ssl-key-file>

Path to ssl private key. Default: key.pem

=item B<--ssl-cert> <ssl-cert-file>

Path to ssl certificate. Default: cert.pem

=item B<-v, --verbose>

Show verbose (debug) level log output

=item B<-V, --version>

Print version and exit

=item B<-h, --help>

Show help output and exit

=back


=head1 CONFIG_JSON

An example config json file:

 {
  "hmackey": "Some long string here...",
  "allowlist": []
 }

=over

=item B<hmackey>

B<hmackey> is a secret key seed to the HMAC used for signing and validation

=item B<allowlist>

B<allowlist> is a list of regex host matches to allow.

If an B<allowlist> is defined, and a request does not match one of the listed
host regex, then the request is denied. Default is all requests pass the
B<allowlist> if none is specified.

=back

I<Note>: Option flags, if provided, override those in the config file.


=head1 STATS

If the B<--stats> flag is provided, then the service will track bytes and<commit_msg>minor change to man page<commit_after>=encoding utf8

=head1 NAME

go-camo - Go version of Camo server


=head1 SYNOPSIS

B<go-camo> [I<OPTIONS>] [I<OPTION-ARGUMENTS>]


=head1 DESCRIPTION

B<go-camo> is an implementation of Camo in Go.

Camo is a special type of image proxy that proxies non-secure images over
SSL/TLS. This prevents mixed content warnings on secure pages.

It works in conjunction with back-end code to rewrite image URLs and sign them
with an HMAC.


=head1 OPTIONS

=over

=item B<-c, --config> <file-name>

JSON config file. See L<CONFIG_JSON|"CONFIG_JSON">

=item B<-k, --key> <hmac-key>

The HMAC key to use.

=item B<--stats>

Enable stats collection and reporting functionality.

If stats flag is provided, then the service will track bytes and clients
served, and offer them up at an http endpoint /status via HTPT GET request.

See L<STATS|"STATS"> for more info.

=item B<--max-size> <size>

Max response image size in KB. Default: 5120

=item B<--timeout> <time>

Timeout value for upstream response. Format is "4s" where I<s> means seconds.
Default: 4s

=item B<--no-follow>

Disable following upstream redirects.

=item B<--listen> <address-port>

Address and port to listen to, as a string of "address:port".
Default: "0.0.0.0:8080"

=item B<--ssl-listen> <address-port>

Address and port to listen via SSL to, as a string of "address:port".

=item B<--ssl-key> <ssl-key-file>

Path to ssl private key. Default: key.pem

=item B<--ssl-cert> <ssl-cert-file>

Path to ssl certificate. Default: cert.pem

=item B<-v, --verbose>

Show verbose (debug) level log output

=item B<-V, --version>

Print version and exit

=item B<-h, --help>

Show help output and exit

=back


=head1 CONFIG_JSON

An example config json file:

 {
  "hmackey": "Some long string here...",
  "allowlist": []
 }

=over

=item B<hmackey>

B<hmackey> is a secret key seed to the HMAC used for signing and validation

=item B<allowlist>

B<allowlist> is a list of regex host matches to allow.

If an B<allowlist> is defined, and a request does not match one of the listed
host regex, then the request is denied. Default is all requests pass the
B<allowlist> if none is specified.

=back

I<Note>: L<Option flags|"OPTIONS">, if provided, override those in the config file.


=head1 STATS

If the B<--stats> flag is provided, then the service will track bytes and
{'fraction_non_alphanumeric': 0.10399829859634198, 'fraction_numerical': 0.00893236920459379, 'mean_word_length': 3.80388151174668, 'pattern_counts': {'":': 4, '<': 76, '<?xml version=': 0, '>': 76, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4843978', 'n_tokens_mistral': 1637, 'n_tokens_neox': 1573, 'n_words': 677}