Compare commits
10 commits
e6a42fb953
...
ff065c7119
Author | SHA1 | Date | |
---|---|---|---|
ff065c7119 | |||
c447e89571 | |||
669e688575 | |||
21d37b3a4d | |||
80e0d97d7c | |||
f5325c8a55 | |||
2229bd9183 | |||
a4cdc10c4f | |||
d45565b47a | |||
89600a729a |
9 changed files with 70 additions and 14 deletions
|
@ -11,6 +11,9 @@ matrix:
|
|||
- GOOS: linux
|
||||
GOARCH: arm64
|
||||
|
||||
depends_on:
|
||||
- lint
|
||||
|
||||
steps:
|
||||
build:
|
||||
secrets:
|
||||
|
|
25
CHANGELOG.md
25
CHANGELOG.md
|
@ -6,16 +6,32 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
### Added
|
||||
- Added `list` alias to `queue show`
|
||||
- Added `delete` alias to `queue remove`
|
||||
|
||||
### Changed
|
||||
- Changed table output style
|
||||
|
||||
## [v0.2.1] - 2023-06-11
|
||||
### Changed
|
||||
- when starting the app in daemon mode, the app will now wait one complete interval until it posts the next post
|
||||
instead of immediately posting one bundle
|
||||
|
||||
## [v0.2.0] - 2023-06-11
|
||||
### Added
|
||||
- cli option `queue show` to list currently queued bundles [#2](https://git.lauka.net/lauralani/humble-bot/issues/2)
|
||||
- cli option `queue fill` to query humblebundle.com for new bundles and then fill the queue [#2](https://git.lauka.net/lauralani/humble-bot/issues/2)
|
||||
- cli option `queue remove` to remove a queued up bundle [#2](https://git.lauka.net/lauralani/humble-bot/issues/2)
|
||||
- Added cli option `queue show` to list currently queued bundles
|
||||
[#2](https://git.lauka.net/lauralani/humble-bot/issues/2)
|
||||
- Added cli option `queue fill` to query humblebundle.com for new bundles and then fill the queue
|
||||
[#2](https://git.lauka.net/lauralani/humble-bot/issues/2)
|
||||
- Added cli option `queue remove` to remove a queued up bundle [#2](https://git.lauka.net/lauralani/humble-bot/issues/2)
|
||||
|
||||
### Fixed
|
||||
- [[BUG] Error parsing mastodon response field time](https://git.lauka.net/lauralani/humble-bot/issues/1)
|
||||
|
||||
### Removed
|
||||
- BREAKING: Removed action when executing `./humble-bot` without arguments, moved to `queue fill`
|
||||
|
||||
## [v0.1.2] - 2023-06-07
|
||||
### Added
|
||||
- logging for new mastodon post now also logs the post url
|
||||
|
@ -47,7 +63,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
|
||||
|
||||
[unreleased]: https://git.lauka.net/lauralani/humble-bot/compare/v0.2.0...HEAD
|
||||
[unreleased]: https://git.lauka.net/lauralani/humble-bot/compare/v0.2.1...HEAD
|
||||
[v0.2.1]: https://git.lauka.net/lauralani/humble-bot/compare/v0.2.0...v0.2.1
|
||||
[v0.2.0]: https://git.lauka.net/lauralani/humble-bot/compare/v0.1.2...v0.2.0
|
||||
[v0.1.2]: https://git.lauka.net/lauralani/humble-bot/compare/v0.1.1...v0.1.2
|
||||
[v0.1.1]: https://git.lauka.net/lauralani/humble-bot/compare/v0.1.0...v0.1.1
|
||||
|
|
30
Dockerfile
Normal file
30
Dockerfile
Normal file
|
@ -0,0 +1,30 @@
|
|||
FROM golang:1.23-bullseye AS dev
|
||||
|
||||
COPY . /var/app
|
||||
WORKDIR /var/app
|
||||
|
||||
|
||||
ENV GO111MODULE="on" \
|
||||
CGO_ENABLED=0 \
|
||||
GOOS=linux
|
||||
|
||||
EXPOSE 80
|
||||
ENTRYPOINT ["sh"]
|
||||
|
||||
|
||||
FROM dev AS build
|
||||
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes ca-certificates make git
|
||||
RUN go mod download && go mod verify
|
||||
RUN make build
|
||||
|
||||
|
||||
FROM gcr.io/distroless/static-debian12 AS prod
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=build /var/app/bin/humble-bot /bin/
|
||||
|
||||
LABEL maintainer="Adora Laura Kalb <adora@lila.network>"
|
||||
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["/bin/humble-bot"]
|
|
@ -1,15 +1,18 @@
|
|||
# Humble Bundle Fediverse Bot
|
||||
by https://chaos.social/@lauralani
|
||||
by https://social.lila.network/@lauralani
|
||||
|
||||
[![status-badge](https://ci.lauka.net/api/badges/4/status.svg)](https://ci.lauka.net/4)
|
||||
[![status-badge](https://ci.codeberg.org/api/badges/12433/status.svg)](https://ci.codeberg.org/repos/12433)
|
||||
[![Please don't upload to GitHub](https://nogithub.codeberg.page/badge.svg)](https://nogithub.codeberg.page)
|
||||
|
||||
## About
|
||||
This bot posts new Humble Bundles on the Fediverse so you can follow the bot and get the newest Bundles.
|
||||
The Bot can be found at: TBD
|
||||
The Bot can be found at https://botsin.space/@humblebundles
|
||||
|
||||
Also see https://botwiki.org/bot/humble-bundle-bot/
|
||||
|
||||
## Changelog
|
||||
You can find the changelog here: [CHANGELOG](CHANGELOG.md)
|
||||
|
||||
## License
|
||||
This Humble Bundle bot is available under the MIT license. See the [LICENSE](LICENSE) file for more info.
|
||||
The Humble Bundle Bot is in no way affiliated with Humble Bundle Inc.
|
|
@ -25,6 +25,7 @@ func RunQueueShow(cmd *cobra.Command, args []string) {
|
|||
}
|
||||
|
||||
t := table.NewWriter()
|
||||
t.SetStyle(table.StyleRounded)
|
||||
t.SetOutputMirror(os.Stdout)
|
||||
t.AppendHeader(table.Row{"ID", "Short Name", "URL"})
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ func StartCronJobs() {
|
|||
return
|
||||
}
|
||||
|
||||
_, err = s.Every(viper.GetString("mastodon.postinterval")).Do(RunSingleQueueItem)
|
||||
_, err = s.Every(viper.GetString("mastodon.postinterval")).WaitForSchedule().Do(RunSingleQueueItem)
|
||||
if err != nil {
|
||||
log.Error().Str("func", "StartCronJobs").Str("job", "RunSingleQueueItem").
|
||||
Msgf("Scheduler Error: %q", err)
|
||||
|
|
|
@ -17,6 +17,7 @@ var queueremoveCmd = &cobra.Command{
|
|||
Run: app.RunQueueRemove,
|
||||
Args: cobra.ExactArgs(1),
|
||||
Example: "humble-bot queue remove 25",
|
||||
Aliases: []string{"delete"},
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -12,10 +12,11 @@ import (
|
|||
|
||||
// queueshowCmd represents the queue command
|
||||
var queueshowCmd = &cobra.Command{
|
||||
Use: "show",
|
||||
Short: "Show items in queue",
|
||||
Run: app.RunQueueShow,
|
||||
Args: cobra.ExactArgs(0),
|
||||
Use: "show",
|
||||
Short: "Show items in queue",
|
||||
Run: app.RunQueueShow,
|
||||
Args: cobra.ExactArgs(0),
|
||||
Aliases: []string{"list"},
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
package constants
|
||||
|
||||
var AppVersion = "0.2.0"
|
||||
var AppVersion = "0.2.1"
|
||||
|
||||
var HumbleCategories = []string{"games", "books", "software"}
|
||||
|
||||
|
|
Loading…
Reference in a new issue