Lurkars / ghs-server

Server component for Gloomhaven Secretariat
https://gloomhaven-secretariat.de
GNU Affero General Public License v3.0
38 stars 14 forks source link

application.properties empty #27

Open dcpc007 opened 2 months ago

dcpc007 commented 2 months ago

Hello / Bonjour

Case

I try to install a version for my group on a VPS.

i run a docker-compose file to mount a local folder to be able to edit parameters, application starts, i see the sqllite file and application.properties, but this one is empty (0 byte).

I run temporary with basic docker start and inside the container, the application.properties is empty too.

The doc says to overwrite the properties. Did i miss something ? Should we create manually all lines ?

Additional infos

When i try to reach on my browser (http://dns:port) i have noclient.html page -->

Gloomhaven Secretariat Server Server is running. No client installed. If you want to serve client, see Instructions.

dcpc007 commented 2 months ago

For info too, i try to create this docker-compose.yml

version: '3'

services:
  ghs-server:
    image: gloomhavensecretariat/ghs-server
    ports:
      - "3382:8080"
    environment:
      - TZ=Europe/Paris
    restart: unless-stopped
    volumes:
      - /srv/ghs-server/ghs:/root/.ghs
Lurkars commented 2 months ago

If the file exists, just add the content required.

dcpc007 commented 2 months ago

ok, maybe it could be more explicit to modify this line (at least then) :

To serve with your own certificate, overwrite the following properties in your application.properties file

https://github.com/Lurkars/ghs-server/blob/8050dca7b9fbecb7d58070189c0f7e1d925ace28/README.md?plain=1#L84

Lurkars commented 2 months ago

This is just bad wording, just add the lines to the file!

dcpc007 commented 2 months ago

Before implement my own certificate, documentation says there's already an embedded default cert. i try to configure with only

server.ssl.enabled=true
ghs-server.public=true

Server web page shows

Bad Request
This combination of host and port requires TLS.

And trying to connect via GHS web and select my public config to connect fails 2024-05-12 23_34_19-Gloomhaven Secretariat

2024-05-12 23_28_31-Gloomhaven Secretariat

i join the log of the docker-compose start too d-c_start.log


Port is a "random" port not used i choose in my range.

And when i remove ssl enable, i have the noclient.html page which forward on docs to install client (with the GUI part i don't have here) : Server is running. No client installed. If you want to serve client, see [Instructions](https://github.com/Lurkars/ghs-server#serve-client).

Then on webUi, if i try to connect, without "secured" checkbox thicked, nothing appears on webUI. But the docker logs show an HTTP parsing request header :

ghs-server    | 2024-05-12T23:42:22.736+02:00  INFO 7 --- [nio-8080-exec-8] o.apache.coyote.http11.Http11Processor   : Error parsing HTTP request header
ghs-server    |  Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.
ghs-server    |
ghs-server    | java.lang.IllegalArgumentException: Invalid character found in method name [0x160x030x010x060xa60x010x000x060xa20x030x030xc70xb20x890x860x9b"0xed0xc70x82s}0xf80xa1;i0xab0xb910x1b0xa20xf3WpQ0x190xa1$I0xdc0xffs0xfa ]. HTTP method names must be tokens
ghs-server    |         at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:407) ~[tomcat-embed-core-10.1.19.jar!/:na]
ghs-server    |         at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:264) ~[tomcat-embed-core-10.1.19.jar!/:na]
ghs-server    |         at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-10.1.19.jar!/:na]
ghs-server    |         at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896) ~[tomcat-embed-core-10.1.19.jar!/:na]
ghs-server    |         at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744) ~[tomcat-embed-core-10.1.19.jar!/:na]
ghs-server    |         at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.19.jar!/:na]
ghs-server    |         at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-10.1.19.jar!/:na]
ghs-server    |         at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.19.jar!/:na]
ghs-server    |         at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63) ~[tomcat-embed-core-10.1.19.jar!/:na]
ghs-server    |         at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na]
ghs-server    |

Don't know how to interpret that, and make it works until there.

Lurkars commented 2 months ago

You need to use the correct port for SSL. Seems your connecting to the HTTP Port instead of HTTPS.

dcpc007 commented 2 months ago

in my docker-compose file i have

ports:
    - "3082:8080"

should be the good one if i understand the doc :

So to easily enable SSL, just edit the application.properties file in the GHS server configuration folder /.ghs and add the following line: server.ssl.enabled=true. As a self-signed certificate is used, it is untrusted by all modern browsers. To connect, just type https://{your-ip}:{server-port} (https://localhost:8080 with default values) and accept the security warnings. You should then be able to connect using SSL. (This must be done for each client).

a docker ps shows : PORTS : 0.0.0.0:3082->8080/tcp

There's another port mentionned in doc (8081 by default), but it's for http when https is enabled.

Lurkars commented 2 months ago

Okay, what happens if you visit https://localhost:3082 ?