about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-08-29 20:39:33 +0530
committerAndinus <andinus@nand.sh>2020-08-29 20:39:33 +0530
commit31e045b3decde15a8e85b0254a099779ec86b91e (patch)
tree0102df7e1a66ecbc16f83b473c5de402a35ac959
parent4fdeba51c8d73a80120f8fc22623fe3864bea0d7 (diff)
downloadpyxis-31e045b3decde15a8e85b0254a099779ec86b91e.tar.gz
Add example config file & document it
-rw-r--r--README35
-rw-r--r--share/config.pl12
2 files changed, 45 insertions, 2 deletions
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;