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
9
Merge Requests
9
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
5f769575
Verified
Commit
5f769575
authored
Jun 27, 2025
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[config] remove url_backend_api
This can be derived from 'url' setting already.
parent
67d1b537
Pipeline
#7702
passed with stages
in 40 minutes and 15 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
35 additions
and
42 deletions
+35
-42
Ini.hs
bin/gargantext-cli/CLI/Ini.hs
+0
-1
gargantext-settings.toml_toModify
gargantext-settings.toml_toModify
+0
-4
Named.hs
src/Gargantext/API/Server/Named.hs
+3
-3
Ngrams.hs
src/Gargantext/API/Server/Named/Ngrams.hs
+1
-1
Private.hs
src/Gargantext/API/Server/Named/Private.hs
+2
-2
Public.hs
src/Gargantext/API/Server/Named/Public.hs
+28
-26
Remote.hs
src/Gargantext/API/Server/Named/Remote.hs
+1
-1
Types.hs
src/Gargantext/Core/Config/Types.hs
+0
-4
No files found.
bin/gargantext-cli/CLI/Ini.hs
View file @
5f769575
...
...
@@ -102,7 +102,6 @@ mkFrontendConfig (Ini.GargConfig { .. }) =
CTypes
.
FrontendConfig
{
_fc_url
,
_fc_internal_url
=
_fc_url
,
_fc_backend_name
=
_gc_backend_name
,
_fc_url_backend_api
=
_gc_url_backend_api
,
_fc_cors
,
_fc_microservices
,
_fc_cookie_settings
=
CTypes
.
defaultCookieSettings
}
...
...
gargantext-settings.toml_toModify
View file @
5f769575
...
...
@@ -7,10 +7,6 @@ internal_url = "http://localhost:8008"
backend_name = "localhost"
# Main API url serving the BackEnd. This is currently used only for
# the public API endpoints.
url_backend_api = "http://localhost:8008/api/v1.0"
jwt_settings = "TODO"
[frontend.cors]
...
...
src/Gargantext/API/Server/Named.hs
View file @
5f769575
...
...
@@ -16,7 +16,7 @@ import Gargantext.API.Admin.EnvTypes (Env)
import
Gargantext.API.Admin.FrontEnd
(
frontEndServer
)
import
Gargantext.API.Auth.PolicyCheck
()
import
Gargantext.API.Errors
import
Gargantext.API.GraphQL
as
GraphQL
import
Gargantext.API.GraphQL
as
GraphQL
(
GraphQLAPI
,
api
)
import
Gargantext.API.Prelude
(
GargM
)
import
Gargantext.API.Routes.Named
import
Gargantext.API.Server.Named.Public
(
serverPublicGargAPI
)
...
...
@@ -24,7 +24,7 @@ import Gargantext.API.Swagger (openApiDoc)
import
Gargantext.API.ThrowAll
(
serverPrivateGargAPI
)
import
Gargantext.Core.Notifications.Dispatcher.WebSocket
qualified
as
Dispatcher
import
Gargantext.Core.Config
(
gc_frontend_config
,
hasConfig
)
import
Gargantext.Core.Config.Types
(
fc_url
_backend_api
)
import
Gargantext.Core.Config.Types
(
fc_url
)
import
Gargantext.Prelude
hiding
(
Handler
,
catch
)
import
Gargantext.System.Logging
(
logLocM
,
LogLevel
(
..
))
import
Paths_gargantext
qualified
as
PG
-- cabal magic build module
...
...
@@ -40,7 +40,7 @@ serverGargAPI env
,
gargForgotPasswordAsyncAPI
=
forgotPasswordAsync
,
gargVersionAPI
=
gargVersion
,
gargPrivateAPI
=
serverPrivateGargAPI
,
gargPublicAPI
=
serverPublicGargAPI
(
env
^.
hasConfig
.
gc_frontend_config
.
fc_url
_backend_api
)
,
gargPublicAPI
=
serverPublicGargAPI
(
env
^.
hasConfig
.
gc_frontend_config
.
fc_url
)
}
where
gargVersion
::
GargVersion
(
AsServerT
(
GargM
Env
BackendInternalError
))
...
...
src/Gargantext/API/Server/Named/Ngrams.hs
View file @
5f769575
...
...
@@ -30,7 +30,7 @@ import Gargantext.Database.Query.Table.Node (getNode)
import
Gargantext.Database.Query.Table.Node.Select
(
selectNodesWithUsername
)
import
Gargantext.Database.Schema.Node
(
node_id
,
node_parent_id
,
node_user_id
)
import
Gargantext.Prelude
import
Gargantext.System.Logging
import
Gargantext.System.Logging
.Types
(
MonadLogger
)
import
Gargantext.Utils.Jobs.Monad
(
JobHandle
,
MonadJobStatus
(
..
),
markFailedNoErr
)
import
Servant.Server.Generic
(
AsServerT
)
...
...
src/Gargantext/API/Server/Named/Private.hs
View file @
5f769575
...
...
@@ -10,7 +10,7 @@ import Gargantext.API.Errors.Types (BackendInternalError)
import
Gargantext.API.Members
(
members
)
import
Gargantext.API.Ngrams.List
qualified
as
List
import
Gargantext.API.Node
(
annuaireNodeAPI
,
corpusNodeAPI
,
nodeAPI
,
nodeNodeAPI
,
nodesAPI
,
roots
)
import
Gargantext.API.Node.Contact
as
Contact
import
Gargantext.API.Node.Contact
as
Contact
(
contactAPI
)
import
Gargantext.API.Node.Corpus.Export
qualified
as
CorpusExport
import
Gargantext.API.Node.Corpus.Subcorpus
qualified
as
Subcorpus
import
Gargantext.API.Node.Document.Export
(
documentExportAPI
)
...
...
@@ -20,7 +20,7 @@ import Gargantext.API.Node.ShareURL ( shareURL )
import
Gargantext.API.Prelude
(
GargM
)
import
Gargantext.API.Routes
(
addWithTempFileApi
,
addCorpusWithQuery
)
import
Gargantext.API.Routes.Named.Private
qualified
as
Named
import
Gargantext.API.Server.Named.Ngrams
import
Gargantext.API.Server.Named.Ngrams
(
apiNgramsTableDoc
)
import
Gargantext.API.Server.Named.Viz
qualified
as
Viz
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Database.Admin.Types.Hyperdata
(
HyperdataAny
)
...
...
src/Gargantext/API/Server/Named/Public.hs
View file @
5f769575
...
...
@@ -4,9 +4,9 @@ module Gargantext.API.Server.Named.Public (
)
where
import
Control.Lens
((
^?
),
_Just
)
import
Data.List
qualified
as
List
import
Data.Map.Strict
qualified
as
Map
import
Data.Set
qualified
as
Set
import
Data.Text
qualified
as
T
import
Gargantext.API.Node.File
(
fileApi
)
import
Gargantext.API.Prelude
(
serverError
,
IsGargServer
)
import
Gargantext.API.Public.Types
(
PublicData
(
..
))
...
...
@@ -22,29 +22,30 @@ import Gargantext.Database.Query.Table.Node.Error (HasNodeError(..))
import
Gargantext.Database.Query.Table.NodeNode
(
selectPublicNodes
)
import
Gargantext.Database.Schema.Node
(
NodePoly
(
..
),
node_date
,
node_hyperdata
)
-- (NodePoly(..))
import
Gargantext.Prelude
import
Servant
import
Servant
(
ServerError
(
errBody
),
err405
)
import
Servant.Client.Core.BaseUrl
(
BaseUrl
(
..
),
showBaseUrl
)
import
Servant.Server.Generic
(
AsServerT
)
serverPublicGargAPI
::
IsGargServer
env
err
m
=>
Text
->
Named
.
GargPublicAPI
(
AsServerT
m
)
serverPublicGargAPI
::
IsGargServer
env
err
m
=>
BaseUrl
->
Named
.
GargPublicAPI
(
AsServerT
m
)
serverPublicGargAPI
baseUrl
=
Named
.
GargPublicAPI
$
Named
.
GargPublicAPI'
{
publicHomeAPI
=
api
_h
ome
baseUrl
,
publicNodeAPI
=
Named
.
NodeAPI
api
_n
ode
{
publicHomeAPI
=
api
H
ome
baseUrl
,
publicNodeAPI
=
Named
.
NodeAPI
api
N
ode
}
api
_home
::
IsGargServer
env
err
m
=>
Text
->
Named
.
HomeAPI
(
AsServerT
m
)
api
_h
ome
baseUrl
=
Named
.
HomeAPI
$
catMaybes
api
Home
::
IsGargServer
env
err
m
=>
BaseUrl
->
Named
.
HomeAPI
(
AsServerT
m
)
api
H
ome
baseUrl
=
Named
.
HomeAPI
$
catMaybes
<$>
map
(
toPublicData
baseUrl
)
<$>
filterPublicDatas
<$>
selectPublic
api
_n
ode
::
IsGargServer
env
err
m
=>
NodeId
->
Named
.
FileAPI
(
AsServerT
m
)
api
_n
ode
nId
=
Named
.
FileAPI
$
do
api
N
ode
::
IsGargServer
env
err
m
=>
NodeId
->
Named
.
FileAPI
(
AsServerT
m
)
api
N
ode
nId
=
Named
.
FileAPI
$
do
pubNodes
<-
publicNodes
-- TODO optimize with SQL
case
Set
.
member
nId
pubNodes
of
False
->
serverError
$
err405
{
errBody
=
"Not allowed"
}
True
->
fileApi
nId
(
if
Set
.
member
nId
pubNodes
then
fileApi
nId
else
serverError
$
err405
{
errBody
=
"Not allowed"
})
-------------------------------------------------------------------------
...
...
@@ -61,7 +62,7 @@ filterPublicDatas :: [(Node HyperdataFolder, Maybe Int)]
filterPublicDatas
datas
=
map
(
\
(
n
,
mi
)
->
let
mi'
=
UnsafeMkNodeId
<$>
mi
in
(
_node_id
n
,
(
n
,
maybe
[]
(
:
[]
)
mi'
))
(
_node_id
n
,
(
n
,
maybe
ToList
mi'
))
)
datas
&
Map
.
fromListWith
(
\
(
n1
,
i1
)
(
_n2
,
i2
)
->
(
n1
,
i1
<>
i2
))
&
Map
.
filter
(
not
.
null
.
snd
)
...
...
@@ -72,28 +73,29 @@ publicNodes :: HasNodeError err
publicNodes
=
do
candidates
<-
filterPublicDatas
<$>
selectPublicNodes
pure
$
Set
.
fromList
$
List
.
concat
$
map
(
\
(
n
,
ns
)
->
(
_node_id
n
)
:
ns
)
candidates
$
concatMap
(
\
(
n
,
ns
)
->
_node_id
n
:
ns
)
candidates
-- http://localhost:8008/api/v1.0/node/23543/file/download<Paste>
-- http://localhost:8000/images/Gargantextuel-212x300.jpg
toPublicData
::
Text
->
(
Node
HyperdataFolder
,
[
NodeId
])
->
Maybe
PublicData
toPublicData
base
(
n
,
mn
)
=
do
title
<-
(
hd
^?
(
_Just
.
hf_data
.
cf_title
)
)
abstract
<-
(
hd
^?
(
_Just
.
hf_data
.
cf_desc
)
)
img
<-
(
Just
$
url'
mn
)
-- "images/Gargantextuel-212x300.jpg"
url
<-
(
Just
$
url'
mn
)
toPublicData
::
BaseUrl
->
(
Node
HyperdataFolder
,
[
NodeId
])
->
Maybe
PublicData
toPublicData
base
Url
(
n
,
mn
)
=
do
title
<-
hd
^?
(
_Just
.
hf_data
.
cf_title
)
abstract
<-
hd
^?
(
_Just
.
hf_data
.
cf_desc
)
img
<-
Just
$
url'
mn
-- "images/Gargantextuel-212x300.jpg"
url
<-
Just
$
url'
mn
date
<-
Just
(
show
$
utc2year
(
n
^.
node_date
))
database
<-
(
hd
^?
(
_Just
.
hf_data
.
cf_query
)
)
author
<-
(
hd
^?
(
_Just
.
hf_data
.
cf_authors
)
)
database
<-
hd
^?
(
_Just
.
hf_data
.
cf_query
)
author
<-
hd
^?
(
_Just
.
hf_data
.
cf_authors
)
pure
$
PublicData
{
..
}
where
hd
=
head
$
filter
(
\
(
HyperdataField
cd
_
_
)
->
cd
==
JSON
)
$
n
^.
(
node_hyperdata
.
hc_fields
)
url'
::
[
NodeId
]
->
Text
url'
mn'
=
base
path
::
[
NodeId
]
->
Text
path
mn'
=
"/api/v1.0"
<>
"/public/"
<>
(
show
$
(
maybe
0
unNodeId
$
head
mn'
))
<>
show
(
maybe
0
unNodeId
(
head
mn'
))
<>
"/file/download"
url'
::
[
NodeId
]
->
Text
url'
mn'
=
T
.
pack
$
showBaseUrl
$
baseUrl
{
baseUrlPath
=
T
.
unpack
$
path
mn'
}
src/Gargantext/API/Server/Named/Remote.hs
View file @
5f769575
...
...
@@ -38,7 +38,7 @@ import Gargantext.API.Errors.Types
import
Gargantext.API.Ngrams.Prelude
(
getNgramsList
)
import
Gargantext.API.Ngrams.Types
(
NgramsList
)
import
Gargantext.API.Node.Document.Export
(
get_document_json
)
import
Gargantext.API.Node.Document.Export.Types
import
Gargantext.API.Node.Document.Export.Types
(
DocumentExport
(
_de_documents
)
)
import
Gargantext.API.Prelude
(
IsGargServer
)
import
Gargantext.API.Routes.Client
(
remoteImportClient
)
import
Gargantext.API.Routes.Named.Remote
qualified
as
Named
...
...
src/Gargantext/Core/Config/Types.hs
View file @
5f769575
...
...
@@ -30,7 +30,6 @@ module Gargantext.Core.Config.Types
,
fc_url
,
fc_internal_url
,
fc_backend_name
,
fc_url_backend_api
,
fc_cors
,
fc_microservices
,
fc_cookie_settings
...
...
@@ -203,7 +202,6 @@ data FrontendConfig =
FrontendConfig
{
_fc_url
::
!
BaseUrl
,
_fc_internal_url
::
!
BaseUrl
,
_fc_backend_name
::
!
Text
,
_fc_url_backend_api
::
!
Text
,
_fc_cors
::
!
CORSSettings
,
_fc_microservices
::
!
MicroServicesSettings
,
_fc_cookie_settings
::
!
CookieSettings
...
...
@@ -222,7 +220,6 @@ instance FromValue FrontendConfig where
Nothing
->
fail
"cannot parse fc_internal_url"
Just
b
->
pure
b
_fc_backend_name
<-
reqKey
"backend_name"
_fc_url_backend_api
<-
reqKey
"url_backend_api"
_fc_cors
<-
reqKey
"cors"
_fc_microservices
<-
reqKey
"microservices"
...
...
@@ -234,7 +231,6 @@ instance ToTable FrontendConfig where
[
"url"
.=
(
T
.
pack
$
showBaseUrl
_fc_url
)
,
"internal_url"
.=
(
T
.
pack
$
showBaseUrl
_fc_internal_url
)
,
"backend_name"
.=
_fc_backend_name
,
"url_backend_api"
.=
_fc_url_backend_api
,
"cors"
.=
_fc_cors
,
"microservices"
.=
_fc_microservices
]
...
...
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