🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #92752

Re: csiph.com

#92752
From: Kevin Bowling
Date: Tue, 05 May 2026 09:01
165 lines
7362 bytes
On 5/3/26 12:20 PM, Julien ÉLIE wrote:
> Hi Kevin,
> 
>> My goal is to replace/displace Google Groups
> 
> I really hope you'll manage to provide such a useful alternative!
> 
> I see that the URLs contain article numbers, which may change in case of 
> a renumbering (it may happen one day, who knows).  It could be 
> interesting to have a permanent link feature with a URL containing the 
> Message-ID.

Added

> 
>> I probably have to reindex at least once more as I fixed some date 
>> parsing stuff
> 
> Did you try to use a library like https://docs.rs/dateparser/latest/ 
> dateparser/ which seems to handle lots of date formats?

I checked a few but none of them handle the real world corpus.  In my 
NNTP library I currently have the following, I'm sure it is missing a 
lot but it seems easy to extend/maintain:

/// Lenient Usenet date parser.
///
/// Usenet articles (especially pre-2000) use many date formats that
/// `chrono::DateTime::parse_from_rfc2822` rejects:
///
/// - Named timezones: `Mon, 27 Apr 1993 10:30:00 EST`
/// - Missing seconds: `Mon, 27 Apr 1993 10:30 +0000`
/// - 2-digit years: `27 Apr 93 10:30:00 GMT`
/// - C asctime: `Mon Apr 27 10:30:00 1993`
/// - No day-of-week: `27 Apr 1993 10:30:00 +0000`
///
/// This function normalizes the most common issues before parsing.
#[cfg(feature = "chrono")]
pub fn parse_usenet_date(s: &str) -> 
Option<chrono::DateTime<chrono::FixedOffset>> {
     use chrono::{DateTime, NaiveDateTime};

     // Fast path: strict RFC 2822.
     if let Ok(dt) = DateTime::parse_from_rfc2822(s) {
         return Some(dt);
     }

     // Normalize: replace named timezone abbreviations with numeric 
offsets.
     let normalized = replace_named_tz(s);
     if let Ok(dt) = DateTime::parse_from_rfc2822(&normalized) {
         return Some(dt);
     }

     // Try common format variants with explicit patterns.
     let patterns = [
         // With day-of-week, no seconds: "Mon, 27 Apr 1993 10:30 +0000"
         "%a, %d %b %Y %H:%M %z",
         // Without day-of-week: "27 Apr 1993 10:30:00 +0000"
         "%d %b %Y %H:%M:%S %z",
         // Without day-of-week, no seconds: "27 Apr 1993 10:30 +0000"
         "%d %b %Y %H:%M %z",
         // 2-digit year with day-of-week: "Mon, 27 Apr 93 10:30:00 +0000"
         "%a, %d %b %y %H:%M:%S %z",
         // 2-digit year without day-of-week: "27 Apr 93 10:30:00 +0000"
         "%d %b %y %H:%M:%S %z",
         // 2-digit year with day-of-week, no seconds: "Mon, 27 Apr 93 
10:30 +0000"
         "%a, %d %b %y %H:%M %z",
         // 2-digit year without day-of-week, no seconds: "27 Apr 93 
10:30 +0000"
         "%d %b %y %H:%M %z",
     ];
     for pat in &patterns {
         if let Ok(dt) = DateTime::parse_from_str(&normalized, pat) {
             return Some(dt);
         }
     }

     // C asctime format: "Mon Apr 27 10:30:00 1993" — no timezone info,
     // assume UTC (the best we can do without context).
     if let Ok(naive) = NaiveDateTime::parse_from_str(s.trim(), "%a %b 
%d %H:%M:%S %Y") {
         return Some(naive.and_utc().fixed_offset());
     }

     None
}

/// Replace common named timezone abbreviations with numeric UTC offsets.
#[cfg(feature = "chrono")]
fn replace_named_tz(s: &str) -> String {
     // Match the last whitespace-delimited token as a potential TZ name.
     let s = s.trim();
     let Some(last_space) = s.rfind([' ', '\t']) else {
         return s.to_owned();
     };
     let (prefix, tz) = s.split_at(last_space);
     let tz = tz.trim();

     let offset = match tz {
         "GMT" | "UTC" | "UT" => "+0000",
         "EST" => "-0500",
         "EDT" => "-0400",
         "CST" => "-0600",
         "CDT" => "-0500",
         "MST" => "-0700",
         "MDT" => "-0600",
         "PST" => "-0800",
         "PDT" => "-0700",
         "BST" => "+0100",
         "CET" | "MET" => "+0100",
         "CEST" | "MEST" => "+0200",
         "EET" => "+0200",
         "EEST" => "+0300",
         "JST" => "+0900",
         "KST" => "+0900",
         "IST" => "+0530", // India; ambiguous (also Ireland +0100, 
Israel +0200)
         "HKT" => "+0800",
         "AEST" => "+1000",
         "AEDT" => "+1100",
         "NZST" => "+1200",
         "NZDT" => "+1300",
         "HST" => "-1000",
         "AKST" => "-0900",
         "AKDT" => "-0800",
         "SAST" => "+0200",
         _ => return s.to_owned(),
     };
     format!("{prefix} {offset}")
}
> 
> Regarding searches, how is the language taken into account?
> Searching "Usenet" with French languages give me articles written in 
> English.
>    http://csiph.com/search?q=usenet&lang=fr

Right now it is just altering the term stemmer.

I need to hook up language detection and heuristics during indexing and 
store it as a document parameter to make it useful.  That will make it 
possible to support a lot more languages but I will need to think about 
how they map to stemming, I guess if a language supports stemming it 
will use it if not it will just use the query term as is.  Added to my 
list of things to do.

> How often do you run innreport?  It seems to be started automatically at 
> 04:15 but not every day?
>    http://csiph.com/innreport/

The current problem is expireover takes around the gap you see to 
complete.  I suspect there was some regression in OpenZFS performance 
around 2021 but I never dug into it that really hurts this file at a 
time workload.  I would like to look into both sides of that at some 
point, and using some POSIX API to get some parallelism would map well 
to all storage devices and file systems.

In the mean time I found a new ZFS feature called a special device.  I 
had a pair of enterprise SSDs in the server that were used for SLOG and 
L2ARC (cache).  I was able to remove the L2ARC and turn it into a 
special, then use zfs rewrite so it is currently moving all 
files/records 64k or less to the SSDs.  I have the ovsqlite record size 
set to 64k as well so it should improve performance quite a bit when the 
rewrite completes.
Technical Details
Message-ID: <10tcblc$2v4q$1@csiph.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!spool1.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!weretis.net!feeder9.news.weretis.net!csiph.com!.POSTED.172.83.103.228!not-for-mail
References: <10t2kh8$1a6i$1@csiph.com> <10t3h5n$1qj8q$1@dont-email.me> <10t3jk0$2c5u$1@csiph.com> <10t3lr2$1rmne$1@dont-email.me> <10t47gr$11h$1@csiph.com> <1777713315-7@newsgrouper.org> <10t4qm9$qul$1@csiph.com> <10t8760$2a1vo$1@news.trigofacile.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!spool1.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!weretis.net!feeder9.news.weretis.net!csiph.com!.POSTED.172.83.103.228!not-for-mail
From: Kevin Bowling <kevin.bowling@kev009.com>
Newsgroups: news.software.nntp
Subject: Re: csiph.com
Date: Tue, 5 May 2026 02:01:27 -0700
Organization: csiph.com Internet News Service
Message-ID: <10tcblc$2v4q$1@csiph.com>
References: <10t2kh8$1a6i$1@csiph.com> <10t3h5n$1qj8q$1@dont-email.me>
 <10t3jk0$2c5u$1@csiph.com> <10t3lr2$1rmne$1@dont-email.me>
 <10t47gr$11h$1@csiph.com> <1777713315-7@newsgrouper.org>
 <10t4qm9$qul$1@csiph.com> <10t8760$2a1vo$1@news.trigofacile.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 5 May 2026 09:01:32 -0000 (UTC)
Injection-Info: csiph.com; posting-host="172.83.103.228";
	logging-data="97434"; mail-complaints-to="admin@kev009.com"
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <10t8760$2a1vo$1@news.trigofacile.com>