Skip to content

Commit

Permalink
Merge pull request #185 from sonroyaalmerol/internal-port
Browse files Browse the repository at this point in the history
Add option to change internal port
  • Loading branch information
sonroyaalmerol authored Nov 11, 2024
2 parents 595463c + 24f63b6 commit e491dd1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,7 @@ RUN chmod +x /m3u-proxy/entrypoint.sh
ENV PUID=1000
ENV PGID=1000

ENV PORT=8080

# The container entrypoint
ENTRYPOINT ["/m3u-proxy/entrypoint.sh", "/m3u-proxy/m3u-proxy"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ Access the generated M3U playlist at `http://<server ip>:8080/playlist.m3u`.

| ENV VAR | Description | Default Value | Possible Values |
|-----------------------------|----------------------------------------------------------|---------------|------------------------------------------------|
| PORT | Set listening port of service inside the container. | 8080 | Any valid port |
| PUID | Set UID of user running the container. | 1000 | Any valid UID |
| PGID | Set GID of user running the container. | 1000 | Any valid GID |
| TZ | Set timezone | Etc/UTC | [TZ Identifiers](https://nodatime.org/TimeZones) |
Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"context"
"fmt"
"m3u-stream-merger/database"
"m3u-stream-merger/m3u"
"m3u-stream-merger/proxy"
Expand Down Expand Up @@ -54,10 +55,10 @@ func main() {
})

// Start the server
utils.SafeLogln("Server is running on port 8080...")
utils.SafeLogln(fmt.Sprintf("Server is running on port %s...", os.Getenv("PORT")))
utils.SafeLogln("Playlist Endpoint is running (`/playlist.m3u`)")
utils.SafeLogln("Stream Endpoint is running (`/proxy/{originalBasePath}/{streamID}.{fileExt}`)")
err = http.ListenAndServe(":8080", nil)
err = http.ListenAndServe(fmt.Sprintf(":%s", os.Getenv("PORT")), nil)
if err != nil {
utils.SafeLogFatalf("HTTP server error: %v", err)
}
Expand Down

0 comments on commit e491dd1

Please sign in to comment.