=head1 NAME

Wireguard::WGmeta::Index - A toolkit to manage Wireguard configurations.

=head1 DESCRIPTION

An approach to add metadata to the main wireguard config, written in Perl.

=head1 HIGHLIGHTS

=over 1

=item *

Compatible with your existing setup (no configuration changes needed).

=item *

A CLI interface with abilities to I<set>, I<enable>, I<disable>, I<apply>, I<add> and I<remove> your wireguard config(s).

=item *

A fancy C<show> output which combines the meta-data, running-config and static-configs. Now also available in a machine readable format

=item *

Modular structure: Both parsers/writers are independent - and therefore can be used as a standalone library.

=item *

Built-in concurrent access support!

=item *

No external dependencies, runs on plain Perl (>=v5.20)!

=back

=head1 ENVIRONMENT VARIABLES

=over 1

=item *

B<WIREGUARD_HOME>: Directory containing the Wireguard configuration -> Make sure the path ends with a `/`. Defaults to I</etc/wireguard/>.

=item *

B<WGmeta_NO_WG>: If defined no actual C<wg *> commands are run

=item *

B<IS_TESTING>: When defined, it has the following effects:

=over 2

=item *

No external commands are run, all data required is obtained from C<t/test_data>. Also very useful for developing

=item *

<Commands::Set|Enable|Disable> omits the header of the generated configuration files.

=item *

Line of code is shown for warnings and errors.

=back

=item *

B<WG_NO_COLOR>: If defined, the show command does not prettify the output with colors.

=back

=head1 TECH DOCUMENTATION

=over

=item *

L<Wireguard::WGmeta::Parser::Conf> - Wireguard configuration parser with support of custom attributes. Only useful
with a "middleware" implementing the two required callbacks e.g L<Wireguard::WGmeta::Parser::Middleware>

=item *

L<Wireguard::WGmeta::Parser::Show> - C<wg show dump> parser.

=item *

L<Wireguard::WGmeta::Wrapper::Config> - Wrapper class for reading/writing and modifying wireguard configurations and as well handle metadata.

=item *

L<Wireguard::WGmeta::Wrapper::ConfigT> - Specialized wrapper class supporting concurrent access.

=item *

L<Wireguard::WGmeta::Wrapper::Show> - Wrapper class around C<wg show dump> output.

=item *

L<Wireguard::WGmeta::Cli::Router> - Entry point for the CLI

=item *

L<Wireguard::WGmeta::ValidAttributes> - Configurations for all supported attributes.

=back

=cut

=head1 AUTHORS

Since there is a lot of spam flooding my mailbox, I had to put spam filtering in place. If you want to make sure
that your email gets delivered into my mailbox, include C<#im_not_a_bot#> in the B<subject!>

S<Tobias Bossert E<lt>tobib at cpan dot orgE<gt>>

=head1 THANKS TO

L<OETIKER+PARTNER AG|https://www.oetiker.ch/> for sponsoring this project.

=head1 COPYRIGHT AND LICENSE

MIT License

Copyright (c) 2021 Tobias Bossert

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


