Skip to content

Commit 2b74512

Browse files
authored
refactor: modernize apache2 custom resources (#862)
* fix: enable previously excluded CI test suites - Add amazon platform family to apache_mod_wsgi_package and apache_mod_wsgi_filename helpers - Update mod_auth_cas devel packages from pcre to pcre2 for v1.2 compatibility - Add Debian 13 PHP 8.4 filename support (libphp8.4.so) - Add mod_php_spec.rb tests for PHP helper functions - Update mod_wsgi_spec.rb and mod_auth_cas_spec.rb tests - Remove CI exclusions for amazonlinux-2023/mod-wsgi, ubuntu-2404/php, opensuse-leap-15/mod-auth-cas, opensuse-leap-15/mod-wsgi, debian-13/php Fixes #815, #816, #817, #818, #819 * refactor: extract shared properties into _partial/_common - Create resources/_partial/_common.rb with root_group and template_cookbook - Update conf.rb, config.rb, default_site.rb, install.rb, mod.rb to use partial * refactor: add explicit action_class blocks to conf, mod_php, mod_userdir, mod_wsgi - conf.rb, mod_php.rb, mod_userdir.rb, mod_wsgi.rb were missing action_class do...end - Each now explicitly includes Apache2::Cookbook::Helpers * test: add missing ChefSpec tests for service and site resources - spec/resources/service_spec.rb: covers start/stop/restart/reload/enable/disable actions - spec/resources/site_spec.rb: covers enable/disable with helper stubs * docs: add documentation for 27 undocumented mod resources * fix: apply cookstyle autocorrect for UnnecessaryPlatformCaseStatement in helpers.rb * refactor: finalize custom resource modernization * docs: fix markdownlint MD034 bare URLs and MD060 table alignment Wrap bare URLs in angle brackets and use minimal table column widths to satisfy markdownlint rules. * fix(test): add apt_update to test recipes missing it Six test recipes were missing apt_update before apache2_install, causing apt-get failures in Dokken containers with stale package caches. * refactor: remove RHEL 7 TODOs and fix mod_ssl spec RHEL 7 is EOL. Simplify helpers by removing version guards. Replace commented-out mod_ssl spec with a working test.
1 parent 8f96cf4 commit 2b74512

91 files changed

Lines changed: 1098 additions & 142 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

LIMITATIONS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Apache2 Cookbook Limitations
2+
3+
- Supported platforms are limited to the distributions covered by the Kitchen and CI matrices: AlmaLinux 8+, Amazon Linux 2023, CentOS Stream 9+, Debian 12+, Fedora, openSUSE Leap 15+, Oracle Linux 8+, Rocky Linux 8+, and Ubuntu 22.04+.
4+
- Platform-specific module package availability still depends on the underlying distribution repositories.
5+
- This modernization branch no longer advertises legacy CentOS, Scientific Linux, FreeBSD, openSUSE classic, SUSE, or Arch support.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# apache2_mod_actions
2+
3+
[Back to resource list](../README.md#resources)
4+
5+
Manages the Apache `mod_actions` configuration file.
6+
7+
## Actions
8+
9+
| Action | Description |
10+
|---------|---------------------------|
11+
| :create | Create the configuration. |
12+
13+
## Properties
14+
15+
| Name | Type | Default | Description |
16+
|---------|------|---------|------------------------------------------------------------------------------------------------------------------------------------|
17+
| actions | Hash | `{}` | A hash of actions where key is the action-type and value is the cgi-script, e.g. `{ news-handler: '"/cgi-bin/news.cgi" virtual' }` |
18+
19+
## Examples
20+
21+
```ruby
22+
apache2_mod_actions '' do
23+
actions({ 'image/gif' => '/cgi-bin/image.cgi' })
24+
end
25+
```
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# apache2_mod_alias
2+
3+
[Back to resource list](../README.md#resources)
4+
5+
Manages the Apache `mod_alias` configuration file.
6+
7+
## Actions
8+
9+
| Action | Description |
10+
|---------|---------------------------|
11+
| :create | Create the configuration. |
12+
13+
## Properties
14+
15+
| Name | Type | Default | Description |
16+
|----------------|--------|-----------------------------------------------------|---------------------------------------------------------------------------------------------|
17+
| options | Array | `['Indexes', 'MultiViews', 'SymLinksIfOwnerMatch']` | Options for the alias directory block. |
18+
| icondir | String | platform-specific (see helpers.rb) | The icon directory path. |
19+
| allow_override | Array | `['None']` | AllowOverride settings. See <https://httpd.apache.org/docs/2.4/mod/core.html#allowoverride> |
20+
| require | String | `'all granted'` | Require directive. See <https://httpd.apache.org/docs/2.4/mod/mod_authz_core.html#require> |
21+
22+
## Examples
23+
24+
```ruby
25+
apache2_mod_alias '' do
26+
options %w(Indexes MultiViews SymLinksIfOwnerMatch)
27+
end
28+
```
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# apache2_mod_autoindex
2+
3+
[Back to resource list](../README.md#resources)
4+
5+
Manages the Apache `mod_autoindex` configuration file.
6+
7+
## Actions
8+
9+
| Action | Description |
10+
|---------|---------------------------|
11+
| :create | Create the configuration. |
12+
13+
## Properties
14+
15+
| Name | Type | Default | Description |
16+
|----------------------|--------|--------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|
17+
| index_options | Array | `['FancyIndexing', 'VersionSort', 'HTMLTable', ...]` | Array of directory indexing options. See <https://httpd.apache.org/docs/2.4/mod/mod_autoindex.html#indexoptions> |
18+
| readme_name | String | `'README.html'` | File inserted at the end of the index listing. See <https://httpd.apache.org/docs/2.4/mod/mod_autoindex.html#readmename> |
19+
| header_name | String | `'HEADER.html'` | File inserted at the top of the index listing. See <https://httpd.apache.org/docs/2.4/mod/mod_autoindex.html#headername> |
20+
| index_ignore | Array | `['.??*', '*~', '*#', 'HEADER*', 'README*', 'RCS', 'CVS', '*,v', '*,t']` | Files to exclude from directory listings. |
21+
| add_icon_by_type | Array | platform-specific | List of icon directives by type. |
22+
| add_icon_by_encoding | Array | `['(CMP,/icons/compressed.gif) x-compress x-gzip x-bzip2']` | Icon directives by encoding. |
23+
| add_icon | Array | platform-specific | Icon directives by file name or extension. |
24+
| default_icon | String | `'/icons/unknown.gif'` | Default icon for unrecognised file types. |
25+
| add_description | Array | platform-specific | Description strings for file types. |
26+
27+
## Examples
28+
29+
```ruby
30+
apache2_mod_autoindex ''
31+
```
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# apache2_mod_cache_disk
2+
3+
[Back to resource list](../README.md#resources)
4+
5+
Manages the Apache `mod_cache_disk` configuration file.
6+
7+
## Actions
8+
9+
| Action | Description |
10+
|---------|---------------------------|
11+
| :create | Create the configuration. |
12+
13+
## Properties
14+
15+
| Name | Type | Default | Description |
16+
|---------------------|--------|------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
17+
| cache_root | String | platform-specific (see helpers.rb) | Root directory for the disk cache. |
18+
| cache_dir_levels | String | `'2'` | Number of sub-directory levels in the cache. See <https://httpd.apache.org/docs/2.4/mod/mod_cache_disk.html#cachedirlevels> |
19+
| cache_dir_length | String | `'1'` | Number of characters in sub-directory names. See <https://httpd.apache.org/docs/2.4/mod/mod_cache_disk.html#cachedirlength> |
20+
| cache_max_file_size | String | `'1000000'` | Maximum size of a cached file in bytes. See <https://httpd.apache.org/docs/2.4/mod/mod_cache_disk.html#cachemaxfilesize> |
21+
22+
## Examples
23+
24+
```ruby
25+
apache2_mod_cache_disk '' do
26+
cache_root '/var/cache/apache2/mod_cache_disk'
27+
end
28+
```
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# apache2_mod_cgid
2+
3+
[Back to resource list](../README.md#resources)
4+
5+
Manages the Apache `mod_cgid` configuration file.
6+
7+
## Actions
8+
9+
| Action | Description |
10+
| ------- | ------------------------- |
11+
| :create | Create the configuration. |
12+
13+
## Properties
14+
15+
| Name | Type | Default | Description |
16+
| ----------- | ------ | ---------------------------------------------- | ----------------------------------- |
17+
| script_sock | String | `<run_dir>/cgisock` (platform-specific) | Path to the CGI daemon socket file. |
18+
19+
## Examples
20+
21+
```ruby
22+
apache2_mod_cgid ''
23+
```
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# apache2_mod_dav_fs
2+
3+
[Back to resource list](../README.md#resources)
4+
5+
Manages the Apache `mod_dav_fs` configuration file.
6+
7+
## Actions
8+
9+
| Action | Description |
10+
| ------- | ------------------------- |
11+
| :create | Create the configuration. |
12+
13+
## Properties
14+
15+
| Name | Type | Default | Description |
16+
| ----------- | ------ | ----------------------------------------------- | ---------------------------------------------- |
17+
| dav_lock_db | String | `<lock_dir>/DAVLock` (platform-specific) | Path to the DAV lock database file. |
18+
19+
## Examples
20+
21+
```ruby
22+
apache2_mod_dav_fs ''
23+
```
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# apache2_mod_deflate
2+
3+
[Back to resource list](../README.md#resources)
4+
5+
Manages the Apache `mod_deflate` configuration file.
6+
7+
## Actions
8+
9+
| Action | Description |
10+
|---------|---------------------------|
11+
| :create | Create the configuration. |
12+
13+
## Properties
14+
15+
| Name | Type | Default | Description |
16+
|---------------------------|-------|--------------------------------------------|--------------------------------------------------------------------------------|
17+
| add_output_filter_by_type | Hash | (common MIME types, see resource file) | An ordered hash of `AddOutputFilterByType DEFLATE <types>` directives. |
18+
| browser_match | Array | (common browser quirks, see resource file) | An array of `BrowserMatch` directives to disable compression for old browsers. |
19+
20+
## Examples
21+
22+
```ruby
23+
apache2_mod_deflate ''
24+
```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# apache2_mod_dir
2+
3+
[Back to resource list](../README.md#resources)
4+
5+
Manages the Apache `mod_dir` configuration file.
6+
7+
## Actions
8+
9+
| Action | Description |
10+
|---------|---------------------------|
11+
| :create | Create the configuration. |
12+
13+
## Properties
14+
15+
| Name | Type | Default | Description |
16+
|-----------------|-------|------------------------------------------------------------------------------------|----------------------------------------------------|
17+
| directory_index | Array | `['index.html', 'index.cgi', 'index.pl', 'index.php', 'index.xhtml', 'index.htm']` | Ordered list of files to serve as directory index. |
18+
19+
## Examples
20+
21+
```ruby
22+
apache2_mod_dir '' do
23+
directory_index %w(index.html index.php)
24+
end
25+
```
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# apache2_mod_fastcgi
2+
3+
[Back to resource list](../README.md#resources)
4+
5+
Manages the Apache `mod_fastcgi` configuration file.
6+
7+
## Actions
8+
9+
| Action | Description |
10+
| ------ | ----------- |
11+
| :create | Create the configuration. |
12+
13+
## Properties
14+
15+
| Name | Type | Default | Description |
16+
| ---- | ---- | ------- | ----------- |
17+
| fast_cgi_wrapper | String | `''` | Path to the FastCGI wrapper script. |
18+
| add_handler | Hash | `{ 1 => 'fastcgi-script .fcgi' }` | An ordered hash of AddHandler directives. |
19+
20+
## Examples
21+
22+
```ruby
23+
apache2_mod_fastcgi ''
24+
```

0 commit comments

Comments
 (0)