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