Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manage web.xml Config #387

Open
Kickball opened this issue Aug 4, 2021 · 1 comment
Open

Manage web.xml Config #387

Kickball opened this issue Aug 4, 2021 · 1 comment

Comments

@Kickball
Copy link

Kickball commented Aug 4, 2021

This puppet module templates several of the commonly used config files for Jira, however web.xml is not one of them at the moment.

It would be useful to fix HTTPS redirection (docs) and change the default session timeout (docs).

While it is possible to manage this separately, ideally it would be possible via the puppet-jira module.

I can work on a PR for this if it is desired but wanted to solicit feedback first.

@Kickball
Copy link
Author

Kickball commented May 13, 2022

This workaround isn't suitable for merging into the module as may not work on all operating systems, but can be implemented in a wrapper module without too much trouble.

# Configure HTTP Redirection for Jira
# https://confluence.atlassian.com/adminjiraserver/running-jira-applications-over-ssl-or-https-938847764.html
exec {
    'atlassian-http-redirection':
        # Firstly remove the last line of the config file (the closing web-app tag) then append the redirection config block and the previously removed closing web-app tag.
        command    => "/bin/head -n-1 web.xml | /bin/sponge web.xml && /bin/cat << EOF >> web.xml
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>all-except-attachments</web-resource-name>
            <url-pattern>*.jsp</url-pattern>
            <url-pattern>*.jspa</url-pattern>
            <url-pattern>/browse/*</url-pattern>
            <url-pattern>/issues/*</url-pattern>
        </web-resource-collection>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>
    
</web-app>
EOF",
        # Only run the command if the file doesn't already contain the relevant config block. This ensures the idempotence that Puppet requires.
        unless => '/bin/grep "<transport-guarantee>CONFIDENTIAL</transport-guarantee>" web.xml'
        # Replace with the full path if no variable is available. E.g.
        # path => '/jira/atlassian-software-8.22.2-standalone/atlassian-jira/WEB-INF/',
        path   => '${jira_app_dir}/atlassian-jira/WEB-INF/',
        # Ensure that Jira is already configured, otherwise the directory and file will not exist.
        require => Class['jira'];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant