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

Under the "From Scratch" installation, it is not clear where Pict-rs is initially installed, so the update doesn't work #219

Open
mtekman opened this issue Jun 19, 2023 · 5 comments

Comments

@mtekman
Copy link
Contributor

mtekman commented Jun 19, 2023

The problem occurs here:

apt install pkg-config libssl-dev libpq-dev postgresql
# installs latest release, you can also specify one with --version
# The --locked argument uses the exact versions of dependencies specified in
# `cargo.lock`at release time. Running it without the flag will use newer minor
# release versions of those dependencies, which are not always guaranteed to compile.
# Remove the parameter `--features embed-pictrs` if you don't require image hosting.
cargo install lemmy_server --target-dir /usr/bin/ --locked --features embed-pictrs

To me it looks like pictrs is embedded within the lemmy_server binary. But later we're told that we can update it via building it in /var/lib/pictrs-source and moving it to /usr/bin/

rustup update
cd /var/lib/pictrs-source
git checkout main
git pull --tags
# check docker-compose.yml for pict-rs version used by lemmy
# https://github.com/LemmyNet/lemmy-ansible/blob/main/templates/docker-compose.yml#L40
git checkout v0.2.6-r2
# or simply add the bin folder to your $PATH
$HOME/.cargo/bin/cargo build --release
cp target/release/pict-rs /usr/bin/
systemctl restart pictrs

Issue: Installing Lemmy when not a sudo user

My lemmy user account does not have root privileges and so cannot use the --target-dir /usr/bin parameter when building. As a result, the final lemmy_server binary exists only at /home/lemmy/.cargo/bin/. Inside this folder there is no pict-rs binary.

So the main question for me now is: where is pictrs installed when --features embed-pictrs is used?

@RocketDerp

This comment was marked as abuse.

@mtekman
Copy link
Contributor Author

mtekman commented Jun 24, 2023

wouldn't the --features embed-pictrs tell the cargo installation to embed the pictrs server within lemmy?

See: #221 (comment)

@RocketDerp

This comment was marked as abuse.

@mtekman
Copy link
Contributor Author

mtekman commented Jun 26, 2023

As another note, the PICTRS port appears (at least to me) to be hardcoded to 8080 when included within lemmy_server. Or at least I'm not sure how to change it.

Edit: Nope, outdated observation.

@Nutomic
Copy link
Member

Nutomic commented Jun 26, 2023

Embedded pictrs uses the port specified in lemmy.hjson for pictrs.

LemmyNet/lemmy#3201

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

3 participants