Camo retired (Installation of alternative)

Just for the records:
The recommended Camo Service retired and is set to “archived” in git.

I found a drop-In replacement for this:

It is not more based on Node, but on the new language “Crystal”. Which is super-easy to install on various systems.

Why install Camo?
It rewrites remote Image addresses to be proxied from the own Service. read the Camo docs for more.

How to install

On your pod, install Crystal
See: https://crystal-lang.org

Clone Camo

$: git clone https://github.com/RX14/camo.cr.git

Install camo

$: shards install
$: shards build --release
( Camo is now under ./camo/bin/camo )

Creata a secure hash token:

$: openssl rand -base64 12

( Or just drop your head on the keyboard )
Remember this hash:

In diaspora.toml, unter ‘configuration.privacy.camo’ under ‘hash’ add this key and enable the recommended settings.

Besides to set this Hash/key for camo, you need another setting to let diaspora* now where to rewrite the URLs: “root”:
root= https://your-pod.tld/camo

You want Camo to be started in System start, so create a systemctl service file:
/etc/system.d/system/camo.service

[Unit]
Description= Diaspora Camo Service

[Service]
Type=simple
Environment="CAMO_KEY=your-fancy-key" "CAMO_HOST=https://yourpod.tld/camo"
ExecStart=/home/diaspora/camo.cr/bin/camo
Restart=on-failure
RestartSec=2s

[Install]
WantedBy=multi-user.target

Enable this…

$: sudo systemctl enable camo

and start…

$: sudo systemctl start camo

check:

$: sudo systemctl status camo

It should return a ‘active’ and ‘running’ service at Camo.cr running on http://0.0.0.0:8081

You have now

  • install Camo
  • configured and startet it
  • set up diaspora to know that there is a service.

Next: Tell your web-service that the path /camo has your assets:
Under nginx simply add:

upstream camo {
  server 127.0.0.1:8081;
}

and

location /camo/ {
  proxy_redirect off;
  proxy_pass http://camo/;
  break;
}

Restart nginx

$: sudo systemctl restart nginx

Check errors in nginx error log

Everything up and running?
So now restart diaspora service (switch to diaspora folder):

$: bin/eye restart web

Check your Stream - remote images should now be rewritten to the new your-pod.tld/camo - address.

If everything’s works, document it somewhere… and forget it. “it just runs”.

For more info, look into the Wiki-Page:

1 Like