update coding style and starting development of dockerfile

This commit is contained in:
htrgouvea 2022-12-02 08:23:31 -03:00
parent 5db7b3c183
commit 74f474af74
5 changed files with 12 additions and 4 deletions

8
Dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM perl:5.34
COPY . /usr/src/nipe
WORKDIR /usr/src/nipe
RUN cpanm --installdeps .
ENTRYPOINT [ "perl", "./nipe.pl" ]

View File

@ -33,7 +33,7 @@ All non-local UDP/ICMP traffic is also blocked by the Tor project.
$ git clone https://github.com/htrgouvea/nipe && cd nipe
# Install libs and dependencies
$ sudo cpan install Try::Tiny Config::Simple JSON
$ cpanm --installdeps .
# Nipe must be run as root
$ perl nipe.pl install

View File

@ -10,7 +10,7 @@ package Nipe::Utils::Device {
my %device = (
"username" => "debian-tor",
"distribution" => "debian"
"distribution" => "debian"
);
if (($id_like =~ /[F,f]edora/) || ($id_distro =~ /[F,f]edora/)) {

View File

@ -6,7 +6,7 @@ package Nipe::Utils::Status {
sub new {
my $apiCheck = "https://check.torproject.org/api/ip";
my $request = HTTP::Tiny -> new -> get($apiCheck);
my $request = HTTP::Tiny -> new -> get($apiCheck);
if ($request -> {status} == 200) {
my $data = decode_json ($request -> {content});

View File

@ -16,7 +16,7 @@ sub main {
my $argument = $ARGV[0];
if ($argument) {
die "Nipe must be run as root.\n" if $> != 0;
die "Nipe must be run as root.\n" if $< != 0;
my $commands = {
stop => "Nipe::Engine::Stop",