Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor 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
mediaserver
envsetup
Commits
e4f054d9
Commit
e4f054d9
authored
7 years ago
by
hmangeart
Browse files
Options
Downloads
Patches
Plain Diff
add some bash set (-ve) # refs 21701
parent
47e90035
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
2.Common_services/7.letsencrypt/0_setup.sh
+6
-3
6 additions, 3 deletions
2.Common_services/7.letsencrypt/0_setup.sh
with
6 additions
and
3 deletions
2.Common_services/7.letsencrypt/0_setup.sh
+
6
−
3
View file @
e4f054d9
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set
-ve
trap
"cp /tmp/{mediaserver-msuser.conf,skyreach.conf,msmonitor.conf} /etc/nginx/sites-available/; nginx -t && service nginx reload; exit 255"
ERR
trap
"cp /tmp/{mediaserver-msuser.conf,skyreach.conf,msmonitor.conf} /etc/nginx/sites-available/; nginx -t && service nginx reload; exit 255"
ERR
source
/root/envsetup/global-conf.sh
source
/root/envsetup/global-conf.sh
LE_DIR
=
"/etc/letsencrypt/live/"
LE_DIR
=
"/etc/letsencrypt/live/"
...
@@ -33,6 +34,8 @@ cp mediaserver-msuser.conf skyreach.conf msmonitor.conf /tmp/
...
@@ -33,6 +34,8 @@ cp mediaserver-msuser.conf skyreach.conf msmonitor.conf /tmp/
# PREPARE LETSENCRYPT REQUEST STRING
# PREPARE LETSENCRYPT REQUEST STRING
# ALTER NGINX CONF TO ACCEPT CLEAR HTTP
# ALTER NGINX CONF TO ACCEPT CLEAR HTTP
# (DEACTIVATE errexit BECAUSE USING FAILING COMMANDS)
set
+e
DOMAIN_STRING
=
"
${
MS_SERVER_NAME
}
"
&&
\
DOMAIN_STRING
=
"
${
MS_SERVER_NAME
}
"
&&
\
sed
-i
s/rewrite/#rewrite/ mediaserver-msuser.conf
sed
-i
s/rewrite/#rewrite/ mediaserver-msuser.conf
[
-n
"
${
CM_SERVER_NAME
}
"
]
&&
\
[
-n
"
${
CM_SERVER_NAME
}
"
]
&&
\
...
@@ -52,13 +55,13 @@ certbot certonly \
...
@@ -52,13 +55,13 @@ certbot certonly \
--webroot
--webroot-path
/tmp/letsencrypt
\
--webroot
--webroot-path
/tmp/letsencrypt
\
--domains
"
${
DOMAIN_STRING
}
"
\
--domains
"
${
DOMAIN_STRING
}
"
\
--email
"
${
EMAIL_ADMINS
}
"
\
--email
"
${
EMAIL_ADMINS
}
"
\
--rsa-key-size
4096
--rsa-key-size
4096
# RE-REDIRECT HTTP to HTTPS
# RE-REDIRECT HTTP to HTTPS
sed
-i
s/#rewrite/rewrite/ mediaserver-msuser.conf skyreach.conf msmonitor.conf
sed
-i
s/#rewrite/rewrite/ mediaserver-msuser.conf skyreach.conf msmonitor.conf
# CHECK CERTS PRESENCE & EDIT NGINX CONFIG
# CHECK CERTS PRESENCE & EDIT NGINX CONFIG
# (DEACTIVATE errexit BECAUSE USING FAILING COMMANDS)
set
+e
set
+e
[
-f
${
LE_DIR
}
/
${
MS_SERVER_NAME
}
/fullchain.pem
]
&&
\
[
-f
${
LE_DIR
}
/
${
MS_SERVER_NAME
}
/fullchain.pem
]
&&
\
sed
-i
s/#ssl_certificate/ssl_certificate/g mediaserver-msuser.conf
sed
-i
s/#ssl_certificate/ssl_certificate/g mediaserver-msuser.conf
...
@@ -73,4 +76,4 @@ set +e
...
@@ -73,4 +76,4 @@ set +e
nginx
-t
&&
\
nginx
-t
&&
\
service nginx reload
service nginx reload
rm
/tmp/
{
mediaserver-msuser.conf,skyreach.conf,msmonitor.conf
}
rm
/tmp/
{
mediaserver-msuser.conf,skyreach.conf,msmonitor.conf
}
cd
-
cd
-
\ No newline at end of file
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