about summary refs log tree commit homepage
path: root/lib
DateCommit message (Collapse)
2016-02-29distinguish error messages intended for users vs developers
For error messages intended to show user error (e.g. giving invalid options), we add a newline ("\n") at the end to polluting the output with location information. However, for diagnosing non-user-triggered errors, we should show the location of where the error occured.
2016-02-29http: avoid needless time2str calls
Checking the time is nearly free on modern systems with vDSO/vsyscall/similar while sprintf is always expensive.
2016-02-29http: document event_write usage
It may not be obvious where we are when we enter the event_write callback. Hopefully this clarifies things.
2016-02-29http: error check for sysseek on input
Just in case we screwed up somewhere, we need to match up syswrite to sysseek and we also favor procedural calls for native types.
2016-02-28spawnpp: die instead of exit on exec failure
Perl may complain about exit not being executed, but not die.
2016-02-28newswww: set Content-Type properly
Oops :x
2016-02-28http: support graceful shutdown like nntp
HTTP responses may be long-running or requests may be slow or pipelined. Ensure we don't kill them off prematurely.
2016-02-28reduce calls to close unless error checks are needed
We can rely on timely auto-destruction based on reference counting; reducing the chance of redundant close(2) calls which may hit the wront FD. We do care about certain close calls (e.g. writing to a buffered IO handle) if we require error-checking for write-integrity. In other cases, let things go out-of-scope so it can be freed automatically after use.
2016-02-28searchidx: use defined for checking EOF behavior
While empty or "0" should never appear, this allows the reviewer to think and know less about the context in which this check is done.
2016-02-28searchmsg: update + fix license header
Not sure how, but this should've always been AGPL-3.0+ like the rest of the code, not GPL-3.0+
2016-02-28spawn: disable popen optimization for non-vfork
This is necessary since we want to be able to do arbitrary redirects via the popen interface. Oh well, we'll be a little slower for now for users without vfork. vfork users will get all the performance benefits.
2016-02-28spawnpp: fix error message for stderr redirect failing
Oops :x
2016-02-27daemon: refresh before forking
This means we always load the PSGI server code early for -httpd. This may make things less compatible with existing PSGI/Plack apps, but we prioritize our httpd for the uses of public-inbox itself, first. And any existing PSGI/Plack app which wants to may adapt themselves to being preload-friendly.
2016-02-27spawn: fail properly if Inline fails
We must stash the error correctly when nesting evals, oops :x
2016-02-27git: use built-in spawn implementation for vfork
This should reduce overhead of spawning git processes from our long-running httpd and nntpd servers.
2016-02-27initial spawn implementation using vfork
Under Linux, vfork maintains constant performance as parent process size increases. fork needs to prepare pages for copy-on-write, requiring a linear scan of the address space.
2016-02-27http: simplify offset calculation slightly
No point in comparing an empty string; length() is only potentially expensive on big strings.
2016-02-26daemon: update comment about usage in httpd
Writing a read-only IMAP server isn't out-of-scope, either, but I've never studiied the IMAP protocol, much, unlike HTTP/1.x or even NNTP.
2016-02-26www: add News* wrappers to preload
We want to preload as much as possible in -httpd when forking to save memory via CoW.
2016-02-26www: workaround for malformed NNTP links
Some linkifiers to create invalid HTTP links when it sees a link intended for NNTP services. This means we may see links to news.public-inbox.org/inbox.comp.mail.public-inbox.meta point to "http://" on port 80 instead of 119. Try to redirect users to http://public-inbox.org/meta/ in this case.
2016-02-26support protocol-relative URLs in publicinbox.$LISTNAME.url
All URL generation in dynamic HTTP pages should be capable of generating "https" or "http" URLs depending on the user's preference.
2016-02-26git-http-backend: extract input_to_file function
This will allow us to more easily read and test later.
2016-02-26extmsg: do not modify shared array via prurl
We cannot modify elements in any shared data strucutures shared between requests. Oops!
2016-02-26extmsg: allow returning 404 responses
We will be falling back and cascading to newsgroup lookups, later.
2016-02-25httpd: fill in missing Danga::Socket callbacks
Danga::Socket will die on us if we hit the base implementations.
2016-02-25git-http-backend: avoid multi-arg print statemtents
Even with output buffering disabled via IO::Handle::autoflush, writes are not atomic unless it is a single argument passed to "print". Multiple arguments to "print" will show up as multiple calls to write(2) instead of a single, atomic writev(2).
2016-02-25git-http-backend: start async API for streaming
git-http-backend may take a while, ensure we can process other requests while waiting on it. We currently do this via Danga::Socket in public-inbox-httpd; but avoid exposing this internal implementation detail to the PSGI interface and instead only expose a callback via: $env->{'pi-httpd.async'}
2016-02-25git-http-backend: start refactoring to use callback
Designing for asynchronous, non-blocking operations makes adapting for synchronous, blocking operation easy. Going the other way around is not easy, so do it now and allow us to be more easily adapted for non-blocking use in the next commit...
2016-02-25use pipe for git-http-backend output
This allows us to stream the output to the client without buffering everything up-front. Next, we'll let Danga::Socket (or AE in the future) wait for readability.
2016-02-25hval: implement common UI for protocol-relative URLs
This allows users to avoid HTTPS -> HTTP downgrade warnings, but we will also avoid encouraging them towards HTTPS, for now. IMHO: the CA system gives a false sense of security, TLS libraries (e.g. OpenSSL) can introduce new bugs and problems (even to attack clients), and TLS libraries also eats memory on cheap servers.
2016-02-25www: make interface more OO
This allows multiple instances the WWW app from running within the same process space
2016-02-25remove direct CGI.pm support
Relying on Plack::Handler::CGI is much easier for long-term maintenance and development. Nowadays, we even include our own httpd implementation to facilitate easier deployment with PSGI/Plack.
2016-02-24www: support $MESSAGE_ID/R/ endpoint for replies
Setting the "In-Reply-To:" header via mailto: links is not well-supported and should probably not be encouraged unless the client situation improves. So instead, teach users more widely-supported ways of setting the In-Reply-To: header to ensure proper threading of replies.
2016-02-24view: capture header object early
For future changes, this will allow us to more quickly notice if we keep the heavy Email::MIME object around too long. It has the side effect of avoiding extra method calls with Email::MIME which forwards header calls to the header_obj.
2016-02-23initial public-inbox-httpd implemenation
This is meant to provide an easy starting point for server admins. It provides a basic HTTP server for admins unfamiliar with configuring PSGI applications as well as being an identical interface for management as our nntpd implementation. This HTTP server may also be a generic Plack/PSGI server for existing Plack/PSGI applications.
2016-02-22extmsg: support "//" protocol-relative URLs
Avoid unintentionally switching protocols if the external site we're linking to supports both HTTP and HTTPS. We do not want to force HTTPS everywhere because potential bugs and performance problems in the TLS stack may outweigh the privacy benefits. Leave up to site authors and users to decide whether they want HTTPS or plain old HTTP.
2016-02-13www: document "git clone --mirror" usage
Not everybody is willing to install or run ssoma; but at least document "git clone --mirror" usage to promote data distribution. It's wasteful to clone without "--mirror", so we'll suggest that to avoid wasting disk space and inodes.
2016-02-13www: advertise clone-ability over http/https
All public-inbox instances shall be clone-able.
2016-02-13feed: favor relative URL to Atom feed in HTML
Normal browsers should understand relative path names. Atom feeds may be hosted externally and seems to need full URLs.
2016-02-08view: fix link to top-level ghost parent
In an single-message thread with a ghost parent, we need to go up level from the current Message-ID before appending the parent message to us.
2016-02-08view: simplify topic handling based on subjects
Dropping "[FOO]" prefixes for the purposes of summarization is tricky and we end up with odd display behavior. Just show Subject line changes as the writer intended (with the exception of normalization to strip the "Re: ")
2016-02-08feed: declare alternate link to HTML interface
It seems we need to declare "alternate" and "text/html" at least for feed readers.
2016-02-07support smart HTTP cloning
This requires POST and (small file) upload support from the PSGI/Plack web server. CGI.pm is currently not supported with this feature. We'll serve everything git can handle by default for performance in the general case. To avoid introducing cognitive overhead for sysadmins managing existing HTTP backends, we do not introduce new configuration directives. Thus, setting http.uploadpack=false in the relevant git config file for each public-inbox (ssoma) git repo will disable smart HTTP for CPU/memory-constrained systems. Technically we could support http.receivepack to allow posting messages to a public-inbox over HTTP(S), but that breaks the public-inbox model of encouraging users to Cc: everyone. Again, we encourage users to Cc: everyone to reduce the chance of a public-inbox becoming a centralized point of failure/censorship.
2016-02-02www: support git cloning via dumb HTTP
This is enabled by default, for now. Smart HTTP cloning support will be added later, but it will be optional since it can be highly CPU and memory intensive.
2016-02-01view: reference ghost parent in permalink view
We should not hide the parent Message-ID in this view; give the user the option to find the message in other archives.
2016-01-30view: cleanup permalink Thread: header display
The word "skip" can be confusing. Instead, spell out "scroll down" for the user to read and only display that text when the thread is sufficiently long.
2016-01-30view: do not kill whitespace in permalink thread timestamp
There's no need to HTML escape a timestamp we generate ourselves. We need to preserve the leading space and can't use the "oneline" semantics to preserve alignment.
2016-01-18view: explain why we do not use blockquote
Inevitably, somebody will care about semantic HTML; but preserving the original intent of the email author is important.
2016-01-09www: fix redirection loops
Sometimes users forget trailing slashes; but we should not punish them with infinite loops.
2016-01-09view: fix Atom feed link in full message view page
Oops :x