From 2137a587bb3a314ac13327d4cdb53f0ee8b9d970 Mon Sep 17 00:00:00 2001 From: Miquel Lionel Date: Fri, 2 Jul 2021 12:09:24 +0100 Subject: Better way to validate cookies and others improvs - Added GPLv3+ short header in source files (genpass.pl, gpigeon-template.cgi and link-template-tmpl.cgi). - Added some security headers in the example nginx configuration file, and renamed the NGINXCONFDIR variable in the Makefile to SITESENABLED, it makes a bit more sense. - Hastily drawed a more fitting .ico/mascot for the project - Tweaked the styles.css to be somewhat more responsive. Some tags in index.html and gpigeon-template.cgi and link-template-tmpl.cgi have now an id for styling. - Fixed and improved cookie validation. While working on the multi-user alternative, I noticed that the ValidCookies() function was flimsy, I was used eq... I learned about 'cmp' and throwed some UA and IP address match to make it a bit more robust. - Improved the genpass.pl script, if you want a argon2id of your password, you can now launch it in interactive mode with the '-i' arg. It'll fill the ARGON2ID_HASH variable in the existing config.mk with the hash of the provided password - Fixed inconsistencies in the Makefile. I was overwriting changes with sed for no good reason instead of using the -i switch ! I also moved the mail address, mail sender, and gpg id checks to the top of the file since they are the most important. Also, the 0xlong is not needed in config.def.mk anymore, we extract via the mail address. --- link-tmpl-template.cgi | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'link-tmpl-template.cgi') diff --git a/link-tmpl-template.cgi b/link-tmpl-template.cgi index d781252..c060131 100644 --- a/link-tmpl-template.cgi +++ b/link-tmpl-template.cgi @@ -1,6 +1,24 @@ #! /usr/bin/perl -wT my $linkuser = q{link_user}; my $linkfilename = q{link_filename}; +# link-tmpl.cgi : self-destructing message form to send yourself GPG +# encrypted messages. Part of gpigeon. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Copyright (c) 2020-2021, Miquel Lionel + use warnings; use strict; use GPG; @@ -43,9 +61,9 @@ else { if ($HAS_MAILSERVER){ use Mail::Sendmail; - my %mail = ( To => "$mymailaddr" - From => "$mailsender" - Subject => '.' + my %mail = ( To => "$mymailaddr", + From => "$mailsender", + Subject => '.', Message => "$enc_msg\n" ); sendmail(%mail) or die $Mail::Sendmail::error; -- cgit v1.2.3-70-g09d2