tazbug rev 113

Box is not longer maintained as weel as cmdline bug posts (+ is insecure)
author Christophe Lincoln <pankso@slitaz.org>
date Sat Feb 11 00:21:42 2017 +0100 (2017-02-11)
parents c9939a4ea74c
children 04dc52cb2d8d
files Makefile README TODO bugs.conf convert-desc.sh data/tazbug.desktop old/convert-desc.sh old/tazbug old/tazbug-box old/tazbug-box.desktop old/tazbug.conf tazbug tazbug-box tazbug.conf web/bugs.cgi web/config.cgi
line diff
     1.1 --- a/Makefile	Sat Feb 11 00:00:17 2017 +0100
     1.2 +++ b/Makefile	Sat Feb 11 00:21:42 2017 +0100
     1.3 @@ -14,7 +14,8 @@
     1.4  
     1.5  pot:
     1.6  	xgettext -o po/tazbug.pot -L Shell --package-name="SliTaz Bugs" \
     1.7 -		./tazbug ./tazbug-box ./web/bugs.cgi
     1.8 +		./web/bugs.cgi 
     1.9 +		#./tazbug
    1.10  
    1.11  msgmerge:
    1.12  	@for l in $(LINGUAS); do \
    1.13 @@ -32,12 +33,9 @@
    1.14  # Client install only. Server part is not packaged
    1.15  
    1.16  install:
    1.17 -	install -m 0777 -d $(DESTDIR)/etc/slitaz
    1.18 -	install -m 0777 -d $(DESTDIR)$(PREFIX)/bin
    1.19 +	#install -m 0777 -d $(DESTDIR)$(PREFIX)/bin
    1.20  	install -m 0777 -d $(DESTDIR)$(PREFIX)/share/applications
    1.21 -	install -m 0755 tazbug $(DESTDIR)$(PREFIX)/bin
    1.22 -	install -m 0755 tazbug-box $(DESTDIR)$(PREFIX)/bin
    1.23 -	install -m 0644 tazbug.conf $(DESTDIR)/etc/slitaz
    1.24 +	#install -m 0755 tazbug $(DESTDIR)$(PREFIX)/bin
    1.25  	install -m 0644 data/tazbug.desktop \
    1.26  		$(DESTDIR)$(PREFIX)/share/applications
    1.27  
     2.1 --- a/README	Sat Feb 11 00:00:17 2017 +0100
     2.2 +++ b/README	Sat Feb 11 00:21:42 2017 +0100
     2.3 @@ -8,8 +8,7 @@
     2.4  Roadmap and other sites such as the wiki and forum.
     2.5  
     2.6  Users data are securely stored outside of the web server document root. Passwords
     2.7 -are encrypted with MD5 and also stored outside of the document root. Your ID key
     2.8 -is the MD5 sum of your login, mail and password.
     2.9 +are encrypted with MD5 and also stored outside of the document root.
    2.10  
    2.11  TazBug is simple to use, 2 types of status exist: OPEN and CLOSED and 2 priority
    2.12  levels are handled. Affected packages names can be added to the bug and all
    2.13 @@ -20,19 +19,13 @@
    2.14  ------------
    2.15  
    2.16  	* Simple to use with a clean and modern interface
    2.17 -	* Client side cmdline tool to post bugs and messages
    2.18 -	* Full desktop integration with GTK boxes or local CGI script
    2.19  	* Use http://paste.slitaz.org/ for attaching files
    2.20  	* Use shared accounts with other sites to have only one login
    2.21  
    2.22  
    2.23  Accounts
    2.24  --------
    2.25 -To create an account on SliTaz Bugs you must use the graphical box from
    2.26 -your SliTaz system found in the menu "Network" --> "SliTaz bug report"
    2.27 -You can also use the command line tool tazbug with the signup command:
    2.28 -
    2.29 -$ tazbug signup --name="Real Name" --user=login --mail=mail@domain --pass=pass
    2.30 +To create an account on SliTaz Bugs you can use the web interface
    2.31  
    2.32  
    2.33  Installation
     3.1 --- a/TODO	Sat Feb 11 00:00:17 2017 +0100
     3.2 +++ b/TODO	Sat Feb 11 00:21:42 2017 +0100
     3.3 @@ -1,6 +1,5 @@
     3.4  
     3.5  	* Log bug activity in $bugdir/$id/bug.log
     3.6 -	* Help Box with button on tazbug-box new-bug
     3.7  	* Hg integration by checking in commits if a bug was solved
     3.8  	  and then close it: hg commit -m "My msg [CLOSE=4]"
     3.9  	  Or full Hg integration ? Meaning the tracker itself under Hg and
     4.1 --- a/bugs.conf	Sat Feb 11 00:00:17 2017 +0100
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,15 +0,0 @@
     4.4 -# SliTaz Bug Tracker Web interface configuration. This config file will
     4.5 -# overwrite: /etc/slitaz/tazbug.conf
     4.6 -#
     4.7 -
     4.8 -# TazBug URL for redirection and RSS
     4.9 -WEB_URL="http://localhost/bugs/bugs.cgi"
    4.10 -
    4.11 -# Auth file for user
    4.12 -AUTH_FILE="/var/lib/slitaz/auth/people"
    4.13 -
    4.14 -# People config files
    4.15 -PEOPLE="/var/lib/slitaz/people"
    4.16 -
    4.17 -# Online registration for user
    4.18 -ONLINE_SIGNUP="yes"
     5.1 --- a/convert-desc.sh	Sat Feb 11 00:00:17 2017 +0100
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,36 +0,0 @@
     5.4 -#!/bin/sh
     5.5 -#
     5.6 -# Extract bug description from a bug.conf file to create a desc.txt file
     5.7 -#
     5.8 -. /lib/libtaz.sh
     5.9 -check_root
    5.10 -path="$1"
    5.11 -
    5.12 -if [ ! "${path}" ]; then
    5.13 -	echo "Usage: $0 path/to/bug" && exit 0
    5.14 -fi
    5.15 -
    5.16 -cd ${path}
    5.17 -
    5.18 -for bug in *
    5.19 -do
    5.20 -	. ./${bug}/bug.conf
    5.21 -	echo  -n "Converting bug: ${bug} "
    5.22 -	echo "${DESC}" > ${bug}/desc.txt
    5.23 -	# Clean bug.conf
    5.24 -	cat > ${bug}/bug.conf << EOT
    5.25 -# SliTaz Bug configuration
    5.26 -
    5.27 -BUG="$BUG"
    5.28 -STATUS="$STATUS"
    5.29 -PRIORITY="$PRIORITY"
    5.30 -CREATOR="$CREATOR"
    5.31 -DATE="$DATE"
    5.32 -PKGS="$PKGS"
    5.33 -EOT
    5.34 -	unset DESC BUG STATUS PRIORITY CREATOR DATE PKGS
    5.35 -	chown www.www ${bug}/*
    5.36 -	status
    5.37 -done
    5.38 -
    5.39 -exit 0
     6.1 --- a/data/tazbug.desktop	Sat Feb 11 00:00:17 2017 +0100
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,11 +0,0 @@
     6.4 -[Desktop Entry]
     6.5 -Encoding=UTF-8
     6.6 -Name=SliTaz bug report
     6.7 -Name[fr]=Rapport de bug SliTaz
     6.8 -Name[pt]=Aviso de Bugs do SliTaz
     6.9 -Name[pt_BR]=Aviso de Bugs do SliTaz
    6.10 -Name[ru]=Баг-репорт SliTaz
    6.11 -Exec=tazbug-box
    6.12 -Icon=slitaz-icon
    6.13 -Type=Application
    6.14 -Categories=Application;Network;
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/old/convert-desc.sh	Sat Feb 11 00:21:42 2017 +0100
     7.3 @@ -0,0 +1,36 @@
     7.4 +#!/bin/sh
     7.5 +#
     7.6 +# Extract bug description from a bug.conf file to create a desc.txt file
     7.7 +#
     7.8 +. /lib/libtaz.sh
     7.9 +check_root
    7.10 +path="$1"
    7.11 +
    7.12 +if [ ! "${path}" ]; then
    7.13 +	echo "Usage: $0 path/to/bug" && exit 0
    7.14 +fi
    7.15 +
    7.16 +cd ${path}
    7.17 +
    7.18 +for bug in *
    7.19 +do
    7.20 +	. ./${bug}/bug.conf
    7.21 +	echo  -n "Converting bug: ${bug} "
    7.22 +	echo "${DESC}" > ${bug}/desc.txt
    7.23 +	# Clean bug.conf
    7.24 +	cat > ${bug}/bug.conf << EOT
    7.25 +# SliTaz Bug configuration
    7.26 +
    7.27 +BUG="$BUG"
    7.28 +STATUS="$STATUS"
    7.29 +PRIORITY="$PRIORITY"
    7.30 +CREATOR="$CREATOR"
    7.31 +DATE="$DATE"
    7.32 +PKGS="$PKGS"
    7.33 +EOT
    7.34 +	unset DESC BUG STATUS PRIORITY CREATOR DATE PKGS
    7.35 +	chown www.www ${bug}/*
    7.36 +	status
    7.37 +done
    7.38 +
    7.39 +exit 0
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/old/tazbug	Sat Feb 11 00:21:42 2017 +0100
     8.3 @@ -0,0 +1,174 @@
     8.4 +#!/bin/sh
     8.5 +#
     8.6 +# TazBug Command line tool. Help to encrypt password, key and post on the
     8.7 +# the server side.
     8.8 +#
     8.9 +# Copyright (C) 2012-2014 SliTaz GNU/Linux - BSD License
    8.10 +#
    8.11 +. /usr/lib/slitaz/httphelper
    8.12 +[ -f "/etc/slitaz/tazbug.conf" ] && . /etc/slitaz/tazbug.conf
    8.13 +[ -f "tazbug.conf" ] && . tazbug.conf
    8.14 +
    8.15 +# Use same key for SliTaz sites.
    8.16 +conf=$HOME/.config/slitaz/account.conf
    8.17 +
    8.18 +# Internationalization: $(gettext "")
    8.19 +. /usr/bin/gettext.sh
    8.20 +TEXTDOMAIN='tazbug'
    8.21 +export TEXTDOMAIN
    8.22 +
    8.23 +# Parse cmdline options.
    8.24 +for opt in "$@"
    8.25 +do
    8.26 +	case "$opt" in
    8.27 +		--bug=*)
    8.28 +			bug="${opt#--bug=}" ;;
    8.29 +		--desc=*)
    8.30 +			desc="${opt#--desc=}" ;;
    8.31 +		--msg=*)
    8.32 +			msg="${opt#--msg=}" ;;
    8.33 +		--priority=*)
    8.34 +			priority=${opt#--priority=} ;;
    8.35 +		--pkgs=*)
    8.36 +			pkgs="${opt#--pkgs=}" ;;
    8.37 +		--name=*)
    8.38 +			name="${opt#--name=}" ;;
    8.39 +		--user=*)
    8.40 +			user=${opt#--user=} ;;
    8.41 +		--mail=*)
    8.42 +			mail=${opt#--mail=} ;;
    8.43 +		--pass=*)
    8.44 +			pass=${opt#--pass=} ;;
    8.45 +	esac
    8.46 +done
    8.47 +
    8.48 +#
    8.49 +# Functions
    8.50 +#
    8.51 +
    8.52 +# --> in /usr/lib/slitaz/httphelper
    8.53 +# httpd -e dont work with GET URL requests
    8.54 +http_urlencode() {
    8.55 +	#space: + or %20
    8.56 +	sed -e 's/ /+/g; s/!/%21/g; s/"/%22/g; s/#/%23/g; s/%/%25/g; s/&/%26/g'
    8.57 +}
    8.58 +
    8.59 +# Usage.
    8.60 +usage() {
    8.61 +	cat << EOT
    8.62 +
    8.63 +$(gettext 'Usage:') $(basename $0) $(gettext '[command] [args]')
    8.64 +
    8.65 +$(gettext 'Commands:')
    8.66 +  gen-key     $(gettext "Recreate the SliTaz secure key.")
    8.67 +  gen-config  $(gettext "Create a new SliTaz account configuration.")
    8.68 +  signup      $(gettext "Create a new account on SliTaz Bugs.")
    8.69 +  new-msg     $(gettext "Send a new message to an open bug.")
    8.70 +  new-bug     $(gettext "Send a new bug report.")
    8.71 +
    8.72 +$(gettext 'Examples:')
    8.73 +  $(basename $0) signup --name="Real Name" --user=login \\
    8.74 +	--mail=mail@domain --pass=password
    8.75 +  $(basename $0) new-msg --bug=0 --msg="Message for bug with ID 0"
    8.76 +
    8.77 +EOT
    8.78 +}
    8.79 +
    8.80 +# Check cmdline user info args
    8.81 +check_info_args() {
    8.82 +	[ ! "$name" ] && gettext "Missing real name" && echo && exit 0
    8.83 +	[ ! "$user" ] && gettext "Missing login name" && echo && exit 0
    8.84 +	[ ! "$mail" ] && gettext "Missing email" && echo && exit 0
    8.85 +	[ ! "$pass" ] && gettext "Missing password" && echo && exit 0
    8.86 +}
    8.87 +
    8.88 +# Crypt pass when login
    8.89 +crypt_pass() {
    8.90 +	echo -n "$1" | md5sum | awk '{print $1}'
    8.91 +}
    8.92 +
    8.93 +# Gen a config file
    8.94 +gen_config() {
    8.95 +	gettext "Creating SliTaz account configuration..."; echo
    8.96 +	mkdir -p $HOME/.config/slitaz
    8.97 +	cat > $conf << EOT
    8.98 +# SliTaz account configuration
    8.99 +
   8.100 +NAME="$name"
   8.101 +USER="$user"
   8.102 +MAIL="$mail"
   8.103 +KEY=""
   8.104 +EOT
   8.105 +	chmod 0600 $conf
   8.106 +}
   8.107 +
   8.108 +# Gen the secure key: gen_key login mail passwd
   8.109 +gen_key() {
   8.110 +	gettext "Creating SliTaz secure key..."; echo
   8.111 +	key=$(echo -n "$user:$mail:$pass" | md5sum | awk '{print $1}')
   8.112 +	sed -i s"/KEY=.*/KEY=\"$key\"/" $conf
   8.113 +	chmod 0600 $conf
   8.114 +}
   8.115 +
   8.116 +#
   8.117 +# Commands
   8.118 +#
   8.119 +
   8.120 +case "$1" in
   8.121 +	gen-key)
   8.122 +		# MD5 key
   8.123 +		[ ! "$pass" ] && gettext "Missing password" && echo && exit 0
   8.124 +		. $conf || exit 1
   8.125 +		gen_key $USER $MAIL $pass ;;
   8.126 +	gen-config)
   8.127 +		# Recreate a config file if values have changed sites must be updated
   8.128 +		check_info_args
   8.129 +		gen_config
   8.130 +		gen_key ;;
   8.131 +	signup)
   8.132 +		# Create an account on the server
   8.133 +		check_info_args
   8.134 +		echo ""
   8.135 +		echo "Sending account request for: $name ($user)"
   8.136 +		# 'gen_key user:mail:passwd' locally but don't send it. It will be
   8.137 +		# generated on server from the user login, mail and encrypted password
   8.138 +		# so it is not transmited in GET urls.
   8.139 +		gen_config
   8.140 +		pass=$(crypt_pass $pass)
   8.141 +		name="$(echo $name | http_urlencode)"
   8.142 +		gen_key
   8.143 +		. $conf
   8.144 +		echo "Secure key: $KEY"
   8.145 +		# Wget GET url
   8.146 +		busybox wget "${WEB_URL}?signup=$user&name=$name&mail=$mail&pass=$pass" \
   8.147 +			-O /tmp/bug.msg
   8.148 +		cat /tmp/bug.msg && rm -f /tmp/bug.msg && echo "" ;;
   8.149 +	new-msg)
   8.150 +		# Post a new message: ID message
   8.151 +		. $conf || exit 1
   8.152 +		[ ! "$bug" ] && gettext "Missing bug ID" && echo && exit 0
   8.153 +		[ ! "$msg" ] && gettext "Missing message" && echo && exit 0
   8.154 +		msg="$(echo $msg | http_urlencode)"
   8.155 +		# Wget GET url
   8.156 +		busybox wget \
   8.157 +			"${WEB_URL}?key=$KEY&bug=$bug&msg=$msg" -O /tmp/bug.msg
   8.158 +		cat /tmp/bug.msg && rm -f /tmp/bug.msg && echo "" ;;
   8.159 +	new-bug)
   8.160 +		# Post a new bug: bug desc priority pkgs
   8.161 +		. $conf || exit 1
   8.162 +		[ ! "$bug" ] && gettext "Missing bug title" && echo && exit 0
   8.163 +		[ ! "$desc" ] && gettext "Missing description" && echo && exit 0
   8.164 +		[ ! "$priority" ] && gettext "Missing bug priority" && echo && exit 0
   8.165 +		bug="$(echo $bug | http_urlencode)"
   8.166 +		desc="$(echo $desc | http_urlencode)"
   8.167 +		releases="$(basename $(cat /var/lib/tazpkg/mirror))"
   8.168 +		# Wget GET url
   8.169 +		busybox wget \
   8.170 +			"${WEB_URL}?key=$KEY&bug=$bug&desc=$desc&priority=$priority&pkgs=$pkgs&releases=$releases" \
   8.171 +			-O /tmp/bug.msg
   8.172 +		cat /tmp/bug.msg && rm -f /tmp/bug.msg && echo "" ;;
   8.173 +	*)
   8.174 +		usage ;;
   8.175 +esac
   8.176 +
   8.177 +exit 0
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/old/tazbug-box	Sat Feb 11 00:21:42 2017 +0100
     9.3 @@ -0,0 +1,203 @@
     9.4 +#!/bin/sh
     9.5 +#
     9.6 +# SliTaz Bug GUI tool. All the account parts may move to slitaz-account
     9.7 +# if we use it for other sites and services so we use one centralized
     9.8 +# SliTaz account.
     9.9 +#
    9.10 +# Copyright (C) 2012-2014 SliTaz GNU/Linux - BSD License
    9.11 +#
    9.12 +# Authors : Christophe Lincoln <pankso@slitaz.org>
    9.13 +#
    9.14 +[ -f "/etc/slitaz/tazbug.conf" ] && . /etc/slitaz/tazbug.conf
    9.15 +[ -f "tazbug.conf" ] && . tazbug.conf
    9.16 +
    9.17 +opts="--window-icon=/usr/share/pixmaps/slitaz-icon.png --center \
    9.18 +--image=slitaz-icon --image-on-top --width=480 --height=340"
    9.19 +
    9.20 +# Internationalization: $(gettext "")
    9.21 +. /usr/bin/gettext.sh
    9.22 +TEXTDOMAIN='tazbug'
    9.23 +export TEXTDOMAIN
    9.24 +
    9.25 +#
    9.26 +# Functions
    9.27 +#
    9.28 +
    9.29 +# Output cmd in GTK box.
    9.30 +output() {
    9.31 +	yad $opts --text-info --text="<b>SliTaz Bug</b>" --title="SliTaz Bug" \
    9.32 +		--margins=8 --tail --button="$(gettext "My account"):0" \
    9.33 +		--button="gtk-close":1
    9.34 +	case $? in
    9.35 +		0) $0 account ;;
    9.36 +		1) exit 0 ;;
    9.37 +	esac
    9.38 +}
    9.39 +
    9.40 +# New message box
    9.41 +new_msg_main() {
    9.42 +	yad --form $opts \
    9.43 +		--title="Bug message" \
    9.44 +		--text="<b>SliTaz Bugs Message</b>" \
    9.45 +		--field="$(gettext "Bug ID")":NUM \
    9.46 +		--field="$(gettext "Message")":TXT \
    9.47 +		--button="$(gettext "New bug"):2" \
    9.48 +		--button="$(gettext "Send message"):0" \
    9.49 +		--button="gtk-close:1"
    9.50 +}
    9.51 +
    9.52 +# New message main function
    9.53 +new_msg() {
    9.54 +	# Store box results
    9.55 +	main=$(new_msg_main)
    9.56 +	ret=$?
    9.57 +	# Deal with --button values
    9.58 +	case $ret in
    9.59 +		1) exit 0 ;;
    9.60 +		2) $0 new-bug && exit 0 ;;
    9.61 +		*) continue ;;
    9.62 +	esac
    9.63 +	id="$(echo $main | cut -d "|" -f 1 | cut -d "," -f 1)"
    9.64 +	msg="$(echo $main | cut -d "|" -f 2)"
    9.65 +	if [ "$msg" ]; then
    9.66 +		tazbug new-msg --bug=$id --msg="$msg" | output
    9.67 +	fi
    9.68 +}
    9.69 +
    9.70 +# New bug box
    9.71 +new_bug_main() {
    9.72 +	yad --form $opts \
    9.73 +		--title="Bug report" \
    9.74 +		--text="<b>SliTaz Bug Report</b>" \
    9.75 +		--field="$(gettext "Bug title")" \
    9.76 +		--field="$(gettext "Priority")":CB \
    9.77 +		--field="$(gettext "Packages")" \
    9.78 +		--field="$(gettext "Description")":TXT \
    9.79 +		--button="$(gettext "My account"):3" \
    9.80 +		--button="$(gettext "New message"):2" \
    9.81 +		--button="$(gettext "Send bug"):0" \
    9.82 +		--button="gtk-close:1" \
    9.83 +		"" "standard!critical" "" ""
    9.84 +}
    9.85 +
    9.86 +# New bug main function
    9.87 +new_bug() {
    9.88 +	# Store box results
    9.89 +	main=$(new_bug_main)
    9.90 +	ret=$?
    9.91 +	# Deal with --button values
    9.92 +	case $ret in
    9.93 +		1) exit 0 ;;
    9.94 +		2) $0 new-msg && exit 0 ;;
    9.95 +		3) $0 account && exit 0 ;;
    9.96 +		*) continue ;;
    9.97 +	esac
    9.98 +	bug="$(echo $main | cut -d "|" -f 1)"
    9.99 +	desc="$(echo $main | cut -d "|" -f 4)"
   9.100 +	priority="$(echo $main | cut -d "|" -f 2)"
   9.101 +	pkgs="$(echo $main | cut -d "|" -f 3)"
   9.102 +	if [ "$bug" ] && [ "$desc" ]; then
   9.103 +		tazbug new-bug --bug="$bug" --desc="$desc" --priority=$priority \
   9.104 +			--pkgs="$pkgs" | output
   9.105 +	fi
   9.106 +}
   9.107 +
   9.108 +# Account information.
   9.109 +account_info() {
   9.110 +	. $HOME/.config/slitaz/account.conf
   9.111 +	cat << EOT
   9.112 +$(gettext "Real name")
   9.113 +$NAME
   9.114 +$(gettext "User name")
   9.115 +$USER
   9.116 +Email
   9.117 +$MAIL
   9.118 +$(gettext "Secure key")
   9.119 +$KEY
   9.120 +EOT
   9.121 +}
   9.122 +
   9.123 +# Main GUI box function with pure Yad spec
   9.124 +account_main() {
   9.125 +	account_info | yad --list $opts \
   9.126 +		--title="Bugs account" \
   9.127 +		--text="<b>SliTaz Bugs Account</b>" \
   9.128 +		--column "$(gettext "Account")" \
   9.129 +		--column "$(gettext "Value")" \
   9.130 +		--dclick-action="" \
   9.131 +		--button="$(gettext "Online bugs"):2" \
   9.132 +		--button="$(gettext "New bug"):3" \
   9.133 +		--button="$(gettext "New message"):4" \
   9.134 +		--button="gtk-close:1"
   9.135 +}
   9.136 +
   9.137 +# This is a function, usually the same name as the command if scripts
   9.138 +# have multiple commands and options.
   9.139 +account() {
   9.140 +	# Store box results
   9.141 +	main=$(account_main)
   9.142 +	ret=$?
   9.143 +	# Deal with --button values
   9.144 +	case $ret in
   9.145 +		1) exit 0 ;;
   9.146 +		2) browser $WEB_URL && exit 0 ;;
   9.147 +		3) $0 new-bug && exit 0 ;;
   9.148 +		4) $0 new-msg && exit 0 ;;
   9.149 +		*) continue ;;
   9.150 +	esac
   9.151 +}
   9.152 +
   9.153 +# Signup GUI box function with pure Yad spec
   9.154 +signup_main() {
   9.155 +	yad --form $opts --borders=4 \
   9.156 +		--title="Bugs Signup" \
   9.157 +		--text="<b>SliTaz Bugs Signup</b>" \
   9.158 +		--field="$(gettext "Real name")" \
   9.159 +		--field="$(gettext "Login name")" \
   9.160 +		--field="$(gettext "Email")" \
   9.161 +		--field="$(gettext "Password")":H \
   9.162 +		--button="gtk-ok:0" \
   9.163 +		--button="gtk-close:1"
   9.164 +}
   9.165 +
   9.166 +# Signup main function
   9.167 +signup() {
   9.168 +	# Store box results
   9.169 +	main=$(signup_main)
   9.170 +	ret=$?
   9.171 +	# Deal with --button values
   9.172 +	case $ret in
   9.173 +		1) exit 0 ;;
   9.174 +		2) browser http://bugs.slitaz.org/ && exit 0 ;;
   9.175 +		*) continue ;;
   9.176 +	esac
   9.177 +	name="$(echo $main | cut -d "|" -f 1)"
   9.178 +	user="$(echo $main | cut -d "|" -f 2)"
   9.179 +	mail="$(echo $main | cut -d "|" -f 3)"
   9.180 +	pass="$(echo $main | cut -d "|" -f 4)"
   9.181 +	tazbug signup --name="$name" --user=$user --mail=$mail \
   9.182 +		--pass="$pass" | output
   9.183 +}
   9.184 +
   9.185 +#
   9.186 +# Script commands
   9.187 +#
   9.188 +
   9.189 +case "$1" in
   9.190 +	usage|help)
   9.191 +		echo "Usage: $(basename $0) [new-msg|new-bug|account|signup]" ;;
   9.192 +	new-msg)
   9.193 +		new_msg ;;
   9.194 +	account)
   9.195 +		account ;;
   9.196 +	signup) 
   9.197 +		signup ;;
   9.198 +	*)
   9.199 +		if [ ! -f $HOME/.config/slitaz/account.conf ]; then
   9.200 +			signup
   9.201 +		fi
   9.202 +		new_bug ;;
   9.203 +esac
   9.204 +
   9.205 +exit 0
   9.206 +
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/old/tazbug-box.desktop	Sat Feb 11 00:21:42 2017 +0100
    10.3 @@ -0,0 +1,11 @@
    10.4 +[Desktop Entry]
    10.5 +Encoding=UTF-8
    10.6 +Name=SliTaz bug report
    10.7 +Name[fr]=Rapport de bug SliTaz
    10.8 +Name[pt]=Aviso de Bugs do SliTaz
    10.9 +Name[pt_BR]=Aviso de Bugs do SliTaz
   10.10 +Name[ru]=Баг-репорт SliTaz
   10.11 +Exec=tazbug-box
   10.12 +Icon=slitaz-icon
   10.13 +Type=Application
   10.14 +Categories=Application;Network;
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/old/tazbug.conf	Sat Feb 11 00:21:42 2017 +0100
    11.3 @@ -0,0 +1,14 @@
    11.4 +# SliTaz Bug Tracker tools configuration
    11.5 +#
    11.6 +
    11.7 +# TazBug URL to post bugs from cmdline and RSS
    11.8 +WEB_URL="http://bugs.slitaz.org/"
    11.9 +
   11.10 +# Auth file for user
   11.11 +AUTH_FILE="/var/lib/slitaz/auth/people"
   11.12 +
   11.13 +# People config files
   11.14 +PEOPLE="/var/lib/slitaz/people"
   11.15 +
   11.16 +# Online registration for user
   11.17 +ONLINE_SIGNUP="yes"
    12.1 --- a/tazbug	Sat Feb 11 00:00:17 2017 +0100
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,174 +0,0 @@
    12.4 -#!/bin/sh
    12.5 -#
    12.6 -# TazBug Command line tool. Help to encrypt password, key and post on the
    12.7 -# the server side.
    12.8 -#
    12.9 -# Copyright (C) 2012-2014 SliTaz GNU/Linux - BSD License
   12.10 -#
   12.11 -. /usr/lib/slitaz/httphelper
   12.12 -[ -f "/etc/slitaz/tazbug.conf" ] && . /etc/slitaz/tazbug.conf
   12.13 -[ -f "tazbug.conf" ] && . tazbug.conf
   12.14 -
   12.15 -# Use same key for SliTaz sites.
   12.16 -conf=$HOME/.config/slitaz/account.conf
   12.17 -
   12.18 -# Internationalization: $(gettext "")
   12.19 -. /usr/bin/gettext.sh
   12.20 -TEXTDOMAIN='tazbug'
   12.21 -export TEXTDOMAIN
   12.22 -
   12.23 -# Parse cmdline options.
   12.24 -for opt in "$@"
   12.25 -do
   12.26 -	case "$opt" in
   12.27 -		--bug=*)
   12.28 -			bug="${opt#--bug=}" ;;
   12.29 -		--desc=*)
   12.30 -			desc="${opt#--desc=}" ;;
   12.31 -		--msg=*)
   12.32 -			msg="${opt#--msg=}" ;;
   12.33 -		--priority=*)
   12.34 -			priority=${opt#--priority=} ;;
   12.35 -		--pkgs=*)
   12.36 -			pkgs="${opt#--pkgs=}" ;;
   12.37 -		--name=*)
   12.38 -			name="${opt#--name=}" ;;
   12.39 -		--user=*)
   12.40 -			user=${opt#--user=} ;;
   12.41 -		--mail=*)
   12.42 -			mail=${opt#--mail=} ;;
   12.43 -		--pass=*)
   12.44 -			pass=${opt#--pass=} ;;
   12.45 -	esac
   12.46 -done
   12.47 -
   12.48 -#
   12.49 -# Functions
   12.50 -#
   12.51 -
   12.52 -# --> in /usr/lib/slitaz/httphelper
   12.53 -# httpd -e dont work with GET URL requests
   12.54 -http_urlencode() {
   12.55 -	#space: + or %20
   12.56 -	sed -e 's/ /+/g; s/!/%21/g; s/"/%22/g; s/#/%23/g; s/%/%25/g; s/&/%26/g'
   12.57 -}
   12.58 -
   12.59 -# Usage.
   12.60 -usage() {
   12.61 -	cat << EOT
   12.62 -
   12.63 -$(gettext 'Usage:') $(basename $0) $(gettext '[command] [args]')
   12.64 -
   12.65 -$(gettext 'Commands:')
   12.66 -  gen-key     $(gettext "Recreate the SliTaz secure key.")
   12.67 -  gen-config  $(gettext "Create a new SliTaz account configuration.")
   12.68 -  signup      $(gettext "Create a new account on SliTaz Bugs.")
   12.69 -  new-msg     $(gettext "Send a new message to an open bug.")
   12.70 -  new-bug     $(gettext "Send a new bug report.")
   12.71 -
   12.72 -$(gettext 'Examples:')
   12.73 -  $(basename $0) signup --name="Real Name" --user=login \\
   12.74 -	--mail=mail@domain --pass=password
   12.75 -  $(basename $0) new-msg --bug=0 --msg="Message for bug with ID 0"
   12.76 -
   12.77 -EOT
   12.78 -}
   12.79 -
   12.80 -# Check cmdline user info args
   12.81 -check_info_args() {
   12.82 -	[ ! "$name" ] && gettext "Missing real name" && echo && exit 0
   12.83 -	[ ! "$user" ] && gettext "Missing login name" && echo && exit 0
   12.84 -	[ ! "$mail" ] && gettext "Missing email" && echo && exit 0
   12.85 -	[ ! "$pass" ] && gettext "Missing password" && echo && exit 0
   12.86 -}
   12.87 -
   12.88 -# Crypt pass when login
   12.89 -crypt_pass() {
   12.90 -	echo -n "$1" | md5sum | awk '{print $1}'
   12.91 -}
   12.92 -
   12.93 -# Gen a config file
   12.94 -gen_config() {
   12.95 -	gettext "Creating SliTaz account configuration..."; echo
   12.96 -	mkdir -p $HOME/.config/slitaz
   12.97 -	cat > $conf << EOT
   12.98 -# SliTaz account configuration
   12.99 -
  12.100 -NAME="$name"
  12.101 -USER="$user"
  12.102 -MAIL="$mail"
  12.103 -KEY=""
  12.104 -EOT
  12.105 -	chmod 0600 $conf
  12.106 -}
  12.107 -
  12.108 -# Gen the secure key: gen_key login mail passwd
  12.109 -gen_key() {
  12.110 -	gettext "Creating SliTaz secure key..."; echo
  12.111 -	key=$(echo -n "$user:$mail:$pass" | md5sum | awk '{print $1}')
  12.112 -	sed -i s"/KEY=.*/KEY=\"$key\"/" $conf
  12.113 -	chmod 0600 $conf
  12.114 -}
  12.115 -
  12.116 -#
  12.117 -# Commands
  12.118 -#
  12.119 -
  12.120 -case "$1" in
  12.121 -	gen-key)
  12.122 -		# MD5 key
  12.123 -		[ ! "$pass" ] && gettext "Missing password" && echo && exit 0
  12.124 -		. $conf || exit 1
  12.125 -		gen_key $USER $MAIL $pass ;;
  12.126 -	gen-config)
  12.127 -		# Recreate a config file if values have changed sites must be updated
  12.128 -		check_info_args
  12.129 -		gen_config
  12.130 -		gen_key ;;
  12.131 -	signup)
  12.132 -		# Create an account on the server
  12.133 -		check_info_args
  12.134 -		echo ""
  12.135 -		echo "Sending account request for: $name ($user)"
  12.136 -		# 'gen_key user:mail:passwd' locally but don't send it. It will be
  12.137 -		# generated on server from the user login, mail and encrypted password
  12.138 -		# so it is not transmited in GET urls.
  12.139 -		gen_config
  12.140 -		pass=$(crypt_pass $pass)
  12.141 -		name="$(echo $name | http_urlencode)"
  12.142 -		gen_key
  12.143 -		. $conf
  12.144 -		echo "Secure key: $KEY"
  12.145 -		# Wget GET url
  12.146 -		busybox wget "${WEB_URL}?signup=$user&name=$name&mail=$mail&pass=$pass" \
  12.147 -			-O /tmp/bug.msg
  12.148 -		cat /tmp/bug.msg && rm -f /tmp/bug.msg && echo "" ;;
  12.149 -	new-msg)
  12.150 -		# Post a new message: ID message
  12.151 -		. $conf || exit 1
  12.152 -		[ ! "$bug" ] && gettext "Missing bug ID" && echo && exit 0
  12.153 -		[ ! "$msg" ] && gettext "Missing message" && echo && exit 0
  12.154 -		msg="$(echo $msg | http_urlencode)"
  12.155 -		# Wget GET url
  12.156 -		busybox wget \
  12.157 -			"${WEB_URL}?key=$KEY&bug=$bug&msg=$msg" -O /tmp/bug.msg
  12.158 -		cat /tmp/bug.msg && rm -f /tmp/bug.msg && echo "" ;;
  12.159 -	new-bug)
  12.160 -		# Post a new bug: bug desc priority pkgs
  12.161 -		. $conf || exit 1
  12.162 -		[ ! "$bug" ] && gettext "Missing bug title" && echo && exit 0
  12.163 -		[ ! "$desc" ] && gettext "Missing description" && echo && exit 0
  12.164 -		[ ! "$priority" ] && gettext "Missing bug priority" && echo && exit 0
  12.165 -		bug="$(echo $bug | http_urlencode)"
  12.166 -		desc="$(echo $desc | http_urlencode)"
  12.167 -		releases="$(basename $(cat /var/lib/tazpkg/mirror))"
  12.168 -		# Wget GET url
  12.169 -		busybox wget \
  12.170 -			"${WEB_URL}?key=$KEY&bug=$bug&desc=$desc&priority=$priority&pkgs=$pkgs&releases=$releases" \
  12.171 -			-O /tmp/bug.msg
  12.172 -		cat /tmp/bug.msg && rm -f /tmp/bug.msg && echo "" ;;
  12.173 -	*)
  12.174 -		usage ;;
  12.175 -esac
  12.176 -
  12.177 -exit 0
    13.1 --- a/tazbug-box	Sat Feb 11 00:00:17 2017 +0100
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,203 +0,0 @@
    13.4 -#!/bin/sh
    13.5 -#
    13.6 -# SliTaz Bug GUI tool. All the account parts may move to slitaz-account
    13.7 -# if we use it for other sites and services so we use one centralized
    13.8 -# SliTaz account.
    13.9 -#
   13.10 -# Copyright (C) 2012-2014 SliTaz GNU/Linux - BSD License
   13.11 -#
   13.12 -# Authors : Christophe Lincoln <pankso@slitaz.org>
   13.13 -#
   13.14 -[ -f "/etc/slitaz/tazbug.conf" ] && . /etc/slitaz/tazbug.conf
   13.15 -[ -f "tazbug.conf" ] && . tazbug.conf
   13.16 -
   13.17 -opts="--window-icon=/usr/share/pixmaps/slitaz-icon.png --center \
   13.18 ---image=slitaz-icon --image-on-top --width=480 --height=340"
   13.19 -
   13.20 -# Internationalization: $(gettext "")
   13.21 -. /usr/bin/gettext.sh
   13.22 -TEXTDOMAIN='tazbug'
   13.23 -export TEXTDOMAIN
   13.24 -
   13.25 -#
   13.26 -# Functions
   13.27 -#
   13.28 -
   13.29 -# Output cmd in GTK box.
   13.30 -output() {
   13.31 -	yad $opts --text-info --text="<b>SliTaz Bug</b>" --title="SliTaz Bug" \
   13.32 -		--margins=8 --tail --button="$(gettext "My account"):0" \
   13.33 -		--button="gtk-close":1
   13.34 -	case $? in
   13.35 -		0) $0 account ;;
   13.36 -		1) exit 0 ;;
   13.37 -	esac
   13.38 -}
   13.39 -
   13.40 -# New message box
   13.41 -new_msg_main() {
   13.42 -	yad --form $opts \
   13.43 -		--title="Bug message" \
   13.44 -		--text="<b>SliTaz Bugs Message</b>" \
   13.45 -		--field="$(gettext "Bug ID")":NUM \
   13.46 -		--field="$(gettext "Message")":TXT \
   13.47 -		--button="$(gettext "New bug"):2" \
   13.48 -		--button="$(gettext "Send message"):0" \
   13.49 -		--button="gtk-close:1"
   13.50 -}
   13.51 -
   13.52 -# New message main function
   13.53 -new_msg() {
   13.54 -	# Store box results
   13.55 -	main=$(new_msg_main)
   13.56 -	ret=$?
   13.57 -	# Deal with --button values
   13.58 -	case $ret in
   13.59 -		1) exit 0 ;;
   13.60 -		2) $0 new-bug && exit 0 ;;
   13.61 -		*) continue ;;
   13.62 -	esac
   13.63 -	id="$(echo $main | cut -d "|" -f 1 | cut -d "," -f 1)"
   13.64 -	msg="$(echo $main | cut -d "|" -f 2)"
   13.65 -	if [ "$msg" ]; then
   13.66 -		tazbug new-msg --bug=$id --msg="$msg" | output
   13.67 -	fi
   13.68 -}
   13.69 -
   13.70 -# New bug box
   13.71 -new_bug_main() {
   13.72 -	yad --form $opts \
   13.73 -		--title="Bug report" \
   13.74 -		--text="<b>SliTaz Bug Report</b>" \
   13.75 -		--field="$(gettext "Bug title")" \
   13.76 -		--field="$(gettext "Priority")":CB \
   13.77 -		--field="$(gettext "Packages")" \
   13.78 -		--field="$(gettext "Description")":TXT \
   13.79 -		--button="$(gettext "My account"):3" \
   13.80 -		--button="$(gettext "New message"):2" \
   13.81 -		--button="$(gettext "Send bug"):0" \
   13.82 -		--button="gtk-close:1" \
   13.83 -		"" "standard!critical" "" ""
   13.84 -}
   13.85 -
   13.86 -# New bug main function
   13.87 -new_bug() {
   13.88 -	# Store box results
   13.89 -	main=$(new_bug_main)
   13.90 -	ret=$?
   13.91 -	# Deal with --button values
   13.92 -	case $ret in
   13.93 -		1) exit 0 ;;
   13.94 -		2) $0 new-msg && exit 0 ;;
   13.95 -		3) $0 account && exit 0 ;;
   13.96 -		*) continue ;;
   13.97 -	esac
   13.98 -	bug="$(echo $main | cut -d "|" -f 1)"
   13.99 -	desc="$(echo $main | cut -d "|" -f 4)"
  13.100 -	priority="$(echo $main | cut -d "|" -f 2)"
  13.101 -	pkgs="$(echo $main | cut -d "|" -f 3)"
  13.102 -	if [ "$bug" ] && [ "$desc" ]; then
  13.103 -		tazbug new-bug --bug="$bug" --desc="$desc" --priority=$priority \
  13.104 -			--pkgs="$pkgs" | output
  13.105 -	fi
  13.106 -}
  13.107 -
  13.108 -# Account information.
  13.109 -account_info() {
  13.110 -	. $HOME/.config/slitaz/account.conf
  13.111 -	cat << EOT
  13.112 -$(gettext "Real name")
  13.113 -$NAME
  13.114 -$(gettext "User name")
  13.115 -$USER
  13.116 -Email
  13.117 -$MAIL
  13.118 -$(gettext "Secure key")
  13.119 -$KEY
  13.120 -EOT
  13.121 -}
  13.122 -
  13.123 -# Main GUI box function with pure Yad spec
  13.124 -account_main() {
  13.125 -	account_info | yad --list $opts \
  13.126 -		--title="Bugs account" \
  13.127 -		--text="<b>SliTaz Bugs Account</b>" \
  13.128 -		--column "$(gettext "Account")" \
  13.129 -		--column "$(gettext "Value")" \
  13.130 -		--dclick-action="" \
  13.131 -		--button="$(gettext "Online bugs"):2" \
  13.132 -		--button="$(gettext "New bug"):3" \
  13.133 -		--button="$(gettext "New message"):4" \
  13.134 -		--button="gtk-close:1"
  13.135 -}
  13.136 -
  13.137 -# This is a function, usually the same name as the command if scripts
  13.138 -# have multiple commands and options.
  13.139 -account() {
  13.140 -	# Store box results
  13.141 -	main=$(account_main)
  13.142 -	ret=$?
  13.143 -	# Deal with --button values
  13.144 -	case $ret in
  13.145 -		1) exit 0 ;;
  13.146 -		2) browser $WEB_URL && exit 0 ;;
  13.147 -		3) $0 new-bug && exit 0 ;;
  13.148 -		4) $0 new-msg && exit 0 ;;
  13.149 -		*) continue ;;
  13.150 -	esac
  13.151 -}
  13.152 -
  13.153 -# Signup GUI box function with pure Yad spec
  13.154 -signup_main() {
  13.155 -	yad --form $opts --borders=4 \
  13.156 -		--title="Bugs Signup" \
  13.157 -		--text="<b>SliTaz Bugs Signup</b>" \
  13.158 -		--field="$(gettext "Real name")" \
  13.159 -		--field="$(gettext "Login name")" \
  13.160 -		--field="$(gettext "Email")" \
  13.161 -		--field="$(gettext "Password")":H \
  13.162 -		--button="gtk-ok:0" \
  13.163 -		--button="gtk-close:1"
  13.164 -}
  13.165 -
  13.166 -# Signup main function
  13.167 -signup() {
  13.168 -	# Store box results
  13.169 -	main=$(signup_main)
  13.170 -	ret=$?
  13.171 -	# Deal with --button values
  13.172 -	case $ret in
  13.173 -		1) exit 0 ;;
  13.174 -		2) browser http://bugs.slitaz.org/ && exit 0 ;;
  13.175 -		*) continue ;;
  13.176 -	esac
  13.177 -	name="$(echo $main | cut -d "|" -f 1)"
  13.178 -	user="$(echo $main | cut -d "|" -f 2)"
  13.179 -	mail="$(echo $main | cut -d "|" -f 3)"
  13.180 -	pass="$(echo $main | cut -d "|" -f 4)"
  13.181 -	tazbug signup --name="$name" --user=$user --mail=$mail \
  13.182 -		--pass="$pass" | output
  13.183 -}
  13.184 -
  13.185 -#
  13.186 -# Script commands
  13.187 -#
  13.188 -
  13.189 -case "$1" in
  13.190 -	usage|help)
  13.191 -		echo "Usage: $(basename $0) [new-msg|new-bug|account|signup]" ;;
  13.192 -	new-msg)
  13.193 -		new_msg ;;
  13.194 -	account)
  13.195 -		account ;;
  13.196 -	signup) 
  13.197 -		signup ;;
  13.198 -	*)
  13.199 -		if [ ! -f $HOME/.config/slitaz/account.conf ]; then
  13.200 -			signup
  13.201 -		fi
  13.202 -		new_bug ;;
  13.203 -esac
  13.204 -
  13.205 -exit 0
  13.206 -
    14.1 --- a/tazbug.conf	Sat Feb 11 00:00:17 2017 +0100
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,14 +0,0 @@
    14.4 -# SliTaz Bug Tracker tools configuration
    14.5 -#
    14.6 -
    14.7 -# TazBug URL to post bugs from cmdline and RSS
    14.8 -WEB_URL="http://bugs.slitaz.org/"
    14.9 -
   14.10 -# Auth file for user
   14.11 -AUTH_FILE="/var/lib/slitaz/auth/people"
   14.12 -
   14.13 -# People config files
   14.14 -PEOPLE="/var/lib/slitaz/people"
   14.15 -
   14.16 -# Online registration for user
   14.17 -ONLINE_SIGNUP="yes"
    15.1 --- a/web/bugs.cgi	Sat Feb 11 00:00:17 2017 +0100
    15.2 +++ b/web/bugs.cgi	Sat Feb 11 00:21:42 2017 +0100
    15.3 @@ -7,9 +7,7 @@
    15.4  . /usr/lib/slitaz/httphelper
    15.5  
    15.6  # Source config file
    15.7 -[ -f "/etc/slitaz/tazbug.conf" ] && . /etc/slitaz/tazbug.conf
    15.8 -# Web interface can have different setting than cmdline tools
    15.9 -[ -f "/etc/slitaz/bugs.conf" ] && . /etc/slitaz/bugs.conf
   15.10 +. ./config.cgi
   15.11  
   15.12  # Internal variable
   15.13  bugdir="$PWD/bug"
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/web/config.cgi	Sat Feb 11 00:21:42 2017 +0100
    16.3 @@ -0,0 +1,14 @@
    16.4 +# SliTaz Bug Tracker Web interface configuration.
    16.5 +#
    16.6 +
    16.7 +# TazBug URL for redirection and RSS
    16.8 +WEB_URL="http://localhost/bugs/bugs.cgi"
    16.9 +
   16.10 +# Auth file for user
   16.11 +AUTH_FILE="/var/lib/slitaz/auth/people"
   16.12 +
   16.13 +# People config files
   16.14 +PEOPLE="/var/lib/slitaz/people"
   16.15 +
   16.16 +# Online registration for user
   16.17 +ONLINE_SIGNUP="yes"