Uberspace / lab

The Uberlab provides various tutorials - written by you! - on how to run software and tools on Uberspace 7.
https://lab.uberspace.de
Other
315 stars 414 forks source link

[HedgeDoc] update guide / script enhancement #1103

Closed mspittler closed 2 years ago

mspittler commented 3 years ago

The update guide and the script should both mention and respect the files which are stored in ~/hedgedoc/public/uploads. If the HedgeDoc config is set to "imageUploadType": "filesystem" all users images are stored in this place.

Thanks @EV21 for writing the script in the first place!

EV21 commented 3 years ago

Thank you, I only used HedgeDoc for writing personal stuff and guides without images, so I missed that point.

By checking that out I noticed uploading images needs some additional config, otherwise the editor will just display something like "uploading image..." So ~/etc/services.d/hedgedoc.ini also needs the following settings

CMD_DOMAIN="isabell.uber.space",
CMD_PROTOCOL_USESSL="true",

... If the HedgeDoc config is set to "imageUploadType": "filesystem" all users images are stored in this place.

This is the default setting

I'm actually not a big fan of copying persistent files all the time into the app file tree.

  1. Linking could be a better way of doing it, so we just keep all the persistent stuff at a fix place.
  2. Or define in config.json something different than the default: uploadsPath -> ./public/uploads - e.g. /home/isabell/hedgedoc_uploads (It looks like there is currently no environment variable for this setting) - So the update script doesn't care.

What do you think?

mspittler commented 3 years ago

I don't see a perfect solution, but some ideas.

But first, regarding the ~/etc/services.d/hedgedoc.ini: Since domain is by default defined in the config.json-example, I'd rather add there protocolUseSSL = true under production in the installation guide.

I'm actually not a big fan of copying persistent files all the time into the app file tree.

I agree. I think for the moment, a message in the guide and when running the script is sufficient. For example in do_upgrade():

echo "If everything works fine you can delete ~/hedgedoc_$LOCAL. Please consider that there might me uploaded files in ~/hedgedoc_$LOCAL/public/uploads which were not migrated to the new version."

Users who made it this far, will be reminded and handle the problem to their taste. For a more permanent solution I'd wait for HedgeDoc 2.0, since this is the great rewrite and might introduce anyway breaking chances.

Last question: Since you have removed ~/hedgedoc/.sequelizerc from the guide, is it not necessary anymore?

Best wishes!

EV21 commented 3 years ago

I don't see a perfect solution, but some ideas.

But first, regarding the ~/etc/services.d/hedgedoc.ini: Since domain is by default defined in the config.json-example, I'd rather add there protocolUseSSL = true under production in the installation guide.

Yes, we can also do it that way.

In my initial guide re-release I removed the config.json completely to avoid double or conflicting configuration settings. At that time the ´.sequlizerc` file was used by the app where you also had to set the database credentials. Since the release of 1.8 it is not used any more. The HedgeDoc team advertised something like "The Release of 2.0 will be early 2021" and its config system will be based on environment variables and .env files. - So I used to set all settings with environment variables in preparation for the new app.

I agree. I think for the moment, a message in the guide and when running the script is sufficient. For example in do_upgrade():

echo "If everything works fine you can delete ~/hedgedoc_$LOCAL. Please consider that there might me uploaded files in ~/hedgedoc_$LOCAL/public/uploads which were not migrated to the new version."

Users who made it this far, will be reminded and handle the problem to their taste. For a more permanent solution I'd wait for HedgeDoc 2.0, since this is the great rewrite and might introduce anyway breaking chances.

We can do that too.

Last question: Since you have removed ~/hedgedoc/.sequelizerc from the guide, is it not necessary anymore?

Since 1.8 it is not necessary and you can safely delete it.