Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ahmetozer/basic-server
A basic file server automatically generates self certificates and serves the given folder.
https://github.com/ahmetozer/basic-server
cloudflare http https https-server
Last synced: 3 months ago
JSON representation
A basic file server automatically generates self certificates and serves the given folder.
- Host: GitHub
- URL: https://github.com/ahmetozer/basic-server
- Owner: ahmetozer
- License: apache-2.0
- Created: 2021-05-04T00:55:57.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-05-04T01:01:15.000Z (over 3 years ago)
- Last Synced: 2023-09-05T02:32:37.039Z (over 1 year ago)
- Topics: cloudflare, http, https, https-server
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Basic Server
A basic file server automatically generates self certificates and serves the given folder.
## Options
```bash
Usage of /basic-server:
-client-cert string
Allow only given client certificate
-listen string
Listen addr (default ":443")
-path string
Share Path (default "/web/") # Note if you not run in container, default path will be current path
-server-cert string
Server cert
-server-key string
Server key
-server-name string
Server name check from TLS
```## Examples
### Run on local
```cmd
C:\Users\Ahmet\Desktop\basic-server.exe -h
2021/05/04 02:46:55 github.com/ahmetozer/basic-server
2021/05/04 02:46:55 Current name WORKSTATION\Ahmet
2021/05/04 02:46:55 ./key.pem exist
2021/05/04 02:46:55 ./cert.pem exist
2021/05/04 02:29:51 Starting HTTPS server on :443 at C:\Users\Ahmet\Desktop\
```### Run in container
This configuration accepts all https clients with all domains.
```bash
docker run -it --rm -p 443:443 --mount type=bind,source="/my/path/",target=/web/,readonly ghcr.io/ahmetozer/basic-server
```### Run in container with client cert control
To allow incoming request from only cloudflare enable 'Authenticated Origin Pulls' in cloudflare.
```bash
docker run -it --rm -p 443:443 --mount type=bind,source="/my/path/",target=/web/,readonly ghcr.io/ahmetozer/basic-server \
--server-name mydomain.test --client-cert /config/client-cloudflare.pem
```### Run in different user
You can also run in different user id for access shared path.
```bash
docker run -it --rm -p 443:443 -u 1249:1249 --mount type=bind,source="/secret/my/path/",target=/web/,readonly ghcr.io/ahmetozer/basic-server \
--server-name mydomain.test --client-cert config/client-cloudflare.pem
```## Dump
You can also inspect your HTTP request with visiting /dump page.