Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: screepers/screeps-launcher
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e2a2e33e66d37d72a2f290e04661685d4bb682e8
Choose a base ref
..
head repository: screepers/screeps-launcher
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8797a4fd25b5a3a446aedfb8b6a805210c8e9b26
Choose a head ref
Showing with 62 additions and 29 deletions.
  1. +8 −5 .github/workflows/docker.yml
  2. +3 −1 .github/workflows/go.yaml
  3. +16 −5 Dockerfile
  4. +2 −0 docker-compose.yml
  5. +15 −15 flake.lock
  6. +5 −3 go.mod
  7. +12 −0 go.sum
  8. +1 −0 launcher/config.go
13 changes: 8 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ on:
- main
tags:
- 'v*'

workflow_dispatch:

jobs:
@@ -28,26 +28,29 @@ jobs:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@3d58c274f17dffee475a5520cbe67f0a882c4dbb
uses: docker/login-action@7ca345011ac4304463197fac0e56eab1bc7e6af0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
id: docker_buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@3d58c274f17dffee475a5520cbe67f0a882c4dbb
uses: docker/login-action@7ca345011ac4304463197fac0e56eab1bc7e6af0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
uses: docker/metadata-action@bd26c982ee2b6c0f9744591c74c527e8a669f72f
with:
images: |
${{ env.IMAGE_NAME }}
ghcr.io/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@94d76d3bc1409736cb5dc1ada9502bec3a72973c
uses: docker/build-push-action@5e99dacf67635c4f273e532b9266ddb609b3025a
with:
context: .
push: true
4 changes: 3 additions & 1 deletion .github/workflows/go.yaml
Original file line number Diff line number Diff line change
@@ -60,6 +60,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Rename Windows Files
run: for F in screeps-launcher_windows*; do mv $F $F.exe; done
- name: Create release
@@ -76,4 +78,4 @@ jobs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bin
asset_name: screeps-launcher_${{ matrix.os }}_${{ matrix.arch }}
asset_content_type: application/octet-stream
asset_content_type: application/octet-stream
21 changes: 16 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -5,16 +5,27 @@ ARG ARCH=amd64

WORKDIR /app
COPY . .
RUN CGO_ENABLED=0 \
RUN --mount=type=cache,target=/go/pkg/mod \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=${ARCH} \
go build -o screeps-launcher ./cmd/screeps-launcher

FROM buildpack-deps:buster
RUN groupadd --gid 1000 screeps \
&& useradd --uid 1000 --gid screeps --shell /bin/bash --create-home screeps \
&& mkdir /screeps && chown screeps.screeps /screeps
USER screeps

ARG UID=1000
ARG GID=1000
RUN <<-EOT bash
if [[ "${GID}" != "0" ]] ; then
groupadd --gid ${GID} screeps
fi
if [[ "${UID}" != "0" ]] ; then
useradd --uid ${UID} --gid ${GID} --shell /bin/bash --create-home screeps
fi
mkdir /screeps && chown ${UID}:${GID} /screeps
EOT

USER ${UID}:${GID}
VOLUME /screeps
WORKDIR /screeps
COPY --from=builder /app/screeps-launcher /usr/bin/
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ services:
context: .
args:
ARCH: amd64
UID: 1000
GID: 1000
image: screepers/screeps-launcher
volumes:
- ./config.yml:/screeps/config.yml
30 changes: 15 additions & 15 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -6,13 +6,14 @@ require (
github.com/c-bata/go-prompt v0.2.6
github.com/cavaliercoder/grab v2.0.0+incompatible
github.com/go-redis/redis/v7 v7.4.1
github.com/go-resty/resty/v2 v2.16.0
github.com/go-resty/resty/v2 v2.16.2
github.com/gorilla/mux v1.8.1
github.com/gorilla/websocket v1.5.3
github.com/otiai10/copy v1.14.0
github.com/otiai10/copy v1.14.1
github.com/pkg/errors v0.9.1
github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e
go.mongodb.org/mongo-driver v1.17.1
go.mongodb.org/mongo-driver v1.17.2
gopkg.in/yaml.v2 v2.2.4
gopkg.in/yaml.v3 v3.0.1
)

@@ -27,6 +28,7 @@ require (
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mattn/go-tty v0.0.7 // indirect
github.com/montanaflynn/stats v0.7.1 // indirect
github.com/otiai10/mint v1.6.3 // indirect
github.com/pkg/term v1.2.0-beta.2 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
12 changes: 12 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -9,6 +9,10 @@ github.com/go-redis/redis/v7 v7.4.1 h1:PASvf36gyUpr2zdOUS/9Zqc80GbM+9BDyiJSJDDOr
github.com/go-redis/redis/v7 v7.4.1/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
github.com/go-resty/resty/v2 v2.16.0 h1:qpKalHWI2bpp9BIKlyT8TYWEJXOk1NuKbfiT3RRnzWc=
github.com/go-resty/resty/v2 v2.16.0/go.mod h1:0fHAoK7JoBy/Ch36N8VFeMsK7xQOHhvWaC3iOktwmIU=
github.com/go-resty/resty/v2 v2.16.1 h1:0EB9QI65hPIGU1uX7EdRPd0ZBcvWHS0DcpAoEayMVQw=
github.com/go-resty/resty/v2 v2.16.1/go.mod h1:0fHAoK7JoBy/Ch36N8VFeMsK7xQOHhvWaC3iOktwmIU=
github.com/go-resty/resty/v2 v2.16.2 h1:CpRqTjIzq/rweXUt9+GxzzQdlkqMdt8Lm/fuK/CAbAg=
github.com/go-resty/resty/v2 v2.16.2/go.mod h1:0fHAoK7JoBy/Ch36N8VFeMsK7xQOHhvWaC3iOktwmIU=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
@@ -61,8 +65,12 @@ github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU=
github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w=
github.com/otiai10/copy v1.14.1 h1:5/7E6qsUMBaH5AnQ0sSLzzTg1oTECmcCmT6lvF45Na8=
github.com/otiai10/copy v1.14.1/go.mod h1:oQwrEDDOci3IM8dJF0d8+jnbfPDllW6vUjNc3DoZm9I=
github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks=
github.com/otiai10/mint v1.5.1/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAqyUSM=
github.com/otiai10/mint v1.6.3 h1:87qsV/aw1F5as1eH1zS/yqHY85ANKVMgkDrf9rcxbQs=
github.com/otiai10/mint v1.6.3/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAqyUSM=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/term v1.2.0-beta.2 h1:L3y/h2jkuBVFdWiJvNfYfKmzcCnILw7mJWm2JQuMppw=
@@ -83,6 +91,8 @@ github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfS
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.mongodb.org/mongo-driver v1.17.1 h1:Wic5cJIwJgSpBhe3lx3+/RybR5PiYRMpVFgO7cOHyIM=
go.mongodb.org/mongo-driver v1.17.1/go.mod h1:wwWm/+BuOddhcq3n68LKRmgk2wXzmF6s0SFOa0GINL4=
go.mongodb.org/mongo-driver v1.17.2 h1:gvZyk8352qSfzyZ2UMWcpDpMSGEr1eqE4T793SqyhzM=
go.mongodb.org/mongo-driver v1.17.2/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
@@ -143,6 +153,8 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
1 change: 1 addition & 0 deletions launcher/config.go
Original file line number Diff line number Diff line change
@@ -100,6 +100,7 @@ func NewConfig() *Config {
"passport-steam": "1.0.17",
"minipass-fetch": "2.1.2",
"express-rate-limit": "6.7.0",
"psl": "1.10.0",
},
Backup: &ConfigBackup{
Dirs: make([]string, 0),