An unofficial, mostly Bitwarden-compatible API server written in Ruby (Sinatra and ActiveRecord)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Allow {BASE,IDENTITY_BASE,ICONS}_URL to be overridden by ENV vars

Prefix all of these with RUBYWARDEN_, but still honor ALLOW_SIGNUPS

+8 -8
+1 -1
README.md
··· 63 63 You'll probably want to run it once with signups enabled, to allow yourself 64 64 to create an account: 65 65 66 - sudo -u _rubywarden env RUBYWARDEN_ENV=production ALLOW_SIGNUPS=1 bundle exec rackup -p 4567 config.ru 66 + sudo -u _rubywarden env RUBYWARDEN_ENV=production RUBYWARDEN_ALLOW_SIGNUPS=1 bundle exec rackup -p 4567 config.ru 67 67 68 68 Once the server is running, the Bitwarden apps (such as the Firefox extension) 69 69 can be configured to use your own Bitwarden server before login.
+4 -4
lib/rubywarden.rb
··· 38 38 require "#{APP_ROOT}/lib/folder.rb" 39 39 require "#{APP_ROOT}/lib/attachment.rb" 40 40 41 - BASE_URL ||= "/api" 42 - IDENTITY_BASE_URL ||= "/identity" 43 - ICONS_URL ||= "/icons" 41 + BASE_URL = (ENV["RUBYWARDEN_BASE_URL"] || "/api") 42 + IDENTITY_BASE_URL = (ENV["RUBYWARDEN_IDENTITY_BASE_URL"] || "/identity") 43 + ICONS_URL = (ENV["RUBYWARDEN_ICONS_URL"] || "/icons") 44 44 45 45 # whether to allow new users 46 46 if !defined?(ALLOW_SIGNUPS) 47 - ALLOW_SIGNUPS = (ENV["ALLOW_SIGNUPS"] || false) 47 + ALLOW_SIGNUPS = (ENV["RUBYWARDEN_ALLOW_SIGNUPS"] || ENV["ALLOW_SIGNUPS"] || false) 48 48 end 49 49 50 50 # create/load JWT signing keys
+3 -3
spec/spec_helper.rb
··· 1 1 ENV["RUBYWARDEN_ENV"] = "test" 2 2 3 + # most tests require this to be on 4 + ENV["RUBYWARDEN_ALLOW_SIGNUPS"] = true 5 + 3 6 require "minitest/autorun" 4 7 require "rack/test" 5 8 require "open3" 6 - 7 - # most tests require this to be on 8 - ALLOW_SIGNUPS = true 9 9 10 10 require File.realpath(File.dirname(__FILE__) + "/../lib/rubywarden.rb") 11 11 require "#{APP_ROOT}/lib/app.rb"