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
199
Issues
199
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
2772e02c
Verified
Commit
2772e02c
authored
Jul 09, 2025
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[config] more toml fixes: fc internal/external urls added
parent
8cde94d7
Pipeline
#7731
passed with stages
in 55 minutes and 50 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
21 deletions
+32
-21
Ini.hs
bin/gargantext-cli/CLI/Ini.hs
+2
-1
gargantext-settings.toml_toModify
gargantext-settings.toml_toModify
+7
-3
FrontEnd.hs
src/Gargantext/API/Admin/FrontEnd.hs
+3
-2
Named.hs
src/Gargantext/API/Server/Named.hs
+3
-3
Config.hs
src/Gargantext/Core/Config.hs
+1
-1
Types.hs
src/Gargantext/Core/Config/Types.hs
+12
-8
test_config.toml
test-data/test_config.toml
+2
-1
Setup.hs
test/Test/API/Setup.hs
+2
-2
No files found.
bin/gargantext-cli/CLI/Ini.hs
View file @
2772e02c
...
@@ -101,8 +101,9 @@ convertConfigs ini@(Ini.GargConfig { .. }) iniMail nlpConfig connInfo =
...
@@ -101,8 +101,9 @@ convertConfigs ini@(Ini.GargConfig { .. }) iniMail nlpConfig connInfo =
mkFrontendConfig
::
Ini
.
GargConfig
->
CTypes
.
FrontendConfig
mkFrontendConfig
::
Ini
.
GargConfig
->
CTypes
.
FrontendConfig
mkFrontendConfig
(
Ini
.
GargConfig
{
..
})
=
mkFrontendConfig
(
Ini
.
GargConfig
{
..
})
=
CTypes
.
FrontendConfig
{
_fc_url
CTypes
.
FrontendConfig
{
_fc_
external_url
=
_fc_
url
,
_fc_internal_url
=
_fc_url
,
_fc_internal_url
=
_fc_url
,
_fc_directory
=
"./purescript-gargantext/dist"
,
_fc_backend_name
=
_gc_backend_name
,
_fc_backend_name
=
_gc_backend_name
,
_fc_cors
,
_fc_cors
,
_fc_microservices
,
_fc_microservices
...
...
gargantext-settings.toml_toModify
View file @
2772e02c
[frontend]
[frontend]
# Main url serving the FrontEnd (public URL)
# Main url serving the FrontEnd (public URL)
url = "http://localhost:8008"
external_url = "http://localhost:8008"
# in case this is behind a reverse proxy
# host/port where the GarganText server will bind to
internal_url = "http://localhost:8008"
internal_url = "http://localhost:8008"
# Location of the frontend code. This will be served at the root of
# the path (e.g. index.html)
directory = "./purescript-gargantext/dist"
backend_name = "localhost"
backend_name = "localhost"
jwt_settings = "TODO"
jwt_settings = "TODO"
...
...
src/Gargantext/API/Admin/FrontEnd.hs
View file @
2772e02c
...
@@ -16,9 +16,10 @@ Loads all static file for the front-end.
...
@@ -16,9 +16,10 @@ Loads all static file for the front-end.
---------------------------------------------------------------------
---------------------------------------------------------------------
module
Gargantext.API.Admin.FrontEnd
where
module
Gargantext.API.Admin.FrontEnd
where
import
GHC.IO
(
FilePath
)
import
Servant
import
Servant
type
FrontEndAPI
=
Raw
type
FrontEndAPI
=
Raw
frontEndServer
::
Server
FrontEndAPI
frontEndServer
::
FilePath
->
Server
FrontEndAPI
frontEndServer
=
serveDirectoryFileServer
"./purescript-gargantext/dist"
frontEndServer
path
=
serveDirectoryFileServer
path
src/Gargantext/API/Server/Named.hs
View file @
2772e02c
...
@@ -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
)
import
Gargantext.Core.Config.Types
(
fc_
directory
,
fc_external_
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
)
,
gargPublicAPI
=
serverPublicGargAPI
(
env
^.
hasConfig
.
gc_frontend_config
.
fc_
external_
url
)
}
}
where
where
gargVersion
::
GargVersion
(
AsServerT
(
GargM
Env
BackendInternalError
))
gargVersion
::
GargVersion
(
AsServerT
(
GargM
Env
BackendInternalError
))
...
@@ -66,7 +66,7 @@ server env =
...
@@ -66,7 +66,7 @@ server env =
-- (Proxy :: Proxy AuthContext)
-- (Proxy :: Proxy AuthContext)
(
transformJSON
errScheme
)
(
transformJSON
errScheme
)
Dispatcher
.
wsServer
Dispatcher
.
wsServer
,
frontendAPI
=
frontEndServer
,
frontendAPI
=
frontEndServer
(
env
^.
hasConfig
.
gc_frontend_config
.
fc_directory
)
}
}
where
where
transformJSON
::
forall
a
.
GargErrorScheme
->
GargM
Env
BackendInternalError
a
->
Handler
a
transformJSON
::
forall
a
.
GargErrorScheme
->
GargM
Env
BackendInternalError
a
->
Handler
a
...
...
src/Gargantext/Core/Config.hs
View file @
2772e02c
...
@@ -143,7 +143,7 @@ instance ToTable GargConfig where
...
@@ -143,7 +143,7 @@ instance ToTable GargConfig where
mkProxyUrl
::
GargConfig
->
BaseUrl
mkProxyUrl
::
GargConfig
->
BaseUrl
mkProxyUrl
GargConfig
{
_gc_frontend_config
=
cfg
}
=
mkProxyUrl
GargConfig
{
_gc_frontend_config
=
cfg
}
=
(
_fc_url
cfg
)
{
baseUrlPort
=
_msProxyPort
$
_fc_microservices
cfg
}
(
_fc_
external_
url
cfg
)
{
baseUrlPort
=
_msProxyPort
$
_fc_microservices
cfg
}
class
HasConfig
env
where
class
HasConfig
env
where
...
...
src/Gargantext/Core/Config/Types.hs
View file @
2772e02c
...
@@ -27,9 +27,10 @@ module Gargantext.Core.Config.Types
...
@@ -27,9 +27,10 @@ module Gargantext.Core.Config.Types
,
f_istex_url
,
f_istex_url
,
PortNumber
,
PortNumber
,
FrontendConfig
(
..
)
,
FrontendConfig
(
..
)
,
fc_url
,
fc_
external_
url
,
fc_internal_url
,
fc_internal_url
,
fc_backend_name
,
fc_backend_name
,
fc_directory
,
fc_cors
,
fc_cors
,
fc_microservices
,
fc_microservices
,
fc_cookie_settings
,
fc_cookie_settings
...
@@ -199,8 +200,9 @@ defaultCookieSettings = SAuth.defaultCookieSettings { cookieXsrfSetting = Just x
...
@@ -199,8 +200,9 @@ defaultCookieSettings = SAuth.defaultCookieSettings { cookieXsrfSetting = Just x
-- TODO jwtSettings = defaultJWTSettings
-- TODO jwtSettings = defaultJWTSettings
data
FrontendConfig
=
data
FrontendConfig
=
FrontendConfig
{
_fc_
url
::
!
BaseUrl
FrontendConfig
{
_fc_
external_url
::
!
BaseUrl
,
_fc_internal_url
::
!
BaseUrl
,
_fc_internal_url
::
!
BaseUrl
,
_fc_directory
::
!
FilePath
,
_fc_backend_name
::
!
Text
,
_fc_backend_name
::
!
Text
,
_fc_cors
::
!
CORSSettings
,
_fc_cors
::
!
CORSSettings
,
_fc_microservices
::
!
MicroServicesSettings
,
_fc_microservices
::
!
MicroServicesSettings
...
@@ -209,16 +211,17 @@ data FrontendConfig =
...
@@ -209,16 +211,17 @@ data FrontendConfig =
deriving
(
Generic
,
Show
)
deriving
(
Generic
,
Show
)
instance
FromValue
FrontendConfig
where
instance
FromValue
FrontendConfig
where
fromValue
=
parseTableFromValue
$
do
fromValue
=
parseTableFromValue
$
do
_fc_
url_txt
<-
reqKey
"
url"
_fc_
external_url_txt
<-
reqKey
"external_
url"
_fc_url
<-
_fc_
external_
url
<-
case
parseBaseUrl
(
T
.
unpack
_fc_url_txt
)
of
case
parseBaseUrl
(
T
.
unpack
_fc_
external_
url_txt
)
of
Nothing
->
fail
"cannot parse fc_url"
Nothing
->
fail
"cannot parse fc_
external_
url"
Just
b
->
pure
b
Just
b
->
pure
b
_fc_internal_url_txt
<-
reqKey
"internal_url"
_fc_internal_url_txt
<-
reqKey
"internal_url"
_fc_internal_url
<-
_fc_internal_url
<-
case
parseBaseUrl
(
T
.
unpack
_fc_internal_url_txt
)
of
case
parseBaseUrl
(
T
.
unpack
_fc_internal_url_txt
)
of
Nothing
->
fail
"cannot parse fc_internal_url"
Nothing
->
fail
"cannot parse fc_internal_url"
Just
b
->
pure
b
Just
b
->
pure
b
_fc_directory
<-
reqKey
"directory"
_fc_backend_name
<-
reqKey
"backend_name"
_fc_backend_name
<-
reqKey
"backend_name"
_fc_cors
<-
reqKey
"cors"
_fc_cors
<-
reqKey
"cors"
_fc_microservices
<-
reqKey
"microservices"
_fc_microservices
<-
reqKey
"microservices"
...
@@ -228,8 +231,9 @@ instance ToValue FrontendConfig where
...
@@ -228,8 +231,9 @@ instance ToValue FrontendConfig where
toValue
=
defaultTableToValue
toValue
=
defaultTableToValue
instance
ToTable
FrontendConfig
where
instance
ToTable
FrontendConfig
where
toTable
(
FrontendConfig
{
..
})
=
table
toTable
(
FrontendConfig
{
..
})
=
table
[
"
url"
.=
(
T
.
pack
$
showBaseUrl
_fc
_url
)
[
"
external_url"
.=
(
T
.
pack
$
showBaseUrl
_fc_external
_url
)
,
"internal_url"
.=
(
T
.
pack
$
showBaseUrl
_fc_internal_url
)
,
"internal_url"
.=
(
T
.
pack
$
showBaseUrl
_fc_internal_url
)
,
"directory"
.=
_fc_directory
,
"backend_name"
.=
_fc_backend_name
,
"backend_name"
.=
_fc_backend_name
,
"cors"
.=
_fc_cors
,
"cors"
.=
_fc_cors
,
"microservices"
.=
_fc_microservices
]
,
"microservices"
.=
_fc_microservices
]
...
@@ -237,7 +241,7 @@ instance ToTable FrontendConfig where
...
@@ -237,7 +241,7 @@ instance ToTable FrontendConfig where
makeLenses
''
F
rontendConfig
makeLenses
''
F
rontendConfig
getPublicUrl
::
FrontendConfig
->
Text
getPublicUrl
::
FrontendConfig
->
Text
getPublicUrl
(
FrontendConfig
{
..
})
=
T
.
pack
$
showBaseUrl
_fc_url
getPublicUrl
(
FrontendConfig
{
..
})
=
T
.
pack
$
showBaseUrl
_fc_
external_
url
data
MicroServicesProxyStatus
data
MicroServicesProxyStatus
=
PXY_enabled
PortNumber
=
PXY_enabled
PortNumber
...
...
test-data/test_config.toml
View file @
2772e02c
[frontend]
[frontend]
url
=
"http://localhost"
external_
url
=
"http://localhost"
internal_url
=
"http://localhost"
internal_url
=
"http://localhost"
directory
=
"./purescript-gargantext/dist"
backend_name
=
"localhost"
backend_name
=
"localhost"
jwt_settings
=
"TODO"
jwt_settings
=
"TODO"
...
...
test/Test/API/Setup.hs
View file @
2772e02c
...
@@ -24,7 +24,7 @@ import Gargantext.API.Admin.EnvTypes (Env (..), env_dispatcher)
...
@@ -24,7 +24,7 @@ import Gargantext.API.Admin.EnvTypes (Env (..), env_dispatcher)
import
Gargantext.API.Errors.Types
import
Gargantext.API.Errors.Types
import
Gargantext.API.Prelude
import
Gargantext.API.Prelude
import
Gargantext.Core.Config
hiding
(
jwtSettings
)
import
Gargantext.Core.Config
hiding
(
jwtSettings
)
import
Gargantext.Core.Config.Types
(
jwtSettings
,
fc_url
,
fc_internal_url
)
import
Gargantext.Core.Config.Types
(
jwtSettings
,
fc_
external_
url
,
fc_internal_url
)
import
Gargantext.Core.Notifications
(
withNotifications
)
import
Gargantext.Core.Notifications
(
withNotifications
)
import
Gargantext.Core.Types.Individu
import
Gargantext.Core.Types.Individu
import
Gargantext.Database.Action.Flow
import
Gargantext.Database.Action.Flow
...
@@ -74,7 +74,7 @@ newTestEnv testEnv logger port = do
...
@@ -74,7 +74,7 @@ newTestEnv testEnv logger port = do
!
manager_env
<-
newTlsManager
!
manager_env
<-
newTlsManager
let
config_env
=
test_config
testEnv
let
config_env
=
test_config
testEnv
&
(
gc_frontend_config
.
fc_url
)
%~
(
\
b
->
b
{
baseUrlPort
=
port
})
&
(
gc_frontend_config
.
fc_
external_
url
)
%~
(
\
b
->
b
{
baseUrlPort
=
port
})
&
(
gc_frontend_config
.
fc_internal_url
)
%~
(
\
b
->
b
{
baseUrlPort
=
port
})
&
(
gc_frontend_config
.
fc_internal_url
)
%~
(
\
b
->
b
{
baseUrlPort
=
port
})
-- dbParam <- pure $ testEnvToPgConnectionInfo testEnv
-- dbParam <- pure $ testEnvToPgConnectionInfo testEnv
-- !pool <- newPool dbParam
-- !pool <- newPool dbParam
...
...
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