Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
TOKEN environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
foxyseta committed Dec 29, 2022
1 parent 497eec4 commit 62c06d5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
Project for the University of Bologna Data Structure and Algorithms course
(a.y. 2020-21).

# Setup

When running both containers (via `docker-compose`) or the backend container
only, please make sure you set the `TOKEN` environment variable first. It will
be used as a bearer token for [Twitter API
v2](https://developer.twitter.com/en/support/twitter-api/v2)

# Run

Production:
Expand Down
9 changes: 0 additions & 9 deletions birdazzone-api/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
# Birdazzone API

[![pipeline status](https://git.hjkl.gq/team13/birdazzone-api/badges/develop/pipeline.svg)](https://git.hjkl.gq/team13/birdazzone-api/-/commits/develop)
[![Coverage](https://qube.hjkl.gq/api/project_badges/measure?project=birdazzone_birdazzone_AYPTe6hijP-lRCpIv8e6&metric=coverage&token=388400b56bf9ab7f4be7dd679f35f5ba9e3f8940)](https://qube.hjkl.gq/dashboard?id=birdazzone_birdazzone_AYPTe6hijP-lRCpIv8e6)
[![Bugs](https://qube.hjkl.gq/api/project_badges/measure?project=birdazzone_birdazzone_AYPTe6hijP-lRCpIv8e6&metric=bugs&token=388400b56bf9ab7f4be7dd679f35f5ba9e3f8940)](https://qube.hjkl.gq/dashboard?id=birdazzone_birdazzone_AYPTe6hijP-lRCpIv8e6)
[![Code Smells](https://qube.hjkl.gq/api/project_badges/measure?project=birdazzone_birdazzone_AYPTe6hijP-lRCpIv8e6&metric=code_smells&token=388400b56bf9ab7f4be7dd679f35f5ba9e3f8940)](https://qube.hjkl.gq/dashboard?id=birdazzone_birdazzone_AYPTe6hijP-lRCpIv8e6)
[![Duplicated Lines (%)](https://qube.hjkl.gq/api/project_badges/measure?project=birdazzone_birdazzone_AYPTe6hijP-lRCpIv8e6&metric=duplicated_lines_density&token=388400b56bf9ab7f4be7dd679f35f5ba9e3f8940)](https://qube.hjkl.gq/dashboard?id=birdazzone_birdazzone_AYPTe6hijP-lRCpIv8e6)
[![Security Hotspots](https://qube.hjkl.gq/api/project_badges/measure?project=birdazzone_birdazzone_AYPTe6hijP-lRCpIv8e6&metric=security_hotspots&token=388400b56bf9ab7f4be7dd679f35f5ba9e3f8940)](https://qube.hjkl.gq/dashboard?id=birdazzone_birdazzone_AYPTe6hijP-lRCpIv8e6)
[![Technical Debt](https://qube.hjkl.gq/api/project_badges/measure?project=birdazzone_birdazzone_AYPTe6hijP-lRCpIv8e6&metric=sqale_index&token=388400b56bf9ab7f4be7dd679f35f5ba9e3f8940)](https://qube.hjkl.gq/dashboard?id=birdazzone_birdazzone_AYPTe6hijP-lRCpIv8e6)
[![Vulnerabilities](https://qube.hjkl.gq/api/project_badges/measure?project=birdazzone_birdazzone_AYPTe6hijP-lRCpIv8e6&metric=vulnerabilities&token=388400b56bf9ab7f4be7dd679f35f5ba9e3f8940)](https://qube.hjkl.gq/dashboard?id=birdazzone_birdazzone_AYPTe6hijP-lRCpIv8e6)

API implementation for the Software Engineering (90106) project for the academic
year 2022/23 at the University of Bologna.

Expand Down
12 changes: 11 additions & 1 deletion birdazzone-api/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/http"
"net/http/httptest"
"net/url"
"os"
"strconv"
"time"
"unicode"
Expand All @@ -15,7 +16,16 @@ import (
"github.com/swaggo/swag/example/celler/httputil"
)

const BearerToken = "AAAAAAAAAAAAAAAAAAAAANHikgEAAAAAt0NQtN01tfyiK%2BbDypCiMOeGTQo%3DMyouTiX5Ewc2jwx5QdKjGrs64wNOJfvr2QeujrXt4lgO6uwtPo"
func getToken() string {
token, ok := os.LookupEnv("TOKEN")
if !ok {
fmt.Fprintf(os.Stderr, "Error: TOKEN environment variable not found.\n")
os.Exit(1)
}
return token
}

var BearerToken = getToken()

var testingResponseRecorder = httptest.NewRecorder()
var testingGinContext *gin.Context = nil
Expand Down
9 changes: 0 additions & 9 deletions birdazzone-web/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
# Birdazzone Web

[![pipeline status](https://git.hjkl.gq/team13/birdazzone-web/badges/develop/pipeline.svg)](https://git.hjkl.gq/team13/birdazzone-web/-/commits/develop)
[![Coverage](https://qube.hjkl.gq/api/project_badges/measure?project=team13_birdazzone-web_AYQALoO4jBpRQxnnBUzo&metric=coverage&token=0167b40480734327ca6f74c86ed9f510e3dbbdd0)](https://qube.hjkl.gq/dashboard?id=team13_birdazzone-web_AYQALoO4jBpRQxnnBUzo)
[![Bugs](https://qube.hjkl.gq/api/project_badges/measure?project=team13_birdazzone-web_AYQALoO4jBpRQxnnBUzo&metric=bugs&token=0167b40480734327ca6f74c86ed9f510e3dbbdd0)](https://qube.hjkl.gq/dashboard?id=team13_birdazzone-web_AYQALoO4jBpRQxnnBUzo)
[![Code Smells](https://qube.hjkl.gq/api/project_badges/measure?project=team13_birdazzone-web_AYQALoO4jBpRQxnnBUzo&metric=code_smells&token=0167b40480734327ca6f74c86ed9f510e3dbbdd0)](https://qube.hjkl.gq/dashboard?id=team13_birdazzone-web_AYQALoO4jBpRQxnnBUzo)
[![Duplicated Lines (%)](https://qube.hjkl.gq/api/project_badges/measure?project=team13_birdazzone-web_AYQALoO4jBpRQxnnBUzo&metric=duplicated_lines_density&token=0167b40480734327ca6f74c86ed9f510e3dbbdd0)](https://qube.hjkl.gq/dashboard?id=team13_birdazzone-web_AYQALoO4jBpRQxnnBUzo)
[![Security Hotspots](https://qube.hjkl.gq/api/project_badges/measure?project=team13_birdazzone-web_AYQALoO4jBpRQxnnBUzo&metric=security_hotspots&token=0167b40480734327ca6f74c86ed9f510e3dbbdd0)](https://qube.hjkl.gq/dashboard?id=team13_birdazzone-web_AYQALoO4jBpRQxnnBUzo)
[![Technical Debt](https://qube.hjkl.gq/api/project_badges/measure?project=team13_birdazzone-web_AYQALoO4jBpRQxnnBUzo&metric=sqale_index&token=0167b40480734327ca6f74c86ed9f510e3dbbdd0)](https://qube.hjkl.gq/dashboard?id=team13_birdazzone-web_AYQALoO4jBpRQxnnBUzo)
[![Vulnerabilities](https://qube.hjkl.gq/api/project_badges/measure?project=team13_birdazzone-web_AYQALoO4jBpRQxnnBUzo&metric=vulnerabilities&token=0167b40480734327ca6f74c86ed9f510e3dbbdd0)](https://qube.hjkl.gq/dashboard?id=team13_birdazzone-web_AYQALoO4jBpRQxnnBUzo)

Web interface for the Software Engineering (90106) project for the academic year
2022/23 at the University of Bologna.

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ services:
backend:
environment:
- PORT=8080
- TOKEN=$TOKEN
ports:
- 8080:8080
restart: always
Expand Down

0 comments on commit 62c06d5

Please sign in to comment.