personal-website/posts/syncthing_arkos.rst

120 lines
4.5 KiB
ReStructuredText
Raw Normal View History

2023-07-09 11:45:49 -04:00
.. syncthing_ark_os
2023-07-09 11:45:49 -04:00
.. for symbols like left/right arrow
.. include:: <isonum.txt>
2023-07-09 11:45:49 -04:00
Setup Syncthing on arkos
========================
2023-07-09 11:45:49 -04:00
.. post:: 09, July 2023
:tags: emulation, infrastructure, guide
:category: Hobbies
:author: len0rd
2023-07-09 11:45:49 -04:00
`Syncthing <https://syncthing.net/>`_ is a handy tool for syncronizing files between multiple machines. I currently use 2 devices for playing retro games: a Steam Deck and a `Anbernic RG353m <https://anbernic.com/products/rg353m>`_ running `arkos <https://github.com/christianhaitian/arkos>`_ My goal here is to syncronize save states and games between the devices. Here's my goal for a final setup:
2023-10-27 11:44:15 -04:00
.. image:: ../assets/diagrams/syncthing_setup.drawio.svg
2023-07-09 11:45:49 -04:00
For now, this writeup only covers RetroArch savestate syncing. There are also plenty of guides and advice online for setting up syncthing on the Steam Deck or a NAS, so the focus here will be ArkOS.
2023-07-09 11:45:49 -04:00
In general, I've found the best way to setup this kind of sync system is to configure the sync folder on ArkOS, then on a NAS and finally on the Steam Deck
2023-07-09 11:45:49 -04:00
Installing Syncthing on ArkOS
-----------------------------
2023-07-09 11:45:49 -04:00
#. Configure Retroarch save location
2023-07-09 11:45:49 -04:00
- By default (at least on my ArkOS version), retroarch will place saves/savestate files in the roms folder of the system they belong to. This can work, but I prefer having all these files in a single location. Using single folders simplifies the syncthing configuration a little, and makes sense for how I store ROMs vs saves on my NAS. To adjust these settings, head to: Retroarch |rarr| Settings |rarr| Saving |rarr| Disable any "Sort save..." options
2023-07-09 11:45:49 -04:00
#. Identify retroarch savestate location. For my install they were here
2023-07-09 11:45:49 -04:00
- ``/home/ark/.config/retroarch/saves/``
2023-07-09 11:45:49 -04:00
- ``/home/ark/.config/retroarch/states/``
2023-07-09 11:45:49 -04:00
#. Install Syncthing
- "Enable Remote Services" in ArkOS by navigating to: Options |rarr| "Enable Remote Services". The window that appears during this will briefly show your local ip address if you dont already know it
2023-07-09 11:45:49 -04:00
- ssh into ark os
2023-07-09 11:45:49 -04:00
i. ``ssh ark@<local_ip_addr>``
2023-07-09 11:45:49 -04:00
ii. Password (default): ``ark``
2023-07-09 11:45:49 -04:00
- Install Syncthing
2023-07-09 11:45:49 -04:00
a. Since ArkOS is ubuntu based, you can follow `Syncthings guide <https://apt.syncthing.net/>`_
2023-07-09 11:45:49 -04:00
b. Here's what I did
2023-07-09 11:45:49 -04:00
.. code-block:: bash
2023-07-09 11:45:49 -04:00
sudo curl -o /usr/share/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg
echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
sudo apt update
sudo apt install syncthing
2023-07-09 11:45:49 -04:00
Syncthing configuration
-----------------------
2023-07-09 11:45:49 -04:00
#. Make syncthing gui accessible
2023-07-09 11:45:49 -04:00
- To make configuration easy, I suggest making the Syncthing GUI accessible from a local machine other than the 353M. To do this edit syncthings config while ssh'ed into arkos
2023-07-09 11:45:49 -04:00
- Open ``~/.config/syncthing/config.xml``
2023-07-09 11:45:49 -04:00
- Update gui/address. ``<address>127.0.0.1:8384</address>`` -> ``<address>LOCAL_IP_ADDRESS:8384</address>`` then save.
2023-07-09 11:45:49 -04:00
- Now startup syncthing from your ssh session with ``$ syncthing``
2023-07-09 11:45:49 -04:00
- On your host machine, you should now be able to access the syncthing web UI at ``<ARKOS_LOCAL_IP_ADDR>:8384``
2023-07-09 11:45:49 -04:00
#. From the syncthing gui
2023-07-09 11:45:49 -04:00
- Remove the default folder sync and create a new one
2023-07-09 11:45:49 -04:00
a. name: whatever you want
2023-07-09 11:45:49 -04:00
b. folder path: ``/home/ark/.config/retroarch``
2023-07-09 11:45:49 -04:00
c. In ``Ignore Patterns`` check the enable box
d. everything else on default. Hit save
e. Now enter the Ignore Patterns
.. code-block::
// DO NOT IGNORE
!/states
!/saves
// IGNORE (everything else)
*
#. Now you can add a remote device. in this case i have a NAS that acts as the primary remote device. all other devices sync to it
.. note::
As you share across devices make SURE you add the ignore pattern everywhere!
Syncthing auto start
2023-07-09 11:45:49 -04:00
--------------------
See `syncthings guide here <https://docs.syncthing.net/users/autostart.html?highlight=windows#using-systemd>`_
2023-07-09 11:45:49 -04:00
#. ``systemctl --user enable syncthing.service``
2023-07-09 11:45:49 -04:00
#. ``systemctl --user start syncthing.service``
2023-07-09 11:45:49 -04:00
Resource optimization
---------------------
2023-07-09 11:45:49 -04:00
Syncthing has `a nice page <https://docs.syncthing.net/users/tuning.html#tuning-for-low-resources>`_ detailing what configuration changes you can make to minimize resource utilization
2023-07-09 11:45:49 -04:00
#. These changes will be made in ``~/.config/syncthing/config.xml``
2023-07-09 11:45:49 -04:00
#. For example one thing you can do is disable the web gui with: ``<gui enabled="false" tls="false" debugging="false">``