mirror of
https://github.com/leonardw/synology-open-vm-tools.git
synced 2025-08-16 17:36:51 +00:00
Gateone - Update to git-6ae1d01 and generic DSM5+6 service approach (#3431)
* Update dtach cross package to v0.9 * [Gateone] Update to git-6ae1d01 and DSM5+6 generic service
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
PKG_NAME = dtach
|
||||
PKG_VERS = 0.8
|
||||
PKG_VERS = 0.9
|
||||
PKG_EXT = tar.gz
|
||||
PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
|
||||
PKG_DIST_SITE = http://downloads.sourceforge.net/project/${PKG_NAME}/dtach/${PKG_VERS}
|
||||
|
@ -1,3 +1,3 @@
|
||||
dtach-0.8.tar.gz SHA1 fb7279e719463aa284676a78cdf96788f4f2706b
|
||||
dtach-0.8.tar.gz SHA256 16614ebddf8ab2811d3dc0e7f329c7de88929ac6a9632d4cb4aef7fe11b8f2a9
|
||||
dtach-0.8.tar.gz MD5 ec5999f3b6bb67da19754fcb2e5221f3
|
||||
dtach-0.9.tar.gz SHA1 a3566bfee3d2b70781bac1b29b7e30be29085c9b
|
||||
dtach-0.9.tar.gz SHA256 32e9fd6923c553c443fab4ec9c1f95d83fa47b771e6e1dafb018c567291492f3
|
||||
dtach-0.9.tar.gz MD5 6dac9c0f96d7d55ea56c01504b23faf6
|
||||
|
@ -1,7 +1,7 @@
|
||||
PKG_NAME = gateone
|
||||
PKG_EXT = tar.gz
|
||||
PKG_DOWNLOAD_METHOD = git
|
||||
PKG_GIT_HASH = 1d0e803
|
||||
PKG_GIT_HASH = 6ae1d01
|
||||
PKG_DIST_SITE = https://github.com/liftoff/GateOne.git
|
||||
PKG_DIST_FILE = $(PKG_NAME)-git$(PKG_GIT_HASH).$(PKG_EXT)
|
||||
PKG_DIR = $(PKG_NAME)-git$(PKG_GIT_HASH)
|
||||
@ -9,7 +9,7 @@ PKG_DIR = $(PKG_NAME)-git$(PKG_GIT_HASH)
|
||||
DEPENDS =
|
||||
|
||||
HOMEPAGE = http://liftoffsoftware.com/Products/GateOne
|
||||
COMMENT =
|
||||
COMMENT = "Gate One is an HTML5 web-based terminal emulator and SSH client."
|
||||
LICENSE = AGPLv3
|
||||
|
||||
CONFIGURE_TARGET = nop
|
||||
|
@ -1,31 +1,34 @@
|
||||
SPK_NAME = gateone
|
||||
SPK_VERS = 20151116
|
||||
SPK_REV = 6
|
||||
SPK_VERS = 20171125
|
||||
SPK_REV = 7
|
||||
SPK_ICON = src/gateone.png
|
||||
DSM_UI_DIR = app
|
||||
|
||||
DEPENDS = cross/busybox cross/dtach cross/$(SPK_NAME)
|
||||
WHEELS = certifi backports.ssl-match-hostname tornado html5lib
|
||||
SPK_DEPENDS = "python>=2.7.6-8"
|
||||
WHEELS = src/requirements.txt
|
||||
SPK_DEPENDS = "python>=2.7.11-15"
|
||||
|
||||
MAINTAINER = Diaoul
|
||||
MAINTAINER = M4tt075
|
||||
DESCRIPTION = Gate One is an HTML5-powered terminal emulator and SSH client
|
||||
DESCRIPTION_FRE = Gate One est un émulateur de terminal et un client SSH fonctionnant en HTML5
|
||||
ADMIN_PROTOCOL = https
|
||||
ADMIN_PORT = 8271
|
||||
RELOAD_UI = yes
|
||||
DISPLAY_NAME = GateOne
|
||||
CHANGELOG = "Update to revision 1d0e803"
|
||||
STARTABLE = yes
|
||||
CHANGELOG = "1. Update Gateone to revision 6ae1d01, 2. Update dtach to v0.9, 3. Use DSM 5+6 service approach."
|
||||
HOMEPAGE = http://liftoffsoftware.com/Products/GateOne
|
||||
LICENSE = AGPLv3
|
||||
|
||||
HOMEPAGE = http://liftoffsoftware.com/Products/GateOne
|
||||
LICENSE = AGPLv3
|
||||
# 'auto' reserved value grabs SPK_NAME
|
||||
SERVICE_USER = auto
|
||||
SERVICE_SETUP = src/service-setup.sh
|
||||
|
||||
INSTALLER_SCRIPT = src/installer.sh
|
||||
SSS_SCRIPT = src/dsm-control.sh
|
||||
FWPORTS = src/${SPK_NAME}.sc
|
||||
CONF_DIR = src/conf/
|
||||
# Service configuration
|
||||
SERVICE_PORT = 8271
|
||||
SERVICE_PORT_TITLE = Gateone (HTTPS)
|
||||
|
||||
INSTALL_PREFIX = /usr/local/$(SPK_NAME)
|
||||
# Admin link
|
||||
ADMIN_PROTOCOL = https
|
||||
ADMIN_PORT = ${SERVICE_PORT}
|
||||
|
||||
POST_STRIP_TARGET = gateone_extra_install
|
||||
|
||||
@ -36,10 +39,8 @@ include ../../mk/spksrc.spk.mk
|
||||
|
||||
.PHONY: gateone_extra_install
|
||||
gateone_extra_install:
|
||||
install -m 755 -d $(STAGING_DIR)/app
|
||||
install -m 755 -d $(STAGING_DIR)/ssl
|
||||
install -m 755 -d $(STAGING_DIR)/var
|
||||
install -m 755 -d $(STAGING_DIR)/var/conf.d
|
||||
install -m 644 src/app/config $(STAGING_DIR)/app/config
|
||||
install -m 644 src/90custom.conf $(STAGING_DIR)/var/conf.d/
|
||||
install -m 644 src/95users.conf $(STAGING_DIR)/var/conf.d/
|
||||
|
@ -2,8 +2,8 @@
|
||||
{
|
||||
// "gateone" server-wide settings fall under "*"
|
||||
"*": {
|
||||
"gateone": { // These settings apply to all of Gate One
|
||||
|
||||
"gateone": {
|
||||
// These settings apply to all of Gate One
|
||||
// 10server.conf overrides
|
||||
"cache_dir": "/usr/local/gateone/var/gateone_cache",
|
||||
"certificate": "@certificate@",
|
||||
@ -18,17 +18,18 @@
|
||||
"user_dir": "/usr/local/gateone/var/users",
|
||||
|
||||
// 20authentication.conf overrides
|
||||
// For Google Auth, head to https://console.developers.google.com/project
|
||||
// Create a new project for your GateOne server
|
||||
// Go to Credentials, Under APIs & auth
|
||||
// Click the Create a new Client ID button
|
||||
// Authorized Javascript Origins are the Url's that you access your GateOne server with (must be FQN, no internal NetBIOS names)
|
||||
// Authorized Redirect URIs are the same as above but with '/auth' appended to the end
|
||||
// e.g., https://www.example.com:1234/ and https://www.example.com:1234/auth
|
||||
// Copy the Client ID to "key" below
|
||||
// Copy the Client Secret to "secret" below
|
||||
// Make sure you deny all user by default (below) and edit 95users.conf to enable access
|
||||
// "auth": "google",
|
||||
// For Google Auth, head to https://console.developers.google.com/project
|
||||
// Create a new project for your GateOne server
|
||||
// Go to Credentials, Under APIs & auth
|
||||
// Click the Create a new Client ID button
|
||||
// Authorized Javascript Origins are the Url's that you access your GateOne server with (must be FQN, no internal NetBIOS names)
|
||||
// Authorized Redirect URIs are the same as above but with '/auth' appended to the end
|
||||
// e.g., https://www.example.com:1234/ and https://www.example.com:1234/auth
|
||||
// Copy the Client ID to "key" below
|
||||
// Copy the Client Secret to "secret" below
|
||||
// Make sure you deny all user by default (below) and edit 95users.conf to enable access
|
||||
// "auth": "google",
|
||||
|
||||
"google_oauth": {
|
||||
"key": "***.apps.googleusercontent.com",
|
||||
"secret": "***"
|
||||
@ -39,7 +40,7 @@
|
||||
|
||||
// Terminal overrides
|
||||
"terminal": {
|
||||
// "allow": false // DENY all users by default, enable them in 95users.conf
|
||||
// "allow": false // DENY all users by default, enable them in 95users.conf
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +0,0 @@
|
||||
{
|
||||
".url": {
|
||||
"com.synocommunity.packages.gateone": {
|
||||
"title": "GateOne",
|
||||
"desc": "GateOne",
|
||||
"icon": "images/gateone-{0}.png",
|
||||
"type": "url",
|
||||
"protocol": "https",
|
||||
"port": "8271",
|
||||
"url": "/",
|
||||
"allUsers": true,
|
||||
"grantPrivilege": "local"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
{
|
||||
"defaults":{
|
||||
"run-as": "package"
|
||||
},
|
||||
"username": "sc-gateone",
|
||||
"ctrl-script": [{
|
||||
"action": "preinst",
|
||||
"run-as": "root"
|
||||
}, {
|
||||
"action": "postinst",
|
||||
"run-as": "root"
|
||||
}, {
|
||||
"action": "preuninst",
|
||||
"run-as": "root"
|
||||
}, {
|
||||
"action": "postuninst",
|
||||
"run-as": "root"
|
||||
}, {
|
||||
"action": "preupgrade",
|
||||
"run-as": "root"
|
||||
}, {
|
||||
"action": "postupgrade",
|
||||
"run-as": "root"
|
||||
}, {
|
||||
"action": "start",
|
||||
"run-as": "root"
|
||||
}, {
|
||||
"action": "stop",
|
||||
"run-as": "root"
|
||||
}]
|
||||
}
|
@ -1,103 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Package
|
||||
PACKAGE="gateone"
|
||||
DNAME="GateOne"
|
||||
|
||||
# Others
|
||||
INSTALL_DIR="/usr/local/${PACKAGE}"
|
||||
PYTHON_DIR="/usr/local/python"
|
||||
PATH="${INSTALL_DIR}/bin:${INSTALL_DIR}/env/bin:${PYTHON_DIR}/bin:${PATH}"
|
||||
PYTHON="${INSTALL_DIR}/env/bin/python"
|
||||
BUILDNUMBER="$(/bin/get_key_value /etc.defaults/VERSION buildnumber)"
|
||||
GATEONE="${INSTALL_DIR}/env/bin/gateone"
|
||||
SETTINGS_DIR="${INSTALL_DIR}/var/conf.d"
|
||||
PID_FILE="${INSTALL_DIR}/var/gateone.pid"
|
||||
|
||||
LEGACY_CERTPATH="/usr/syno/etc/ssl/ssl.key"
|
||||
LEGACY_CERTIFICATE="server.crt"
|
||||
LEGACY_KEYFILE="server.key"
|
||||
CERTPATH="/usr/syno/etc/certificate/system/default"
|
||||
CERTIFICATE="cert.pem"
|
||||
KEYFILE="privkey.pem"
|
||||
|
||||
SC_USER="sc-gateone"
|
||||
LEGACY_USER="gateone"
|
||||
USER="$([ "${BUILDNUMBER}" -ge "7321" ] && echo -n ${SC_USER} || echo -n ${LEGACY_USER})"
|
||||
|
||||
|
||||
start_daemon ()
|
||||
{
|
||||
# Copy certificate
|
||||
if [ "${BUILDNUMBER}" -ge "7321" ]; then
|
||||
cp ${CERTIFICATE} ${KEYFILE} ${INSTALL_DIR}/ssl/
|
||||
else
|
||||
cp ${LEGACY_CERTIFICATE} ${LEGACY_KEYFILE} ${INSTALL_DIR}/ssl/
|
||||
fi
|
||||
chown ${USER} ${INSTALL_DIR}/ssl/*
|
||||
|
||||
su ${USER} -s /bin/sh -c "PATH=${PATH} nohup ${PYTHON} ${GATEONE} --settings_dir=${SETTINGS_DIR} > ${INSTALL_DIR}/var/gateone_startup.log &"
|
||||
}
|
||||
|
||||
stop_daemon ()
|
||||
{
|
||||
su ${USER} -s /bin/sh -c "PATH=${PATH} ${PYTHON} ${GATEONE} --kill --settings_dir=${SETTINGS_DIR}"
|
||||
wait_for_status 1 20 || kill -9 `cat ${PID_FILE}`
|
||||
rm -f ${PID_FILE}
|
||||
}
|
||||
|
||||
daemon_status ()
|
||||
{
|
||||
if [ -f ${PID_FILE} ] && kill -0 `cat ${PID_FILE}` > /dev/null 2>&1; then
|
||||
return
|
||||
fi
|
||||
rm -f ${PID_FILE}
|
||||
return 1
|
||||
}
|
||||
|
||||
wait_for_status ()
|
||||
{
|
||||
counter=$2
|
||||
while [ ${counter} -gt 0 ]; do
|
||||
daemon_status
|
||||
[ $? -eq $1 ] && return
|
||||
let counter=counter-1
|
||||
sleep 1
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
if daemon_status; then
|
||||
echo ${DNAME} is already running
|
||||
else
|
||||
echo Starting ${DNAME} ...
|
||||
start_daemon
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
if daemon_status; then
|
||||
echo Stopping ${DNAME} ...
|
||||
stop_daemon
|
||||
else
|
||||
echo ${DNAME} is not running
|
||||
fi
|
||||
;;
|
||||
status)
|
||||
if daemon_status; then
|
||||
echo ${DNAME} is running
|
||||
exit 0
|
||||
else
|
||||
echo ${DNAME} is not running
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
log)
|
||||
echo ${LOG_FILE}
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
@ -1,6 +0,0 @@
|
||||
[gateone]
|
||||
title="GateOne"
|
||||
desc="GateOne"
|
||||
port_forward="yes"
|
||||
dst.ports="8271/tcp"
|
||||
|
@ -1,142 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Package
|
||||
PACKAGE="gateone"
|
||||
DNAME="GateOne"
|
||||
|
||||
# Others
|
||||
INSTALL_DIR="/usr/local/${PACKAGE}"
|
||||
SSS="/var/packages/${PACKAGE}/scripts/start-stop-status"
|
||||
PYTHON_DIR="/usr/local/python"
|
||||
PATH="${INSTALL_DIR}/bin:${INSTALL_DIR}/env/bin:${PYTHON_DIR}/bin:${PATH}"
|
||||
PYTHON="${INSTALL_DIR}/env/bin/python"
|
||||
VIRTUALENV="${PYTHON_DIR}/bin/virtualenv"
|
||||
TMP_DIR="${SYNOPKG_PKGDEST}/../../@tmp"
|
||||
SERVICETOOL="/usr/syno/bin/servicetool"
|
||||
BUILDNUMBER="$(/bin/get_key_value /etc.defaults/VERSION buildnumber)"
|
||||
FWPORTS="/var/packages/${PACKAGE}/scripts/${PACKAGE}.sc"
|
||||
|
||||
CONF_FILE="${INSTALL_DIR}/var/conf.d/90custom.conf"
|
||||
LEGACY_CERTPATH="/usr/syno/etc/ssl/ssl.key"
|
||||
LEGACY_CERTIFICATE="server.crt"
|
||||
LEGACY_KEYFILE="server.key"
|
||||
CERTPATH="/usr/syno/etc/certificate/system/default"
|
||||
CERTIFICATE="cert.pem"
|
||||
KEYFILE="privkey.pem"
|
||||
|
||||
DSM6_UPGRADE="${INSTALL_DIR}/var/.dsm6_upgrade"
|
||||
SC_USER="sc-gateone"
|
||||
LEGACY_USER="gateone"
|
||||
LEGACY_GROUP="nobody"
|
||||
USER="$([ "${BUILDNUMBER}" -ge "7321" ] && echo -n ${SC_USER} || echo -n ${LEGACY_USER})"
|
||||
|
||||
|
||||
preinst ()
|
||||
{
|
||||
exit 0
|
||||
}
|
||||
|
||||
postinst ()
|
||||
{
|
||||
# Link
|
||||
ln -s ${SYNOPKG_PKGDEST} ${INSTALL_DIR}
|
||||
|
||||
# Install busybox stuff
|
||||
${INSTALL_DIR}/bin/busybox --install ${INSTALL_DIR}/bin
|
||||
|
||||
# Create legacy user
|
||||
if [ "${BUILDNUMBER}" -lt "7321" ]; then
|
||||
adduser -h ${INSTALL_DIR}/var -g "${DNAME} User" -G ${LEGACY_GROUP} -s /bin/sh -S -D ${LEGACY_USER}
|
||||
fi
|
||||
|
||||
# Create a Python virtualenv
|
||||
${VIRTUALENV} --system-site-packages ${INSTALL_DIR}/env > /dev/null
|
||||
|
||||
# Install the wheels
|
||||
${INSTALL_DIR}/env/bin/pip install --no-deps --no-index -U --force-reinstall -f ${INSTALL_DIR}/share/wheelhouse ${INSTALL_DIR}/share/wheelhouse/*.whl > /dev/null 2>&1
|
||||
|
||||
# Install GateOne
|
||||
${PYTHON} ${INSTALL_DIR}/share/${PACKAGE}/setup.py install --prefix=${INSTALL_DIR}/env --skip_init_scripts > /dev/null
|
||||
|
||||
# install initial certificates
|
||||
if [ "${BUILDNUMBER}" -ge "7321" ]; then
|
||||
cp ${CERTIFICATE} ${KEYFILE} ${INSTALL_DIR}/ssl/
|
||||
sed -i -e "s|\"certificate\":.*|\"certificate\": \"${INSTALL_DIR}/ssl/${CERTIFICATE}\"|g" \
|
||||
-e "s|\"keyfile\":.*|\"keyfile\": \"${INSTALL_DIR}/ssl/${KEYFILE}\"|g" \
|
||||
${CONF_FILE}
|
||||
else
|
||||
cp ${LEGACY_CERTIFICATE} ${LEGACY_KEYFILE} ${INSTALL_DIR}/ssl/
|
||||
sed -i -e "s|\"certificate\":.*|\"certificate\": \"${INSTALL_DIR}/ssl/${LEGACY_CERTIFICATE}\"|g" \
|
||||
-e "s|\"keyfile\":.*|\"keyfile\": \"${INSTALL_DIR}/ssl/${LEGACY_KEYFILE}\"|g" \
|
||||
${CONF_FILE}
|
||||
fi
|
||||
|
||||
# Correct the files ownership
|
||||
chown -R ${USER}:root ${SYNOPKG_PKGDEST}
|
||||
|
||||
# Add firewall config
|
||||
${SERVICETOOL} --install-configure-file --package ${FWPORTS} >> /dev/null
|
||||
|
||||
exit 0
|
||||
}
|
||||
|
||||
preuninst ()
|
||||
{
|
||||
# Stop the package
|
||||
${SSS} stop > /dev/null
|
||||
|
||||
if [ "${SYNOPKG_PKG_STATUS}" != "UPGRADE" ]; then
|
||||
# Remove the user (if not upgrading)
|
||||
delgroup ${LEGACY_USER} ${LEGACY_GROUP}
|
||||
deluser ${USER}
|
||||
|
||||
# Remove firewall configuration
|
||||
${SERVICETOOL} --remove-configure-file --package ${PACKAGE}.sc >> /dev/null
|
||||
fi
|
||||
|
||||
exit 0
|
||||
}
|
||||
|
||||
postuninst ()
|
||||
{
|
||||
# Remove link
|
||||
rm -f ${INSTALL_DIR}
|
||||
|
||||
exit 0
|
||||
}
|
||||
|
||||
preupgrade ()
|
||||
{
|
||||
# Stop the package
|
||||
${SSS} stop > /dev/null
|
||||
|
||||
# DSM6 Upgrade handling
|
||||
if [ "${BUILDNUMBER}" -ge "7321" ] && [ ! -f ${DSM6_UPGRADE} ]; then
|
||||
echo "Deleting legacy user" > ${DSM6_UPGRADE}
|
||||
delgroup ${LEGACY_USER} ${LEGACY_GROUP}
|
||||
deluser ${LEGACY_USER}
|
||||
fi
|
||||
|
||||
# Revision 5 introduces backward incompatible changes
|
||||
if [ `echo ${SYNOPKG_OLD_PKGVER} | sed -r "s/^.*-([0-9]+)$/\1/"` -le 4 ]; then
|
||||
echo "Please uninstall previous version, no update possible.<br>Remember to save your ${INSTALL_DIR}/var/server.conf file before uninstalling.<br>You will need to manually port old configuration settings to the new configuration files."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Save some stuff
|
||||
rm -fr ${TMP_DIR}/${PACKAGE}
|
||||
mkdir -p ${TMP_DIR}/${PACKAGE}
|
||||
mv ${INSTALL_DIR}/var ${TMP_DIR}/${PACKAGE}/
|
||||
|
||||
exit 0
|
||||
}
|
||||
|
||||
postupgrade ()
|
||||
{
|
||||
# Restore some stuff
|
||||
rm -fr ${INSTALL_DIR}/var
|
||||
mv ${TMP_DIR}/${PACKAGE}/var ${INSTALL_DIR}/
|
||||
rm -fr ${TMP_DIR}/${PACKAGE}
|
||||
|
||||
exit 0
|
||||
}
|
6
spk/gateone/src/requirements.txt
Normal file
6
spk/gateone/src/requirements.txt
Normal file
@ -0,0 +1,6 @@
|
||||
certifi
|
||||
backports.ssl-match-hostname
|
||||
tornado==4.5.3
|
||||
webencodings
|
||||
html5lib
|
||||
futures
|
62
spk/gateone/src/service-setup.sh
Normal file
62
spk/gateone/src/service-setup.sh
Normal file
@ -0,0 +1,62 @@
|
||||
PYTHON_DIR="/usr/local/python"
|
||||
PATH="${SYNOPKG_PKGDEST}/bin:${SYNOPKG_PKGDEST}/env/bin:${PYTHON_DIR}/bin:${PATH}"
|
||||
PYTHON="${SYNOPKG_PKGDEST}/env/bin/python"
|
||||
VIRTUALENV="${PYTHON_DIR}/bin/virtualenv"
|
||||
GATEONE="${SYNOPKG_PKGDEST}/env/bin/gateone"
|
||||
SETTINGS_DIR="${SYNOPKG_PKGDEST}/var/conf.d"
|
||||
CONF_FILE="${SYNOPKG_PKGDEST}/var/conf.d/90custom.conf"
|
||||
if [ $SYNOPKG_DSM_VERSION_MAJOR -ge 6 ]; then
|
||||
CERTPATH="/usr/syno/etc/certificate/system/default/"
|
||||
CERTIFICATE="cert.pem"
|
||||
KEYPATH="/usr/syno/etc/certificate/system/default/"
|
||||
KEYFILE="privkey.pem"
|
||||
else
|
||||
CERTPATH="/usr/syno/etc/ssl/ssl.crt/"
|
||||
CERTIFICATE="server.crt"
|
||||
KEYPATH="/usr/syno/etc/ssl/ssl.key/"
|
||||
KEYFILE="server.key"
|
||||
fi
|
||||
SSL_DIR="${SYNOPKG_PKGDEST}/ssl/"
|
||||
|
||||
SERVICE_COMMAND="${PYTHON} ${GATEONE} --settings_dir=${SETTINGS_DIR}"
|
||||
SVC_BACKGROUND=yes
|
||||
|
||||
service_postinst ()
|
||||
{
|
||||
# Create a Python virtualenv
|
||||
echo "Creaing Python virtualenv..." >> ${INST_LOG}
|
||||
${VIRTUALENV} --system-site-packages ${SYNOPKG_PKGDEST}/env >> ${INST_LOG} 2>&1
|
||||
|
||||
# Install the wheels
|
||||
echo "Installing wheels..." >> ${INST_LOG}
|
||||
${SYNOPKG_PKGDEST}/env/bin/pip install --no-deps --no-index -U --force-reinstall -f ${SYNOPKG_PKGDEST}/share/wheelhouse ${SYNOPKG_PKGDEST}/share/wheelhouse/*.whl >> ${INST_LOG} 2>&1
|
||||
|
||||
# Install GateOne
|
||||
echo "Installing Gateone" >> ${INST_LOG}
|
||||
${PYTHON} ${SYNOPKG_PKGDEST}/share/gateone/setup.py install --prefix=${SYNOPKG_PKGDEST}/env --skip_init_scripts >> ${INST_LOG}
|
||||
|
||||
# Install initial certificates
|
||||
echo "Installing initial certificates..." >> ${INST_LOG}
|
||||
$CP "${CERTPATH}${CERTIFICATE}" "${KEYPATH}${KEYFILE}" ${SSL_DIR}
|
||||
sed -i -e "s,@certificate@,${SSL_DIR}${CERTIFICATE},g" ${CONF_FILE}
|
||||
sed -i -e "s,@keyfile@,${SSL_DIR}${KEYFILE},g" ${CONF_FILE}
|
||||
|
||||
# Fix permissions
|
||||
set_unix_permissions "${SYNOPKG_PKGDEST}/ssl"
|
||||
set_unix_permissions "${SYNOPKG_PKGDEST}/env"
|
||||
|
||||
# Discard legacy obsolete busybox user account
|
||||
BIN=${SYNOPKG_PKGDEST}/bin
|
||||
$BIN/busybox --install $BIN
|
||||
$BIN/delgroup "${USER}" "users" >> ${INST_LOG}
|
||||
$BIN/deluser "${USER}" >> ${INST_LOG}
|
||||
}
|
||||
|
||||
service_preupgrade ()
|
||||
{
|
||||
# Revision 5 introduces backward incompatible changes
|
||||
if [ `echo ${SYNOPKG_OLD_PKGVER} | sed -r "s/^.*-([0-9]+)$/\1/"` -le 4 ]; then
|
||||
echo "Please uninstall previous version, no update possible.<br>Remember to save your ${INSTALL_DIR}/var/server.conf file before uninstalling.<br>You will need to manually port old configuration settings to the new configuration files."
|
||||
exit 1
|
||||
fi
|
||||
}
|
Reference in New Issue
Block a user