# HG changeset patch # User Christophe Lincoln # Date 1486768902 -3600 # Node ID d24cd6951458ceea34498e0e52c4fab505f90e0e # Parent c9939a4ea74c1a25a512c42a8c94ed87dac1617f Box is not longer maintained as weel as cmdline bug posts (+ is insecure) diff -r c9939a4ea74c -r d24cd6951458 Makefile --- a/Makefile Sat Feb 11 00:00:17 2017 +0100 +++ b/Makefile Sat Feb 11 00:21:42 2017 +0100 @@ -14,7 +14,8 @@ pot: xgettext -o po/tazbug.pot -L Shell --package-name="SliTaz Bugs" \ - ./tazbug ./tazbug-box ./web/bugs.cgi + ./web/bugs.cgi + #./tazbug msgmerge: @for l in $(LINGUAS); do \ @@ -32,12 +33,9 @@ # Client install only. Server part is not packaged install: - install -m 0777 -d $(DESTDIR)/etc/slitaz - install -m 0777 -d $(DESTDIR)$(PREFIX)/bin + #install -m 0777 -d $(DESTDIR)$(PREFIX)/bin install -m 0777 -d $(DESTDIR)$(PREFIX)/share/applications - install -m 0755 tazbug $(DESTDIR)$(PREFIX)/bin - install -m 0755 tazbug-box $(DESTDIR)$(PREFIX)/bin - install -m 0644 tazbug.conf $(DESTDIR)/etc/slitaz + #install -m 0755 tazbug $(DESTDIR)$(PREFIX)/bin install -m 0644 data/tazbug.desktop \ $(DESTDIR)$(PREFIX)/share/applications diff -r c9939a4ea74c -r d24cd6951458 README --- a/README Sat Feb 11 00:00:17 2017 +0100 +++ b/README Sat Feb 11 00:21:42 2017 +0100 @@ -8,8 +8,7 @@ Roadmap and other sites such as the wiki and forum. Users data are securely stored outside of the web server document root. Passwords -are encrypted with MD5 and also stored outside of the document root. Your ID key -is the MD5 sum of your login, mail and password. +are encrypted with MD5 and also stored outside of the document root. TazBug is simple to use, 2 types of status exist: OPEN and CLOSED and 2 priority levels are handled. Affected packages names can be added to the bug and all @@ -20,19 +19,13 @@ ------------ * Simple to use with a clean and modern interface - * Client side cmdline tool to post bugs and messages - * Full desktop integration with GTK boxes or local CGI script * Use http://paste.slitaz.org/ for attaching files * Use shared accounts with other sites to have only one login Accounts -------- -To create an account on SliTaz Bugs you must use the graphical box from -your SliTaz system found in the menu "Network" --> "SliTaz bug report" -You can also use the command line tool tazbug with the signup command: - -$ tazbug signup --name="Real Name" --user=login --mail=mail@domain --pass=pass +To create an account on SliTaz Bugs you can use the web interface Installation diff -r c9939a4ea74c -r d24cd6951458 TODO --- a/TODO Sat Feb 11 00:00:17 2017 +0100 +++ b/TODO Sat Feb 11 00:21:42 2017 +0100 @@ -1,6 +1,5 @@ * Log bug activity in $bugdir/$id/bug.log - * Help Box with button on tazbug-box new-bug * Hg integration by checking in commits if a bug was solved and then close it: hg commit -m "My msg [CLOSE=4]" Or full Hg integration ? Meaning the tracker itself under Hg and diff -r c9939a4ea74c -r d24cd6951458 bugs.conf --- a/bugs.conf Sat Feb 11 00:00:17 2017 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -# SliTaz Bug Tracker Web interface configuration. This config file will -# overwrite: /etc/slitaz/tazbug.conf -# - -# TazBug URL for redirection and RSS -WEB_URL="http://localhost/bugs/bugs.cgi" - -# Auth file for user -AUTH_FILE="/var/lib/slitaz/auth/people" - -# People config files -PEOPLE="/var/lib/slitaz/people" - -# Online registration for user -ONLINE_SIGNUP="yes" diff -r c9939a4ea74c -r d24cd6951458 convert-desc.sh --- a/convert-desc.sh Sat Feb 11 00:00:17 2017 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -#!/bin/sh -# -# Extract bug description from a bug.conf file to create a desc.txt file -# -. /lib/libtaz.sh -check_root -path="$1" - -if [ ! "${path}" ]; then - echo "Usage: $0 path/to/bug" && exit 0 -fi - -cd ${path} - -for bug in * -do - . ./${bug}/bug.conf - echo -n "Converting bug: ${bug} " - echo "${DESC}" > ${bug}/desc.txt - # Clean bug.conf - cat > ${bug}/bug.conf << EOT -# SliTaz Bug configuration - -BUG="$BUG" -STATUS="$STATUS" -PRIORITY="$PRIORITY" -CREATOR="$CREATOR" -DATE="$DATE" -PKGS="$PKGS" -EOT - unset DESC BUG STATUS PRIORITY CREATOR DATE PKGS - chown www.www ${bug}/* - status -done - -exit 0 diff -r c9939a4ea74c -r d24cd6951458 data/tazbug.desktop --- a/data/tazbug.desktop Sat Feb 11 00:00:17 2017 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=SliTaz bug report -Name[fr]=Rapport de bug SliTaz -Name[pt]=Aviso de Bugs do SliTaz -Name[pt_BR]=Aviso de Bugs do SliTaz -Name[ru]=Баг-репорт SliTaz -Exec=tazbug-box -Icon=slitaz-icon -Type=Application -Categories=Application;Network; diff -r c9939a4ea74c -r d24cd6951458 old/convert-desc.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/old/convert-desc.sh Sat Feb 11 00:21:42 2017 +0100 @@ -0,0 +1,36 @@ +#!/bin/sh +# +# Extract bug description from a bug.conf file to create a desc.txt file +# +. /lib/libtaz.sh +check_root +path="$1" + +if [ ! "${path}" ]; then + echo "Usage: $0 path/to/bug" && exit 0 +fi + +cd ${path} + +for bug in * +do + . ./${bug}/bug.conf + echo -n "Converting bug: ${bug} " + echo "${DESC}" > ${bug}/desc.txt + # Clean bug.conf + cat > ${bug}/bug.conf << EOT +# SliTaz Bug configuration + +BUG="$BUG" +STATUS="$STATUS" +PRIORITY="$PRIORITY" +CREATOR="$CREATOR" +DATE="$DATE" +PKGS="$PKGS" +EOT + unset DESC BUG STATUS PRIORITY CREATOR DATE PKGS + chown www.www ${bug}/* + status +done + +exit 0 diff -r c9939a4ea74c -r d24cd6951458 old/tazbug --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/old/tazbug Sat Feb 11 00:21:42 2017 +0100 @@ -0,0 +1,174 @@ +#!/bin/sh +# +# TazBug Command line tool. Help to encrypt password, key and post on the +# the server side. +# +# Copyright (C) 2012-2014 SliTaz GNU/Linux - BSD License +# +. /usr/lib/slitaz/httphelper +[ -f "/etc/slitaz/tazbug.conf" ] && . /etc/slitaz/tazbug.conf +[ -f "tazbug.conf" ] && . tazbug.conf + +# Use same key for SliTaz sites. +conf=$HOME/.config/slitaz/account.conf + +# Internationalization: $(gettext "") +. /usr/bin/gettext.sh +TEXTDOMAIN='tazbug' +export TEXTDOMAIN + +# Parse cmdline options. +for opt in "$@" +do + case "$opt" in + --bug=*) + bug="${opt#--bug=}" ;; + --desc=*) + desc="${opt#--desc=}" ;; + --msg=*) + msg="${opt#--msg=}" ;; + --priority=*) + priority=${opt#--priority=} ;; + --pkgs=*) + pkgs="${opt#--pkgs=}" ;; + --name=*) + name="${opt#--name=}" ;; + --user=*) + user=${opt#--user=} ;; + --mail=*) + mail=${opt#--mail=} ;; + --pass=*) + pass=${opt#--pass=} ;; + esac +done + +# +# Functions +# + +# --> in /usr/lib/slitaz/httphelper +# httpd -e dont work with GET URL requests +http_urlencode() { + #space: + or %20 + sed -e 's/ /+/g; s/!/%21/g; s/"/%22/g; s/#/%23/g; s/%/%25/g; s/&/%26/g' +} + +# Usage. +usage() { + cat << EOT + +$(gettext 'Usage:') $(basename $0) $(gettext '[command] [args]') + +$(gettext 'Commands:') + gen-key $(gettext "Recreate the SliTaz secure key.") + gen-config $(gettext "Create a new SliTaz account configuration.") + signup $(gettext "Create a new account on SliTaz Bugs.") + new-msg $(gettext "Send a new message to an open bug.") + new-bug $(gettext "Send a new bug report.") + +$(gettext 'Examples:') + $(basename $0) signup --name="Real Name" --user=login \\ + --mail=mail@domain --pass=password + $(basename $0) new-msg --bug=0 --msg="Message for bug with ID 0" + +EOT +} + +# Check cmdline user info args +check_info_args() { + [ ! "$name" ] && gettext "Missing real name" && echo && exit 0 + [ ! "$user" ] && gettext "Missing login name" && echo && exit 0 + [ ! "$mail" ] && gettext "Missing email" && echo && exit 0 + [ ! "$pass" ] && gettext "Missing password" && echo && exit 0 +} + +# Crypt pass when login +crypt_pass() { + echo -n "$1" | md5sum | awk '{print $1}' +} + +# Gen a config file +gen_config() { + gettext "Creating SliTaz account configuration..."; echo + mkdir -p $HOME/.config/slitaz + cat > $conf << EOT +# SliTaz account configuration + +NAME="$name" +USER="$user" +MAIL="$mail" +KEY="" +EOT + chmod 0600 $conf +} + +# Gen the secure key: gen_key login mail passwd +gen_key() { + gettext "Creating SliTaz secure key..."; echo + key=$(echo -n "$user:$mail:$pass" | md5sum | awk '{print $1}') + sed -i s"/KEY=.*/KEY=\"$key\"/" $conf + chmod 0600 $conf +} + +# +# Commands +# + +case "$1" in + gen-key) + # MD5 key + [ ! "$pass" ] && gettext "Missing password" && echo && exit 0 + . $conf || exit 1 + gen_key $USER $MAIL $pass ;; + gen-config) + # Recreate a config file if values have changed sites must be updated + check_info_args + gen_config + gen_key ;; + signup) + # Create an account on the server + check_info_args + echo "" + echo "Sending account request for: $name ($user)" + # 'gen_key user:mail:passwd' locally but don't send it. It will be + # generated on server from the user login, mail and encrypted password + # so it is not transmited in GET urls. + gen_config + pass=$(crypt_pass $pass) + name="$(echo $name | http_urlencode)" + gen_key + . $conf + echo "Secure key: $KEY" + # Wget GET url + busybox wget "${WEB_URL}?signup=$user&name=$name&mail=$mail&pass=$pass" \ + -O /tmp/bug.msg + cat /tmp/bug.msg && rm -f /tmp/bug.msg && echo "" ;; + new-msg) + # Post a new message: ID message + . $conf || exit 1 + [ ! "$bug" ] && gettext "Missing bug ID" && echo && exit 0 + [ ! "$msg" ] && gettext "Missing message" && echo && exit 0 + msg="$(echo $msg | http_urlencode)" + # Wget GET url + busybox wget \ + "${WEB_URL}?key=$KEY&bug=$bug&msg=$msg" -O /tmp/bug.msg + cat /tmp/bug.msg && rm -f /tmp/bug.msg && echo "" ;; + new-bug) + # Post a new bug: bug desc priority pkgs + . $conf || exit 1 + [ ! "$bug" ] && gettext "Missing bug title" && echo && exit 0 + [ ! "$desc" ] && gettext "Missing description" && echo && exit 0 + [ ! "$priority" ] && gettext "Missing bug priority" && echo && exit 0 + bug="$(echo $bug | http_urlencode)" + desc="$(echo $desc | http_urlencode)" + releases="$(basename $(cat /var/lib/tazpkg/mirror))" + # Wget GET url + busybox wget \ + "${WEB_URL}?key=$KEY&bug=$bug&desc=$desc&priority=$priority&pkgs=$pkgs&releases=$releases" \ + -O /tmp/bug.msg + cat /tmp/bug.msg && rm -f /tmp/bug.msg && echo "" ;; + *) + usage ;; +esac + +exit 0 diff -r c9939a4ea74c -r d24cd6951458 old/tazbug-box --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/old/tazbug-box Sat Feb 11 00:21:42 2017 +0100 @@ -0,0 +1,203 @@ +#!/bin/sh +# +# SliTaz Bug GUI tool. All the account parts may move to slitaz-account +# if we use it for other sites and services so we use one centralized +# SliTaz account. +# +# Copyright (C) 2012-2014 SliTaz GNU/Linux - BSD License +# +# Authors : Christophe Lincoln +# +[ -f "/etc/slitaz/tazbug.conf" ] && . /etc/slitaz/tazbug.conf +[ -f "tazbug.conf" ] && . tazbug.conf + +opts="--window-icon=/usr/share/pixmaps/slitaz-icon.png --center \ +--image=slitaz-icon --image-on-top --width=480 --height=340" + +# Internationalization: $(gettext "") +. /usr/bin/gettext.sh +TEXTDOMAIN='tazbug' +export TEXTDOMAIN + +# +# Functions +# + +# Output cmd in GTK box. +output() { + yad $opts --text-info --text="SliTaz Bug" --title="SliTaz Bug" \ + --margins=8 --tail --button="$(gettext "My account"):0" \ + --button="gtk-close":1 + case $? in + 0) $0 account ;; + 1) exit 0 ;; + esac +} + +# New message box +new_msg_main() { + yad --form $opts \ + --title="Bug message" \ + --text="SliTaz Bugs Message" \ + --field="$(gettext "Bug ID")":NUM \ + --field="$(gettext "Message")":TXT \ + --button="$(gettext "New bug"):2" \ + --button="$(gettext "Send message"):0" \ + --button="gtk-close:1" +} + +# New message main function +new_msg() { + # Store box results + main=$(new_msg_main) + ret=$? + # Deal with --button values + case $ret in + 1) exit 0 ;; + 2) $0 new-bug && exit 0 ;; + *) continue ;; + esac + id="$(echo $main | cut -d "|" -f 1 | cut -d "," -f 1)" + msg="$(echo $main | cut -d "|" -f 2)" + if [ "$msg" ]; then + tazbug new-msg --bug=$id --msg="$msg" | output + fi +} + +# New bug box +new_bug_main() { + yad --form $opts \ + --title="Bug report" \ + --text="SliTaz Bug Report" \ + --field="$(gettext "Bug title")" \ + --field="$(gettext "Priority")":CB \ + --field="$(gettext "Packages")" \ + --field="$(gettext "Description")":TXT \ + --button="$(gettext "My account"):3" \ + --button="$(gettext "New message"):2" \ + --button="$(gettext "Send bug"):0" \ + --button="gtk-close:1" \ + "" "standard!critical" "" "" +} + +# New bug main function +new_bug() { + # Store box results + main=$(new_bug_main) + ret=$? + # Deal with --button values + case $ret in + 1) exit 0 ;; + 2) $0 new-msg && exit 0 ;; + 3) $0 account && exit 0 ;; + *) continue ;; + esac + bug="$(echo $main | cut -d "|" -f 1)" + desc="$(echo $main | cut -d "|" -f 4)" + priority="$(echo $main | cut -d "|" -f 2)" + pkgs="$(echo $main | cut -d "|" -f 3)" + if [ "$bug" ] && [ "$desc" ]; then + tazbug new-bug --bug="$bug" --desc="$desc" --priority=$priority \ + --pkgs="$pkgs" | output + fi +} + +# Account information. +account_info() { + . $HOME/.config/slitaz/account.conf + cat << EOT +$(gettext "Real name") +$NAME +$(gettext "User name") +$USER +Email +$MAIL +$(gettext "Secure key") +$KEY +EOT +} + +# Main GUI box function with pure Yad spec +account_main() { + account_info | yad --list $opts \ + --title="Bugs account" \ + --text="SliTaz Bugs Account" \ + --column "$(gettext "Account")" \ + --column "$(gettext "Value")" \ + --dclick-action="" \ + --button="$(gettext "Online bugs"):2" \ + --button="$(gettext "New bug"):3" \ + --button="$(gettext "New message"):4" \ + --button="gtk-close:1" +} + +# This is a function, usually the same name as the command if scripts +# have multiple commands and options. +account() { + # Store box results + main=$(account_main) + ret=$? + # Deal with --button values + case $ret in + 1) exit 0 ;; + 2) browser $WEB_URL && exit 0 ;; + 3) $0 new-bug && exit 0 ;; + 4) $0 new-msg && exit 0 ;; + *) continue ;; + esac +} + +# Signup GUI box function with pure Yad spec +signup_main() { + yad --form $opts --borders=4 \ + --title="Bugs Signup" \ + --text="SliTaz Bugs Signup" \ + --field="$(gettext "Real name")" \ + --field="$(gettext "Login name")" \ + --field="$(gettext "Email")" \ + --field="$(gettext "Password")":H \ + --button="gtk-ok:0" \ + --button="gtk-close:1" +} + +# Signup main function +signup() { + # Store box results + main=$(signup_main) + ret=$? + # Deal with --button values + case $ret in + 1) exit 0 ;; + 2) browser http://bugs.slitaz.org/ && exit 0 ;; + *) continue ;; + esac + name="$(echo $main | cut -d "|" -f 1)" + user="$(echo $main | cut -d "|" -f 2)" + mail="$(echo $main | cut -d "|" -f 3)" + pass="$(echo $main | cut -d "|" -f 4)" + tazbug signup --name="$name" --user=$user --mail=$mail \ + --pass="$pass" | output +} + +# +# Script commands +# + +case "$1" in + usage|help) + echo "Usage: $(basename $0) [new-msg|new-bug|account|signup]" ;; + new-msg) + new_msg ;; + account) + account ;; + signup) + signup ;; + *) + if [ ! -f $HOME/.config/slitaz/account.conf ]; then + signup + fi + new_bug ;; +esac + +exit 0 + diff -r c9939a4ea74c -r d24cd6951458 old/tazbug-box.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/old/tazbug-box.desktop Sat Feb 11 00:21:42 2017 +0100 @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=SliTaz bug report +Name[fr]=Rapport de bug SliTaz +Name[pt]=Aviso de Bugs do SliTaz +Name[pt_BR]=Aviso de Bugs do SliTaz +Name[ru]=Баг-репорт SliTaz +Exec=tazbug-box +Icon=slitaz-icon +Type=Application +Categories=Application;Network; diff -r c9939a4ea74c -r d24cd6951458 old/tazbug.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/old/tazbug.conf Sat Feb 11 00:21:42 2017 +0100 @@ -0,0 +1,14 @@ +# SliTaz Bug Tracker tools configuration +# + +# TazBug URL to post bugs from cmdline and RSS +WEB_URL="http://bugs.slitaz.org/" + +# Auth file for user +AUTH_FILE="/var/lib/slitaz/auth/people" + +# People config files +PEOPLE="/var/lib/slitaz/people" + +# Online registration for user +ONLINE_SIGNUP="yes" diff -r c9939a4ea74c -r d24cd6951458 tazbug --- a/tazbug Sat Feb 11 00:00:17 2017 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +0,0 @@ -#!/bin/sh -# -# TazBug Command line tool. Help to encrypt password, key and post on the -# the server side. -# -# Copyright (C) 2012-2014 SliTaz GNU/Linux - BSD License -# -. /usr/lib/slitaz/httphelper -[ -f "/etc/slitaz/tazbug.conf" ] && . /etc/slitaz/tazbug.conf -[ -f "tazbug.conf" ] && . tazbug.conf - -# Use same key for SliTaz sites. -conf=$HOME/.config/slitaz/account.conf - -# Internationalization: $(gettext "") -. /usr/bin/gettext.sh -TEXTDOMAIN='tazbug' -export TEXTDOMAIN - -# Parse cmdline options. -for opt in "$@" -do - case "$opt" in - --bug=*) - bug="${opt#--bug=}" ;; - --desc=*) - desc="${opt#--desc=}" ;; - --msg=*) - msg="${opt#--msg=}" ;; - --priority=*) - priority=${opt#--priority=} ;; - --pkgs=*) - pkgs="${opt#--pkgs=}" ;; - --name=*) - name="${opt#--name=}" ;; - --user=*) - user=${opt#--user=} ;; - --mail=*) - mail=${opt#--mail=} ;; - --pass=*) - pass=${opt#--pass=} ;; - esac -done - -# -# Functions -# - -# --> in /usr/lib/slitaz/httphelper -# httpd -e dont work with GET URL requests -http_urlencode() { - #space: + or %20 - sed -e 's/ /+/g; s/!/%21/g; s/"/%22/g; s/#/%23/g; s/%/%25/g; s/&/%26/g' -} - -# Usage. -usage() { - cat << EOT - -$(gettext 'Usage:') $(basename $0) $(gettext '[command] [args]') - -$(gettext 'Commands:') - gen-key $(gettext "Recreate the SliTaz secure key.") - gen-config $(gettext "Create a new SliTaz account configuration.") - signup $(gettext "Create a new account on SliTaz Bugs.") - new-msg $(gettext "Send a new message to an open bug.") - new-bug $(gettext "Send a new bug report.") - -$(gettext 'Examples:') - $(basename $0) signup --name="Real Name" --user=login \\ - --mail=mail@domain --pass=password - $(basename $0) new-msg --bug=0 --msg="Message for bug with ID 0" - -EOT -} - -# Check cmdline user info args -check_info_args() { - [ ! "$name" ] && gettext "Missing real name" && echo && exit 0 - [ ! "$user" ] && gettext "Missing login name" && echo && exit 0 - [ ! "$mail" ] && gettext "Missing email" && echo && exit 0 - [ ! "$pass" ] && gettext "Missing password" && echo && exit 0 -} - -# Crypt pass when login -crypt_pass() { - echo -n "$1" | md5sum | awk '{print $1}' -} - -# Gen a config file -gen_config() { - gettext "Creating SliTaz account configuration..."; echo - mkdir -p $HOME/.config/slitaz - cat > $conf << EOT -# SliTaz account configuration - -NAME="$name" -USER="$user" -MAIL="$mail" -KEY="" -EOT - chmod 0600 $conf -} - -# Gen the secure key: gen_key login mail passwd -gen_key() { - gettext "Creating SliTaz secure key..."; echo - key=$(echo -n "$user:$mail:$pass" | md5sum | awk '{print $1}') - sed -i s"/KEY=.*/KEY=\"$key\"/" $conf - chmod 0600 $conf -} - -# -# Commands -# - -case "$1" in - gen-key) - # MD5 key - [ ! "$pass" ] && gettext "Missing password" && echo && exit 0 - . $conf || exit 1 - gen_key $USER $MAIL $pass ;; - gen-config) - # Recreate a config file if values have changed sites must be updated - check_info_args - gen_config - gen_key ;; - signup) - # Create an account on the server - check_info_args - echo "" - echo "Sending account request for: $name ($user)" - # 'gen_key user:mail:passwd' locally but don't send it. It will be - # generated on server from the user login, mail and encrypted password - # so it is not transmited in GET urls. - gen_config - pass=$(crypt_pass $pass) - name="$(echo $name | http_urlencode)" - gen_key - . $conf - echo "Secure key: $KEY" - # Wget GET url - busybox wget "${WEB_URL}?signup=$user&name=$name&mail=$mail&pass=$pass" \ - -O /tmp/bug.msg - cat /tmp/bug.msg && rm -f /tmp/bug.msg && echo "" ;; - new-msg) - # Post a new message: ID message - . $conf || exit 1 - [ ! "$bug" ] && gettext "Missing bug ID" && echo && exit 0 - [ ! "$msg" ] && gettext "Missing message" && echo && exit 0 - msg="$(echo $msg | http_urlencode)" - # Wget GET url - busybox wget \ - "${WEB_URL}?key=$KEY&bug=$bug&msg=$msg" -O /tmp/bug.msg - cat /tmp/bug.msg && rm -f /tmp/bug.msg && echo "" ;; - new-bug) - # Post a new bug: bug desc priority pkgs - . $conf || exit 1 - [ ! "$bug" ] && gettext "Missing bug title" && echo && exit 0 - [ ! "$desc" ] && gettext "Missing description" && echo && exit 0 - [ ! "$priority" ] && gettext "Missing bug priority" && echo && exit 0 - bug="$(echo $bug | http_urlencode)" - desc="$(echo $desc | http_urlencode)" - releases="$(basename $(cat /var/lib/tazpkg/mirror))" - # Wget GET url - busybox wget \ - "${WEB_URL}?key=$KEY&bug=$bug&desc=$desc&priority=$priority&pkgs=$pkgs&releases=$releases" \ - -O /tmp/bug.msg - cat /tmp/bug.msg && rm -f /tmp/bug.msg && echo "" ;; - *) - usage ;; -esac - -exit 0 diff -r c9939a4ea74c -r d24cd6951458 tazbug-box --- a/tazbug-box Sat Feb 11 00:00:17 2017 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,203 +0,0 @@ -#!/bin/sh -# -# SliTaz Bug GUI tool. All the account parts may move to slitaz-account -# if we use it for other sites and services so we use one centralized -# SliTaz account. -# -# Copyright (C) 2012-2014 SliTaz GNU/Linux - BSD License -# -# Authors : Christophe Lincoln -# -[ -f "/etc/slitaz/tazbug.conf" ] && . /etc/slitaz/tazbug.conf -[ -f "tazbug.conf" ] && . tazbug.conf - -opts="--window-icon=/usr/share/pixmaps/slitaz-icon.png --center \ ---image=slitaz-icon --image-on-top --width=480 --height=340" - -# Internationalization: $(gettext "") -. /usr/bin/gettext.sh -TEXTDOMAIN='tazbug' -export TEXTDOMAIN - -# -# Functions -# - -# Output cmd in GTK box. -output() { - yad $opts --text-info --text="SliTaz Bug" --title="SliTaz Bug" \ - --margins=8 --tail --button="$(gettext "My account"):0" \ - --button="gtk-close":1 - case $? in - 0) $0 account ;; - 1) exit 0 ;; - esac -} - -# New message box -new_msg_main() { - yad --form $opts \ - --title="Bug message" \ - --text="SliTaz Bugs Message" \ - --field="$(gettext "Bug ID")":NUM \ - --field="$(gettext "Message")":TXT \ - --button="$(gettext "New bug"):2" \ - --button="$(gettext "Send message"):0" \ - --button="gtk-close:1" -} - -# New message main function -new_msg() { - # Store box results - main=$(new_msg_main) - ret=$? - # Deal with --button values - case $ret in - 1) exit 0 ;; - 2) $0 new-bug && exit 0 ;; - *) continue ;; - esac - id="$(echo $main | cut -d "|" -f 1 | cut -d "," -f 1)" - msg="$(echo $main | cut -d "|" -f 2)" - if [ "$msg" ]; then - tazbug new-msg --bug=$id --msg="$msg" | output - fi -} - -# New bug box -new_bug_main() { - yad --form $opts \ - --title="Bug report" \ - --text="SliTaz Bug Report" \ - --field="$(gettext "Bug title")" \ - --field="$(gettext "Priority")":CB \ - --field="$(gettext "Packages")" \ - --field="$(gettext "Description")":TXT \ - --button="$(gettext "My account"):3" \ - --button="$(gettext "New message"):2" \ - --button="$(gettext "Send bug"):0" \ - --button="gtk-close:1" \ - "" "standard!critical" "" "" -} - -# New bug main function -new_bug() { - # Store box results - main=$(new_bug_main) - ret=$? - # Deal with --button values - case $ret in - 1) exit 0 ;; - 2) $0 new-msg && exit 0 ;; - 3) $0 account && exit 0 ;; - *) continue ;; - esac - bug="$(echo $main | cut -d "|" -f 1)" - desc="$(echo $main | cut -d "|" -f 4)" - priority="$(echo $main | cut -d "|" -f 2)" - pkgs="$(echo $main | cut -d "|" -f 3)" - if [ "$bug" ] && [ "$desc" ]; then - tazbug new-bug --bug="$bug" --desc="$desc" --priority=$priority \ - --pkgs="$pkgs" | output - fi -} - -# Account information. -account_info() { - . $HOME/.config/slitaz/account.conf - cat << EOT -$(gettext "Real name") -$NAME -$(gettext "User name") -$USER -Email -$MAIL -$(gettext "Secure key") -$KEY -EOT -} - -# Main GUI box function with pure Yad spec -account_main() { - account_info | yad --list $opts \ - --title="Bugs account" \ - --text="SliTaz Bugs Account" \ - --column "$(gettext "Account")" \ - --column "$(gettext "Value")" \ - --dclick-action="" \ - --button="$(gettext "Online bugs"):2" \ - --button="$(gettext "New bug"):3" \ - --button="$(gettext "New message"):4" \ - --button="gtk-close:1" -} - -# This is a function, usually the same name as the command if scripts -# have multiple commands and options. -account() { - # Store box results - main=$(account_main) - ret=$? - # Deal with --button values - case $ret in - 1) exit 0 ;; - 2) browser $WEB_URL && exit 0 ;; - 3) $0 new-bug && exit 0 ;; - 4) $0 new-msg && exit 0 ;; - *) continue ;; - esac -} - -# Signup GUI box function with pure Yad spec -signup_main() { - yad --form $opts --borders=4 \ - --title="Bugs Signup" \ - --text="SliTaz Bugs Signup" \ - --field="$(gettext "Real name")" \ - --field="$(gettext "Login name")" \ - --field="$(gettext "Email")" \ - --field="$(gettext "Password")":H \ - --button="gtk-ok:0" \ - --button="gtk-close:1" -} - -# Signup main function -signup() { - # Store box results - main=$(signup_main) - ret=$? - # Deal with --button values - case $ret in - 1) exit 0 ;; - 2) browser http://bugs.slitaz.org/ && exit 0 ;; - *) continue ;; - esac - name="$(echo $main | cut -d "|" -f 1)" - user="$(echo $main | cut -d "|" -f 2)" - mail="$(echo $main | cut -d "|" -f 3)" - pass="$(echo $main | cut -d "|" -f 4)" - tazbug signup --name="$name" --user=$user --mail=$mail \ - --pass="$pass" | output -} - -# -# Script commands -# - -case "$1" in - usage|help) - echo "Usage: $(basename $0) [new-msg|new-bug|account|signup]" ;; - new-msg) - new_msg ;; - account) - account ;; - signup) - signup ;; - *) - if [ ! -f $HOME/.config/slitaz/account.conf ]; then - signup - fi - new_bug ;; -esac - -exit 0 - diff -r c9939a4ea74c -r d24cd6951458 tazbug.conf --- a/tazbug.conf Sat Feb 11 00:00:17 2017 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -# SliTaz Bug Tracker tools configuration -# - -# TazBug URL to post bugs from cmdline and RSS -WEB_URL="http://bugs.slitaz.org/" - -# Auth file for user -AUTH_FILE="/var/lib/slitaz/auth/people" - -# People config files -PEOPLE="/var/lib/slitaz/people" - -# Online registration for user -ONLINE_SIGNUP="yes" diff -r c9939a4ea74c -r d24cd6951458 web/bugs.cgi --- a/web/bugs.cgi Sat Feb 11 00:00:17 2017 +0100 +++ b/web/bugs.cgi Sat Feb 11 00:21:42 2017 +0100 @@ -7,9 +7,7 @@ . /usr/lib/slitaz/httphelper # Source config file -[ -f "/etc/slitaz/tazbug.conf" ] && . /etc/slitaz/tazbug.conf -# Web interface can have different setting than cmdline tools -[ -f "/etc/slitaz/bugs.conf" ] && . /etc/slitaz/bugs.conf +. ./config.cgi # Internal variable bugdir="$PWD/bug" diff -r c9939a4ea74c -r d24cd6951458 web/config.cgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/config.cgi Sat Feb 11 00:21:42 2017 +0100 @@ -0,0 +1,14 @@ +# SliTaz Bug Tracker Web interface configuration. +# + +# TazBug URL for redirection and RSS +WEB_URL="http://localhost/bugs/bugs.cgi" + +# Auth file for user +AUTH_FILE="/var/lib/slitaz/auth/people" + +# People config files +PEOPLE="/var/lib/slitaz/people" + +# Online registration for user +ONLINE_SIGNUP="yes"