Add .env file

This commit is contained in:
Kevin Kandlbinder 2023-03-07 15:24:34 +01:00
parent 37b27ec3e0
commit a5a030eba9
Signed by: kevin
GPG key ID: 1460B586646E180D
4 changed files with 16 additions and 4 deletions

6
.env.dist Normal file
View file

@ -0,0 +1,6 @@
CALAPI_DEVELOPMENT=0
CALAPI_DATA_DIRECTORY=./data
CALAPI_AUTH__TYPE=GHOST
CALAPI_AUTH__SECRET=CH4NG3_M3
CALAPI_AUTH__ANONYMOUS_READ=1
CALAPI_AUTH__GHOST__BASE_URL=https://demo.ghost.io/ghost

6
.gitignore vendored
View file

@ -2,4 +2,8 @@
/calapi.exe /calapi.exe
/data /data
/download /download
.env
.env.*
!.env.dist

4
.idea/calapi.iml generated
View file

@ -2,7 +2,9 @@
<module type="WEB_MODULE" version="4"> <module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" /> <component name="Go" enabled="true" />
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" /> <content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/data" />
</content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>

View file

@ -34,8 +34,8 @@ func init() {
viper.SetDefault("auth.type", "GHOST") viper.SetDefault("auth.type", "GHOST")
viper.SetDefault("auth.secret", "hunter2") viper.SetDefault("auth.secret", "hunter2")
viper.SetDefault("auth.anonymous_read", true) viper.SetDefault("auth.anonymous_read", true)
viper.SetDefault("auth.ghost.base_url", "https://content.hhga.1in9.net/ghost") viper.SetDefault("auth.ghost.base_url", "https://demo.ghost.io/ghost")
viper.SetDefault("auth.ghost.limit_to_roles", nil) //viper.SetDefault("auth.ghost.limit_to_roles", nil)
viper.AutomaticEnv() viper.AutomaticEnv()