<commit_before>package nginx;

use Rex -base;

desc "Install nginx";
task "install", make {
	needs main "root" || die "Cannot gain root access";

	append_if_no_such_line "/etc/portage/package.accept_keywords",
		"www-servers/nginx:0 ~arm";
	file "/etc/portage/package.use/www-servers",
		content => "www-servers/nginx rtmp nginx_modules_http_sub",
		on_change => sub { pkg "nginx", ensure => "latest" };

	pkg "nginx", ensure => "present";
	service "nginx", ensure => "started";

	file "/etc/nginx/nginx.conf",
		source => "lib/files/nginx.conf",
		on_change => sub { service "nginx" => "reload" };

	file "/etc/nginx/conf.d",
		ensure => "directory";

	file "/etc/nginx/acme-challenge.conf",
		source => "lib/files/nginx/acme-challenge.conf",
		on_change => sub { service "nginx" => "reload" };

	file "/etc/nginx/ssl.conf",<commit_msg>nginx: unmask rtmp use flag<commit_after>package nginx;

use Rex -base;

desc "Install nginx";
task "install", make {
	needs main "root" || die "Cannot gain root access";

	file "/etc/portage/profile",
		ensure => "directory";
	append_if_no_such_line "/etc/portage/profile/package.use.mask",
		"www-servers/nginx -rtmp";
	append_if_no_such_line "/etc/portage/package.accept_keywords",
		"www-servers/nginx:0 ~arm";
	file "/etc/portage/package.use/www-servers",
		content => "www-servers/nginx rtmp nginx_modules_http_sub",
		on_change => sub { pkg "nginx", ensure => "latest" };

	pkg "nginx", ensure => "present";
	service "nginx", ensure => "started";

	file "/etc/nginx/nginx.conf",
		source => "lib/files/nginx.conf",
		on_change => sub { service "nginx" => "reload" };

	file "/etc/nginx/conf.d",
		ensure => "directory";

	file "/etc/nginx/acme-challenge.conf",
		source => "lib/files/nginx/acme-challenge.conf",
		on_change => sub { service "nginx" => "reload" };

	file "/etc/nginx/ssl.conf",
{'fraction_non_alphanumeric': 0.18018508437670114, 'fraction_numerical': 0.0010887316276537834, 'mean_word_length': 4.251428571428572, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 7, 'xml': 0}, 'pii_count': 0, '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': '1618717', 'n_tokens_mistral': 719, 'n_tokens_neox': 671, 'n_words': 147}