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

Dan: Upgrade Etherpad package (to 1.18.14 or close) #15

Closed
8 of 14 tasks
orblivion opened this issue Sep 29, 2021 · 87 comments
Closed
8 of 14 tasks

Dan: Upgrade Etherpad package (to 1.18.14 or close) #15

orblivion opened this issue Sep 29, 2021 · 87 comments
Assignees

Comments

@orblivion
Copy link

orblivion commented Sep 29, 2021

Total

(This got a little complicated since there was wrapup stuff not really in any category. Will probably leave milestone metrics below as "out of date" unless people are very interested.)

  • Estimated Originally: 17.5-44.5 hr
  • Currently: 38 hrs at the point of experimental app release. Will update after it's in the market in case I need to fix things.

Milestones (out of date)

This section got out of date as far as hours, and it'll probably take more time than it's worth to get back up to date. But keeping around in old state in case anyone cares.

Get started on spk based on Ian's vagrant-spk version

  • Convert vagrant-spk -> spk
    • Estimated: 2-4 hr
    • Actual: 3 hr

Caveat on vagrant-spk -> spk:

  • Figure out why spk packed version can't find any files in the package.
    • Not /usr/bin/bash, not launcher.sh, nothing.

Based on Kenton's changes:

  • Sandstorm Packaging Stuff

    • Graphics, md files, pkgdef, etc
    • Estimated: 1 hr
  • Trivial items

    • Remove excessive logging and console warnings
    • Estimated: .5 hr
  • Style

    • Style tweaks, some for avoiding cutting things off (avatar in sidebar, which Kenton added to ep_author_neat)
    • Estimated: 1-4 hr
      • Pessimistic end of estimate: the new version could be styled sufficiently differently that these tweaks are nontrivial to replicate.
  • Minifying/Caching/Performance

    • Upstream etherpad (as of the old version, at least) minifies on runtime. Kenton's etherpad minifies during the build phase (need to run etherpad outside of Sandstorm manually to trigger it), saving results to ./cache which gets packaged. At runtime, it uses ./cache and and bypasses all minifying.
    • Estimated: 2-6 hr
      • This seems like something that may or may not have changed a fair amount under the hood over the years.
    • Actual (so far): 10hr
  • Dependencies

    • Install plugins, including two modified plugins (ep_comments_page and ep_author_neat) from source. (these have their own milestones)
    • Install sqlite3 and capnp.
    • Estimated: 1-10 hr
      • Long side of this estimate is based on updated plugins causing surprise problems.
    • Actual: 4 hr
  • Migrating dirty.db -> sqlite

    • Dirty.db is Etherpad's default database. Etherpad-Sandstorm used it for very early versions. We ideally should still migrate for the sake of those folks.
    • Estimated: .5 hr
      • I don't see how changes in the latest Etherpad could create surprises here given that this migration runs in the kickoff script.
  • Sandstorm Profile Integrations

    • Automatically populate author name and avatar. Make avatar available in ep_author_neat (see below).
    • Estimated: 2-4 hr
    • Actual: 4hr
  • Sandstorm Auth/Permission Integrations

    • Replace Etherpad identity and permission with Sandstorm's
    • Estimated: 2-4 hr
      • Would be faster, except I worry there may be new places that I have to patch in this permission. Risk may be unauthorized access.
    • Actual: 3.5hr
  • Sandstorm Activities Integrations

    • Posting Sandstorm activity on edit
    • Estimated: .5 hr
    • Actual: .5hr
  • Assorted

    • Settings - initial messages and other cosmetics, basic configs. One text change (which Kenton has noted may warrant translation). Redirect to a document instead of the Etherpad home page.
    • Estimated: 1-2 hr
      • Gonna check for new settings. Something interesting could come up.
  • ep_author_neat

    • UI/styling bugfixes and tweaks. Alter behavior for attributing a paragraph to an author. Show avatar in the sidebar (using changes in etherpad-lite).
    • Estimated: 2-4 hr
      • Some competing upstream changes
    • Actual: 4 hr
  • ep_comments_page

    • UI/styling bugfixes and tweaks. Sandstorm permission: comment. Sandstorm activity: comment.
    • Estimated: 2-4 hr
      • Upstream made a lot of commits
    • Actual: Way over, but I'll count 4 hr
@orblivion
Copy link
Author

Not sure how much community feedback you're looking for first, so lmk when I should go ahead.

I'd start with vagrant-spk -> spk, since testing everything else sort of depends on that.

@ocdtrekkie
Copy link
Member

One of the challenges we've encountered through this process is soliciting community feedback. I think if Ian and I are good with it (I am), I think you should start working, as we are the two people currently administrating this funding, and there isn't a conflict of interest (i.e. we are not paying Ian). The terms we are discussing are not dissimilar from what we'd previously discussed if Ian took on the project, so there's been plenty of time for people to raise objections to the rate or the goal.

So perhaps wait for @zenhack to sign off here, and then consider that a go-ahead.

@garrison
Copy link
Contributor

All sounds good to me. I am merely curious if someone could post a few sentences explaining the vagrant-spk -> spk change (motivation, etc.).

@zenhack
Copy link
Collaborator

zenhack commented Sep 29, 2021

I think the reason for this is that @orblivion uses QuebesOS, which, since it uses virtualization for its own isolation layer, makes running VMs difficult. I think if that initial overhead will make him otherwise able to be more productive it makes sense, though it is important that the build process is well documented and portable.

@zenhack
Copy link
Collaborator

zenhack commented Sep 29, 2021

Also, I think we should send out a thing to the mailing list and wait a day or two before pulling the trigger.

@zenhack
Copy link
Collaborator

zenhack commented Sep 29, 2021

(I sent out a thing)

@orblivion
Copy link
Author

That's right, I can't really do a VM within a VM. And I just enjoy the simplicity of it. Qubes lets me make a VM to separate everything anyway, I may as well just have simple access to the machine.

That said, since I'll be paid for this, and since others may need to pick up the work after me some day, I'm thinking I should take a minute to look into running Vagrant on QubesOS. Maybe there's a way with some sort of caveat. Perhaps it could use Qubes' VM system, or perhaps it can work as totally emulated (and not unusably slow).

@orblivion
Copy link
Author

Yeah, if there's a way it's not very obvious. It doesn't work out of the box at any rate.

@zenhack
Copy link
Collaborator

zenhack commented Oct 2, 2021

Alright, it's been few days and no one has spoken up; I think we can give you the green light.

@orblivion
Copy link
Author

Works with spk in addition to vagrant-spk:

https://github.com/orblivion/etherpad-lite-sandstorm/

Turns out there's not a whole lot different between the two for this package so hopefully vagrant-spk still works just as well. See README.

Includes finishing up an optimization that Ian started (which Kenton didn't even include).

@orblivion
Copy link
Author

Oh, big caveat: spk pack produces something where sandstorm can't seem to find any files referenced by the packagedef (???). @zenhack says he will look into it; it's only blocking release, not development. Worst case we can see if someone else can build it.

@garrison
Copy link
Contributor

garrison commented Oct 4, 2021

Great!

Oh, big caveat

Yeah, this sounds surmountable to me.

@orblivion
Copy link
Author

orblivion commented Oct 5, 2021

Next is installing dependencies. See latest on my repo for the results of that. (4 hours so far.)

I initially included the altered plugins (ep_comments_page and ep_author_neat) in the list for the Dependencies milestone. This was a mistake given that they each have their own milestones.

Just for the sake of sticking to the estimate plan, I tried rolling with it installing them as-is, and they sort of looked promising, but there seem to be upstream changes that are required for the latest etherpad-lite. I'll need to rebase Kenton's changes for them onto latest upstream in their respective milestones.

Assuming people are fine with excluding the altered plugins from the Dependencies miletsone, there's one more thing before I call this done. I'd like some feedback on what I found with the unaltered plugins (see below).

Results

sqlite3

Ian already had taken care of sqlite3.

capnp

I had to wrestle a bit with capnp but I got it to the point where I'm able to require("capnp") without complaints. Confirming that it actually works is part of the "activities" milestone (in retrospect, estimating activities at .5 hours might have been a mistake given that capnp is a newer verison than our previous package, but I could get lucky).

unaltered plugins

They seemed to work fine with the below caveats. I'm curious about your opinions.

Note: Some are New Bugs (only after upgrade) and Existing Bugs (already exist in our previous package). Also, none of these bugs seem to be triggered by being within Sandstorm. They exist when running Etherpad directly.

ep_sticky_attributes

This plugin is supposed to make it so that if you click "bold" (etc) and type, it will type bold. Like a normal word processor. Without this plugin, the only function of the bold button is to format selected text.

Existing Bug: turning on bold, italics etc is indeed sticky, but turning it off is not. (I suppose you could say it's too sticky)

ep_font_family:

Font choice is not "sticky", and ep_sticky_attributes does not change this. You can only select areas and change their font. Though, if you move your caret to the middle of an area that is already a different font, then you can continue typing in that font.

New Bug: The font dropdown menu does not react when you move the caret to an area that no longer has that font.

Granted, in the previous Etherpad package, moving the caret would just switch to "Font Family" (the name of the dropdown) rather than telling you the name of the font at the new location of the caret. But at least it wouldn't be incorrect information.

ep_font_size:

New Bug: Same bug as ep_font_family but for font size.

ep_markdown

Existing Bugs: This plugin is really buggy, at least given the other stew of formatting plugins in the mix. That said, import seems to work better than in the old version. 🤷

Maybe also notable that the markdown format is changed between these two versions.

I vote we nix this plugin. It's a mess. I can't imagine it being useful. Try it out though (on the existing package) to see.

@ocdtrekkie
Copy link
Member

Are these bugs reported to the respective Etherpad repos? I guess my hope is that we can retain the features close to the original package, but ideally that Etherpad plugin updates will resolve these issues independently of our more maintainable Etherpad package.

@orblivion
Copy link
Author

orblivion commented Oct 5, 2021 via email

@orblivion
Copy link
Author

BTW I meant "caret" when I said "cursor". I corrected my comment.

The author (or one of them) of the font plugin chimed in and said he fixed the logic around the headings plugin to fix this bug. Indeed the bug does not appear there. So maybe that's an easy fix. I won't have time to look for a bit tho.

@zenhack
Copy link
Collaborator

zenhack commented Oct 5, 2021

Thanks for the update.

I'm fine with junking the markdown plugin -- indeed, I once started an etherpad doc working under the assumption that I could export it as markdown, and then was annoyed when I found the output was really bad. It would have saved me some time if it was clear that wasn't going to work well at the outset; I would have just used SandMD or something.

Re: node-capnp, I don't expect too much trouble; most of what's changed is just internals to work with newer versions of the v8 FFI.

WRT milestone bookkeeping, entirely up to you how you want to count that; you're not billing us per milestone, so whatever makes it easiest for you to keep track of things is fine with me.

@orblivion
Copy link
Author

orblivion commented Oct 5, 2021 via email

@zenhack
Copy link
Collaborator

zenhack commented Oct 6, 2021 via email

@orblivion
Copy link
Author

Looking a little more closely at the same question with regard to the font color plugin: in our current Etherpad package, moving the caret around does not change the value of the dropdown box. In the latest version of Etherpad and the plugin, it does, though it has an issue:

If you select an area that's all red, it correctly shows up as "red". If you select an area that starts red and ends green, it correctly shows up as "Font Color", indicating that it can't say one way or the other. If you select an area that starts red, goes to green, and ends back on red, it incorrectly (imho) sets the dropdown to "red".

So, it doesn't look at every character in the selection, only the first and last character. I discovered this while looking at its implementation, while trying to fix the aforemention font size and font family bugs. The facility functions provided by etherpad to get the attributes at the various characters don't appear to be very friendly toward implementing it correctly.

Talking it over with John from Etherpad here: ether/ep_font_family#29

Question: Supposing John wants to bring Font Size and Font Family up to par with Font Color with this regard, do we count this as a regression and stop the presses? Or is this not exactly a bug?

@orblivion
Copy link
Author

I also have a worst-case proposal:

Let's say at the end of the day we don't like what the plugins are doing with the dropdowns, or maybe it will be fixed it but it'll just take more time than we want to wait/spend right now. We could fork these plugins and short-circuit them, such that it works like our old etherpad package, in that the dropdown does not reflect the selection at all.

This would be very easy to do.

@ocdtrekkie
Copy link
Member

I am not super worried about non-Sandstorm-impacted plugin behavior, as hopefully Etherpad will patch it at some point, and a dependencies-updated release hopefully won't be a big deal for your new package.

If it's not data corrupting, but just behavior weirdness, I wouldn't worry too much about it.

@orblivion
Copy link
Author

Okay. I'll call this milestone done and move on for now then.

@zenhack
Copy link
Collaborator

zenhack commented Oct 10, 2021

Agreed; I'm not inclined to spend time fussing with minor upstream bugs & regressions, unless they somehow disproportionately affect Sandstorm users.

@orblivion
Copy link
Author

I'm working on the caching/minifying milestone now. I just want to give a heads up - I'm closing in on the estimate high end (6 hours) at this point. I feel like I'm getting there, but there seem to be lots of rickety moving parts that keep throwing me surprises.

@orblivion
Copy link
Author

@zenhack I found that you have settings.json in rootfs rather than putting it in the etherpad-lite directory with a patch. (And I separately put it in a patch, and am just now discovering it in rootfs). So I should do one or the other. Any reason it ought to stay in rootfs?

@zenhack
Copy link
Collaborator

zenhack commented Oct 20, 2021 via email

@zenhack
Copy link
Collaborator

zenhack commented Oct 20, 2021 via email

@orblivion
Copy link
Author

orblivion commented Jan 27, 2022 via email

@zenhack
Copy link
Collaborator

zenhack commented Jan 27, 2022 via email

@orblivion
Copy link
Author

Since we're putting off the caching/minimizing thing for now (and again I'm not sure how much that would even buy us) I'm going to turn off caching altogether so as to not pollute the grain. I could also write it to /tmp/ so that it sticks around until the grain quits. But I'm not sure it makes much if any noticeable difference.


Some background in case this is confusing:

The way Etherpad works out of the box is that it minimizes, maybe gzips, and puts the result in the etherpad-lite/var/ directory (which we've mapped to within the grain, since the db also goes here). It has to do this on the first request of every grain.

The optimal way (the one Kenton ultimately did, and the one we're putting off) is to run this process during packaging time, use the cache/ directory instead of the var/ directory, where cache/ is within the package. Now it'll use the cached responses from the very first run of any grain.

Since we're putting that off, I turned off minimizing a while ago because it's really slow. But it still pollutes the grain by putting un-minimized cached files into the var/ directory. So now (what I'm letting people know about here) I'm just turning off caching.

Before Kenton implemented the optimal minimization cache, he had it to write to a temp directory instead of var/ for this reason. (Except, it looks like he was accidentally writing to etherpad-lite/tmp/ and I don't think that exists. The way it's implemented, if the caching directory doesn't exist, it just skips caching. So, I think Kenton accidentally just turned off caching at this point. Of course he fixed it when he implemented the optimal strategy.)

At any rate, I don't notice any change in speed whether it's /tmp/, var/, or not cached at all.

@zenhack
Copy link
Collaborator

zenhack commented Feb 20, 2022

Any updates?

@orblivion
Copy link
Author

I made a change and did some experimenting that cleared up a lot of confusion (in my mind, anyway) about sandstorm-files.list, alwaysInclude, hidePaths, etc. It was a big ambiguous item in my mind, so it's good that it's out of the way. (There is one weird thing left: inconsistency as to whether the files under the bin/ lib/ lib64/ symlink dirs end up automatically populated in sandstorm-files.list. But this is more about preventing confusion when developing future versions. I guess I could just add it to ISSUES.md.)

I made another change related to file paths inside the grain. @zenhack had the Etherpad var directory pointing to /var/etherpad-lite-var, I'm pointing it straight to /var as Kenton effectively did. With this change, I expect that old grains should work. This also took a lot of time to consider how I was going to handle it, even though the change is fairly small. So that's another big item off my mind.

@orblivion
Copy link
Author

What's left is the Firefox item (since that was the one item from ISSUES.md that I was told was worth fixing), and then some packaging issues basically. And maybe one other problem that I made a note to myself about, but I'm not sure why.

And I think that's it.

@zenhack
Copy link
Collaborator

zenhack commented Mar 14, 2022

I think I have a lead on the firefox issue: it appears to only occur when you have ALLOW_LEGACY_RELAXED_CSP=false set in sandstorm.conf.

Looking at the console, there are numerous csp errors, but they seem to be referring to urls that are hosted internally, but that are being pulled in as a result of javascript injecting stuff into the page (e.g. adding an element that pulls in a stylesheet at runtime). So this might actually be a bug in our CSP handling, and also might not be a blocker after all. I'll look into it more and report back.

@zenhack
Copy link
Collaborator

zenhack commented Mar 14, 2022

Ok, I stared at our CSP implementation for a bit, and I strongly suspect that this is related to that firefox bug (esp. since it works fine in chromium). I'm comfortable punting on this for the etherpad release, as it doesn't affect most prod setups and is probably either a sandstorm issue or a firefox issue.

So I think what's left:

  • appMarketingVersion is still set to the string "TODO".
    • Probably should do a quick scan over to make sure all the metadata is filled out.
  • Figure out who's going to do the official build, and maybe change the appId.
    • If we use the old app's appId, we should confirm upgrading old grains works.

I think it's probably best to use the old appId. In which case, @kentonv needs to either do the build himself or hand off the key to someone.

@orblivion
Copy link
Author

it doesn't affect most prod setups

Well, we can put the app out as experimental and see if it breaks for Firefox users, yeah? Or do you mean we'll let it break for Firefox users in hopes that it'll be fixed soon?


Other than that, yeah I just have to do the packaging stuff as you described and I think that's it.

I already had in my notes to remember to set appMarketingVersion and to check for other things to set in pkdgef. (I'm assuming we should leave pgp-keyring and pgp-signature to Kenton).

Also, README and CHANGELOG. (I want to factor in Kenton's old CHANGELOG).


Though, I added a couple items to ISSUES.md, which I'm guessing you'll want to punt on if address at all:


The checkboxes and hours in the issue description need to be updated. It got a little complicated since there was wrapup stuff not really in any category.

@zenhack
Copy link
Collaborator

zenhack commented Mar 18, 2022 via email

@orblivion
Copy link
Author

Kenton seems to usually set appMarketingVersion to <etherpad-version>~<release-date>. Maybe I'll put the etherpad version and TODO for him to fill in when the time comes?

@zenhack
Copy link
Collaborator

zenhack commented Mar 19, 2022

Maybe @kentonv can comment on why he used that convention rather than the upstream version number?

@orblivion
Copy link
Author

Okay, I looked through the pkgdef and compared it to Kenton's. A few questions remain:

  • CHANGELOG - as described before. that's a TODO for me. (actually maybe significant since a lot may have changed).
  • The first line in the pkgdef file that begins with @ - what's up with that? Does it need to be the same as Kenton's in order for it to be considered the same app?
  • appMarketingVersion - as we described
  • codeURL - should it stay pointing to my github or do we want to host the canonical version on someone else's account?
  • contactEmail - related - should this be me?
  • pgp-keyring - Kenton will do
  • pgp-signature - Kenton will do
  • hidePaths - Related to this, you previously said:

once the files are removed from sandstorm-files.list, they shouldn't be re-added unless spk dev is run in an environment where they're in the old place.

Are you saying that paths such as /bin/bash were only in sandstorm-files.list in the first place because you (@zenhack) initially created the repo on your system? If not, then they must have been added somehow on my system, where /bin is a symlink. In which case, for all I know they could reappear some day (even though they're not reappearing now, which is the mystery I laid out in ISSUES.md)

But if I understood your explanation right, then I'll delete that entry in ISSUES.md as well as the file paths in hidePaths.

@orblivion
Copy link
Author

Yeah, per your initial commit, that seems to be the case. /bin/bash is there but not /usr/bin/bash. I guess that explains it.

@ocdtrekkie
Copy link
Member

Re: What should be Kenton's versus yours, it should be who is responsible the release to some degree. I am unsure if @kentonv would prefer to fork and release this, or if he'd rather hand over or rotate the app key to you. (And I suppose your interest in continuing to do that may also be a relevant question there.)

It's even possible/worth asking if someday we should maintain core app packages within the sandstorm-io org at some future point.

@zenhack
Copy link
Collaborator

zenhack commented Mar 20, 2022 via email

@orblivion
Copy link
Author

Fork the repo to the sandstormports org and put [email protected]

Okay cool. I went with this. I guess for simplicity I'll remind you to fork after I'm done with my few remaining changes. Unless you just want to give me write access to it or do pull requests.

@orblivion
Copy link
Author

Okay I got one small question that comes to mind: I am generating and writing SESSION.txt inside /tmp. As I understand, this means that on each server restart, the existing sessions should break. That could be a problem. However, isn't it the case that Sandstorm refreshes everybody's page on server restart regardless? If not, I'll think of something else for SESSION.txt. No problem saving to grain (I did that previously) I just figured there's no use polluting the filesystem if I can avoid it (it's not a space concern, it's tiny).


If I'm not changing that, I think I'm done making commits until Kenton is ready for the three items I need from him. You can fork the repo to sandstormports.

@ocdtrekkie
Copy link
Member

So, I am thinking I should ask @xet7 to maybe make me an owner of the org here. (Apparently I am a "member" of sandstormports), so that I can in turn add other people to the org. Would it make sense to fork the repo here or figure out to make it so you can transfer it here, so issues and everything remains intact, and if you need to update it, you can maintain access to the canonical repo?

@orblivion
Copy link
Author

Yeah totally. I'll try to do that now.

@orblivion
Copy link
Author

The transfer of ownership thing.

@orblivion
Copy link
Author

Oh you probably can't accept the transfer without being an owner, nevermind. I'll wait.

@orblivion
Copy link
Author

orblivion commented Mar 25, 2022

Okay good deal. I joined the organization and transferred ownership. I can still push to it.

@orblivion
Copy link
Author

Regarding the session thing (literally the only thing left on my list) - I tried sharing a document, and then restarting the app with the restart button.

It reloads the page on the owner's side, but not on the side of the shared app. I see from the logs on the owner's side that it is generating a new SESSION.txt. However, after the app reloads, the person shared with is still able to communicate edits in both directions. I did not expect this.

I guess it means it works at least for this version. I don't know how this would happen other than that the etherpad session key isn't used at all when running in sandstorm. Or maybe it reestablishes the session without reloading the page.

I'd only worry about what happens in future version if the session key somehow becomes relevant and there are hidden connection issues for shared collaborators when the app restarts.

@zenhack
Copy link
Collaborator

zenhack commented Mar 26, 2022

I don't have a strong opinion re: what to do about the session thing; you could move it to /var just in case, but if it appears to be working I'm comfortable punting until and unless a problem comes up testing a future version.

@orblivion
Copy link
Author

Okay I just moved it to /var and we won't have to think about it. Also a few more files ended up in sandstorm-files.list.

That's it, afaik the next step is for Kenton to examine it, sign it, etc. BTW he'll hit an error for lack of pgp files referred to in pkgdef. He can delete those lines in pkgdef until he's ready to sign.

@zenhack
Copy link
Collaborator

zenhack commented Apr 25, 2022

@ocdtrekkie
Copy link
Member

Going to close this one, experimental app seems good enough to consider this done.

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

No branches or pull requests

5 participants