Some checks failed
Code scanning / CodeQL (push) Failing after 15s
Zulip production suite / Ubuntu 22.04 production build (push) Failing after 26s
Zulip production suite / Debian 12 production install with custom db name and user (push) Has been skipped
Zulip production suite / Ubuntu 22.04 production install and PostgreSQL upgrade with pgroonga (push) Has been skipped
Zulip production suite / Ubuntu 24.04 production install (push) Has been skipped
Zulip production suite / Ubuntu 26.04 production install (push) Has been skipped
Zulip production suite / Debian 13 production install (push) Has been skipped
Zulip production suite / 7.0 Version Upgrade (push) Has been skipped
Zulip production suite / 8.0 Version Upgrade (push) Has been skipped
Zulip production suite / 6.0 Version Upgrade (push) Has been skipped
Zulip production suite / 10.0 Version Upgrade (push) Has been skipped
Zulip production suite / 9.0 Version Upgrade (push) Has been skipped
Zulip production suite / 12.0 Version Upgrade (push) Has been skipped
Zulip production suite / 11.0 Version Upgrade (push) Has been skipped
GitHub Actions Security Analysis with zizmor / zizmor (push) Failing after 3s
Zulip CI / Debian 12 (Python 3.11, backend + documentation) (push) Failing after 26s
Zulip CI / Ubuntu 22.04 (Python 3.10, backend + frontend) (push) Failing after 3s
Zulip CI / Ubuntu 24.04 (Python 3.12, backend) (push) Failing after 25s
Zulip CI / Ubuntu 26.04 (Python 3.14, backend) (push) Failing after 25s
Zulip CI / Debian 13 (Python 3.13, backend) (push) Failing after 28s
Zulip production suite / Required jobs (push) Has been cancelled
Zulip CI / Required jobs (push) Has been cancelled
API Documentation Update Check / check-feature-level-updated (push) Has been cancelled
API Documentation Update Check / notify-if-api-docs-changed (push) Has been cancelled
121 lines
3.6 KiB
Puppet
121 lines
3.6 KiB
Puppet
class zulip::nginx {
|
|
include zulip::certbot
|
|
package { $zulip::common::nginx: ensure => installed }
|
|
package { 'ca-certificates': ensure => latest }
|
|
|
|
if $facts['os']['family'] == 'RedHat' {
|
|
file { '/etc/nginx/sites-available':
|
|
ensure => directory,
|
|
owner => 'root',
|
|
group => 'root',
|
|
}
|
|
file { '/etc/nginx/sites-enabled':
|
|
ensure => directory,
|
|
owner => 'root',
|
|
group => 'root',
|
|
}
|
|
}
|
|
|
|
file { '/etc/nginx/zulip-include/':
|
|
require => Package[$zulip::common::nginx],
|
|
recurse => true,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0644',
|
|
source => 'puppet:///modules/zulip/nginx/zulip-include-common/',
|
|
notify => Service['nginx'],
|
|
}
|
|
|
|
file { '/etc/nginx/dhparam.pem':
|
|
ensure => file,
|
|
require => Package[$zulip::common::nginx],
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0644',
|
|
notify => Service['nginx'],
|
|
source => 'puppet:///modules/zulip/nginx/dhparam.pem',
|
|
}
|
|
|
|
if $facts['os']['family'] == 'Debian' {
|
|
$ca_crt = '/etc/ssl/certs/ca-certificates.crt'
|
|
} else {
|
|
$ca_crt = '/etc/pki/tls/certs/ca-bundle.crt'
|
|
}
|
|
$worker_processes = zulipconf('application_server', 'nginx_worker_processes', 'auto')
|
|
$worker_connections = zulipconf('application_server', 'nginx_worker_connections', 10000)
|
|
file { '/etc/nginx/nginx.conf':
|
|
ensure => file,
|
|
require => Package[$zulip::common::nginx, 'ca-certificates'],
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0644',
|
|
notify => Service['nginx'],
|
|
content => template('zulip/nginx.conf.template.erb'),
|
|
}
|
|
|
|
$loadbalancers = split(zulipconf('loadbalancer', 'ips', ''), ',')
|
|
$raw_true_client_header = zulipconf('loadbalancer', 'true_client_header', '')
|
|
$true_client_header = regsubst(downcase($raw_true_client_header), '-', '_', 'G')
|
|
$true_client_header_from = split(zulipconf('loadbalancer', 'true_client_header_from', ''), ',')
|
|
$lb_rejects_http_requests = zulipconf('loadbalancer', 'rejects_http_requests', false)
|
|
file { '/etc/nginx/zulip-include/trusted-ip':
|
|
ensure => file,
|
|
require => Package[$zulip::common::nginx],
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0644',
|
|
notify => Service['nginx'],
|
|
content => template('zulip/nginx/trusted-ip.template.erb'),
|
|
}
|
|
file { '/etc/nginx/zulip-include/trusted-proto':
|
|
ensure => file,
|
|
require => Package[$zulip::common::nginx],
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0644',
|
|
notify => Service['nginx'],
|
|
content => template('zulip/nginx/trusted-proto.template.erb'),
|
|
}
|
|
|
|
file { '/etc/nginx/uwsgi_params':
|
|
ensure => file,
|
|
require => Package[$zulip::common::nginx],
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0644',
|
|
notify => Service['nginx'],
|
|
source => 'puppet:///modules/zulip/nginx/uwsgi_params',
|
|
}
|
|
|
|
file { '/etc/nginx/sites-enabled/default':
|
|
ensure => absent,
|
|
notify => Service['nginx'],
|
|
}
|
|
|
|
file { '/var/log/nginx':
|
|
ensure => directory,
|
|
owner => 'zulip',
|
|
group => 'adm',
|
|
mode => '0750',
|
|
}
|
|
$access_log_retention_days = zulipconf('application_server','access_log_retention_days', 14)
|
|
file { '/etc/logrotate.d/nginx':
|
|
ensure => file,
|
|
require => Package[$zulip::common::nginx],
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0644',
|
|
content => template('zulip/logrotate/nginx.template.erb'),
|
|
}
|
|
file { ['/var/lib/zulip', '/var/lib/zulip/certbot-webroot']:
|
|
ensure => directory,
|
|
owner => 'zulip',
|
|
group => 'adm',
|
|
mode => '0770',
|
|
}
|
|
|
|
service { 'nginx':
|
|
ensure => running,
|
|
}
|
|
}
|