-
Notifications
You must be signed in to change notification settings - Fork 60
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
Create rmfakecloud-proxy package #448
Conversation
This PR provides a new package intended to ease the setup of rmfakecloud on a device. [rmfakecloud](https://github.com/ddvk/rmfakecloud) is an alternative Xochitl sync server developed by ddvk that anyone can self-host. With this package, connecting to an rmfakecloud server only takes a few steps: * `opkg install rmfakecloud-proxy` * `rmfakecloudctl set-upstream https://...` (define the server to use) * `rmfakecloudctl enable` One can then run `rmfakecloudctl disable` (or uninstall the package) to revert back to the default reMarkable servers. Technical details ----------------- This package reuses most of its logic from the rmfakecloud-proxy installer <https://github.com/ddvk/rmfakecloud-proxy/blob/master/scripts/installer.sh>, but makes it more integrated with Toltec. The following steps happen when enabling rmfakecloud-proxy: * A local certificate authority and a self-signed certificate are generated for the reMarkable cloud domain names (stored in `/opt/var/rmfakecloud-proxy`). * The `rmfakecloud-proxy` service is enabled. This is a proxy server listening on `127.0.42.10` which forwards any requests it receives to the server selected by running `rmfakecloudctl set-upstream`. * Entries are written to the `/etc/hosts` file to direct requests to the reMarkable cloud to the `rmfakecloud-proxy` server. Additionally, if one is already connected to the reMarkable cloud in Xochitl when enabling rmfakecloud-proxy (or connected to rmfakecloud when disabling it), the script takes care of disconnecting them and marking their files as unsynced. This prevents Xochitl from believing that the files have disappeared from the server and therefore deleting them. The “enabled” state survives package upgrades and system upgrades. This state is stored as a file in `/opt/etc/rmfakecloud-proxy/enabled` which exists if and only if the proxy is enabled. Test plan --------- Please make a backup of your files (in `~/.local/share/remarkable/xochitl`) before testing this. To test this PR, you’ll need access to an rmfakecloud instance. I can give temporary access to my instance if needed. The following scenarios should be tested: * Installing and enabling rmfakecloud-proxy while previously being connected to the reMarkable cloud: no files should be lost and they should sync to the server. * Installing and enabling rmfakecloud-proxy while not being connected to the rM cloud: same result as before. * After enabling rmfakecloud-proxy, switching to a different rmfakecloud server with `rmfakecloud set-upstream`: no files should be lost. * Upgrading the system while being connected to rmfakecloud: the rmfakecloud connection should be re-enabled after running `toltecctl reenable`. * Running `rmfakecloudctl disable` should remove entries from the `/etc/hosts` file, uninstall the self-signing CA and disconnect the user. No files should be lost. * Removing the rmfakecloud-proxy package should disable rmfakecloud.
I’ve been testing this for a few days on my rM2 and haven’t had any issues. Testers wanted! (Please see the test plan above.) |
Any thoughts on this @ddvk? |
nicely done 👍 |
btw, there is a -c option now that accepts a yml config file |
if is-enabled; then | ||
echo "rmfakecloud-proxy is already enabled." | ||
else | ||
disconnect-cloud |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we trap various signals here that would cause an exit and disable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean trapping script errors? Or do you have other cases in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script errors, also ctrl-c or another interrupt signal.
I'll have to investigate further but the preremove script of this package fails when invoked as part of |
Should this be changed to a draft until you resolve this? |
The |
`toltecctl uninstall` will now try to uninstall packages in the reverse order of their dependencies, so that a package can use binaries it depends on during its removal scripts (see #448). Packages in a dependency cycle are removed in an unspecified order. Test plan: Upgrade `toltec-bootstrap`, install some packages, then run `toltecctl uninstall`. You should see packages removed in reverse dependency order, so for example: * `libc`, `libpthread`, `libgcc` should generally be the last removed packages * graphical apps should get removed before `display` * `toltec-bootstrap` should get removed before `coreutils-tsort`
I added back the dependency on pgrep. Provided that the updated uninstall script from #456 is used, this package now uninstalls without errors during |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add traps for ctrl-c/other interrupt signals to avoid leaving things in a bad state.
`toltecctl uninstall` will now try to uninstall packages in the reverse order of their dependencies, so that a package can use binaries it depends on during its removal scripts (see #448). Packages in a dependency cycle are removed in an unspecified order.
`toltecctl uninstall` will now try to uninstall packages in the reverse order of their dependencies, so that a package can use binaries it depends on during its removal scripts (see #448). Packages in a dependency cycle are removed in an unspecified order.
`toltecctl uninstall` will now try to uninstall packages in the reverse order of their dependencies, so that a package can use binaries it depends on during its removal scripts (see #448). Packages in a dependency cycle are removed in an unspecified order.
* toltecctl: Honour dependencies when uninstalling (#456) `toltecctl uninstall` will now try to uninstall packages in the reverse order of their dependencies, so that a package can use binaries it depends on during its removal scripts (see #448). Packages in a dependency cycle are removed in an unspecified order. * [rmkit] upgrade remux with rM1 support on 2.9 (#450) this brings remux up to date with rmkit-dev/rmkit@8254893 major improvement is proper support for touch gestures in remux on rM1 after rebooting. the main issue was the display was resizing after remux started, so the touch gestures were using the wrong display size. holding the center button on rM1 would cause remux to restart (and fix this problem), so there is a workaround available. * Update KOReader to 2021.10 (#467) Co-authored-by: raisjn <[email protected]> * Add cache for dependencies install (#473) * Add cache for dependencies install Co-authored-by: Mattéo Delabre <[email protected]> Co-authored-by: raisjn <[email protected]> Co-authored-by: Mattéo Delabre <[email protected]>
Added an error handler to the
(cc @Eeems) |
This PR adds a detailed step-by-step guide to setting up rmfakecloud-proxy on a device (see toltec-dev/toltec#448). It is to be merged when the package reaches the stable branch.
I propose to add a guide to our website for how to use this package to connect to alternative sync servers. See toltec-dev/web#8. |
Just tried to run through the first test and it looks like rmfakecloud-proxy.service fails to start after running Steps that I took:
Looks like the set-upstream configuration was wiped before enable was called. After a disable, set-upstream, enable it worked. I was able to connect after generating a code, and all my documents started uploading! rmfakecloudctl should also have a status method to check on the current upstream, if it's enabled, and if it's running. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I think the issue I found should be resolved, and rmfakecloudctl should be enhanced, I think it's worth getting this into testing first.
@matteodelabre poke? |
Thanks for the review @Eeems! As you proposed I’ll go ahead and merge this, and will make a follow-up PR to address your points. |
This PR provides a new package intended to ease the setup of rmfakecloud on a device. [rmfakecloud](https://github.com/ddvk/rmfakecloud) is an alternative Xochitl sync server developed by ddvk that anyone can self-host. With this package, connecting to an rmfakecloud server only takes a few steps: * `opkg install rmfakecloud-proxy` * `rmfakecloudctl set-upstream https://...` (define the server to use) * `rmfakecloudctl enable` One can then run `rmfakecloudctl disable` (or uninstall the package) to revert back to the default reMarkable servers. Co-authored-by: Nathaniel van Diepen <[email protected]>
* Update xochitl.oxide to support templatectl (#505) * Update xochitl.oxide to support templatectl Co-authored-by: Linus K. <[email protected]> Co-authored-by: Linus K <[email protected]> * Create rmfakecloud-proxy package (#448) This PR provides a new package intended to ease the setup of rmfakecloud on a device. [rmfakecloud](https://github.com/ddvk/rmfakecloud) is an alternative Xochitl sync server developed by ddvk that anyone can self-host. With this package, connecting to an rmfakecloud server only takes a few steps: * `opkg install rmfakecloud-proxy` * `rmfakecloudctl set-upstream https://...` (define the server to use) * `rmfakecloudctl enable` One can then run `rmfakecloudctl disable` (or uninstall the package) to revert back to the default reMarkable servers. Co-authored-by: Nathaniel van Diepen <[email protected]> * Remove rmfakecloud-proxy Co-authored-by: Linus K. <[email protected]> Co-authored-by: Mattéo Delabre <[email protected]> Co-authored-by: Mattéo Delabre <[email protected]>
This PR provides a new package intended to ease the setup of rmfakecloud on a device. [rmfakecloud](https://github.com/ddvk/rmfakecloud) is an alternative Xochitl sync server developed by ddvk that anyone can self-host. With this package, connecting to an rmfakecloud server only takes a few steps: * `opkg install rmfakecloud-proxy` * `rmfakecloudctl set-upstream https://...` (define the server to use) * `rmfakecloudctl enable` One can then run `rmfakecloudctl disable` (or uninstall the package) to revert back to the default reMarkable servers. Co-authored-by: Nathaniel van Diepen <[email protected]>
This PR provides a new package intended to ease the setup of rmfakecloud on a device. rmfakecloud is an alternative Xochitl sync server developed by ddvk that anyone can self-host. With this package, connecting to an rmfakecloud server only takes a few steps:
opkg install rmfakecloud-proxy
rmfakecloudctl set-upstream https://...
(define the server to use)rmfakecloudctl enable
One can then run
rmfakecloudctl disable
(or uninstall the package) to revert back to the default reMarkable servers.Technical details
This package reuses most of its logic from the rmfakecloud-proxy installer https://github.com/ddvk/rmfakecloud-proxy/blob/master/scripts/installer.sh, but makes it more integrated with Toltec. The following steps happen when enabling rmfakecloud-proxy:
/opt/var/rmfakecloud-proxy
).rmfakecloud-proxy
service is enabled. This is a proxy server listening on127.0.42.10
which forwards any requests it receives to the server selected by runningrmfakecloudctl set-upstream
./etc/hosts
file to direct requests to the reMarkable cloud to thermfakecloud-proxy
server.Additionally, if one is already connected to the reMarkable cloud in Xochitl when enabling rmfakecloud-proxy (or connected to rmfakecloud when disabling it), the script takes care of disconnecting them and marking their files as unsynced. This prevents Xochitl from believing that the files have disappeared from the server and therefore deleting them.
The “enabled” state survives package upgrades and system upgrades. This state is stored as a file in
/opt/etc/rmfakecloud-proxy/enabled
which exists if and only if the proxy is enabled.Test plan
Please make a backup of your files (in
~/.local/share/remarkable/xochitl
) before testing this.To test this PR, you’ll need access to an rmfakecloud instance. I can give temporary access to my instance if needed.
The following scenarios should be tested:
rmfakecloud set-upstream
: you should get disconnected from the previous server and no files should be lost.toltecctl reenable
.rmfakecloudctl disable
should remove entries from the/etc/hosts
file, uninstall the self-signing CA and disconnect the user. No files should be lost.