libreddit / libreddit

Private front-end for Reddit
https://github.com/libreddit/libreddit/issues/840
GNU Affero General Public License v3.0
5.02k stars 269 forks source link

[SOLVED]🐛 Bug Report: Cannot run code in replit. #862

Open Taratect opened 11 months ago

Taratect commented 11 months ago

Describe the bug

Hey, I cannot run the code on the built with replit butt on the readme.md.

Steps to reproduce the bug

Just, import the git and run, it gives error exit status 22.

What's the expected behavior?

The repl should run

Additional context / screenshot

Welp I fairly new at this so idk if I'm doing this right or not. However I have successfully ran whoogle on replit. So I don't think it's on my end. Please help me out because I wanna use libreddit without getting rate limited like in the public instances and take my load off on those public instances.

FreeUserIam commented 10 months ago

Replace the code in .replit file with this

run = "while :; do set -ex; nix-env -iA nixpkgs.unzip; curl -o./libreddit -fsSL -- https://github.com/libreddit/libreddit/releases/download/v0.30.1/libreddit; chmod +x libreddit; set +e; ./libreddit -H 63115200; sleep 1; done"
language = "bash"
entrypoint = "src/main.rs"
hidden = ["target"]

[languages]

[languages.rust]
pattern = "**/*.rs"

[languages.rust.languageServer]
start = "rust-analyzer"

[packager]
language = "rust"

[packager.features]
packageSearch = true

[nix]
channel = "stable-22_11"

[gitHubImport]
requiredFiles = [".replit", "replit.nix"]

[deployment]
build = ["cargo build --release"]
run = ["./target/release/my-project"]

This should work. The previous code isnt working because of the nightly link not working in the .replit file.

Taratect commented 10 months ago

This should work. The previous code isnt working because of the nightly link not working in >the .replit file.

Thanks a lot man! For the new code, it worked perfectly. I appreciate ur help. Sorry it took a while to thank u cuz I gave up looking for answers on this thread after a week or two cuz I thought no one would help since the project is kinda not maintained like before. I'll keep the issue open in case someone faces the same problem as me and also u should fork it to change the code of .replit on this repo too. I didn't do it myself cuz I don't wanna take credit of your code.

Btw, I'd also appreciate if u could help me out again. The code ran properly. But I wanna deploy the program on static deployment because that's the free option and replit will stop allowing from hosting from 2024. I tried to follow your instructions and used "./target/release/my-project" as my public directory but i get the following error: package `time-macros v0.2.9` cannot be built because it requires rustic 1.65.0 or newer while the current active rustic version is 1.64.0

I got this error, I tried the default public directory but it didn't work either. I'm sorry for asking ur help again but I'm not coder myself. So I'm unable to fix it

FreeUserIam commented 10 months ago

I will have to look that up. If I find something will tell you.

FreeUserIam commented 10 months ago

I will have to look that up. If I find something will tell you.

Also can you tell me what is static deployment on replit and what was the deployment using .replit file called? A link to that would work

Taratect commented 10 months ago

I will have to look that up. If I find something will tell you.

Also can you tell me what is static deployment on replit and what was the deployment using .replit file called? A link to that would work

Idk what was the deployment on .replit file. It'd didn't give any clear indications. I've just chosen the static deployment because it's the free one. And here is the documentation https://docs.replit.com/category/deployments

I'm having the same problem with Whoogle also (it's giving different error). I don't know the public directory. Basically, static deployment requires a public directory. But Whoogle or Libreddit didn't clearly mention anything about public directory in their documentation. So I just tried different stuff. N as result I tried the directory given on ur code too and got the error as mentioned above

FreeUserIam commented 10 months ago

Oh, that's bad news. What this means is we can only host frontend on replit for free from 2024 that basically means we would not be able to host libreddit(since it also has a backend) for free.

Taratect commented 10 months ago

Oh, that's bad news. What this means is we can only host frontend on replit for free from 2024 that basically means we would not be able to host libreddit(since it also has a backend) for free.

Yes, unless we find a way to know the public directory and host on static deployment. I think the directory u gave ./target/release/my-projectwas correct but for newer version but doesn't work on older version. That's why it gave that type of error. Back when I couldn't run libreddit on replit, I tried other hosting alternative present on this github repo. Heroku is paywalled but Glitch is free. I wonder if applying the same changes of replit would make it work or not. Let me try it out lol

FreeUserIam commented 10 months ago

Oh, that's bad news. What this means is we can only host frontend on replit for free from 2024 that basically means we would not be able to host libreddit(since it also has a backend) for free.

Yes, unless we find a way to know the public directory and host on static deployment. I think the directory u gave ./target/release/my-projectwas correct but for newer version but doesn't work on older version. That's why it gave that type of error. Back when I couldn't run libreddit on replit, I tried other hosting alternative present on this github repo. Heroku is paywalled but Glitch is free. I wonder if applying the same changes of replit would make it work or not. Let me try it out lol

Sorry you didn't get me a public directory is for something that only has a frontend as you might see libreddit also requires a backend to run and only running libreddit's frontend would be of no use. That's why I said that we can't host it on replit. You may try glitch btw maybe it allows free hosting for backend also.

Taratect commented 10 months ago

Sorry you didn't get me a public directory is for something that only has a frontend as you might see libreddit also requires a backend to run and only running libreddit's frontend would be of no use. That's why I said that we can't host it on replit. You may try glitch btw maybe it allows free hosting for backend also.

I see. Now I got it. Damn that sucks! I thought I'd be able to host the backend to if I had the public directory.but ig I was wrong. Anyway thanks for trying. I appreciate it. Atleast I can use it for 2 months because of ur code. That's better than nothing.

As for Glitch, the logs gives me a lot of error and frankly idk what they mean. Ig it gotta be fixed first but glitch doesn't have a .glitch file like replit. So idk how to fix it lol. Btw Idk if Glitch allows backend tho.

FreeUserIam commented 7 months ago

Sorry you didn't get me a public directory is for something that only has a frontend as you might see libreddit also requires a backend to run and only running libreddit's frontend would be of no use. That's why I said that we can't host it on replit. You may try glitch btw maybe it allows free hosting for backend also.

I see. Now I got it. Damn that sucks! I thought I'd be able to host the backend to if I had the public directory.but ig I was wrong. Anyway thanks for trying. I appreciate it. Atleast I can use it for 2 months because of ur code. That's better than nothing.

As for Glitch, the logs gives me a lot of error and frankly idk what they mean. Ig it gotta be fixed first but glitch doesn't have a .glitch file like replit. So idk how to fix it lol. Btw Idk if Glitch allows backend tho.

You found anything? Now since replit doesnt stay on. My instance is down.