Skip to content
This repository was archived by the owner on Nov 24, 2019. It is now read-only.

Commit 46dd9b4

Browse files
format, optimize, add config template
1 parent adab10f commit 46dd9b4

12 files changed

Lines changed: 381 additions & 285 deletions

File tree

config/lambda-settings.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
root-password: <your root password>
2+
bpf-path: /usr/bin/bpftrace
3+
stap-path: /usr/bin/stap
4+
submit-chunk-size: 51200
5+
platform-url: <your platform url>
6+
secret: abc123456 # please change it
7+
endpoint-uuid: 4633d686-f75d-4d1f-8415-02ce37d9e5f8 # please change it

config/routes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@
1111
/trace/remove RemoveTraceR POST
1212
/trace/running RunningTraceR GET
1313
/traces/running/all RunningTracesR GET
14-
/trace/kill KillRunningTraceR POST
14+
/trace/kill KillRunningTraceR POST
15+

config/settings.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Values formatted like "_env:YESOD_ENV_VAR_NAME:default_value" can be overridden by the specified environment variable.
2+
# See https://github.com/yesodweb/yesod/wiki/Configuration#overriding-configuration-values-with-environment-variables
3+
4+
static-dir: "_env:YESOD_STATIC_DIR:static"
5+
host: "_env:YESOD_HOST:*4" # any IPv4 host
6+
port: "_env:YESOD_PORT:3000" # NB: The port `yesod devel` uses is distinct from this value. Set the `yesod devel` port from the command line.
7+
ip-from-header: "_env:YESOD_IP_FROM_HEADER:false"
8+
9+
# Default behavior: determine the application root from the request headers.
10+
# Uncomment to set an explicit approot
11+
#approot: "_env:YESOD_APPROOT:http://localhost:3000"
12+
13+
# By default, `yesod devel` runs in development, and built executables use
14+
# production settings (see below). To override this, use the following:
15+
#
16+
# development: false
17+
18+
# Optional values with the following production defaults.
19+
# In development, they default to the inverse.
20+
#
21+
# detailed-logging: false
22+
# should-log-all: false
23+
# reload-templates: false
24+
# mutable-static: false
25+
# skip-combining: false
26+
# auth-dummy-login : false
27+
28+
# NB: If you need a numeric value (e.g. 123) to parse as a String, wrap it in single quotes (e.g. "_env:YESOD_PGPASS:'123'")
29+
# See https://github.com/yesodweb/yesod/wiki/Configuration#parsing-numeric-values-as-strings
30+
31+
database:
32+
user: "_env:YESOD_PGUSER:lambda"
33+
password: "_env:YESOD_PGPASS:lambda"
34+
host: "_env:YESOD_PGHOST:127.0.0.1"
35+
port: "_env:YESOD_PGPORT:5432"
36+
# See config/test-settings.yml for an override during tests
37+
database: "_env:YESOD_PGDATABASE:lambda"
38+
poolsize: "_env:YESOD_PGPOOLSIZE:10"
39+
40+
copyright: Insert copyright statement here
41+
#analytics: UA-YOURCODE

src/Foundation.hs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import Text.Jasmine (minifym)
1717

1818
-- Used only when in "auth-dummy-login" setting is enabled.
1919
-- import Yesod.Auth.Dummy
20-
2120
-- import qualified Data.CaseInsensitive as CI
2221
-- import qualified Data.Text.Encoding as TE
2322
-- import Yesod.Auth.OpenId (IdentifierType (Claimed), authOpenId)
@@ -107,7 +106,7 @@ instance Yesod App
107106
_mcurrentRoute <- getCurrentRoute
108107
-- Get the breadcrumbs, as defined in the YesodBreadcrumbs instance.
109108
-- Define the menu items of the header.
110-
let _menuItems = [ ]
109+
let _menuItems = []
111110
let _navbarLeftMenuItems = [x | NavbarLeft x <- _menuItems]
112111
let _navbarRightMenuItems = [x | NavbarRight x <- _menuItems]
113112
let _navbarLeftFilteredMenuItems =
@@ -125,7 +124,6 @@ instance Yesod App
125124
$(widgetFile "default-layout")
126125
withUrlRenderer $(hamletFile "templates/default-layout-wrapper.hamlet")
127126
-- The page to be redirected to when authentication is required.
128-
129127
addStaticContent ::
130128
Text -- ^ The file extension
131129
-> Text -- ^ The MIME content type
@@ -167,9 +165,6 @@ instance YesodPersistRunner App where
167165
getDBRunner :: Handler (DBRunner App, Handler ())
168166
getDBRunner = defaultGetDBRunner appConnPool
169167

170-
171-
172-
173168
-- This instance is required to use forms. You can modify renderMessage to
174169
-- achieve customized and internationalized form validation messages.
175170
instance RenderMessage App FormMessage where

0 commit comments

Comments
 (0)