Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
Context Sensitive Group
freedombone
Commits
6ec1758f
Commit
6ec1758f
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Dovecot uses default certificate
parent
43c5e1dd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/freedombone-app-xmpp
+15
-23
15 additions, 23 deletions
src/freedombone-app-xmpp
src/freedombone-base-email
+31
-11
31 additions, 11 deletions
src/freedombone-base-email
with
46 additions
and
34 deletions
src/freedombone-app-xmpp
+
15
−
23
View file @
6ec1758f
...
...
@@ -309,10 +309,12 @@ function install_xmpp_main {
return
fi
# obtain a cert for the default domain
if
[[
$(
cert_exists
${
DEFAULT_DOMAIN_NAME
}
pem
)
==
"0"
]]
;
then
echo
$'Obtaining certificate for the main domain'
create_site_certificate
${
DEFAULT_DOMAIN_NAME
}
'yes'
if
[[
$ONION_ONLY
==
'no'
]]
;
then
# obtain a cert for the default domain
if
[[
$(
cert_exists
${
DEFAULT_DOMAIN_NAME
}
pem
)
==
"0"
]]
;
then
echo
$'Obtaining certificate for the main domain'
create_site_certificate
${
DEFAULT_DOMAIN_NAME
}
'yes'
fi
fi
apt-get
-yq
install
lua-sec lua-bitop
...
...
@@ -340,29 +342,19 @@ function install_xmpp_main {
# create a certificate
if
[[
$(
cert_exists
${
DEFAULT_DOMAIN_NAME
}
pem
)
==
"0"
]]
;
then
if
[[
$(
cert_exists
${
DEFAULT_DOMAIN_NAME
}
xmpp
)
==
"0"
]]
;
then
if
[[
$(
cert_exists xmpp
)
==
"0"
]]
;
then
${
PROJECT_NAME
}
-addcert
-h
xmpp
--dhkey
${
DH_KEYLENGTH
}
check_certificates xmpp
fi
fi
if
[
-f
/etc/ssl/private/xmpp.key
]
;
then
chown
prosody:prosody /etc/ssl/private/xmpp.key
fi
if
[
-f
/etc/ssl/certs/xmpp.crt
]
;
then
chown
prosody:prosody /etc/ssl/certs/xmpp.crt
fi
if
[
-f
/etc/ssl/certs/xmpp.dhparam
]
;
then
chown
prosody:prosody /etc/ssl/certs/xmpp.dhparam
fi
if
[
-f
/etc/ssl/private/
${
DEFAULT_DOMAIN_NAME
}
.key
]
;
then
chown
prosody:prosody /etc/ssl/private/
${
DEFAULT_DOMAIN_NAME
}
.key
fi
if
[
-f
/etc/ssl/certs/
${
DEFAULT_DOMAIN_NAME
}
.pem
]
;
then
chown
prosody:prosody /etc/ssl/certs/
${
DEFAULT_DOMAIN_NAME
}
.pem
fi
if
[
-f
/etc/ssl/certs/
${
DEFAULT_DOMAIN_NAME
}
.dhparam
]
;
then
chown
prosody:prosody /etc/ssl/certs/
${
DEFAULT_DOMAIN_NAME
}
.dhparam
fi
groupadd default
usermod
-g
default prosody
chown
root:default /etc/ssl/private/xmpp.
*
chown
root:default /etc/ssl/certs/xmpp.
*
chown
root:default /etc/ssl/private/
${
DEFAULT_DOMAIN_NAME
}
.
*
chown
root:default /etc/ssl/certs/
${
DEFAULT_DOMAIN_NAME
}
.
*
cp
-a
/etc/prosody/conf.avail/example.com.cfg.lua /etc/prosody/conf.avail/xmpp.cfg.lua
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-base-email
+
31
−
11
View file @
6ec1758f
...
...
@@ -1218,24 +1218,44 @@ function configure_imap {
exit
48
fi
if
[
!
-f
/etc/ssl/certs/dovecot.dhparam
]
;
then
${
PROJECT_NAME
}
-addcert
-h
dovecot
--dhkey
$DH_KEYLENGTH
check_certificates dovecot
if
[[
$ONION_ONLY
==
'no'
]]
;
then
# obtain a cert for the default domain
if
[[
$(
cert_exists
${
DEFAULT_DOMAIN_NAME
}
pem
)
==
"0"
]]
;
then
echo
$'Obtaining certificate for the main domain'
create_site_certificate
${
DEFAULT_DOMAIN_NAME
}
'yes'
fi
fi
if
[[
$(
cert_exists
${
DEFAULT_DOMAIN_NAME
}
pem
)
==
"0"
]]
;
then
if
[[
$(
cert_exists dovecot
)
==
"0"
]]
;
then
${
PROJECT_NAME
}
-addcert
-h
dovecot
--dhkey
$DH_KEYLENGTH
check_certificates dovecot
fi
fi
chown
root:dovecot /etc/ssl/certs/dovecot.
*
chown
root:dovecot /etc/ssl/private/dovecot.
*
groupadd default
usermod
-g
default dovecot
chown
root:default /etc/ssl/certs/dovecot.
*
chown
root:default /etc/ssl/private/dovecot.
*
chown
root:default /etc/ssl/certs/
${
DEFAULT_DOMAIN_NAME
}
.
*
chown
root:default /etc/ssl/private/
${
DEFAULT_DOMAIN_NAME
}
.
*
if
[
!
-f
/etc/dovecot/conf.d/10-ssl.conf
]
;
then
echo
$'Unable to find /etc/dovecot/conf.d/10-ssl.conf'
exit
83629
fi
sed
-i
's|#ssl =.*|ssl = required|g'
/etc/dovecot/conf.d/10-ssl.conf
sed
-i
's|ssl = no|ssl = required|g'
/etc/dovecot/conf.d/10-ssl.conf
sed
-i
's|ssl = yes|ssl = required|g'
/etc/dovecot/conf.d/10-ssl.conf
sed
-i
's|#ssl_cert =.*|ssl_cert = </etc/ssl/certs/dovecot.crt|g'
/etc/dovecot/conf.d/10-ssl.conf
sed
-i
's|ssl_cert =.*|ssl_cert = </etc/ssl/certs/dovecot.crt|g'
/etc/dovecot/conf.d/10-ssl.conf
sed
-i
's|#ssl_key =.*|ssl_key = </etc/ssl/private/dovecot.key|g'
/etc/dovecot/conf.d/10-ssl.conf
sed
-i
's|ssl_key =.*|ssl_key = </etc/ssl/private/dovecot.key|g'
/etc/dovecot/conf.d/10-ssl.conf
sed
-i
's|ssl =.*|ssl = required|g'
/etc/dovecot/conf.d/10-ssl.conf
if
[[
$(
cert_exists
${
DEFAULT_DOMAIN_NAME
}
pem
)
==
"1"
]]
;
then
sed
-i
"s|#ssl_cert =.*|ssl_cert = </etc/ssl/certs/
${
DEFAULT_DOMAIN_NAME
}
.pem|g"
/etc/dovecot/conf.d/10-ssl.conf
sed
-i
"s|ssl_cert =.*|ssl_cert = </etc/ssl/certs/
${
DEFAULT_DOMAIN_NAME
}
.pem|g"
/etc/dovecot/conf.d/10-ssl.conf
else
sed
-i
"s|#ssl_cert =.*|ssl_cert = </etc/ssl/certs/
${
DEFAULT_DOMAIN_NAME
}
.crt|g"
/etc/dovecot/conf.d/10-ssl.conf
sed
-i
"s|ssl_cert =.*|ssl_cert = </etc/ssl/certs/
${
DEFAULT_DOMAIN_NAME
}
.crt|g"
/etc/dovecot/conf.d/10-ssl.conf
fi
sed
-i
"s|#ssl_key =.*|ssl_key = </etc/ssl/private/
${
DEFAULT_DOMAIN_NAME
}
.key|g"
/etc/dovecot/conf.d/10-ssl.conf
sed
-i
"s|ssl_key =.*|ssl_key = </etc/ssl/private/
${
DEFAULT_DOMAIN_NAME
}
.key|g"
/etc/dovecot/conf.d/10-ssl.conf
sed
-i
's|#ssl_dh_parameters_length.*|ssl_dh_parameters_length = 2048|g'
/etc/dovecot/conf.d/10-ssl.conf
sed
-i
's/#ssl_prefer_server_ciphers.*/ssl_prefer_server_ciphers = yes/g'
/etc/dovecot/conf.d/10-ssl.conf
sed
-i
"s|#ssl_protocols =.*|ssl_protocols = '
$SSL_PROTOCOLS
'|g"
/etc/dovecot/conf.d/10-ssl.conf
...
...
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