blob: 4295093f611736f27cabea6d78bae10d55e9d9ec (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# Upchud
> File upload service; without stage 4 retardation.
### Shilling points 🚀:
* Minimal dependencies
* CLI friendly
* Web friendly
* Optional random upload name mangling
* Easy to configure
* Small codebase
* Traubisoda
### Depedencies
* Lighttpd
* Tcl (base installation)
### Files
| File | Description |
| :-----------: | :---------: |
| lighttpd.conf | Master lighttpd configuration. Tip: set max upload size here. |
| upchud.tcl | Master CGI Tcl script. Tip: simply forked by lighttpd; set finer configurations here. |
| Makefile | Short-hands for common operations. |
| test/* | Scripts and files used during development. |
| example\_frontend.html | Simple web front-end for the service. |
| example\_frontend.lighttpd.conf | Serves the example front-end. Tip: you could merge this with the master configuration if you wanted one service. |
### Usage
Lets get hello-world out-of the way:
```sh
$ make serve &
[1] 15225
lighttpd -D -f lighttpd.conf
$ curl http://localhost:8080 --upload-file test/test.txt
http://localhost:8080/out//n6cru4.txt
$ curl http://localhost:8080/out//n6cru4.txt
Hello World
```
Alternatively I could run.
```sh
$ make serve &
[1] 23895
lighttpd -D -f lighttpd.conf
$ make front &
[2] 24105
lighttpd -D -f example_frontend.lighttpd.conf
```
And I could use the web page (localhost:8081 by default) to perform the same task.
The example frontend is perfectly functional, but is meant to be modified.
Alternatively, you could copy and embed it anywhere else on your site at large.
To learn more about configuration, read the top of `upchud.tcl` and checkout `lighttpd.conf`
### Why?
Because every implementation of this extremely simple thing is flawed.
Common faults I witnessed are:
* CLI is second class with sloppy wrapper scripts and or HTML responses
* No web support, preventing phoneposting
* Horrifically convoluted configuration due to poor isolation of responsibilities
* 6 gorillion dependencies
|