To create new wiki account, please join us on #znc at Libera.Chat and ask admins to create a wiki account for you. You can say thanks to spambots for this inconvenience.

Backlog and OpenSSL.cnf SelfSigned: Difference between pages

From ZNC
(Difference between pages)
Jump to navigation Jump to search
mNo edit summary
 
DoctorD90 (talk | contribs)
Created page with " [default] default_md = sha512 name_opt = ca_default cert_opt = ca_default default_days = 375 policy = @policy_selfsigned [ re..."
 
Line 1: Line 1:
{{DISPLAYTITLE:backlog}}
[default]
{{External Module}}
default_md        = sha512
'''znc-backlog''' is a ZNC module that makes it easy to request backlog. Its intended use is for when you have just launched your IRC client and gotten a few lines of backlog sent to you, but want to read more. Instead of having to deal with shelling into the box where you run ZNC and manually sifting through the logs, you can issue a short command in your IRC client to request any amount of the most recent lines of log.
name_opt          = ca_default
 
cert_opt          = ca_default
== Setup ==
default_days      = 375
 
policy            = @policy_selfsigned
You can get this module's source code [http://github.com/fruitiex/znc-backlog/ here]. Read the [https://github.com/FruitieX/znc-backlog/blob/master/README.md README] for information on compiling and installing.
 
[ req ]
At the moment you must specify a log path manually: See [[log]] for information on where ZNC's log module stores logs.
#Options from the [ req ] section are applied
 
#when creating certificates or certificate signing requests.
'''For ZNC versions after 1.6, you would use something like'''
# Options for the `req` tool (`man req`).
 
default_bits        = 4096
  /msg *backlog LogPath /path/to/your/logs/$USER/$NETWORK/$WINDOW/*.log
distinguished_name  = req_selfsigned
 
string_mask        = utf8only
'''For ZNC versions prior to 1.6, you would use something like'''
  default_md          = sha512
 
   
  /msg *backlog LogPath /path/to/your/logs/$USER_$NETWORK_$WINDOW_*.log
 
[ req_selfsigned ]
<code>$USER</code> will be replaced with your ZNC username, <code>$NETWORK</code> with the current network and <code>$WINDOW</code> with the requested channel/window name. The last found asterisk character '<code>*</code>' in the string is assumed to be a date, and the order in which the files are read is determined by a simple alphabetical sort (i.e. date format order must be year-month-day, which is true of output from the [[log]] module).
# The [ req_dn ] section declares the information
 
  # normally required in a certificate signing request.
Optionally, you may specify this path as an argument to the module, either in the [[webadmin]] textbox, or in the ZNC config file.
# You can optionally specify some defaults.
 
# See <https://en.wikipedia.org/wiki/Certificate_signing_request>.
== Usage ==
countryName                    = Country Name (2 letter code)
 
countryName_min                = 2
After the module is loaded and LogPath is set, you can request for logs with:
countryName_max                = 2
 
stateOrProvinceName            = State or Province Name (full name)
  /msg *backlog <window-name> [num-lines]
localityName                    = Locality Name (eg, city)
e.g.
organizationName                = Organization Name (eg, company)
  /msg *backlog #znc 42
organizationalUnitName          = Organizational Unit Name (eg, section)
 
  commonName                      = Common Name (e.g. server FQDN or YOUR name)
<code>[num-lines]</code> is optional and defaults to 150.
  emailAddress                    = Email Address
 
=== Commands ===
# Optionally, specify some defaults.
 
countryName_default            = IT
  Help
stateOrProvinceName_default    = Italy
 
localityName_default            = Italy
Prints this text
organizationName_default        = ZNC.in
 
  #organizationalUnitName_default  = ZNC Service
  LogPath <path>
  #commonName_default            = wiki.znc.in
 
emailAddress_default            = user [at] example [dot] com
Sets path to log files. Use keywords <code>$USER</code>, <code>$NETWORK</code>, <code>$WINDOW</code> and an asterisk <code>*</code> to stand-in for a year-month-day date.
   
 
[ policy_selfsigned ]
  PrintStatusMsgs <true | false>
# See the POLICY FORMAT section of the `ca` man page.
 
countryName            = optional
Show join/part/rename/etc. messages, in addition to lines of chat.
stateOrProvinceName    = optional
 
localityName            = optional
== Tips ==
organizationName        = optional
 
organizationalUnitName  = optional
=== ZNC Alias Module ===
commonName              = optional
You can make requesting backlogs slightly easier in any client with ZNC's alias module.
emailAddress            = optional
 
First, make sure the alias module is loaded:
[ usr_cert ]
 
# We’ll apply the usr_cert extension when signing client certificates,
  /msg *status LoadMod alias
# such as those used for remote user authentication.
Create an alias for using backlog:
# Extensions for client certificates (`man x509v3_config`).
 
basicConstraints = critical, CA:FALSE
  /msg *alias create BL
subjectKeyIdentifier = hash
  /msg *alias add BL PRIVMSG *backlog :%1% %?2% 50
  authorityKeyIdentifier = keyid:always, issuer:always
This creates and then adds to an alias named "'''BL'''" that you can use to playback logs. <code>%1%</code> will be replaced by the channel/window name you type when using the alias. <code>%?2%</code> will optionally be the number of lines to play back. If no number of lines is supplied, then the last number is used instead—in this example <code>50</code>. You can set this number to anything you want.
keyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment, dataEncipherment, keyAgreement
 
extendedKeyUsage = critical, clientAuth, emailProtection, codeSigning
Now try it out. To play back the default number of lines you set (50 in our example) in the channel #znc:
   
 
  [ server_cert ]
  /bl #znc
# We’ll apply the server_cert extension when signing server certificates,
To play back exactly 32 lines in the channel #znc:
# such as those used for web servers.
 
# Extensions for server certificates (`man x509v3_config`).
  /bl #znc 32
  basicConstraints = critical, CA:FALSE
 
subjectKeyIdentifier = hash
 
  authorityKeyIdentifier = keyid:always, issuer:always
 
  keyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment, keyAgreement
=== WeeChat ===
  extendedKeyUsage = critical, serverAuth
 
In [http://weechat.org weechat], you can create an alias to make requesting logs for the current window easier:
  /alias add bl msg *backlog $channel $1
Now you can:
  /bl 42
or just:
/bl

Revision as of 18:03, 23 August 2021

[default]
default_md        = sha512
name_opt          = ca_default
cert_opt          = ca_default
default_days      = 375
policy            = @policy_selfsigned

[ req ]
#Options from the [ req ] section are applied
#when creating certificates or certificate signing requests.
# Options for the `req` tool (`man req`).
default_bits        = 4096
distinguished_name  = req_selfsigned
string_mask         = utf8only
default_md          = sha512


[ req_selfsigned ]
# The [ req_dn ] section declares the information
# normally required in a certificate signing request.
# You can optionally specify some defaults.
# See <https://en.wikipedia.org/wiki/Certificate_signing_request>.
countryName                     = Country Name (2 letter code)
countryName_min                 = 2
countryName_max                 = 2
stateOrProvinceName             = State or Province Name (full name)
localityName                    = Locality Name (eg, city)
organizationName                = Organization Name (eg, company)
organizationalUnitName          = Organizational Unit Name (eg, section)
commonName                      = Common Name (e.g. server FQDN or YOUR name)
emailAddress                    = Email Address

# Optionally, specify some defaults.
countryName_default             = IT
stateOrProvinceName_default     = Italy
localityName_default            = Italy
organizationName_default        = ZNC.in
#organizationalUnitName_default  = ZNC Service
#commonName_default             = wiki.znc.in
emailAddress_default            = user [at] example [dot] com

[ policy_selfsigned ]
# See the POLICY FORMAT section of the `ca` man page.
countryName             = optional
stateOrProvinceName     = optional
localityName            = optional
organizationName        = optional
organizationalUnitName  = optional
commonName              = optional
emailAddress            = optional

[ usr_cert ]
# We’ll apply the usr_cert extension when signing client certificates,
# such as those used for remote user authentication.
# Extensions for client certificates (`man x509v3_config`).
basicConstraints = critical, CA:FALSE
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always, issuer:always
keyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment, dataEncipherment, keyAgreement
extendedKeyUsage = critical, clientAuth, emailProtection, codeSigning

[ server_cert ]
# We’ll apply the server_cert extension when signing server certificates,
# such as those used for web servers.
# Extensions for server certificates (`man x509v3_config`).
basicConstraints = critical, CA:FALSE
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always, issuer:always
keyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment, keyAgreement
extendedKeyUsage = critical, serverAuth