From edf3f8228e205b3b07a1e7575cee064963c08cd6 Mon Sep 17 00:00:00 2001 From: len0rd Date: Sun, 9 Jul 2023 11:45:49 -0400 Subject: [PATCH] cleanup syncthing_arkos config page --- assets/diagrams/syncthing_setup.drawio | 25 ++++++ posts/syncthing_arkos.rst | 119 ++++++++++++++++--------- 2 files changed, 100 insertions(+), 44 deletions(-) create mode 100644 assets/diagrams/syncthing_setup.drawio diff --git a/assets/diagrams/syncthing_setup.drawio b/assets/diagrams/syncthing_setup.drawio new file mode 100644 index 0000000..3f7537a --- /dev/null +++ b/assets/diagrams/syncthing_setup.drawio @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/posts/syncthing_arkos.rst b/posts/syncthing_arkos.rst index ac37e85..a8e1481 100644 --- a/posts/syncthing_arkos.rst +++ b/posts/syncthing_arkos.rst @@ -1,88 +1,119 @@ +.. syncthing_ark_os + +.. for symbols like left/right arrow +.. include:: + +Setup Syncthing on arkos +======================== + +.. post:: 09, July 2023 + :tags: emulation, infrastructure, guide + :category: Hobbies + :author: len0rd + +`Syncthing `_ 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 `_ running `arkos `_ My goal here is to syncronize save states and games between the devices. Here's my goal for a final setup: + +.. drawio-image:: ../assets/diagrams/syncthing_setup.drawio -Syncthing on arkos +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. -Goal: savestate/save sync to other retroarch instances +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 -In Retroarch -> Settings -> Saving: recommend disabling any type of per-game/per-core save settings so everything is in single folders +Installing Syncthing on ArkOS +----------------------------- +#. Configure Retroarch save location -Identify retroarch save location: + - 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 -/home/ark/.config/retroarch/saves/ -/home/ark/.config/retroarch/states/ +#. Identify retroarch savestate location. For my install they were here + - ``/home/ark/.config/retroarch/saves/`` -ssh into arkos: + - ``/home/ark/.config/retroarch/states/`` -ssh ark@ -password: ark +#. 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 -syncthing apt install: https://apt.syncthing.net/ + - ssh into ark os -.. code-block:: bash - 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 + i. ``ssh ark@`` + ii. Password (default): ``ark`` -for first time configuration, update the GUI address to the devices IP: + - Install Syncthing -open config.xml: + a. Since ArkOS is ubuntu based, you can follow `Syncthings guide `_ -``nano ~/.config/syncthing/config.xml`` + b. Here's what I did -Update gui/address: + .. code-block:: bash + 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 -``
127.0.0.1:8384
`` -> ``
LOCAL_IP_ADDRESS:8384
`` +Syncthing configuration +----------------------- +#. Make syncthing gui accessible -Start it up: ``syncthing`` + - 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 -from your host machine. login to the gui with LOCAL_IP_ADDRESS:8384 + - Open ``~/.config/syncthing/config.xml`` -remove the default folder sync and create a new one + - Update gui/address. ``
127.0.0.1:8384
`` -> ``
LOCAL_IP_ADDRESS:8384
`` then save. -name: whatever you want + - Now startup syncthing from your ssh session with ``$ syncthing`` -folder path: ``/home/ark/.config/retroarch`` + - On your host machine, you should now be able to access the syncthing web UI at ``:8384`` -In ``Ignore Patterns`` check the enable box +#. From the syncthing gui -everything else on default. Hit save + - Remove the default folder sync and create a new one + a. name: whatever you want -Now enter the Ignore Patterns: + b. folder path: ``/home/ark/.config/retroarch`` -.. code-block:: + c. In ``Ignore Patterns`` check the enable box - // DO NOT IGNORE - !/states - !/saves - // IGNORE (everything else) - * + d. everything else on default. Hit save -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 + e. Now enter the Ignore Patterns -As you share across devices make SURE you add the ignore pattern everywhere!! + .. code-block:: -best way i found to do it was rg353m -> NAS -> steamdeck + // 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 +-------------------- -https://docs.syncthing.net/users/autostart.html?highlight=windows#using-systemd +See `syncthings guide here `_ -disable syncthing gui now (save some resources) (in ~/.config/syncthing/config.xml) +#. ``systemctl --user enable syncthing.service`` -```` +#. ``systemctl --user start syncthing.service`` -Also checkout https://docs.syncthing.net/users/tuning.html#tuning-for-low-resources +Resource optimization +--------------------- -to help minimize resource utilization +Syncthing has `a nice page `_ detailing what configuration changes you can make to minimize resource utilization +#. These changes will be made in ``~/.config/syncthing/config.xml`` + +#. For example one thing you can do is disable the web gui with: ```` -systemctl --user enable syncthing.service -systemctl --user start syncthing.service \ No newline at end of file