Jump to content

Storage: Difference between revisions

No edit summary
Line 38: Line 38:
* Linode Docs:
* Linode Docs:
** https://www.linode.com/docs/guides/linode-object-storage-with-mastodon/
** https://www.linode.com/docs/guides/linode-object-storage-with-mastodon/
Our media is configured to be served via a reverse proxy at https://media.neuromatch.social
=== Proxy ===
First we set up the reverse proxy as described in the linode and masto docs - we modified the nginx configuration slightly to use a different cache than the regular masto cache, and because you can't declare a <code>proxy_cache_path</code> within the server block as the linode docs have.
<pre>
proxy_cache_path /var/cache/nginx-object-storage keys_zone=CACHEOBJECT:10m inactive=7d max_size=10g;
server {
  # ...
  location @s3 {
    # ...
    proxy_cache CACHEOBJECT;
    # ...
  }
}
</pre>
=== Transition ===
To transition data from our existing instance, we used rclone.
'''docs:'''
* https://www.linode.com/docs/guides/rclone-object-storage-file-sync/
* install rclone from precompiled binary: https://rclone.org/install/#linux-precompiled
'''Install:'''
<syntaxhighlight lang="bash">
curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip
unzip rclone-current-linux-amd64.zip
cd rclone-*-linux-amd64
# Copy binary file
sudo cp rclone /usr/bin/
sudo chown root:root /usr/bin/rclone
sudo chmod 755 /usr/bin/rclone
# Install manpage
sudo mkdir -p /usr/local/share/man/man1
sudo cp rclone.1 /usr/local/share/man/man1/
sudo mandb
</syntaxhighlight>


== Managing Storage ==
== Managing Storage ==