Skip to content

Commit 958f4a8

Browse files
committed
docs: update readme
1 parent 5a803de commit 958f4a8

File tree

1 file changed

+40
-5
lines changed

1 file changed

+40
-5
lines changed

README.md

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66

77
A very simple webserver that serves files from your local app data.
88

9+
- [Features](#features)
10+
- [Configuration](#configuration)
11+
- [Launch Switches](#launch-switches)
12+
- [Options](#options)
13+
- [Using Interactive Mode](#using-interactive-mode)
14+
- [Using the Interop to Create Webpages](#using-the-interop-to-create-webpages)
15+
- [Examples](#examples)
16+
917
## Features
1018

1119
- Serves files like a normal webserver
@@ -15,7 +23,38 @@ A very simple webserver that serves files from your local app data.
1523

1624
## Configuration
1725

18-
Todo!
26+
Global configuration options are stored in `./Config/SharpConfig.json`
27+
28+
- `SafeMode` : If set to true the server will respond with dummy data instead of real webpages. Great for testing the extents of the server without exposing any real info.
29+
- `PortNumber` : The port the server should bind to. On Unix family OSes ports below 1024 are *protected* and require super user permission to bind. Use `sudo` or choose a higher range port such as 8080.
30+
31+
The remote block list is stored in `bannedClients.json`
32+
33+
Each entry is simply an IP that is prohibited from connecting to the server.
34+
35+
## Launch Switches
36+
37+
Use `./SharpServer --help` to display this information in your terminal.
38+
39+
### Options
40+
41+
- `-h`, `--help` | Show the help screen
42+
- `-p`, `--portable` | Launch in portable mode using the current directory instead of appdata
43+
- `-l`, `--license` | output this program's license information and exit
44+
45+
> *Note*
46+
>
47+
> The default base directory when not launching in portable mode is `%localAppData%/RobynLlama/SharpWebserver` on windows and `~/.local/share/RobynLlama/SharpWebserver` on most Linux distros. See [Special Folders](https://learn.microsoft.com/en-us/dotnet/api/system.environment.getfolderpath?view=net-8.0) on the MSDN docs for more on where this location is on your system.
48+
49+
## Using Interactive Mode
50+
51+
The server continues to accept input from the terminal or console it was launched from during operation. The following commands are supported:
52+
53+
- `help` : Print all acceptable interactive commands
54+
- `exit` : Save configs and exit immediately. No requests will be filled while shutting down.
55+
- `ban` : Used like ban `IPAddress` this will immediately ban the remote associated with that IP address. Existing connections will not be closed but the client will be sent a notice they have been blocked and the connection ended on every subsequent request.
56+
- `cache-clear` : Clears the existing webpage program cache. Great for testing and iterating on a page live.
57+
- `config-reload` : Reloads all configs from disk without saving the current config. Be careful, any unsaved information will be lost. The block list is updated on disk after each entry so this is usually safe to use.
1958

2059
## Using the Interop to Create Webpages
2160

@@ -24,7 +63,3 @@ All rendered webpage scripts should adhere to SharpWebserver.Interop.IScriptPage
2463
### Examples
2564

2665
See [Examples](src/ExamplePages/README.md)
27-
28-
## Defaults
29-
30-
The default base directory is `%localAppData%/RobynLlama/SharpWebserver` on windows and `~/.local/share/RobynLlama/SharpWebserver` on most Linux distros. See [Special Folders](https://learn.microsoft.com/en-us/dotnet/api/system.environment.getfolderpath?view=net-8.0) on the MSDN docs for more on where this location is on your system.

0 commit comments

Comments
 (0)