merge with develop

This commit is contained in:
Sebastian Sdorra
2020-07-02 07:09:18 +02:00
14 changed files with 76 additions and 387 deletions

View File

@@ -8,13 +8,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Added
- enrich commit mentions in markdown viewer by internal links ([#1210](https://github.com/scm-manager/scm-manager/pull/1210))
- restart service after rpm or deb package upgrade
### Changed
- Checkboxes can now be 'indeterminate' ([#1215](https://github.com/scm-manager/scm-manager/pull/1215))
### Fixed
- Fixed installation of debian packages on distros without preinstalled `at` ([#1216](https://github.com/scm-manager/scm-manager/issues/1216) and [#1217](https://github.com/scm-manager/scm-manager/pull/1217))
- Fixed restart with deb or rpm installation ([#1222](https://github.com/scm-manager/scm-manager/issues/1222) and [#1227](https://github.com/scm-manager/scm-manager/pull/1227))
- Fixed broken migration with empty security.xml ([#1219](https://github.com/scm-manager/scm-manager/issues/1219) and [#1221](https://github.com/scm-manager/scm-manager/pull/1221))
- Added missing architecture to debian installation documentation ([#1230](https://github.com/scm-manager/scm-manager/pull/1230))
- Mercurial on Python 3
## [2.1.1] - 2020-06-23

View File

@@ -9,7 +9,7 @@ displayToc: true
The following code block will configure an apt repository for scm-manager and install it.
```bash
echo 'deb https://packages.scm-manager.org/repository/apt-v2-releases/ stable main' | sudo tee /etc/apt/sources.list.d/scm-manager.list
echo 'deb [arch=all] https://packages.scm-manager.org/repository/apt-v2-releases/ stable main' | sudo tee /etc/apt/sources.list.d/scm-manager.list
sudo apt-key adv --recv-keys --keyserver hkps://keys.openpgp.org 0x975922F193B07D6E
sudo apt-get update
sudo apt-get install scm-server
@@ -24,7 +24,7 @@ To install SCM-Manager as a debian package (.deb), we have to configure an apt r
Create a file at `/etc/apt/sources.list.d/scm-manager.list` with the following content:
```text
deb https://packages.scm-manager.org/repository/apt-v2-releases/ stable main
deb [arch=all] https://packages.scm-manager.org/repository/apt-v2-releases/ stable main
```
This will add the apt repository of the scm-manager stable releases to the list of your apt repositories.

View File

@@ -73,30 +73,6 @@
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
<execution>
<id>copy-jsvc</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>commons-daemon</groupId>
<artifactId>commons-daemon-native</artifactId>
<version>1.1.0</version>
<type>tar.gz</type>
<fileMappers>
<org.codehaus.plexus.components.io.filemappers.FlattenFileMapper/>
</fileMappers>
</artifactItem>
</artifactItems>
<includes>**/jsvc-linux-*</includes>
<outputDirectory>${project.build.directory}/deb/libexec</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
<execution>
<id>copy-webapp</id>
<phase>prepare-package</phase>
@@ -208,18 +184,6 @@
</mapper>
</data>
<data>
<type>directory</type>
<src>${project.build.directory}/deb/libexec</src>
<mapper>
<type>perm</type>
<prefix>/opt/scm-server/libexec</prefix>
<user>root</user>
<group>scm</group>
<filemode>0755</filemode>
</mapper>
</data>
<data>
<type>file</type>
<src>src/main/fs/opt/scm-server/var/webapp/docroot/index.html</src>

View File

@@ -18,58 +18,14 @@
# Copyright (c) 2001-2002 The Apache Software Foundation. All rights
# reserved.
# user used to run the daemon (defaults to current user)
USER="scm"
# extra jvm arguments
EXTRA_JVM_ARGUMENTS="-Djava.awt.headless=true -Dlogback.configurationFile=logging.xml"
BASEDIR="/opt/scm-server"
# set pid path for jsvc
PIDFILE="/var/run/scm-server.pid"
# set log dir for jsvc
LOGDIR="/var/log/scm"
# load settings from defaults directory
[ -r /etc/default/scm-server ] && . /etc/default/scm-server
OS=`uname | tr '[:upper:]' '[:lower:]'`
ARCH=`uname -m`
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
case "$OS" in
sunos*) OS="solaris"
ARCH=`uname -p`
;;
cygwin*) cygwin=true ;;
darwin*) darwin=true
if [ -z "$JAVA_VERSION" ] ; then
JAVA_VERSION="CurrentJDK"
else
echo "Using Java version: $JAVA_VERSION"
fi
if [ -z "$JAVA_HOME" ] ; then
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# If a specific java binary isn't specified search for the standard 'java' binary
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
@@ -97,96 +53,12 @@ fi
CLASSPATH=$CLASSPATH_PREFIX:"$BASEDIR"/conf:"$REPO"/*
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$HOME" ] && HOME=`cygpath --path --windows "$HOME"`
[ -n "$BASEDIR" ] && BASEDIR=`cygpath --path --windows "$BASEDIR"`
[ -n "$REPO" ] && REPO=`cygpath --path --windows "$REPO"`
fi
jsvc=false;
stop="";
if [ "$1" == "start" ]
then
jsvc=true;
else
if [ "$1" == "stop" ]
then
jsvc=true;
stop='-stop';
fi
fi
USER_ARGUMENT=""
if [ "x$USER" != "x" ]
then
USER_ARGUMENT="-user $USER"
fi
DARWIN_USE_ARCH="false"
if $jsvc; then
JSVCCMD=""
if [ "$OS" == "darwin" ]; then
if [ "$DARWIN_USE_ARCH" == "true" ]; then
JSVCCMD="/usr/bin/arch -arch $ARCH $BASEDIR/libexec/jsvc-$OS"
else
JSVCCMD="exec $BASEDIR/libexec/jsvc-$OS"
fi
else
JSVCCMD="exec $BASEDIR/libexec/jsvc-$OS-$ARCH"
fi
# try to extract JAVA_HOME from JAVACMD
if [ -z "$JAVA_HOME" ] ; then
PRG="$JAVACMD"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
DIR="$(dirname "$PRG")"
DIR="$(dirname "$DIR")"
if [ -d "$DIR" ] ; then
JAVA_HOME="$DIR"
fi
fi
# TODO JVM Arguments
$JSVCCMD -cp "$CLASSPATH" $JAVA_OPTS \
$EXTRA_JVM_ARGUMENTS $USER_ARGUMENT \
-outfile "$LOGDIR/scm-server.out" \
-errfile "$LOGDIR/scm-server.err" \
-pidfile "$PIDFILE" \
-jvm server \
-home "$JAVA_HOME" \
-Dapp.name="scm-server" \
-Dapp.pid="$$" \
-Dapp.repo="$REPO" \
-Dbasedir="$BASEDIR" \
$stop sonia.scm.server.ScmServerDaemon \
"$@"
else
exec "$JAVACMD" $JAVA_OPTS \
$EXTRA_JVM_ARGUMENTS \
-classpath "$CLASSPATH" \
-Dapp.name="scm-server" \
-Dapp.pid="$$" \
-Dapp.repo="$REPO" \
-Dbasedir="$BASEDIR" \
sonia.scm.server.ScmServerDaemon \
"$@"
fi
exec "$JAVACMD" $JAVA_OPTS \
$EXTRA_JVM_ARGUMENTS \
-classpath "$CLASSPATH" \
-Dapp.name="scm-server" \
-Dapp.pid="$$" \
-Dapp.repo="$REPO" \
-Dbasedir="$BASEDIR" \
sonia.scm.server.ScmServerDaemon \
"$@"

View File

@@ -37,7 +37,22 @@ systemctl daemon-reload
# enable and start the service
sudo systemctl enable scm-server
# we start scm-manager after 5 seconds
# this is required, because if we install scm-manager with recommend java
# java is not fully setup if we ran our postint script
nohup sh -c "sleep 5; systemctl start scm-server" >/dev/null 2>&1 &
# reload systemd and make service available
systemctl --system daemon-reload || true
# enable service
if ! systemctl is-enabled scm-server >/dev/null
then
systemctl enable scm-server
fi
# start or restart service
if systemctl is-active scm-server >/dev/null
then
systemctl restart scm-server
else
# we start scm-manager after 5 seconds
# this is required, because if we install scm-manager with recommend java
# java is not fully setup if we ran our postint script
nohup sh -c "sleep 5; systemctl start scm-server" >/dev/null 2>&1 &
fi

View File

@@ -29,21 +29,12 @@ HOST=0.0.0.0
# scm-server port
PORT=8080
# change user
USER=scm
# home of scm-manager
export SCM_HOME=/var/lib/scm
# force jvm path
# JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
# path to pid
PIDFILE=/var/run/scm/scm.pid
# path to log directory
LOGDIR=/var/log/scm
# increase memory
# EXTRA_JVM_ARGUMENTS="$EXTRA_JVM_ARGUMENTS -Xms1g -Xmx1g"

View File

@@ -100,7 +100,8 @@
<root level="WARN">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
<!-- uncomment to enable logging to stdout -->
<!-- appender-ref ref="STDOUT" /-->
</root>
</configuration>

View File

@@ -3,14 +3,19 @@ Description=SCM-Manager Server
After=syslog.target network.target
[Service]
Type=forking
Type=simple
User=scm
Group=scm
WorkingDirectory=/opt/scm-server
ExecStart=/opt/scm-server/bin/scm-server start
ExecStop=/opt/scm-server/bin/scm-server stop
ExecStart=/opt/scm-server/bin/scm-server
Restart=on-failure
# Exit code 143 means that the program received a SIGTERM signal to instruct it to exit,
# but it did not handle the signal properly.
# we suppress that warning for now
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target

View File

@@ -73,30 +73,6 @@
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
<execution>
<id>copy-jsvc</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>commons-daemon</groupId>
<artifactId>commons-daemon-native</artifactId>
<version>1.1.0</version>
<type>tar.gz</type>
<fileMappers>
<org.codehaus.plexus.components.io.filemappers.FlattenFileMapper/>
</fileMappers>
</artifactItem>
</artifactItems>
<includes>**/jsvc-linux-*</includes>
<outputDirectory>${project.build.directory}/rpm/libexec</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
<execution>
<id>copy-webapp</id>
<phase>prepare-package</phase>
@@ -163,15 +139,6 @@
<group>scm</group>
<mode>0644</mode>
</rule>
<rule>
<when>
<type>file</type>
<prefix>/opt/scm-server/libexec</prefix>
</when>
<user>root</user>
<group>scm</group>
<mode>0755</mode>
</rule>
</rules>
</ruleset>
</rulesets>
@@ -229,14 +196,6 @@
<ruleset>default</ruleset>
</entry>
<entry>
<name>/opt/scm-server/libexec</name>
<collect>
<from>${project.build.directory}/rpm/libexec</from>
</collect>
<ruleset>default</ruleset>
</entry>
<entry>
<name>/opt/scm-server/var/webapp/docroot/index.html</name>
<file>src/main/fs/opt/scm-server/var/webapp/docroot/index.html</file>

View File

@@ -18,58 +18,14 @@
# Copyright (c) 2001-2002 The Apache Software Foundation. All rights
# reserved.
# user used to run the daemon (defaults to current user)
USER="scm"
# extra jvm arguments
EXTRA_JVM_ARGUMENTS="-Djava.awt.headless=true -Dlogback.configurationFile=logging.xml"
BASEDIR="/opt/scm-server"
# set pid path for jsvc
PIDFILE="/var/run/scm-server.pid"
# set log dir for jsvc
LOGDIR="/var/log/scm"
# load settings from defaults directory
[ -r /etc/default/scm-server ] && . /etc/default/scm-server
OS=`uname | tr '[:upper:]' '[:lower:]'`
ARCH=`uname -m`
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
case "$OS" in
sunos*) OS="solaris"
ARCH=`uname -p`
;;
cygwin*) cygwin=true ;;
darwin*) darwin=true
if [ -z "$JAVA_VERSION" ] ; then
JAVA_VERSION="CurrentJDK"
else
echo "Using Java version: $JAVA_VERSION"
fi
if [ -z "$JAVA_HOME" ] ; then
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# If a specific java binary isn't specified search for the standard 'java' binary
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
@@ -97,96 +53,12 @@ fi
CLASSPATH=$CLASSPATH_PREFIX:"$BASEDIR"/conf:"$REPO"/*
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$HOME" ] && HOME=`cygpath --path --windows "$HOME"`
[ -n "$BASEDIR" ] && BASEDIR=`cygpath --path --windows "$BASEDIR"`
[ -n "$REPO" ] && REPO=`cygpath --path --windows "$REPO"`
fi
jsvc=false;
stop="";
if [ "$1" == "start" ]
then
jsvc=true;
else
if [ "$1" == "stop" ]
then
jsvc=true;
stop='-stop';
fi
fi
USER_ARGUMENT=""
if [ "x$USER" != "x" ]
then
USER_ARGUMENT="-user $USER"
fi
DARWIN_USE_ARCH="false"
if $jsvc; then
JSVCCMD=""
if [ "$OS" == "darwin" ]; then
if [ "$DARWIN_USE_ARCH" == "true" ]; then
JSVCCMD="/usr/bin/arch -arch $ARCH $BASEDIR/libexec/jsvc-$OS"
else
JSVCCMD="exec $BASEDIR/libexec/jsvc-$OS"
fi
else
JSVCCMD="exec $BASEDIR/libexec/jsvc-$OS-$ARCH"
fi
# try to extract JAVA_HOME from JAVACMD
if [ -z "$JAVA_HOME" ] ; then
PRG="$JAVACMD"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
DIR="$(dirname "$PRG")"
DIR="$(dirname "$DIR")"
if [ -d "$DIR" ] ; then
JAVA_HOME="$DIR"
fi
fi
# TODO JVM Arguments
$JSVCCMD -cp "$CLASSPATH" $JAVA_OPTS \
$EXTRA_JVM_ARGUMENTS $USER_ARGUMENT \
-outfile "$LOGDIR/scm-server.out" \
-errfile "$LOGDIR/scm-server.err" \
-pidfile "$PIDFILE" \
-jvm server \
-home "$JAVA_HOME" \
-Dapp.name="scm-server" \
-Dapp.pid="$$" \
-Dapp.repo="$REPO" \
-Dbasedir="$BASEDIR" \
$stop sonia.scm.server.ScmServerDaemon \
"$@"
else
exec "$JAVACMD" $JAVA_OPTS \
$EXTRA_JVM_ARGUMENTS \
-classpath "$CLASSPATH" \
-Dapp.name="scm-server" \
-Dapp.pid="$$" \
-Dapp.repo="$REPO" \
-Dbasedir="$BASEDIR" \
sonia.scm.server.ScmServerDaemon \
"$@"
fi
exec "$JAVACMD" $JAVA_OPTS \
$EXTRA_JVM_ARGUMENTS \
-classpath "$CLASSPATH" \
-Dapp.name="scm-server" \
-Dapp.pid="$$" \
-Dapp.repo="$REPO" \
-Dbasedir="$BASEDIR" \
sonia.scm.server.ScmServerDaemon \
"$@"

View File

@@ -29,21 +29,12 @@ HOST=0.0.0.0
# scm-server port
PORT=8080
# change user
USER=scm
# home of scm-manager
export SCM_HOME=/var/lib/scm
# force jvm path
# JAVA_HOME="/usr/lib/jvm/jre-11"
# path to pid
PIDFILE=/var/run/scm/scm.pid
# path to log directory
LOGDIR=/var/log/scm
# increase memory
# EXTRA_JVM_ARGUMENTS="$EXTRA_JVM_ARGUMENTS -Xms1g -Xmx1g"

View File

@@ -100,7 +100,8 @@
<root level="WARN">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
<!-- uncomment to enable logging to stdout -->
<!-- appender-ref ref="STDOUT" /-->
</root>
</configuration>

View File

@@ -3,14 +3,19 @@ Description=SCM-Manager Server
After=syslog.target network.target
[Service]
Type=forking
Type=simple
User=scm
Group=scm
WorkingDirectory=/opt/scm-server
ExecStart=/opt/scm-server/bin/scm-server start
ExecStop=/opt/scm-server/bin/scm-server stop
ExecStart=/opt/scm-server/bin/scm-server
Restart=on-failure
# Exit code 143 means that the program received a SIGTERM signal to instruct it to exit,
# but it did not handle the signal properly.
# we suppress that warning for now
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target

View File

@@ -32,8 +32,18 @@ if [ -d "${WORKDIR}" ]; then
fi
# reload systemd and make service available
systemctl daemon-reload
systemctl --system daemon-reload || true
# enable and start the service
sudo systemctl enable scm-server
sudo systemctl start scm-server
# enable service
if ! systemctl is-enabled scm-server >/dev/null
then
systemctl enable scm-server
fi
# start or restart service
if systemctl is-active scm-server >/dev/null
then
systemctl restart scm-server
else
systemctl start scm-server
fi