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

Update from_scratch.md (LEMMY_UI variables, and added note about failing postgresql config) #221

Merged
merged 5 commits into from
Jun 22, 2023

Conversation

mtekman
Copy link
Contributor

@mtekman mtekman commented Jun 19, 2023

Updated out of date LEMMY_UI environment variables, and added caution with failing postgresql configuration

Note that currently Lemmy only supports non-SSL connections to databases. More info [here](https://github.com/LemmyNet/lemmy/issues/3007).
Note:
* Lemmy currently only supports non-SSL connections to databases. More info [here](https://github.com/LemmyNet/lemmy/issues/3007).
* Your postgres config might need to be edited to allow password authentication instead of peer authentication. More info [here](https://github.com/LemmyNet/lemmy-docs/issues/220).
Copy link
Member

@Nutomic Nutomic Jun 20, 2023

Choose a reason for hiding this comment

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

Linking to an issue is not great in this case. Better link to an external page which explains this, so that the issue can be closed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed.... but the issue page gives an instant fix and solution to people who are not familiar with postgres. It took me some time too to understand from the various different search queries of "Failed Authentication postgres" what exactly was required to get things running.

Do you have a good reference with an example solution we can link directly to? All I'm seeing is various stackoverflow links

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the fix inline and removed the link to the issue.
I've also just seen that there is a Troubleshooting page, but it looks like it's more docker specific. Should I add the postgres note there instead?

@@ -118,7 +120,7 @@ yarn build:prod
exit
```

Add another systemd unit file, this time for lemmy-ui. You need to replace example.com with your actual domain. Put the file in `/etc/systemd/system/lemmy-ui.service`, then run `systemctl enable lemmy-ui` and `systemctl start lemmy-ui`.
Add another systemd unit file, this time for lemmy-ui. You need to replace example.com with your actual domain. Put the file in `/etc/systemd/system/lemmy-ui.service`, then run `systemctl enable lemmy-ui` and `systemctl start lemmy-ui`. Note that some of the environment variables `LEMMY_*` are subject to change, and you should use the most up to date variable names, as [found here](https://github.com/LemmyNet/lemmy-ui#configuration)
Copy link
Member

Choose a reason for hiding this comment

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

I dont think there are any plans to change the env vars again, so remove this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah good. I can get rid of the "Note that the..." part, but should I still keep the link to the config page?

This comment was marked as abuse.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kept the config link, but removed the part where I said the envs might change. I also added a rust log.

@Nutomic
Copy link
Member

Nutomic commented Jun 21, 2023

Looks good like this, but you need to format the file with prettier.

@mtekman
Copy link
Contributor Author

mtekman commented Jun 21, 2023

prettier -c from_scratch.md
Checking formatting...
All matched files use Prettier code style!

Not sure what I'm doing wrong...

@mtekman
Copy link
Contributor Author

mtekman commented Jun 21, 2023

One other issue that is slightly outside the scope of this PR, is how does the update of pictrs fit?

When we do cargo install lemmy_server --features embed_pictrs, I see no pictrs binary appear in my installation target (~/.cargo/bin/), so I assume that pictrs is embedded within lemmy_server.

But later in the document we talk about building in /var/lib/pictrs and copying over to /usr/bin/.

I guess I'm not really clear on what the --features embed_pictrs flag does.

Related: MichaIng/DietPi#6434 (comment)

@Nutomic
Copy link
Member

Nutomic commented Jun 21, 2023

The CI has a problem where it sometimes runs on an old version of the code, thats probably why its failing here.

Yes with --features embed_pictrs it is embedded inside the Lemmy binary, running on a different port. Its worth mentioning the possiblity to compile without this option and compiling pict-rs manually. This is necessary to use a custom config or other customizations. It looks like the pictrs section under upgrading was forgotten to be removed when that feature was added, could you get rid of it?

@mtekman
Copy link
Contributor Author

mtekman commented Jun 21, 2023

Oh I see! So when lemmy_server is updated, so is the embedded pictrs. Okay, I will kick it out

Edit: I kept it in because I think it's useful, but I added a note about it not being needed if --features embed_picts is used.
Let me know if I should kick it out entirely, and I will happily do so.

@@ -207,14 +217,17 @@ systemctl restart lemmy-ui

### Pict-rs

If you did **not** use the `--features embed-pictrs` flag, then this script below is necessary for installing/updating Pict-rs as a standalone server.
Otherwise, pict-rs should update with lemmy_server.
Copy link
Member

Choose a reason for hiding this comment

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

This only makes sense if you mention in the beginning that pictrs can be installed as standalone.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will add, but another point of confusion for me:

Pict-rs requires the magick command which comes with Imagemagick version 7, but Ubuntu 20.04 only comes with Imagemagick 6. So you need to install that command manually, eg from the official website.

This is still true, regardless of whether pict-rs is standalone or embedded, right?

Copy link
Member

Choose a reason for hiding this comment

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

Yes dependencies would be the same either way.

@Nutomic
Copy link
Member

Nutomic commented Jun 22, 2023

Looks good but there is a conflict.

@mtekman
Copy link
Contributor Author

mtekman commented Jun 22, 2023

force pushed after rebase, let me know if anything looks weird. Cheers

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.

3 participants