LemmyNet/lemmyBB

Install the frontend only

Tealk opened this issue · 19 comments

Tealk commented

Hello, is there a possibility to install only the frontend next to an existing installation?

Yes absolutely. It would work something like this:

  • git clone the repo and cargo build to get a binary
  • put the binary on your server, and execute it with these env vars. you need to adjust LEMMY_BB_BACKEND so it connects to your existing lemmy
  • alternatively, clone directly on your server and cargo run (again with env vars)
  • setup nginx with a new (sub)domain, which forwards requests to LEMMY_BB_LISTEN_ADDRESS

Let me know if anything is unclear or you have any problems.

Once this gets to a stable place too, nutomic will likely do releases and publish docker images with them.

Tealk commented

put the binary on your server

where can i find them?
is it the /lemmyBB/target/debug/lemmy_bb ?

Yes

Tealk commented

What does this package belong to? On the net I could not find anything suitable.

./lemmy_bb 
./lemmy_bb: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./lemmy_bb)
./lemmy_bb: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./lemmy_bb)
./lemmy_bb: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./lemmy_bb)

Dont know what that means. Are you running the same architecture on both devices? Maybe you need to use cargo build --release, and then copy from /lemmyBB/target/debug/lemmy_bb. If that doesnt work, try compiling directly on the server.

Tealk commented

I compiled it on my client and then uploaded it to the server and wanted to run the lemmy_bb there
Client Arch x64
Server Debian x64

Ah its probably because glibc version on your client where you compile is different from the server. Either compile on the server directly, or use a Debian vm of the same version to compile.

Tealk commented

running :D
https://lemmybb.rollenspiel.monster/

what would be the best way to start this rocket server?
Currently I use the following command:
LEMMY_BB_BACKEND=http://127.0.0.1:8536 LEMMY_BB_LISTEN_ADDRESS=0.0.0.0:8701 ./lemmy_bb

Great! Best option is probably to write a systemd service file, its pretty simple.

Also, would you like to add some documentation about this to the readme?

Tealk commented

I can do it, but will only make it to the weekend

Of course, there is no rush at all. Take your time.

Tealk commented

Roughly summarized and untested I have to formulate later
am not sure if you put the lemmy_bb as a link or just copy it

# install lemmyBB
cd /opt
git clone https://github.com/LemmyNet/lemmyBB.git
cd lemmyBB
cargo build --release
ls /opt/lemmyBB/target/debug/lemmy_bb /opt/lemmyBB/lemmy_bb

# copy nginx config
cp docker/nginx-lemmybb.conf /etc/nginx/sites-enabled/lemmybb.conf
nano /etc/systemd/system/lemmy_bb.service
[Unit]
Description=lemmy_bb
After=network.target

[Service]
Type=simple
WorkingDirectory=/opt/lemmyBB/
Environment="LEMMY_BB_BACKEND=http://127.0.0.1:8536"
Environment="LEMMY_BB_LISTEN_ADDRESS=127.0.0.1:8703"
Environment="LD_PRELOAD=libjemalloc.so"
ExecStart=/opt/lemmyBB/lemmy_bb
Restart=always

[Install]
WantedBy=multi-user.target
systemctl enable --now lemmy_bb.service 
systemctl status lemmy_bb.service

maybe better to activate the wiki and enter it there than to put everything in the readme?

I would prefer to add it too lemmy-docs, so we dont get tied to github too much. @dessalines do you agree with that?

am not sure if you put the lemmy_bb as a link or just copy it

For now i wont do that, because im not sure what would be the best way to distribute the project, and anyway its not really ready for production.

Tealk commented

For now i wont do that, because im not sure what would be the best way to distribute the project, and anyway its not really ready for production.

I have to put the binary in the root directory; otherwise I get the message that the template folder is missing

True. It might be possible to embed templates etc in the binary, but that seems be complicated and not worth the effort for now.

Tealk commented

I would prefer to add it too lemmy-docs, so we dont get tied to github too much. @dessalines do you agree with that?

i can't install this particular version of mdbook, it runs into error
if @dessalines agrees i can create a pr

If you want to maintain it sure, but I do suggest clients have install methods / instructions in their READMEs.

Tealk commented

with #12 i added it to the readme