Skip to content

Commit 9d08b83

Browse files
committed
Replace the H2 by PostgreSQL as database for Silverpeas.
Replace the initial Silverpeas dataset by the one produced by Aurore.
1 parent fed940f commit 9d08b83

File tree

500 files changed

+30989
-8187
lines changed

Some content is hidden

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

500 files changed

+30989
-8187
lines changed

Dockerfile

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
FROM ubuntu:focal
2-
3-
MAINTAINER Miguel Moquillon "miguel.moquillon@silverpeas.org"
1+
FROM ubuntu:jammy
42

53
ENV TERM=xterm
4+
ENV DEBIAN_FRONTEND=noninteractive
65

76
#
87
# Install required and recommended programs for Silverpeas
@@ -11,7 +10,7 @@ ENV TERM=xterm
1110
# Installation of LibreOffice, ImageMagick, Ghostscript, and then
1211
# the dependencies required to run SWFTools and PDF2JSON
1312
RUN apt-get update \
14-
&& apt-get install -y tzdata \
13+
&& apt-get install -y tzdata \
1514
&& apt-get install -y \
1615
apt-utils \
1716
iputils-ping \
@@ -32,6 +31,8 @@ RUN apt-get update \
3231
libreoffice \
3332
ure \
3433
gpgv \
34+
postgresql \
35+
sudo \
3536
&& rm -rf /var/lib/apt/lists/* \
3637
&& update-ca-certificates -f
3738

@@ -74,9 +75,21 @@ ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
7475
ENV SILVERPEAS_HOME /opt/silverpeas
7576
ENV JBOSS_HOME /opt/wildfly
7677

77-
ARG SILVERPEAS_VERSION=6.4
78+
ARG SILVERPEAS_VERSION=6.4.2-SNAPSHOT
7879
ARG WILDFLY_VERSION=26.1.3
79-
LABEL name="Silverpeas Test" description="An all-to-one image to run Silverpeas for demo/testing purpose" vendor="Silverpeas" version=${SILVERPEAS_VERSION} build=1
80+
81+
LABEL org.opencontainers.image.vendor="Silverpeas" \
82+
org.opencontainers.image.authors="Miguel Moquillon <miguel.moquillon@silverpeas.org>" \
83+
org.opencontainers.image.licenses="AGPLv3" \
84+
org.opencontainers.image.title="Silverpeas for testing/trial purpose" \
85+
org.opencontainers.image.description="An all-to-one image to run Silverpeas for demo/testing purpose" \
86+
org.opencontainers.image.version="${SILVERPEAS_VERSION}"
87+
88+
LABEL name="Silverpeas for testing/trial purpose" \
89+
description="An all-to-one image to run Silverpeas for demo/testing purpose" \
90+
vendor="Silverpeas" \
91+
version="${SILVERPEAS_VERSION}" \
92+
build=1
8093

8194
# Fetch both Silverpeas and Wildfly and unpack them into /opt
8295
RUN wget -nc https://www.silverpeas.org/files/silverpeas-${SILVERPEAS_VERSION}-wildfly${WILDFLY_VERSION%.?.?}.zip \
@@ -90,19 +103,13 @@ RUN wget -nc https://www.silverpeas.org/files/silverpeas-${SILVERPEAS_VERSION}-w
90103
&& unzip wildfly-${WILDFLY_VERSION}.Final.zip -d /opt \
91104
&& mv /opt/silverpeas-${SILVERPEAS_VERSION}-wildfly${WILDFLY_VERSION%.?.?} /opt/silverpeas \
92105
&& mv /opt/wildfly-${WILDFLY_VERSION}.Final /opt/wildfly \
93-
&& wget -nc https://www.silverpeas.org/files/oak-migrate.zip \
94-
&& echo '02d21f69004f2d9e634e82ec062d94521bd6bc0385d7c0ddf9af261cb63afdbb oak-migrate.zip' | sha256sum -c --status - \
95-
&& mkdir -p /opt/oak-migration \
96-
&& unzip oak-migrate.zip -d /opt/oak-migration/ \
97-
&& chmod +x /opt/oak-migration/oak-migrate.sh \
98-
&& rm *.zip \
99-
&& mkdir -p /root/.m2
106+
&& rm ./*.zip \
107+
&& mkdir -p /root/.m2/repository
100108

101109
# Copy the Maven settings.xml required to install Silverpeas by fetching the software bundles from
102110
# the Silverpeas Nexus Repository
103-
COPY src/repository /root/.m2/repository
104111
COPY src/settings.xml /root/.m2/
105-
COPY src/h2 /opt/silverpeas/h2
112+
COPY src/silverpeas.sql /opt/silverpeas/
106113
COPY src/configuration /opt/silverpeas/configuration
107114
COPY src/data /opt/silverpeas/data
108115
COPY src/bin /opt/silverpeas/bin
@@ -128,7 +135,7 @@ EXPOSE 8000 9990
128135

129136
# The following Silverpeas folders are exposed by default so that you can access outside the container the logs,
130137
# the data, and the workflow definitions that are produced in Silverpeas.
131-
VOLUME ["/opt/silverpeas/log", "/opt/silverpeas/data", "/opt/silverpeas/h2"]
138+
VOLUME ["/opt/silverpeas/log", "/opt/silverpeas/data"]
132139

133140
# What to execute by default when running the container
134141
CMD ["/opt/run.sh"]

README.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,30 @@ say English, by passing it to the container through the `locale` environment var
4646
To customize more configuration parameters in Silverpeas, please refer section
4747
**Custom configuration** below.
4848

49+
Once Silverpeas running, you can access it through the following URL
50+
[http://localhost:8000/silverpeas](http://localhost:8000/silverpeas) with your preferred web
51+
browser. To sign in, please use the following login identifier `SilverAdmin` with the following
52+
password `SilverAdmin`. You will find then a Silverpeas collaborative platform with an initial
53+
content set.
54+
4955
### Keep data out of the container
5056

5157
By default, the data are stored into the container and then they can be lost once the container is
5258
removed.
5359
To share the data with others containers or to keep them out of a container, you
54-
can mount the volumes `/opt/silverpeas/data` and `/opt/silverpeas/h2` on the host.
60+
can mount the volumes `/opt/silverpeas/data` and `/var/lib/postgresql/data` on the host.
5561
You can also mount the volume `/opt/silverpeas/log` in order to glance at the logs.
5662
For example:
5763

5864
$ docker run --name silverpeas-test -p 8080:8000 -d \
5965
-v silverpeas-log:/opt/silverpeas/log \
6066
-v silverpeas-data:/opt/silverpeas/data \
61-
-v silverpeas-h2:/opt/silverpeas/h2 \
67+
-v silverpeas-postgresql:/var/lib/postgresql/data \
6268
silverpeas/silverpeas-test
6369

64-
The logs, the Silverpeas data and the H2 database's data are here all mounted on the host under the
65-
respective labels `silverpeas-log`, `silverpeas-data` and `silverpeas-h2`.
66-
Refers the
67-
[Docker Documentation](https://docs.docker.com/engine/tutorials/dockervolumes/#locating-a-volume)
70+
The logs, the Silverpeas data and the PostgreSQL database's data are here all mounted on the host
71+
under the respective labels `silverpeas-log`, `silverpeas-data` and `silverpeas-postgresql`.
72+
Refers the [Docker Documentation](https://docs.docker.com/engine/tutorials/dockervolumes/#locating-a-volume)
6873
to locate the labels of mounted volumes in a Docker installation. Be careful, because the volumes
6974
have a content that was produced at the image creation, they cannot be mounted in the host's
7075
filesystem without losing the volumes' content (the mount point overlays the pre-existing content of
@@ -77,7 +82,7 @@ configuration file `config.properties`, set them into a `custom_config.propertie
7782
file on the host and then map it to a `/opt/silverpeas/configuration/custom_config.properties` file
7883
in the container.
7984
For example, to set the SMTP properties to receive email notifications, you add them into a
80-
`custom_config.properties` file (for our example, in your home `/home/me`):
85+
`custom_config.properties` file (for our example, in your home directory `/home/me`):
8186

8287
SMTP_SERVER=smtp.googlemail.com
8388
SMTP_AUTHENTICATION=true
@@ -98,15 +103,19 @@ configuration file.
98103

99104
### Custom Silverpeas settings
100105

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
106+
The Silverpeas core engines as well as the Silverpeas applications can be customized by modifying
107+
their settings in their properties files located in the `/opt/silverpeas/properties` directory. For
108+
historical reason, the customization of such settings are performed by XML scripts
109+
that follows the syntax of the main `00-SilverpeasSettings.xml` script in the
110+
`/opt/silverpeas/configuration/silverpeas` directory.
111+
112+
By default, this image is provided with a customization of some settings through the XML file
113+
`CustomerSettings.xml`, in order to provide a ready-to-test Silverpeas platform. If you which to add
114+
additional customization of the Silverpeas settings, you can do it by adding then into your own
115+
XML file and then map it to the same file in the
107116
`/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`):
117+
For example, to set weaker rules for passwords, you can set them into the
118+
`MyOwnCustomSettings.xml`XML file (located for example in your home directory `/home/me`):
110119

111120
<?xml version="1.0" encoding="UTF-8"?>
112121
<silverpeas-settings product="custom">
@@ -126,7 +135,7 @@ example in your home `/home/me`):
126135
then you map it to the container:
127136

128137
$ docker run --name silverpeas-test -p 8080:8000 -d \
129-
-v /home/me/CustomSettings.xml:/opt/silverpeas/configuration/silverpeas/CustomSettings.xml \
138+
-v /home/me/MyOwnCustomSettings.xml:/opt/silverpeas/configuration/silverpeas/MyOwnCustomSettings.xml \
130139
silverpeas/silverpeas-test
131140

132141
## Logs

src/bin/h2database

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/bin/setup.sh

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,25 @@
11
#!/usr/bin/env bash
22

3-
migrate_jcr() {
4-
# figure out the data home directory (by default it is into the Silverpeas home directory)
5-
data_home=`grep "SILVERPEAS_DATA_HOME[ ]*=" "${SILVERPEAS_HOME}/configuration/config.properties" | cut -d '=' -f 2 | xargs`
6-
if [ "Z${data_home}" = "Z" ]; then
7-
data_home="${SILVERPEAS_HOME}/data"
8-
else
9-
data_home=`sed -e "s/{env./{/g" <<< "${data_home}"`
10-
data_home=`eval echo -e "${data_home}"`
11-
fi
12-
13-
# figure out now the JCR home directory (by default it is located into the data home directory)
14-
jcr_home=`grep "JCR_HOME[ ]*=" "${SILVERPEAS_HOME}/configuration/config.properties" | cut -d '=' -f 2 | xargs`
15-
if [ "Z${jcr_home}" = "Z" ]; then
16-
jcr_home="${data_home}/jcr"
17-
else
18-
jcr_home=`sed -e "s/SILVERPEAS_DATA_HOME/data_home/g" <<< "${jcr_home}"`
19-
jcr_home=`eval echo -e "${jcr_home}"`
20-
fi
3+
echo "Installation of Silverpeas $1"
4+
/etc/init.d/postgresql start
5+
test $? -eq 0 || exit $?
216

22-
jcr_dir=`dirname ${jcr_home}`
23-
if [ -d "${jcr_dir}/jackrabbit" ] && [ ! -d "${jcr_dir}/jcr/segmentstore" ]; then
24-
echo "Migrate the JCR from Apache Jackrabbit 2 to Apache Jackrabbit Oak..."
25-
if ! /opt/oak-migration/oak-migrate.sh "$jcr_dir/jackrabbit" "$jcr_dir/jcr"; then
26-
exit 1
27-
fi
28-
fi
29-
}
7+
sudo -u postgres psql < ../silverpeas.sql
8+
test $? -eq 0 || exit $?
309

31-
echo "Installation of Silverpeas $1"
32-
./h2database start
3310
./silverpeas clean install
34-
migrate_jcr
3511
ret=$?
3612
if [ $ret -eq 0 ]; then
37-
rm ../log/build-*
38-
touch .install
13+
rm ../log/build-*
14+
touch .install
15+
rm ../silverpeas.sql
3916
else
4017
echo "An error has occurred :-("
4118
echo
4219
for f in ../log/build-*; do
4320
cat "$f"
4421
done
4522
fi
46-
./h2database stop
47-
exit $ret
23+
24+
/etc/init.d/postgresql stop
25+
exit $ret

src/configuration/config.properties

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,8 @@
1-
# Copyright (C) 2000 - 2022 Silverpeas
2-
#
3-
# This program is free software: you can redistribute it and/or modify
4-
# it under the terms of the GNU Affero General Public License as
5-
# published by the Free Software Foundation, either version 3 of the
6-
# License, or (at your option) any later version.
7-
#
8-
# As a special exception to the terms and conditions of version 3.0 of
9-
# the GPL, you may redistribute this Program in connection withWriter Free/Libre
10-
# Open Source Software ("FLOSS") applications as described in Silverpeas's
11-
# FLOSS exception. You should have recieved a copy of the text describing
12-
# the FLOSS exception, and it is also available here:
13-
# "http://www.silverpeas.org/legal/licensing"
14-
#
15-
# This program is distributed in the hope that it will be useful,
16-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18-
# GNU Affero General Public License for more details.
19-
#
20-
# You should have received a copy of the GNU Affero General Public License
21-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1+
SILVERPEAS_USER_LANGUAGE=en
2+
SILVERPEAS_CONTENT_LANGUAGES=en,fr
223

23-
DB_SERVERTYPE=H2
4+
DB_SERVERTYPE=POSTGRESQL
245
DB_SERVER=localhost
25-
DB_USER=silverpeas
6+
DB_USER=silver
267
DB_PASSWORD=silverpeas
27-
DB_NAME=Silverpeas
8+
DB_NAME=silverpeas

src/configuration/silverpeas/99-confAuroraLooks.groovy

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)