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
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
5dd90077
Commit
5dd90077
authored
Jul 31, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into dev-file-upload
parents
b8b639d5
92e50de6
Pipeline
#1004
canceled 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 @
5dd90077
...
@@ -5,9 +5,11 @@ MASTER_USER = gargantua
...
@@ -5,9 +5,11 @@ MASTER_USER = gargantua
# SECURITY WARNING: keep the secret key used in production secret!
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = PASSWORD_TO_CHANGE
SECRET_KEY = PASSWORD_TO_CHANGE
# Data path to local files
# Data path to local files
DATA_FILEPATH = FILEPATH_TO_CHANGE
DATA_FILEPATH = FILEPATH_TO_CHANGE
# [external]
# FRAMES
# FRAMES
FRAME_WRITE_URL = URL_TO_CHANGE
FRAME_WRITE_URL = URL_TO_CHANGE
FRAME_CALC_URL = URL_TO_CHANGE
FRAME_CALC_URL = URL_TO_CHANGE
...
@@ -15,6 +17,17 @@ FRAME_CALC_URL = URL_TO_CHANGE
...
@@ -15,6 +17,17 @@ FRAME_CALC_URL = URL_TO_CHANGE
FRAME_SEARX_URL = URL_TO_CHANGE
FRAME_SEARX_URL = URL_TO_CHANGE
FRAME_ISTEX_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]
[network]
# Emails From address (sent by smtp)
# Emails From address (sent by smtp)
MAIL = username@gargantext.org
MAIL = username@gargantext.org
...
@@ -33,5 +46,5 @@ DB_PASS = PASSWORD_TO_CHANGE
...
@@ -33,5 +46,5 @@ DB_PASS = PASSWORD_TO_CHANGE
[logs]
[logs]
LOG_FILE = /var/log/gargantext/backend.log
LOG_FILE = /var/log/gargantext/backend.log
LOG_LEVEL =
DEBUG
LOG_LEVEL =
LevelDebug
LOG_FORMATTER = verbose
LOG_FORMATTER = verbose
src/Gargantext/API/Admin/Settings.hs
View file @
5dd90077
...
@@ -75,7 +75,6 @@ data Settings = Settings
...
@@ -75,7 +75,6 @@ data Settings = Settings
,
_cookieSettings
::
CookieSettings
,
_cookieSettings
::
CookieSettings
,
_sendLoginEmails
::
SendEmailType
,
_sendLoginEmails
::
SendEmailType
,
_scrapydUrl
::
BaseUrl
,
_scrapydUrl
::
BaseUrl
,
_fileFolder
::
FilePath
,
_config
::
GargConfig
,
_config
::
GargConfig
}
}
...
@@ -97,7 +96,6 @@ devSettings jwkFile = do
...
@@ -97,7 +96,6 @@ devSettings jwkFile = do
-- , _dbServer = "localhost"
-- , _dbServer = "localhost"
,
_sendLoginEmails
=
LogEmailToConsole
,
_sendLoginEmails
=
LogEmailToConsole
,
_scrapydUrl
=
fromMaybe
(
panic
"Invalid scrapy URL"
)
$
parseBaseUrl
"http://localhost:6800"
,
_scrapydUrl
=
fromMaybe
(
panic
"Invalid scrapy URL"
)
$
parseBaseUrl
"http://localhost:6800"
,
_fileFolder
=
"data"
,
_cookieSettings
=
defaultCookieSettings
{
cookieXsrfSetting
=
Just
xsrfCookieSetting
}
-- TODO-SECURITY tune
,
_cookieSettings
=
defaultCookieSettings
{
cookieXsrfSetting
=
Just
xsrfCookieSetting
}
-- TODO-SECURITY tune
,
_jwtSettings
=
defaultJWTSettings
jwk
-- TODO-SECURITY tune
,
_jwtSettings
=
defaultJWTSettings
jwk
-- TODO-SECURITY tune
,
_config
=
defaultConfig
,
_config
=
defaultConfig
...
...
src/Gargantext/Config.hs
View file @
5dd90077
...
@@ -24,7 +24,7 @@ import Control.Lens (makeLenses)
...
@@ -24,7 +24,7 @@ import Control.Lens (makeLenses)
data
GargConfig
=
GargConfig
{
_gc_masteruser
::
!
Text
data
GargConfig
=
GargConfig
{
_gc_masteruser
::
!
Text
,
_gc_secretkey
::
!
Text
,
_gc_secretkey
::
!
Text
,
_gc_datafilepath
::
!
Text
,
_gc_datafilepath
::
!
FilePath
,
_gc_frame_write_url
::
!
Text
,
_gc_frame_write_url
::
!
Text
,
_gc_frame_calc_url
::
!
Text
,
_gc_frame_calc_url
::
!
Text
...
@@ -36,7 +36,6 @@ data GargConfig = GargConfig { _gc_masteruser :: !Text
...
@@ -36,7 +36,6 @@ data GargConfig = GargConfig { _gc_masteruser :: !Text
makeLenses
''
G
argConfig
makeLenses
''
G
argConfig
readConfig
::
FilePath
->
IO
GargConfig
readConfig
::
FilePath
->
IO
GargConfig
readConfig
fp
=
do
readConfig
fp
=
do
ini
<-
readIniFile
fp
ini
<-
readIniFile
fp
...
@@ -50,7 +49,7 @@ readConfig fp = do
...
@@ -50,7 +49,7 @@ readConfig fp = do
pure
$
GargConfig
(
val
"MASTER_USER"
)
pure
$
GargConfig
(
val
"MASTER_USER"
)
(
val
"SECRET_KEY"
)
(
val
"SECRET_KEY"
)
(
val
"DATA_FILEPATH"
)
(
cs
$
val
"DATA_FILEPATH"
)
(
val
"FRAME_WRITE_URL"
)
(
val
"FRAME_WRITE_URL"
)
(
val
"FRAME_CALC_URL"
)
(
val
"FRAME_CALC_URL"
)
(
val
"FRAME_SEARX_URL"
)
(
val
"FRAME_SEARX_URL"
)
...
...
src/Gargantext/Prelude/Utils.hs
View file @
5dd90077
...
@@ -20,6 +20,7 @@ import Control.Monad.Reader (MonadReader)
...
@@ -20,6 +20,7 @@ import Control.Monad.Reader (MonadReader)
import
Control.Monad.Reader
(
ask
)
import
Control.Monad.Reader
(
ask
)
import
Data.Text
(
Text
)
import
Data.Text
(
Text
)
import
GHC.IO
(
FilePath
)
import
GHC.IO
(
FilePath
)
import
Gargantext.Config
import
Gargantext.API.Admin.Settings
import
Gargantext.API.Admin.Settings
import
Gargantext.Database.Admin.Types.Node
(
NodeId
,
NodeType
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
,
NodeType
)
import
Gargantext.Prelude
import
Gargantext.Prelude
...
@@ -65,7 +66,7 @@ class ReadFile a where
...
@@ -65,7 +66,7 @@ class ReadFile a where
writeFile
::
(
MonadReader
env
m
,
MonadBase
IO
m
,
HasSettings
env
,
SaveFile
a
)
writeFile
::
(
MonadReader
env
m
,
MonadBase
IO
m
,
HasSettings
env
,
SaveFile
a
)
=>
a
->
m
FilePath
=>
a
->
m
FilePath
writeFile
a
=
do
writeFile
a
=
do
dataPath
<-
view
(
settings
.
fileFolder
)
<$>
ask
dataPath
<-
view
(
settings
.
config
.
gc_datafilepath
)
<$>
ask
(
fp
,
fn
)
<-
liftBase
$
(
toPath
3
)
.
hash
.
show
<$>
newStdGen
(
fp
,
fn
)
<-
liftBase
$
(
toPath
3
)
.
hash
.
show
<$>
newStdGen
let
foldPath
=
dataPath
<>
"/"
<>
fp
let
foldPath
=
dataPath
<>
"/"
<>
fp
...
@@ -80,5 +81,5 @@ writeFile a = do
...
@@ -80,5 +81,5 @@ writeFile a = do
readFile
::
(
MonadReader
env
m
,
MonadBase
IO
m
,
HasSettings
env
,
ReadFile
a
)
readFile
::
(
MonadReader
env
m
,
MonadBase
IO
m
,
HasSettings
env
,
ReadFile
a
)
=>
FilePath
->
m
a
=>
FilePath
->
m
a
readFile
fp
=
do
readFile
fp
=
do
dataPath
<-
view
(
settings
.
fileFolder
)
<$>
ask
dataPath
<-
view
(
settings
.
config
.
gc_datafilepath
)
<$>
ask
liftBase
$
readFile'
$
dataPath
<>
"/"
<>
fp
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