Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F36730
run-login
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
dereckson
May 22 2016, 20:27
2016-05-22 20:27:13 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
run-login
View Options
#!/bin/sh
# -------------------------------------------------------------
# Auth Grove
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Author: Sébastien Santoro aka Dereckson
# Project: Nasqueron
# Created: 2016-05-21
# Description: SSO for Nasqueron services.
# Image: nasqueron/auth-grove
# Services used: MySQL server (acquisitariat)
# Docker volume (/data/notifications/storage)
# -------------------------------------------------------------
# -------------------------------------------------------------
# Container parameters
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
INSTANCE_NAME
=
login
PORT
=
25080
MYSQL_INSTANCE
=
acquisitariat
STORAGE
=
/data/login/storage
CANONICAL_URL
=
http://login.nasqueron.org
# -------------------------------------------------------------
# Database parameters
#
# Get credentials from zr
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MYSQL_HOST
=
mysql
MYSQL_USER
=
`
ssh -4 -i /root/.ssh/id_zr zr@ysul.nasqueron.org getcredentials
67
username
`
MYSQL_PASS
=
`
ssh -4 -i /root/.ssh/id_zr zr@ysul.nasqueron.org getcredentials
67
`
MYSQL_DB
=
$INSTANCE_NAME
# -------------------------------------------------------------
# Run the container
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Checks container isn't running
docker-container-status
$INSTANCE_NAME
> /dev/null
if
[
"
$?
"
-lt
2
]
;
then
echo
"Container is already running."
echo
"To force relaunch, try docker stop
$INSTANCE_NAME
; docker rm
$INSTANCE_NAME
;
$0
"
exit
1
fi
mkdir -p
$STORAGE
chcon -Rt svirt_sandbox_file_t
$STORAGE
chown
431
:433
$STORAGE
docker run -t -d
\
--link
$MYSQL_INSTANCE
:
$MYSQL_HOST
\
-p
$PORT
:80
\
-e
DB_HOST
=
$MYSQL_HOST
\
-e
DB_DATABASE
=
$MYSQL_DB
\
-e
DB_USERNAME
=
$MYSQL_USER
\
-e
DB_PASSWORD
=
$MYSQL_PASS
\
-e
CANONICAL_URL
=
"
$CANONICAL_URL
"
\
--name
$INSTANCE_NAME
nasqueron/auth-grove
echo
"Deployment done at `date`."
exit
0
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33429
Default Alt Text
run-login (1 KB)
Attached To
Mode
P194 run-login
Attached
Detach File
Event Timeline
Log In to Comment