Skip to content

Commit

Permalink
Version++ doc++ cpan version fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtoobii committed Jan 22, 2021
1 parent df27e5d commit 33d58e8
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 31 deletions.
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.1.2 2021-01-22 Tobias Bossert (tobib at cpan.org)
- fix: Required perl version in Makefile.PL
- changed: doc upgrades and fixes

0.1.1 2021-01-21 Tobias Bossert (tobib at cpan.org)
- Small QoL-changes (dist)

Expand Down
2 changes: 1 addition & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ WriteMakefile(
"bin/wg-meta"
],
META_MERGE => {
requires => { perl => '5.20' },
requires => { perl => '5.020000' },
resources => {
license => 'https://opensource.org/licenses/mit',
repository => 'https://github.com/sirtoobii/wg-meta',
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.1
0.1.2
2 changes: 1 addition & 1 deletion bin/wg-meta
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

=head1 NAME
wg-meta - A CLI interface to manage Wireguard using Perl
wg-meta - CLI interface to manage Wireguard using Perl
=head1 DESCRIPTION
Expand Down
4 changes: 2 additions & 2 deletions lib/Wireguard/WGmeta.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ An approach to add metadata to the main wireguard config, written in Perl.
=head1 UNDER THE HOOD
The main advantage is that this tool is not dependent on any other storage, metadata is stored inside the corresponding
I<wgXX.conf> file (Metadata is prefixed with I<#+>):
Unlike similar projects, this toolkit is not not dependent on any other storage system, metadata is stored dirctly inside the corresponding
C<wgXX.conf> file (Metadata is prefixed with C<#+>):
[Interface]
#+Alias = some_alias
Expand Down
2 changes: 1 addition & 1 deletion lib/Wireguard/WGmeta/ValidAttributes.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=head1 NAME
WGmeta::ValidAttributes - Supported attributes configurations
WGmeta::ValidAttributes - Supported attribute configurations
=head1 DESCRIPTION
Expand Down
17 changes: 7 additions & 10 deletions lib/Wireguard/WGmeta/Wrapper/Bridge.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=head1 NAME
WGmeta::Wrapper::Bridge - Interface with shell using (linux only!)
WGmeta::Wrapper::Bridge - Interface with shell using IPC::Open3
=head1 METHODS
Expand Down Expand Up @@ -39,7 +39,7 @@ sub gen_keypair() {
}
=head2 get_pub_key($priv_key)
Runs I<wg pubkey> on C<$priv_key>.
Runs C<wg pubkey> on C<$priv_key>.
B<Parameters>
Expand All @@ -62,7 +62,7 @@ sub get_pub_key($priv_key){
return $out[0];
}

=head2 get_wg_show([$cmd])
=head2 get_wg_show()
Runs C<wg show dump> and captures the output into str_out and str_err.
Expand All @@ -75,11 +75,8 @@ B<Returns>
First array of STD_OUT
=cut
sub get_wg_show($cmd = undef) {
unless (defined($cmd)) {
$cmd = 'wg show dump';

}
sub get_wg_show() {
my $cmd = 'wg show dump';
my (@out, undef) = run_external($cmd);
chomp @out;
return @out;
Expand All @@ -99,7 +96,7 @@ C<$command_line> Complete commandline for the external program to execute.
=item *
C<[$input = undef]> If defined, this is feed into STD_IN of the C<$command_line>.
C<[$input = undef]> If defined, this is feed into STD_IN of C<$command_line>.
=item *
Expand All @@ -113,7 +110,7 @@ Exception if return code is not 0 (if C<$soft_fail> is set to true, just a warni
B<Returns>
Returns two lists if all lines of I<STDout> and I<STDerr>
Returns two lists with all lines of I<STDout> and I<STDerr>
=cut
sub run_external($command_line, $input = undef, $soft_fail = FALSE) {
Expand Down
17 changes: 7 additions & 10 deletions lib/Wireguard/WGmeta/Wrapper/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ WGmeta::Wrapper::Config - Class for interfacing the wireguard configs
=head1 DESCRIPTION
This class serves as wrapper around the Wireguard configurations files.
It is able to parse, modify, add and write Wireguard .conf files. In addition, support for metadata is built in. As a small
bonus, the parser and encoder are exported ar usable as standalone methods
It is able to parse, modify, add and write Wireguard I<.conf> files. In addition, support for metadata is built in. As a small
bonus, the parser and encoder are exported and usable as standalone methods
=head1 EXAMPLES
Expand All @@ -35,7 +35,7 @@ bonus, the parser and encoder are exported ar usable as standalone methods
# disable peer (this comments out the peer in the configuration file
wg_meta->disable_by_alias('wg0', 'some_fancy_alias');
# write config (if parameter is set to True, the config is overwritten, if set to False the resulting file is suffixed with '_dryrun'
# write config (if parameter is set to True, the config is overwritten, if set to False the resulting file is suffixed with '_not_applied'
wg_meta->commit(1);
=head1 METHODS
Expand Down Expand Up @@ -77,7 +77,7 @@ use constant IS_NORMAL => 3;

=head3 new($wireguard_home [, $wg_meta_prefix = '#+', $wg_meta_disabled_prefix = '#-'])
Creates a new instance of this class. Default wg-meta attributes: 'Name' and 'Alias'.
Creates a new instance of this class.
B<Parameters>
Expand Down Expand Up @@ -155,8 +155,7 @@ C<$attribute> Attribute name (Case does not not matter)
=item *
C<[$allow_non_meta = FALSE]> If set to TRUE, non wg-meta attributes are not forwarded to `wg set`.
However be extra careful when using this, just the attribute names are validated but not the data!
C<[$allow_non_meta = FALSE]> If set to TRUE, non wg-meta attributes are not forwarded to C<$forward_function>.
=item *
Expand Down Expand Up @@ -315,7 +314,7 @@ sub set_by_alias($self, $interface, $alias, $attribute, $value, $allow_non_meta

=head3 disable($interface, $identifier)
Disables a peer
Disables an interface/peer (by prefixing C<$wg_meta_disabled_prefix>) and setting the wg-meta attribute `Disabled` to C<1>.
B<Parameters>
Expand Down Expand Up @@ -535,7 +534,7 @@ However, does only exist if this section has been enabled/disabled once.
=item *
To check wether a file is actually a Wireguard interface config, the parser first checks the presence of the string
To check whether a file is actually a Wireguard interface config, the parser first checks the presence of the string
I<[Interface]>. If not present, the file is skipped (without warning!).
=back
Expand Down Expand Up @@ -1110,8 +1109,6 @@ sub add_interface($self, $interface_name, $ip_address, $listen_port, $private_ke
Adds a peer to an exiting interface.
B<Caveat:> No validation is performed on the values!
B<Parameters>
=over 1
Expand Down
12 changes: 7 additions & 5 deletions lib/Wireguard/WGmeta/Wrapper/Show.pm
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ WGmeta::Wrapper::Show - Class for parsing the `wg show dump` output
=head1 DESCRIPTION
This class contains a parser for the output of C<wg show dump> together with an interface to retrieve the parsed data.
An important note tough: This class does not perform the necessary I/O by itself and therefore the actual output of the command
C<wg show dump> has to be captured into a string externally (e.g using L<Wireguard::WGmeta::Wrapper::Bridge/get_wg_show([$cmd])>).
An important note: This class does not perform the necessary I/O by itself and therefore the output of the command
C<wg show dump> has to be captured into a string externally (e.g using L<Wireguard::WGmeta::Wrapper::Bridge/get_wg_show()>).
=head1 EXAMPLES
Expand Down Expand Up @@ -82,7 +82,7 @@ sub new($class, $wg_show_dump) {

=head3 wg_show_dump_parser($input)
Parser for the output of C<wg show dump>. Aims to create a compatible structure as
Parser for the output of C<wg show dump>. Aims to create a compatible with:
L<Wireguard::WGmeta::Wrapper::Config/read_wg_configs($wireguard_home, $wg_meta_prefix, $disabled_prefix)>:
{
Expand Down Expand Up @@ -126,6 +126,8 @@ A reference to a hash with the structure described above.
sub wg_show_dump_parser($input) {
my $interface = '';
my $parsed_show = {};

# ToDo: Make use of WGmeta::ValidAttributes
my @keys_interface = qw(interface private-key public-key listen-port fwmark);
my @keys_peer = qw(interface public-key preshared-key endpoint allowed-ips latest-handshake transfer-rx transfer-tx persistent-keepalive);
for my $line (split /\n/, $input) {
Expand Down Expand Up @@ -196,7 +198,7 @@ B<Parameters>
=item
C<$interface> A valid interface name, optimally retrieved through L</get_interface_list()>.
C<$interface> A valid interface name, ideally retrieved through L</get_interface_list()>.
=item
Expand Down Expand Up @@ -228,7 +230,7 @@ B<Parameters>
=item
C<$interface> A valid interface name, optimally retrieved through L</get_interface_list()>.
C<$interface> A valid interface name, ideally retrieved through L</get_interface_list()>.
=back
Expand Down

0 comments on commit 33d58e8

Please sign in to comment.