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

Install the frontend only #9

Closed
Tealk opened this issue Sep 24, 2022 · 19 comments
Closed

Install the frontend only #9

Tealk opened this issue Sep 24, 2022 · 19 comments

Comments

@Tealk
Copy link
Collaborator

Tealk commented Sep 24, 2022

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

@Nutomic
Copy link
Member

Nutomic commented Sep 26, 2022

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.

@dessalines
Copy link
Member

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

@Tealk
Copy link
Collaborator Author

Tealk commented Sep 27, 2022

put the binary on your server

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

@Nutomic
Copy link
Member

Nutomic commented Sep 27, 2022

Yes

@Tealk
Copy link
Collaborator Author

Tealk commented Sep 29, 2022

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)

@Nutomic
Copy link
Member

Nutomic commented Sep 29, 2022

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
Copy link
Collaborator Author

Tealk commented Sep 29, 2022

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

@Nutomic
Copy link
Member

Nutomic commented Sep 29, 2022

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
Copy link
Collaborator Author

Tealk commented Sep 29, 2022

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

@Nutomic
Copy link
Member

Nutomic commented Sep 29, 2022

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
Copy link
Collaborator Author

Tealk commented Sep 29, 2022

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

@Nutomic
Copy link
Member

Nutomic commented Sep 29, 2022

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

@Tealk
Copy link
Collaborator Author

Tealk commented Sep 30, 2022

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?

@Nutomic
Copy link
Member

Nutomic commented Sep 30, 2022

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
Copy link
Collaborator Author

Tealk commented Sep 30, 2022

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

@Nutomic
Copy link
Member

Nutomic commented Sep 30, 2022

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
Copy link
Collaborator Author

Tealk commented Sep 30, 2022

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

@dessalines
Copy link
Member

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

@Tealk
Copy link
Collaborator Author

Tealk commented Sep 30, 2022

with #12 i added it to the readme

@Nutomic Nutomic closed this as completed Oct 6, 2022
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