prepare to work with uberspace-webadmin

This commit is contained in:
2015-07-10 22:59:44 +03:00
parent 635513411c
commit ff32bd9ea2
2 changed files with 68 additions and 25 deletions

View File

@@ -1,52 +1,69 @@
## DOMAIN ## > DOMAIN
Domain: SEDDOMAIN Domain: SEDDOMAIN
IP Address: SEDIP IP Address: SEDIP
## < DOMAIN
## WEBPANEL ## > WEBPANEL
https://uberspace.de/login https://uberspace.de/login
User: SEDUSER User: SEDUSER
Pass: SEDSSHPASS Pass: SEDSSHPASS
## SSH ## < WEBPANEL
## > SSH
Server: SEDHOSTNAME Server: SEDHOSTNAME
User: SEDUSER User: SEDUSER
Pass: SEDSSHPASS Pass: SEDSSHPASS
## < SSH
## SFTP ## > SFTP
Server: SEDHOSTNAME Server: SEDHOSTNAME
User: SEDUSER User: SEDUSER
Pass: SEDSSHPASS Pass: SEDSSHPASS
## MYSQL ## < SFTP
## > MYSQL
PHPMyAdmin: https://pma.SEDHOSTNAME
Host: localhost Host: localhost
DB: SEDUSER DB: SEDUSER
User: SEDUSER User: SEDUSER
Pass: SEDMYSQLPASS Pass: SEDMYSQLPASS
## WORDPRESS ## < MYSQL
## > WORDPRESS
## MAIL ## < WORDPRESS
Webmail: webmail.SEDDOMAIN ## > EMAIL
Webmail: https://webmail.SEDDOMAIN
# Receive # Receive
Typ: IMAP Type: IMAP
Server: SEDDOMAIN Server: SEDDOMAIN
Port: 143 Port: 143
STARTTLS / Password, normal STARTTLS / Password, normal
# Send # Send
Typ: SMTP Type: SMTP
Server: SEDDOMAIN Server: SEDDOMAIN
Port: 587 Port: 587
STARTTLS / Password, normal STARTTLS / Password, normal
SMTP server requires authentication SMTP server requires authentication
User:
Pass:
User: User:
Pass: Pass:
User: ## < EMAIL
Pass:
## DO NOT DELETE

View File

@@ -36,6 +36,7 @@ if [ "$MYSQLPASS" == "" ]; then
fi fi
read -p "Domain: " DOMAIN read -p "Domain: " DOMAIN
read -p "SSH Passwort: " SSHPASS
IP=$(wget -q -O - http://ip4.nandus.net) IP=$(wget -q -O - http://ip4.nandus.net)
echo "User: $USER" # user in system echo "User: $USER" # user in system
@@ -45,7 +46,8 @@ echo "Server: $SERVER" # e.g. cetus
echo "Domain: $DOMAIN" echo "Domain: $DOMAIN"
echo "IP: $IP" echo "IP: $IP"
echo "Virtualdir: $VIRTUAL" echo "Virtualdir: $VIRTUAL"
echo "MySQL-Passwort: $MYSQLPASS" echo "MySQL Password: $MYSQLPASS"
echo "SSH Password: $SSHPASS"
echo "" echo ""
read -p "All correct? If not, cancel now." END read -p "All correct? If not, cancel now." END
@@ -58,31 +60,55 @@ uberspace-add-domain -d $DOMAIN -m
# Setup basic directories # Setup basic directories
mkdir ~/backup mkdir ~/backup
mkdir -p ~/bin ~/lib/python2.4 ~/lib/python2.6
# Setup softlinks # Setup softlinks
ln -s $VIRTUAL ~/virtual ln -s $VIRTUAL ~/virtual
# Mail
vsetup
# Webmail # Webmail
mkdir $VIRTUAL/webmail.$DOMAIN mkdir $VIRTUAL/webmail.$DOMAIN
echo "RedirectPermanent / https://webmail.$HOSTNAME" > $VIRTUAL/webmail.$DOMAIN/.htaccess echo "RedirectPermanent / https://webmail.$HOSTNAME" > $VIRTUAL/webmail.$DOMAIN/.htaccess
# Web administration panel
read -p "Should the web administration panel be installed? [y/N] " YN
if [ "$YN" == "y" ]; then
SENDMAILPATH=$(which sendmail)
read -p "TO which email should reports be sent?" TOEMAIL
read -p "FROM which email should reports be sent?" FREMAIL
git clone http://src.mehl.mx/git/uberspace-webadmin.git $VIRTUAL/panel.$DOMAIN
# Create and edit config.cfg
cp $VIRTUAL/panel.$DOMAIN/config.cfg.sample $VIRTUAL/panel.$DOMAIN/config.cfg
sed -r -i \
-e "s|DOMAIN=.*|DOMAIN=$DOMAIN|" \
-e "s|TOEMAIL=.*|DOMAIN=$DOMAIN|" \
-e "s|FREMAIL=.*|DOMAIN=$DOMAIN|" \
-e "s|SENDMAILPATH=.*|DOMAIN=$DOMAIN|" \
$VIRTUAL/panel.$DOMAIN/config.cfg
# Set htaccess and htpasswd
cp $VIRTUAL/panel.$DOMAIN/.htaccess.sample $VIRTUAL/panel.$DOMAIN/.htaccess
sed -r -i \
-e "s|AuthUserFile.*|AuthUserFile $VIRTUAL/panel.$DOMAIN/.htpasswd|" \
$VIRTUAL/panel.$DOMAIN/.htaccess
htpasswd -b -c $VIRTUAL/panel.$DOMAIN/.htpasswd $USER $SSHPASS
# Install dependencies
easy_install pexpect
fi
# Create datasheet # Create datasheet
DOMAIN=$DOMAIN
USER=$USER
HOSTNAME=$HOSTNAME
MYSQLPASS=$MYSQLPASS
SSHPASS=
read -p "SSH Passwort: " SSHPASS
sed -e 's/SEDDOMAIN/'$DOMAIN'/g' \ sed -e 's/SEDDOMAIN/'$DOMAIN'/g' \
-e 's/SEDIP/'$IP'/g' \ -e 's/SEDIP/'$IP'/g' \
-e 's/SEDUSER/'$USER'/g' \ -e 's/SEDUSER/'$USER'/g' \
-e 's/SEDHOSTNAME/'$HOSTNAME'/g' \ -e 's/SEDHOSTNAME/'$HOSTNAME'/g' \
-e 's/SEDMYSQLPASS/'$MYSQLPASS'/g' \ -e 's/SEDMYSQLPASS/'$MYSQLPASS'/g' \
-e 's/SEDSSHPASS/'$SSHPASS'/g' \ -e 's/SEDSSHPASS/'$SSHPASS'/g' \
uber-datenblatt-template.txt > $USER-Notes.txt uber-datenblatt-template.txt > $HOME/$USER-Notes.txt