Skip to content

Commit 780c614

Browse files
committed
Several changes in order to be used in the Silverpeas development
workflow: * Add the directory 'repository' in src/. This directory can then be used as a Maven repository when building Silverpeas. It will be then used in the building of the docker image. * Update the script 'run.sh' to take into account any CustomerSettings.xml or CustomSettings.xml file for customizing the settings of Silverpeas. * Update the documentation with the above elements.
1 parent de09993 commit 780c614

File tree

5 files changed

+46
-1
lines changed

5 files changed

+46
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.idea
2+
src/repository/*

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ RUN wget -nc https://www.silverpeas.org/files/silverpeas-${SILVERPEAS_VERSION}-w
8585

8686
# Copy the Maven settings.xml required to install Silverpeas by fetching the software bundles from
8787
# the Silverpeas Nexus Repository
88+
COPY src/repository /root/.m2/repository
8889
COPY src/settings.xml /root/.m2/
8990
COPY src/config.properties /opt/silverpeas/configuration/
9091

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ the volume).
7474

7575
In the case you wish to set some specific configuration parameters in the global Silverpeas
7676
configuration file `config.properties`, set them into a `custom_config.properties` configuration
77-
file on the host and then map to it a `/opt/silverpeas/configuration/custom_config.properties` file
77+
file on the host and then map it to a `/opt/silverpeas/configuration/custom_config.properties` file
7878
in the container.
7979
For example, to set the SMTP properties to receive email notifications, you add them into a
8080
`custom_config.properties` file (for our example, in your home `/home/me`):
@@ -96,6 +96,39 @@ then you map it to the container:
9696
The custom configuration file will be then parsed to add each parameters into the global Silverpeas
9797
configuration file.
9898

99+
### Custom Silverpeas settings
100+
101+
The Silverpeas core engines as well as the Silverpeas applications can be customized by their
102+
settings in the `/opt/silverpeas/properties` directory. For historical reason, the customization of
103+
such settings are performed by an XML script `CustomerSettings.xml` that follows the syntax of the
104+
main `00-SilverpeasSettings.xml` script in `/opt/silverpeas/configuration/silverpeas` directory. If
105+
you wish to customize some of the Silverpeas settings, you can do it through either a
106+
`CustomSettings.xml` file or a `CustomerSettings.xml` file and then map it to the same file in the
107+
`/opt/silverpeas/configuration/silverpeas/` directory in the container.
108+
For example, to set weaker rules for passwords, you can set them into such an XML file (located for
109+
example in your home `/home/me`):
110+
111+
<?xml version="1.0" encoding="UTF-8"?>
112+
<silverpeas-settings product="custom">
113+
<fileset root="${SILVERPEAS_HOME}/properties/org/silverpeas">
114+
<configfile name="password/settings/password.properties">
115+
<parameter key="password.rule.minLength">4</parameter>
116+
<parameter key="password.rule.blankForbidden">false</parameter>
117+
<parameter key="password.rule.sequentialForbidden">false</parameter>
118+
<parameter key="password.rule.atLeastXUppercase">false</parameter>
119+
<parameter key="password.rule.atLeastXLowercase">false</parameter>
120+
<parameter key="password.rule.atLeastXDigit">false</parameter>
121+
<parameter key="password.rule.atLeastXSpecialChar">false</parameter>
122+
</configfile>
123+
</fileset>
124+
</silverpeas-settings>
125+
126+
then you map it to the container:
127+
128+
$ docker run --name silverpeas-test -p 8080:8000 -d \
129+
-v /home/me/CustomSettings.xml:/opt/silverpeas/configuration/silverpeas/CustomSettings.xml \
130+
silverpeas/silverpeas-test
131+
99132
## Logs
100133

101134
You can follow the activity of Silverpeas by watching the logs generated in the mounted
@@ -106,3 +139,9 @@ watched as following:
106139

107140
$ docker logs -f silverpeas
108141

142+
## For development purpose
143+
144+
You can use this project to build a Silverpeas docker image with your own changes in the Silverpeas
145+
code. For doing, build the code of Silverpeas (at least both `Silverpeas-Core` and
146+
`Silverpeas-Component`) with as Maven repository the `src/repository` directory. This folder will be
147+
then automatically used when building a test image of Silverpeas.

src/repository/.gitkeep

Whitespace-only changes.

src/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ configure_silverpeas() {
2222
rm ${SILVERPEAS_HOME}/configuration/custom_config.fixed.properties
2323
configure=1
2424
fi
25+
if [ -f ${SILVERPEAS_HOME}/configuration/silverpeas/CustomerSettings.xml ] || [ -f ${SILVERPEAS_HOME}/configuration/silverpeas/CustomSettings.xml ]; then
26+
echo " -> custom settings detected in CustomerSettings.xml or CustomSettings.xml"
27+
configure=1
28+
fi
2529
if [ $configure -ne 0 ]; then
2630
./silverpeas configure
2731
fi

0 commit comments

Comments
 (0)