From owner-svn-ports-head@freebsd.org Mon Jan 8 17:00:33 2018 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50B10E779EF; Mon, 8 Jan 2018 17:00:33 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F61824E7; Mon, 8 Jan 2018 17:00:33 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4101E25AD; Mon, 8 Jan 2018 17:00:32 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w08H0W51086322; Mon, 8 Jan 2018 17:00:32 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w08H0VFf086316; Mon, 8 Jan 2018 17:00:31 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201801081700.w08H0VFf086316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Mon, 8 Jan 2018 17:00:31 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r458452 - in head/security: . bitwarden-ruby bitwarden-ruby/files X-SVN-Group: ports-head X-SVN-Commit-Author: feld X-SVN-Commit-Paths: in head/security: . bitwarden-ruby bitwarden-ruby/files X-SVN-Commit-Revision: 458452 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jan 2018 17:00:33 -0000 Author: feld Date: Mon Jan 8 17:00:31 2018 New Revision: 458452 URL: https://svnweb.freebsd.org/changeset/ports/458452 Log: 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 Added: head/security/bitwarden-ruby/ head/security/bitwarden-ruby/Makefile (contents, props changed) head/security/bitwarden-ruby/distinfo (contents, props changed) head/security/bitwarden-ruby/files/ head/security/bitwarden-ruby/files/bitwarden-api.in (contents, props changed) head/security/bitwarden-ruby/pkg-descr (contents, props changed) head/security/bitwarden-ruby/pkg-plist (contents, props changed) Modified: head/security/Makefile Modified: head/security/Makefile ============================================================================== --- head/security/Makefile Mon Jan 8 16:59:35 2018 (r458451) +++ head/security/Makefile Mon Jan 8 17:00:31 2018 (r458452) @@ -46,6 +46,7 @@ SUBDIR += belier SUBDIR += bfbtester SUBDIR += binwalk + SUBDIR += bitwarden-ruby SUBDIR += blindelephant SUBDIR += boringssl SUBDIR += botan110 Added: head/security/bitwarden-ruby/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/bitwarden-ruby/Makefile Mon Jan 8 17:00:31 2018 (r458452) @@ -0,0 +1,40 @@ +# Created by: Mark Felder +# $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 Added: head/security/bitwarden-ruby/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/bitwarden-ruby/distinfo Mon Jan 8 17:00:31 2018 (r458452) @@ -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 Added: head/security/bitwarden-ruby/files/bitwarden-api.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/bitwarden-ruby/files/bitwarden-api.in Mon Jan 8 17:00:31 2018 (r458452) @@ -0,0 +1,48 @@ +#!/bin/sh +# +# Created by: Mark Felder +# $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" Added: head/security/bitwarden-ruby/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/bitwarden-ruby/pkg-descr Mon Jan 8 17:00:31 2018 (r458452) @@ -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 Added: head/security/bitwarden-ruby/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/bitwarden-ruby/pkg-plist Mon Jan 8 17:00:31 2018 (r458452) @@ -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