diff --git a/.gitignore b/.gitignore index aa50428..31ad99b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,20 @@ oldsite/ stage/ scratch/ /web/sitemap.org .*.orgx /web/theindex.inc /web/faq/gnupg-faq.pdf /web/faq/gnupg-faq.tex /web/faq/gnupg-faq.txt /web/swdb.lst /web/swdb.lst.sig /misc/blog.gnupg.org/index.html /misc/blog.gnupg.org/20*.html /misc/blog.gnupg.org/headlines.txt /misc/id/eddsa-for-openpgp/draft.txt *~ .DS_Store ._.DS_Store default.profraw +/misc/id/openpgp-webkey-service/draft.xml diff --git a/README b/README index d1bf219..1efc6b5 100644 --- a/README +++ b/README @@ -1,121 +1,120 @@ README for the gnupg-doc repository -*- org -*- -This is a separated branch for the gnupg.org website. - -The old website was tracked in a CVS repository but we want to start -the new website form scratch using only the texts from the generated -HTML files. +This is the new gnupg.org website. The old website was tracked in a +CVS repository. We started the new website form scratch by converting +the HTML rendered content to org-mode instead of writing a converter +from the formerly used [[https://en.wikipedia.org/wiki/Website_Meta_Language][WML]]. ** Directory structure - web/ :: Source files for the web. This also include images etc. - web/share :: Logos, CSS, macros and elisp for building. - misc :: Other websites etc. - blog.gnupg.org - git.gnupg.org - howtos.gnupg.org :: Manuals etc. - build-aux :: Build helper rscripts - tools/ :: Tools used to build the web site. - stage/ :: staging directory for the site. ** Aliases www.gnupg.org uses Boa to serve the pages, here are the aliases we use: #+BEGIN_EXAMPLE # The manuals are maintained outside of the web pages; # thus we use an alias to copy them in. Alias /documentation/manuals /var/www/shared/manuals Alias /gph /var/www/shared/gph # The blog is maintained outside of the standard tree, so that it can be build using # a separate script. Alias /blog /var/www/www/www.gnupg.org/misc/blog # Redirect a couple of well-known old URLs # We use redirect to make language switching work. Redirect /gpa.html http://www.gnupg.org/related_software/gpa/ Redirect /gpgme.html http://www.gnupg.org/related_software/gpgme/ Redirect /docs.html http://www.gnupg.org/documentation/ Redirect /download.html http://www.gnupg.org/download/ Redirect /faq.html http://www.gnupg.org/documentation/faqs.html Redirect /faqs.html http://www.gnupg.org/documentation/faqs.html Redirect /gpgme-faq.html http://www.gnupg.org/faq/gpgme-faq.html Redirect /gnupg-faq.html http://www.gnupg.org/documentation/faqs.html Redirect /GnuPG-FAQ.html http://www.gnupg.org/documentation/faqs.html Redirect /supported_systems.html http://www.gnupg.org/download/supported_systems.html Redirect /release_notes.html http://www.gnupg.org/download/release_notes.html Redirect /integrity_check.html http://www.gnupg.org/download/integrity_check.html Redirect /cvs_access.html http://www.gnupg.org/download/cvs_access.html Redirect /iconv.html http://www.gnupg.org/download/iconv.html Redirect /manpage.html http://www.gnupg.org/documentation/manpage.html Redirect /sites.html http://www.gnupg.org/documentation/sites.html Redirect /guides.html http://www.gnupg.org/documentation/guides.html Redirect /manuals.html http://www.gnupg.org/documentation/manuals.html Redirect /mailing-lists.html http://www.gnupg.org/documentation/mailing-lists.html Redirect /howtos.html http://www.gnupg.org/documentation/howtos.html Redirect /bts.html http://www.gnupg.org/documentation/bts.html Redirect /weak-digest-algos.html http://www.gnupg.org/faq/weak-digest-algos.html Redirect /subkey-cross-certify.html http://www.gnupg.org/faq/subkey-cross-certify.html Redirect /why-not-idea.html http://www.gnupg.org/faq/why-not-idea.html Redirect /howtos/ch/ http://www.gnupg.org/howtos/zh/ # Temporary: Redirect /fund http://goteo.org/project/gnupg-new-website-and-infrastructure #+END_EXAMPLE The howtos are symlinked into the www.gnupg.org tree; see below. ** Symlinks #+begin_example howtos -> ../../howtos.gnupg.org/htdocs related_software -> software features.html -> software/index.html #+end_example The website-build script assures that these symlinks exist ** Cronjobs A cronjob needs to run mkkudos.sh to update the list of donors. This can be done every few minutes because mkkudos won't do anything if the list of donors has not been updated. ** Writing a blog entry The misc/blog.gnupg.org directory is used for the blogging system. On the web server it is symlinked to /blog/. To build and upload all blogs you cd to misc/blog.gnupg.org and run the command ./upload. This renders the org files into html, builds an index, and uploads the html files to the web server. Emacs and a decent org-mode are required (tested with org-mode 8.2.7). To add a new blog entry, decide on the publication date and create a file YYYYMMDD-short-headline.org for example "20141030-what-happened-this-month.org". For drafting the blog you may want to store it in drafts/ first. Unless you translate an existing entry do not use a file name which ends in ".??.org". The file itself is a standard org file using these conventions: ===== 8< ========= # Comment #+AUTHOR: Werner #+DATE: 30th October 2014 ** What happened in October 2014 Blurb ===== >8 ========= AUTHOR and DATE are used to construct the "Posted at" info. The headline needs to start at level 2. diff --git a/cgi/procdonate.cgi b/cgi/procdonate.cgi index 55726c0..f13ab1d 100755 --- a/cgi/procdonate.cgi +++ b/cgi/procdonate.cgi @@ -1,1173 +1,1181 @@ #!/usr/bin/perl -T # procdonate.cgi - Donation payment processor for gnupg.org # Copyright (C) 2014 g10 Code GmbH # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. use strict; #use CGI qw/:standard -debug/; use CGI; use Cwd qw(realpath); use IO::Socket::UNIX; realpath($0) =~ /^(.*)\/.*$/; my %config = do $1 . '/config.rc'; $ENV{PATH} = "/bin:/usr/bin"; delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; my $baseurl = $config{baseurl}; my $htdocs = $config{htdocs}; my $stripepubkey = $config{stripepubkey}; my $socket_name = $config{payprocd_socket}; my $error_marker = '* error'; # The form variables are accessed via Q. my $q = new CGI; # This is a multi-purpose CGI. The mode decides what to do. my $mode = $q->param("mode"); my $sessid = $q->param("sessid"); my $lang = $q->param("lang"); # Variables used in the template pages. my $amount = ""; my $paytype = ""; my $stripeamount = ""; my $euroamount = ""; my $currency = ""; my $recur = ""; my $name = ""; my $mail = ""; my $message = ""; my $separef = ""; my $sepaqr = ""; my $errorstr = ""; my $notepanel = ""; # We use a dictionary to track error. Those errors will then be # inserted into the output by write_template. my %errdict = (); # Prototypes sub fail ($); sub get_paypal_approval (); sub complete_sepa (); # Write a template file. A template is a proper HTML file with # variables enclosed in HTML comments. To allow inserting data into # a value attribute of an input field, such a tag needs to be written as # # the result after processing will be # # assuming that the value of FOO is foo. Note that this substitution # rules work for all tags and thus you better take care to add an # extra space if you do not want this to happen. sub write_template ($) { my $fname = shift; my $tname; my $errorpanel = $errorstr; my $err_amount = ''; my $err_name = ''; my $err_mail = ''; my $err_paytype = ''; my $check_checked = ' checked="checked"'; my $sel_eur = ''; my $sel_usd = ''; my $sel_gbp = ''; my $sel_jpy = ''; my $chk_amt500 = ''; my $chk_amt200 = ''; my $chk_amt100 = ''; my $chk_amt50 = ''; my $chk_amt20 = ''; my $chk_amt10 = ''; my $chk_amt5 = ''; my $chk_amtx = ''; my $amt_other = ''; my $recur_none = ''; my $recur_month = ''; my $recur_quarter = ''; my $recur_year = ''; my $recur_text = ''; my $message_fmt; my $publishname; my $check_paytype = 'none'; my $stripe_data_email = ''; my $stripe_data_label_value; my $xamount; my $stripelocale; # Avoid broken HTML attributes. $amount =~ s/\x22/\x27/g; $stripeamount =~ s/\x22/\x27/g; $currency =~ s/\x22/\x27/g; $recur =~ s/\x22/\x27/g; $name =~ s/\x22/\x27/g; $mail =~ s/\x22/\x27/g; $message =~ s/\x22/\x27/g; $separef =~ s/\x22/\x27/g; $lang =~ s/\x22/\x27/g; # Clean possible user provided data $sessid =~ s//g; # Check the currency and predefined amount. if ( $currency =~ /EUR/i ) { $sel_eur = ' selected="selected"'; $chk_amtx = $check_checked; $amt_other = $amount; } elsif ( $currency =~ /USD/i ) { $sel_usd = ' selected="selected"'; $chk_amtx = $check_checked; $amt_other = $amount; } elsif ( $currency =~ /GBP/i ) { $sel_gbp = ' selected="selected"'; $chk_amtx = $check_checked; $amt_other = $amount; } elsif ( $currency =~ /JPY/i ) { $sel_jpy = ' selected="selected"'; $chk_amtx = $check_checked; $amt_other = $amount; } else { $chk_amtx = $check_checked; $amt_other = $amount; } # For non-recurring Stripe donations we do not want to send a # data-email="$mail" # line to Stripe so to enable the user to use a a different mail # address for use with them. This is implemented using a # STRIPE_DATA_EMAIL template variable. $stripe_data_email = 'data-email="' . $mail . '"'; if ( $recur =~ /0/ ) { $stripe_data_email = ''; $recur_none = ' selected="selected"'; $recur_text = ''; if ($lang eq 'de') { $stripe_data_label_value = 'Einmalig spenden'; } elsif ($lang eq 'fr') { $stripe_data_label_value = 'Faire un don unique'; } elsif ($lang eq 'ja') { $stripe_data_label_value = '一回の寄付する'; } else { $stripe_data_label_value = 'Make one-time donation'; } } elsif ( $recur =~ /12/ ) { $recur_month = ' selected="selected"'; if ($lang eq 'de') { $recur_text = 'monatlich'; $stripe_data_label_value = 'Monatlich spenden'; } elsif ($lang eq 'fr') { $recur_text = 'mensuels'; $stripe_data_label_value = 'Faire un don mensuel'; } elsif ($lang eq 'ja') { $recur_text = '毎月'; $stripe_data_label_value = '毎月寄付する'; } else { $recur_text = 'monthly'; $stripe_data_label_value = 'Donate monthly'; } } elsif ( $recur =~ /4/ ) { $recur_quarter = ' selected="selected"'; if ($lang eq 'de') { $recur_text = 'vierteljährlich'; $stripe_data_label_value = 'Vierteljährlich spenden'; } elsif ($lang eq 'fr') { $recur_text = 'trimestriels'; $stripe_data_label_value = 'Faire un don trimestriel'; } elsif ($lang eq 'ja') { $recur_text = '3ヶ月毎'; $stripe_data_label_value = '3ヶ月毎に寄付する'; } else { $recur_text = 'quarterly'; $stripe_data_label_value = 'Donate quarterly'; } } elsif ( $recur =~ /1/ ) { $recur_year = ' selected="selected"'; if ($lang eq 'de') { $recur_text = 'jährlich'; $stripe_data_label_value = 'Jährlich spenden'; } elsif ($lang eq 'fr') { $recur_text = 'annuels'; $stripe_data_label_value = 'Faire un don annuel'; } elsif ($lang eq 'ja') { $recur_text = '毎年'; $stripe_data_label_value = '毎年寄付する'; } else { $recur_text = 'yearly'; $stripe_data_label_value = 'Donate yearly'; } } else { # invalid $stripe_data_label_value = ''; } if ( $paytype eq "cc" ) { $check_paytype = "CC"; } elsif ( $paytype eq "pp" ) { $check_paytype = "PP"; } elsif ( $paytype eq "se" ) { $check_paytype = "SE"; } elsif ( $paytype eq "bc" ) { $check_paytype = "BC"; } # Set var for the paypal button if ( $name eq 'Anonymous' or $name eq '') { $publishname = 'No'; } else { $publishname = 'Yes'; } # Set a specific locale. if ($lang eq 'de') { $stripelocale = "de"; } elsif ($lang eq 'fr') { $stripelocale = "fr"; } elsif ($lang eq 'ja') { $stripelocale = "ja"; } elsif ($lang eq 'en') { $stripelocale = "en"; } else { $stripelocale = "auto"; } # Build error strings. foreach (keys %errdict) { my $fieldname; if ($lang eq 'de') { $fieldname = "Feld $_: "; } elsif ($lang eq 'fr') { $fieldname = "Champ $_: "; } elsif ($lang eq 'ja') { $fieldname = "欄 $_: "; } else { $fieldname = "Field $_: "; } if (/amount/) { $err_amount = $error_marker; } elsif (/name/) { $err_name = $error_marker; } elsif (/mail/) { $err_mail = $error_marker; } elsif (/paytype/){ $err_paytype = $error_marker; } $errorpanel = $errorpanel . $fieldname . $errdict{$_} . "
\n" } if ( $errorpanel ne '' ) { $errorpanel = "

\n" . $errorpanel . "

\n"; } elsif ( $notepanel ne '' ) { $errorpanel = "

\n" . $notepanel . "

\n"; $notepanel = ''; } open TEMPLATE, $tname; while (