From 735831aa8a220f890f00e84f93c600c5069f2dc6 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Wed, 4 Aug 2021 20:32:01 +0700 Subject: [PATCH] Put builtin tools here --- .gitignore | 3 +++ init.sh | 24 ++++++++++++++++++++++++ init_nginx.conf | 14 ++++++++++++++ src/iptables/whitelist.conf | 1 + 4 files changed, 42 insertions(+) create mode 100644 init.sh create mode 100644 init_nginx.conf diff --git a/.gitignore b/.gitignore index 099f448..52e0da7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ nginx.ori.conf test.php a.txt .vscode +/phpmyadmin +/phppgadmin +/webssh diff --git a/init.sh b/init.sh new file mode 100644 index 0000000..5933c93 --- /dev/null +++ b/init.sh @@ -0,0 +1,24 @@ +if [ ! -d "./phpmyadmin" ]; then + git clone https://github.com/phpmyadmin/phpmyadmin.git phpmyadmin -b STABLE --depth 1 + cd ./phpmyadmin + composer install --no-dev + yarn install --production + cp config.sample.inc.php config.inc.php + hash=`node -e "console.log(require('crypto').randomBytes(16).toString('hex'))"` + sed -ri "s/\['blowfish_secret'\] = '';/['blowfish_secret'] = '${hash}';/g" config.inc.php + cd .. +fi +if [ ! -d "./phppgadmin" ]; then + git clone https://github.com/phppgadmin/phppgadmin.git phppgadmin --depth 1 + cd ./phppgadmin + cp conf/config.inc.php-dist conf/config.inc.php + cd .. +fi +if [ ! -d "./webssh" ]; then + git clone https://github.com/huashengdun/webssh.git webssh --depth 1 + cd ./webssh + pip install --user -r requirements.txt + cd .. +fi + + diff --git a/init_nginx.conf b/init_nginx.conf new file mode 100644 index 0000000..142d0d0 --- /dev/null +++ b/init_nginx.conf @@ -0,0 +1,14 @@ +server { + root ~/public_html/public; + location /phpmyadmin/ { + alias ~/public_html/phpmyadmin/; + } + location /phppgadmin/ { + alias ~/public_html/phppgadmin/; + } + location /webssh/ { + alias ~/public_html/webssh/public/; + passenger_enabled on; + passenger_app_start_command 'python run.py --port=$PORT'; + } +} \ No newline at end of file diff --git a/src/iptables/whitelist.conf b/src/iptables/whitelist.conf index dcee14f..d38dff2 100644 --- a/src/iptables/whitelist.conf +++ b/src/iptables/whitelist.conf @@ -26,6 +26,7 @@ packagist.org nodejs.org nodesource.com registry.npmjs.org +registry.yarnpkg.com # Pip/Python pypi.org pypi.python.org