Skip to content

Commit

Permalink
v 0.5.6, add secret to fly.ip
Browse files Browse the repository at this point in the history
  • Loading branch information
gernotstarke committed Feb 2, 2024
1 parent ba7cf8c commit d561329
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 60 deletions.
57 changes: 2 additions & 55 deletions docs/_pages/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,61 +55,8 @@ doc-faq-quality:
<!-- the following div will be swapped with the HTML generated by the backend API -->

<div id="statsTable">
<table id="sortableStatsTable" class="display">
<thead>
<tr>
<th rowspan="2"><img src="./images/minion-logo-100px.png"></th>
<th colspan="2" style="border-left: 2px solid black;">7 Days</th>
<th colspan="2" style="border-left: 2px solid black;">30 Days</th>
<th colspan="2" style="border-left: 2px solid black;">12 Month</th>
<th rowspan="2" style="border-left: 2px solid black;">Issues</th>
</tr>
<tr>
<th style="border-left: 2px solid black;">Visitors</th>
<th>PageViews</th>
<th style="border-left: 2px solid black;">Visitors</th>
<th>PageViews</th>
<th style="border-left: 2px solid black;">Visitors</th>
<th>PageViews</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td class="cell-style"></td>
<td></td>
<td class="cell-style"></td></td>
<td></td>
<td class="cell-style"></td>
<td></td>
<td class="cell-style"></td>
</tr>
<tr>
<td></td>
<td class="cell-style"></td>
<td></td>
<td class="cell-style"></td>
<td></td>
<td class="cell-style"></td>
<td></td>
<td class="cell-style"></td>
</tr>
</tbody>
<tfoot>
<tr>
<td>arc42.org</td>
<td class="cell-style"></td>
<td></td>
<td class="cell-style"></td>
<td></td>
<td class="cell-style"></td>
<td></td>
<td class="cell-style"></td>
</tr>
</tfoot>
</table>

Data is being collected by arc42 statistics service running on <a href="https://fly.io" target="_blank"><img src="/images/fly-logo-landscape.svg" width="60px"></a>

Data is being collected by arc42 statistics service running on fly.io.

</div>

Expand Down
2 changes: 1 addition & 1 deletion go-app/internal/api/apiGateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func statsHTMLTableHandler(w http.ResponseWriter, r *http.Request) {
database.SaveInvocationParams(r.Host, r.RequestURI)

// 4b: inform owner via Slack
msg := fmt.Sprintf("Loaded arc42 statistics in %sms on %s", domain.ArcStats.HowLongDidItTake, time.Now)
msg := fmt.Sprintf("Loaded arc42 statistics in %sms on %s", domain.ArcStats.HowLongDidItTake, time.Now().Format("02 Jan 15:04"))
slack.SendSlackMessage(msg)

// 5. finally, render the template
Expand Down
4 changes: 2 additions & 2 deletions go-app/internal/slack/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func getSlackAuthToken() string {
// we exit here, as we have no chance of recovery
log.Error().Msgf("CRITICAL ERROR: required Slack Auth token not set.\n" +
"You need to set the 'SLACK_AUTH_TOKEN' environment variable prior to launching this application.\n")
os.Exit(14)
//os.Exit(14)
}
return slackAuthToken
}
Expand Down Expand Up @@ -70,7 +70,7 @@ func getSlackAPI() *slack.Client {
{
// this should never happen, as env.GetEnv() needs to care for valid environments
log.Error().Msgf("Invalid environment %s specified for slack messages", env.GetEnv())
os.Exit(14)
// os.Exit(14)
}
}

Expand Down
9 changes: 7 additions & 2 deletions go-app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"arc42-status/internal/database"
"arc42-status/internal/domain"
"arc42-status/internal/env"
"arc42-status/internal/slack"
"fmt"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"os"
Expand Down Expand Up @@ -85,11 +87,14 @@ func main() {
// Save the startup metadata persistently, see ADR-0012
database.SaveStartupTime(time.Now(), appVersion, env.GetEnv())

// tell Slack that an instance has been started
msg := fmt.Sprintf("Started arc42 statistics server on %s",
time.Now().Format("02 Jan 15:04"))
slack.SendSlackMessage(msg)

// log the server details
api.LogServerDetails(appVersion)

// load statistics and add results to cache

// Start a server which runs in the background, and waits for http requests
// to arrive at predefined routes.
// THIS IS A BLOCKING CALL, therefore server details are printed prior to starting the server
Expand Down

0 comments on commit d561329

Please sign in to comment.