New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default docker config #690
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE DeriveAnyClass #-} | ||
{-# LANGUAGE DeriveGeneric #-} | ||
{-# LANGUAGE FlexibleContexts #-} | ||
{-# LANGUAGE FlexibleInstances #-} | ||
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | ||
{-# LANGUAGE MultiParamTypeClasses #-} | ||
{-# LANGUAGE OverloadedStrings #-} | ||
{-# LANGUAGE RankNTypes #-} | ||
{-# LANGUAGE RecordWildCards #-} | ||
{-# LANGUAGE ScopedTypeVariables #-} | ||
{-# LANGUAGE TemplateHaskell #-} | ||
{-# LANGUAGE TypeApplications #-} | ||
{-# LANGUAGE TypeOperators #-} | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE FlexibleContexts #-} | ||
{-# LANGUAGE FlexibleInstances #-} | ||
{-# LANGUAGE MultiParamTypeClasses #-} | ||
{-# LANGUAGE OverloadedStrings #-} | ||
{-# LANGUAGE RankNTypes #-} | ||
{-# LANGUAGE RecordWildCards #-} | ||
{-# LANGUAGE ScopedTypeVariables #-} | ||
{-# LANGUAGE TypeApplications #-} | ||
{-# LANGUAGE TypeOperators #-} | ||
{-# OPTIONS_GHC -Wno-orphans #-} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This right here is why I'm not a fan of stylish Haskell. Can't change it, but it's an apt time to (re)moan. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agreed |
||
|
||
module Webserver | ||
|
@@ -29,7 +25,8 @@ import Control.Monad.Reader (ReaderT, runRea | |
import Data.Default.Class (def) | ||
import Data.Proxy (Proxy (Proxy)) | ||
import Data.Text (Text) | ||
import Development.GitRev (gitHash) | ||
import qualified Data.Text as Text | ||
import Git (gitHead) | ||
import Network.HTTP.Types (Method) | ||
import Network.Wai (Application) | ||
import Network.Wai.Handler.Warp (Settings, runSettings) | ||
|
@@ -73,7 +70,7 @@ server handlers _staticDir githubEndpoints Config {..} = | |
serveDirectoryFileServer _staticDir | ||
|
||
version :: Applicative m => m Text | ||
version = pure $(gitHash) | ||
version = pure (Text.pack gitHead) | ||
|
||
app :: | ||
Server MA.API -> FilePath -> Auth.GithubEndpoints -> Config -> Application | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module Git where | ||
|
||
gitHead :: String | ||
gitHead = "master" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yerwhat? :-D There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a monster |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ pkgs, declInput }: | ||
|
||
with pkgs.lib; | ||
|
||
let | ||
headPath = ../../.git/HEAD; | ||
readRev = let head = if builtins.pathExists headPath then builtins.readFile headPath else "master"; | ||
in | ||
if hasPrefix "ref: " head | ||
then builtins.readFile (../../.git + ''/${removeSuffix "\n" (removePrefix "ref: " head)}'') | ||
else head; | ||
git-rev = removeSuffix "\n" (if isNull declInput then readRev else declInput.rev); | ||
gitModulePatch = pkgs.writeText "gitModulePatch" '' | ||
diff --git a/src/Git.hs b/src/Git.hs | ||
index b0398a7..45a9066 100644 | ||
--- a/src/Git.hs | ||
+++ b/src/Git.hs | ||
@@ -1,4 +1,4 @@ | ||
module Git where | ||
|
||
gitHead :: String | ||
-gitHead = "master" | ||
+gitHead = "${git-rev}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I see. You're a monster. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. its true |
||
''; | ||
in | ||
self: super: { | ||
plutus-playground-server = super.plutus-playground-server.overrideDerivation (oldAttrs: { | ||
patches = [gitModulePatch]; | ||
}); | ||
meadow = super.meadow.overrideDerivation (oldAttrs: { | ||
patches = [gitModulePatch]; | ||
}); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
auth: | ||
# Your github OAuth App Credentials. | ||
github-client-id: | ||
github-client-secret: | ||
github-client-id: "" | ||
github-client-secret: "" | ||
|
||
# You can generate a good signature by running `openssl rand -hex 40` and pasting the result here: | ||
jwt-signature: | ||
jwt-signature: "" | ||
|
||
# This should match the client-facing schema/host/port. | ||
redirect-url: https://localhost:8009 | ||
redirect-url: "https://localhost:8080" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These links are incorrect, I wanted them left to signify that they should be fixed. I will open an issue for this.