From 31e045b3decde15a8e85b0254a099779ec86b91e Mon Sep 17 00:00:00 2001 From: Andinus Date: Sat, 29 Aug 2020 20:39:33 +0530 Subject: Add example config file & document it --- README | 35 +++++++++++++++++++++++++++++++++-- share/config.pl | 12 ++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 share/config.pl diff --git a/README b/README index 145e286..f946bed 100644 --- a/README +++ b/README @@ -21,5 +21,36 @@ hackers. features will be added if I use it. The feeds are saved in `$XDG_DATA_HOME/pyxis', if it's not defined - then `$HOME/.local/share/pyxis' is used. Feeds are stored in - `pyxis.pl', config file will be used later. + then `$HOME/.local/share/pyxis' is used. Feeds are configured in + `$XDG_CONFIG_HOME/pyxis.pl' or `$HOME/.config/pyxis.pl'. + + +1.1 Configuration +───────────────── + + There is an example config file under `share/config.pl', move it + config directory & rename it to `pyxis.pl'. + + *Warning*: Pyxis will evaluate the configuration file, which means an + attacker can use it to run malicious code. + + *Note*: They could always add malicious code to `.profile' & do harm. + Just thought I should put the warning. + + ┌──── + │ #!/usr/bin/perl + │ + │ use strict; + │ use warnings; + │ + │ my %feeds = ( + │ example => "https://example.com/twtxt.txt", + │ ); + │ + │ sub get_feeds { return %feeds; } + │ + │ 1; + └──── + + Add your feeds to `%feeds' hash like shown above. You can remove those + 2 `use' lines but it's good if you keep them. diff --git a/share/config.pl b/share/config.pl new file mode 100644 index 0000000..084eca7 --- /dev/null +++ b/share/config.pl @@ -0,0 +1,12 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +my %feeds = ( + example => "https://example.com/twtxt.txt", +); + +sub get_feeds { return %feeds; } + +1; -- cgit 1.4.1-2-gfad0