commit a3c221cdf90cf90692839a964d8d065c2254c751 from: jrmu date: Tue Mar 07 16:58:25 2023 UTC Create folder backups commit - 6941c9c13d739183241826b5c924ef1608b73c3e commit + a3c221cdf90cf90692839a964d8d065c2254c751 blob - c725f59d1bba9b37ce95de1a763f46af50265a38 blob + 90c8df62e7d17bedbb2e2eaf869f927fcb31d163 --- botnow +++ botnow @@ -39,7 +39,7 @@ sub readstr { sub writefile { my ($filename, $str) = @_; my $date = date(); - copy($filename, $homepath.basename($filename).".".date()) or die "Could not make backup of $filename"; + copy($filename, $backuppath.basename($filename).".".date()) or die "Could not make backup of $filename"; open(my $fh, '>', "$filename") or die "Could not write to $filename"; print $fh $str; close $fh; @@ -82,7 +82,7 @@ return "true"; # Path to configuration file my $confpath = "botnow.conf"; -my $homepath = "/home/botnow"; +my $backuppath = "/home/botnow/backups/"; # Configuration variables will be stored in key => value pairs our %conf; @@ -198,7 +198,7 @@ my $expires = $conf{expires}; unveil("./", "r") or die "Unable to unveil $!"; unveil("$confpath", "r") or die "Unable to unveil $!"; -unveil("$homepath", "rwc") or die "Unable to unveil $!"; +unveil("$backuppath", "rwc") or die "Unable to unveil $!"; unveil() or die "Unable to lock unveil $!"; #dns and inet for sockets, proc and exec for figlet blob - 253da02ca13c10b3ae15829bb3a5a04db76cee3d blob + d352434e5240ad4a272a3870ffcd2baf842754d5 --- install +++ install @@ -22,7 +22,6 @@ else useradd -m -g =uid -c ${USERNAME} -d ${HOMEDIR} -s /bin/ksh ${USERNAME} fi mkdir ${HOMEDIR} -chmod go-rx ${HOMEDIR} mkdir ${DATABASE} chmod o-rx ${DATABASE} touch ${DATABASE}/www @@ -43,8 +42,9 @@ echo "permit nopass ${USERNAME}" >> /etc/doas.conf usermod -G _dovecot botnow chmod g+rw ${HOSTNAMEIF} cp captcha.png register.php ${HTDOCS}/ -cp LICENSE README botnow botnow.conf.example BNC.pm DNS.pm Mail.pm SQLite.pm Shell.pm table.sql Hash.pm Help.pm install networks captcha.png register.php words ${HOMEDIR}/ +cp LICENSE README botnow botnow.conf.example BNC.pm DNS.pm Mail.pm SQLite.pm Shell.pm table.sql Hash.pm Help.pm install networks captcha.png register.php words backups ${HOMEDIR}/ chown -R ${USERNAME}:${USERNAME} ${HOMEDIR} +chmod -R go-rx ${HOMEDIR} chmod u+x ${HOMEDIR}/botnow chown -R ${ZNCUSER}:daemon ${ZNCDIR} chmod -R ug+r ${ZNCDIR}