Skip to content

Commit

Permalink
Add www/rustypaste: Minimal file upload/pastebin service
Browse files Browse the repository at this point in the history
Rustypaste is a minimal file upload/pastebin service.

Features:

* File upload & URL shortening & upload from URL
  - supports basic HTTP authentication
  - random file names (optional)
    - pet name (e.g. capital-mosquito.txt)
    - alphanumeric string (e.g. yB84D2Dv.txt)
  - supports expiring links
    - auto-deletion of expired files (optional)
  - supports one shot links (can only be viewed once)
  - guesses MIME types
    - supports overriding and blacklisting
  - no duplicate uploads (optional)
* Single binary
* Simple configuration
  - supports hot reloading
* No database
  - filesystem is used
* Self-hosted
  - centralization is bad!
* Written in Rust
  - blazingly fast!

WWW: https://github.com/orhun/rustypaste/

PR:		267095
  • Loading branch information
DtxdF authored and lwhsu committed Oct 22, 2022
1 parent b8cda5a commit 31484c7
Show file tree
Hide file tree
Showing 8 changed files with 737 additions and 2 deletions.
2 changes: 1 addition & 1 deletion GIDs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ datadog:*:480:
# free: 495
# free: 496
# free: 497
# free: 498
rustypaste:*:498:
# free: 499
# free: 500
# free: 501
Expand Down
2 changes: 1 addition & 1 deletion UIDs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ datadog:*:480:480::0:0:DataDog Agent:/var/db/datadog:/usr/sbin/nologin
# free: 495
# free: 496
# free: 497
# free: 498
rustypaste:*:498:498::0:0:Minimal file upload/pastebin service:/nonexistent:/usr/sbin/nologin
# free: 499
# free: 500
# free: 501
Expand Down
38 changes: 38 additions & 0 deletions www/rustypaste/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
PORTNAME= rustypaste
DISTVERSIONPREFIX= v
DISTVERSION= 0.8.2
CATEGORIES= www

MAINTAINER= DtxdF@disroot.org
COMMENT= Minimal file upload/pastebin service
WWW= https://github.com/orhun/rustypaste/

LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE

USES= cargo
USE_GITHUB= yes
GH_ACCOUNT= orhun
USE_RC_SUBR= ${PORTNAME}

SUB_LIST+= USER="${USERS:[0]}"

USERS= ${PORTNAME}
GROUPS= ${PORTNAME}

PLIST_SUB+= USER="${USERS:[0]}" \
GROUP="${GROUPS:[0]}"

UPLOAD_PATH= /var/db/${PORTNAME}

post-patch:
@${REINPLACE_CMD} -e '/^upload_path=/s#=.*#="${UPLOAD_PATH}"#' ${WRKSRC}/config.toml

post-install:
${MKDIR} ${STAGEDIR}${ETCDIR}
${MKDIR} ${STAGEDIR}/${UPLOAD_PATH}
${ECHO_CMD} 'CONFIG="${ETCDIR}/${PORTNAME}.toml"' > ${STAGEDIR}${ETCDIR}/${PORTNAME}.env.sample
${CP} ${WRKSRC}/config.toml ${STAGEDIR}${ETCDIR}/${PORTNAME}.toml.sample
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}

.include <bsd.port.mk>
210 changes: 210 additions & 0 deletions www/rustypaste/Makefile.crates
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
CARGO_CRATES= actix-codec-0.5.0 \
actix-files-0.6.2 \
actix-http-3.2.2 \
actix-macros-0.2.3 \
actix-multipart-0.4.0 \
actix-router-0.5.1 \
actix-rt-2.7.0 \
actix-server-2.1.1 \
actix-service-2.0.2 \
actix-tls-3.0.3 \
actix-utils-3.0.0 \
actix-web-4.2.1 \
actix-web-codegen-4.1.0 \
adler-1.0.2 \
ahash-0.7.6 \
aho-corasick-0.7.19 \
alloc-no-stdlib-2.0.4 \
alloc-stdlib-0.2.2 \
askama_escape-0.10.3 \
async-trait-0.1.57 \
atty-0.2.14 \
autocfg-1.1.0 \
awc-3.0.1 \
base64-0.13.0 \
bitflags-1.3.2 \
block-buffer-0.10.3 \
brotli-3.3.4 \
brotli-decompressor-2.3.2 \
bumpalo-3.11.0 \
byte-unit-4.0.14 \
bytes-1.2.1 \
bytestring-1.1.0 \
cc-1.0.73 \
cfg-if-0.1.10 \
cfg-if-1.0.0 \
clap-2.34.0 \
config-0.13.2 \
convert_case-0.4.0 \
cookie-0.16.1 \
cpufeatures-0.2.5 \
crc32fast-1.3.2 \
crypto-common-0.1.6 \
derive_more-0.99.17 \
digest-0.10.5 \
dirs-4.0.0 \
dirs-sys-0.3.7 \
dotenvy-0.15.5 \
either-1.8.0 \
encoding_rs-0.8.31 \
env_logger-0.9.1 \
filetime-0.2.17 \
flate2-1.0.24 \
fnv-1.0.7 \
form_urlencoded-1.1.0 \
fsevent-0.4.0 \
fsevent-sys-2.0.1 \
fuchsia-zircon-0.3.3 \
fuchsia-zircon-sys-0.3.3 \
futures-core-0.3.24 \
futures-macro-0.3.24 \
futures-sink-0.3.24 \
futures-task-0.3.24 \
futures-util-0.3.24 \
generic-array-0.14.6 \
getrandom-0.2.7 \
glob-0.3.0 \
h2-0.3.14 \
hashbrown-0.12.3 \
heck-0.3.3 \
hermit-abi-0.1.19 \
hotwatch-0.4.6 \
http-0.2.8 \
http-range-0.1.5 \
httparse-1.8.0 \
httpdate-1.0.2 \
humantime-2.1.0 \
humantime-serde-1.1.1 \
idna-0.3.0 \
indexmap-1.9.1 \
infer-0.9.0 \
inotify-0.7.1 \
inotify-sys-0.1.5 \
iovec-0.1.4 \
itertools-0.10.5 \
itoa-1.0.3 \
jobserver-0.1.25 \
js-sys-0.3.60 \
kernel32-sys-0.2.2 \
language-tags-0.3.2 \
lazy-regex-2.3.0 \
lazy-regex-proc_macros-2.3.0 \
lazy_static-1.4.0 \
lazycell-1.3.0 \
libc-0.2.134 \
linked-hash-map-0.5.6 \
local-channel-0.1.3 \
local-waker-0.1.3 \
lock_api-0.4.9 \
log-0.4.17 \
memchr-2.5.0 \
mime-0.3.16 \
mime_guess-2.0.4 \
minimal-lexical-0.2.1 \
miniz_oxide-0.5.4 \
mio-0.6.23 \
mio-0.8.4 \
mio-extras-2.0.6 \
miow-0.2.2 \
net2-0.2.37 \
nom-7.1.1 \
notify-4.0.17 \
num_cpus-1.13.1 \
num_threads-0.1.6 \
once_cell-1.15.0 \
parking_lot-0.12.1 \
parking_lot_core-0.9.3 \
paste-1.0.9 \
pathdiff-0.2.1 \
percent-encoding-2.2.0 \
petname-1.1.2 \
pin-project-lite-0.2.9 \
pin-utils-0.1.0 \
ppv-lite86-0.2.16 \
proc-macro-error-1.0.4 \
proc-macro-error-attr-1.0.4 \
proc-macro2-1.0.46 \
quote-1.0.21 \
rand-0.8.5 \
rand_chacha-0.3.1 \
rand_core-0.6.4 \
redox_syscall-0.2.16 \
redox_users-0.4.3 \
regex-1.6.0 \
regex-syntax-0.6.27 \
ring-0.16.20 \
rustc_version-0.4.0 \
rustls-0.20.6 \
ryu-1.0.11 \
same-file-1.0.6 \
scopeguard-1.1.0 \
sct-0.7.0 \
semver-1.0.14 \
serde-1.0.145 \
serde_derive-1.0.145 \
serde_json-1.0.85 \
serde_regex-1.1.0 \
serde_urlencoded-0.7.1 \
sha1-0.10.5 \
signal-hook-registry-1.4.0 \
slab-0.4.7 \
smallvec-1.10.0 \
socket2-0.4.7 \
spin-0.5.2 \
structopt-0.3.26 \
structopt-derive-0.4.18 \
syn-1.0.101 \
termcolor-1.1.3 \
textwrap-0.11.0 \
thiserror-1.0.37 \
thiserror-impl-1.0.37 \
time-0.3.15 \
time-macros-0.2.4 \
tinyvec-1.6.0 \
tinyvec_macros-0.1.0 \
tokio-1.21.2 \
tokio-rustls-0.23.4 \
tokio-util-0.7.4 \
toml-0.5.9 \
tracing-0.1.36 \
tracing-core-0.1.29 \
twoway-0.2.2 \
typenum-1.15.0 \
unchecked-index-0.2.2 \
unicase-2.6.0 \
unicode-bidi-0.3.8 \
unicode-ident-1.0.4 \
unicode-normalization-0.1.22 \
unicode-segmentation-1.10.0 \
unicode-width-0.1.10 \
untrusted-0.7.1 \
url-2.3.1 \
utf8-width-0.1.6 \
version_check-0.9.4 \
walkdir-2.3.2 \
wasi-0.11.0+wasi-snapshot-preview1 \
wasm-bindgen-0.2.83 \
wasm-bindgen-backend-0.2.83 \
wasm-bindgen-macro-0.2.83 \
wasm-bindgen-macro-support-0.2.83 \
wasm-bindgen-shared-0.2.83 \
web-sys-0.3.60 \
webpki-0.22.0 \
webpki-roots-0.22.5 \
winapi-0.2.8 \
winapi-0.3.9 \
winapi-build-0.1.1 \
winapi-i686-pc-windows-gnu-0.4.0 \
winapi-util-0.1.5 \
winapi-x86_64-pc-windows-gnu-0.4.0 \
windows-sys-0.36.1 \
windows_aarch64_msvc-0.36.1 \
windows_i686_gnu-0.36.1 \
windows_i686_msvc-0.36.1 \
windows_x86_64_gnu-0.36.1 \
windows_x86_64_msvc-0.36.1 \
ws2_32-sys-0.2.1 \
yaml-rust-0.4.5 \
zstd-0.11.2+zstd.1.5.2 \
zstd-safe-5.0.2+zstd.1.5.2 \
zstd-sys-2.0.1+zstd.1.5.2
Loading

0 comments on commit 31484c7

Please sign in to comment.