The use of both "strict" and "warnings" is a well known practice in Perl code
for generating further warnings for common cases where future misbehaviors
may happen. With this patch, every Perl file has both compiler flags enabled.
Alongside the flags enablement, this patch also bring the necessary
modifications to allow the program to run normally.
This new feature allows the user to specify custom tor configurations that he
may have created manually or from Nipe itself (through "install" command)
using the '-c' flag with "start" command.
$ ./nipe.pl start -c $HOME/.nipe_torrc
In case the user's config doesn't contain some of the values required by Nipe,
it will use its defined default value. For now the default values are
hardcoded within Nipe's source code, but may change in the future for a more
flexible approach.
With this new feature it's also possible for the user to issue two nipe start
calls with different configuration files, creating conflitant firewall rules.
Because of that a locking file scheme was used to make sure nipe is called
only once and the "stop" call also terminates only the tor instance actually
created by Nipe. Therefore, the user may have a tor instance running in
parallel with nipe's specific instance.
Allow the user inform the location he would like to install nipe's tor config
file in the system through a command line flag speific to 'install' option:
./nipe.pl install -c $HOME/.nipe_torrc
...
[.] Writing Nipe's custom Tor config file
[.] .configs/fedora-torrc -> /home/user/.nipe_torrc
With that it's possible the user to maintain multiple configurations in the
same system. Possibly allowing future support of multiple tor instances.
It's a good practice to let a already existent configuration file untouched,
letting the user to decide if the new tool should or not overwrite. This patch
adds this option via a command line flag specific to the "install" option:
$ ./nipe.pl install -f
...
[.] Overwriting system Tor's config file
[.] .configs/fedora-torrc -> /etc/tor/torrc
Otherwise, he's notified about the possibility to use one of the configuration
files present in the project's home dir.
$ ./nipe.pl install
...
[.] Refer to our custom Tor config files in project home
NOTE: It can be further enhanced in future version of the tool.