diff options
-rw-r--r-- | .SRCINFO | 24 | ||||
-rw-r--r-- | .gitignore | 6 | ||||
-rw-r--r-- | PKGBUILD | 39 | ||||
-rw-r--r-- | lesma.service | 14 | ||||
-rw-r--r-- | lesma.toml | 55 |
5 files changed, 138 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..3c15ba169ee9 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,24 @@ +pkgbase = lesma + pkgdesc = A small and ultrasecure Lesspass database server written in Rust + pkgver = 0.6.0 + pkgrel = 1 + url = https://gitlab.com/ogarcia/lesma + arch = arm + arch = armv6h + arch = armv7h + arch = aarch64 + arch = i686 + arch = x86_64 + license = GPL3 + makedepends = rust + depends = gcc-libs + options = !lto + backup = etc/lesma.toml + source = https://gitlab.com/ogarcia/lesma/-/archive/0.6.0/lesma-0.6.0.tar.bz2 + source = lesma.toml + source = lesma.service + b2sums = 011a07fd4b6652c936ba81e392f601d8bd162cb10e1ecf0a8b3cbc56917c77ba33a8fb307a82c901ea9466d0f82621ef7db86f3fbff49edc0b57b116bb9cc206 + b2sums = 669031b846b817a48e7aa621df34fbf85102e8da6ab58e77ab6ac4abbb77d3632933881116f256e49a22cff3ecd52712ce9e34f451cef778d8e61762ad3609d2 + b2sums = 6512f2d4fc6852cbcb96469890d15ab922d46eeeb6f25b234b074966f3a17b5748936fd5898a0e3c914b59f5b526595cff17f8abc856e58fb5cb4acd83ef2515 + +pkgname = lesma diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..dd572daed645 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +* +!.gitignore +!lesma.service +!lesma.toml +!PKGBUILD +!.SRCINFO diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..cb092cc5e57e --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,39 @@ +# Maintainer: "Amhairghin" Oscar Garcia Amor (https://ogarcia.me) + +pkgname=lesma +pkgver=0.6.0 +pkgrel=1 +pkgdesc='A small and ultrasecure Lesspass database server written in Rust' +arch=('arm' 'armv6h' 'armv7h' 'aarch64' 'i686' 'x86_64') +url='https://gitlab.com/ogarcia/lesma' +license=('GPL3') +depends=('gcc-libs') +makedepends=('rust') +options=('!lto') +backup=("etc/${pkgname}.toml") +source=("https://gitlab.com/ogarcia/${pkgname}/-/archive/${pkgver}/${pkgname}-${pkgver}.tar.bz2" + "${pkgname}.toml" + "${pkgname}.service") +b2sums=('011a07fd4b6652c936ba81e392f601d8bd162cb10e1ecf0a8b3cbc56917c77ba33a8fb307a82c901ea9466d0f82621ef7db86f3fbff49edc0b57b116bb9cc206' + '669031b846b817a48e7aa621df34fbf85102e8da6ab58e77ab6ac4abbb77d3632933881116f256e49a22cff3ecd52712ce9e34f451cef778d8e61762ad3609d2' + '6512f2d4fc6852cbcb96469890d15ab922d46eeeb6f25b234b074966f3a17b5748936fd5898a0e3c914b59f5b526595cff17f8abc856e58fb5cb4acd83ef2515') + +build() { + cd "${pkgbase}-${pkgver}" + cargo build --release --locked --target-dir=target +} + +package() { + # binary + install -Dm755 "${srcdir}/${pkgbase}-${pkgver}/target/release/${pkgname}" \ + "${pkgdir}/usr/bin/${pkgname}" + # conf + install -Dm644 "${srcdir}/${pkgname}.toml" "${pkgdir}/etc/${pkgname}.toml" + # service + install -Dm644 "${srcdir}/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service" + # templates and static directories + install -dm755 "${pkgdir}/usr/lib/${pkgname}" + cp -r "${srcdir}/${pkgbase}-${pkgver}/templates" \ + "${srcdir}/${pkgbase}-${pkgver}/static" \ + "${pkgdir}/usr/lib/${pkgname}" +} diff --git a/lesma.service b/lesma.service new file mode 100644 index 000000000000..35b87a3a0628 --- /dev/null +++ b/lesma.service @@ -0,0 +1,14 @@ +[Unit] +Description=Simple paste app friendly with browser and command line +Documentation=https://gitlab.com/ogarcia/lesma/-/blob/master/README.md +Wants=network-online.target +After=network-online.target + +[Service] +Type=simple +DynamicUser=yes +StateDirectory=lesma +ExecStart=/usr/bin/lesma + +[Install] +WantedBy=multi-user.target diff --git a/lesma.toml b/lesma.toml new file mode 100644 index 000000000000..43f038b6da37 --- /dev/null +++ b/lesma.toml @@ -0,0 +1,55 @@ +# You can have several different profiles and use LESMA_PROFILE environment +# variable to switch between them. By default release is used. +# See https://rocket.rs/v0.5-rc/guide/configuration/#profiles for more info. +# +# All configuration parameters can also be set with environment variables. +# For each parameter, the corresponding environment variable is indicated. +# Note that all parameters are optional, if not defined the default values +# are used. +# +# If you want to use this configuration file, copy it as /etc/lesma.toml or +# as lesma.toml together with the executable file. +[release] +# Listen address, default 127.0.0.1 +# LESMA_ADDRESS +address = "127.0.0.1" +# Listen port, default 8000 +# LESMA_PORT +#port = 8000 +# When a new URL for a paste or file is generated use http or https, by +# default is set to false and uses http +# LESMA_HTTPS +https=true +# Log level, the valid values are `critical`, `normal`, `debug`, `off`, if +# not defined the default value is off +# LESMA_LOG_LEVEL +#log_level = "normal" +# The size limit sets both the limit for uploaded files and for the +# information posted, default 10MiB. If you simply indicate a number the +# size is in bytes but you can use the suffixes kB, MB, GB.. for powers of +# ten or KiB, MiB, GiB.. for powers of two +# LESMA_SIZE_LIMIT +#size_limit = "5GiB" +# Default download limit for every paste or file created where a different +# value is not specified , default 0 (unlimited), maximum accepted value 255 +# LESMA_DEFAULT_LIMIT +#default_limit = 1 +# Default expiration time (in hours) for each paste or file created when +# a different value is not specified, default 720 hours (30 days) +# LESMA_DEFAULT_EXPIRE +#default_expire = 24 +# Maximum expiration time that an user can set (in hours) for each paste or +# file, default 720 hours (30 days) +# LESMA_MAX_EXPIRE +#max_expire = 168 +# Location of lesmas storage, if not defined, a temporary directory will be +# used, usually /tmp +# LESMA_STORAGE +storage = "/var/lib/lesma" + +# Other sample +#[debug] +#address = "127.0.0.1" +#port = 9000 +#log_level = "debug" +#storage = "/tmp/lesma" |