2022-09-17 21:21:58 +00:00
|
|
|
//go:build !js
|
|
|
|
|
2021-03-09 08:05:07 +00:00
|
|
|
package config
|
|
|
|
|
2021-07-05 18:34:51 +00:00
|
|
|
import (
|
2023-01-29 06:53:24 +00:00
|
|
|
"github.com/jackc/pgx/v5/tracelog"
|
2021-07-05 18:34:51 +00:00
|
|
|
"github.com/rs/zerolog"
|
|
|
|
)
|
|
|
|
|
2021-03-09 08:05:07 +00:00
|
|
|
var Config = HMNConfig{
|
2021-07-05 18:34:51 +00:00
|
|
|
Env: Dev,
|
2022-05-07 13:11:05 +00:00
|
|
|
Addr: "localhost:9001",
|
|
|
|
PrivateAddr: "localhost:9002",
|
2021-07-05 18:34:51 +00:00
|
|
|
BaseUrl: "http://handmade.local:9001",
|
2021-08-29 23:11:41 +00:00
|
|
|
LogLevel: zerolog.TraceLevel, // InfoLevel is recommended for production
|
2021-03-09 08:05:07 +00:00
|
|
|
Postgres: PostgresConfig{
|
2023-01-17 02:19:36 +00:00
|
|
|
// the "db seed" command depends on this user existing in Postgres, so you'll want to make sure it exists when running locally.
|
2021-03-09 08:05:07 +00:00
|
|
|
User: "hmn",
|
|
|
|
Password: "password",
|
2022-05-12 00:20:22 +00:00
|
|
|
Hostname: "localhost",
|
2021-08-28 21:33:15 +00:00
|
|
|
Port: 5432,
|
2021-03-09 08:05:07 +00:00
|
|
|
DbName: "hmn",
|
2023-01-29 06:53:24 +00:00
|
|
|
LogLevel: tracelog.LogLevelError, // LogLevelWarn is recommended for production
|
2021-04-06 06:10:15 +00:00
|
|
|
MinConn: 2, // Keep these low for dev, high for production
|
2021-08-29 23:11:41 +00:00
|
|
|
MaxConn: 10,
|
2021-03-09 08:05:07 +00:00
|
|
|
},
|
2021-05-04 13:23:02 +00:00
|
|
|
Auth: AuthConfig{
|
|
|
|
CookieDomain: ".handmade.local",
|
|
|
|
CookieSecure: false,
|
|
|
|
},
|
2021-09-24 00:12:46 +00:00
|
|
|
Admin: AdminConfig {
|
|
|
|
AtomUsername: "admin",
|
|
|
|
AtomPassword: "password",
|
|
|
|
},
|
2021-08-08 20:05:52 +00:00
|
|
|
Email: EmailConfig{
|
2022-05-25 22:39:57 +00:00
|
|
|
ServerAddress: "smtp.example.com",
|
|
|
|
ServerPort: 587,
|
|
|
|
FromAddress: "noreply@example.com",
|
|
|
|
FromName: "Handmade Network Team",
|
2022-09-18 19:23:36 +00:00
|
|
|
MailerUsername: "actualuser@example.com",
|
|
|
|
MailerPassword: "",
|
2022-05-25 22:39:57 +00:00
|
|
|
|
|
|
|
ForceToAddress: "localdev@example.com", // NOTE(asaf): If this is not empty, all emails will be sent to this address.
|
2021-08-08 20:05:52 +00:00
|
|
|
},
|
2021-06-22 09:50:40 +00:00
|
|
|
DigitalOcean: DigitalOceanConfig{
|
2022-05-14 05:33:00 +00:00
|
|
|
AssetsSpacesKey: "dummy",
|
|
|
|
AssetsSpacesSecret: "dummy",
|
|
|
|
AssetsSpacesRegion: "dummy",
|
|
|
|
AssetsSpacesEndpoint: "http://handmade.local:9003/",
|
|
|
|
AssetsSpacesBucket: "assets",
|
|
|
|
AssetsPublicUrlRoot: "http://handmade.local:9003/assets/",
|
|
|
|
// In prod, AssetsPublicUrlRoot will probably look something like:
|
|
|
|
//
|
|
|
|
// "https://bucket-name.region.cdn.digitaloceanspaces.com/"
|
|
|
|
//
|
|
|
|
// Note the trailing slash...
|
|
|
|
|
|
|
|
RunFakeServer: true,
|
|
|
|
FakeAddr: "localhost:9003",
|
2021-06-22 09:50:40 +00:00
|
|
|
},
|
2021-09-08 00:55:52 +00:00
|
|
|
Discord: DiscordConfig{
|
|
|
|
BotToken: "",
|
|
|
|
BotUserID: "",
|
|
|
|
|
|
|
|
OAuthClientID: "",
|
|
|
|
OAuthClientSecret: "",
|
|
|
|
|
|
|
|
GuildID: "",
|
|
|
|
MemberRoleID: "",
|
|
|
|
ShowcaseChannelID: "",
|
|
|
|
LibraryChannelID: "",
|
2022-03-22 18:07:43 +00:00
|
|
|
StreamsChannelID: "",
|
|
|
|
},
|
|
|
|
Twitch: TwitchConfig{
|
|
|
|
ClientID: "",
|
|
|
|
ClientSecret: "",
|
|
|
|
EventSubSecret: "",
|
|
|
|
BaseUrl: "https://api.twitch.tv/helix",
|
|
|
|
BaseIDUrl: "https://id.twitch.tv/oauth2",
|
2021-09-08 00:55:52 +00:00
|
|
|
},
|
2021-08-28 10:40:13 +00:00
|
|
|
EpisodeGuide: EpisodeGuide{
|
|
|
|
CineraOutputPath: "./annotations/",
|
|
|
|
Projects: map[string]string{"hero": "code", "riscy": "riscy", "bitwise": "bitwise"},
|
|
|
|
},
|
2021-03-09 08:05:07 +00:00
|
|
|
}
|