go-gost / gost

GO Simple Tunnel - a simple tunnel written in golang
https://gost.run
MIT License
4.39k stars 528 forks source link

Deployment Issue: Config file is lost after Docker container restarts #506

Closed amirsaam closed 5 months ago

amirsaam commented 5 months ago

Hi, thanks for your valuable project!

Unfortunately looks like config file is not persistent between container restarts in Docker environment. I tried to make a volume for GOST under it's pathPrefix/config but still after restart the file is lost. Can you explain how can I make sure the file is persistent?

Thanks,

cnwhy commented 5 months ago

You can use this interface saveConfigRequest

amirsaam commented 5 months ago

@cnwhy Hi, thanks for the reply but I don't think it's a good solution, GOST should save a file automatically in a path and try to read that in that path first and we should make it persistent in docker.

ginuerzh commented 5 months ago

You should start GOST with -C from config file:

gost -C /path/to/config/file

then save config to /path/to/config/file when it changes.

cnwhy commented 5 months ago

@amirsaam I understand what you mean, so web-ui uses the "saveConfigRequest" interface to implement "auto save"

amirsaam commented 5 months ago

Thanks!