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

Store java preferences in the intended location #357

Open
wants to merge 3 commits into
base: 6.0.x
Choose a base branch
from

Conversation

NCMEC-daavendasora
Copy link

Purpose

Resolves:

Goals

Correct the Dockerfiles for Alpine, Centos, & Ubuntu to store both system and user java preferences in the intended location according to the code comments in the Dockerfiles:
Dockerfile comment:

# create Java prefs dir
# this is to avoid warning logs printed by FileSystemPreferences class

Approach

  1. For #355 followed the implementation (with changes) already implemented in Ubuntu Dockerfile, i.e., add system properties to the JAVA_OPTS environment variable and pass it to the image.
  2. For #356 removed redundant path elements so user preferences will be stored directly in /home/wso2carbon/.java/.userPrefs and not subdirectories.

Release note

Allow WSO2IS to successfully store java system and user preferences without needing to give wso2carbon user R/W permissions to /etc/.java

Documentation

# create Java prefs dir
# this is to avoid warning logs printed by FileSystemPreferences class

# create Java prefs dir
# this is to avoid warning logs printed by FileSystemPreferences class

# create Java prefs dir
# this is to avoid warning logs printed by FileSystemPreferences class

Certification

N/A - Code changes made only to implement the intended behavior.

Automation tests

  • Unit tests - none
  • Integration tests - none

Security checks

  • Followed secure coding standards in http://wso2.com/technical-reports/wso2-secure-engineering-guidelines? yes, followed pre-existing coding pattern
  • Ran FindSecurityBugs plugin and verified report? no - changes were entirely within Dockerfiles
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets? yes

Test environment

MacOS 12.5.1,
Docker Desktop 4.12.0 (85629), Docker Engine: 20.10.17
WSO2 Identity Server release 6.0.0

@CLAassistant
Copy link

CLAassistant commented Sep 8, 2022

CLA assistant check
All committers have signed the CLA.

@NCMEC-daavendasora NCMEC-daavendasora changed the title Store java system and user preferences in ${USER_HOME} Store java spreferences in the intended location Sep 8, 2022
@NCMEC-daavendasora NCMEC-daavendasora changed the title Store java spreferences in the intended location Store java preferences in the intended location Sep 8, 2022
java.util.prefs.userRoot should simply point to ${USER_HOME}. Specifying “${USER_HOME}.java/.userPrefs” is redundant and causes java.util.prefs.userRoot to be defined as  “${USER_HOME}.java/.userPrefs/.java/.userPrefs”
Pass java system properties to image using the JAVA_OPS environment variable, the same way the Unbuntu Dockerfile already does.

The directories were created earlier in the Dockerfile, but never set in the image.
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

Successfully merging this pull request may close these issues.

2 participants