rebrand + added dockerfile agian
This commit is contained in:
parent
d1c583d4b0
commit
e4575d7d6e
11 changed files with 901 additions and 81 deletions
64
src/args.rs
64
src/args.rs
|
@ -17,133 +17,133 @@ pub struct Args {
|
|||
/// If unset, HTTP authentication stays disabled.
|
||||
///
|
||||
/// WARNING: people opening pastas will have to authenticate too.
|
||||
#[clap(long, env = "MICROBIN_AUTH_USERNAME")]
|
||||
#[clap(long, env = "KARTON_AUTH_USERNAME")]
|
||||
pub auth_username: Option<String>,
|
||||
|
||||
/// Set a password for HTTP authentication.
|
||||
/// If unset, HTTP authentication will not require a password.
|
||||
/// If `auth_username` is unset, this option will not have any effect.
|
||||
#[clap(long, env = "MICROBIN_AUTH_PASSWORD")]
|
||||
#[clap(long, env = "KARTON_AUTH_PASSWORD")]
|
||||
pub auth_password: Option<String>,
|
||||
|
||||
/// Enable the option to make pastas editable.
|
||||
#[clap(long, env = "MICROBIN_EDITABLE")]
|
||||
#[clap(long, env = "KARTON_EDITABLE")]
|
||||
pub editable: bool,
|
||||
|
||||
/// The text displayed in the browser navigation bar.
|
||||
#[clap(long, env = "MICROBIN_TITLE", default_value = " MicroBin")]
|
||||
#[clap(long, env = "KARTON_TITLE", default_value = " Karton")]
|
||||
pub title: String,
|
||||
|
||||
/// The web interfaces' footer text.
|
||||
#[clap(long, env = "MICROBIN_FOOTER_TEXT")]
|
||||
#[clap(long, env = "KARTON_FOOTER_TEXT")]
|
||||
pub footer_text: Option<String>,
|
||||
|
||||
/// Hide the footer of the web interface.
|
||||
#[clap(long, env = "MICROBIN_HIDE_FOOTER")]
|
||||
#[clap(long, env = "KARTON_HIDE_FOOTER")]
|
||||
pub hide_footer: bool,
|
||||
|
||||
/// Hide the header of the web interface.
|
||||
#[clap(long, env = "MICROBIN_HIDE_HEADER")]
|
||||
#[clap(long, env = "KARTON_HIDE_HEADER")]
|
||||
pub hide_header: bool,
|
||||
|
||||
/// Hide the logo in the header.
|
||||
#[clap(long, env = "MICROBIN_HIDE_LOGO")]
|
||||
#[clap(long, env = "KARTON_HIDE_LOGO")]
|
||||
pub hide_logo: bool,
|
||||
|
||||
/// Disable the listing page.
|
||||
#[clap(long, env = "MICROBIN_NO_LISTING")]
|
||||
#[clap(long, env = "KARTON_NO_LISTING")]
|
||||
pub no_listing: bool,
|
||||
|
||||
/// Enable syntax highlighting in pastas.
|
||||
#[clap(long, env = "MICROBIN_HIGHLIGHTSYNTAX")]
|
||||
#[clap(long, env = "KARTON_HIGHLIGHTSYNTAX")]
|
||||
pub highlightsyntax: bool,
|
||||
|
||||
/// The port to which to bind the server.
|
||||
#[clap(short, long, env = "MICROBIN_PORT", default_value_t = 8080)]
|
||||
#[clap(short, long, env = "KARTON_PORT", default_value_t = 8080)]
|
||||
pub port: u16,
|
||||
|
||||
/// The IP adress to bind the server to.
|
||||
#[clap(short, long, env="MICROBIN_BIND", default_value_t = IpAddr::from([0, 0, 0, 0]))]
|
||||
#[clap(short, long, env="KARTON_BIND", default_value_t = IpAddr::from([0, 0, 0, 0]))]
|
||||
pub bind: IpAddr,
|
||||
|
||||
/// Enable the option to create private pastas.
|
||||
#[clap(long, env = "MICROBIN_PRIVATE")]
|
||||
#[clap(long, env = "KARTON_PRIVATE")]
|
||||
pub private: bool,
|
||||
|
||||
/// Disables most css, apart form some inline styles.
|
||||
#[clap(long, env = "MICROBIN_PURE_HTML")]
|
||||
#[clap(long, env = "KARTON_PURE_HTML")]
|
||||
pub pure_html: bool,
|
||||
|
||||
/// The servers public path, making it possible to run microbin behind a reverse proxy subpath.
|
||||
#[clap(long, env="MICROBIN_PUBLIC_PATH", default_value_t = PublicUrl(String::from("")))]
|
||||
/// The servers public path, making it possible to run Karton behind a reverse proxy subpath.
|
||||
#[clap(long, env="KARTON_PUBLIC_PATH", default_value_t = PublicUrl(String::from("")))]
|
||||
pub public_path: PublicUrl,
|
||||
|
||||
/// Enable creation of QR codes of pastas. Requires `public_path` to be set.
|
||||
#[clap(long, env = "MICROBIN_QR")]
|
||||
#[clap(long, env = "KARTON_QR")]
|
||||
pub qr: bool,
|
||||
|
||||
|
||||
/// Disable adding/removing/editing pastas.
|
||||
#[clap(long, env = "MICROBIN_READONLY")]
|
||||
#[clap(long, env = "KARTON_READONLY")]
|
||||
pub readonly: bool,
|
||||
|
||||
/// The amount of worker threads that the server is allowed to have.
|
||||
#[clap(short, long, env = "MICROBIN_THREADS", default_value_t = 1)]
|
||||
#[clap(short, long, env = "KARTON_THREADS", default_value_t = 1)]
|
||||
pub threads: u8,
|
||||
|
||||
/// Sets a time value for the garbage collector. Pastas that aren't accessed for the given
|
||||
/// amount of days will be deleted. Set to 0 to disable garbage collection.
|
||||
#[clap(short, long, env = "MICROBIN_GC_DAYS", default_value_t = 90)]
|
||||
#[clap(short, long, env = "KARTON_GC_DAYS", default_value_t = 90)]
|
||||
pub gc_days: u16,
|
||||
|
||||
/// Enable the option to delete after a given amount of reads.
|
||||
#[clap(long, env = "MICROBIN_ENABLE_BURN_AFTER")]
|
||||
#[clap(long, env = "KARTON_ENABLE_BURN_AFTER")]
|
||||
pub enable_burn_after: bool,
|
||||
|
||||
/// The default amount of reads for the self-delete mechanism.
|
||||
#[clap(short, long, env = "MICROBIN_DEFAULT_BURN_AFTER", default_value_t = 0)]
|
||||
#[clap(short, long, env = "KARTON_DEFAULT_BURN_AFTER", default_value_t = 0)]
|
||||
pub default_burn_after: u16,
|
||||
|
||||
/// Changes the UIs maximum width from 720 pixels to 1080.
|
||||
#[clap(long, env = "MICROBIN_WIDE")]
|
||||
#[clap(long, env = "KARTON_WIDE")]
|
||||
pub wide: bool,
|
||||
|
||||
/// Disable "Never" expiry setting.
|
||||
#[clap(long, env = "MICROBIN_NO_ETERNAL_PASTA")]
|
||||
#[clap(long, env = "KARTON_NO_ETERNAL_PASTA")]
|
||||
pub no_eternal_pasta: bool,
|
||||
|
||||
/// Set the default expiry time value.
|
||||
#[clap(long, env = "MICROBIN_DEFAULT_EXPIRY", default_value = "24hour")]
|
||||
#[clap(long, env = "KARTON_DEFAULT_EXPIRY", default_value = "24hour")]
|
||||
pub default_expiry: String,
|
||||
|
||||
/// Disable file uploading.
|
||||
#[clap(short, long, env = "MICROBIN_NO_FILE_UPLOAD")]
|
||||
#[clap(short, long, env = "KARTON_NO_FILE_UPLOAD")]
|
||||
pub no_file_upload: bool,
|
||||
|
||||
// TODO: replace with simple path.
|
||||
/// Replace built-in CSS file with a CSS file provided by the linked URL.
|
||||
#[clap(long, env = "MICROBIN_CUSTOM_CSS")]
|
||||
#[clap(long, env = "KARTON_CUSTOM_CSS")]
|
||||
pub custom_css: Option<String>,
|
||||
|
||||
/// Replace built-in animal names file with custom names file for pasta links.
|
||||
/// The file must be newline seperated.
|
||||
#[clap(long, env = "MICROBIN_CUSTOM_NAMES")]
|
||||
#[clap(long, env = "KARTON_CUSTOM_NAMES")]
|
||||
pub custom_names: Option<PathBuf>,
|
||||
|
||||
/// Enable the use of Hash IDs for shorter URLs instead of animal names.
|
||||
#[clap(long, env = "MICROBIN_HASH_IDS")]
|
||||
#[clap(long, env = "KARTON_HASH_IDS")]
|
||||
pub hash_ids: bool,
|
||||
|
||||
/// Endpoint for /url/
|
||||
#[clap(long, env = "MICROBIN_URL_EP", default_value = "url" )]
|
||||
#[clap(long, env = "KARTON_URL_EP", default_value = "url" )]
|
||||
pub url_endpoint: String,
|
||||
|
||||
/// Endpoint for /pasta/
|
||||
#[clap(long, env = "MICROBIN_PASTA_EP", default_value = "pasta" )]
|
||||
#[clap(long, env = "KARTON_PASTA_EP", default_value = "pasta" )]
|
||||
pub pasta_endpoint: String,
|
||||
|
||||
/// Endpoint for /raw/
|
||||
#[clap(long, env = "MICROBIN_RAW_EP", default_value = "raw" )]
|
||||
#[clap(long, env = "KARTON_RAW_EP", default_value = "raw" )]
|
||||
pub raw_endpoint: String,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue