Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish to Docker Hub

on:
push:
branches:
- master
workflow_dispatch: # Allows manual triggering of the workflow

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/myimage:latest
${{ secrets.DOCKERHUB_USERNAME }}/myimage:${{ github.sha }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.10-slim

ENV SHIFT_GAMES='bl3 blps bl2 bl1' \
ENV SHIFT_GAMES='bl4 bl3 blps bl2 bl1' \
SHIFT_PLATFORMS='epic steam' \
SHIFT_ARGS='--schedule' \
TZ='America/Chicago'
Expand Down
34 changes: 17 additions & 17 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

- **Compatibility:** 3.9+.
- **Platform:** Crossplatform.
- **Repo:** https://github.com/ugoogalizer/autoshift forked from https://github.com/Fabbi/autoshift
- **Repo:** https://github.com/zarmstrong/autoshift forked from https://github.com/ugoogalizer/autoshift forked from https://github.com/Fabbi/autoshift

# Overview

Data provided by Mental Mars' Websites via this [shiftcodes.json](https://raw.githubusercontent.com/ugoogalizer/autoshift-codes/main/shiftcodes.json) file that is updated reguarly by an instance of [this scraper](https://github.com/ugoogalizer/autoshift-scraper). You don't need to run the scraper as well, only this `autoshift` script/container. This is to reduce the burden on the Mental Mars website given the great work they're doing to make this possible.<br>
Data provided by Mental Mars' Websites via this [shiftcodes.json](https://raw.githubusercontent.com/zarmstrong/autoshift-codes/main/shiftcodes.json) file that is updated reguarly by an instance of [this scraper](https://github.com/zarmstrong/autoshift-scraper). You don't need to run the scraper as well, only this `autoshift` script/container. This is to reduce the burden on the Mental Mars website given the great work they're doing to make this possible.<br>

This documentation intended to be temporary until Issue [#53](https://github.com/Fabbi/autoshift/issues/53) and PR [#54](https://github.com/Fabbi/autoshift/pull/54) in the the upstream [autoshift by Fabbi](https://github.com/Fabbi/autoshift/) is merged in.

Expand All @@ -16,6 +16,7 @@ Games currently maintained by mental mars that are scraped and made available to
- [Borderlands](https://mentalmars.com/game-news/borderlands-golden-keys/)
- [Borderlands 2](https://mentalmars.com/game-news/borderlands-2-golden-keys/)
- [Borderlands 3](https://mentalmars.com/game-news/borderlands-3-golden-keys/)
- [Borderlands 4](https://mentalmars.com/game-news/borderlands-4-shift-codes/)
- [Borderlands The Pre-Sequel](https://mentalmars.com/game-news/bltps-golden-keys/)
- [Tiny Tina's Wonderlands](https://mentalmars.com/game-news/tiny-tinas-wonderlands-shift-codes)

Expand All @@ -31,7 +32,7 @@ You can choose to only redeem mods/skins etc, only golden keys or both. There is
## Installation

```sh
git clone git@github.com:ugoogalizer/autoshift.git
git clone git@github.com:zarmstrong/autoshift.git
```

or download it as zip
Expand Down Expand Up @@ -123,12 +124,12 @@ docker run \
--restart=always \
-e SHIFT_USER='<username>' \
-e SHIFT_PASS='<password>' \
-e SHIFT_GAMES='bl3 blps bl2 bl1 ttw' \
-e SHIFT_GAMES='bl4 bl3 blps bl2 bl1 ttw' \
-e SHIFT_PLATFORMS='epic xboxlive psn nintendo' \
-e SHIFT_ARGS='--schedule -v' \
-e TZ='America/Chicago' \
-v autoshift:/autoshift/data \
ugoogalizer/autoshift:latest
zarmstrong/autoshift:latest
```

## Docker Compose Usage:
Expand All @@ -138,7 +139,7 @@ docker run \
version: "3.0"
services:
autoshift:
image: ugoogalizer/autoshift:latest
image: zarmstrong/autoshift:latest
container_name: autoshift_all
restart: always
volumes:
Expand All @@ -148,7 +149,7 @@ services:
- SHIFT_PLATFORMS=epic xboxlive psn
- SHIFT_USER=<username>
- SHIFT_PASS=<password>
- SHIFT_GAMES=bl3 blps bl2 bl1 ttw gdfll
- SHIFT_GAMES=bl4 bl3 blps bl2 bl1 ttw gdfll
- SHIFT_ARGS=--schedule -v
```
## Kubernetes Usage:
Expand Down Expand Up @@ -186,9 +187,7 @@ spec:
spec:
containers:
- name: autoshift
# Fix version so it doesn't auto-update
#image: fabianschweinfurth/autoshift@sha256:4cc0232e371f574c992fa7df3290f3fd037f4c36e4cc00c79f8228634bb08550
image: ugoogalizer/autoshift/autoshift:1.8
image: zarmstrong/autoshift/autoshift:latest
imagePullPolicy: IfNotPresent
env:
- name: SHIFT_USER
Expand All @@ -206,7 +205,7 @@ spec:
- name: SHIFT_ARGS
value: "--schedule 6 -v"
- name: SHIFT_GAMES
value: "bl3 blps bl2 bl1 ttw"
value: "bl4 bl3 blps bl2 bl1 ttw"
- name: TZ
value: "Australia/Sydney"
resources:
Expand Down Expand Up @@ -258,7 +257,7 @@ Example: `p@ssw0rd`
#### **SHIFT_GAMES** (recommended)
The game(s) you want to redeem codes for

Default: `bl3 blps bl2 bl`
Default: `bl4 bl3 blps bl2 bl`

Example: `blps` or `bl bl2 bl3`

Expand All @@ -268,6 +267,7 @@ Example: `blps` or `bl bl2 bl3`
|Borderlands 2|`bl2`|
|Borderlands: The Pre-Sequel|`blps`|
|Borderlands 3|`bl3`|
|Borderlands 4|`bl4`|
|Tiny Tina's Wonderlands|`ttw`|
|Godfall|`gdfll`|

Expand Down Expand Up @@ -351,10 +351,10 @@ docker push ${HARBORURL}:443/autoshift/autoshift:latest
docker push ${HARBORURL}:443/autoshift/autoshift:${VERSIONTAG}

#Tag and Push the image to public docker hub repo
docker login -u ugoogalizer docker.io/ugoogalizer/autoshift
docker tag ${IMAGE} docker.io/ugoogalizer/autoshift:latest
docker tag ${IMAGE} docker.io/ugoogalizer/autoshift:${VERSIONTAG}
docker push docker.io/ugoogalizer/autoshift:latest
docker push docker.io/ugoogalizer/autoshift:${VERSIONTAG}
docker login -u zarmstrong docker.io/zarmstrong/autoshift
docker tag ${IMAGE} docker.io/zarmstrong/autoshift:latest
docker tag ${IMAGE} docker.io/zarmstrong/autoshift:${VERSIONTAG}
docker push docker.io/zarmstrong/autoshift:latest
docker push docker.io/zarmstrong/autoshift:${VERSIONTAG}

```
3 changes: 2 additions & 1 deletion query.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def without(self, *args):
"bl1": "Borderlands: Game of the Year Edition",
"bl2": "Borderlands 2",
"bl3": "Borderlands 3",
"bl4": "Borderlands 4",
"blps": "Borderlands: The Pre-Sequel",
"ttw": "Tiny Tina's Wonderland",
"gdfll": "Godfall",
Expand Down Expand Up @@ -360,7 +361,7 @@ def progn(*args: _VT) -> _VT:

def parse_shift_orcicorn():
import json
key_url = "https://raw.githubusercontent.com/ugoogalizer/autoshift-codes/main/shiftcodes.json"
key_url = "https://raw.githubusercontent.com/zarmstrong/autoshift-codes/main/shiftcodes.json"


resp = requests.get(key_url)
Expand Down