SaltyAom / hifumin

Opensource optimized Hentai Platform
https://hifumin.app
117 stars 11 forks source link

Tried running bismarck branch on local, then on vercel, some problems. #11

Open animemandir opened 2 years ago

animemandir commented 2 years ago

What I did -

image

Sorry if this something very obvious error T_T ....

SaltyAom commented 2 years ago

First off, sorry for the late reply.

For Deployment

Ok, so current Hifumin is using Docker for deployment so you have to change the deployment target to Vercel first. Basically, just install this package @sveltejs/adapter-vercel, and change the adapter in the sveltekit.config.js, and it should be fine.

For Blank Page

For the blank page, the timing is quite perfect with #10 so I'm assuming that's the problem. So basically, last week, nHentai has put up their bot protection service which makes Hifumin API (and almost global service using nHentai API) go down.

About DDOS Protection

Also if on production, you couldn't fetch the API in the backend it's because lately, Hifumin has been targeted for DDOS, so the API has only worked on the frontend for the last 3 weeks, so I'm putting up a bot and DDOS protection service.

But I've just put it down since you're asking for it and the attack has been down lately I have disabled the security so it should be all working, but be aware that if Hifumin got some DDOS again, the bot protection service will be put up again and might cause some error on your deployment.

If an error is not tolerable

However, if you couldn't tolerate any API error, I'd recommend that you should also deploy a dedicated Hifumin API for your own service only and point your endpoint to there.

Hifumin API server is currently deployed on GCP Cloud Run but actually, it's a Docker container, you could deploy it on any VPS, but I'd recommend deploying it to Serverless since it's free.

Also, if you're going to deploy API on your own, you should also comment out this line:

# * --- Running Stage ---
FROM alpine:3.15.4 as main

WORKDIR /usr/app

COPY --from=builder /usr/local/cargo/bin/akashic akashic

# Comment out this line
# COPY data data

EXPOSE 8080

CMD ["./akashic"]

About User and Databases

Beware that in the future it might not work as I will implement CSRF and domain checking, so I'd recommend that if you're planning to use a login system, you should also deploy your own which can be found here.

Currently, it needs 2 services

  1. Platnetscale as a database
  2. Redis, as a session management

Both can be deployed for free.

However, for easier management and setup, I'd recommend you to use supabase as it's easy to integrate in, but you would have to do it yourself as I have no plan on using it in this project.

Afterword

Also, since Hifumin is still in development, it's quite surprising but a welcoming one, that devs out there would like to create a base from Hifumin. I haven't written any documentation about it on how to deploy or how it might work yet because it's currently subject to change, but if you want, you could ask me anything about it.

animemandir commented 2 years ago

image

Now i really don't know what's happening. Here is my fork: https://github.com/animemandir/hifumin/tree/bismarck ELIFECYCLE  Command failed with exit code 1.

18:36:48.809 | Error! Command "pnpm build" exited with 1 18:36:48.911 | Error: Command "vercel build" exited with 1

Now after I added "@sveltejs/kit/node/polyfills" as external, it gave this - `This Serverless Function has crashed.

Your connection is working correctly.

Vercel is working correctly.`