• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

src/H03-May-2022-2,7641,694

CHANGES.DOCH A D03-May-2022830 2726

README.DOCH A D03-May-20222.6 KiB7047

build.shH A D03-May-20221.3 KiB3423

README.DOC

1DFileServer 	[-port (port)] [-backlog (backlog)] [-maxconnections (connections)] [-maxbandwidth (bytes per second)]
2		[-log (logfile)] [-requireauth (username:password)] [-showconnections] [-background]
3
4*nix only: 	[-setuid (newuid)] [-chroot (folder to chroot to)]
5
6Basic Authentication:
7
8If you use "-requireauth jones:tutorpassword" on the command line while executing
9the program, any page viewed from the server will require the person to authenticate
10using the username jones, and the password tutorpassword. These are case sensitive.
11
12If you use the wrong username or password, you are denied access to the content.
13
14Structure of resource.cfg:
15
16[url] [mime/type] [Identifier] [IP Mask] [Local File] cannot have any spaces
17in them. If the [url] or [Local File] need a space, use %20 instead.
18If you are unaware of the mimetype, put - there instead. The program will
19attempt to identify the mimetype based off the file extension.
20
21RESOURCE 	[url]		[mime/type]
22[Identifier]	[IP Mask]	[Local File]
23
24IP Masks work like this --
25
26For 24.150.34.200
27
2824.150.34.200 - Direct match.
2924.150.       - Indirect match.
30x.x.x.x	      - Match all.
31
32If the IP doesn't match any of the IP Masks for the RESOURCE, they are
33sent a 404.
34
35Example:
36
37RESOURCE	/pictures/kitten.jpg	image/jpeg
38Somebody	24.150.34		c:/pictures/notkitten.jpg
39All		x.x.x.x			c:/pictures/kitten.jpg
40
41RESOURCE	/pictures/dumbass.jpg	image/jpeg
42Asshole		24.150.34		c:/pictures/deadmoose.jpg
43
44In the bottom example, only people in the 24.150.34 range will see the
45picture, everyone else gets a 404.
46
47If the mime/type is simply set to "redirect" then the "Local File" is treated as a path
48redirect and an index is created on the fly if it is a folder.
49
50Example:
51
52RESOURCE	/PersonalFiles		redirect
53All		x.x.x.x			c:/PersonalStuff
54
55Now if someone views that in their browser they will see an HTML index of the contents
56of that folder, and all subfolders in it will also be browsable.
57
58The Indexes themselves are very configurable. The program checks for an Index template at
59indextemplates/default.html . If it cannot find it, it uses an internal one to substitute.
60
61The template should be relatively straightforward, and I hate writing documentation, so
62here is a quick detail of the various template tags.
63
64$$LOCATION$$ = Replaced with the current URL location, minus the hostname, etc.
65$$SERVERVERSION$$ = Replaced with the DashFileServer version identifier.
66$$INDEXTABLE$$ = Replaced with the table of files in the folder you are browsing.
67$$INSERTFILE(filename)$$ = Replaced with the contents of "filename". You can only insert a file
68				once, while you can insert multiple files. This file is hidden
69				from the index.
70