diff options
-rw-r--r-- | security/Makefile | 1 | ||||
-rw-r--r-- | security/bitwarden-ruby/Makefile | 40 | ||||
-rw-r--r-- | security/bitwarden-ruby/distinfo | 3 | ||||
-rw-r--r-- | security/bitwarden-ruby/files/bitwarden-api.in | 48 | ||||
-rw-r--r-- | security/bitwarden-ruby/pkg-descr | 4 | ||||
-rw-r--r-- | security/bitwarden-ruby/pkg-plist | 33 |
6 files changed, 129 insertions, 0 deletions
diff --git a/security/Makefile b/security/Makefile index 01245aba0ab4..85d3f983c59d 100644 --- a/security/Makefile +++ b/security/Makefile @@ -46,6 +46,7 @@ SUBDIR += belier SUBDIR += bfbtester SUBDIR += binwalk + SUBDIR += bitwarden-ruby SUBDIR += blindelephant SUBDIR += boringssl SUBDIR += botan110 diff --git a/security/bitwarden-ruby/Makefile b/security/bitwarden-ruby/Makefile new file mode 100644 index 000000000000..d4f8bba0fc38 --- /dev/null +++ b/security/bitwarden-ruby/Makefile @@ -0,0 +1,40 @@ +# Created by: Mark Felder <feld@FreeBSD.org> +# $FreeBSD$ + +PORTNAME= bitwarden-ruby +DISTVERSION= 0.0.0.20180103 +CATEGORIES= security www + +MAINTAINER= feld@FreeBSD.org +COMMENT= Ruby implementation of the BitWarden API + +LICENSE= ISCL + +RUN_DEPENDS= rubygem-sinatra>=2.0:www/rubygem-sinatra \ + rubygem-sinatra-contrib>=2.0:www/rubygem-sinatra-contrib \ + rubygem-unicorn>0:www/rubygem-unicorn \ + rubygem-json>0:devel/rubygem-json \ + rubygem-pbkdf2-ruby>0:security/rubygem-pbkdf2-ruby \ + rubygem-rotp>0:devel/rubygem-rotp \ + rubygem-jwt>0:www/rubygem-jwt \ + rubygem-sqlite3>0:databases/rubygem-sqlite3 \ + rubygem-rqrcode>0:www/rubygem-rqrcode + +USE_RUBY= yes +RUBY_NO_BUILD_DEPENDS= yes + +USE_GITHUB= yes +GH_ACCOUNT= jcs +GH_TAGNAME= 9628d8a + +NO_ARCH= yes +NO_BUILD= yes + +USE_RC_SUBR= bitwarden-api +SUB_LIST+= RUBY_WITH_SUFFIX="${RUBY_WITH_SUFFIX}" + +do-install: + ${MKDIR} ${STAGEDIR}/${WWWDIR} + (cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}/${WWWDIR}) + +.include <bsd.port.mk> diff --git a/security/bitwarden-ruby/distinfo b/security/bitwarden-ruby/distinfo new file mode 100644 index 000000000000..2cf1139b80b4 --- /dev/null +++ b/security/bitwarden-ruby/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1515424065 +SHA256 (jcs-bitwarden-ruby-0.0.0.20180103-9628d8a_GH0.tar.gz) = 178852ce86086f6b927cc1f41ed75ef0f3e3f8343dac5922452e91972adcfb0f +SIZE (jcs-bitwarden-ruby-0.0.0.20180103-9628d8a_GH0.tar.gz) = 27560 diff --git a/security/bitwarden-ruby/files/bitwarden-api.in b/security/bitwarden-ruby/files/bitwarden-api.in new file mode 100644 index 000000000000..00fe822b1e75 --- /dev/null +++ b/security/bitwarden-ruby/files/bitwarden-api.in @@ -0,0 +1,48 @@ +#!/bin/sh +# +# Created by: Mark Felder <feld@FreeBSD.org> +# $FreeBSD$ +# + +# PROVIDE: bitwarden-api +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# +# Add the following line to /etc/rc.conf to enable `bitwarden-api': +# +# bitwarden_api_enable="YES" + +. /etc/rc.subr +name=bitwarden_api + +rcvar=bitwarden_api_enable +load_rc_config ${name} + +: ${bitwarden_api_enable:=NO} +: ${bitwarden_api_port:=4567} +: ${bitwarden_api_signups:=NO} +: ${bitwarden_api_user:=www} +: ${bitwarden_api_group:=www} +: ${bitwarden_api_chdir=/usr/local/www/bitwarden-ruby} + +pidfile="/var/run/bitwarden/${name}.pid" +procname=%%RUBY_WITH_SUFFIX%% +command="%%PREFIX%%/bin/rackup" +command_args="-P ${pidfile} -p ${bitwarden_api_port} -E production config.ru 2>&1 | logger -t bitwarden &" +start_precmd="start_precmd" + +start_precmd() +{ + if [ ! -e /var/run/bitwarden ] ; then + install -d -o ${bitwarden_api_user} -g ${bitwarden_api_group} /var/run/bitwarden; + fi + + checkyesno bitwarden_api_signups + if [ "$?" -eq 0 ]; then + export ALLOW_SIGNUPS=1 + echo "Bitwarden Signups Enabled" + fi +} + +run_rc_command "$1" diff --git a/security/bitwarden-ruby/pkg-descr b/security/bitwarden-ruby/pkg-descr new file mode 100644 index 000000000000..388281dfbfa6 --- /dev/null +++ b/security/bitwarden-ruby/pkg-descr @@ -0,0 +1,4 @@ +A small, self-contained API server written in Ruby and Sinatra to +provide a private backend for the open-source Bitwarden apps. + +WWW: https://github.com/jcs/bitwarden-ruby diff --git a/security/bitwarden-ruby/pkg-plist b/security/bitwarden-ruby/pkg-plist new file mode 100644 index 000000000000..6efe5b18c92b --- /dev/null +++ b/security/bitwarden-ruby/pkg-plist @@ -0,0 +1,33 @@ +%%WWWDIR%%/API.md +%%WWWDIR%%/Gemfile +%%WWWDIR%%/Gemfile.lock +%%WWWDIR%%/LICENSE +%%WWWDIR%%/README.md +%%WWWDIR%%/Rakefile +%%WWWDIR%%/config.ru +@owner www +%%WWWDIR%%/db/.gitkeep +@owner +%%WWWDIR%%/lib/api.rb +%%WWWDIR%%/lib/bitwarden.rb +%%WWWDIR%%/lib/bitwarden_ruby.rb +%%WWWDIR%%/lib/cipher.rb +%%WWWDIR%%/lib/db.rb +%%WWWDIR%%/lib/dbmodel.rb +%%WWWDIR%%/lib/device.rb +%%WWWDIR%%/lib/folder.rb +%%WWWDIR%%/lib/helper.rb +%%WWWDIR%%/lib/user.rb +%%WWWDIR%%/spec/cipher_spec.rb +%%WWWDIR%%/spec/cipherstring_spec.rb +%%WWWDIR%%/spec/db_spec.rb +%%WWWDIR%%/spec/folder_spec.rb +%%WWWDIR%%/spec/icon_spec.rb +%%WWWDIR%%/spec/identity_spec.rb +%%WWWDIR%%/spec/spec_helper.rb +%%WWWDIR%%/tools/1password_import.rb +%%WWWDIR%%/tools/activate_totp.rb +%%WWWDIR%%/tools/bitwarden_import.rb +%%WWWDIR%%/tools/lastpass_import.rb +%%WWWDIR%%/tools/mitm.rb +@dir(www,www,0750) %%WWWDIR%%/db |