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

Added ENV variable X_SESSION_COOKIE #78

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[![CircleCI Build Status](https://img.shields.io/circleci/project/cptactionhank/docker-atlassian-confluence/master.svg?label=CircleCI)](https://circleci.com/gh/cptactionhank/docker-atlassian-confluence) [![Open Issues](https://img.shields.io/github/issues/cptactionhank/docker-atlassian-confluence.svg)](https://github.com/cptactionhank/docker-atlassian-confluence/issues) [![Stars on GitHub](https://img.shields.io/github/stars/cptactionhank/docker-atlassian-confluence.svg)](https://github.com/cptactionhank/docker-atlassian-confluence/stargazers) [![Forks on GitHub](https://img.shields.io/github/forks/cptactionhank/docker-atlassian-confluence.svg)](https://github.com/cptactionhank/docker-atlassian-confluence/network) [![Stars on Docker Hub](https://img.shields.io/docker/stars/cptactionhank/atlassian-confluence.svg)](https://hub.docker.com/r/cptactionhank/atlassian-confluence/) [![Pulls on Docker Hub](https://img.shields.io/docker/pulls/cptactionhank/atlassian-confluence.svg)](https://hub.docker.com/r/cptactionhank/atlassian-confluence/) [![Sponsor by PayPal](https://img.shields.io/badge/sponsor-PayPal-blue.svg)](https://paypal.me/cptactionhank/5)
# Fork

Added ENV X_SESSION_COOKIE. This is the only difference to the original source. Fork will be available till my pull request is accepted.

# Atlassian Confluence in a Docker container

Expand Down Expand Up @@ -32,6 +34,7 @@ You can configure a small set of things by supplying the following environment v
| X_PROXY_PORT | Sets the Tomcat Connectors `ProxyPort` attribute |
| X_PROXY_SCHEME | If set to `https` the Tomcat Connectors `secure=true` and `redirectPort` equal to `X_PROXY_PORT` |
| X_PATH | Sets the Tomcat connectors `path` attribute |
| X_SESSION_COOKIE | Set the name of the used Session cookie |

## Contributions

Expand Down
9 changes: 9 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ if [ "$(stat -c "%Y" "${CONF_INSTALL}/conf/server.xml")" -eq "0" ]; then
fi
fi

# check if the `context.xml` file has been changed since the creation of this
# Docker image. If the file has been changed the entrypoint script will not
# perform modifications to the configuration file.
if [ "$(stat --format "%Y" "${CONF_INSTALL}/conf/context.xml")" -eq "0" ]; then
if [ -n "${X_SESSION_COOKIE}" ]; then
xmlstarlet ed --inplace --pf --ps --insert '//Context' --type attr --name "sessionCookieName" --value "CONFLUENCESESSIONID" "${CONF_INSTALL}/conf/context.xml"
fi
fi

if [ -f "${CERTIFICATE}" ]; then
keytool -noprompt -storepass changeit -keystore ${JAVA_CACERTS} -import -file ${CERTIFICATE} -alias CompanyCA
fi
Expand Down