Setup web client with Debian 10

please go inside your sao folder and type:
bash$ pwd

then overwrite:
to the the full path

please go inside your sao folder and type:
bash$ pwd

then overwrite:
to the the full path[quote=“trytfan, post:57, topic:2125”]
root = ~/trytond/sao
[/quote]

Hello, what did you mean?
How can i find post:57, topic:2125? At the rigth side i have find post 57 with scrolling.

Can you the full /etc/tryton/trytond.conf?

Only for better reading:

@ced is it so ok? In post 57 we have the full /etc/tryton/trytond.conf without link.

I didn’t have read the whole discussion, but make things extremely simple. I’m assuming you are using version 5.0.x and you installed the .deb package

  1. setup a database user / password, create a new empty database. Username and password are filled in the tryton.conf file.
  2. just create the most simple /etc/tryton/trytond.conf with only the necessary parts
[database]
uri = postgresql://<username>:<password>@localhost:5432/

[web]
listen = 0.0.0.0:8000
root = /usr/share/tryton-sao/www
  1. from the commandline initialize the database. You will be asked for a admin username and password.
trytond-admin -d <database name> -c /etc/tryton/trytond.conf --all -v
  1. start de trytond-server with systemctl start trytond
  2. check with the (GTK) tryton-client if you can connect to trytond-server (localhost:8000)

Congratulation! you have Tryton running. Please get this all working properly before installing Sao.

The next step will be installing Sao.

  1. download the precompiled version from https://downloads.tryton.org/5.0/ (tryton-sao-5.0.X.tar.gz)
  2. unpack it in /usr/share/tryton-sao/www. Sao will be in a sub directory called package
  3. move all the data from the package a level higher, so all the data resides in /usr/share/tryton-sao/www
  4. get the script https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/productivity/tryton/5.0/sao/files/Attic/sao-dependencies.sh?rev=1.1&content-type=text/x-cvsweb-markup and save it in /usr/share/tryton-sao/www. Call it what you want.
  5. modify the script a bit:
    • change FETCHCMD='ftp' to FETCHCMD='curl -L'
    • change UNZIP='/usr/local/bin/7z x' to UNZIP='7z x' (be sure you have 7z installed)
    • change xargs -0 sha256 -b to xargs -0 sha256sum -b (end of the file)
  6. run the script from /usr/share/tryton-sao/www so,
    cd /usr/share/tryton-sao/www & sh <your script>. You will end up with a directory called sao-dependencies-5.0. In this directory you have another directory called bower_components
  7. symlink the bower_components ln -s /usr/share/tryton-sao/www/sao-dependencies-5.0/bower_components/ /usr/share/tryton-sao/www/
  8. make sure the read / write rights for the trytond-server user (systemctl) are correct! chown -R tryton:tryton /usr/share/tryton-sao/www/
  9. make sure trytond-server is running, start your webbrowser and open the url (localhost:8000). You will see Sao coming up.
1 Like

instead of running the script to generate sao-dependencies, you could directly download the latest generated archive at http://kapouay.odns.fr/pub/tryton/sao-dependencies-5.0-12.tar.gz , unpack it and move the bower_components directory inside the sao root.

1 Like

edbo, Post 63, Script:

sao-dependencies.sh

#!/bin/sh
# little tool to grab all js-dependencies and generate a bower_components/
# directory suitable for tryton-sao

PATH='/usr/bin:/bin:/usr/sbin:/sbin'
set -eu

FETCHCMD='ftp'
UNZIP='/usr/local/bin/7z x'

TRYTON_VERSION='5.0'

umask 022

if [ $# -ne 0 ]; then
	echo "usage: $0" >&2
	exit 1
fi

OUTDIR="${PWD}/sao-dependencies-${TRYTON_VERSION}"

if [ -d "${OUTDIR}" ]; then
	echo "error: output directory already exists: ${OUTDIR}" >&2
	exit 1
fi

EXTRACTDIR=$(mktemp -dt sao-dependencies.XXXXXXXX) || {
	echo "error: unable to create temporary directory" >&2
	exit 1
}

# https://getbootstrap.com/docs/3.3/getting-started/#download
bootstrap() {
	local V="$1"
	local U="https://github.com/twbs/bootstrap/releases/download/v${V}/bootstrap-${V}-dist.zip"
	local O="${OUTDIR}/bower_components/bootstrap/dist"

	${FETCHCMD} -o "${EXTRACTDIR}/bootstrap-${V}-dist.zip" -- "${U}"
	( cd "${EXTRACTDIR}" && ${UNZIP} "bootstrap-${V}-dist.zip" )
	rm "${EXTRACTDIR}/bootstrap-${V}-dist.zip"

	mkdir -p -- "${O}"
	cp -R "${EXTRACTDIR}/bootstrap-${V}-dist"/{css,fonts,js} "${O}"
	rm -rf "${EXTRACTDIR}/bootstrap-${V}-dist"
}

# https://github.com/Eonasdan/bootstrap-datetimepicker/releases
bootstrap_datetimepicker() {
	local V="$1"
	local U="https://github.com/Eonasdan/bootstrap-datetimepicker/archive/${V}.tar.gz"
	local O="${OUTDIR}/bower_components/eonasdan-bootstrap-datetimepicker"

	${FETCHCMD} -o- -- "${U}" | tar zxf - -C "${EXTRACTDIR}"

	mkdir -p "${O}"
	cp -R "${EXTRACTDIR}/bootstrap-datetimepicker-${V}/build" "${O}"
	rm -rf "${EXTRACTDIR}/bootstrap-datetimepicker-${V}"
}

# https://github.com/bright/bootstrap-rtl/releases
bootstrap_rtl_ondemand() {
	local V="$1"
	local U="https://github.com/bright/bootstrap-rtl/archive/v${V}-ondemand.tar.gz"
	local O="${OUTDIR}/bower_components/bootstrap-rtl-ondemand"

	${FETCHCMD} -o- -- "${U}" | tar zxf - -C "${EXTRACTDIR}"

	mkdir -p "${O}"
	cp -R "${EXTRACTDIR}/bootstrap-rtl-${V}-ondemand/dist" "${O}"
	rm -rf "${EXTRACTDIR}/bootstrap-rtl-${V}-ondemand"
}

# https://github.com/c3js/c3/releases
c3() {
	local V="$1"
	local U="https://github.com/c3js/c3/archive/v${V}.tar.gz"
	local O="${OUTDIR}/bower_components/c3"

	${FETCHCMD} -o- -- "${U}" | tar zxf - -C "${EXTRACTDIR}"

	mkdir -p "${O}"
	cp -R "${EXTRACTDIR}/c3-${V}"/c3{.min,}.css \
		"${EXTRACTDIR}/c3-${V}"/c3{.min,}.js \
		"${EXTRACTDIR}/c3-${V}/extensions" \
		"${O}"
	rm "${O}/extensions/chart-bubble/c3.css" \
		"${O}/extensions/chart-bubble/c3.min.js"
	cp "${EXTRACTDIR}/c3-${V}/bower.json" "${O}"	# for dependencies
	rm -rf "${EXTRACTDIR}/c3-${V}"
}

# https://github.com/d3/d3/releases
d3() {
	local V="$1"
	local U="https://github.com/d3/d3/releases/download/v${V}/d3.zip"
	local O="${OUTDIR}/bower_components/d3"

	${FETCHCMD} -o "${EXTRACTDIR}/d3.zip" -- "${U}"
	mkdir "${EXTRACTDIR}/d3"
	( cd "${EXTRACTDIR}/d3" && ${UNZIP} "../d3.zip" )
	rm "${EXTRACTDIR}/d3.zip"

	mkdir -p -- "${O}"
	cp "${EXTRACTDIR}/d3/"d3{.min,}.js "${O}"
	rm -rf "${EXTRACTDIR}/d3"
}

# https://github.com/fullcalendar/fullcalendar/releases
fullcalendar() {
	local V="$1"
	local U="https://github.com/fullcalendar/fullcalendar/releases/download/v${V}/fullcalendar-${V}.zip"
	local O="${OUTDIR}/bower_components/fullcalendar/dist"

	${FETCHCMD} -o "${EXTRACTDIR}/fullcalendar-${V}.zip" -- "${U}"
	( cd "${EXTRACTDIR}" && ${UNZIP} "fullcalendar-${V}.zip" )
	rm "${EXTRACTDIR}/fullcalendar-${V}.zip"

	mkdir -p -- "${O}"
	cp -R "${EXTRACTDIR}/fullcalendar-${V}"/fullcalendar{,.min}.js \
		"${EXTRACTDIR}/fullcalendar-${V}"/fullcalendar{,.min}.css \
		"${EXTRACTDIR}/fullcalendar-${V}"/fullcalendar.print{,.min}.css \
		"${EXTRACTDIR}/fullcalendar-${V}"/gcal{.min,}.js \
		"${EXTRACTDIR}/fullcalendar-${V}"/locale{-all.js,} \
		"${O}"
	rm -rf "${EXTRACTDIR}/fullcalendar-${V}"
}

# https://github.com/guillaumepotier/gettext.js/releases
gettext_js() {
	local V="$1"
	local U="https://github.com/guillaumepotier/gettext.js/archive/${V}.tar.gz"
	local O="${OUTDIR}/bower_components/gettext.js"

	${FETCHCMD} -o- -- "${U}" | tar zxf - -C "${EXTRACTDIR}"

	mkdir -p -- "${O}"
	cp -R "${EXTRACTDIR}/gettext.js-${V}/dist" "${O}"
	rm -rf "${EXTRACTDIR}/gettext.js-${V}"
}

# https://jquery.com/download/
jquery() {
	local V="$1"
	local U="https://code.jquery.com"
	local O="${OUTDIR}/bower_components/jquery/dist"

	mkdir -p "${O}"
	${FETCHCMD} -o "${O}/jquery.js"		"${U}/jquery-${V}.js"
	${FETCHCMD} -o "${O}/jquery.min.js"	"${U}/jquery-${V}.min.js"
	${FETCHCMD} -o "${O}/jquery.min.map"	"${U}/jquery-${V}.min.map"
}

# https://github.com/moment/moment/releases
moment() {
	local V="$1"
	local U="https://github.com/moment/moment/archive/${V}.tar.gz"
	local O="${OUTDIR}/bower_components/moment"

	${FETCHCMD} -o- -- "${U}" | tar zxf - -C "${EXTRACTDIR}"

	mkdir -p -- "${O}"
	cp -R "${EXTRACTDIR}/moment-${V}/moment.js" \
		"${EXTRACTDIR}/moment-${V}/min" \
		"${O}"
	rm "${O}/min/tests.js"
	rm -rf "${EXTRACTDIR}/moment-${V}"
}

# https://github.com/ccampbell/mousetrap/releases
mousetrap() {
	local V="$1"
	local U="https://github.com/ccampbell/mousetrap/archive/${V}.tar.gz"
	local O="${OUTDIR}/bower_components/mousetrap"

	${FETCHCMD} -o- -- "${U}" | tar zxf - -C "${EXTRACTDIR}"

	mkdir -p -- "${O}"
	cp -R "${EXTRACTDIR}/mousetrap-${V}/"mousetrap{.min,}.js \
		"${EXTRACTDIR}/mousetrap-${V}/plugins" \
		"${O}"
	rm -rf "${EXTRACTDIR}/mousetrap-${V}"
}

# https://github.com/mholt/papaparse/releases
papaparse() {
	local V="$1"
	local U="https://github.com/mholt/papaparse/archive/${V}.tar.gz"
	local O="${OUTDIR}/bower_components/papaparse"

	${FETCHCMD} -o- -- "${U}" | tar zxf - -C "${EXTRACTDIR}"

	mkdir -p -- "${O}"
	cp "${EXTRACTDIR}/PapaParse-${V}/"papaparse{.min,}.js "${O}"
	rm -rf "${EXTRACTDIR}/PapaParse-${V}"
}

# download and extract files
bootstrap			'3.3.7'		# ^3.3.7
bootstrap_datetimepicker	'4.17.47'	# ^4.17
bootstrap_rtl_ondemand		'3.3.4'		# ^3.3.4-ondemand
c3				'0.6.11'	# ^0.6
d3				'5.7.0'		# ^5.0.0 (c3 dependency)
fullcalendar			'3.9.0'		# ^3.0
gettext_js			'0.5.5'		# ^0.5
jquery				'3.3.1'		# ^3
moment				'2.23.0'	# ^2.10
mousetrap			'1.6.2'		# ^1.6
papaparse			'4.6.2'		# ^4.1

# cleanup (ensure it is empty)
rmdir "${EXTRACTDIR}"

# generate sha256
( cd "${OUTDIR}" && find "bower_components" -type f -print0 \
	| xargs -0 sha256 -b ) \
	> "${OUTDIR}/SHA256"

Ah, didn’t know that, but that makes things even easier :smile:

Hello edbo,

can you edit your with for the new solution (sao-dependencies-5.0-12.tar.gz) how to? Or create a new how to?

The how to reads very nice.

Thank you

trytfan

I can modify the post, but more important is if you got up-and-running :smile: I can make howto’s which reads nice (thanks for the kind words) but it’s main purpose is to get you (and others) up-and-running. So please let us know if you got everything running.