|
@@ -36,7 +36,7 @@ while [ -n "$1" ] ; do
|
|
shift
|
|
shift
|
|
done
|
|
done
|
|
|
|
|
|
-#CREATE USER
|
|
|
|
|
|
+
|
|
sudo useradd -m -s $USER_SHELL -d /home/$USER_NAME -G www-data $USER_NAME
|
|
sudo useradd -m -s $USER_SHELL -d /home/$USER_NAME -G www-data $USER_NAME
|
|
echo "$USER_NAME:$PASSWORD"|chpasswd
|
|
echo "$USER_NAME:$PASSWORD"|chpasswd
|
|
sudo chmod o-r /home/$USER_NAME
|
|
sudo chmod o-r /home/$USER_NAME
|
|
@@ -45,7 +45,7 @@ mkdir /home/$USER_NAME/web
|
|
mkdir /home/$USER_NAME/nginx
|
|
mkdir /home/$USER_NAME/nginx
|
|
mkdir /home/$USER_NAME/nginx/log
|
|
mkdir /home/$USER_NAME/nginx/log
|
|
|
|
|
|
-#WELCOME PAGE
|
|
|
|
|
|
+
|
|
if [ $BASE_PATH != "" ]; then
|
|
if [ $BASE_PATH != "" ]; then
|
|
mkdir /home/$USER_NAME/web/$BASE_PATH
|
|
mkdir /home/$USER_NAME/web/$BASE_PATH
|
|
WELCOME=/home/$USER_NAME/web/$BASE_PATH/index.php
|
|
WELCOME=/home/$USER_NAME/web/$BASE_PATH/index.php
|
|
@@ -54,36 +54,69 @@ else
|
|
fi
|
|
fi
|
|
sudo touch $WELCOME
|
|
sudo touch $WELCOME
|
|
sudo cat > "$WELCOME" <<EOF
|
|
sudo cat > "$WELCOME" <<EOF
|
|
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
-<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
|
|
+<!DOCTYPE html>
|
|
|
|
+<html lang="en">
|
|
<head>
|
|
<head>
|
|
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
|
|
+ <meta charset="utf-8">
|
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Coming soon...</title>
|
|
<title>Coming soon...</title>
|
|
- <style type="text/css">
|
|
|
|
- body {
|
|
|
|
|
|
+ <link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">
|
|
|
|
+ <style>
|
|
|
|
+ html, body {
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ color: #636b6f;
|
|
|
|
+ font-family: 'Nunito', sans-serif;
|
|
|
|
+ font-weight: 200;
|
|
|
|
+ height: 100vh;
|
|
|
|
+ margin: 0;
|
|
|
|
+ }
|
|
|
|
+ .full-height {
|
|
|
|
+ height: 100vh;
|
|
|
|
+ }
|
|
|
|
+ .flex-center {
|
|
|
|
+ align-items: center;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ }
|
|
|
|
+ .position-ref {
|
|
|
|
+ position: relative;
|
|
|
|
+ }
|
|
|
|
+ .content {
|
|
text-align: center;
|
|
text-align: center;
|
|
- background: #f0f0f0;
|
|
|
|
- font-family: Arial, Helvetica, sans-serif;
|
|
|
|
- font-size: 48px;
|
|
|
|
- font-weight: bold;
|
|
|
|
}
|
|
}
|
|
- h2.c1 {
|
|
|
|
- margin-top: 60px;
|
|
|
|
- color: #444;
|
|
|
|
- font-size: 32px;
|
|
|
|
- font-weight: lighter;
|
|
|
|
|
|
+ .title {
|
|
|
|
+ font-size: 84px;
|
|
|
|
+ }
|
|
|
|
+ .links > a {
|
|
|
|
+ color: #636b6f;
|
|
|
|
+ padding: 0 25px;
|
|
|
|
+ font-size: 13px;
|
|
|
|
+ font-weight: 600;
|
|
|
|
+ letter-spacing: .1rem;
|
|
|
|
+ text-decoration: none;
|
|
|
|
+ text-transform: uppercase;
|
|
|
|
+ }
|
|
|
|
+ .m-b-md {
|
|
|
|
+ margin-bottom: 30px;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|
|
</head>
|
|
</head>
|
|
<body>
|
|
<body>
|
|
- <h2 class="c1">
|
|
|
|
- Coming soon...
|
|
|
|
- </h2>
|
|
|
|
|
|
+ <div class="flex-center position-ref full-height">
|
|
|
|
+ <div class="content">
|
|
|
|
+ <div class="title m-b-md">
|
|
|
|
+ Coming soon...
|
|
|
|
+ </div>
|
|
|
|
+ <div class="links">
|
|
|
|
+ <a href="https://cipi.sh">Powered by Cipi</a>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</body>
|
|
</body>
|
|
</html>
|
|
</html>
|
|
EOF
|
|
EOF
|
|
|
|
|
|
-#VIRTUAL HOST
|
|
|
|
|
|
+
|
|
NGINX=/etc/nginx/sites-available/$USER_NAME.conf
|
|
NGINX=/etc/nginx/sites-available/$USER_NAME.conf
|
|
wget $REMOTE/sh/hg/$APPCODE/ -O $NGINX
|
|
wget $REMOTE/sh/hg/$APPCODE/ -O $NGINX
|
|
sudo dos2unix $NGINX
|
|
sudo dos2unix $NGINX
|
|
@@ -94,7 +127,7 @@ sudo ln -s $NGINX /etc/nginx/sites-enabled/$USER_NAME.conf
|
|
sudo chown -R www-data: /home/$USER_NAME
|
|
sudo chown -R www-data: /home/$USER_NAME
|
|
sudo systemctl restart nginx.service
|
|
sudo systemctl restart nginx.service
|
|
|
|
|
|
-#MYSQL
|
|
|
|
|
|
+
|
|
DBNAME=$USER_NAME
|
|
DBNAME=$USER_NAME
|
|
DBUSER=$USER_NAME
|
|
DBUSER=$USER_NAME
|
|
/usr/bin/mysql -u root -p$DBROOT <<EOF
|
|
/usr/bin/mysql -u root -p$DBROOT <<EOF
|
|
@@ -104,18 +137,18 @@ GRANT USAGE ON *.* TO '$DBUSER'@'localhost' IDENTIFIED BY '$DBPASS' WITH MAX_QUE
|
|
GRANT ALL PRIVILEGES ON $DBNAME.* TO $DBUSER@'localhost';
|
|
GRANT ALL PRIVILEGES ON $DBNAME.* TO $DBUSER@'localhost';
|
|
EOF
|
|
EOF
|
|
|
|
|
|
-#GIT
|
|
|
|
|
|
+
|
|
sudo mkdir /home/$USER_NAME/git/
|
|
sudo mkdir /home/$USER_NAME/git/
|
|
sudo cp /cipi/github /home/$USER_NAME/git/deploy
|
|
sudo cp /cipi/github /home/$USER_NAME/git/deploy
|
|
sudo cp /cipi/github.pub /home/$USER_NAME/git/deploy.pub
|
|
sudo cp /cipi/github.pub /home/$USER_NAME/git/deploy.pub
|
|
sudo cp /cipi/deploy.sh /home/$USER_NAME/git/deploy.sh
|
|
sudo cp /cipi/deploy.sh /home/$USER_NAME/git/deploy.sh
|
|
sudo rpl -q "###CIPI-USER###" "$USER_NAME" /home/$USER_NAME/git/deploy.sh
|
|
sudo rpl -q "###CIPI-USER###" "$USER_NAME" /home/$USER_NAME/git/deploy.sh
|
|
|
|
|
|
-#PERMISSIONS
|
|
|
|
|
|
+
|
|
sudo chown -R $USER_NAME:$USER_NAME /home/$USER_NAME/git/
|
|
sudo chown -R $USER_NAME:$USER_NAME /home/$USER_NAME/git/
|
|
sudo chown -R $USER_NAME:$USER_NAME /home/$USER_NAME/web/
|
|
sudo chown -R $USER_NAME:$USER_NAME /home/$USER_NAME/web/
|
|
sudo chown -R $USER_NAME:$USER_NAME /home/$USER_NAME
|
|
sudo chown -R $USER_NAME:$USER_NAME /home/$USER_NAME
|
|
|
|
|
|
-#RESUME
|
|
|
|
|
|
+
|
|
clear
|
|
clear
|
|
echo "###CIPI###Ok"
|
|
echo "###CIPI###Ok"
|