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

Recreate shares.json in case of deletion #952

Closed
wants to merge 1 commit into from
Closed

Recreate shares.json in case of deletion #952

wants to merge 1 commit into from

Conversation

PVince81
Copy link
Contributor

@PVince81 PVince81 commented Jul 8, 2020

To be able to clear shares when testing, we need to be able to reload
the json files after they have been deleted.

Later on, in a real-world scenario, we need to be able to rebuild the
json file based on information stored in the storage. (see inline TODO)

@butonic

Test steps:

  1. Create a folder "test"
  2. Share "test" with "Marie"
  3. Refresh the page, see that the share exists
  4. Delete "shares.json"
  5. Refresh the page, see that the shares are gone

Before this fix: the shares would still be there until the service is reloaded
After this fix: the shares are gone directly and the file is recreated empty.

TODOs:

  • get preliminary review for approach
  • remove print statements
  • apply the same approach for publicshares.json

To be able to clear shares when testing, we need to be able to reload
the json files after they have been deleted.

Later on, in a real-world scenario, we need to be able to rebuild the
json file based on information stored in the storage.
@PVince81 PVince81 requested review from labkode and butonic July 8, 2020 10:07
}

func (m *mgr) Lock() {
m.locked = true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe instead of overriding Lock/Unlock, could simply set the flag in the Save() method before and after writing to catch the events that were triggered by us

@labkode
Copy link
Member

labkode commented Jul 8, 2020

@PVince81 as this is mainly for testing: why don't you recreate the daemon again?

@PVince81
Copy link
Contributor Author

PVince81 commented Jul 8, 2020

@individual-it it might be possible to restart the "reva-sharing" service alone, might be faster to boot up then restarting everything ?

@PVince81
Copy link
Contributor Author

PVince81 commented Jul 8, 2020

hmm, the problem might be that the container where the services run is not the same.
they might have shared volumes but not shared processes.

restarting the service would require having some kind of API in the container that runs reva to be able to tell it to restart services.

@individual-it correct ?

@individual-it
Copy link
Contributor

yes we would have to talk somehow across the container to restart the service.
Anyway how would an admin do it? If a user is deleted it would be impractical to restart the complete service.
Would it make sense to recreate the shares if a change in the user is detected, e.g. the id. I guess even if a user is recreated in LDAP with the same name, email etc. the ID should be different, or?

@butonic
Copy link
Contributor

butonic commented Feb 3, 2021

won't be continued here

@butonic butonic closed this Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants