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
c068d9ca
Commit
c068d9ca
authored
6 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Add tls to exim config
parent
915c1ac9
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-base-email
+56
-0
56 additions, 0 deletions
src/freedombone-base-email
src/freedombone-upgrade
+1
-0
1 addition, 0 deletions
src/freedombone-upgrade
with
57 additions
and
0 deletions
src/freedombone-base-email
+
56
−
0
View file @
c068d9ca
...
...
@@ -1760,6 +1760,61 @@ function populate_keyservers {
done
}
function
exim_enable_tls
{
read_config_param ONION_ONLY
# TLS only applies on the clearnet
if
[[
"
$ONION_ONLY
"
!=
'no'
]]
;
then
return
fi
# don't conflict with web UI
if
[[
"
$(
hostname
)
"
==
*
'.local'
]]
;
then
return
fi
# check that cert exists
if
[
!
-f
"/etc/letsencrypt/live/
$(
hostname
)
/fullchain.pem"
]
;
then
# try to create a letsencrypt cert
if
[
!
-d
"/var/www/
$(
hostname
)
/htdocs"
]
;
then
mkdir
"/var/www/
$(
hostname
)
/htdocs"
fi
DH_KEYLENGTH
=
2048
LETSENCRYPT_SERVER
=
'https://acme-v01.api.letsencrypt.org/directory'
"
${
PROJECT_NAME
}
-addcert"
-e
"
$(
hostname
)
"
-s
"
$LETSENCRYPT_SERVER
"
--dhkey
"
$DH_KEYLENGTH
"
# does the cert exist ?
if
[
!
-f
"/etc/letsencrypt/live/
$(
hostname
)
/fullchain.pem"
]
;
then
return
fi
fi
if
[
!
-f
"/etc/letsencrypt/live/
$(
hostname
)
/privkey.pem"
]
;
then
return
fi
exim_tls_config_file
=
/etc/exim4/conf.d/main/03_exim4-config_tlsoptions
# enable TLS in exim
if
!
grep
-q
"MAIN_TLS_ENABLE ="
$exim_tls_config_file
;
then
sed
-i
'/.ifdef MAIN_TLS_ENABLE/i MAIN_TLS_ENABLE = yes'
$exim_tls_config_file
else
sed
-i
's|MAIN_TLS_ENABLE =.*|MAIN_TLS_ENABLE = yes|g'
$exim_tls_config_file
fi
# add TLS private key in exim
if
!
grep
-q
'MAIN_TLS_PRIVATEKEY = /etc/letsencrypt'
$exim_tls_config_file
;
then
sed
-i
"/MAIN_TLS_ENABLE =/a MAIN_TLS_PRIVATEKEY = /etc/letsencrypt/live/
$(
hostname
)
/privkey.pem"
$exim_tls_config_file
else
sed
-i
"s|MAIN_TLS_PRIVATEKEY = /etc/letsencrypt.*|MAIN_TLS_PRIVATEKEY = /etc/letsencrypt/live/
$(
hostname
)
/privkey.pem|g"
$exim_tls_config_file
fi
# add TLS public key in exim
if
!
grep
-q
'MAIN_TLS_CERTIFICATE = /etc/letsencrypt'
$exim_tls_config_file
;
then
sed
-i
"/MAIN_TLS_ENABLE =/a MAIN_TLS_CERTIFICATE = /etc/letsencrypt/live/
$(
hostname
)
/fullchain.pem"
$exim_tls_config_file
else
sed
-i
"s|MAIN_TLS_CERTIFICATE = /etc/letsencrypt.*|MAIN_TLS_CERTIFICATE = /etc/letsencrypt/live/
$(
hostname
)
/fullchain.pem|g"
$exim_tls_config_file
fi
}
function
install_email
{
if
[[
$SYSTEM_TYPE
==
"mesh"
*
]]
;
then
return
...
...
@@ -1773,6 +1828,7 @@ function install_email {
install_email_basic
configure_email_onion
prevent_mail_process_overrun
exim_enable_tls
mark_completed
"
${
FUNCNAME
[0]
}
"
}
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-upgrade
+
1
−
0
View file @
c068d9ca
...
...
@@ -139,6 +139,7 @@ if [ -d "$PROJECT_DIR" ]; then
#rebuild_exim_with_socks
install_dynamicdns
torrc_migrate
exim_enable_tls
add_xmpp_onion_to_email
nodejs_upgrade
$INSTALL_PACKAGES_BACKPORTS
certbot
...
...
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