Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #29 from jmgooden94/feat/privacy-and-support
Browse files Browse the repository at this point in the history
Feat/privacy and support
  • Loading branch information
nicjohnson145 authored Feb 11, 2023
2 parents d56c9a1 + 5f9581d commit beb8bb1
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/mixer-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ package main

import (
"flag"

"github.com/nicjohnson145/mixer-service/pkg/auth"
"github.com/nicjohnson145/mixer-service/pkg/common"
"github.com/nicjohnson145/mixer-service/pkg/db"
"github.com/nicjohnson145/mixer-service/pkg/drink"
"github.com/nicjohnson145/mixer-service/pkg/health"
"github.com/nicjohnson145/mixer-service/pkg/settings"
"github.com/nicjohnson145/mixer-service/pkg/slow"
"github.com/nicjohnson145/mixer-service/pkg/static"
"github.com/nicjohnson145/mixer-service/pkg/user"
log "github.com/sirupsen/logrus"
)
Expand Down Expand Up @@ -52,6 +54,10 @@ func main() {
log.Fatal(err)
}

if err := static.Init(app); err != nil {
log.Fatal(err)
}

port := common.DefaultedEnvVar("PORT", "30000")

log.Info("Listening on port ", port)
Expand Down
26 changes: 26 additions & 0 deletions pkg/static/base.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package static

import (
"embed"
_ "embed"
"net/http"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/filesystem"
)

//go:embed public
var publicWebUiContent embed.FS

func Init(app *fiber.App) error {
addStaticRoutes(app)
return nil
}

func addStaticRoutes(app *fiber.App) {
app.Use("/static/", filesystem.New(filesystem.Config{
Root: http.FS(publicWebUiContent),
PathPrefix: "public/webui",
Browse: true,
}))
}
15 changes: 15 additions & 0 deletions pkg/static/public/webui/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>MixerDrinks Static Web Content Landing Page</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
</head>
<body>
<p><a href="privacy">Privacy Policy</a></p>
<p><a href="support">Support</a></p>
</body>
</html>
15 changes: 15 additions & 0 deletions pkg/static/public/webui/privacy/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>MixerDrinks Privacy Policy</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
</head>
<body>
<p>All data you create is stored on the developers' personal servers. We won't sell it or do anything shitty with it. All drink
recipes you submit are shared with other users unless you disable "public profile" in your settings.</p>
</body>
</html>
15 changes: 15 additions & 0 deletions pkg/static/public/webui/support/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>MixerDrinks Support Page</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
</head>
<body>
<p>This app is currently only available by invitations directly from the developers. If you have the app, you
must personally know one of the developers, and you can contact them yourself.</p>
</body>
</html>

0 comments on commit beb8bb1

Please sign in to comment.