feat: add configurable HTTP port
This commit is contained in:
@@ -40,7 +40,7 @@ USER appuser
|
||||
|
||||
ENV TZ=Asia/Jakarta
|
||||
|
||||
EXPOSE 2200 80 8443
|
||||
EXPOSE 2200 8080 8443
|
||||
|
||||
LABEL org.opencontainers.image.title="Tunnel Please" \
|
||||
org.opencontainers.image.description="SSH-based tunnel server"
|
||||
|
||||
@@ -22,6 +22,7 @@ The following environment variables can be configured in the `.env` file:
|
||||
|----------|-------------|---------|----------|
|
||||
| `DOMAIN` | Domain name for subdomain routing | `localhost` | No |
|
||||
| `PORT` | SSH server port | `2200` | No |
|
||||
| `HTTP_PORT` | HTTP server port | `8080` | No |
|
||||
| `HTTPS_PORT` | HTTPS server port | `8443` | No |
|
||||
| `TLS_ENABLED` | Enable TLS/HTTPS | `false` | No |
|
||||
| `TLS_REDIRECT` | Redirect HTTP to HTTPS | `false` | No |
|
||||
|
||||
@@ -193,7 +193,8 @@ func (cw *CustomWriter) AddInteraction(interaction Interaction) {
|
||||
var redirectTLS = false
|
||||
|
||||
func NewHTTPServer() error {
|
||||
listener, err := net.Listen("tcp", ":80")
|
||||
httpPort := utils.Getenv("HTTP_PORT", "8080")
|
||||
listener, err := net.Listen("tcp", ":"+httpPort)
|
||||
if err != nil {
|
||||
return errors.New("Error listening: " + err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user