mirror of
https://github.com/len0rd/personal-website.git
synced 2025-02-28 19:42:15 -05:00
cleanup syncthing_arkos config page
This commit is contained in:
parent
1ca7c9b0db
commit
edf3f8228e
25
assets/diagrams/syncthing_setup.drawio
Normal file
25
assets/diagrams/syncthing_setup.drawio
Normal file
|
@ -0,0 +1,25 @@
|
|||
<mxfile host="65bd71144e">
|
||||
<diagram id="5akZJ5bUuDu-clLUh8Qc" name="Page-1">
|
||||
<mxGraphModel dx="725" dy="548" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0"/>
|
||||
<mxCell id="1" parent="0"/>
|
||||
<mxCell id="6" style="edgeStyle=none;html=1;entryX=0.25;entryY=1;entryDx=0;entryDy=0;startArrow=classic;startFill=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="2" target="3">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="2" value="ArkOS (RG353M)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
|
||||
<mxGeometry x="250" y="480" width="120" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="3" value="NAS<br>(Unraid + Syncthing container)" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="320" y="380" width="120" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="5" style="edgeStyle=none;html=1;entryX=0.75;entryY=1;entryDx=0;entryDy=0;startArrow=classic;startFill=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="4" target="3">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="4" value="SteamDeck" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
|
||||
<mxGeometry x="390" y="480" width="120" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
|
@ -1,88 +1,119 @@
|
|||
.. syncthing_ark_os
|
||||
|
||||
.. for symbols like left/right arrow
|
||||
.. include:: <isonum.txt>
|
||||
|
||||
Setup Syncthing on arkos
|
||||
========================
|
||||
|
||||
.. post:: 09, July 2023
|
||||
:tags: emulation, infrastructure, guide
|
||||
:category: Hobbies
|
||||
:author: len0rd
|
||||
|
||||
`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:
|
||||
|
||||
.. 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@<local_ip_addr>
|
||||
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@<local_ip_addr>``
|
||||
|
||||
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 <https://apt.syncthing.net/>`_
|
||||
|
||||
``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
|
||||
|
||||
``<address>127.0.0.1:8384</address>`` -> ``<address>LOCAL_IP_ADDRESS:8384</address>``
|
||||
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. ``<address>127.0.0.1:8384</address>`` -> ``<address>LOCAL_IP_ADDRESS:8384</address>`` 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 ``<ARKOS_LOCAL_IP_ADDR>: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 <https://docs.syncthing.net/users/autostart.html?highlight=windows#using-systemd>`_
|
||||
|
||||
disable syncthing gui now (save some resources) (in ~/.config/syncthing/config.xml)
|
||||
#. ``systemctl --user enable syncthing.service``
|
||||
|
||||
``<gui enabled="false" tls="false" debugging="false">``
|
||||
#. ``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 <https://docs.syncthing.net/users/tuning.html#tuning-for-low-resources>`_ 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: ``<gui enabled="false" tls="false" debugging="false">``
|
||||
|
||||
systemctl --user enable syncthing.service
|
||||
systemctl --user start syncthing.service
|
Loading…
Reference in a new issue