Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature "sync shared" #1978

Merged
merged 57 commits into from
Mar 12, 2023
Merged

Conversation

AlvinSchiller
Copy link
Collaborator

I added a component to sync the shared files (shortcut and audiofolders) from a remote server via a mounted share or ssh.
It allows to manage the shortcuts and audiofiles of one to many Phonieboxes in a central place (e.g. NAS, one main Phoniebox, ...) in the network, but keeps the possibility to play audio offline once the data where synced.

There is a "full-sync" command that can be bound to an CardId and an optional "sync-on-rfid-scan" feature which syncs only the files for a CardId on scan (shortcuts and and the corresponding audiofolder). The "sync-on-rfid-scan" feature can also be enabled/disabled with a command bound to an CardId.

See "components/synchronisation/sync-shared/README.md" for further details.

unquoted "is set" check fails if var is not set and if-statement has a following check. Further the preceding "is empty" check is sufficient in this case.
Enabled Flag hinzugefuegt, mit fruehem ausstieg.
rsync command ignoriert nun hinzufuegen der "folder.conf" als Aenderung.
- hierdurch sync nicht nur bei erstem Scan sondern immer moeglich
Ordner auf Remote werden initialisiert wenn nicht vorhanden.
Uunveraenderte Dateien werden uebersprungen (--update). Permissions ignoriert (--np-perms). folder.conf als Aenderung ignoriert (--exclude).
Nachtraegliches Setzen der Persmission korrigiert.
Added full synchronisation on rfid scan.
Changed rsync option to correctly sync files and ignore 'folder.conf' and 'placholder' file
Command for changing acticvation of 'cync on rfid scan'
Sync folder.conf from server, but dont delete it if only present on phoniebox (except folder will be deleted)
added function for changing access of files/folder
changed definition of SYNC*PATH variables
Make sure the path variables are alike and dont have a trailing slash
moved command handling to funtions
moved rsync to single function
moved server check to funtion
@s-martin
Copy link
Collaborator

s-martin commented Mar 2, 2023

Hi, thanks for improving Phoniebox 🙏

We will review the PR :) and are probably happy to add this feature.

please be aware that we are intending to move to Phoniebox 3 (future3 branches), which is an all python implementation. So you might want to consider to implement the feature there.
Details: https://rpi-jukebox-rfid.readthedocs.io/en/latest/

@AlvinSchiller
Copy link
Collaborator Author

Thank you too for this great project :)
I read about future 3 and wasn't quite sure about the lifetime of 2.x.
But as I have no experience in python I made a start here. But I will try and get into it and add it for future 3 aswell.

@s-martin
Copy link
Collaborator

s-martin commented Mar 3, 2023

To be honest there is no clear "schedule" when version 3 will be the new stable.

@s-martin
Copy link
Collaborator

@AlvinSchiller, can you have a look?
Merge of #1968 now conflicts with this PR.

@s-martin s-martin added this to the 2.5 milestone Mar 10, 2023
@AlvinSchiller
Copy link
Collaborator Author

@s-martin Merged it

@s-martin
Copy link
Collaborator

Note: we need to update the wiki as well after merging this PR: https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/Sychnronising-Phonieboxes-in-a-local-network

@s-martin s-martin merged commit 70b0bc5 into MiczFlor:develop Mar 12, 2023
@AlvinSchiller AlvinSchiller deleted the feature/sync-shared branch March 12, 2023 21:35
AlvinSchiller added a commit to AlvinSchiller/RPi-Jukebox-RFID that referenced this pull request Dec 21, 2023
* removed "is set" check (#)

unquoted "is set" check fails if var is not set and if-statement has a following check. Further the preceding "is empty" check is sufficient in this case.

* Sync fuer shortcuts und audiofile von lokalem Ordner (wenn Datei/Ordner nicht existent)

* chmod und chown korrigiert. update mpc angepasst

* sync in eigenes Script ausgelagert

* Settings in conf ausgelagert. Weitere Anpassungen im Abluaf

Enabled Flag hinzugefuegt, mit fruehem ausstieg.
rsync command ignoriert nun hinzufuegen der "folder.conf" als Aenderung.
- hierdurch sync nicht nur bei erstem Scan sondern immer moeglich
Ordner auf Remote werden initialisiert wenn nicht vorhanden.

* Synchronisierung korrigiert

Uunveraenderte Dateien werden uebersprungen (--update). Permissions ignoriert (--np-perms). folder.conf als Aenderung ignoriert (--exclude).
Nachtraegliches Setzen der Persmission korrigiert.

* gitignore erweitert

* Sync Shared als Componente ausgelagert

* Sync Shared Flag angepasst

* Skripte Pfade und Aufrufe korrigiert

* Skript Name angepasst

* Install Skript hinzugefuegt

* ReadMe hinzugefuegt

* New feature 'full sync'. rsync options corrected

Added full synchronisation on rfid scan.
Changed rsync option to correctly sync files and ignore 'folder.conf' and 'placholder' file

* Added DEBUG_sync_shared_sh to WebUi

* Added new Feature

Command for changing acticvation of 'cync on rfid scan'

* corrected description of new Command

* Timeout for server check added to settings

* Added script for configuration. Improved installation

* Adjusted sync rules for folder.conf

Sync folder.conf from server, but dont delete it if only present on phoniebox (except folder will be deleted)

* Added Readme

* Readme adjusted

* Readme adjusted

* refactored sync script.

* changed definition of owner and rights in setup conf

* refactored sync script

added function for changing access of files/folder
changed definition of SYNC*PATH variables

* refactoring and path handling

Make sure the path variables are alike and dont have a trailing slash
moved command handling to funtions
moved rsync to single function
moved server check to funtion

* removed leftover var

* new rfid commands harmonised

* minor corrections

* Added synchronisation mode SSH

config updated for new settings

* Settings sample updated

* Exclude special folders from syncing

* renamed folder sync-shared-from-server to sync-shared

Updated README.md

* refactored commands to playout_control.sh

fullsync and changeOnRfidScan refactored to playout_controls.sh

* fixed exec_for_mode for paths with whitespaces

* use consinstent quotation

* use consistent var access

* removed unused logic

* added documentation comments to conf file

* reordered conf and updated README

* updated README

* refactored function definition

* fixed sync_from_server for paths with whitespaces

* applied editorconfig

* applied filename convention

* refactored filepath to var

* updated README

added special thanks section

* fixed db update after sync for spotify version

* install packages for openssh-client added

* updated comments

* Update README.md

* fixed logic for subfolder shortcuts

* Update README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants