C9Glax / tranga

Docker-Container to monitor (Manga) Scanlation-Sites for download new chapters.
GNU General Public License v3.0
157 stars 15 forks source link

Docker website shows nginx welcome page #35

Closed schklom closed 1 year ago

schklom commented 1 year ago

Maybe related to https://github.com/C9Glax/tranga/issues/4

The Docker's Website contains

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to [nginx.org](http://nginx.org/).
Commercial support is available at [nginx.com](http://nginx.com/).

Thank you for using nginx.

and that's it.

The Docker's API page contains some JSON:

Click me (JSON response) ```json [ { "Item1": { "Method": "GET" }, "Item2": "/", "Item3": [] }, { "Item1": { "Method": "GET" }, "Item2": "/Connectors", "Item3": [] }, { "Item1": { "Method": "GET" }, "Item2": "/Publications/Known", "Item3": [ "internalId?" ] }, { "Item1": { "Method": "GET" }, "Item2": "/Publications/FromConnector", "Item3": [ "connectorName", "title" ] }, { "Item1": { "Method": "GET" }, "Item2": "/Publications/Chapters", "Item3": [ "connectorName", "internalId", "onlyNew?", "onlyExisting?", "language?" ] }, { "Item1": { "Method": "GET" }, "Item2": "/Tasks/Types", "Item3": [] }, { "Item1": { "Method": "POST" }, "Item2": "/Tasks/CreateMonitorTask", "Item3": [ "connectorName", "internalId", "reoccurrenceTime", "language?" ] }, { "Item1": { "Method": "POST" }, "Item2": "/Tasks/CreateDownloadChaptersTask", "Item3": [ "connectorName", "internalId", "chapters", "language?" ] }, { "Item1": { "Method": "GET" }, "Item2": "/Tasks", "Item3": [ "taskType", "connectorName?", "publicationId?" ] }, { "Item1": { "Method": "DELETE" }, "Item2": "/Tasks", "Item3": [ "taskType", "connectorName?", "searchString?" ] }, { "Item1": { "Method": "GET" }, "Item2": "/Tasks/Progress", "Item3": [ "taskType", "connectorName", "publicationId", "chapterSortNumber?" ] }, { "Item1": { "Method": "POST" }, "Item2": "/Tasks/Start", "Item3": [ "taskType", "connectorName?", "internalId?" ] }, { "Item1": { "Method": "GET" }, "Item2": "/Tasks/RunningTasks", "Item3": [] }, { "Item1": { "Method": "GET" }, "Item2": "/Queue/List", "Item3": [] }, { "Item1": { "Method": "POST" }, "Item2": "/Queue/Enqueue", "Item3": [ "taskType", "connectorName?", "publicationId?" ] }, { "Item1": { "Method": "DELETE" }, "Item2": "/Queue/Dequeue", "Item3": [ "taskType", "connectorName?", "publicationId?" ] }, { "Item1": { "Method": "GET" }, "Item2": "/Settings", "Item3": [] }, { "Item1": { "Method": "POST" }, "Item2": "/Settings/Update", "Item3": [ "downloadLocation?", "komgaUrl?", "komgaAuth?", "kavitaUrl?", "kavitaUsername?", "kavitaPassword?", "gotifyUrl?", "gotifyAppToken?", "lunaseaWebhook?" ] } ] ```

This happens without using a reverse-proxy.

How do I get the interface shown in the screenshots? :P

kacpak commented 1 year ago

I've checked the docker contents. You need to add /Website to the url... So https://tranga.homelab.address/Website

kacpak commented 1 year ago

You can also configure your reverse proxy to do this for you. Traefik example label:

      traefik.http.routers.tranga.middlewares: tranga-website@docker
      traefik.http.middlewares.tranga-website.addprefix.prefix: /Website
kacpak commented 1 year ago

Bigger problem is that the website has hardcoded fetches to port 6531...

You need to also expose tranga-api on reverse proxy, and manually via browser's dev tools set a cookie "apiUri" that points to it. It should work after a reload.

C9Glax commented 1 year ago

Okay here are a few setup things/how thins run.

  1. tranga-api runs in container A and exposes port 6531 for requests.
  2. website runs in container B. inside container B port 80 is exposed and bridged to port 9555 in docker.
  3. Website has "hardcoded" port 6531, but that can be changed on the website (settings -> API-Url)

So here is what I guess is happening for you: You have a nginx server runnning on port 80 somewhere on that machine, and if you check the logs for website, you will probably see nothing at the moment. You get to see the interface when using port 9555.

You need to add /Website to the url...

Only if you reverse proxied "/website" to that port.

schklom commented 1 year ago

Thank you both for the replies, here is how the containers behave currently (from inside the containers to avoid Docker and port problems).

The tranga-website container shows default NGINX page on http://localhost:80:

From inside the "tranga-website" container: Click here for details ```bash $ wget http://localhost:80 Connecting to localhost:80 (127.0.0.1:80) saving to 'index.html' index.html 100% |************************************************************************| 615 0:00:00 ETA 'index.html' saved $ cat index.html Welcome to nginx!

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.

```

And /Website seems to be the good page:

From inside the "tranga-website" container: Click here for details ```bash $ wget http://localhost:80/Website Connecting to localhost:80 (127.0.0.1:80) Connecting to localhost (127.0.0.1:80) saving to 'Website' Website 100% |************************************************************************| 7951 0:00:00 ETA 'Website' saved $ cat Website  Tranga website image is Blahaj Tranga etc... ```

@kacpak

and manually via browser's dev tools set a cookie "apiUri" that points to it

I doubt that this is the intended procedure.

@C9Glax The problem seems to come from inside the containers themselves.

kacpak commented 1 year ago

I doubt that this is the intended procedure.

@schklom I'm pretty sure it's not intended. There is an option in the settings to change the apiUrl via GUI, it just didn't work for me so I had to do this the hard way

janaxhell commented 1 year ago

Found this app today, all I get from port 6531 on http:// is

[{"Item1":{"Method":"GET"},"Item2":"/","Item3":[]},{"Item1":{"Method":"GET"},"Item2":"/Connectors","Item3":[]},{"Item1":{"Method":"GET"},"Item2":"/Publications/Known","Item3":["internalId?"]},{"Item1":{"Method":"GET"},"Item2":"/Publications/FromConnector","Item3":["connectorName","title"]},{"Item1":{"Method":"GET"},"Item2":"/Publications/Chapters","Item3":["connectorName","internalId","onlyNew?","onlyExisting?","language?"]},{"Item1":{"Method":"GET"},"Item2":"/Tasks/Types","Item3":[]},{"Item1":{"Method":"POST"},"Item2":"/Tasks/CreateMonitorTask","Item3":["connectorName","internalId","reoccurrenceTime","language?"]},{"Item1":{"Method":"POST"},"Item2":"/Tasks/CreateDownloadChaptersTask","Item3":["connectorName","internalId","chapters","language?"]},{"Item1":{"Method":"GET"},"Item2":"/Tasks","Item3":["taskType","connectorName?","publicationId?"]},{"Item1":{"Method":"DELETE"},"Item2":"/Tasks","Item3":["taskType","connectorName?","searchString?"]},{"Item1":{"Method":"GET"},"Item2":"/Tasks/Progress","Item3":["taskType","connectorName","publicationId","chapterSortNumber?"]},{"Item1":{"Method":"POST"},"Item2":"/Tasks/Start","Item3":["taskType","connectorName?","internalId?"]},{"Item1":{"Method":"GET"},"Item2":"/Tasks/RunningTasks","Item3":[]},{"Item1":{"Method":"GET"},"Item2":"/Queue/List","Item3":[]},{"Item1":{"Method":"POST"},"Item2":"/Queue/Enqueue","Item3":["taskType","connectorName?","publicationId?"]},{"Item1":{"Method":"DELETE"},"Item2":"/Queue/Dequeue","Item3":["taskType","connectorName?","publicationId?"]},{"Item1":{"Method":"GET"},"Item2":"/Settings","Item3":[]},{"Item1":{"Method":"POST"},"Item2":"/Settings/Update","Item3":["downloadLocation?","komgaUrl?","komgaAuth?","kavitaUrl?","kavitaUsername?","kavitaPassword?","gotifyUrl?","gotifyAppToken?","lunaseaWebhook?"]}]

and if I add /website, simply nothing. On port 9555 I get the same Nginx message and nothing again if I add /website. Tried with a cloudflare domain and I get nothing at all.

I'm on docker and I have used the docker-compose in homepage only changing the volume paths to

- /srv/dev-disk-by-uuid-5b67514d-485e-4306-873e-b1cbb54ccf99/Config/Tranga:/usr/share/Tranga-API
- /srv/dev-disk-by-uuid-5b67514d-485e-4306-873e-b1cbb54ccf99/Config/Tranga/imageCache:/usr/share/nginx/html/imageCache:ro
- /srv/dev-disk-by-uuid-2628F1C228F19153/data/media/manga:/Manga
schklom commented 1 year ago

if I add /website, simply nothing

That's because it is /Website, not /website :P

janaxhell commented 1 year ago

Tried both..

schklom commented 1 year ago

/Website works for me and /website does not. Weird that neither works for you.

janaxhell commented 1 year ago

Where is the "/Website" part referenced? I don't see it anywhere besides this thread. Does the output in the first part of my comment make any sense to you? I have tried the IP of my server with both ports, both /Website and /website and the same through Nginx Proxy Manager using my domain in the form of https://my.domain.tld/Website or /website. EDIT to be completely clear, I have tried http://192.168.1.94:9555/Website and /website and http://192.168.1.94:6531/Website and /website

EDIT 2 Oh, my.. with no sort of advice, the SSL certificate was not working, I have tried another random one among those I have in NPM and now it works. For the record, the one not working (which works fine with 99% of my services) is the 15 years Cloudflare certificate. I can now see the UI of Tranga. !solved

EDIT 3 I have a different problem now, I have exposed the api with its own domain, added my kavita url, but how do I add manga sites? I have launched a search to see what happens, and I just see a circle rolling.

EDIT 4 Ok, it's just unstable, I tried back and forth the local IP and public domain for the api and after several switches and page reloads, it finally worked. I can search titles and choose the site from where to get mangas.

C9Glax commented 1 year ago

Note to self: Don't push to master on the evening before vacation and build...

What happened: Build context in .github actions was ./ instead of /Website, causing all relevant files to be moved to the subdirectory in tranga-website

So it should now again just be http://whateverAddress/ instead of http://whateverAddress/Website