lemmy-docs
lemmy-docs copied to clipboard
Under the "From Scratch" installation, it is not clear where Pict-rs is initially installed, so the update doesn't work
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?
In issue #213 the issue of shifting to using git checkout for server came up, I think it is more in the spirit of 'from scratch'. But I'm stuck, because I don't know the steps to make the choice regarding building withembed-pictrs to match:
cargo install lemmy_server --target-dir /usr/bin/ --locked --features embed-pictrs
wouldn't the --features embed-pictrs tell the cargo installation to embed the pictrs server within lemmy?
See: https://github.com/LemmyNet/lemmy-docs/pull/221#issuecomment-1600608062
ok, so maybe from-scratch should encourage non-integration given the philosophy of doing things more 'under control' for your own server. I'll try to add that to the document. Thank you.
~~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.
Embedded pictrs uses the port specified in lemmy.hjson for pictrs.
https://github.com/LemmyNet/lemmy/pull/3201