-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
222 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,23 @@ | ||
// Package main provides the entry point for the GitHub application | ||
package main | ||
|
||
import ( | ||
"strconv" | ||
|
||
"github.com/ragurney/term-check/internal/bot" | ||
"github.com/ragurney/term-check/pkg/config" | ||
|
||
"flag" | ||
"github.com/rs/zerolog" | ||
"github.com/rs/zerolog/log" | ||
|
||
"github.com/ragurney/term-check/internal/bot" | ||
"github.com/ragurney/term-check/internal/config" | ||
) | ||
|
||
var filepath = flag.String("config", "config.yaml", "Location of the configuration file.") | ||
|
||
func main() { | ||
zerolog.TimeFieldFormat = "" | ||
flag.Parse() | ||
|
||
c := config.New() | ||
|
||
id, err := strconv.Atoi(c.Env("APP_ID", "")) | ||
if err != nil { | ||
log.Panic().Err(err) | ||
} | ||
|
||
pk := c.Env("PRIVATE_KEY_PATH", "") | ||
|
||
secrets, err := config.Secrets() | ||
|
||
if err != nil { | ||
log.Panic().Err(err) | ||
} | ||
|
||
ws, ok := secrets["WEBHOOK_SECRET_KEY"] | ||
|
||
if ok != true { | ||
log.Panic().Msg("Could not read PRIVATE_KEY_PATH from secrets.") | ||
} | ||
c := config.New(*filepath) | ||
|
||
log.Info().Msg("Starting service...") | ||
|
||
bot.New( | ||
bot.WithAppID(id), | ||
bot.WithPrivateKeyPath(pk), | ||
bot.WithWebhookSecretKey(ws), | ||
).Start() | ||
bot.New(c.ForBot, c.ForClient, c.ForServer).Start() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
shared: | ||
appID: &appID 18238 | ||
botConfig: | ||
appID: *appID | ||
termList: | ||
- master | ||
- slave | ||
- whitelist | ||
- blacklist | ||
checkName: Term Check | ||
checkSuccessSummary: ✅ No flagged terms found. | ||
checkFailureSummary: ⚠️ Flagged terms found. | ||
checkDetails: Placeholder text | ||
annotationTitle: Term Notice | ||
annotationBody: > | ||
Please consider changing the following terms on this line: %s | ||
clientConfig: | ||
appID: *appID | ||
privateKeyPath: /secrets/PRIVATE_KEY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.