Skip to content
alonsovidalesPublic

About

A private, decentralised social network and home cloud for your family, on a Raspberry Pi 5: share photos and videos with friends from device to device, back up your phones and keep your files in sync. Free and open source, with iPhone, Android, Mac, Windows and Linux apps.

Topics

Resources

Contributing

Stars

7 stars

Watchers

0 watching

Forks

Latest commit

 

History

1,639 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Off The Cloud

Off The Cloud is free, open-source software that gives your family its own private social network and home cloud on a Raspberry Pi 5: share photos and videos with the friends you accept, from device to device, back up every phone and keep your files in sync, instead of Instagram, Google Photos, iCloud, Google Drive or Dropbox. With iPhone, Android, Mac, Windows and Linux apps.

Website · Live demo · App Store (iPhone, iPad and Mac) · Google Play · otc-sync for Windows and Linux · Press kit

The social network is decentralised: each family's posts live on its own device, and friends' devices fetch them from each other, with comments, likes and notifications, newest first: no ads, no algorithm, no strangers, and no company server holding everyone's photos. The same device is a NAS for your files: the Mac, Windows and Linux apps keep folders on your computers in sync or backed up, and Files in the apps and the web app works like a drive, with share links and upload-only folders that keep earlier versions. The phone apps back up your photos and videos in the background, in full resolution. The device tags them itself, and recognises faces if you turn that on, so you can search for "beach" or "dog" without any photo being sent away to be analysed, and your files are encrypted at rest under a key only your password unlocks. The device also serves a web app for any browser. The apps are published: the Mac app on the Mac App Store since 2026-10-06, the Android app on Google Play since 2026-10-10 and the iPhone app on the App Store since 2026-10-21.

Off The Cloud (OTC) is hosted in your home using your network connection and inexpensive hardware, everything is designed to work on a Raspberry Pi 5 with 8GB of RAM (a 4GB one works too, with Image Tagging as an option, and a 2GB one for a single person) and two USB drives in a RAID 1 configuration to store the data (USB sticks, SSDs, hard disks or MicroSD cards in USB card readers).

OTC is composed of five systems:

The "device"

This is the Raspberry Pi 5 that stores all your data, on two USB drives mirrored as RAID 1 (in the photo, two microSD cards in USB card readers), with two optional status LEDs that show the mirror's health (how to wire them)

The Off The Cloud device: a Raspberry Pi 5 whose mirrored drives are two microSD cards in USB card readers, with a card being swapped and the status lights red and green

The macOS app

A menu-bar app, on the Mac App Store, that keeps folders on your computer in sync with the device - watch local folders, or pull a remote folder down to a local one

The Mac menu bar app, connected to the device, with six folders backed up or in sync and an Add Folder button

The Windows and Linux clients

The same sync client for Windows and Linux, otc-sync: a tray icon with the same menu (status, the RAID's health as the icon's colour, "Open Web App" for your device's web app in the browser, your folders, "Add Folder…" - the kind of folder, its options, then the folder - and settings), plus a command line, and on Linux it can run as a service on a machine nobody logs into. Once it has connected to your device it asks whether to start when you log in (nothing is set up until you say yes; "Start at login" in the menu changes it later), and it updates itself: when a new version is out, the menu shows "⬆ Update otc-sync to …" and one click installs it (otc-sync update on the command line). Updates are signed with the project's release key and checked before they are installed. Download it from off-the.cloud or the desktop release:

System File
Windows (Intel/AMD) otc-sync-windows-amd64.exe
Windows (ARM) otc-sync-windows-arm64.exe
Linux (Intel/AMD) otc-sync-linux-amd64
Linux (ARM, e.g. a Raspberry Pi) otc-sync-linux-arm64

Setting up a new device: "Set Up a New Device…" in the tray menu (or otc-sync flash in a terminal) downloads the device image, checks its signature, writes it to an SD card (it asks for administrator permission and lists only cards and removable disks; it refuses a disk that holds a folder otc-sync syncs, and asks a second time before erasing one larger than 128 GB), verifies the card and deletes the download. The Mac app has the same wizard and uses Raspberry Pi Imager to write the card.

Windows: run the .exe once; it appears in the tray and asks for your device and password, and once connected, whether to start at login ("Start at Login" / "Not Now"). Keep it somewhere permanent (not Downloads), since that path is what starts at login.

Linux, with a desktop:

install -Dm755 otc-sync-linux-amd64 ~/.local/bin/otc-sync   # yours, so it can update itself
otc-sync            # the tray app; once connected it asks whether to start at login (~/.config/autostart)

Linux, command line and service (a server, a Pi, a box with no desktop):

otc-sync settings --name cala --password-prompt   # or --address ws://192.168.1.10:8080/ws
otc-sync add ~/Documents                          # two-way sync of a folder from this computer
otc-sync add --upload-only ~/Projects             # the same, but nothing in it is ever deleted on the device
otc-sync add-remote /Photos ~/Photos              # two-way sync with a device folder (no options)
otc-sync backup --keep-out-of-images ~/Scans      # backed up, but kept out of Images
otc-sync images <id> keep-out|show                # keep a synced folder out of Images, or show it again
otc-sync delete-held <id> [--yes]                 # delete on the device too what was deleted here at once
otc-sync ls /                                     # browse the device
otc-sync open                                     # the device's web app in the browser (prints its address)
otc-sync service install                          # run as a systemd user service, from boot
otc-sync status                                   # what it is doing
otc-sync folders | remove <id> | service uninstall | autostart on|off|status

Adding a folder takes two steps in the Mac app and the tray: first the kind of folder (a backup of a folder on this computer, a two-way sync of one, or a two-way sync of a folder already on the device), then the options that kind has, and only then the folder itself. A folder from this computer can be:

  • Upload only (two-way folders; a backup always is): the device keeps every older version of a file, and nothing in the folder can be deleted on the device. A file you delete on this computer stays on the device and isn't downloaded again; files added or changed on the device still come down. Turn it off later with the lock on the folder in Files (web app, phone app); the files you deleted on this computer while it was on then come back to it. Until the device has made the folder upload only (an older device does it once it is updated), nothing deleted on this computer is deleted on the device. On the command line: otc-sync add --upload-only.
  • Kept out of Images: its photos and videos still go to the device and show in Files, but they aren't tagged, searched for faces or shown in Images. You can change it later from the folder's row on the Mac (the eye), its menu in the tray, or otc-sync images. On the command line: --keep-out-of-images on backup and add.

A folder synced from the device has no options: it keeps what is set for it on the device. The tray asks the options in one checklist on Linux, and one Yes / No / Cancel question each on Windows (its dialogs have no checkboxes). A device that hasn't been updated yet does them once it is.

Nothing deleted by mistake: a file deleted on the device (from the web app, a phone or another computer) goes to this computer's trash rather than away for good - the desktop's trash on Linux (otc-sync empties what it put there after 30 days, so a computer with no desktop doesn't fill up), the Recycle Bin on Windows, and on a disk without one (a network share, a USB stick on Windows, a drive whose Recycle Bin is turned off or too small for the file) a .otc-trash folder inside the synced folder (or at the top of a disk mounted inside it), emptied after 30 days. Many files deleted on this computer at once (more than 20, and a quarter of the folder) aren't deleted on the device: the folder says so, and if you meant it, "Delete Them on the Device Too…" in its menu (or otc-sync delete-held <id>, or deleting them from the web app or a phone) finishes the job. It asks first, and deletes exactly the files it asked about - with their older versions, for good: if more were deleted here meanwhile, it asks again. The same guard keeps files the device lost from being deleted here. Each two-way folder holds a small hidden file, .otc-sync-<id>, by which otc-sync knows it is the folder it synced: when a disk or network share isn't mounted and its empty mount point is there instead - or another disk, or a new folder at the same place - the folder says "Not the folder that was synced" and changes nothing until the right one is back. To sync the folder that is there now instead, remove it from otc-sync and add it again, which deletes nothing. A file that is now a link, a file hidden in Windows' Explorer and a device file whose name Windows can't hold are left as they are on the device, and the folder says so, as it does for files that couldn't be downloaded (no room on the disk, or a file over 4 GB on a FAT32 one).

The Mac app follows the same rules. What is deleted on the device goes to the Trash, or on a network share that has none to the same .otc-trash folder; many files deleted on the Mac at once stay on the device, until "Delete Them on the Device Too…" under the folder's row deletes them there as well; and each two-way folder holds the same kind of hidden .otc-sync-<id> file - when iCloud's Desktop & Documents is turned off and macOS leaves an empty Documents folder in place of the synced one, or another disk with the same name is plugged in, the folder waits instead of emptying the device's copy. To sync the folder that is there now, pick it again with Add Folder…, which links it to its row and deletes nothing. A file hidden in the Finder or turned into a link stays as it is on the device, and the folder says so.

Only one process syncs at a time: with the service installed, the tray app becomes a viewer of it, and every change made from the tray or the command line is picked up by the service at once. The password goes to the OS keyring (Windows Credential Manager, the Secret Service on a Linux desktop); without one, to a file only your user can read under ~/.config/otc-sync/ (OTC_SYNC_NO_KEYRING=1 forces that, for a service that has to start before the keyring is unlocked). Folders land on the device under /windows/<computer>/… and /linux/<computer>/…, like the Mac's /mac/<computer>/….

At home it doesn't go through off-the.cloud. Once signed in there, it asks the device for its home-network address and the fingerprint of the device's own certificate, and from then on tries that address first, over TLS that accepts only that certificate; the bridge is used when the device doesn't answer at home within a few seconds. The status line says which: "Connected over your home network" or "Connected through off-the.cloud".

The iOS/Android app

On the App Store for iPhone and iPad, and on Google Play. This is used to access all the data, sync photos and documents from your mobile device, Social Network app and much more

Social feed: photo posts with likes, comments and multi-photo carousels Images: the photo library, with people recognised on the device and tag search Search: the 'Dog' tag combined with a person filter - both narrow the same search

Files: browse, select and share files and folders Notifications: friend requests, likes and comments

The Web app

With this you can access all your data and social network from any browser just with your password

Social feed in the browser

Images: a tag search alongside the people recognised on the device

Collections: create one from a selection, add to it, open it and keep searching inside

Files: browse, upload by drag and drop, select and share

Notifications

Recommended Hardware

  • 1x Raspberry Pi 5 with 8GB of RAM. 8GB is recommended. A 4GB one runs everything, and has room for one extra user at most. There Image Tagging starts off: its model takes about 1-2GB more of the memory and new photos are processed about four times slower, so it is yours to turn on in Settings (Smart search finds photos by what they show without it, and Face Recognition fits either way). A 2GB one runs one person's library: no Image Tagging and no other users.
  • 2x USB drives of the same size for storage (USB sticks, SSDs, hard disks, or MicroSD cards in USB card readers), plugged into the Pi 5's two blue (USB 3) ports: they are the fast ones, and if a drive fails the device tells you which port it is in (top or bottom)
  • 1x MicroSD card to host the OS in the RaspberryPi
  • 1x Power Supply (Use something of at least 27W since the consumption is quite high when processing images)
  • 1x Active Cooler
  • Optional, to print yourself: a case - the cloud case for a shelf or a desk, or the screen case that hangs a portable screen on the wall with the device behind it. Both take a GeeekPi Armor Lite V5 cooler in place of the Active Cooler (all cases).

Installation of the device

There are four ways to set up a device, from least to most work: flash the pre-built image (a Raspberry Pi 5 with 8 GB of RAM, or 4 GB (Image Tagging off until you turn it on), or 2 GB for one person - no keyboard, monitor or Linux knowledge needed, RAID1 included), run the one-line install script against a machine you already have login access to (Ubuntu, Debian, Raspberry Pi OS or another Debian-based 64-bit distro - no flashing, RAID1 and the status LEDs included, no WiFi setup), run that same script on a plain Raspberry Pi OS install from your computer with Makefile.pi, or follow the manual steps yourself.

Option 0: One-line install script (any Debian/Ubuntu machine)

Already have a Debian/Ubuntu-family Linux box you can log into (Ubuntu, Debian or Raspberry Pi OS, 64-bit - a Raspberry Pi, an old laptop, a VPS)? Skip flashing anything - log in and run (on Debian 12, Ubuntu 24.04, Linux Mint 22 and others whose OpenCV is older than 4.10, it first builds OpenCV itself, which adds 5 to 30 minutes):

$ curl -fsSL https://raw.githubusercontent.com/alonsovidales/otc/main/scripts/verified-install.sh | sudo bash -s -- <subdomain>

<subdomain> is this device's bridge address, e.g. pit for pit.off-the.cloud - omit it and the script prompts for one. On the off-the.cloud bridge the name has to belong to an account: register it first, as Bridge accounts explains, or install with OTC_BRIDGE_ADDR="" for a device on your home network only. It installs MariaDB, a native Go toolchain, ONNX Runtime, the RAM++ tagging model, and builds the otc binary from source right there, then writes the database schema, app config, and a systemd service - no cross-compiling or second computer needed (Makefile.pi, Option 2, runs this same script over SSH from another computer). It's safe to re-run any time (e.g. to pick up new code) - device identity (UUID, DB password, bridge secret) is only ever generated once, on the first run.

Storage is a RAID1 mirror of two disks by default, OTC_DISK1/OTC_DISK2 (/dev/sda and /dev/sdb unless you set them). An existing array on them is reassembled, never wiped - which is how a machine re-installed with its old disks gets everything back. Two new disks are only erased and mirrored when you confirm it with OTC_RAID_CONFIRM_WIPE=yes; without that, or with no disks to mirror, the script stops at the storage step, before touching any disk, and says what to do. OTC_SKIP_RAID=1 installs on a single disk instead (the storage is then a plain directory on the system disk). The script also installs the RAID status-LED watcher (raid-watch.service): on a Raspberry Pi it drives the two LEDs wired as in Wiring the status lights, and elsewhere it runs without lights. For example, for two blank disks:

$ curl -fsSL https://raw.githubusercontent.com/alonsovidales/otc/main/scripts/verified-install.sh | sudo OTC_RAID_CONFIRM_WIPE=yes bash -s -- <subdomain>

The script leaves the machine's SSH settings as they are, so you keep logging in the way you do now. (Releases 59 to 136 turned off password and root logins over SSH on every install; if that locked you out, log in at the console or with a key and delete /etc/ssh/sshd_config.d/01-otc-keys-only.conf. Only devices made from the image below keep it, because their console account has a published password.)

What this path doesn't set up is the image's first-boot setup over Bluetooth: it assumes a machine you already have network/login access to. For a Raspberry Pi from scratch, the pre-built image below handles everything from a first boot with nothing pre-configured.

Option 1: Flash the pre-built image (easiest - Raspberry Pi 5, 8 GB of RAM recommended)

Use the official Raspberry Pi 27 W USB-C power supply (or a better one): a Pi 5 on a weaker supply, with USB disks attached, can restart or hang from low voltage while it processes photos. The image is for a Raspberry Pi 5 with 8 GB of RAM (the tagging model and the build from source need the memory); a 4 GB one runs everything, with Image Tagging off until you turn it on in Settings, and has room for one extra user at most, and a 2 GB one runs one person's library, without Image Tagging or other users. It is a stock Raspberry Pi OS Lite with a first-boot setup wizard on it and nothing else (about 530 MB). The wizard asks for your WiFi, the device's name and its disks, then installs the current software with the same install.sh as Option 0, showing its progress - so there is never an "old image": whatever you flash installs today's release.

  1. Download off-the-cloud-rpi-lite-arm64.img.xz (the .sha256 next to it lets you check the download with shasum -a 256 -c).
  2. Flash it to a MicroSD card with Raspberry Pi Imager: choose "Use custom", pick the downloaded .img.xz file, select your card, and write. Don't use Imager's own Customisation step - the wizard handles WiFi and identity itself.
  3. Plug in the USB disks you want to use (two for RAID1) into the two blue USB ports, put the card in the Pi and power it on. After a minute it announces itself over Bluetooth. Set it up from your phone with the app (iOS or Android): on the welcome screen tap Set up a new device. The app finds the Pi over Bluetooth and runs the wizard right there; your phone stays on its own WiFi. Already signed into another device? Log out first, in Settings - the app then belongs to the device you set up. Setup is over Bluetooth only: the wizard isn't reachable from the network, and once a phone has connected to the Pi for setup, no other phone can.
  4. The wizard walks through five steps:
    • WiFi: pick your network (the list fills in by itself) and enter its password - 2.4 or 5 GHz. Wired into your router instead? Skip it. You can change it later in Settings > Wi-Fi.
    • Storage: the disks it found, with sizes. Pick two to mirror them as RAID1 (both are wiped), or none to keep everything on the SD card for now.
    • Account: sign in to your bridge account or create one, or type a setup code from the account page; "Continue without an account" sets the device up for your home network only (see Bridge accounts).
    • Name and password: the device's <name>.off-the.cloud address, checked as you type and reserved on the bridge the moment you continue, and the device's password (twice, 8 characters or more). The password encrypts your files on the device (see What is encrypted on the device) and can't be recovered; the app encrypts it before it leaves your phone, and the install sets it. A recovered device keeps the password it had.
    • Install: a progress bar over the install script's steps, with what it is doing under it and the log one tap away. This takes a while on a Pi - it downloads the tagging model and builds the software from source - about 20 minutes. You can close the app meanwhile; when the installation is complete, open https://<name>.off-the.cloud from any network.
  5. When it finishes, the wizard waits until the bridge sees the device connected, then shows its address, https://<name>.off-the.cloud. Tap Open my device and the app signs in with the password you chose. Then you set up your profile. The setup wizard switches off afterwards.

Replacing a dead Pi: if the Pi died but its two disks didn't, flash a new card with the same image, attach the same disks, and go through the wizard again. At the Storage step it finds the existing Off The Cloud array (and the database on it) and offers to recover it: the array is reassembled instead of wiped, the database comes back with everything in it - photos, files, friends, the owner password - and the device presents its old name and bridge identity, so there is no Name step and no new password. The wizard then checks the device is really back on the bridge; only if it isn't (the old name was released, say) does it ask for a name and register the recovered device under it. 6. Wiring the RAID status LEDs to the GPIO pins is still a manual, physical step - see Wiring the status lights for the diagram and the pins.

Automatic updates. The device checks for a new version of Off The Cloud every 12 hours and installs it by itself, restarting on the way (a few minutes). Settings > Device version has the switch, Automatic updates, on unless you turn it off; with it off you press Update there when you choose. A release that fails to install three times is left for that button. The Docker image doesn't update itself: you pull the new image.

System updates. Besides Off The Cloud's own updates (Settings > Device version), the device installs its operating system's security updates by itself every day: Debian's, and the Raspberry Pi's kernel and firmware. When one needs a restart (a new kernel), it restarts at 04:00, offline for about a minute. On a machine of your own installed with the script, set OTC_SECURITY_REBOOT=0 before installing to leave the restarts to you.

A screen on the device. Plug a screen into the Raspberry Pi's HDMI port (a portable touch screen, a TV, the screen case's screen on the wall) and, a few seconds later, the device shows its web app on it, full-screen, with an on-screen keyboard for a touch screen: sign in as on any browser and use it as you would there. The first time it installs the browser for it (Chromium, about 600 MB on the microSD card) - a few minutes; a device that never has a screen never installs it. It needs a Raspberry Pi with 4 GB of memory or more (the browser takes about 500 MB), and only the device's own pages open on it: no other site, no downloads. Signed in once on it, the screen stays signed in - through the device's updates and the screen going off and on - so it can stay on the wall as a photo frame (a collection's Slideshow): it signs out only when you sign out on it, change the password, or the device itself restarts or is switched off (a power cut, Restart device, a security update that needs one): it keeps that sign-in in its memory only, never on its disks, so after that it asks for the password once. Unplug the screen (or switch it off) and the browser stops within 15 seconds. A touch screen also needs a USB cable from the Pi to the screen's touch/USB-C port (the touch goes over USB; no driver to install), and a portable screen should have its own power supply: the Pi's USB ports share 1.6 A with the storage disks. Turn a screen on before the Pi if you can - the device looks again every 10 seconds for one it missed.

Console access. The image doesn't enable SSH. If you ever need a shell on the device itself, plug in a keyboard and monitor and log in as (on a device already set up, the monitor shows the web app instead: press Ctrl+Alt+F1 for the console and Ctrl+Alt+F7 to go back):

user password
otc-debug off-the-cloud

It has sudo. Nothing about normal setup or day-to-day use needs it; it's for troubleshooting and the few things listed here:

  • Enable SSH (optional, for remote troubleshooting): the image ships without SSH host keys (so no two devices share one), so generate them first:
    sudo ssh-keygen -A && sudo systemctl enable --now ssh
    
    then put your public key in ~otc-debug/.ssh/authorized_keys and use ssh otc-debug@<name>.local. SSH only ever accepts keys (/etc/ssh/sshd_config.d/01-otc-keys-only.conf): the password above is public, so it works at the console only, never over the network. (Cards flashed from a newer image generate the keys on their own the first time sshd starts.)
  • "Your device can't reach its storage disks": the apps say this (instead of "device unreachable") when the device is running but its disks aren't there - unplugged, switched off or slow to start, the mirror not assembled, or the database on them unable to start. A minute after the device notices, it answers every app with that message, on the home network and through off-the.cloud, while it writes nothing at all to the disks; the web app's page still loads. Plug the disks back in (or reassemble the mirror from the console): the device mounts them and starts normally by itself, with no restart, and Alerts then says how long they were missing. The two status LEDs show it too: red in turn, a second each.
  • The status LEDs: both green - the mirror is healthy; one red - that disk stopped working (plug in a replacement at least as large); one blinking green and the other blinking red - a disk is being copied onto the other; both red in turn, a second each - the device can't reach its storage at all (above).
  • Restart the device: Settings > Device version > Restart Device (web, iPhone and Android; the device's owner only) restarts it cleanly; it is back in about a minute. Settings shows when it is. Not while an update or a Wi-Fi change runs: try again once it has finished. From the console, sudo reboot does the same.
  • Switch the device off: Settings > Device version > Shut Down Device (release 164 or later; the device's owner only) stops everything cleanly and powers it off, so it can be unplugged without risking the microSD card: wait until its lights stop blinking. It stays off until you unplug its power and plug it back in. Not while an update or a Wi-Fi change runs, nor in Docker (docker compose stop there). From the console, sudo poweroff does the same.
  • The Wi-Fi restarted by itself: if the Wi-Fi keeps receiving but stops sending properly (most TCP data sent twice, for minutes on end), the device restarts its Wi-Fi once and says so in Alerts. If that didn't help it doesn't try again until the Wi-Fi has worked normally for a while - restart the device from Settings, or use an Ethernet cable. Its log: journalctl -u otc-wifi-restart and the wifi watchdog: lines in /var/log/otc/otc.log.
  • Changed your Wi-Fi's name or password? In the web app, Settings > Wi-Fi (the device's owner only; release 140 or later): choose the network and enter its password, and the device switches over in about a minute. It keeps the new network only once it reaches the bridge through it (without a bridge, your router); otherwise it goes back to the network it was on. If it has already lost your Wi-Fi, connect it to your router with an Ethernet cable, wait a minute or two, do the same, then unplug the cable. Its log: journalctl -u otc-wifi-join. At the console, by hand (nmcli asks for the password, so it stays out of the command line and the shell history):
    sudo nmcli connection delete OTC-WiFi
    sudo nmcli --ask device wifi connect "<name>"
    
  • Force an update from the console - normally you press Update in Settings, but a device installed before release 5 can't start one on its own and needs this once:
    sudo bash -c 'curl -fsSL https://raw.githubusercontent.com/alonsovidales/otc/main/scripts/update.sh -o /tmp/update.sh && bash /tmp/update.sh'
    
    It prints nothing; follow it with tail -f /var/log/otc/update.log.
  • Logs: the device's own log is /var/log/otc/otc.log, the setup wizard's is journalctl -u otc-setup, and an update's is /var/log/otc/update.log (its current state is in /var/lib/otc/update-status.json).

To build and publish the image yourself (only needed when the wizard, hotspot or Bluetooth setup scripts change - the software it installs is always the newest signed release), with TARGET in makefile pointing at any arm64 Linux box you can SSH to as otc (a Pi is fine):

$ make image           # builds on TARGET (scripts/build_image.sh) from HEAD's scripts/, copies dist/off-the-cloud-rpi-lite-arm64.img.xz back
$ make image-publish   # checks it against its .sha256, signs that, uploads them to the rolling "image" GitHub release and checks what was published

make image builds from a git archive of HEAD only, and refuses to start while scripts/ has changes that aren't committed: every device made from the image runs those scripts as root.

Using the setup wizard

Whether you flashed the pre-built image or ran Makefile.pi/the manual steps against a plain OS install, the very first time you open the device's web app (http://<device>:8080/, or through the mobile/desktop apps) with no owner password set yet, you land straight on a short setup flow instead of the normal sign-in screen:

  1. Owner name + password - the password you set here becomes the device's permanent password from that point on (there's no separate "create account" step later - whatever you type here is the account). Pick something you can keep somewhere safe: it also protects your files and social profile.
  2. Storage - if the device found spare USB drives attached (beyond the boot SD card), you can pick up to two: pick two to mirror them into a RAID1 array (recommended - your files survive one disk failing), pick one to use it alone with no redundancy, or pick none to just use the boot disk. Building the array happens in the background after this step, so it's normal for storage to not be "ready" the instant you click through.

After that you're dropped into the normal app, signed in. You can change the owner name and password any time from Settings. There is no Wi-Fi step: once you're in, Settings > Wi-Fi changes the network the device uses.

Option 2: Makefile.pi, from your computer

  1. Install Raspberry Pi OS (64-bit) in the Raspberry Pi using this tutorial. In Customisation enable SSH with your public key, and create a login account with sudo under any name except otc: the installer creates otc itself, as the device's own service account, with no login and no sudo.

Makefile.pi, in the root of this repository, runs Option 0's installer on the Pi for you, over SSH. Run it from your computer (not the Pi), with the repository checked out; it needs GNU make 3.82 or newer (on a Mac, brew install make and use gmake):

$ make -f Makefile.pi bootstrap TARGET=<device_addr_or_hostname> PI_USER=<your_login> SUBDOMAIN=<subdomain> DISK1=/dev/sda DISK2=/dev/sdb

It shows the two disks first: an OTC mirror already on them is kept and never wiped, and two disks without one are only erased and mirrored after you type yes. SKIP_RAID=1 installs on a single disk, and BRIDGE_ADDR= (empty) installs a device for your home network only, which needs no SUBDOMAIN. What it installs is exactly what Option 0 installs - the newest signed release - so the device then updates itself from Settings, gets the system's security updates, and keeps its identity and database password on itself (/etc/otc). Re-running bootstrap is safe.

Afterwards:

$ make -f Makefile.pi status   # service / DB / RAID / release / healthcheck status
$ make -f Makefile.pi logs     # tail the service logs

Run make -f Makefile.pi help for the full list of targets. Wiring the RAID status LEDs to the GPIO pins is still a manual, physical step - see Wiring the status lights for the diagram and the pins.

Option 3: Manual installation (step by step)

These steps show what the installer does, for anyone who wants to customize an install or understand what is on the device. A device set up only by hand has none of the installer's root helpers, so it can't update itself: Settings > Device version says so when Update is pressed, and running Option 0's installer on it adds them (it keeps the device's data and identity).

  1. SSH into the device and update the OS:
$ sudo apt-get update
$ sudo apt-get upgrade
  1. Execute the next in order to create the RAID1:
$ sudo wipefs -a /dev/sda
$ sudo wipefs -a /dev/sdb
$ sudo mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda /dev/sdb
$ sudo mkfs.ext4 /dev/md0
$ sudo mkdir /mnt/storage
$ sudo mount /dev/md0 /mnt/storage
$ sudo mdadm --detail --scan >> /etc/mdadm/mdadm.conf
$ sudo update-initramfs -u

# Add to /etc/fstab if you want it mounted automatically:
/dev/md0   /mnt/storage   ext4   defaults   0   0
  1. Add the RAID monitorig service Create /etc/systemd/system/raid-watch.service with:
[Unit]
StartLimitIntervalSec=0
Description=RAID1 watcher + LED driver
After=mdadm.service

[Service]
RestartSec=5
Type=simple
ExecStart=/usr/bin/python3 /usr/local/bin/raid_watch.py
Restart=on-failure
User=root

[Install]
WantedBy=multi-user.target

then:

# From the local repo directory:
$ scp scripts/raid_watch.py otc@<device_addr>:/tmp/
# Connect by SSH to the device
$ sudo mv /tmp/raid_watch.py /usr/local/bin/raid_watch.py
$ sudo chmod +x /usr/local/bin/raid_watch.py
$ sudo systemctl daemon-reload
$ sudo systemctl enable --now raid-watch.service

Wiring the status lights. The lights are optional: one per storage disk, green when it's fine and red when it needs you. Each light is a red LED and a green LED side by side (or one two-colour LED with three legs), and each colour connects to one pin of the Raspberry Pi through a 330 Ω resistor. Wire them with the Pi switched off; raid_watch.py lights them by itself (the pins are its CONFIG["leds"], BCM numbering).

Wiring the two status lights to pins 9, 11, 13, 14, 15 and 16 of the Raspberry Pi 5's header, each LED through a 330 ohm resistor

  • Light 1, red: pin 11 (GPIO17), through a 330 Ω resistor, to the long leg of the red LED.
  • Light 1, green: pin 13 (GPIO27), through a 330 Ω resistor, to the long leg of the green LED.
  • Light 1, both short legs: pin 9 (GND).
  • Light 2, red: pin 15 (GPIO22), through a 330 Ω resistor, to the long leg of the red LED.
  • Light 2, green: pin 16 (GPIO23), through a 330 Ω resistor, to the long leg of the green LED.
  • Light 2, both short legs: pin 14 (GND).

Pin 1 is the square one, at the end of the header farthest from the USB ports. With a two-colour LED, the shared leg (usually the middle one) goes to GND; it must be the kind with a shared negative leg, called common cathode. You can use 3mm red and green LEDs like these: https://www.amazon.nl/-/en/dp/B01CFZMSNO. What the lights mean is under The status LEDs in Option 1. Each light follows one of the two disks of the mirror, not a USB port, so check the alert in the app to know which disk to pull.

  1. Install MariaDB and set the datadir to use the RAID:
$ sudo apt-get install mariadb-server
$ sudo mkdir /mnt/storage/mysql
$ sudo rsync -aHAX --numeric-ids --info=progress2 /var/lib/mysql/ /mnt/storage/mysql

Edit /etc/mysql/mariadb.conf.d/50-server.cnf and replace:

#datadir                 = /var/lib/mysql

by:

datadir                 = /mnt/storage/mysql

start MariaDB and check that the directory is properly set:

$ sudo systemctl start mariadb
$ sudo mysql -uroot -p -e "SHOW VARIABLES LIKE 'datadir';"

Populate the DB with the content from db/db.sql Add the settings row that will be used to identify the device and connect to the bridge:

insert into settings (`device_uuid`, `subdomain`, `bridge_secret`) values ('<device_uuid>', '<device_domain>.off-the.cloud', '<device_secret>')

You can put random values there if you don't plan to use the bridge. To reach your device through the bridge, create an account at off-the.cloud/account, register the device's name under "Installing by hand?" and copy the identity it shows (only once): DEVICE_UUID is device_uuid, BRIDGE_SECRET is bridge_secret, and <name>.off-the.cloud is subdomain (see Bridge accounts).

  1. Edit the MakeFile and specify in TARGET the IP Address or hostname used by the Raspberry Pi

  2. Create the www directory and install Go (use the latest version for Linux ARM64):

$ wget https://go.dev/dl/go1.26.1.linux-arm64.tar.gz
$ sudo tar -C /usr/local -xzf go1.26.1.linux-arm64.tar.gz
$ echo "export PATH=\$PATH:/usr/local/go/bin" >> .bash_profile
  1. In your local machine, clone the repository and make the project:
$ git clone git@github.com:alonsovidales/otc.git
$ cd otc
# Edit makefile and replace TARGET by the address or hostname of the device
$ make all
  1. Build the database:
$ sudo mysql -u root
> create database otc;
> CREATE USER 'otc'@'localhost' IDENTIFIED BY '<your_pass_here>';
> GRANT ALL PRIVILEGES ON otc.* TO 'otc'@'localhost';
> GRANT ALL PRIVILEGES ON `otc_%`.* TO 'otc'@'localhost' WITH GRANT OPTION;
> GRANT CREATE USER, RELOAD ON *.* TO 'otc'@'localhost';
> exit

The last two GRANTs (issue #82, multiple users on one device) let the otc account provision/drop a whole database + dedicated MySQL user per additional user at runtime (see dao/provisioning.go) — required even if you never add a second user, since scripts/install.sh applies them as part of the base setup. A MySQL account can't GRANT a privilege it doesn't itself hold, so it holds everything, with GRANT OPTION, on the otc_<uuid> databases it creates (otc_%: in a GRANT the _ of otc_<uuid> is itself a wildcard, which the escaped otc\_% doesn't cover - provisioning then fails with Access denied ... to database 'otc_<uuid>'), plus CREATE USER and RELOAD (for FLUSH PRIVILEGES) - and nothing else on the server. Devices installed before release 143 held ALL PRIVILEGES ON *.* WITH GRANT OPTION; that release narrows it.

  1. Create the OTC config file in /etc/otc_dev.ini like:
[otc]
bridge-addr=off-the.cloud
storage-path=/mnt/storage/
unenc-storage-path=/mnt/storage/unencrypted/
# The LONGEST side of a thumbnail, in pixels (the name is historical: it
# was the width until release 111). The grids' small thumbnails are fixed
# at 400 px on the shorter side, at most 800 on the longer.
max-thumbnail-width-px=1000
shared-link-ttl-hours=168
# Every outbound friend/bridge connection this device makes must be to a
# domain ending in this TLD (defaults to off-the.cloud if omitted) — closes
# off dialing an arbitrary attacker-supplied domain (e.g. an inbound friend
# request naming a LAN address) as an SSRF vector. Set this if you're
# running your own separate network of devices under your own domain
# instead of the public off-the.cloud bridge.
friend-domain-tld=off-the.cloud
# How many standby connections this device keeps open to the bridge, ready
# to be handed to a client (see websocket.ensureBridgePool). Each one is
# pinned to a client for that client's *entire* session, not released after
# one request, so this needs to cover every concurrent session (phone app,
# Mac app, browser tabs, friends) this device is expected to serve through
# the bridge at once. Defaults to 20 if omitted.
bridge-pool-target=20
# The Wi-Fi watchdog: a Wi-Fi that keeps receiving but has stopped sending
# properly (seen on a Pi 5 after a day up) is restarted once per episode,
# with an Alert. Only while the device is on Wi-Fi. "off" turns it off; the
# other keys override its thresholds (defaults shown).
# A minute is bad at bad-pct % of TCP segments retransmitted or more, and
# healthy under healthy-pct, judged only with min-segments sent in it; it
# restarts after bad-minutes in a row while the radio itself reports
# failures (tx errors, frames the router never acknowledged), or after
# bad-minutes-alone without that; healthy-minutes count as working again.
#wifi-watchdog=on
#wifi-watchdog-bad-pct=4
#wifi-watchdog-healthy-pct=1
#wifi-watchdog-min-segments=1000
#wifi-watchdog-bad-minutes=5
#wifi-watchdog-bad-minutes-alone=10
#wifi-watchdog-healthy-minutes=5
# A public demo device: anyone may sign in with its published password and
# look around, and every change is refused (uploads, deletes, renames,
# settings, the password, sharing, friends, updates, restarts). Set the
# owner password and load the content with it off, then turn it on and
# restart. `OTC_DEMO=1` on the install script writes it. See
# docs/demo-device.md.
#demo=true

[logger]
log_file=/var/log/otc/otc.log
max_log_size_mb=10
level=debug

[otc-api]
base-url=otc/
static=/var/www/
port=8080
ssl-port=443
ssl-cert=
ssl-key=
# Issue #190: the apps reach the device at home over TLS on this port, with
# a self-signed certificate they pin (made on the first start and kept in
# <storage-path>/.lan-tls/). Defaults to port + 363 (8443) if omitted.
# Keep it reachable from the home network: once the iPhone or Android app
# has signed in over it, it signs in to a ws:// address only through it.
lan-tls-port=8443
# Optional: browser pages on other addresses that may open the device's
# socket, besides the device's own page at its addresses and names on the
# home network (otc.local, names under .lan, .home, .home.arpa, .internal or
# fritz.box, a name with no dot) - a name of your own that your network's DNS
# points at the device, a reverse proxy that passes neither the Host nor
# X-Forwarded-Host on, or a developer's own server. Origins, separated by
# commas. Any other site's page is refused.
# allowed-origins=https://photos.example.com

[mysql]
user=otc
pass=<your_password_here>
port=3306
db=otc

[tagger]
model-path=/usr/local/models/ram_plus_swin_large_14m.int8.onnx
tags-path=/usr/local/models/tag_list_4585.txt
thresholds-path=/usr/local/models/tag_list_4585_thresholds.txt
tags-per-image=10
max-images-search=30

# Optional (issue #43) - push notifications to the iOS app when a friend
# posts. Omit this whole section and it's simply skipped (the device token
# still registers, just nothing gets sent) - web push needs no such section
# at all, since the device generates its own VAPID keypair on first use.
# Get these four values from your own Apple Developer account: Certificates,
# Identifiers & Profiles > Keys > create one with the "Apple Push
# Notifications service (APNs)" capability, download its .p8 file (Apple
# only lets you download it once), and note its Key ID and your Team ID.
# Bridge only - never on a device. The APNs auth key is the developer
# team's private key; devices ask the bridge to send (BridgeNotify).
[apns]
key-path=/etc/otc/apns_auth_key.p8
key-id=<key id from the Apple Developer portal>
team-id=<your Apple Developer team id>
bundle-id=cloud.off-the.OffTheCloud
# 1 once the app is TestFlight/App-Store distributed; leave unset (or 0)
# while testing against Xcode's own debug builds, which use the sandbox
# APNs environment instead.
production=0

# Optional (issue #52) - face recognition ("People" search), humans only.
# Omit this whole section and the feature just stays unavailable - it's
# off by default (toggled from Settings in the app) even when this is
# present. See step 11 below for where to get these two model files.
[faces]
detector-model-path=/usr/local/models/face_detection_yunet_2023mar.onnx
recognizer-model-path=/usr/local/models/face_recognition_sface_2021dec_int8.onnx
  1. Download the models. thresholds-path is optional (older/from-scratch exports have no threshold file — drop that line if you go with the models-export fallback further below); when set, RAM++'s own per-tag calibrated cutoffs are used instead of one flat threshold for all 4585 tags, which is more accurate. From the repository directory:
$ cd models
$ curl -fL -o ram_plus_swin_large_14m.int8.onnx https://huggingface.co/anakhiu/ram-plus-onnx-int8/resolve/main/ram_plus_int8.onnx
$ curl -fL -o tag_list_4585_thresholds.txt https://huggingface.co/anakhiu/ram-plus-onnx-int8/resolve/main/ram_tag_list_threshold.txt
$ scp ram_plus_swin_large_14m.int8.onnx tag_list_4585_thresholds.txt tag_list_4585.txt otc@<otc_addr>:/usr/local/models/
(This is a community-hosted INT8 re-export of the same RAM++ Swin-Large
weights and 4585-tag vocabulary used below — same tags, ~2-3x faster,
half the size, no measurable accuracy loss in testing. If it's ever
unavailable, `make -f Makefile.pi models-export` exports the original
fp32 model from scratch instead — see that target for the manual
equivalent, which needs a Python/torch/transformers toolchain and takes
much longer.)
  1. Install ONNX runtime:
$ wget https://github.com/microsoft/onnxruntime/releases/download/v1.24.3/onnxruntime-linux-aarch64-1.24.3.tgz
$ tar -xzf onnxruntime-linux-aarch64-1.24.3.tgz
$ sudo mv onnxruntime-linux-aarch64-1.24.3 /opt/onnxruntime
Issue #52 (face recognition, "People" search) needs OpenCV's actual
headers/libs at build time (unlike ONNX Runtime above, found via
pkg-config rather than a manually-placed .so), and the two small
(~230KB + ~10MB) YuNet/SFace models:
$ sudo apt-get install libopencv-dev pkg-config
$ curl -fL -o /usr/local/models/face_detection_yunet_2023mar.onnx https://github.com/opencv/opencv_zoo/raw/main/models/face_detection_yunet/face_detection_yunet_2023mar.onnx
$ curl -fL -o /usr/local/models/face_recognition_sface_2021dec_int8.onnx https://github.com/opencv/opencv_zoo/raw/main/models/face_recognition_sface/face_recognition_sface_2021dec_int8.onnx
Both are official OpenCV Zoo models (MIT/Apache-2.0), designed as a
matched pair - see `face_recognition/face_recognition.go`'s package doc
comment. The feature stays off until turned on from Settings in the app
regardless of whether these are installed; skip this if you don't want
it.
  1. In your computer, in the repository directory execute: make all, this will compile nd copy all the content to the device, note that you need Go installed. Everytime that you want to change something and re-compile, this is the step to run

  2. Connect by SSH to the device and execute the next in order to register the service:

$ sudo mkdir -p /var/log/otc
$ sudo chown otc:otc /var/log/otc
$ sudo chmod 755 /var/log/otc

$ sudo mkdir -p /etc/otc
$ sudo bash -c 'cat >/etc/otc/otc.env <<EOF
OTC_LOG=info
OTC_ADDR=:8080
EOF'
sudo tee /etc/systemd/system/otc.service >/dev/null <<'UNIT'
[Unit]
Description=Off The Cloud service
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=otc
Group=otc
# If you want a writable working dir at runtime:
WorkingDirectory=/var/lib/otc

# Load environment variables (optional)
EnvironmentFile=-/etc/otc/otc.env

# Start command as dev, the cofig is in: /etc/otc_dev.ini
ExecStart=/usr/bin/otc dev

# Restart policy
Restart=on-failure
RestartSec=3

# Resource & fd limits (tweak to your needs)
LimitNOFILE=65535

# Runtime directories (systemd creates them with proper perms)
RuntimeDirectory=otc
StateDirectory=otc
LogsDirectory=otc

# Security hardening (safe defaults; relax if needed)
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=full
ProtectHome=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
SystemCallArchitectures=native

[Install]
WantedBy=multi-user.target
UNIT

$ sudo systemctl daemon-reload
$ sudo systemctl enable --now otc.service
  1. If everything went well, you should be able to see the process running with:
$ journalctl -u otc -f

and the logs in:

$ tail -f /var/log/otc/otc.log

To connect locally use the 8080 port: http://<local_ip>:8080

If you have configured the bridge you should be able to connect in: https://.off-the.cloud/

The first time, before any password is set, the web app shows the setup described in "Using the setup wizard" instead of the sign-in: be careful, because the password you choose there will be your password.

Home server (Docker, beta)

Already run a Linux home server, a NAS or a Docker host? Off The Cloud also runs there in Docker, as a beta, on amd64 and arm64. The server's own RAID protects the files, or the container mirrors two disks itself and watches them, as the Raspberry Pi does; updates come by pulling the image. On a Raspberry Pi, use the pre-built image above instead. docs/docker.md explains how to set it up.

What is encrypted on the device

Everything you store is encrypted at rest under a key only your password unlocks: file contents, thumbnails, previous versions, the originals of photos you edited and face embeddings (AES-GCM, in 1 MiB segments; since release 164 each file is sealed under a key of its own, derived from that key and a random salt kept with the file). A share link's archive or gallery is encrypted the same way under the secret in the link itself, which the device doesn't keep. Someone who takes the disks - or the whole device - without your password can't read any of it.

What the device needs in order to find and organise your files is kept in its database unencrypted, and could be read by someone with the disks:

  • file and folder names, types, sizes and dates;
  • the photo tags (including the city and country a photo was taken in), the names you give people and collections, and which photos a person appears in;
  • the stars a photo has in a collection with Rating on (from you or from anyone with the collection's shared link), so the collection can be filtered and sorted by them;
  • your posts, comments and alerts, and your friends' names and profiles;
  • each file's SHA-256, which names its encrypted content on disk - so someone who already has a particular file can tell whether it is stored there.

This is a deliberate trade-off: searching by name, folder, tag or place needs these fields readable by the database, and encrypting them would make search slow or impossible. Your content stays protected; its names and labels don't.

Rating comments are encrypted. The comment under a photo's stars is sealed to a key pair of your own: its public half lets the device seal a comment that comes through a shared link while you are signed out, and its private half is itself encrypted under your key, so only your sign-in opens the comments. A collection shared with "Let people rate the photos" also keeps a copy of each comment under a key that only that collection's shared links carry (inside each link's encrypted gallery), so the people you shared it with see the current comments; the device can read those copies only while it answers someone who has the link.

Posts are the other exception. When you post a photo or video, a copy of it (as posted, original metadata included) is stored unencrypted, readable only by the service; so are the posts your friends share with you (up to the space limit in Settings). Your friends' devices fetch posts whenever they sync, usually while you aren't signed in, so these copies can't be under a key only your password unlocks. Deleting the original from your files doesn't delete the post; delete the post to remove its copy.

Decrypted data never reaches the SD card: the service locks its memory, swap stays in RAM, and temporary files live in RAM (release 62).

Bridge accounts

Issue #124: every domain on the bridge belongs to an account. The setup wizard asks for it right before the device's name (step 3 of 5): sign in or create an account with an email and password, or type a setup code - an 8-character code from the account page, good for 15 minutes, which is also how an account created with Google or Apple is used from the wizard (the hotspot's captive portal only lets the device itself reach the bridge, so the wizard never sends the phone off to a sign-in provider). An account keeps only a name, surname, country of residence and email.

The terms, shown at sign-up: free for the first two years, then 9.99 € + VAT a year (an email goes out before the two years are up; nothing is charged today, there is no payment system yet); up to five domains per account, extra ones 2 € a year each by writing to info@off-the.cloud; an account unused for six months is removed and its domains released.

The account page, https://off-the.cloud/account: sign in (password, Google or Apple where the bridge has them configured), see the domains with whether each device is connected, get a setup code, release a domain, or give one a new identity (a fresh owner uuid and bridge secret, shown once - the old device is locked out). Releasing a domain and giving it a new identity both ask for the account's password again (an account without one, made with Google or Apple, needs a sign-in from the last 15 minutes), and a new identity is emailed to the account's address: whoever holds it receives everyone who reaches that name. A released name stays reserved for its account for 30 days; registering it again within them asks for the password the same way. For a device installed by hand with the install script rather than the image, register its name there first and put the identity shown into /etc/otc/otc-install.env before running the script.

A lost device is replaced by setting up the new one signed in to the same account and giving it the same name: the name moves to the new device (a fresh identity, the old one refused from then on), and with the old disks recovered (see "Replacing a dead Pi") nothing else changes. Moving a name needs a sign-in just made: signing in from the setup wizard does it, and so does a setup code from the account page asked for within 15 minutes of signing in there; a code asked for later sets up new names only, and the move is refused until you sign in again. The account's address gets an email about the move.

A device's other users with bridge access get addresses of their own (pepe.off-the.cloud), which the device registers on the account as it adds them; they count toward the account's names. Only that device gives such an address a new identity, when its user is added again with the same name (the account's address gets the same email), and it never moves the account's other names.

Without an account the wizard offers "Continue without an account": the device installs with no bridge (OTC_BRIDGE_ADDR="" for the install script) and lives on the home network only, as otc.local. Everything local works - files, photo backup from the apps and the sync clients while at home, the gallery, tags, people. What needs the bridge: reaching the device from outside, the social features (friends, posts, comments), share links that work from anywhere, and push notifications. Setting the device up again with an account adds them later.

A device that dials in with a domain no account registered is refused (the bridge tells it to create an account), unless the bridge runs with [accounts] open-registration=true - the pre-accounts rule, meant for forks and development. Sign in with Google / Apple needs their credentials in [accounts] (see bridge/cfg/otc_dev.ini); without them the account page simply offers email and password only. bridge/db/migrations/001-accounts.sql adds the tables to an existing bridge.

Bridge admin panel

The bridge (bridge/, deployed separately - see bridge/makefile) has a small admin panel at https://off-the.cloud/admin for whoever operates the bridge: log in, see/add/remove registered devices, and check per-device metrics (requests/bandwidth, hourly) and a security log of rejected bridge-registration attempts (wrong owner/secret for a claimed domain).

There's no sign-up - bootstrap (or change) an admin account from the bridge's shell:

$ sudo /usr/bin/otc_bridge <env> set-admin-password <username>

It asks for the password twice without echoing it (or reads one line from a pipe) - never on the command line, where ps and the shell history would keep it. Either way the password must have at least 12 characters and at most 72 bytes, as in the panel. [admin] session-secret must also be set in the bridge's config file (/etc/otc_<env>.ini) - a random value that stays stable across restarts, e.g. openssl rand -hex 32 - otherwise every restart logs every admin out.

Contact messages. Every message sent through the site's contact form is stored (the panel's Messages tab) and, where [smtp] is configured, mailed to the bridge's own address ([smtp] from) with the sender's address as Reply-To, so answering that email in a mail client answers them. The email goes in the background and only while the node's email budget has room to spare (people's confirmation and reset emails come first); the message is stored either way. They can also be read and answered from the bridge's shell:

$ sudo /usr/bin/otc_bridge <env> messages [--all]
$ sudo /usr/bin/otc_bridge <env> reply <id> [--again] < answer.txt
$ sudo /usr/bin/otc_bridge <env> mark-read <id>

messages lists the unread messages, or all of them with --all, oldest first: the id, when (UTC), the name, the address, the reason, read or not, and the message. reply mails the answer read from stdin (plain UTF-8 text, at most 32 KB; at a terminal, type it and end with Ctrl-D) to the sender from the bridge's address, subject "Re: your message to Off The Cloud", with a blind copy to the bridge's address and replies going there, then marks the message read. It refuses an unknown id, an empty answer, and a message read already (answered, or marked read) unless --again is given. mark-read is for a message that needs no answer. These commands only read and write the contact messages, and reply sends one email: they start no server and prune nothing.

License

OTC is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0-or-later).

In short: you're free to use, study, modify, and redistribute this code, including forking it - but if you run a modified version as a network service (for example, your own bridge relay), the AGPL requires you to make that modified source available to your users too. This is stronger than the plain GPL specifically to cover server/SaaS-style use, which is most of what this project is.

Every source file carries an SPDX-License-Identifier: AGPL-3.0-or-later header; see CONTRIBUTING.md for what that means for contributions.

About

A private, decentralised social network and home cloud for your family, on a Raspberry Pi 5: share photos and videos with friends from device to device, back up your phones and keep your files in sync. Free and open source, with iPhone, Android, Mac, Windows and Linux apps.

Topics

Resources

Contributing

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages