Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Puppet module - Automated Comptoir du Libre deployment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Comptoir
Puppet module - Automated Comptoir du Libre deployment
Commits
5217f9bf
Commit
5217f9bf
authored
9 months ago
by
Fabrice Gangler
Browse files
Options
Downloads
Patches
Plain Diff
feat: allow to configure WEBAPP_DEFAULT_URI environment variable
parent
6e611598
No related branches found
No related tags found
1 merge request
!4
Resolve "Allow to configure WEBAPP_DEFAULT_URI environment variable"
Pipeline
#76819
canceled
9 months ago
Stage: syntax
Stage: unit
Stage: acceptance
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
REFERENCE.md
+9
-0
9 additions, 0 deletions
REFERENCE.md
manifests/init.pp
+2
-0
2 additions, 0 deletions
manifests/init.pp
spec/classes/comptoir_spec.rb
+15
-0
15 additions, 0 deletions
spec/classes/comptoir_spec.rb
templates/env.prod.local.epp
+1
-1
1 addition, 1 deletion
templates/env.prod.local.epp
with
27 additions
and
1 deletion
REFERENCE.md
+
9
−
0
View file @
5217f9bf
...
@@ -35,6 +35,7 @@ The following parameters are available in the `comptoir` class:
...
@@ -35,6 +35,7 @@ The following parameters are available in the `comptoir` class:
*
[
`download_url`
](
#-comptoir--download_url
)
*
[
`download_url`
](
#-comptoir--download_url
)
*
[
`download_checksum`
](
#-comptoir--download_checksum
)
*
[
`download_checksum`
](
#-comptoir--download_checksum
)
*
[
`checksum_type`
](
#-comptoir--checksum_type
)
*
[
`checksum_type`
](
#-comptoir--checksum_type
)
*
[
`app_default_uri`
](
#-comptoir--app_default_uri
)
*
[
`app_name`
](
#-comptoir--app_name
)
*
[
`app_name`
](
#-comptoir--app_name
)
*
[
`app_shortname`
](
#-comptoir--app_shortname
)
*
[
`app_shortname`
](
#-comptoir--app_shortname
)
*
[
`app_secret`
](
#-comptoir--app_secret
)
*
[
`app_secret`
](
#-comptoir--app_secret
)
...
@@ -85,6 +86,14 @@ Checksum type given with download_checksum.
...
@@ -85,6 +86,14 @@ Checksum type given with download_checksum.
Default value:
`'sha256'`
Default value:
`'sha256'`
##### <a name="-comptoir--app_default_uri"></a>`app_default_uri`
Data type:
`Stdlib::HTTPUrl`
Default URI used to generate URLs in a non-HTTP context
Default value:
`'https://comptoir.example.org/'`
##### <a name="-comptoir--app_name"></a>`app_name`
##### <a name="-comptoir--app_name"></a>`app_name`
Data type:
`String[1]`
Data type:
`String[1]`
...
...
This diff is collapsed.
Click to expand it.
manifests/init.pp
+
2
−
0
View file @
5217f9bf
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
# @param download_url URL where Comptoir-du-Libre archive is stored.
# @param download_url URL where Comptoir-du-Libre archive is stored.
# @param download_checksum Archive file checksum (match checksum_type) used to verify of archive file.
# @param download_checksum Archive file checksum (match checksum_type) used to verify of archive file.
# @param checksum_type Checksum type given with download_checksum.
# @param checksum_type Checksum type given with download_checksum.
# @param app_default_uri Default URI used to generate URLs in a non-HTTP context
# @param app_name A custom string displayed to users as name of service.
# @param app_name A custom string displayed to users as name of service.
# @param app_shortname A custom string displayed to users as short name of service.
# @param app_shortname A custom string displayed to users as short name of service.
# @param app_secret Application secret is required to generate CSRF tokens
# @param app_secret Application secret is required to generate CSRF tokens
...
@@ -45,6 +46,7 @@ class comptoir (
...
@@ -45,6 +46,7 @@ class comptoir (
String
[
1
]
$download_checksum
=
'f33363b96fc330b9298d3477f90ee1aaa09eb06605901b72af3d472c054cf223'
,
# 3.0.0.alpha.4
String
[
1
]
$download_checksum
=
'f33363b96fc330b9298d3477f90ee1aaa09eb06605901b72af3d472c054cf223'
,
# 3.0.0.alpha.4
Enum
[
'md5'
,
'sha1'
,
'sha2'
,
'sha256'
,
'sha384'
,
'sha512'
]
$checksum_type
=
'sha256'
,
Enum
[
'md5'
,
'sha1'
,
'sha2'
,
'sha256'
,
'sha384'
,
'sha512'
]
$checksum_type
=
'sha256'
,
String
[
1
]
$app_secret
=
'ThisTokenIsNotSoSecretChangeIt'
,
String
[
1
]
$app_secret
=
'ThisTokenIsNotSoSecretChangeIt'
,
Stdlib
::
HTTPUrl
$app_default_uri
=
'https://comptoir.example.org/'
,
String
[
1
]
$app_name
=
'Comptoir-du-Libre'
,
String
[
1
]
$app_name
=
'Comptoir-du-Libre'
,
String
[
1
]
$app_shortname
=
'Comptoir'
,
String
[
1
]
$app_shortname
=
'Comptoir'
,
Stdlib
::
Absolutepath
$config_path
=
'/etc/comptoir'
,
Stdlib
::
Absolutepath
$config_path
=
'/etc/comptoir'
,
...
...
This diff is collapsed.
Click to expand it.
spec/classes/comptoir_spec.rb
+
15
−
0
View file @
5217f9bf
...
@@ -22,6 +22,8 @@ describe 'comptoir' do
...
@@ -22,6 +22,8 @@ describe 'comptoir' do
is_expected
.
to
contain_file
(
'/etc/comptoir/env.prod.local'
)
\
is_expected
.
to
contain_file
(
'/etc/comptoir/env.prod.local'
)
\
.
with_content
(
sensitive
(
%r{^MAILER_DSN=smtp://127.0.0.1:25$}
))
.
with_content
(
sensitive
(
%r{^MAILER_DSN=smtp://127.0.0.1:25$}
))
is_expected
.
to
contain_file
(
'/etc/comptoir/env.prod.local'
)
\
.
with_content
(
sensitive
(
%r{^WEBAPP_DEFAULT_URI='https://comptoir.example.org/'$}
))
is_expected
.
to
contain_file
(
'/etc/comptoir/env.prod.local'
)
\
is_expected
.
to
contain_file
(
'/etc/comptoir/env.prod.local'
)
\
.
with_content
(
sensitive
(
%r{^WEBAPP_NAME='Comptoir-du-Libre'$}
))
.
with_content
(
sensitive
(
%r{^WEBAPP_NAME='Comptoir-du-Libre'$}
))
is_expected
.
to
contain_file
(
'/etc/comptoir/env.prod.local'
)
\
is_expected
.
to
contain_file
(
'/etc/comptoir/env.prod.local'
)
\
...
@@ -95,6 +97,19 @@ describe 'comptoir' do
...
@@ -95,6 +97,19 @@ describe 'comptoir' do
end
end
end
end
context
'/etc/comptoir/env.prod.local with custom WEBAPP_DEFAULT_URI'
do
let
(
:params
)
do
{
app_default_uri:
'http://new-comptoir.example.org/'
,
}
end
it
do
is_expected
.
to
contain_file
(
'/etc/comptoir/env.prod.local'
)
\
.
with_content
(
sensitive
(
%r{^WEBAPP_DEFAULT_URI='http://new-comptoir.example.org/'$}
))
end
end
context
'/etc/comptoir/env.prod.local with custom emails (mail from, mail alerting to)'
do
context
'/etc/comptoir/env.prod.local with custom emails (mail from, mail alerting to)'
do
let
(
:params
)
do
let
(
:params
)
do
{
{
...
...
This diff is collapsed.
Click to expand it.
templates/env.prod.local.epp
+
1
−
1
View file @
5217f9bf
...
@@ -33,6 +33,7 @@ APP_SECRET=<%= $comptoir::app_secret %>
...
@@ -33,6 +33,7 @@ APP_SECRET=<%= $comptoir::app_secret %>
DATABASE_URL="postgresql://
<%=
$comptoir::db_user
%>
:
<%=
$comptoir::db_password
%>
@
<%=
$comptoir::db_host
%>
:5432/
<%=
$comptoir::db_name
%>
?serverVersion=
<%=
$comptoir::db_version
%>
&charset=utf8"
DATABASE_URL="postgresql://
<%=
$comptoir::db_user
%>
:
<%=
$comptoir::db_password
%>
@
<%=
$comptoir::db_host
%>
:5432/
<%=
$comptoir::db_name
%>
?serverVersion=
<%=
$comptoir::db_version
%>
&charset=utf8"
MAILER_DSN=smtp://
<%
if
$comptoir::smtp_user
{
%><%=
$comptoir::smtp_user
%>
:
<%=
$comptoir::smtp_password
%>
@
<%
}
%><%=
$comptoir::smtp_host
%>
:
<%=
$comptoir::smtp_port
%>
MAILER_DSN=smtp://
<%
if
$comptoir::smtp_user
{
%><%=
$comptoir::smtp_user
%>
:
<%=
$comptoir::smtp_password
%>
@
<%
}
%><%=
$comptoir::smtp_host
%>
:
<%=
$comptoir::smtp_port
%>
WEBAPP_DEFAULT_URI='
<%=
$comptoir::app_default_uri
%>
'
WEBAPP_EMAIL_FROM='
<%=
$comptoir::smtp_mailfrom
%>
'
WEBAPP_EMAIL_FROM='
<%=
$comptoir::smtp_mailfrom
%>
'
WEBAPP_EMAIL_ALERTING_TO='
<%=
$comptoir::smtp_mailalertingto
%>
'
WEBAPP_EMAIL_ALERTING_TO='
<%=
$comptoir::smtp_mailalertingto
%>
'
WEBAPP_NAME='
<%=
$comptoir::app_name
%>
'
WEBAPP_NAME='
<%=
$comptoir::app_name
%>
'
...
@@ -42,7 +43,6 @@ WEBAPP_TIMEZONE='<%= $comptoir::timezone %>'
...
@@ -42,7 +43,6 @@ WEBAPP_TIMEZONE='<%= $comptoir::timezone %>'
WEBAPP_TRUSTED_HOSTS='
<%=
$comptoir::trusted_hosts
%>
'
WEBAPP_TRUSTED_HOSTS='
<%=
$comptoir::trusted_hosts
%>
'
############ Environment variables not yet managed by Puppet ##########################################################
############ Environment variables not yet managed by Puppet ##########################################################
# WEBAPP_DEFAULT_URI='https://example.org/'
# WEBAPP_SESSION_LIFETIME=3600
# WEBAPP_SESSION_LIFETIME=3600
# WEBAPP_USER_CONFIG_PASSWORD_RESET_TOKEN_LIFETIME=1200
# WEBAPP_USER_CONFIG_PASSWORD_RESET_TOKEN_LIFETIME=1200
# WEBAPP_USER_CONFIG_MIN_PASSWORD_LENGTH=12
# WEBAPP_USER_CONFIG_MIN_PASSWORD_LENGTH=12
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment