News for hackers. Stuff that matters.
Re:Nweb: a tiny, safe web server (static pages only) by dfc on Monday March 31, 2014 @10:08PM (#7505719)
I am always on the look out for a small, lightweight and secure web server for impromptu file sharing. Right now I use publicfile from djb.[^1] My only complaint is that there is no debian package for publicfile so I have to build my own package. I would love to find an equivalent (ftp not necessary) daemon that is included in debian. Is anyone aware of a something in debian repos that I am overlooking?

[^1]: http://cr.yp.to/publicfile.html

Re:Nweb: a tiny, safe web server (static pages only) by pjc50 on Tuesday April 01, 2014 @02:44AM (#7506528)
http://smarden.org/pape/Debian/unofficial/why.html

DJB appears to have changed the license to public domain, but at some point in the past there was a license that prohibited distribution of binaries from modified source. There's still the request that the paths not be changed to comply with the FHS.

DJB has strong opinions about the construction and distribution of software. So do quite a lot of debian people. These views are incompatible.

Re:Nweb: a tiny, safe web server (static pages only) by dfc on Tuesday April 01, 2014 @03:16AM (#7506623)
The page you linked to was last updated 11+ years ago. Notice the discussion of qmail|ucspi|djbdns-installer packages? They are not around anymore, you can install qmail/ucspi/daemontools etc. There is even djbdns and the debian tweaked + community patches version known as dbndns. Yes djb and debian devs are quite opinionated, but I do not think that is the reason that publicfile is not in debian despite the fact that so many other djb packages are.

I think the reason is low demand largely due to the fact that gnome-desktop depends on gnome-user-share (AKA: apache).

Re:Nweb: a tiny, safe web server (static pages only) by pmahoney on Monday March 31, 2014 @10:48PM (#7505861)
This is hardly in the category of "lightweight and secure", but for impromptu stuff, this Ruby+Rack one-liner serves directory listings and static files from the current directory:

    ruby -e 'require "rack"; include Rack; \
      Server.start :app => Directory.new(".", \
      Static.new(nil, :urls => ["/"], :root => "."))'
Re:Nweb: a tiny, safe web server (static pages only) by dylz on Monday March 31, 2014 @10:52PM (#7505884)

    python -m SimpleHTTPServer
Re:Nweb: a tiny, safe web server (static pages only) by eik3_de on Tuesday April 01, 2014 @02:37AM (#7506507)
the minimal Ruby equivalent would be

    ruby -run -ehttpd .
Here's a handy snippet for bashrc:

    function S {
      ruby -run -ehttpd . -p${1-8080}  # default to port 8080 unless given as parameter
    }
Re:Nweb: a tiny, safe web server (static pages only) by pekk on Monday March 31, 2014 @11:35PM (#7506027)
although that server is very horrible
Re:Nweb: a tiny, safe web server (static pages only) by hcarvalhoalves on Monday March 31, 2014 @11:39PM (#7506038)
Works fine for some tests, but it's single threaded. If you need concurrency:

    twistd -no web --path=.
Re:Nweb: a tiny, safe web server (static pages only) by deathanatos on Tuesday April 01, 2014 @03:07AM (#7506593)
Perhaps, but the use case it usually finds is "I need a webserver, here. Now."

Python is nearly always installed, and that depends on nothing but the standard library. You can stick an alias in your dotfiles (I have, it's called "serve-this") and not have to worry about having twisted¹ getting to wherever your dotfiles get put. (I distribute my dotfiles over git/github, so it's really easy to move them around. More work to get Twisted.)

¹Or Ruby… or Go…

Re:Nweb: a tiny, safe web server (static pages only) by hcarvalhoalves on Tuesday April 01, 2014 @10:08AM (#7508247)
Twisted is pre-installed on OS X and various Linux distributions...
Re:Nweb: a tiny, safe web server (static pages only) by stock_toaster on Tuesday April 01, 2014 @12:13AM (#7506148)
or in go:

    package main

    import (
        "flag"
        "net/http"
    )

    var serveDir = flag.String("d", ".", "Directory to serve from")

    func main() {
        flag.Parse()
        panic(http.ListenAndServe("127.0.0.1:8000", http.FileServer(
            http.Dir(*serveDir))))
    }
Re:Nweb: a tiny, safe web server (static pages only) by Orangeair on Tuesday April 01, 2014 @02:44AM (#7506526)
What's wrong with it? Honestly, I don't know. I know Python probably isn't a great choice for performance reasons, but anything else? It's super easy to build off and configure. Seems fine for a beginner (which I admittedly am; hence my asking).
Re:Nweb: a tiny, safe web server (static pages only) by masklinn on Tuesday April 01, 2014 @03:52AM (#7506716)
Main issue is it's single threaded. So if you use it to share big files with an other machines, only 1 file can be downloaded at a time and a download will block browsing of available files.
Re:Nweb: a tiny, safe web server (static pages only) by lucian1900 on Tuesday April 01, 2014 @05:11AM (#7506973)
It's also very buggy. Its only excuse is being old.
Re:Nweb: a tiny, safe web server (static pages only) by troels on Tuesday April 01, 2014 @03:02AM (#7506577)
This is mine:

    #!/bin/bash
    unlink /Library/WebServer/Documents
    ln -s "$(pwd)" /Library/WebServer/Documents
    echo "http://localhost/ mounted on $(pwd)"
Of course, it's only "lightweight" in as far as you already have Apache installed and running.
Re:Nweb: a tiny, safe web server (static pages only) by chubot on Tuesday April 01, 2014 @12:12AM (#7506145)
Doesn't DJB's stuff usually compile faster than you can install a Debian package? :)

You could always try to package it for Debian, although I understand that's not a small amount of work.

I don't know of anything else designed for security. Hard to beat DJB in that respect. If you left out the security requirement, I would say just use the Python SimpleHTTPServer. I think it's probably secure, but definitely not explicitly designed for it.

Re:Nweb: a tiny, safe web server (static pages only) by dfc on Tuesday April 01, 2014 @01:29AM (#7506323)
I use equivs to create a virtual package that does nothing but depends/recommends/suggests other packages. I have two dfc.deb and dfc-workstation.deb, dfc-workstation adds GUI/multimedia/end-user tools that I do not need everywhere. When I get a new machine I can install these packages and all of the things I depend on will be installed. If publicfile was in debian it would be automatically installed. As it is I have to copy the package I created with checkinstall and install it manually.
Re:Nweb: a tiny, safe web server (static pages only) by inconshreveable on Tuesday April 01, 2014 @01:18AM (#7506296)
I think my project srvdir might be exactly what you're looking for: https://srvdir.net
Re:Nweb: a tiny, safe web server (static pages only) by zimpenfish on Tuesday April 01, 2014 @05:03AM (#7506950)
Re:Nweb: a tiny, safe web server (static pages only) by justincormack on Tuesday April 01, 2014 @05:01AM (#7506935)
Webfsd is in the Debian repos but the stupid person who packaged it created an init script for it as if you want to run it as a service rather than ad hoc. So you may as well build from source...
Re:Nweb: a tiny, safe web server (static pages only) by davidw on Tuesday April 01, 2014 @10:39AM (#7508497)
Or you could contribute something back and file a bug report, or maybe even a patch allowing people to use it either way. Certainly beats insulting someone you don't even know who was trying to make the world a little bit better by doing some free work.