new files, fix nex-php redir to give 51 on parameters

This commit is contained in:
Alexander 2023-09-03 15:38:03 +02:00
parent 8fe2961143
commit 1bc4fbeda5
9 changed files with 109 additions and 9 deletions

45
capsule/atomfeed.gmi Normal file
View File

@ -0,0 +1,45 @@
# Creating an atom feed file to submit to antenna
I recently considered submitting articles to antenna but since I am not using a gemlog format but just create random files.
I thoght I needed to reformat my files but it is mentioned on the antenna site that you can use an atom feed file instead. I tried that and at first failed to understand what is actually accessed and after some fiddling I noticed that if the atom file is submitted, the information in the file is used and the actual article files are not even accessed by the tool.
To create an atom file with an editor, I used the file from another capsule as source and edited the fields, the xml format is pretty simple and can be done for a few articles easily. If you do not know XML, it has a few quirks, especially you have to be careful not to use characters like & < > which have to be encoded like in HTML with &amp; &lt; &gt;
The header of the file is a few lines, you only have to change the name and email and the self link, I amnot sure if the date is evaluated, I update that each time when I add a new entry.
````
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>user's atom feed</title>
<link rel="self" type="application/atom+xml" href="gemini://domain.com/feed.atom"/>
<updated>2023-08-20T11:21:00+02:00</updated>
<author>
<name>user</name>
<email>user@domain.com</email>
</author>
````
Each entry consists of the <entry> tag and a few inner tags, the text used in the list comes from the <title> tag, the <id> and <link> tags both contain the target url, I think the <id> is avaluated, I just copied it to both. <summary> is not used but it is usually in an atom file.
````
<entry>
<id>gemini://domain.com/atomfeed.gmi</id>
<title>Creating a atom feed file to submit to antenna</title>
<updated>2023-09-01T21:25:00+02:00</updated>
<summary>How to create a sample atom file to submit to antenna</summary>
<link type="text/gemini" href="gemini://domain.com/atomfeed.gmi"/>
</entry>
````
In the end you have to close the XML
````
</feed>
````
If the file is valid (check with tidy -xml), it should be accepted by antenna if you submit it via the gemini page.
An examle atom file for my page is visible on the url
=> gemini://gemini.lehmann.cx/feed.atom
This is the file I currently use to submit posts.

View File

@ -0,0 +1,7 @@
#!/usr/bin/php
<?php
echo "\n";
echo "\n";
echo "\n";

View File

@ -1,8 +1,19 @@
#!/usr/bin/php
<?php
if(isset($_SERVER['QUERY_STRING'])) {
$query=$_SERVER['QUERY_STRING'];
} else {
$query="";
}
if($query!="") {
echo "51 Service has moved (please check /cgi-bin/nex.php)\r\n";
exit;
}
echo "20 text/gemini\r\n";
?>
# nex gateway
=> nex/nex.php the script has moved to accomodate better robots.txt
=> nex/nex.php the script has moved to support robots.txt better

View File

@ -0,0 +1,6 @@
# cgi-bin folder
you likely want to use one of the scripts linked from the start page
=> /

View File

@ -1,5 +1,5 @@
#! /usr/bin/php
<?php
<?php declare(strict_types=1);
chdir("/home/lehmann/gemini-site/capsule/cgi-bin");
@ -119,7 +119,7 @@ if(strtolower(substr($path, -4, 4))==".jpg" || strtolower(substr($path, -5, 5))=
fclose($fp);
}
function combine($path, $link) {
function combine(string $path, string $link) {
if(substr($path, -1, 1)!="/") {
$path=substr($path, 0, strrpos($path, "/", -1))."/";
}

View File

@ -2,12 +2,25 @@
<feed xmlns="http://www.w3.org/2005/Atom">
<title>alexlehm's atom feed</title>
<link rel="self" type="application/atom+xml" href="gemini://gemini.lehmann.cx/feed.atom"/>
<updated>2023-08-20T11:21:00+02:00</updated>
<id>4498b4c8-c94f-4181-bbfd-3c3cfb5ab271</id>
<updated>2023-09-02T10:39:00+02:00</updated>
<author>
<name>alexlehm</name>
<email>alexlehm@gmail.com</email>
</author>
<entry>
<id>gemini://gemini.lehmann.cx/using_znc_pw.gmi</id>
<title>Issue using ZNC with multiple accounts and SASL</title>
<updated>2023-09-02T10:39:00+02:00</updated>
<summary>I messed up my IRC passwords on ZNC and how to fix it</summary>
<link type="text/gemini" href="gemini://gemini.lehmann.cx/using_znc_pw.gmi"/>
</entry>
<entry>
<id>gemini://gemini.lehmann.cx/atomfeed.gmi</id>
<title>Creating a atom feed file to submit to antenna</title>
<updated>2023-09-01T21:25:00+02:00</updated>
<summary>How to create a sample atom file to submit to antenna</summary>
<link type="text/gemini" href="gemini://gemini.lehmann.cx/atomfeed.gmi"/>
</entry>
<entry>
<id>gemini://gemini.lehmann.cx/using_socks.gmi</id>
<title>How to run gemini clients via SOCKS5 (e.g. TOR)</title>

View File

@ -25,10 +25,14 @@ The script is here
I have created a nex2gemini gateway script as CGI, it proxies the nex pages and tries to render them as gemtext pages, which gives an ok result but it is far from perfect.
=> cgi-bin/nex.php
=> cgi-bin/nex/nex.php
=> using_socks.gmi Running Gemini via SOCKS5 (to TOR)
=> atomfeed.gmi How to create a atom file to submit to antenna
=> using_znc_pw.gmi Issue using ZNC with multiple accounts and SASL
I have a few links around WWW
=> https://about.me/alexlehm about.me/alexlehm

View File

@ -1,11 +1,11 @@
# gemini.lehmann.cx web proxy
User-agent: *
Disallow: /x
Disallow: /x/
User-agent: *
Disallow: /cgi-bin/nex
Disallow: /cgi-bin/nex/
User-agent: *
Disallow: /dejavu/dejavu
Disallow: /dejavu/dejavu/

14
capsule/using_znc_pw.gmi Normal file
View File

@ -0,0 +1,14 @@
# Issue using ZNC with multiple accounts and SASL
I have been using different bouncers on different IRC networks since I got more into IRC again (with SDF and Tildechat) in the beginning of this year and switched between a ZNC and a Soju-based bouncer and I am actually using both right now since I don't want to change the configs that are working, both are working quite well, so I am not sure if I am preferring one over the other.
When configuring ZNC I had a rather random issue that caused the nickserv or SASL authentication to fail on some irc accounts and I couldn't really figure out why and when manually authenticating via Nickserv it always worked, also using cert auth usually works. Since most bouncers and irc networks are up for a long time, this is not really an issue and I simply thought, it is an intermittend issue that happens every Blue Moon (which was actually last week).
Yesterday one bouncer I use had a planned downtime and I looked at the config of the different accounts again and found why it is not working with some after checking the different config entries.
I am using Firefox to access the ZNC page and have stored the bouncer account in the Firefox password manager, this way the login is prefilled, but the setting is global so that any other password field that is in the page is prefilled as well, which includes the SASL config page which means that I overwrite the irc account password with the ZNC account password each time I save the page (which is not necessary usually, but I probably do it more often than necessary). When not doing that and setting the right password once and not storing it in the FF password list, it works as expected and it works for each network individually.
I guess it would be helpful to have an option to skip setting the password that greys out the form, but the issue is mostly due to my stupidity, so it is probably not a big issue at all. Or it could be possible to name the password forms for each network with a different id or whatever so that the stored password is not put into the wrong form.
I generally prefer using Certfp when it is supported, but if not, setting the SASL password works like that.