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
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Christian Merten
haskell-gargantext
Commits
76b557ea
Commit
76b557ea
authored
Oct 08, 2024
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/304-dev-pubmed-api-not-in-toml' into dev
parents
2925d008
50c77ea2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
16 deletions
+18
-16
Ini.hs
bin/gargantext-cli/CLI/Ini.hs
+1
-2
Caddyfile
devops/docker/Caddyfile
+6
-0
docker-compose.yaml
devops/docker/docker-compose.yaml
+0
-1
gargantext-settings.toml_toModify
gargantext-settings.toml_toModify
+0
-3
CentralExchange.hs
src/Gargantext/Core/AsyncUpdates/CentralExchange.hs
+9
-4
Types.hs
src/Gargantext/Core/Config/Types.hs
+2
-6
No files found.
bin/gargantext-cli/CLI/Ini.hs
View file @
76b557ea
...
...
@@ -76,8 +76,7 @@ convertConfigs ini@(Ini.GargConfig { .. }) iniMail nlpConfig connInfo =
,
_jc_max_docs_scrapers
=
_gc_max_docs_scrapers
,
_jc_js_job_timeout
=
_gc_js_job_timeout
,
_jc_js_id_timeout
=
_gc_js_id_timeout
}
,
_gc_apis
=
CTypes
.
APIsConfig
{
_ac_pubmed_api_key
=
_gc_pubmed_api_key
,
_ac_epo_api_url
=
_gc_epo_api_url
,
_gc_apis
=
CTypes
.
APIsConfig
{
_ac_epo_api_url
=
_gc_epo_api_url
,
_ac_scrapyd_url
}
,
_gc_log_level
=
LevelDebug
}
...
...
devops/docker/Caddyfile
0 → 100644
View file @
76b557ea
# http disables automatic https
http://localhost:8108 {
root * /srv/purescript-gargantext/dist
file_server
}
devops/docker/docker-compose.yaml
View file @
76b557ea
...
...
@@ -3,7 +3,6 @@ version: '3'
services
:
caddy
:
image
:
caddy:alpine
network
:
host
ports
:
-
8108:8108
volumes
:
...
...
gargantext-settings.toml_toModify
View file @
76b557ea
...
...
@@ -59,9 +59,6 @@ data_filepath = FILEPATH_TO_CHANGE
[apis]
[apis.pubmed]
api_key = ENTER_PUBMED_API_KEY
[apis.epo]
api_url = EPO_API_URL
...
...
src/Gargantext/Core/AsyncUpdates/CentralExchange.hs
View file @
76b557ea
...
...
@@ -29,7 +29,8 @@ import Gargantext.Core.AsyncUpdates.CentralExchange.Types
import
Gargantext.Core.Config.Types
(
NotificationsConfig
(
..
))
import
Gargantext.Prelude
import
Gargantext.System.Logging
(
LogLevel
(
..
),
withLogger
,
logMsg
)
import
Nanomsg
(
Pull
(
..
),
Push
(
..
),
bind
,
connect
,
recv
,
sendNonblocking
,
withSocket
)
import
Nanomsg
(
Pull
(
..
),
Push
(
..
),
bind
,
connect
,
recv
,
send
,
withSocket
)
import
System.Timeout
(
timeout
)
{-
...
...
@@ -74,7 +75,8 @@ gServer (NotificationsConfig { .. }) = do
Just
_ujp
@
(
UpdateJobProgress
_s
)
->
do
-- logMsg ioLogger DEBUG $ "[central_exchange] " <> show ujp
-- send the same message that we received
void
$
sendNonblocking
s_dispatcher
r
-- void $ sendNonblocking s_dispatcher r
void
$
timeout
100
_000
$
send
s_dispatcher
r
Just
(
UpdateTreeFirstLevel
node_id
)
->
do
logMsg
ioLogger
INFO
$
"[central_exchange] update tree: "
<>
show
node_id
-- putText $ "[central_exchange] sending that to the dispatcher: " <> show node_id
...
...
@@ -92,7 +94,8 @@ gServer (NotificationsConfig { .. }) = do
-- gargantext-server but maybe it can be a separate
-- process, independent of the server.
-- send the same message that we received
void
$
sendNonblocking
s_dispatcher
r
-- void $ sendNonblocking s_dispatcher r
void
$
timeout
100
_000
$
send
s_dispatcher
r
_
->
logMsg
ioLogger
DEBUG
$
"[central_exchange] unknown message"
...
...
@@ -104,4 +107,6 @@ notify (NotificationsConfig { _nc_central_exchange_connect }) ceMessage = do
let
str
=
Aeson
.
encode
ceMessage
withLogger
()
$
\
ioLogger
->
logMsg
ioLogger
DEBUG
$
"[central_exchange] sending: "
<>
(
T
.
unpack
$
TE
.
decodeUtf8
$
BSL
.
toStrict
str
)
void
$
sendNonblocking
s
$
BSL
.
toStrict
str
-- err <- sendNonblocking s $ BSL.toStrict str
-- putText $ "[notify] err: " <> show err
void
$
timeout
100
_000
$
send
s
$
BSL
.
toStrict
str
src/Gargantext/Core/Config/Types.hs
View file @
76b557ea
...
...
@@ -15,7 +15,6 @@ TODO-SECURITY: Critical
module
Gargantext.Core.Config.Types
(
APIsConfig
(
..
)
,
ac_pubmed_api_key
,
ac_epo_api_url
,
ac_scrapyd_url
,
CORSOrigin
(
..
)
...
...
@@ -299,13 +298,11 @@ makeLenses ''JobsConfig
data
APIsConfig
=
APIsConfig
{
_ac_pubmed_api_key
::
!
Text
,
_ac_epo_api_url
::
!
Text
APIsConfig
{
_ac_epo_api_url
::
!
Text
,
_ac_scrapyd_url
::
!
BaseUrl
}
deriving
(
Generic
,
Show
)
instance
FromValue
APIsConfig
where
fromValue
=
parseTableFromValue
$
do
_ac_pubmed_api_key
<-
reqKeyOf
"pubmed"
$
parseTableFromValue
$
reqKey
"api_key"
_ac_epo_api_url
<-
reqKeyOf
"epo"
$
parseTableFromValue
$
reqKey
"api_url"
scrapyd_url
<-
reqKeyOf
"scrapyd"
$
parseTableFromValue
$
reqKey
"url"
_ac_scrapyd_url
<-
...
...
@@ -316,8 +313,7 @@ instance FromValue APIsConfig where
instance
ToValue
APIsConfig
where
toValue
=
defaultTableToValue
instance
ToTable
APIsConfig
where
toTable
(
APIsConfig
{
..
})
=
table
[
"pubmed"
.=
table
[
"api_key"
.=
_ac_pubmed_api_key
]
,
"epo"
.=
table
[
"api_url"
.=
_ac_epo_api_url
]
toTable
(
APIsConfig
{
..
})
=
table
[
"epo"
.=
table
[
"api_url"
.=
_ac_epo_api_url
]
,
"scrapyd"
.=
table
[
"url"
.=
showBaseUrl
_ac_scrapyd_url
]
]
...
...
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