stuff to do
===========


* build-depends upon obsolete gcc-13.  that's wrong.  fixing that is not trivial:

 FTBFS

joostvb@agni:~/lo...blicfile/publicfile-0.52% echo gcc-13 -O2 > conf-cc ; echo gcc-13 -s > conf-ld
joostvb@agni:~/lo...blicfile/publicfile-0.52% make

str_len.o str_rchr.o str_start.o
./load auto-str substdio.a error.a str.a
/usr/bin/ld: errno: TLS definition in /lib/x86_64-linux-gnu/libc.so.6 section .tbss mismatches non-TLS reference in substdio.a(substdo.o)
/usr/bin/ld: /lib/x86_64-linux-gnu/libc.so.6: error adding symbols: bad value
collect2: error: ld returned 1 exit status
make: *** [Makefile:21: auto-str] Error 1
joostvb@agni:~/lo...blicfile/publicfile-0.52%

(sid)joostvb@agni:~/lo...blicfile/publicfile-0.52% patch -p1 < ~/git/publicfile/debian/patches/errno.patch
patching file error.h
patching file leapsecs_read.c

joostvb@agni:~/lo...blicfile/publicfile-0.52% make

joostvb@agni:~/lo...blicfile/publicfile-0.52% ./httpd < /dev/null

(sid)joostvb@agni:~/lo...blicfile/publicfile-0.52% ./httpd </dev/null
(sid)joostvb@agni:~/lo...blicfile/publicfile-0.52%

dus: op "Debian GNU/Linux 13 (trixie)" , en op forky/sid van jan 25, 2026

met gcc-13 en _alleen_ de errno.patch
bouwt t.

other ideas:

    -D_POSIX_C_SOURCE=200809L ....
 -std=c99



* FTBFS @ salsa.d.o pipeline as of сре, 17. дец 2025.  15:07:54 CET
    pipeline #897930 : OK (July 2025)
    pipeline #991936 : FAIL (Dec 2025)


* пет,  2. јан 2026.  13:21:08 CET

dealing with "#1098807: ITP: publicfile -- http and ftp server by Daniel J.
Bernstein"

it entered https://ftp-master.debian.org/new.html at 13 july 2025 .

see also https://salsa.debian.org/newgateway-team


Date: Sun, 21 Dec 2025 18:31:13 -0500
From: Reinhard Tartler <siretart@d.o>
To: joostvb
Cc: 1098807@bugs.debian.org
Subject: Bug#1098807: RFP: publicfile -- http and ftp server by Daniel J. Bernstein
Message-ID: <87y0mvcszi.fsf@tauware.de>

I wonder why "after all these years" nobody stepped up and decided to
continue development? Surely, we all want well-maintained software that
keeps up with the many changes in requirements and infrastructure
modernizations these days, no?

[...]


joostvb wrote:
> rt wrote:
>> On a personal note? Do you expect further updates and releases of
>> publicfile?  How frequently do you expect them to happen, and what
>> licensing terms do you expect them to be placed on?
>
> No, I don't expect any further upstream updates.  I plan to keep
> adjusting the software so that it keeps running fine on Debian.

Have you considered just declaring yourself as the new upstream, and
relicense the 0.5.2 version under a proper license, such as BSD or
Expat? (If upstream were active, one could call that a "fork", not sure
that'd be an accurate depiction here). I honestly think that would be so
much clearer from a license review standpoint, and also for you as
prospective maintainer.

My main concern right now with those patches is that their license is
very unclear. As (new) upstream author, I would not accept them as is,
but ask contributors to be explicit about the redistribution terms.

For the Debian project, I would find such a "forked" package much more
valuable as it avoids unclear licensing terms, and conveys a strong
message around commitment on the package.





* сре,  9. јул 2025.  09:45:17 CEST :

    FIXME our build should honor $(CPPFLAGS) and $(CFLAGS) for debian
    hardening stuff.  See -D_FORTIFY_SOURCE and e.g. #1091671 and "blhc"

   @ https://salsa.debian.org/debian/publicfile/-/pipelines/889865 , blhc:
   "No compiler commands!" and: pass

   dh_dwz -a
    dwz: debian/publicfile/usr/bin/ftpd: .debug_info section not present
    dwz: debian/publicfile/usr/bin/httpd: .debug_info section not present
    dwz: debian/publicfile/usr/lib/publicfile/configure: .debug_info
     section not present
    dwz: Too few files for multifile optimization
    dh_dwz: warning: No dwz multifile created, but not explicitly requested
     either so ignoring it.
    dh_dwz: warning: Common issues include no debug information at all
     (missing -g) and
    dh_dwz: warning: compressed debug information (#931891).

* 

Sun May 7 23:53:03 CEST 2000
    Announced libdjb on freshmeat.
    included fifo_make in unix.a
    included man pages from earlier versions of Dan's programs 
 @ https://www.fefe.de/djb/news.html

https://www.fefe.de/djb/djb-0.5.2.tar.bz2

joostvb@oganj:~/lo...~/local/src/fefe-djb/djb% find . -type f | grep '\.3'

geen .1 of andere .nummertjes

* Mention https://github.com/cbiffle/httpd1 somewhere: reimplementation of
  publicfile ideas in Rust; see also
  http://cliffle.com/blog/publicfile-patches/ .

* as quote below:

  • William Baxter wrote ucspi-ssl, along with a small patch to publicfile to
    get it to answer https queries.

* W: publicfile source: out-of-date-standards-version 3.9.8 (current is 4.1.1)

: implement:

build reproducibly, see 4.15

4.9.1 : DEB_BUILD_OPTIONS "nodoc"

for 4.0.0: check:

9.3.2
   New optional "try-restart" standard init script argument, which (if
   supported) should restart the service if it is already running and
   otherwise just report success.

9.3.2
   Support for the "status" init script argument is recommended.

9.3.3.2
   Packages must not call "/etc/init.d" scripts directly even as a
   fallback, and instead must always use "invoke-rc.d" (which is
   essential and shouldn’t require any conditional).

* debian/README.Debian : add notes like:

The author of the Debian package suggests symlinks like this:

 joostvb@nusku:~% ls -l /srv
 total 8
 lrwxrwxrwx  1 root    root    1 јан 10 17:26 0 -> ./
 drwxr-xr-x 29 joostvb root 4096 јан  3 18:26 audio/
 drwxr-xr-x  5 root    root   63 јан 10 17:30 data/
 lrwxrwxrwx  1 root    root    1 јан 10 17:24 ftp -> ./
 -rw-r--r--  1 root    root 1114 јан 10 17:29 index.html
 lrwxrwxrwx  1 root    root    1 јан 10 17:24 localhost -> ./
 lrwxrwxrwx  1 root    root    1 јан 10 17:24 nusku.lan -> ./
 lrwxrwxrwx  1 root    root    1 јан 10 17:26 www -> ./

 root@nusku:~# ls -l /etc/service/httpd/log
 total 8
 lrwxrwxrwx 1 root    root      25 дец 27 20:08 main -> /var/log/publicfile/httpd/
 -rwxr-xr-x 1 root    root      81 дец 27 20:08 run*
 -rw-r--r-- 1 www-log nogroup 1001 јан 18 10:51 status
 drwx--S--- 2 root    root      74 јан 17 09:57 supervise/

It should create log files like

 root@nusku:~# ls -ltr /var/log/publicfile/httpd
 total 356
 -rw------- 1 www-log nogroup     0 дец 27 20:10 lock
 -rw-r--r-- 1 www-log nogroup  8816 дец 28 15:39 @4000000054a016491a03a524.u
 -rwxr--r-- 1 www-log nogroup 98004 јан 10 17:33 @4000000054b1546b38bd1004.s*
 -rw-r--r-- 1 www-log nogroup 13881 јан 10 17:34 @4000000054b2da0832533784.u
 -rwxr--r-- 1 www-log nogroup 98059 јан 12 01:14 @4000000054b311ea39e5f7d4.s*
 -rw-r--r-- 1 www-log nogroup 82300 јан 12 15:40 @4000000054ba23ec3592aefc.u
 -rw-r--r-- 1 www-log nogroup     0 јан 17 09:57 state
 -rw-r--r-- 1 www-log nogroup 50624 јан 18 10:51 current

 lrwxrwxrwx 1 root root  8 дец 28 15:59 /etc/publicfile/file -> /srv/www/
 lrwxrwxrwx 1 root root 21 дец 27 20:10 /etc/service/httpd -> /etc/publicfile/httpd/

#/etc/publicfile/file
#/etc/publicfile/file/0/foo.html
#/etc/publicfile/file/www.heaven.af.mil/foo.html
#/etc/publicfile/httpd
#/etc/publicfile/httpd/log/main
#/etc/publicfile/ftpd

* mime types

see debian/update-publicfile-contenttype

 dpkg-source --commit : generate a patch from current edited source tree

* utf-8 issue:

see also debian/patches/bozohttpd-20111118-utf8.patch.txt  FIXME: remove that once finished

joostvb@nusku:~% curl --verbose http://localhost/audio/201507/ 2>&1 | less

> GET /audio/201507/ HTTP/1.1
> User-Agent: curl/7.38.0
> Host: localhost
> Accept: */*

< HTTP/1.1 200 OK
< Server: publicfile
< Date: Sat, 29 Aug 2015 04:56:32 GMT
< Last-Modified: Sat, 29 Aug 2015 04:54:01 GMT
< Content-Type: text/html
< Transfer-Encoding: chunked

joostvb@perun:~% curl --verbose http://localhost/201708/ >/dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 80 (#0)
> GET /201708/ HTTP/1.1
> Host: localhost
> User-Agent: curl/7.52.1
> Accept: */*
> 
< HTTP/1.1 200 OK
< Server: publicfile
< Date: Sat, 27 Jan 2018 07:40:12 GMT
< Last-Modified: Sat, 27 Jan 2018 07:30:34 GMT
< Content-Type: text/html
< Transfer-Encoding: chunked
< 
{ [1029 bytes data]
* Curl_http_done: called premature == 0
100  1954    0  1954    0     0  80272      0 --:--:-- --:--:-- --:--:-- 81416
* Connection #0 to host localhost left intact

Wed 26 09:56 < Fruit> Content-Type: text/html; charset=UTF-8

publicfile-0.52/httpd.c :
    out_puts("Content-Type: text/html\r\n\r\n");

/usr/share/doc/publicfile/examples/autoindex/ad1810-autoindex : does not add utf-8
info in .html file

http://mdcc.cx/index.html has:

 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 
   <head>

some debian page has:

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head>
    
    Debian Contributors

jigl's picture index.html has no utf-8 info

See maybe also Jeff King patch

* honor upstream installation instructions:

Compile the publicfile programs: make
As root, install the publicfile programs in /usr/local/publicfile: make setup check

we seem to skip 'make check'  ./rts is nice, use it

* check file conflict /usr/bin/httpd
  also: inetutils-ftpd: /usr/sbin/ftpd

* FIXME: policy: 9.11
   New section documenting general requirements for alternate init
   systems and specific requirements for integrating with upstart.

Packages may integrate with these replacement init systems by providing
implementation-specific configuration information about how and when to start
a service or in what order to run certain tasks at boot time. However, any
package integrating with other init systems must also be backwards-compatible
with sysvinit by providing a SysV-style init script with the same name as and
equivalent functionality to any init-specific job, as this is the only
start-up configuration method guaranteed to be supported by all init
implementations. An exception to this rule is scripts or jobs provided by the
init implementation itself; such jobs may be required for an
implementation-specific equivalent of the /etc/rcS.d/ scripts and may not
have a one-to-one correspondence with the init scripts.

* test my requirements: index generating directory (run "make" from cron?), utf-8

 done: pics w/ right mime type (png,jpg)  (currenlty (2017-08 .. 2017-10) some pics
 are renamed from .JPG to foo.jpeg)

 done: ucspi-tcp-ipv6 takes care of ipv6

* SSL/TLS: "William Baxter wrote ucspi-ssl, along with a small patch to
  publicfile to get it to answer https queries.

* make installable @ beskar

* announce work in #122614

*

root@nusku:/etc/service# ln -s /etc/publicfile/httpd
root@nusku:/etc/service# ln -s /etc/publicfile/ftpd

sudo /usr/sbin/runsvdir-start

put  /usr/sbin/runsvdir-start 's

runsvdir -P /etc/service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'

in a service unit file

man systemd.unit

fix FIXME's

add some info from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=122614#40 to docs

----

document this

/usr/lib/publicfile/configure www-data www-log /tmp/publicfile foo localhost

creates, under /tmp/publicfile :

drwxr-sr-x 3 root    root     40 дец 25 14:40 file/
drwxr-sr-x 2 root    root      6 дец 25 14:40 file/0/
lrwxrwxrwx 1 root    root      1 дец 25 14:40 file/foo -> 0/
lrwxrwxrwx 1 root    root      1 дец 25 14:40 file/localhost -> 0/
drwx--S--T 3 root    root     26 дец 25 14:40 ftpd/
drwxr-sr-x 3 root    root     40 дец 25 14:40 ftpd/log/
drwxr-sr-x 2 www-log nogroup   6 дец 25 14:40 ftpd/log/main/
-rwxr-xr-x 1 root    root     81 дец 25 14:40 ftpd/log/run*
-rw-r--r-- 1 www-log nogroup   0 дец 25 14:40 ftpd/log/status
-rwxr-xr-x 1 root    root    161 дец 25 14:40 ftpd/run*
drwx--S--T 3 root    root     26 дец 25 14:40 httpd/
drwxr-sr-x 3 root    root     40 дец 25 14:40 httpd/log/
drwxr-sr-x 2 www-log nogroup   6 дец 25 14:40 httpd/log/main/
-rwxr-xr-x 1 root    root     81 дец 25 14:40 httpd/log/run*
-rw-r--r-- 1 www-log nogroup   0 дец 25 14:40 httpd/log/status
-rwxr-xr-x 1 root    root    137 дец 25 14:40 httpd/run*

debug log
=========

joostvb@perun:/etc...le/file/localhost/201708% pwd
/etc/publicfile/file/localhost/201708
joostvb@perun:/etc...le/file/localhost/201708% export PATH=$PATH:/usr/share/doc/publicfile/examples/autoindex

chokes on directories with space in name

joostvb@perun:/etc...le/file/localhost/201708% ls -d Rach* | while read d; do mv "$d" "`echo $d | sed 's/ /_/g'`"; done

joostvb@perun:~% w3m -dump http://localhost/201708/The_Fall/2008-Imperial_Wax_Solvent/
Index of 2008-Imperial_Wax_Solvent/

 size  last-changed      name
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

 4,0K  2018-01-27 08:31  ./
  139  2018-01-27 08:31  ../
  18M  2018-01-26 12:38  01-Alton_Towers.flac
  22M  2018-01-26 12:38  02-Wolf_Kidult_Man.flac
  68M  2018-01-26 12:38  03-50_Year_Old_Man.flac
  18M  2018-01-26 12:38  04-Ive_Been_Duped.flac
  34M  2018-01-26 12:38  05-Strangetown.flac
  18M  2018-01-26 12:38  06-Taurig.flac
  19M  2018-01-26 12:38  07-Can_Can_Summer.flac
  24M  2018-01-26 12:38  08-Tommy_Shooter.flac
  19M  2018-01-26 12:38  09-Latch_Key_Kid.flac
  12M  2018-01-26 12:38  10-Is_This_New.flac
  19M  2018-01-26 12:38  11-Senior_Twilight_Replacer.flac
  16M  2018-01-26 12:38  12-Exploding_Chimney.flac
  310  2018-01-27 08:31  index.html

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
generated by ad1810-autoindex on perun.local.network on суб, 27. јан 2018.
08:31:05 CET

that's ok

however, firefox displays corrupt utf8



http://publicfile.org/
======================

w3m -dump http://publicfile.org/ ->

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

[pub]publicfile home page

publicfile is a system for publishing public files. It implements an http server
and ftp server. It is secure, reliable, small, fast, etc etc etc. Just like all
of Dan Bernstein's tools. Dan has his own page for publicfile. We've got this one
so we can distribute our enhancements to publicfile.

Dan has a mailing list for publicfile. The Aims Group has an archive.

A few people have contributed enhancements:

  • Giles Lean wrote a patch which makes it send redirects instead of "404 access
    denied" when directories are requested without a trailing slash.
  • Uwe Ohse wrote FTPcopy, a tool to mirror a publicfile site.
  • Camiel Dobbelaar wrote a patch to publicfile which removes EPLF support and
    replaces it with a /bin/ls FTP listing, or something that looks like it
    anyway.
  • Mark Peloquin wants his EPLF sorted.
  • Uwe Ohse has a patch to get file types from a set of environment variables.
    This may be used very profitably with daemontools' envdir program.
  • William Baxter wrote some derivative http servers based on the publicfile
    code. This includes a CGI server, a constant file server, and a redirect
    server.
  • Mike DuChene has a patch to publicfile which gives it write capability under
    the user's uid. It uses checkpassword for authentication.
  • SHINYAMA Yusuke has a patch to publicfile which also gives it write
    capability, but it doesn't switch userids, doesn't run as root, is chrooted,
    and only allows users to store a file.
  • Bruce Guenter has an otherwise-unrelated ftp daemon called twoftpd which uses
    checkpassword for authentication. It's not a derivative of publicfile.
  • Laurent G. Bercot has withdrawn skahttpd from distribution. He encourages
    people to use fnord instead.
  • Jay Soffian has written a patch to allow for Basic Auth.
  • William Baxter wrote ucspi-ssl, along with a small patch to publicfile to get
    it to answer https queries.
  • custom error messages and directory redirection support for publicfile 0.52.
    Custom html pages may be displayed instead of the default one-line error
    messages given by default. In addition, user omission of the trailing slash
    has been forgiven. Read the notes located at the head of the patch.
  • Tivano has three publicfile patches:

    publicfile-0.52-gzip-1.patch
        This patch enables "Content-Encoding" (gzip). If there is a compressed
        copy of the file available, it is returned instead of the uncompressed
        version, saving some bandwidth.
    publicfile-0.52-http10keepalive.patch
        This patch enables persistent connections for HTTP/1.0 requests as
        described in RFC 2616 section 19.6.2.
    publicfile-0.52-commonlog-2.patch
        This patch makes publicfile's httpd write additional log lines in
        Apache's common or combined format.

  • Jeff King has written a patch to allow publicfile's content-type determining
    mechanism to follow symbolic links before examining a filename. The goal is
    to avoid ugly URLs like http://host/foo.content=type; instead, I want http://
    host/foo with the correct content-type.

Publicfile's ftp server uses a documented listing format which is designed to be
parsed. Some ftp clients have been modified to parse this format. Some have
patches to help them grokk it:

  • Felix von Leitner -- ncftp-3.1.1
  • Russ Nelson -- wget-1.5.2
  • Martin Hedenfalk -- His Yet Another FTP Client supports EPLF natively.
  • Alexander Lukyanov's lftp
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Russell Nelson
Last modified: Fri Apr 27 10:49:09 EDT 2007
