[Debian-l10n-commits] [ddtp] branch master updated (bb62413 -> 756d7ea)
Martijn van Oosterhout
kleptog-guest at moszumanska.debian.org
Mon Jan 6 23:31:49 UTC 2014
This is an automated email from the git hooks/post-receive script.
kleptog-guest pushed a change to branch master
in repository ddtp.
from bb62413 Fix the importing of descriptions to verify md5.
new 05d8e0b Don't use Mail::Sender as it is non-free. MIME::Entity can do the job also.
new 1e31de4 Remove absolute link.
new 927137c Improve error messages.
new e550aa0 Fix the database connections to use the service rather than the dbname.
new 230fe33 Use the scripts out of the repo, rather than some far off directory.
new d903b08 Don't copy script, handled by apache config.
new 756d7ea Fix base so you stay in HTTPS once there.
The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.
Summary of changes:
db2web.sh | 3 +--
ddt.cgi | 2 +-
ddtp-dinstall/checks/ddtp_dinstall.sh | 2 +-
ddtss/DDTSS_Pg.pm | 26 --------------------------
ddtss/Pg_BDB.pm | 2 +-
ddtss/ddts_lib.pm | 2 +-
ddtss/ddtss-cgi | 33 ++++++++++++++++++++++-----------
file2Translation.sh | 2 +-
stat.pl | 8 ++++----
9 files changed, 32 insertions(+), 48 deletions(-)
diff --git a/db2web.sh b/db2web.sh
index a532a9e..888362c 100755
--- a/db2web.sh
+++ b/db2web.sh
@@ -20,7 +20,7 @@ do
done
echo "<hr>" >> www/index.html.new
-echo "<a href=\"http://ddtp.debian.net/ddtss/index.cgi/\">to the ddtss (a web interface for the ddtp)<a/><br>" >> www/index.html.new
+echo "<a href=\"/ddtss/index.cgi/\">to the ddtss (a web interface for the ddtp)<a/><br>" >> www/index.html.new
echo "Daily description translation stats for <a href='stats/stats-squeeze.html'>Squeeze</a>, <a href='stats/stats-wheezy.html'>Wheezy</a>, <a href='stats/stats-jessie.html'>Jessie</a> and <a href='stats/stats-sid.html'>Sid</a>" >> www/index.html.new
echo "<hr>" >> www/index.html.new
echo "<a href=\"http://www.debian.org/international/l10n/ddtp\">Documentation about DDTP and DDTSS<a/>" >> www/index.html.new
@@ -71,7 +71,6 @@ gnuplot ../lib/all-stat.gnuplot
cd ..
mv www/index.html.new www/index.html
-cp -a ddt.cgi www
mkdir -p www/gnuplot
cp -a gnuplot/* www/gnuplot
diff --git a/ddt.cgi b/ddt.cgi
index f38fab9..b7e09e9 100755
--- a/ddt.cgi
+++ b/ddt.cgi
@@ -11,7 +11,7 @@ use Text::Diff;
my $cgi = new CGI;
$cgi->charset("UTF-8");
-my @DSN = ("DBI:Pg:dbname=ddtp", "", "");
+my @DSN = ("DBI:Pg:service=ddtp", "", "");
my $dbh = DBI->connect(@DSN,
{ PrintError => 0,
diff --git a/ddtp-dinstall/checks/ddtp_dinstall.sh b/ddtp-dinstall/checks/ddtp_dinstall.sh
index 6f6521c..95702df 100755
--- a/ddtp-dinstall/checks/ddtp_dinstall.sh
+++ b/ddtp-dinstall/checks/ddtp_dinstall.sh
@@ -15,7 +15,7 @@
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
-DDTP_I18N_CHECK=/srv/scripts/ddtp_i18n_check.sh
+DDTP_I18N_CHECK=$(dirname $(readlink -f $0))/ddtp_i18n_check.sh
TRANSLATION_FILES=/srv/ddtp.debian.net/Translation-files
PACKAGE_LISTS=/srv/ddtp.debian.net/packagelist
diff --git a/ddtss/DDTSS_Pg.pm b/ddtss/DDTSS_Pg.pm
index bbfd8b5..4b71f6b 100644
--- a/ddtss/DDTSS_Pg.pm
+++ b/ddtss/DDTSS_Pg.pm
@@ -4,7 +4,6 @@ use POSIX qw(strftime);
use Pg_BDB;
use Data::Dumper;
use Text::Iconv;
-use Mail::Sender;
use Algorithm::Diff::XS qw(compact_diff);
use ddts_lib;
@@ -963,31 +962,6 @@ sub process_data
DDTSS_Log( $db, "$lang/packages/$package/log", time()." processed from todo" );
}
-# Setup Mail::Sender object
-# No longer used for the sending/receiving of data, but it is used for sending verification emails for accounts
-sub setup_email_connection
-{
- my $db = shift;
- my ($from,$to,$mailserver,$emaildebug);
- $db->get("config/clientemail",$from);
- $db->get("config/serveremail",$to);
- $db->get("config/mailserver",$mailserver);
- $db->get("config/debugemail",$emaildebug);
-
- if( not defined $mailserver )
- { $mailserver = "127.0.0.1" }
-
- my $sender = new Mail::Sender { smtp => $mailserver,
- from => $from,
- to => $to,
-# to => "<ddtss\@kleptog.org>",
- subject => 'nothing',
- on_errors => 'die',
- (defined $emaildebug ? (bcc => $emaildebug) : ()) };
-
- return $sender;
-}
-
sub DDTSS_Get_commonpackages
{
#my $db = shift;
diff --git a/ddtss/Pg_BDB.pm b/ddtss/Pg_BDB.pm
index 7aad35e..44c517e 100644
--- a/ddtss/Pg_BDB.pm
+++ b/ddtss/Pg_BDB.pm
@@ -5,7 +5,7 @@ package Pg_BDB;
use DBI;
use DBD::Pg qw(:pg_types);
#DBI->trace(1);
-my @DSN = ("DBI:Pg:dbname=ddtp", "", "");
+my @DSN = ("DBI:Pg:service=ddtp", "", "");
my ($_dbh, $_inuse);
sub _get_handle()
diff --git a/ddtss/ddts_lib.pm b/ddtss/ddts_lib.pm
index fcbcb00..b64c0dc 100644
--- a/ddtss/ddts_lib.pm
+++ b/ddtss/ddts_lib.pm
@@ -13,7 +13,7 @@ use Text::Iconv;
#my $start= shift(@ARGV);
-my @DSN = ("DBI:Pg:dbname=ddtp", "", "");
+my @DSN = ("DBI:Pg:service=ddtp", "", "");
my $dbh = DBI->connect(@DSN,
{ PrintError => 0,
diff --git a/ddtss/ddtss-cgi b/ddtss/ddtss-cgi
index 492aae0..363cf63 100755
--- a/ddtss/ddtss-cgi
+++ b/ddtss/ddtss-cgi
@@ -7,6 +7,7 @@ use lib '/org/ddtp.debian.net/ddtss';
use DDTSS_Pg;
use LWP::Simple;
#use Text::Iconv;
+use MIME::Entity;
use CGI qw/escapeHTML/;
use Encode;
use Digest::MD5 qw(md5_hex);
@@ -69,6 +70,7 @@ my $path = $ENV{PATH_INFO} || '/';
# Later $self is overwritten for the per language page, so keep a copy of the real thing
my $self = $ENV{SCRIPT_NAME} || 'local';
my $http_host = $ENV{HTTP_HOST} || 'local';
+my $http_proto = $ENV{HTTPS} ? "https" : "http";
if( defined $q->param("_charset_") and uc($q->param("_charset_")) ne "UTF-8" )
{
@@ -696,7 +698,7 @@ sub main_display
DDTSS_Close($db);
print $q->header( -type =>'text/html', -charset => "UTF-8", -refresh => "240; url=$self", -expires => '+10s', -cookie => $usercookie ),
- $q->start_html( -title => "DDTSS ($lang)", @html_headers, -xbase => "http://$http_host$self/" );
+ $q->start_html( -title => "DDTSS ($lang)", @html_headers, -xbase => "$http_proto://$http_host$self/" );
print $q->h1("DDTSS for $lang");
# print $q->p({-style=>'color: #ff0000'}, "Scheduled downtime: 08:00-10:00 UTC on 5 June 2011");
@@ -1881,17 +1883,26 @@ sub display_createlogin
$db->put( "aliases/$alias/key", $key );
# We want to unlock the database before trying to send the message
- my $sender = setup_email_connection($db);
-
+
+ my ($from,$emaildebug);
+ $db->get("config/clientemail",$from);
+ $db->get("config/debugemail",$emaildebug);
+
+ my $email = MIME::Entity->build( Type => 'text/plain',
+ From => $from,
+ To => $email,
+# To => "<ddtss\@kleptog.org>",
+ Subject => 'Confirm DDTSS account',
+ (defined $emaildebug ? (Bcc => $emaildebug) : ()),
+ Data => "To confirm you account ($alias) on the DDTSS, please follow this link\n".
+ "http://$http_host$self/verifylogin?a=$alias&k=$key\n\n".
+ "If you did not create an account, please ignore this email.\n".
+ "DDTSS (Debian Distributed Translation Server Satelite)\n" );
+
+ $email->send();
+
DDTSS_Close($db);
-
- $sender->MailMsg({to => $email,
- subject => 'Confirm DDTSS account',
- msg => "To confirm you account ($alias) on the DDTSS, please follow this link\n".
- "http://$http_host$self/verifylogin?a=$alias&k=$key\n\n".
- "If you did not create an account, please ignore this email.\n".
- "DDTSS (Debian Distributed Translation Server Satelite)\n"});
-
+
goto_main_display("Logon creation succesful, email sent.");
return;
}
diff --git a/file2Translation.sh b/file2Translation.sh
index 1c7228e..6b6fe0a 100755
--- a/file2Translation.sh
+++ b/file2Translation.sh
@@ -50,4 +50,4 @@ cp -a ./Translation-files_new/ ./Translation-files_to-check
rm -rf Translation-files
mv Translation-files_new Translation-files
-/srv/scripts/ddtp_dinstall.sh
+./ddtp-dinstall/ddtp_dinstall.sh
diff --git a/stat.pl b/stat.pl
index 9525167..77d8bab 100755
--- a/stat.pl
+++ b/stat.pl
@@ -52,7 +52,7 @@ $sth->execute;
print "$d_count package descriptions;<br>\n";
print "<br>\n";
- open (FILE, ">>$logdir/stat") or die "log-file";
+ open (FILE, ">>$logdir/stat") or die "Could not open $logdir/stat ($!)";
printf FILE "%s %5d\n", $time, $d_count;
close (FILE);
@@ -63,7 +63,7 @@ $sth->execute;
print "$a_count package descriptions are active;<br>\n";
print "<br>\n";
- open (FILE, ">>$logdir/stat-uptodate") or die "log-file";
+ open (FILE, ">>$logdir/stat-uptodate") or die "Could not open $logdir/stat-uptodate ($!)";
printf FILE "%s %5d\n", $time, $a_count;
close (FILE);
@@ -89,11 +89,11 @@ while(($lang) = $sth->fetchrow_array) {
print "lang $lang has $ta_count ($pa_count) active translations from $t_count translations;<br>\n";
- open (FILE, ">>$logdir/stat-$lang") or die "log-file";
+ open (FILE, ">>$logdir/stat-$lang") or die "Could not open $logdir/stat-$lang ($!)";
printf FILE "%s %5d\n", $time, $t_count;
close (FILE);
- open (FILE, ">>$logdir/stat-trans-sid-$lang") or die "log-file";
+ open (FILE, ">>$logdir/stat-trans-sid-$lang") or die "Could not open $logdir/stat-trans-sid-$lang ($!)";
printf FILE "%s %5d %5d %5d\n", $time, $a_count, $ta_count, $pa_count ;
close (FILE);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-l10n/ddtp.git
More information about the Debian-l10n-commits
mailing list