Skip to content

Commit

Permalink
Microbin 2 beta 1 first commit
Browse files Browse the repository at this point in the history
This is the first, early beta version of Microbin 2.

Microbin 2 brings a lot of improvements to Microbin. To name just the most important ones:
- Server-side and client-side encryption for uploads, including file attachments,
- SQLite database support by default,
- Reworked upload settings, 5 privacy levels,
- New administrator console (/admin),
- Automatic syntax highlighting,
- Image and video embedding,
- Refreshed styling and QoL features,
- New user guide page.

Beyond these,
- Added file upload size limits,
- Added sample .env file with description for each environmental variable,
- Removed Info page (moved to admin page),
- Pasta list now sorted from newer to older,
- Pasta terminology replaced with Upload,
- Files are now served with a proper service, not just as a public directory,
- Pastas are now stored in /attachments instead of /public.

As this is the first beta of Microbin v2, and I do not recommend updating to this in critical environments as long as we are in beta stage. I expect many bugs to emerge and v2 is also getting a few more smaller QoL features from the backlog. README and website won't be updated until v2 is stable and well-tested.

Fixes #164
Fixes #156
Fixes #153
Fixes #149
Fixes #139
Fixes #98
Fixes #4

Fixes #105 (sort of)
Fixes #97 (sort of)
Fixes #45 (sort of)
Fixes #22 (sort of)
  • Loading branch information
szabodanika committed Jul 1, 2023
1 parent 3d45357 commit bc188e3
Show file tree
Hide file tree
Showing 44 changed files with 8,806 additions and 476 deletions.
211 changes: 211 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
# Require username for HTTP Basic Authentication when
# visiting the service. If basic auth username is set but
# basic auth password is not, just leave the password field
# empty when logging in. You can also just go to
# https://username:password@yourserver.net or
# https://username@yourserver.net if password is not set
# instead of typing into the password
# Default value: unset
# export MICROBIN_BASIC_AUTH_USERNAME=

# Require password for HTTP Basic Authentication when
# visiting the service. Will not have any affect unless
# basic auth username is also set. If basic auth username is
# set but basic auth password is not, just leave the
# password field empty when logging in. You can also just go
# to https://username:password@yourserver.net or
# https://username@yourserver.net if password is not set
# instead of typing into the password prompt.
# Default value: unset
# export MICROBIN_BASIC_AUTH_PASSWORD=

# Enables administrator interface at yourserver.com/admin/
# if set, disables it if unset. If admin username is set but
# admin password is not, just leave the password field empty
# when logging in.
# Default value: admin
export MICROBIN_ADMIN_USERNAME=admin

# Enables administrator interface at yourserver.com/admin/
# if set, disables it if unset. Will not have any affect
# unless admin username is also set. If admin username is
# set but admin password is not, just leave the password
# field empty when logging in.
# Default value: m1cr0b1n
export MICROBIN_ADMIN_PASSWORD=m1cr0b1n

# Enables editable pastas. You will still be able to make
# finalised pastas but there will be an extra checkbox to
# make your new pasta editable from the pasta list or the
# pasta view page.
# Default value: 8080
export MICROBIN_EDITABLE=true

# Replaces the default footer text with your own. If you
# want to hide the footer, use the hide footer option instead.
# export MICROBIN_FOOTER_TEXT=

# Hides the navigation bar on every page.
# Default value: 8080
export MICROBIN_HIDE_HEADER=false

# Hides the footer on every page.
# Default value: 8080
export MICROBIN_HIDE_FOOTER=false

# Hides the MicroBin logo from the navigation bar on every
# page.
# Default value: 8080
export MICROBIN_HIDE_LOGO=false

# Disables the /pastalist endpoint, essentially making all
# pastas private.
# Default value: 8080
export MICROBIN_NO_LISTING=false

# Enables syntax highlighting support. When creating a new
# pasta, a new dropdown selector will be added where you can
# select your pasta's syntax, or just leave it empty for no
# highlighting.
export MICROBIN_HIGHLIGHTSYNTAX=true

# Sets the port for the server will be listening on.
# Default value: 8080
export MICROBIN_PORT=8080

# Sets the bind address for the server will be listening on.
# Both ipv4 and ipv6 are supported. Default value: 0.0.0.0.
# Example value: "myserver.net", "127.0.0.1".
export MICROBIN_BIND=127.0.0.1

# Enables private pastas. Adds a new checkbox to make your
# pasta private, which then won't show up on the pastalist
# page. With the URL to your pasta, it will still be
# accessible.
# Default value: false
export MICROBIN_PRIVATE=true

# Disables main CSS styling, just uses a few in-line
# stylings for the layout. With this option you will lose
# dark-mode support.
export MICROBIN_PURE_HTML=false

# Enables storing pasta data (not attachments and files) in
# a JSON file instead of the SQLite database.
# Default value: false
export MICROBIN_JSON_DB=false

# Add the given public path prefix to all urls. This allows
# you to host MicroBin behind a reverse proxy on a subpath.
# Note that MicroBin itself still expects all routes to be
# as without this option, and thus is unsuited if you are
# running MicroBin directly. Default value: unset. Example
# values: https://myserver.com/ or https://192.168.0.10:8080/
# export MICROBIN_PUBLIC_PATH=

# Sets a shortened path to use when the user copies URL from
# the application. This will also use shorter endpoints,
# such as /p/ instead if /pasta/. Default value:
# unset.Example value: https://b.in/ export
# MICROBIN_SHORT_PATH=

# If set to true, disables adding/editing/removing pastas
# entirely.
# Default value: false
export MICROBIN_READONLY=false

# Enables showing read count on pasta pages.
# Default value: false
export MICROBIN_SHOW_READ_STATS=true

# Adds your title of choice to the
# navigation bar.
# Default value: unset
# export MICROBIN_TITLE=

# Number of workers MicroBin is allowed to have. Increase
# this to the number of CPU cores you have if you want to go
# beast mode, but for personal use one worker is enough.
# Default value: 1.
export MICROBIN_THREADS=4

# Sets the garbage collector time limit. Pastas not accessed
# for N days are removed even if they are set to never
# expire.
# Default value: 90.
# To turn off GC: 0.
export MICROBIN_GC_DAYS=90

# Enables or disables the "Burn after" function
# Default value: false
export MICROBIN_ENABLE_BURN_AFTER=true

# Sets the default burn after setting on the main screen.
# Default value: 0. Available expiration options: 1, 10,
# 100, 1000, 10000, 0 (= no limit)
export MICROBIN_DEFAULT_BURN_AFTER=0

# Changes the maximum width of the UI from 720 pixels to
# 1080 pixels.
# Default value: false
export MICROBIN_WIDE=false

# Enables generating QR codes for pastas. Requires
# --public-path to be set.
# Default value: false
export MICROBIN_QR=true

# Disables "Never" expiry settings for pastas. Default
# value: false
export MICROBIN_NO_ETERNAL_PASTA=true

# Enables "Read-only" uploads. These are unlisted and
# unencrypted, but can be viewed without password if you
# have the URL. Editing and removing requires password.
# Default value: true
export MICROBIN_ENABLE_READONLY=true

# Sets the default expiry time setting on the main screen.
# Default value: 24hour Available expiration options: 1min,
# 10min, 1hour, 24hour, 1week, never
export MICROBIN_DEFAULT_EXPIRY=24hour

# Disables and hides the file upload option in the UI.
# Default value: false
export MICROBIN_NO_FILE_UPLOAD=false

# Replaced the built-in water.css stylesheet with the URL
# you provide. Default value: unset. Example value:
# https://myserver.net/public/mystyle.css
# export MICROBIN_CUSTOM_CSS=

# Use short hash strings in the URLs instead of animal names
# to make URLs shorter. Does not change the underlying data
# stored, just how pastas are recalled.
# Default value: false
export MICROBIN_HASH_IDS=false

# Enables server-side encryption. This will add private
# privacy level, where the user sends plain unencrypted data
# (still secure, because you use HTTPS, right?), but the
# server sees everything that the user submits, therefore
# the user does not have complete and absolute protection.
# Default value: false
export MICROBIN_ENCRYPTION_CLIENT_SIDE=true

# Enables client-side encryption. This will add the secret
# privacy level where the user's browser encrypts all data
# with JavaScript before sending it over to MicroBin, which
# encrypt the data once again on server side.
# Default value: false
export MICROBIN_ENCRYPTION_SERVER_SIDE=true

# Limit the maximum file size users can upload without
# encryption. Default value: 256.
export MICROBIN_MAX_FILE_SIZE_ENCRYPTED_MB=256

# Limit the maximum file size users can upload with
# encryption (more strain on your server than without
# encryption, so the limit should be lower. Secrets tend to
# be tiny files usually anyways.) Default value: 2048.
export MICROBIN_MAX_FILE_SIZE_UNENCRYPTED_MB=2048

0 comments on commit bc188e3

Please sign in to comment.