• This repository has been archived on 18/Apr/2023
  • Stars
    star
    103
  • Rank 332,978 (Top 7 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 9 years ago
  • Updated almost 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Automatically disable dangerous Rake tasks in production

Rails Safe Tasks

This gem provides an extra layer of safety between you and deleting all your production data by accident.

It restricts the use of various rake tasks (including db:drop, db:reset etc...) when you are running your application in a production environment.

Screenshot

Installation

To install, just add to your Gemfile and run bundle.

gem 'rails_safe_tasks', '~> 1.0'

Usage

You don't need to do anything to get started but you can add some extra configuration if you wish.

# Add another task to the list of dangerous tasks
RailsSafeTasks.dangerous_tasks << 'another:task'

# Also can add your own custom environment to the list of restricted
# environments.
RailsSafeTasks.restricted_environments << 'SOME_ENV'

# Specify a custom rule for checking whether or not the current environment
# should be protected or not. Return true if the current environment should
# be protected. In this example, the presence of the 'VDT_APP' environment
# variable means we should be in a cautious state.
RailsSafeTasks.custom_check do
  !!ENV['VDT_APP']
end

# Protect a task which is not already initialized when the Gem is included.
namespace :my_app do
  task :wipe_everything do
    # Here be dragons...
  end
end

Rake::Task['my_app:wipe_everything'].enhance ['rails_safe_tasks:disable']

More Repositories

1

staytus

💡 An open source solution for publishing the status of your services
Ruby
2,169
star
2

procodile

🐊 Run processes in the background (and foreground) on Mac & Linux from a Procfile (for production and/or development environments)
Ruby
616
star
3

authie

👮‍♂️ Improve user session security in Ruby on Rails applications with database session storage
Ruby
234
star
4

documentation

A Rails engine to provide the ability to add documentation to a Rails application
Ruby
214
star
5

vat-rates

172
star
6

fake-person

Create some fake personalities
Ruby
116
star
7

memist

A Ruby Memoization Helper
Ruby
76
star
8

json-vat

A Ruby client library for jsonvat.com
Ruby
69
star
9

ghost-theme

The theme used on my Ghost blog at http://blog.adamcooke.io
CSS
59
star
10

florrick

A Rails extension for providing awesome user-initiated string interpolation
Ruby
57
star
11

key-installer

Installs SSH public keys on remote hosts from a single command
Ruby
49
star
12

moonrope

A library to help with building an RPC-like JSON API
Ruby
34
star
13

apns-proxy

A proxy for sending requests to the Apple Push Notification Service
Ruby
21
star
14

muck

A tool for backing up remote MySQL databases
Ruby
18
star
15

runa

A redis-powered job/background runner
Ruby
17
star
16

changey

Run callbacks based on changes to attributes in Active Record
Ruby
17
star
17

param-auto-permit

Automatically permit attributes which are present in the sending form
Ruby
15
star
18

mysql-http-api

An HTTP API to any MySQL Database
Ruby
12
star
19

riptables

A Ruby DSL for generating iptables configuration
Ruby
12
star
20

send_file_with_range

A Rails addition which will allow sending of files with appropriate range headers
Ruby
12
star
21

budgets

A little Rails app to help manage your finances
Ruby
12
star
22

keyman

A utility for managing distributed authorized keys
Ruby
11
star
23

actionnav

🗺 A navigation manager for Rails apps
Ruby
11
star
24

seeka

An Active Record Search Interface
Ruby
10
star
25

railswork

Source for www.railswork.com
Ruby
9
star
26

procodile-capistrano

Capistrano 2 and 3 recipes for Procodile
Ruby
9
star
27

checken

🐓 An authorization framework for Ruby & Rails applications
Ruby
9
star
28

myxi

A web socket server for Ruby with RabbitMQ
Ruby
9
star
29

geolocate

A Ruby library to return information about a given IP (currently using ip-api.com)
Ruby
9
star
30

nissh

A wrapper for net/ssh to allow easy command execution
Ruby
9
star
31

datey

A Ruby library for interrogating and formatting dates
Ruby
9
star
32

hmrc-moss-return

A Ruby library to generate HMRC VAT MOSS Return files
Ruby
8
star
33

authorized_networks

🔐 Easily restrict access to networks based on source IP
Ruby
8
star
34

twitterfications

A Rails plugin which allows you to send tweets to alert you of specific activities within your app with considerable ease
Ruby
8
star
35

procman

A very simple process manager for Ruby apps
Ruby
8
star
36

rails-template

My template for creating new Rails applications
Ruby
8
star
37

parameter_sets

🍔 A friendly schema for defining permitted parameters in Rails controllers
Ruby
8
star
38

color_fun

A little gem for doing stuff with colors
Ruby
7
star
39

apiable-model-errors

Provide ActiveModel errors in an format suitable for API consumers
Ruby
6
star
40

lizard

🏞 Very simple ImageMagick interface for Ruby
Ruby
6
star
41

sqb

👷‍♀️ A very simple but effective SQL query builder
Ruby
6
star
42

moss-return-api

An API to generate HMRC VAT MOSS Return ODS files from JSON
Ruby
6
star
43

log_logins

🖍 A small library to log login attempts & block after too many failed attempts
Ruby
6
star
44

rails-env-config

Set environment variables for your local development
Ruby
5
star
45

sshake

🤝A friendly SSH interface on top of net/ssh
Ruby
5
star
46

hs1xx

Control TP-Link HS100/HS110 devices from Ruby
Ruby
5
star
47

apns-key-convert

A script to create PEM files from P12 and CER files.
Ruby
4
star
48

dasher-ruby

A Ruby library for Dasher
Ruby
4
star
49

ipgeo-server

Simple HTTP interface to a MaxMind IP database
Ruby
4
star
50

waiter

⏳ A tiny application that waits for a set of services to become available before exiting clean. Ideal for init containers.
Go
4
star
51

jobster

🦐 A RabbitMQ-based job queueing system for lobsters and absolute pros.
Ruby
4
star
52

growler

A simple codebase/github post-receive script to send a growl notification for each commit to a group of networked machines whenever a push is received.
PHP
4
star
53

chuck-divides-by-zero

Ruby
3
star
54

potamus

Utility for building and publishing Docker images
Ruby
3
star
55

apns-client

A client library for APNS Proxy
Ruby
3
star
56

plesk

Plesk for Ruby
Ruby
3
star
57

hippo

Deployment orchestration for Kubernetes
Ruby
3
star
58

rubysnippets

Sublime Text 3 snippets for Ruby & Rails
3
star
59

secure_random_string

A random string generator
Ruby
3
star
60

moonrope-client

A client library for the Moonrope server
Ruby
3
star
61

maxminder

Ruby library for the MaxMind minFraud checking service
Ruby
3
star
62

uu

Some useful things for your Rails applications
Ruby
3
star
63

bluebird

🐦 A TUI for quickly accessing a library of pre-defined commands
Go
3
star
64

bask-proxy

🐊🐊🐊 Manage multiple procodiles on your development environment
Ruby
2
star
65

moonrope-workbench

A graphical frontend to use when testing Moonrope APIs
CSS
2
star
66

shoppe

The original Shoppe
Ruby
2
star
67

ipgeo-ruby

A Ruby library for talking to the IPGeo Server
Ruby
2
star
68

uk_vat_rate

Ruby
2
star
69

rack-custom-proxies

Allow the list of trusted proxies to be set by environment variable
Ruby
2
star
70

ghost-theme-2015

My blog's Ghost theme
CSS
2
star
71

LlamaKit

Some bits and bobs for iOS/tvOS development
Swift
1
star
72

cloudapp-exporter

Ruby
1
star
73

notes

1
star
74

llama-app

An empty app to use a skeleton for new Rails applications
Ruby
1
star
75

gandi

Gandi Domain Registration Library for Ruby
Ruby
1
star
76

moonrope-oc-sdk

Moonrope Objective C SDK
Objective-C
1
star
77

documentation-elasticsearch

An Elasticsearch module for Documentation
Ruby
1
star
78

webnull

A web server that accepts requests and returns the status you want
Ruby
1
star
79

swamp

A framework for writing simple CLI applications
Ruby
1
star
80

swipe

A Javascript App Framework
JavaScript
1
star
81

ripe-db

A Ruby library for talking to the RIPE datbaase
Ruby
1
star
82

localresolv

A DNS server which returns 127.0.0.1 for any domain you provide
Ruby
1
star
83

moonrope-workbench-osx

An OS X Application Wrapper for the Moonrope Workbench Tool
Objective-C
1
star
84

ACToolkit

A set of useful tools which I used when developing iOS applications
Objective-C
1
star
85

records-manipulator

Add manipulations to an Active Record scope to change the records when they are finally returned from the database
Ruby
1
star
86

monograph

A tool to help writers write content in Markdown and easily export into an HTML site.
Ruby
1
star
87

imap-gmail-importer

Ruby
1
star
88

advent-of-code

Ruby
1
star