modulepackage
0.0.0-20240908034829-fe9e0aca56a7
Repository: https://github.com/oftn-oswg/zerodrop.git
Documentation: pkg.go.dev
# README
Zerodrop šµļø
A utility for private redirects and proxies that disappear after certain conditions are met.
Live demo
A live demo is available at thisĀ dangerous.link.
Features
- Web interface for creating resources
- Create proxies and redirections for a given URL
- Upload files or manually enter content in a textarea
- Access control
- Expire access to a resource after number of downloads
- Block or allow access based on IP address
- Block or allow access based on IP network
- Block or allow access based on GeoIP location
- Block or allow access based on hostname matching (w/ regex)
- Publish "secret" pages with UUID generation
- Self-destruct action which removes and kills running binary; configurable.
Blacklist
The blacklist syntax is similar to that of gitignore. An optional prefix !
which negates the pattern can be used for whitelisting.
Categories
- Match All [
*
] (Useful for creating a whitelist) - Match IP [e.g.
203.0.113.6
or2001:db8::68
] - Match IP Network [e.g.:
192.0.2.0/24
or::1/128
] - Match Hostname [e.g.
crawl-66-249-66-1.googlebot.com
] - Match Hostname RegExp [e.g.:
~ .*\.cox\.net
] - Match Geofence [e.g.:
@ 39.377297 -74.451082 (7km)
] - Match database [e.g.
db datacenters
ordb tor
]
Whitelist
For example to only allow from local:
# This strange blacklist only allows access from localhost and google bots
*
! ::1 # Allow localhost
! ~ .*\.google(bot)?\.com$
Geofencing
A @
prefix is for targeted geofencing, i.e., @ lat lng (optional radius)
. The default radius is 25m. For example to block Atlantic City:
@ 39.377297 -74.451082 (7km)
Unit | Symbol |
---|---|
meter | m |
kilometer | km |
mile | mi |
feet | ft |
Regular Expression
A ~
prefix indicates a hostname regular expression match.
shady.com
~ (.*)\.shady\.com # Block subdomains of shady
Databases
A rule that begins with "db
" will be matched with a database by name, e.g.,
!db tor
to whitelist Tor exit nodes. The database file must be specified in
the config.
ipcat:
cloudflare: cloudflare.csv
datacenters: datacenters.csv
tor: torexitnodes.csv
The format of the CSV file is specified by ipcat rules.
# Functions
NewAdminHandler creates a new admin handler with the specified configuration and loads the template files into cache.
NewShotHandler constructs a new ShotHandler from the arguments.
No description provided by the author
ParseBlacklist parses a text blacklist and returns a Blacklist object.
ParseSocketName produces a struct suitable for net.Dial given a string representing a socket address to bind or connect to.
RealRemoteIP returns the value of the X-Real-IP header, or the RemoteAddr property if the header does not exist.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
IsDisjoint means that the two sets have no common elements.
IsSubset means the first set is a subset of the second.
IsSuperset means the second set is a subset of the first.
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
# Structs
AdminClaims represents the claims of the JWT (JSON Web Token).
No description provided by the author
No description provided by the author
No description provided by the author
AdminHandler serves the administration page, or asks for credentials if not already authenticated.
AdminPageData represents the data served to the admin templates.
Blacklist is a list of BlacklistRules.
BlacklistContext is a structure used to contain the external data used to categorize IP addresses needed for specific rules, like the geolocation database used for geofencing or the ipcat database.
BlacklistRule is a structure that represents a rule or comment as part of a blacklist.
Geofence represents a point on the Earth with an accuracy radius in meters.
NotFoundHandler serves the "404" page.
ShotHandler serves the requested page and removes it from the database, or returns 404 page if not available.
No description provided by the author
ZerodropConfig holds the configuration for an application instance.
ZerodropDB represents a database connection.
ZerodropEntry is a page entry.
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SetIntersection is a description of the relationship between two sets.