Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
148
Issues
148
List
Board
Labels
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
92e50de6
Commit
92e50de6
authored
Jul 30, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[INI] clean + fix + add todos
parent
e6229776
Pipeline
#1003
failed with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
8 deletions
+19
-8
gargantext.ini_toModify
gargantext.ini_toModify
+14
-1
Settings.hs
src/Gargantext/API/Admin/Settings.hs
+0
-2
Config.hs
src/Gargantext/Config.hs
+2
-3
Utils.hs
src/Gargantext/Prelude/Utils.hs
+3
-2
No files found.
gargantext.ini_toModify
View file @
92e50de6
...
...
@@ -5,9 +5,11 @@ MASTER_USER = gargantua
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = PASSWORD_TO_CHANGE
# Data path to local files
DATA_FILEPATH = FILEPATH_TO_CHANGE
# [external]
# FRAMES
FRAME_WRITE_URL = URL_TO_CHANGE
FRAME_CALC_URL = URL_TO_CHANGE
...
...
@@ -15,6 +17,17 @@ FRAME_CALC_URL = URL_TO_CHANGE
FRAME_SEARX_URL = URL_TO_CHANGE
FRAME_ISTEX_URL = URL_TO_CHANGE
[server]
# Server config (TODO connect in ReaderMonad)
ALLOWED_ORIGIN = http://localhost
ALLOWED_ORIGIN_PORT = 8008
ALLOWED_HOST = localhost
ALLOWED_HOST_PORT = 3000
JWT_SETTINGS = TODO
[network]
# Emails From address (sent by smtp)
MAIL = username@gargantext.org
...
...
@@ -33,5 +46,5 @@ DB_PASS = PASSWORD_TO_CHANGE
[logs]
LOG_FILE = /var/log/gargantext/backend.log
LOG_LEVEL =
DEBUG
LOG_LEVEL =
LevelDebug
LOG_FORMATTER = verbose
src/Gargantext/API/Admin/Settings.hs
View file @
92e50de6
...
...
@@ -75,7 +75,6 @@ data Settings = Settings
,
_cookieSettings
::
CookieSettings
,
_sendLoginEmails
::
SendEmailType
,
_scrapydUrl
::
BaseUrl
,
_fileFolder
::
FilePath
,
_config
::
GargConfig
}
...
...
@@ -97,7 +96,6 @@ devSettings jwkFile = do
-- , _dbServer = "localhost"
,
_sendLoginEmails
=
LogEmailToConsole
,
_scrapydUrl
=
fromMaybe
(
panic
"Invalid scrapy URL"
)
$
parseBaseUrl
"http://localhost:6800"
,
_fileFolder
=
"data"
,
_cookieSettings
=
defaultCookieSettings
{
cookieXsrfSetting
=
Just
xsrfCookieSetting
}
-- TODO-SECURITY tune
,
_jwtSettings
=
defaultJWTSettings
jwk
-- TODO-SECURITY tune
,
_config
=
defaultConfig
...
...
src/Gargantext/Config.hs
View file @
92e50de6
...
...
@@ -24,7 +24,7 @@ import Control.Lens (makeLenses)
data
GargConfig
=
GargConfig
{
_gc_masteruser
::
!
Text
,
_gc_secretkey
::
!
Text
,
_gc_datafilepath
::
!
Text
,
_gc_datafilepath
::
!
FilePath
,
_gc_frame_write_url
::
!
Text
,
_gc_frame_calc_url
::
!
Text
...
...
@@ -36,7 +36,6 @@ data GargConfig = GargConfig { _gc_masteruser :: !Text
makeLenses
''
G
argConfig
readConfig
::
FilePath
->
IO
GargConfig
readConfig
fp
=
do
ini
<-
readIniFile
fp
...
...
@@ -50,7 +49,7 @@ readConfig fp = do
pure
$
GargConfig
(
val
"MASTER_USER"
)
(
val
"SECRET_KEY"
)
(
val
"DATA_FILEPATH"
)
(
cs
$
val
"DATA_FILEPATH"
)
(
val
"FRAME_WRITE_URL"
)
(
val
"FRAME_CALC_URL"
)
(
val
"FRAME_SEARX_URL"
)
...
...
src/Gargantext/Prelude/Utils.hs
View file @
92e50de6
...
...
@@ -20,6 +20,7 @@ import Control.Monad.Reader (MonadReader)
import
Control.Monad.Reader
(
ask
)
import
Data.Text
(
Text
)
import
GHC.IO
(
FilePath
)
import
Gargantext.Config
import
Gargantext.API.Admin.Settings
import
Gargantext.Database.Admin.Types.Node
(
NodeId
,
NodeType
)
import
Gargantext.Prelude
...
...
@@ -65,7 +66,7 @@ class ReadFile a where
writeFile
::
(
MonadReader
env
m
,
MonadBase
IO
m
,
HasSettings
env
,
SaveFile
a
)
=>
a
->
m
FilePath
writeFile
a
=
do
dataPath
<-
view
(
settings
.
fileFolder
)
<$>
ask
dataPath
<-
view
(
settings
.
config
.
gc_datafilepath
)
<$>
ask
(
fp
,
fn
)
<-
liftBase
$
(
toPath
3
)
.
hash
.
show
<$>
newStdGen
let
foldPath
=
dataPath
<>
"/"
<>
fp
...
...
@@ -80,5 +81,5 @@ writeFile a = do
readFile
::
(
MonadReader
env
m
,
MonadBase
IO
m
,
HasSettings
env
,
ReadFile
a
)
=>
FilePath
->
m
a
readFile
fp
=
do
dataPath
<-
view
(
settings
.
fileFolder
)
<$>
ask
dataPath
<-
view
(
settings
.
config
.
gc_datafilepath
)
<$>
ask
liftBase
$
readFile'
$
dataPath
<>
"/"
<>
fp
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment