Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
capistrano-postgresql
Advanced tools
Note: this plugin works only with Capistrano 3. Please check the capistrano
gem version you're using before installing this gem:
$ bundle show | grep capistrano
The plugin for Capistrano 2 is here.
Capistrano PostgreSQL plugin abstracts and speeds up common administration tasks for PostgreSQL when deploying rails apps.
Here are the specific things this plugin does for your capistrano deployment process:
database.yml
file on all release nodes (using ssh)db
and app
nodes ( versions > 4.0 )Note: gem version 4 introduces some breaking changes. If you installed gem version 3 or below you might want to follow the upgrade instructions.
Put the following in your application's Gemfile
:
group :development do
gem 'capistrano', '~> 3.11'
gem 'capistrano-postgresql', '~> 6.2'
end
Then:
$ bundle install
In a standard RAILS app, you need to put the following in Capfile
file:
require 'capistrano/postgresql'
You need to include ONLY ONE of the following in your config/deploy/*.rb files:
set :pg_password, ENV['DATABASE_USER_PASSWORD'] # Example is an ENV value, but you can use a string instead
set :pg_ask_for_password, true # Prompts user for password on execution of setup
set :pg_generate_random_password, true # Generates a random password on each setup
cap ENV setup
will run ALTER USER on pg_username if there is a different password. If you're using :pg_generate_random_password, you'll get a new random password on each run.Example config:
server 'yoursite.net', user: 'ssh_username_here', roles: %w{app db}
set :stage, :development
set :branch, 'development'
# ==================
# Postgresql setup
set :pg_without_sudo, false
set :pg_host, 'db.yoursite.net'
set :pg_database, 'pg_database_name_here'
set :pg_username, 'pg_username_here'
#set :pg_generate_random_password, true
#set :pg_ask_for_password, true
set :pg_password, ENV['yoursite_PGPASS']
set :pg_extensions, ['citext','hstore']
set :pg_encoding, 'UTF-8'
set :pg_pool, '100'
Finally, to setup the server(s), run:
$ bundle exec cap development setup
config/database.yml
from your application's version control.local all all trust
. We ssh into the servers to execute psql commands.deploy_to
path exists and has the right privileges on your servers. The ~ symbol (i.e. ~/myapp
) is not supported.roles: %w{web app db}
):primary => true
on the end of your primary :db server.Read it only if you want to learn more about the plugin internals.
A full list of configuration options.
The list can be overwhelming so consult it only if you're looking for something specific.
database.yml
templateWiki page about the database.yml format.
Check out capistrano-plugins github org.
Contributions and improvements are very welcome.
If something is not working for you, or you find a bug, please report it.
Here are other plugins and people this project was based upon:
FAQs
Unknown package
We found that capistrano-postgresql demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.