ipfs-ios-backup

command module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2020 License: MIT Imports: 1 Imported by: 0

README

ipfs-ios-backup

Command line utility to backup iOS devices to an embedded and private IPFS node.

Installation

Homebrew

brew tap codynhat/ipfs-ios-backup
brew install ipfs-ios-backup

Building from source

Requirements
  • Go 1.14+
  • libimobiledevice
libimobiledevice

libimobiledevice is a cross-platform library that enables communication with iOS devices. The main project has been forked to include a few more features needed for ipfs-ios-backup.

See the README for more info.

Usage

Backup iOS devices to IPFS

Usage:
  ipfs-ios-backup [command]

Available Commands:
  backups        Interact with iOS backups
  daemon         Run the ipfs-ios-backup daemon
  devices        Interact with connected iOS devices
  export-secrets Export secrets needed to sync backups with another device
  help           Help about any command
  init           Initialize ipfs-ios-backup repo

Flags:
      --apiAddr string       gRPC API endpoint (default "/ip4/127.0.0.1/tcp/3006")
      --config string        config file (default is $HOME/.ipfs-ios-backup.json)
      --debug                Enable debug logging
  -h, --help                 help for ipfs-ios-backup
      --ipfsAddr string      IPFS address (default "/ip4/0.0.0.0/tcp/4010")
      --repoPath string      Path to IPFS iOS Backup repo (default "$HOME/.ipfs-ios-backup.json")
      --threadsAddr string   Threads IPFS lite node address (default "/ip4/0.0.0.0/tcp/3010")

Use "ipfs-ios-backup [command] --help" for more information about a command.

Initialize repo

The repo will need to be initialized before doing anything.

ipfs-ios-backup init

By default, the repo will be $HOME/.ipfs-ios-backup. You can use the --repoPath flag to set a custom path

ipfs-ios-backup init --repoPath=$HOME/.ipfs-ios-backup-custom

or set repoPath in the configuration file at $HOME/.ipfs-ios-backup.json.

{
  "repoPath": "$HOME/.ipfs-ios-backup-custom"
}

Schedule Automatic Backups

Backups can be automatically performed in the background by the daemon. This can be enabled in the configuration (default is $HOME/.ipfs-ios-backup.json).

{
  "schedules": {
    "{DEVICE_NAME}": {
      "deviceID": "{DEVICE_ID}",
      "periodInHours": 6,
      "minBatteryLevel": 50
    }
  }
}

Where {DEVICE_NAME} and {DEVICE_ID} are the name and ID of the device you want to backup, respectively. See finding devices for how to find the device ID.

Each schedule has the following parameters:

Option Description
periodInHours How many hours should pass between backups
minBatteryLevel The minimum battery level required to perform a backup when a device is not charging

Notes:

  • If a device is connected to a charger, minBatteryLevel is ignored
  • It is common for a device to not always be detected on WiFi. Therefore, the periodInHours is a best-effort and is not guaranteed

Run the daemon

Interacting with and performing scheduled backups requires the daemon to be running

ipfs-ios-desktop daemon

brew service (macOS launchd)

If installed via Homebrew, the daemon can be started automatically at launch.

brew services start ipfs-ios-backup

Logs can be found at ${HOMEBREW_PREFIX}/var/log/ipfs-ios-backup.log

Finding devices

Search for devices connected via USB or on the same Wifi network.

ipfs-ios-backup devices list

Enable backups for a device

ipfs-ios-backup backups enable [device-id]

You will be prompted to enter a password to use for encrypting backups for this device. The password is not stored anywhere on your computer. The backup is encrypted on your iOS device before any data is sent to your computer.

Perform a backup

ipfs-ios-backup backups perform [device-id]

Restore a backup

A backup can be restored to a device. YOUR DEVICE AND DATA WILL BE RESTORED. You will be prompted to enter the password of the backup before the restore begins.

ipfs-ios-backup backups restore [device-id]

Sync backups with multiple devices

Backups can be stored on multiple devices that are part of the same private IPFS network. This may be multiple computers on your home network, or a private cloud-hosted instance.

To start, a single node must be initialized. Then the secrets from this node will need to be exported.

ipfs-ios-backup export-secrets > secrets.json

The output should be saved and sent via some secure mechanism to other machines that want to join the network. These secrets can be passed when initializing these other machines.

ipfs-ios-backup init --secrets secrets.json

WARNING: Only send these secrets to trusted nodes. They will join a private IPFS swarm that has access to your backups. While the backups' contents are still encrypted using a password, the metadata is not. Any node that is part of this network will have access to the metadata.

Architecture

IPFS iOS Backup Architecture

Roadmap

  • Encryption of metadata
  • Integration with pinning services

Support

Please consider supporting this project on Gitcoin. Through future improvements the hope is to make this more accessible and increase adoption of IPFS and Filecoin.

Documentation

Overview

Copyright © 2020 Cody Hatfield <cody.hatfield@me.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis
api
pb

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL