Skip to content

Commit

Permalink
version 1.0.1-alpha
Browse files Browse the repository at this point in the history
version 1.0.1-alpha
  • Loading branch information
Millefeuille42 authored Apr 4, 2024
2 parents 23bd6a6 + 77ae830 commit 838dcf7
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [ "master" ]
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "master" ]
branches: [ "master", "develop" ]

env:
REGISTRY: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [ "master" ]
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "master" ]
branches: [ "master", "develop" ]

env:
REGISTRY: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [ "master" ]
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "master" ]
branches: [ "master", "develop" ]

env:
REGISTRY: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
branches: [ "master", "develop" ]

jobs:
build-api:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Welcome, Helldiver! You're about to deploy the Helldivers II Discord Bot, your t
The Helldivers II Discord Bot is accessible at [this url](https://discord.com/oauth2/authorize?client_id=1219964573231091713&permissions=277025705024&scope=bot) for immediate deployment.
Alternatively, it can be self-deployed using the provided resources.

[Join the official server!](https://discord.gg/5DawaMJh)

## Mission Objectives

Your mission, should you choose to accept it, involves the following objectives:
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
depends_on:
- redis
environment:
- HDII__GENERIC__USER_AGENT=${HDII__GENERIC__USER_AGENT-docker}-api
- HDII__API__BIND_ADDRESS=0.0.0.0:3000
- HDII__API__REDIS_DB=${HDII__API__REDIS_DB-0}
- HDII__API__REDIS_HOST=${HDII__API__REDIS_HOST-redis}
Expand All @@ -31,6 +32,7 @@ services:
depends_on:
- api
environment:
- HDII__GENERIC__USER_AGENT=${HDII__GENERIC__USER_AGENT-docker}-bot
- HDII__API__REDIS_DB=${HDII__API__REDIS_DB-0}
- HDII__API__REDIS_HOST=${HDII__API__REDIS_HOST-redis}
- HDII__API__REDIS_PORT=${HDII__API__REDIS_PORT-6379}
Expand All @@ -50,6 +52,7 @@ services:
- api
- redis
environment:
- HDII__GENERIC__USER_AGENT=${HDII__GENERIC__USER_AGENT-docker}-updater
- HDII__API__REDIS_DB=${HDII__API__REDIS_DB-0}
- HDII__API__REDIS_HOST=${HDII__API__REDIS_HOST-redis}
- HDII__API__REDIS_PORT=${HDII__API__REDIS_PORT-6379}
Expand Down
7 changes: 7 additions & 0 deletions pkg/shared/helldivers/lib/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package lib

import (
"bytes"
"fmt"
"io"
"net/http"
"net/http/cookiejar"
"net/url"
"os"
)

type Response struct {
Expand Down Expand Up @@ -47,6 +49,11 @@ func (c *Client) generateRequest(method string, endpoint string, data []byte) (*
return nil, err
}
req.Header.Set("Accept-Language", "en-US")
userAgent := "Helldivers II Tools"
if os.Getenv("HDII__GENERIC__USER_AGENT") != "" {
userAgent = fmt.Sprintf("%s - %s", userAgent, os.Getenv("HDII__GENERIC__USER_AGENT"))
}
req.Header.Set("User-Agent", userAgent)

return req, err
}
Expand Down
3 changes: 3 additions & 0 deletions sample.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Generic elements
HDII__GENERIC__USER_AGENT=

# Discord bot token
HDII__BOT__TOKEN=token

Expand Down

0 comments on commit 838dcf7

Please sign in to comment.