diff --git a/cross/diesel/Makefile b/cross/diesel/Makefile new file mode 100644 index 00000000000..2a12d1381d8 --- /dev/null +++ b/cross/diesel/Makefile @@ -0,0 +1,33 @@ +PKG_NAME = diesel +PKG_VERS = 2.1.4 +PKG_EXT = tar.gz +PKG_DIST_NAME = v$(PKG_VERS).$(PKG_EXT) +PKG_DIST_SITE = https://github.com/diesel-rs/diesel/archive +PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) +PKG_DIR = $(PKG_NAME)-$(PKG_VERS) + +DEPENDS += cross/mysql-connector-c + +# powerpc archs (except qoriq) are not supported +UNSUPPORTED_ARCHS += $(OLD_PPC_ARCHS) + +HOMEPAGE = https://diesel.rs/ +COMMENT = A safe, extensible ORM and Query Builder for Rust. +LICENSE = MIT + +# build the cli tool for mysql +RUST_SRC_DIR = $(WORK_DIR)/$(PKG_DIR)/diesel_cli +CARGO_BUILD_ARGS += --no-default-features +CARGO_BUILD_ARGS += --features=mysql + +# we support MariaDB 10 only +# we must define the mysql db socket, since the rust binaries (mysqlclient-sys) +# do not read settings from bin/mysql_conf +export "MYSQL_DB_SOCKET=/run/mysqld/mysqld10.sock" + +# mysqlclient-sys: to find libmysqlclient +ENV += MYSQLCLIENT_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib +# to find dependencies of libmysqlclient (libz) +ENV += RUSTFLAGS="-Clink-arg=-Wl,--rpath,$(INSTALL_PREFIX)/lib -Clink-arg=-Wl,--rpath-link,$(STAGING_INSTALL_PREFIX)/lib" + +include ../../mk/spksrc.cross-rust.mk diff --git a/cross/diesel/PLIST b/cross/diesel/PLIST new file mode 100644 index 00000000000..c2b783bb865 --- /dev/null +++ b/cross/diesel/PLIST @@ -0,0 +1 @@ +bin:bin/diesel diff --git a/cross/diesel/digests b/cross/diesel/digests new file mode 100644 index 00000000000..bc4d98c7631 --- /dev/null +++ b/cross/diesel/digests @@ -0,0 +1,3 @@ +diesel-2.1.4.tar.gz SHA1 ea4fd4a77bcd90038a04bcfefcee7448b63e5b03 +diesel-2.1.4.tar.gz SHA256 5aac923078a5b431902d75cfca36f2990b3f11dbb2bbbc44f4538305af939657 +diesel-2.1.4.tar.gz MD5 d570cfe9013331fad318a94a6a389b8d diff --git a/cross/mysql-connector-c/Makefile b/cross/mysql-connector-c/Makefile index e9f90a027a5..cd1da65ebc4 100644 --- a/cross/mysql-connector-c/Makefile +++ b/cross/mysql-connector-c/Makefile @@ -19,6 +19,19 @@ include ../../mk/spksrc.cross-cmake.mk # give access to comp_err binary on host ENV += PATH=$(WORK_DIR)/../../../native/libmysqlclient/work-native/install/usr/local/bin/:$(CMAKE_PATH):$$PATH +# custom mysql socket addr (default is /tmp/mysql.sock) +# on DSM 7 (only MariaDB 10 available) +# /run/mysqld/mysqld10.sock (links to /run/mysqld/mysqld.sock) +# /run/mysqld/mysqld.sock +# on DSM 6 with mariadb 5 and 10 +# /run/mysqld/mysqld.sock (MariaDB 5) +# /run/mysqld/mysqld10.sock (MariaDB 10) +ifeq ($(MYSQL_DB_SOCKET),) +# default mysql socket for DSM +MYSQL_DB_SOCKET = /run/mysqld/mysqld.sock +endif +CMAKE_ARGS += -DMYSQL_UNIX_ADDR=$(MYSQL_DB_SOCKET) + # Mandatory for build CMAKE_ARGS += -DHAVE_LLVM_LIBCPP_EXITCODE=1 CMAKE_ARGS += -DHAVE_CXX_FLOATING_POINT_OPTIMIZATION_PROBLEMS_EXITCODE=1 diff --git a/cross/syncstorage-rs/Makefile b/cross/syncstorage-rs/Makefile new file mode 100644 index 00000000000..f81d9cb55ca --- /dev/null +++ b/cross/syncstorage-rs/Makefile @@ -0,0 +1,68 @@ +PKG_NAME = syncstorage-rs +PKG_VERS = 0.14.3 +PKG_EXT = tar.gz +PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) +PKG_DIST_SITE = https://github.com/mozilla-services/$(PKG_NAME)/archive/${PKG_VERS} +PKG_DIR = $(PKG_NAME)-$(PKG_VERS) + +# only required for build in cross/syncstorage-rs folder (not when using prebuilt spk/python311) +#BUILD_DEPENDS = cross/python311 +# for openssl-sys +DEPENDS = cross/openssl3 +# for mysqlclient-sys +DEPENDS += cross/mysql-connector-c + +# OLD_PPC_ARCHS are not supported for Rust builds +# Rust has support for qoriq, but the "ring" dependency has issue(s) with big-endian targets +# see: https://github.com/briansmith/ring/issues/1555 (and referenced issues) +# There is an update in https://github.com/briansmith/ring/pull/1677 for (64-bit) PPC +# this might fix ring for 32-bit PPC (qoriq) too. +# An update of ring (>= 0.17.0) is required, syncstorage-rs 0.14.3 has locked ring to 0.16.20. +# +# powerpc archs are not supported +UNSUPPORTED_ARCHS += $(PPC_ARCHS) + +HOMEPAGE = https://github.com/mozilla-services/syncstorage-rs/ +COMMENT = Mozilla Sync Storage built with Rust. +LICENSE = MPL 2.0 + +# arguments to install the main server program +RUST_SRC_DIR = $(WORK_DIR)/$(PKG_DIR)/syncserver +CARGO_BUILD_ARGS += --no-default-features +CARGO_BUILD_ARGS += --features=syncstorage-db/mysql +CARGO_BUILD_ARGS += --locked + +# we support MariaDB 10 only +# we must define the mysql db socket, since the rust binaries (mysqlclient-sys) +# do not read settings from bin/mysql_conf +export MYSQL_DB_SOCKET=/run/mysqld/mysqld10.sock + +# To find libpython in prebuilt or local built python +ifneq ($(PYTHON_STAGING_PREFIX),) +# use prebuilt python +ENV += PYO3_CROSS_LIB_DIR=$(PYTHON_STAGING_PREFIX)/lib/ +ENV += PYO3_CROSS_INCLUDE_DIR=$(PYTHON_STAGING_PREFIX)/include/ +else +# use local python (together with "BUILD_DEPENDS = cross/python311" above) +ENV += PYO3_CROSS_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/ +ENV += PYO3_CROSS_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/ +endif + +# mysqlclient-sys: to find libmysqlclient +ENV += MYSQLCLIENT_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib +# to find dependencies of libmysqlclient (libz) +ENV += RUSTFLAGS="-Clink-arg=-Wl,--rpath,$(INSTALL_PREFIX)/lib -Clink-arg=-Wl,--rpath-link,$(STAGING_INSTALL_PREFIX)/lib" + +POST_INSTALL_TARGET = syncstorage-rs_post_install + +include ../../mk/spksrc.cross-rust.mk + +.PHONY: syncstorage-rs_post_install +syncstorage-rs_post_install: + @$(MSG) Install Tools + @install -m 755 -d $(STAGING_INSTALL_PREFIX)/tools + @tar -cf - -C $(WORK_DIR)/$(PKG_DIR)/tools . | tar -xf - -C $(STAGING_INSTALL_PREFIX)/tools + @$(MSG) Install DB Migration scripts + @install -m 755 -d $(STAGING_INSTALL_PREFIX)/syncstorage-mysql/migrations -d $(STAGING_INSTALL_PREFIX)/tokenserver-db/migrations + @tar -cf - -C $(WORK_DIR)/$(PKG_DIR)/syncstorage-mysql/migrations . | tar -xf - -C $(STAGING_INSTALL_PREFIX)/syncstorage-mysql/migrations + @tar -cf - -C $(WORK_DIR)/$(PKG_DIR)/tokenserver-db/migrations . | tar -xf - -C $(STAGING_INSTALL_PREFIX)/tokenserver-db/migrations diff --git a/cross/syncstorage-rs/PLIST b/cross/syncstorage-rs/PLIST new file mode 100644 index 00000000000..5e07c7dc11f --- /dev/null +++ b/cross/syncstorage-rs/PLIST @@ -0,0 +1,4 @@ +bin:bin/syncserver +rsc:tools/ +rsc:syncstorage-mysql/ +rsc:tokenserver-db/ diff --git a/cross/syncstorage-rs/digests b/cross/syncstorage-rs/digests new file mode 100644 index 00000000000..e0f50a12217 --- /dev/null +++ b/cross/syncstorage-rs/digests @@ -0,0 +1,3 @@ +syncstorage-rs-0.14.3.tar.gz SHA1 0982c8f6d471d277b94596ecca6d8966e26826f4 +syncstorage-rs-0.14.3.tar.gz SHA256 7ece5b08b2160b04ff01fa1fa61069973a63ec2f6aa34ae53fc29c9252539d96 +syncstorage-rs-0.14.3.tar.gz MD5 8b96d242d3e194b50c4f2ffa18b8979f diff --git a/cross/syncstorage-rs/patches/01-tokenserver-auth_pyo3-version.patch b/cross/syncstorage-rs/patches/01-tokenserver-auth_pyo3-version.patch new file mode 100644 index 00000000000..f9bcdf7ef7f --- /dev/null +++ b/cross/syncstorage-rs/patches/01-tokenserver-auth_pyo3-version.patch @@ -0,0 +1,17 @@ +# pyo3 0.14.2 (as locked in Cargo.lock) does not support Python 3.10 and 3.11 +# error: the configured Python interpreter version (3.1) is lower than PyO3's minimum supported version (3.6) +# +# This patch updates to pyo3 0.17.* +# At time of writing pyo3 0.17.3 is used +# +--- tokenserver-auth/Cargo.toml.orig 2023-11-30 02:34:56.000000000 +0000 ++++ tokenserver-auth/Cargo.toml 2023-11-30 18:24:35.953670206 +0000 +@@ -14,7 +14,7 @@ + + async-trait = "0.1.40" + dyn-clone = "1.0.4" +-pyo3 = { version = "0.14", features = ["auto-initialize"] } ++pyo3 = { version = "0.17", features = ["auto-initialize"] } + reqwest = { version = "0.10.10", features = ["json", "rustls-tls"] } + syncserver-common = { path = "../syncserver-common" } + tokenserver-common = { path = "../tokenserver-common" } diff --git a/mk/spksrc.cross-rust.mk b/mk/spksrc.cross-rust.mk index e6385916b26..af03e152713 100644 --- a/mk/spksrc.cross-rust.mk +++ b/mk/spksrc.cross-rust.mk @@ -53,6 +53,11 @@ endif CARGO_INSTALL_ARGS += --path $(RUST_SRC_DIR) CARGO_INSTALL_ARGS += --root $(STAGING_INSTALL_PREFIX) +# Append additional install options if present +ifneq ($(strip $(CARGO_BUILD_ARGS)),) +CARGO_INSTALL_ARGS += $(CARGO_BUILD_ARGS) +endif + # Default build with rust and install with cargo rust_install_target: @echo " ==> Cargo install rust package $(PKG_NAME) ($(shell rustc --version); $(RUST_TOOLCHAIN))" diff --git a/spk/ffsync/BROKEN b/spk/ffsync/BROKEN deleted file mode 100644 index e05071f7305..00000000000 --- a/spk/ffsync/BROKEN +++ /dev/null @@ -1,8 +0,0 @@ -something is wrong with python2 wheels: - - make[3]: Leaving directory '/github/workspace/spk/ffsync' -===> [https://github.com/mozilla-services/tokenserver/archive/1.5.11.tar.gz] -make[3]: Entering directory '/github/workspace/spk/ffsync' -make[3]: *** No rule to make target 'cross-compile-wheel-https://github.com/mozilla-services/tokenserver/archive/1.5.11.tar.gz'. Stop. -make[3]: Leaving directory '/github/workspace/spk/ffsync' - diff --git a/spk/ffsync/Makefile b/spk/ffsync/Makefile index 82b59c4f1ca..0c20252e067 100644 --- a/spk/ffsync/Makefile +++ b/spk/ffsync/Makefile @@ -1,47 +1,68 @@ SPK_NAME = ffsync -SPK_VERS = 1.5.2 -SPK_REV = 3 +SPK_VERS = 0.14.3 +SPK_REV = 1 SPK_ICON = src/ffsync.png -BETA = 1 -BUILD_DEPENDS = cross/python2 cross/setuptools_py2 cross/pip_py2 cross/wheel -BUILD_DEPENDS += cross/gevent cross/greenlet cross/cffi +DEPENDS = cross/syncstorage-rs cross/diesel -DEPENDS = cross/busybox -WHEELS = src/requirements.txt +PYTHON_PACKAGE = python311 +WHEELS = src/requirements-crossenv.txt src/requirements-pure.txt -MAINTAINER = SynoCommunity -DESCRIPTION = Firefox Sync Server 1.5, used for Firefox 29 and later. You can use Firefox Sync Server to synchronize your bookmarks, passwords, settings, history, add-ons and tabs with Firefox on other computers. The service runs on port 8132. -DISPLAY_NAME = Firefox Sync Server 1.5 -CHANGELOG = "1. Fix Python requirement
2. Fix startup issue when pidfile is not yet written" +UNSUPPORTED_ARCHS = $(ARMv5_ARCHS) $(PPC_ARCHS) -HOMEPAGE = https://docs.services.mozilla.com/howtos/run-sync-1.5.html -LICENSE = MPL/GPL/LGPL -HELPURL = https://github.com/SynoCommunity/spksrc/wiki/Firefox-Sync-Server-1.5 +REQUIRED_MIN_DSM = 6.0 +SPK_DEPENDS = MariaDB10:$(PYTHON_PACKAGE) -INSTALLER_SCRIPT = src/installer.sh -SSS_SCRIPT = src/dsm-control.sh -FWPORTS = src/${SPK_NAME}.sc -CONF_DIR = src/conf/ +MAINTAINER = SynoCommunity +DESCRIPTION = An implementation of the Mozilla Sync-1.5 Server protocol used by the sync service in Firefox 29 and later. You can use Mozilla Sync Server to exchange browser data \(bookmarks, history, open tabs, passwords, add-ons, and the like\) between 'clients' in a manner that respects a user's security and privacy. The service runs on port 8132. +DISPLAY_NAME = Mozilla Sync Server +CHANGELOG = "Initial Mozilla Sync Server package." -INSTALL_DEP_SERVICES = mysql -START_DEP_SERVICES = mysql +HOMEPAGE = https://mozilla-services.readthedocs.io/en/latest/howtos/run-sync-1.5.html +LICENSE = MPL 2.0 -INSTALL_PREFIX = /usr/local/$(SPK_NAME) +WIZARDS_DIR = src/wizard/ + +STARTABLE = yes +SERVICE_USER = auto +SERVICE_SETUP = src/service-setup.sh +SERVICE_PORT = 8132 +SERVICE_PORT_TITLE = $(DISPLAY_NAME) + +# Admin link for in DSM UI +ADMIN_PORT = $(SERVICE_PORT) + +# [cryptography] +# Mandatory of using OPENSSL_*_DIR starting with version >= 40 +# https://docs.rs/openssl/latest/openssl/#automatic +DEPENDS += cross/openssl3 +ENV += OPENSSL_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/ +ENV += OPENSSL_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/ + +# [mysqlclient] +ENV += MYSQLCLIENT_CFLAGS="$(CFLAGS) -I$(STAGING_INSTALL_PREFIX)/include/mysql -I$(STAGING_INSTALL_PREFIX)/$(PYTHON_INC_DIR)" +ENV += MYSQLCLIENT_LDFLAGS="$(LDFLAGS)" POST_STRIP_TARGET = ffsync_extra_install -BUSYBOX_CONFIG = usermng -ENV += BUSYBOX_CONFIG="$(BUSYBOX_CONFIG)" +include ../../mk/spksrc.python.mk + +# [greenlet] +ifeq ($(call version_ge, $(TC_GCC), 4.9),1) +WHEELS += src/requirements-crossenv-greenlet-v2.txt +ifeq ($(call version_lt, $(TC_GCC), 5.0),1) +WHEELS_CPPFLAGS += [greenlet] -std=c++11 -fpermissive +endif +else +WHEELS += src/requirements-crossenv-greenlet-v1.txt +endif -include ../../mk/spksrc.spk.mk .PHONY: ffsync_extra_install ffsync_extra_install: - install -m 755 -d $(STAGING_DIR)/var - install -m 644 src/ffsync.ini $(STAGING_DIR)/var/ - sed -i -e "s|https://github.com/mozilla-services/mozservices/archive/e00e1b68130423ad98d0f6185655bde650443da8.zip|mozsvc==0.8|g" \ - -e "s|https://github.com/mozilla-services/tokenserver/archive/d7e513e8a4f5c588b70d685a8df1d2e508c341c0.zip|tokenserver==1.2.7|g" \ - -e "s|https://github.com/mozilla-services/server-syncstorage/archive/1.5.5.zip|SyncStorage==1.5.5|g" \ - -e "s|https://github.com/mozilla-services/syncserver/archive/1.5.2.tar.gz|syncserver==1.5.2|g" \ - $(STAGING_DIR)/share/wheelhouse/requirements.txt + @$(MSG) Install config file + @install -m 755 -d $(STAGING_DIR)/var + @install -m 644 src/var/local.toml $(STAGING_DIR)/var/ + @$(MSG) Patch binaries built with rust to find shared libraries + @patchelf --set-rpath /var/packages/$(SPK_NAME)/target/lib:/var/packages/$(PYTHON_PACKAGE)/target/lib $(STAGING_DIR)/bin/syncserver + @patchelf --set-rpath /var/packages/$(SPK_NAME)/target/lib $(STAGING_DIR)/bin/diesel diff --git a/spk/ffsync/src/conf/PKG_DEPS b/spk/ffsync/src/conf/PKG_DEPS deleted file mode 100644 index 265c6fd5421..00000000000 --- a/spk/ffsync/src/conf/PKG_DEPS +++ /dev/null @@ -1,5 +0,0 @@ -[MariaDB] -dsm_min_ver=5.0-4300 - -[python] -pkg_min_ver=2.7.8-9 diff --git a/spk/ffsync/src/conf/privilege b/spk/ffsync/src/conf/privilege deleted file mode 100644 index 8b3e5509769..00000000000 --- a/spk/ffsync/src/conf/privilege +++ /dev/null @@ -1,31 +0,0 @@ -{ - "defaults":{ - "run-as": "package" - }, - "username": "sc-ffsync", - "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" - }] -} \ No newline at end of file diff --git a/spk/ffsync/src/dsm-control.sh b/spk/ffsync/src/dsm-control.sh deleted file mode 100755 index 51ab9dcebf8..00000000000 --- a/spk/ffsync/src/dsm-control.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/sh - -# Package -PACKAGE="ffsync" -DNAME="Firefox Sync Server 1.5" - -# Others -INSTALL_DIR="/usr/local/${PACKAGE}" -PATH="${INSTALL_DIR}/env/bin:${INSTALL_DIR}/bin:${PYTHON_DIR}/bin:${PATH}" -BUILDNUMBER="$(/bin/get_key_value /etc.defaults/VERSION buildnumber)" -PSERVE="${INSTALL_DIR}/env/bin/pserve" -INI_FILE="${INSTALL_DIR}/var/ffsync.ini" -PID_FILE="${INSTALL_DIR}/var/ffsync.pid" -LOG_FILE="${INSTALL_DIR}/var/pserve.log" - -SC_USER="sc-ffsync" -LEGACY_USER="ffsync" -USER="$([ "${BUILDNUMBER}" -ge "7321" ] && echo -n ${SC_USER} || echo -n ${LEGACY_USER})" - - -start_daemon () -{ - ${PSERVE} ${INI_FILE} --user=${USER} --daemon --pid-file=${PID_FILE} --log-file=${LOG_FILE} - sleep 1 -} - -stop_daemon () -{ - ${PSERVE} ${INI_FILE} --stop-daemon --pid-file=${PID_FILE} --log-file=${LOG_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 - exit 0 - else - echo Starting ${DNAME} ... - start_daemon - exit $? - fi - ;; - stop) - if daemon_status; then - echo Stopping ${DNAME} ... - stop_daemon - exit $? - else - echo ${DNAME} is not running - exit 0 - 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 diff --git a/spk/ffsync/src/ffsync.ini b/spk/ffsync/src/ffsync.ini deleted file mode 100755 index 753bf5b9809..00000000000 --- a/spk/ffsync/src/ffsync.ini +++ /dev/null @@ -1,45 +0,0 @@ -[server:main] -use = egg:Paste#http -host = 0.0.0.0 -port = 8132 - -[app:main] -use = egg:syncserver - -[syncserver] -# This must be edited to point to the public URL of your server, -# i.e. the URL as seen by Firefox. -public_url = http://0.0.0.0:8132/ - -# This defines the database in which to store all server data. -#sqluri = sqlite:////tmp/syncserver.db -sqluri = pymysql://ffsync:@mysql_password@@localhost:3306/ffsync - -# This is a secret key used for signing authentication tokens. -# It should be long and randomly-generated. -# The following command will give a suitable value on *nix systems: -# -# head -c 20 /dev/urandom | sha1sum -# -# If not specified then the server will generate a temporary one at startup. -#secret = INSERT_SECRET_KEY_HERE - -# Set this to "false" to disable new-user signups on the server. -# Only request by existing accounts will be honoured. -# allow_new_users = false - -# Set this to "true" to work around a mismatch between public_url and -# the application URL as seen by python, which can happen in certain reverse- -# proxy hosting setups. It will overwrite the WSGI environ dict with the -# details from public_url. This could have security implications if e.g. -# you tell the app that it's on HTTPS but it's really on HTTP, so it should -# only be used as a last resort and after careful checking of server config. -force_wsgi_environ = false - -# Uncomment and edit the following to use a local BrowserID verifier -# rather than posting assertions to the mozilla-hosted verifier. -# Audiences should be set to your public_url without a trailing slash. -#[browserid] -#backend = tokenserver.verifiers.LocalVerifier -#audiences = https://localhost:5000 - diff --git a/spk/ffsync/src/ffsync.png b/spk/ffsync/src/ffsync.png old mode 100755 new mode 100644 index afcbbfbbe26..ad08b0908c3 Binary files a/spk/ffsync/src/ffsync.png and b/spk/ffsync/src/ffsync.png differ diff --git a/spk/ffsync/src/ffsync.sc b/spk/ffsync/src/ffsync.sc deleted file mode 100644 index 7b5d5c9f4fa..00000000000 --- a/spk/ffsync/src/ffsync.sc +++ /dev/null @@ -1,6 +0,0 @@ -[ffsync_port] -title="Firefox Sync Server 1.5" -desc="Firefox Sync Server 1.5" -port_forward="yes" -dst.ports="8132/tcp" - diff --git a/spk/ffsync/src/installer.sh b/spk/ffsync/src/installer.sh deleted file mode 100755 index ad808a4b2fa..00000000000 --- a/spk/ffsync/src/installer.sh +++ /dev/null @@ -1,168 +0,0 @@ -#!/bin/sh - -# Package -PACKAGE="ffsync" -DNAME="Firefox Sync Server 1.5" - -# Others -INSTALL_DIR="/usr/local/${PACKAGE}" -SSS="/var/packages/${PACKAGE}/scripts/start-stop-status" -PYTHON_DIR="/usr/local/python" -PATH="${INSTALL_DIR}/env/bin:${INSTALL_DIR}/bin:${PYTHON_DIR}/bin:${PATH}" -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" -MYSQL="$([ "${BUILDNUMBER}" -ge "7321" ] && echo -n /bin/mysql || echo -n /usr/syno/mysql/bin/mysql)" -MYSQLDUMP="$([ "${BUILDNUMBER}" -ge "7321" ] && echo -n /bin/mysqldump || echo -n /usr/syno/mysql/bin/mysqldump)" -INI_FILE="${INSTALL_DIR}/var/ffsync.ini" - -DSM6_UPGRADE="${INSTALL_DIR}/var/.dsm6_upgrade" -SC_USER="sc-ffsync" -LEGACY_USER="ffsync" -LEGACY_GROUP="nobody" -USER="$([ "${BUILDNUMBER}" -ge "7321" ] && echo -n ${SC_USER} || echo -n ${LEGACY_USER})" - - -preinst () -{ - # Check MySQL database - if [ "${SYNOPKG_PKG_STATUS}" == "INSTALL" ]; then - if [ ! -z "${wizard_mysql_password_root}" ]; then - if ! ${MYSQL} -u root -p"${wizard_mysql_password_root}" -e quit > /dev/null 2>&1; then - echo "Incorrect MySQL root password" - exit 1 - fi - if ${MYSQL} -u root -p"${wizard_mysql_password_root}" mysql -e "SELECT User FROM user" | grep ^${USER}$ > /dev/null 2>&1; then - echo "MySQL user ${USER} already exists" - exit 1 - fi - if ${MYSQL} -u root -p"${wizard_mysql_password_root}" -e "SHOW DATABASES" | grep ^${PACKAGE}$ > /dev/null 2>&1; then - echo "MySQL database ${PACKAGE} already exists" - exit 1 - fi - fi - fi - - exit 0 -} - -postinst () -{ - # Link - ln -s ${SYNOPKG_PKGDEST} ${INSTALL_DIR} - - # Create conf dir for 4.3 and add dependencies - mkdir -p /var/packages/${PACKAGE}/conf && echo -e "[MariaDB]\ndsm_min_ver=5.0-4300\n\n[python]\npkg_min_ver=2.7.8-9" > /var/packages/${PACKAGE}/conf/PKG_DEPS - - # Install busybox stuff - ${INSTALL_DIR}/bin/busybox --install ${INSTALL_DIR}/bin - - # Edit the configuration according to the wizard - if [ "${SYNOPKG_PKG_STATUS}" == "INSTALL" ]; then - ${MYSQL} -u root -p"${wizard_mysql_password_root}" -e "CREATE DATABASE ${PACKAGE}; GRANT ALL PRIVILEGES ON ${PACKAGE}.* TO '${USER}'@'localhost' IDENTIFIED BY '${wizard_password_ffsync:=ffsync}';" - sed -i -e "s|@mysql_password@|${wizard_password_ffsync:=ffsync}|g" \ - -e "s|^#secret.*|secret = `openssl rand -base64 20`|g" \ - -e "s|http://0.0.0.0:8132|http://${wizard_ffsync_public_url}:8132|g" \ - ${INI_FILE} - 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 - - # Add port-forwarding config - ${SERVICETOOL} --install-configure-file --package ${FWPORTS} >> /dev/null - - # 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 - - # Correct the files ownership - chown -R ${USER}:root ${SYNOPKG_PKGDEST} - - exit 0 -} - -preuninst () -{ - - # Check database - if [ "${SYNOPKG_PKG_STATUS}" == "UNINSTALL" ] && ! ${MYSQL} -u root -p"${wizard_mysql_password_root}" -e quit > /dev/null 2>&1; then - echo "Incorrect MySQL root password" - exit 1 - fi - - # Check database export location - if [ "${SYNOPKG_PKG_STATUS}" == "UNINSTALL" -a -n "${wizard_dbexport_path}" ]; then - if [ -f "${wizard_dbexport_path}" -o -e "${wizard_dbexport_path}/${PACKAGE}.sql" ]; then - echo "File ${wizard_dbexport_path}/${PACKAGE}.sql already exists. Please remove or choose a different location" - exit 1 - fi - fi - - # 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} - - # Export and remove database - if [ "${SYNOPKG_PKG_STATUS}" == "UNINSTALL" ]; then - if [ -n "${wizard_dbexport_path}" ]; then - mkdir -p ${wizard_dbexport_path} - ${MYSQLDUMP} -u root -p"${wizard_mysql_password_root}" ${PACKAGE} > ${wizard_dbexport_path}/${PACKAGE}.sql - fi - ${MYSQL} -u root -p"${wizard_mysql_password_root}" -e "DROP DATABASE ${PACKAGE}; DROP LEGACY_USER '${LEGACY_USER}'@'localhost';" - fi - - 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 - - # 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 -} diff --git a/spk/ffsync/src/requirements-crossenv-greenlet-v1.txt b/spk/ffsync/src/requirements-crossenv-greenlet-v1.txt new file mode 100644 index 00000000000..eab2e8a8b4f --- /dev/null +++ b/spk/ffsync/src/requirements-crossenv-greenlet-v1.txt @@ -0,0 +1,9 @@ +## +## All configurations below are optional and +## are provided to demonstrate how to build +## various wheels. Uncoment to enable. +## + +# [greenlet] +# - gcc < 5.0 (DSM6) Last known working version +greenlet==1.1.3 diff --git a/spk/ffsync/src/requirements-crossenv-greenlet-v2.txt b/spk/ffsync/src/requirements-crossenv-greenlet-v2.txt new file mode 100644 index 00000000000..47a0d61c465 --- /dev/null +++ b/spk/ffsync/src/requirements-crossenv-greenlet-v2.txt @@ -0,0 +1,9 @@ +## +## All configurations below are optional and +## are provided to demonstrate how to build +## various wheels. Uncoment to enable. +## + +# [greenlet] +# - Mandatory require full c++11 support +greenlet==2.0.2 diff --git a/spk/ffsync/src/requirements-crossenv.txt b/spk/ffsync/src/requirements-crossenv.txt new file mode 100644 index 00000000000..d74972f17ff --- /dev/null +++ b/spk/ffsync/src/requirements-crossenv.txt @@ -0,0 +1,33 @@ +# From requirements.txt + +# original dependency does not work with openssl3: +# We pin cryptography to 3.4.8 due to a build error that occurs with the +# current version (36.0.0 at the time of this commit). In short, building +# the cryptography package with Rust results in a segfault, so we need to +# set the CRYPTOGRAPHY_DONT_BUILD_RUST env var to force the package to build +# with C instead. This env var is only present in cryptography<3.5. +#cryptography==3.4.8 + +# [cryptography] +# Mandatory of using OPENSSL_*_DIR starting with version >= 40 +# https://docs.rs/openssl/latest/openssl/#automatic +# ENV += OPENSSL_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/ +# ENV += OPENSSL_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/ +cryptography==41.0.3 + +# From tools/tokenserver/requirements.txt + +# [mysqlclient] +# Depends: mysql-connector-c, mariadb-connector-c +# Require environment variables +# MYSQLCLIENT_CFLAGS +# MYSQLCLIENT_LDFLAGS +mysqlclient==2.1.1 + +sqlalchemy==1.4.46 + +# further crossenv dependencies +cffi==1.16.0 +charset_normalizer==3.3.2 +# greenlet==3.0.1 => supported version depends on gcc version +zope.interface==6.1 diff --git a/spk/ffsync/src/requirements-pure.txt b/spk/ffsync/src/requirements-pure.txt new file mode 100644 index 00000000000..732d747fe17 --- /dev/null +++ b/spk/ffsync/src/requirements-pure.txt @@ -0,0 +1,29 @@ +# From requirements.txt + +pyfxa==0.7.7 +tokenlib==2.0.0 + +# From tools/tokenserver/requirements.txt + +boto==2.49.0 +hawkauthlib==2.0.0 +pyramid==2.0.1 +#sqlalchemy==1.4.46 => crossenv +testfixtures==7.2.2 +#tokenlib==2.0.0 => same as above +PyBrowserID==0.14.0 + + +# further dependencies +hupper==1.12 +idna==3.6 +PasteDeploy==3.1.0 +plaster==1.1.2 +plaster_pastedeploy==1.0.1 +PyJWT==2.8.0 +requests==2.31.0 +translationstring==1.4 +urllib3==2.1.0 +venusian==3.1.0 +WebOb==1.8.7 +zope.deprecation==5.0 diff --git a/spk/ffsync/src/requirements.txt b/spk/ffsync/src/requirements.txt deleted file mode 100644 index 995df7d7573..00000000000 --- a/spk/ffsync/src/requirements.txt +++ /dev/null @@ -1,67 +0,0 @@ -# to enforce cross-compiled versions -setuptools==44.1.0 -wheel==0.33.6 - -alembic==1.4.2 -appdirs==1.4.3 -boto==2.49.0 -CacheControl==0.12.6 -certifi==2019.11.28 -cffi==1.14.1 -chardet==3.0.4 -colorama==0.4.3 -configparser==3.5.0 -contextlib2==0.6.0 -cornice==0.16.2 -#cryptography==2.9 -#distlib==0.3.0 -distro==1.4.0 -gunicorn==19.6.0 -hawkauthlib==2.0.0 -html5lib==1.0.1 -#idna==2.8 -konfig==1.1 -linecache2==1.0.0 -lockfile==0.12.2 -Mako==1.1.2 -MarkupSafe==1.1.1 -mozsvc==0.9 -msgpack==0.6.2 -packaging==20.3 -Paste==3.4.0 -PasteDeploy==2.1.0 -progress==1.5 -PyBrowserID==0.14.0 -pycparser==2.20 -PyFxA==0.7.3 -PyMySQL==0.9.3 -pymysql-sa==1.0 -pyparsing==2.4.6 -pyramid==1.5 -pyramid_hawkauth==0.1.0 -python-dateutil==2.8.1 -python-editor==1.0.4 -pytoml==0.1.21 -repoze.lru==0.7 -requests==2.13.0 -retrying==1.3.3 -simplejson==3.10.0 -#six==1.14.0 -#SQLAlchemy==1.1.5 -#testfixtures==6.14.0 -tokenlib==2.0.0 -traceback2==1.4.0 -translationstring==1.3 -#unittest2==1.1.0 -urllib3==1.25.8 -venusian==2.1.0 -webencodings==0.5.1 -WebOb==1.4.1 -zope.component==4.2.1 -zope.deprecation==4.4.0 -zope.event==4.4 -zope.interface==5.1.0 - -https://github.com/mozilla-services/tokenserver/archive/1.5.11.tar.gz -https://github.com/mozilla-services/server-syncstorage/archive/1.8.0.tar.gz -https://github.com/mozilla-services/syncserver/archive/1.9.1.tar.gz diff --git a/spk/ffsync/src/service-setup.sh b/spk/ffsync/src/service-setup.sh new file mode 100644 index 00000000000..ef5411cad90 --- /dev/null +++ b/spk/ffsync/src/service-setup.sh @@ -0,0 +1,180 @@ + +# ffsync service setup +PYTHON_DIR="/var/packages/python311/target/bin" +PATH="${SYNOPKG_PKGDEST}/env/bin:${SYNOPKG_PKGDEST}/bin:${PYTHON_DIR}:${PATH}" + +MARIADB_10_INSTALL_DIRECTORY="/var/packages/MariaDB10" +MARIADB_10_BIN_DIRECTORY="${MARIADB_10_INSTALL_DIRECTORY}/target/usr/local/mariadb10/bin" +MYSQL="${MARIADB_10_BIN_DIRECTORY}/mysql" +MYSQLDUMP="${MARIADB_10_BIN_DIRECTORY}/mysqldump" + +PYTHON="${SYNOPKG_PKGDEST}/env/bin/python3" +SYNCSERVER="${SYNOPKG_PKGDEST}/bin/syncserver" +DIESEL="${SYNOPKG_PKGDEST}/bin/diesel" +CFG_FILE="${SYNOPKG_PKGVAR}/local.toml" + +SERVICE_COMMAND="${SYNCSERVER} --config=${CFG_FILE}" +SVC_BACKGROUND=y +SVC_WRITE_PID=y + +# enhance logging +export RUST_LOG=debug +export RUST_BACKTRACE=full + +DBUSER=ffsync +DBSERVER="localhost" + +percent_encode () +{ + string="$1" + result="" + len=$(echo "$string" | awk '{print length}') + i=1 + while [ "$i" -le "$len" ]; do + char=$(echo "$string" | cut -c "$i") + if echo "$char" | grep -qE '[0-9a-zA-Z]'; then + result="$result$char" + else + result="$result$(printf '%%%02X' "'$char")" + fi + i=$((i + 1)) + done + echo "$result" +} + +validate_preinst () +{ + # Check MySQL database + if [ "${SYNOPKG_PKG_STATUS}" = "INSTALL" ]; then + if [ -n "${wizard_mysql_password_root}" ]; then + if ! ${MYSQL} -u root -p"${wizard_mysql_password_root}" -e quit > /dev/null 2>&1; then + echo "Incorrect MySQL root password" + exit 1 + fi + if ${MYSQL} -u root -p"${wizard_mysql_password_root}" mysql -e "SELECT User FROM user" | grep ^${DBUSER}$ > /dev/null 2>&1; then + echo "MySQL user ${DBUSER} already exists" + exit 1 + fi + if ${MYSQL} -u root -p"${wizard_mysql_password_root}" -e "SHOW DATABASES" | grep -E '^(syncstorage_rs|tokenserver_rs)$' > /dev/null 2>&1; then + echo "MySQL database(s) for ${DBUSER} already exist(s)" + exit 1 + fi + fi + fi +} + +service_postinst () +{ + separator="====================================================" + + echo "Install Python virtual environment" + install_python_virtualenv + + echo ${separator} + echo "Install packages from wheelhouse" + pip install --disable-pip-version-check --no-deps --no-input --no-index "${SYNOPKG_PKGDEST}/share/wheelhouse"/*.whl + + echo ${separator} + echo "Install pure python packages from index" + pip install --disable-pip-version-check --no-deps --no-input --requirement "${SYNOPKG_PKGDEST}/share/wheelhouse/requirements-pure.txt" + + + if [ "${SYNOPKG_PKG_STATUS}" = "INSTALL" ]; then + # Generate database password for database user + DBPASS_RAW=$(tr -dc 'a-zA-Z0-9!@#$%^&*()_+{}<>?=' ?=]' | head -n 1) + DBPASS_ENC=$(percent_encode "$DBPASS_RAW") + + echo ${separator} + echo "Set up the databases" + # login as root sql user using whatever creds you set up for that + # this sets up a user for sync storage and sets up the databases + ${MYSQL} -u root -p"${wizard_mysql_password_root}" < /dev/null 2>&1; then + echo "Incorrect MySQL root password" + exit 1 + fi + # Check if database export path is specified + if [ "${SYNOPKG_PKG_STATUS}" = "UNINSTALL" ] && [ -n "${wizard_dbexport_path}" ]; then + if [ ! -d "${wizard_dbexport_path}" ]; then + # If the export path directory does not exist, create it + mkdir -p "${wizard_dbexport_path}" || { + # If mkdir fails, print an error message and exit + echo "Error: Unable to create directory ${wizard_dbexport_path}. Check permissions." + exit 1 + } + elif [ ! -w "${wizard_dbexport_path}" ]; then + # If the export path directory is not writable, print an error message and exit + echo "Error: Unable to write to directory ${wizard_dbexport_path}. Check permissions." + exit 1 + fi + if [ -e "$wizard_dbexport_path/syncstorage_rs.sql" ] || [ -e "$wizard_dbexport_path/tokenserver_rs.sql" ]; then + # If either syncstorage_rs.sql or tokenserver_rs.sql already exists, print an error message and exit + echo "File syncstorage_rs.sql or tokenserver_rs.sql already exists in ${wizard_dbexport_path}. Please remove or choose a different location" + exit 1 + fi + # If everything is okay, perform database dumps + ${MYSQLDUMP} -u root -p"${wizard_mysql_password_root}" syncstorage_rs > "${wizard_dbexport_path}/syncstorage_rs.sql" + ${MYSQLDUMP} -u root -p"${wizard_mysql_password_root}" tokenserver_rs > "${wizard_dbexport_path}/tokenserver_rs.sql" + fi +} + +service_postuninst () +{ + # Export and remove database + if [ "${SYNOPKG_PKG_STATUS}" = "UNINSTALL" ]; then + ${MYSQL} -u root -p"${wizard_mysql_password_root}" -e "DROP DATABASE syncstorage_rs; DROP DATABASE tokenserver_rs; DROP USER '${DBUSER}'@'localhost';" + fi +} diff --git a/spk/ffsync/src/var/local.toml b/spk/ffsync/src/var/local.toml new file mode 100644 index 00000000000..141e24dd3ca --- /dev/null +++ b/spk/ffsync/src/var/local.toml @@ -0,0 +1,24 @@ +master_secret = "{{MASTER_SECRET}}" + +# removing this line will default to moz_json formatted logs +human_logs = 1 + +# required to be externally available +host = "0.0.0.0" +# defined by SynoCommunity Package +port = {{TCP_PORT}} + +syncstorage.database_url = "mysql://{{SQL_USER}}:{{SQL_PASS}}@{{DB_SERVER}}/syncstorage_rs" +syncstorage.enable_quota = 0 +syncstorage.enabled = true +syncstorage.limits.max_total_records = 1666 # See issues #298/#333 + +# token +tokenserver.database_url = "mysql://{{SQL_USER}}:{{SQL_PASS}}@{{DB_SERVER}}/tokenserver_rs" +tokenserver.enabled = true +tokenserver.fxa_email_domain = "api.accounts.firefox.com" +tokenserver.fxa_metrics_hash_secret = "{{METRICS_HASH_SECRET}}" +tokenserver.fxa_oauth_server_url = "https://oauth.accounts.firefox.com" +tokenserver.fxa_browserid_audience = "https://token.services.mozilla.com" +tokenserver.fxa_browserid_issuer = "https://api.accounts.firefox.com" +tokenserver.fxa_browserid_server_url = "https://verifier.accounts.firefox.com/v2" diff --git a/spk/ffsync/src/wizard/install_uifile b/spk/ffsync/src/wizard/install_uifile deleted file mode 100644 index 795f4a0e49e..00000000000 --- a/spk/ffsync/src/wizard/install_uifile +++ /dev/null @@ -1,28 +0,0 @@ -[{ - "step_title": "Firefox Sync Server 1.5 database configuration", - "items": [{ - "type": "password", - "desc": "Enter your MySQL root password", - "subitems": [{ - "key": "wizard_mysql_password_root", - "desc": "Root password" - }] - }, { - "type": "password", - "desc": "A 'ffsync' user and database will be created. Please enter a password for the 'ffsync' user.", - "subitems": [{ - "key": "wizard_password_ffsync", - "desc": "ffsync password" - }] - }] -}, { - "step_title": "Public URL", - "items": [{ - "type": "textfield", - "desc": "Provide the client-visible URL. The URL to configure on your device is:

http://public-url:8132/token/1.0/sync/1.5

Note: Configure a reverse proxy for SSL support", - "subitems": [{ - "key": "wizard_ffsync_public_url", - "desc": "Public URL" - }] - }] -}] diff --git a/spk/ffsync/src/wizard/install_uifile.sh b/spk/ffsync/src/wizard/install_uifile.sh new file mode 100644 index 00000000000..9220b6cbfc5 --- /dev/null +++ b/spk/ffsync/src/wizard/install_uifile.sh @@ -0,0 +1,93 @@ +#!/bin/bash + +INTERNAL_IP=$(ip -4 route get 8.8.8.8 | awk '/8.8.8.8/ && /src/ {print $NF}') + +quote_json () +{ + sed -e 's|\\|\\\\|g' -e 's|\"|\\\"|g' +} + +page_append () +{ + if [ -z "$1" ]; then + echo "$2" + elif [ -z "$2" ]; then + echo "$1" + else + echo "$1,$2" + fi +} + +checkPublicUrl() +{ + CHECK_PUBLIC_URL=$(/bin/cat<about:config. Change identity.sync.tokenserver.uri to the following URL:", + "subitems": [{ + "key": "client_ffsync_public_url", + "grow": true + }] + }, { + "desc": "Note: For SSL support, set up a reverse proxy" + }] +} +EOF +) + +main () { + local install_page="" + install_page=$(page_append "$install_page" "$PAGE_FFSYNC_SETUP") + echo "[$install_page]" > "${SYNOPKG_TEMP_LOGFILE}" +} + +main "$@" diff --git a/spk/ffsync/src/wizard/uninstall_uifile b/spk/ffsync/src/wizard/uninstall_uifile deleted file mode 100644 index 66be36095d2..00000000000 --- a/spk/ffsync/src/wizard/uninstall_uifile +++ /dev/null @@ -1,27 +0,0 @@ -[{ - "step_title": "Remove Firefox Sync Server 1.5 database", - "items": [{ - "desc": "Attention: The Firefox Sync Server 1.5 database will be removed during package uninstallation. All users and sync data will be deleted." - }, { - "type": "password", - "desc": "Enter your MySQL password", - "subitems": [{ - "key": "wizard_mysql_password_root", - "desc": "Root password" - }] - }, { - "type": "textfield", - "desc": "Optional: Provide directory for database export. Leave blank to skip export. The directory will be created if it does not exist", - "subitems": [{ - "key": "wizard_dbexport_path", - "desc": "Database export location", - "validator": { - "allowBlank": true, - "regex": { - "expr": "/^\\\/volume[0-9]+\\\//", - "errorText": "Path should begin with /volume?/ with ? the number of the volume" - } - } - }] - }] -}] diff --git a/spk/ffsync/src/wizard/uninstall_uifile.sh b/spk/ffsync/src/wizard/uninstall_uifile.sh new file mode 100644 index 00000000000..5599ea6afc2 --- /dev/null +++ b/spk/ffsync/src/wizard/uninstall_uifile.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +quote_json () +{ + sed -e 's|\\|\\\\|g' -e 's|\"|\\\"|g' +} + +page_append () +{ + if [ -z "$1" ]; then + echo "$2" + elif [ -z "$2" ]; then + echo "$1" + else + echo "$1,$2" + fi +} + +PAGE_FFSYNC_REMOVE=$(/bin/cat< "${SYNOPKG_TEMP_LOGFILE}" +} + +main "$@"