Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Save and restore snapshots of stateful services to a central archive. Have a development database that you want to restore to a prior state? Just take a snapshot and restore it later!
# Uses your EDITOR to add details for the snapshot.
# Uses the default configured "stores" for creating the snapshot
dev_archive backup
# Add a message from the command line:
dev_archive backup --message "Add message from command line"
dev_archive backup -m "Add message from command line"
# Override which stores are used for the snapshot
dev_archive --store custom_store_1,custom_store_2
See the "Configure" section for how add a custom store.
# Show the full details for a given snapshot
dev_archive show {id}
# Restore the given snapshot
dev_archive restore {id}
# list all snapshots (pipe to `less` if you like)
dev_archive list
# Delete the given snapshot
dev_archive rm {id}
A custom configuration can be written at the location $HOME/.config/dev_archive.rb
. It is written in ruby. Here is an example config:
DevArchive.configure do |config|
# Configure where the snapshots are stored. Defaults to `$HOME/.dev_archive`
config.storage_path = "/path/to/snapshot_dir"
# Configure which stores are active by default (can be overridden with --store
# option on command line). The default store is "mysql_rails" which saves a
# snapshot of all databases for the Rails app found in the CWD.
config.active_stores = ["store_1", "store_2"]
# Creating a custom store:
#
# Stores must implement two methods:
#
# backup: accepts a directory for data and returns a JSON hash (with string
# keys) for use in restoring.
#
# restore: accepts the metadata JSON data created when making the backup. No
# return value.
#
# Stores can either be defined as objects/classes/modules or a builtin store
# builder can be used.
# Using an object:
class MyCustomStore
def backup(dir)
path = File.join(dir, "my_custom_store.txt")
File.write(path, "hello")
{ "path" => path }
end
def restore(metadata)
puts(File.read(metadata.fetch("path")))
end
end
config.register_store("my_custom_store", MyCustomStore.new)
# Using the store builder:
config.register_store("my_customer_store") do |store|
store.backup do |dir|
path = File.join(dir, "my_custom_store.txt")
File.write(path, "hello")
{ "path" => path }
end
store.restore do |metadata|
puts(File.read(metadata.fetch("path")))
end
end
end
FAQs
Unknown package
We found that dev_archive demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.