├── .gitignore ├── LICENSE.md ├── README.md ├── bin ├── app-details ├── backup-site ├── cache-status ├── clean-wp-site ├── clear-cache ├── create-app-user ├── create-filezilla-link ├── create-httpasswd-user ├── create-jail-user ├── create-linux-user ├── create-monitor ├── create-mysql-db ├── create-postgres-db ├── create-redis-user ├── create-reverseproxy-app ├── create-site-angular ├── create-site-hostname ├── create-site-joomla ├── create-site-magento ├── create-site-node ├── create-site-php ├── create-site-python ├── create-site-react ├── create-site-svelte ├── create-site-vue ├── create-ssh-key ├── create-user-mysql-db ├── create-wp-user ├── delete-app ├── delete-backup ├── delete-monitor ├── delete-mysql-db ├── delete-site ├── delete-wp-plugin ├── disable-app ├── disable-app-ssl ├── disable-cache ├── disable-ramdisk ├── disable-site ├── disable-ssl ├── edit-nginx-vhost ├── edit-php-fpm-pool ├── enable-app ├── enable-app-ssl ├── enable-cache ├── enable-ramdisk ├── enable-site ├── enable-ssl ├── enter-site ├── enter-site-sudo ├── fix-app-permissions ├── fix-permissions ├── fix-user-permissions ├── install-django ├── install-horizon ├── install-hostname-ssl ├── install-nvm ├── install-scheduler ├── install-wp ├── install-wp-plugin ├── iops-benchmark ├── iops-stats ├── jail-binary ├── jail-user ├── list-apps ├── list-backups ├── list-sites ├── logrotate-site ├── mount-site ├── mysql-stats ├── nvm-user ├── ramdisk-status ├── reset-user-mysql ├── restart-php-fpm-pool ├── restart-site ├── restore-site ├── set-env-param ├── site-details ├── site-info ├── site-status ├── slack-notification ├── toggle-node ├── toggle-php ├── toggle-python ├── update-bash-completion ├── update-jail ├── update-lemp ├── update-lemp-repo ├── vscode-app ├── vscode-site-old ├── vscode-site-ssh └── wp-users ├── includes └── helpers.sh ├── install.sh ├── installers ├── adminer.sh ├── amavisd.sh ├── backup.sh ├── clamav.sh ├── composer.sh ├── cron.sh ├── dkim.sh ├── docker.sh ├── dovecot.sh ├── elk.sh ├── fail2ban.sh ├── glitchtip.sh ├── hostname.sh ├── jailkit.sh ├── java.sh ├── jenkins.sh ├── kafka.sh ├── kernel.sh ├── mailhog.sh ├── mailserver.sh ├── meilisearch.sh ├── mongodb.sh ├── mongodb_express.sh ├── monit.sh ├── mysql.sh ├── netdata.sh ├── nginx.sh ├── nvm.sh ├── openldap.sh ├── openresty.sh ├── pgadmin.sh ├── php.sh ├── phpmyadmin.sh ├── phppgadmin.sh ├── postfix.sh ├── postfixadmin.sh ├── postgres.sh ├── prereq.sh ├── proftpd.sh ├── python.sh ├── rabbitmq.sh ├── ramdisk.sh ├── redis.sh ├── rkhunter.sh ├── roundcube.sh ├── scripts.sh ├── sentry.sh ├── shellinabox.sh ├── sogogroupware.sh ├── ssh.sh ├── ssl.sh ├── supervisor.sh ├── ufw.sh └── zabbix.sh ├── templates ├── adminer │ ├── adminer.css │ ├── index.php │ ├── php.conf │ ├── plugins │ │ ├── css.php │ │ ├── login-servers.php │ │ └── plugin.php │ └── vhost.conf ├── cron │ ├── backup-sites │ ├── certbot │ ├── lemp │ └── mailserver ├── dkim │ ├── opendkim │ └── opendkim.conf ├── dovecot │ ├── conf.d │ │ ├── 10-auth.conf │ │ ├── 10-mail.conf │ │ ├── 10-master.conf │ │ ├── 10-ssl.conf │ │ └── 15-mailboxes.conf │ ├── dovecot-sql.conf.ext │ └── dovecot.conf ├── elasticsearch │ └── elasticsearch.yml ├── filebeat │ └── filebeat.yml ├── glitchtip │ ├── .env │ ├── docker-compose.yml │ ├── glitchtip.service │ └── vhost.conf ├── jailed_ssh │ ├── .bashrc │ └── .profile ├── jailkit │ ├── bin │ │ ├── clear-cache │ │ ├── delete-wp-plugin │ │ ├── disable-cache │ │ ├── enable-cache │ │ ├── toggle-node │ │ ├── toggle-php │ │ ├── toggle-python │ │ └── wp-users │ └── jk_init.ini ├── jenkins │ ├── basic-security.groovy │ ├── config.xml │ ├── jenkins.service │ └── vhost.conf ├── kafka │ ├── kafka.service │ └── zookeeper.service ├── kernel │ └── sysctl.conf ├── kibana │ ├── kibana.yml │ └── vhost.conf ├── letsencrypt │ ├── options-ssl-nginx.conf │ ├── renewal-hooks │ │ └── deploy │ │ │ ├── reload-dovecot.sh │ │ │ └── reload-nginx.sh │ └── ssl-dhparams.pem ├── logrotate │ └── site.conf ├── logstash │ └── conf.d │ │ ├── 02-beats-input.conf │ │ └── 30-elasticsearch-output.conf ├── mailhog │ └── vhost.conf ├── meilisearch │ └── meilisearch.service ├── mongodb │ └── mongodb.conf ├── mongodb_express │ ├── config.js │ ├── mongodb_express.service │ └── vhost.conf ├── monit │ ├── alert.sh │ ├── cron.conf │ ├── diskspace.conf │ ├── monitrc │ ├── mysql.conf │ ├── nginx.conf │ ├── php-fpm │ │ ├── 5.6.conf │ │ ├── 7.0.conf │ │ ├── 7.1.conf │ │ ├── 7.2.conf │ │ ├── 7.3.conf │ │ ├── 7.4.conf │ │ ├── 8.0.conf │ │ ├── 8.1.conf │ │ └── 8.2.conf │ ├── site.conf │ ├── slack.sh │ ├── ssh.conf │ ├── system.conf │ └── vhost.conf ├── mysql │ └── 10-lemp.cnf ├── netdata │ ├── netdata.conf │ └── vhost.conf ├── nginx │ ├── angular │ │ └── vhost.conf │ ├── basic │ │ └── vhost.conf │ ├── hostname │ │ └── vhost.conf │ ├── htpasswd │ ├── htpasswd.users │ ├── laravel-vhost.conf │ ├── nginx.conf │ ├── node │ │ └── vhost.conf │ ├── performance.conf │ ├── php │ │ └── vhost.conf │ ├── proxypass.conf │ ├── python │ │ └── vhost.conf │ ├── react │ │ └── vhost.conf │ ├── svelte │ │ └── vhost.conf │ ├── vue │ │ └── vhost.conf │ └── wordpress-vhost.conf ├── openresty │ ├── nginx-openresty.service │ ├── nginx.conf │ └── working-vhost.conf ├── owncloud │ └── vhost.site ├── pgadmin │ ├── config_local.py │ ├── pgadmin.service │ └── vhost.conf ├── php │ └── template.tpl ├── phpmyadmin │ ├── config.inc.php │ ├── php.conf │ └── vhost.conf ├── postfix │ ├── main.cf │ ├── master.cf │ └── sql │ │ ├── mysql_virtual_alias_domain_catchall_maps.cf │ │ ├── mysql_virtual_alias_domain_mailbox_maps.cf │ │ ├── mysql_virtual_alias_domain_maps.cf │ │ ├── mysql_virtual_alias_maps.cf │ │ ├── mysql_virtual_domains_maps.cf │ │ └── mysql_virtual_mailbox_maps.cf ├── postfixadmin │ ├── config.local.php │ ├── mysql.sql │ ├── php.conf │ └── vhost.conf ├── rabbitmq │ └── vhost.conf ├── redis │ └── redis.conf ├── reverseproxy │ └── vhost.conf ├── rkhunter │ └── rkhunter.conf ├── roundcube │ ├── config.inc.php │ ├── mysql.sql │ ├── php.conf │ └── vhost.conf ├── sentry │ └── vhost.conf ├── shellinabox │ ├── shellinabox │ ├── shellinabox.service │ └── vhost.conf ├── ssh │ ├── .bashrc │ ├── .profile │ ├── bash_completion.d │ │ └── lemp_installer │ └── sshd_config ├── supervisor │ └── horizon.conf ├── systemd │ ├── mailhog.service │ ├── node-site.service │ └── python-site.service ├── www │ ├── angular │ │ ├── .browserslistrc │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── .vscode │ │ │ ├── extensions.json │ │ │ ├── launch.json │ │ │ └── tasks.json │ │ ├── README.md │ │ ├── angular.json │ │ ├── dist │ │ │ ├── 3rdpartylicenses.txt │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ ├── main.d202c08d40858e04.js │ │ │ ├── polyfills.f04764812ed2518a.js │ │ │ ├── runtime.231e96734c9fdc57.js │ │ │ └── styles.ef46db3751d8e999.css │ │ ├── karma.conf.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── src │ │ │ ├── app │ │ │ │ ├── app-routing.module.ts │ │ │ │ ├── app.component.html │ │ │ │ ├── app.component.sass │ │ │ │ ├── app.component.spec.ts │ │ │ │ ├── app.component.ts │ │ │ │ └── app.module.ts │ │ │ ├── assets │ │ │ │ └── .gitkeep │ │ │ ├── environments │ │ │ │ ├── environment.prod.ts │ │ │ │ └── environment.ts │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ ├── main.ts │ │ │ ├── polyfills.ts │ │ │ ├── styles.sass │ │ │ └── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.json │ │ └── tsconfig.spec.json │ ├── default_site │ │ ├── .editorconfig │ │ ├── .env.example │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── .styleci.yml │ │ ├── README.md │ │ ├── app │ │ │ ├── Console │ │ │ │ ├── Commands │ │ │ │ │ └── FilezillaDownloadLinkGenerator.php │ │ │ │ └── Kernel.php │ │ │ ├── Exceptions │ │ │ │ └── Handler.php │ │ │ ├── Http │ │ │ │ ├── Controllers │ │ │ │ │ ├── BackupController.php │ │ │ │ │ ├── Controller.php │ │ │ │ │ └── FileZillaController.php │ │ │ │ ├── Kernel.php │ │ │ │ ├── Middleware │ │ │ │ │ ├── Authenticate.php │ │ │ │ │ ├── EncryptCookies.php │ │ │ │ │ ├── PreventRequestsDuringMaintenance.php │ │ │ │ │ ├── RedirectIfAuthenticated.php │ │ │ │ │ ├── TrimStrings.php │ │ │ │ │ ├── TrustHosts.php │ │ │ │ │ ├── TrustProxies.php │ │ │ │ │ └── VerifyCsrfToken.php │ │ │ │ └── Requests │ │ │ │ │ └── FileZilla.php │ │ │ ├── Models │ │ │ │ └── User.php │ │ │ ├── Providers │ │ │ │ ├── AppServiceProvider.php │ │ │ │ ├── AuthServiceProvider.php │ │ │ │ ├── BroadcastServiceProvider.php │ │ │ │ ├── EventServiceProvider.php │ │ │ │ └── RouteServiceProvider.php │ │ │ ├── Services │ │ │ │ ├── Backup.php │ │ │ │ ├── BaseService.php │ │ │ │ └── Filezilla.php │ │ │ └── Traits │ │ │ │ └── Cache.php │ │ ├── artisan │ │ ├── bootstrap │ │ │ ├── app.php │ │ │ └── cache │ │ │ │ └── .gitignore │ │ ├── composer.json │ │ ├── composer.lock │ │ ├── config │ │ │ ├── app.php │ │ │ ├── auth.php │ │ │ ├── broadcasting.php │ │ │ ├── cache.php │ │ │ ├── cors.php │ │ │ ├── database.php │ │ │ ├── filesystems.php │ │ │ ├── hashing.php │ │ │ ├── logging.php │ │ │ ├── mail.php │ │ │ ├── queue.php │ │ │ ├── sanctum.php │ │ │ ├── services.php │ │ │ ├── session.php │ │ │ └── view.php │ │ ├── database │ │ │ ├── .gitignore │ │ │ ├── factories │ │ │ │ └── UserFactory.php │ │ │ ├── migrations │ │ │ │ ├── 2014_10_12_000000_create_users_table.php │ │ │ │ ├── 2014_10_12_100000_create_password_resets_table.php │ │ │ │ ├── 2019_08_19_000000_create_failed_jobs_table.php │ │ │ │ └── 2019_12_14_000001_create_personal_access_tokens_table.php │ │ │ └── seeders │ │ │ │ └── DatabaseSeeder.php │ │ ├── package.json │ │ ├── phpunit.xml │ │ ├── public │ │ │ ├── .htaccess │ │ │ ├── favicon.ico │ │ │ ├── index.php │ │ │ └── robots.txt │ │ ├── resources │ │ │ ├── css │ │ │ │ └── app.css │ │ │ ├── js │ │ │ │ ├── app.js │ │ │ │ └── bootstrap.js │ │ │ ├── lang │ │ │ │ └── en │ │ │ │ │ ├── auth.php │ │ │ │ │ ├── pagination.php │ │ │ │ │ ├── passwords.php │ │ │ │ │ └── validation.php │ │ │ └── views │ │ │ │ ├── filezilla.blade.php │ │ │ │ └── welcome.blade.php │ │ ├── routes │ │ │ ├── api.php │ │ │ ├── channels.php │ │ │ ├── console.php │ │ │ └── web.php │ │ ├── server.php │ │ ├── storage │ │ │ ├── app │ │ │ │ ├── .gitignore │ │ │ │ └── public │ │ │ │ │ └── .gitignore │ │ │ ├── framework │ │ │ │ ├── .gitignore │ │ │ │ ├── cache │ │ │ │ │ ├── .gitignore │ │ │ │ │ └── data │ │ │ │ │ │ └── .gitignore │ │ │ │ ├── sessions │ │ │ │ │ └── .gitignore │ │ │ │ ├── testing │ │ │ │ │ └── .gitignore │ │ │ │ └── views │ │ │ │ │ └── .gitignore │ │ │ └── logs │ │ │ │ └── .gitignore │ │ ├── tests │ │ │ ├── CreatesApplication.php │ │ │ ├── Feature │ │ │ │ └── ExampleTest.php │ │ │ ├── TestCase.php │ │ │ └── Unit │ │ │ │ └── ExampleTest.php │ │ └── webpack.mix.js │ ├── mongodb_express │ │ ├── .gitignore │ │ └── package-lock.json │ ├── node │ │ ├── app.js │ │ ├── package-lock.json │ │ └── package.json │ ├── php │ │ ├── index.html │ │ └── info.php │ ├── python │ │ └── app.py │ ├── react │ │ ├── .gitignore │ │ ├── README.md │ │ ├── build │ │ │ ├── asset-manifest.json │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ ├── logo192.png │ │ │ ├── logo512.png │ │ │ ├── manifest.json │ │ │ ├── robots.txt │ │ │ └── static │ │ │ │ ├── css │ │ │ │ ├── main.073c9b0a.css │ │ │ │ └── main.073c9b0a.css.map │ │ │ │ ├── js │ │ │ │ ├── 787.d6dd7736.chunk.js │ │ │ │ ├── 787.d6dd7736.chunk.js.map │ │ │ │ ├── main.1ce6189d.js │ │ │ │ ├── main.1ce6189d.js.LICENSE.txt │ │ │ │ └── main.1ce6189d.js.map │ │ │ │ └── media │ │ │ │ └── logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── public │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ ├── logo192.png │ │ │ ├── logo512.png │ │ │ ├── manifest.json │ │ │ └── robots.txt │ │ └── src │ │ │ ├── App.css │ │ │ ├── App.js │ │ │ ├── App.test.js │ │ │ ├── index.css │ │ │ ├── index.js │ │ │ ├── logo.svg │ │ │ ├── reportWebVitals.js │ │ │ └── setupTests.js │ ├── svelte │ │ ├── .gitignore │ │ ├── README.md │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── public │ │ │ ├── build │ │ │ │ ├── bundle.css │ │ │ │ ├── bundle.js │ │ │ │ └── bundle.js.map │ │ │ ├── favicon.png │ │ │ ├── global.css │ │ │ └── index.html │ │ ├── rollup.config.js │ │ ├── scripts │ │ │ └── setupTypeScript.js │ │ └── src │ │ │ ├── App.svelte │ │ │ └── main.js │ └── vue │ │ ├── .gitignore │ │ ├── README.md │ │ ├── babel.config.js │ │ ├── dist │ │ ├── css │ │ │ └── app.2cf79ad6.css │ │ ├── favicon.ico │ │ ├── index.html │ │ └── js │ │ │ ├── app.fff96c94.js │ │ │ ├── app.fff96c94.js.map │ │ │ ├── chunk-vendors.6a023eeb.js │ │ │ └── chunk-vendors.6a023eeb.js.map │ │ ├── jsconfig.json │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── public │ │ ├── favicon.ico │ │ └── index.html │ │ ├── src │ │ ├── App.vue │ │ ├── assets │ │ │ └── logo.png │ │ ├── components │ │ │ └── HelloWorld.vue │ │ └── main.js │ │ └── vue.config.js └── zabbix │ └── zabbix_agentd.conf ├── tests ├── .gitignore ├── .terraform.lock.hcl ├── basic.sh ├── main.tf ├── network.xml ├── terraform.tfstate ├── terraform.tfstate.backup └── ubuntu22.tf └── updates └── 100 └── update.sh /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/.gitignore -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright © 2022 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /bin/app-details: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | while getopts a: flag 15 | do 16 | case "${flag}" in 17 | a) app=${OPTARG};; 18 | esac 19 | done 20 | 21 | if [ -z "$app" ] 22 | then 23 | echo "Please provide a app using -a " 24 | exit 25 | fi 26 | 27 | 28 | if [ ! -f "/etc/nginx/apps-available/$app.conf" ] 29 | then 30 | echo "No Vhost found for this app $app" 31 | exit; 32 | fi 33 | 34 | 35 | domain=$(cat /etc/nginx/apps-available/$app.conf | grep -m1 -Poe 'server_name \K[^; ]+') 36 | port=$(cat /etc/nginx/apps-available/$app.conf | grep -m1 -Poe 'listen \K[^; ]+') 37 | url="https://$domain:$port" 38 | 39 | 40 | app_info="$app" 41 | app_info+="\t" 42 | app_info+="$url" 43 | app_info+="\t" 44 | app_info+="$port" 45 | app_info+="\t" 46 | app_info+="\n" 47 | 48 | printf "$app_info" -------------------------------------------------------------------------------- /bin/clear-cache: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | while getopts u: flag 15 | do 16 | case "${flag}" in 17 | u) username=${OPTARG};; 18 | esac 19 | done 20 | 21 | if [ -z "$username" ] 22 | then 23 | echo "Please provide a username using -u " 24 | exit 25 | fi 26 | 27 | 28 | 29 | if ! id "$username" &>/dev/null 30 | then 31 | echo "The $username doesn't exist" 32 | exit; 33 | fi 34 | 35 | rm -rf /var/www/home/$username/cache/nginx/* 36 | echo "Cache Purged" 37 | -------------------------------------------------------------------------------- /bin/create-app-user: -------------------------------------------------------------------------------- 1 | 2 | #!/bin/bash 3 | 4 | DIR=$(dirname "${BASH_SOURCE[0]}") 5 | DIR=$(realpath "${DIR}") 6 | 7 | template_path="$(cd $DIR/../ && pwd)/templates" 8 | source $DIR/../includes/helpers.sh 9 | 10 | if [ "$EUID" -ne 0 ] 11 | then echo "Please run as root" 12 | exit 13 | fi 14 | 15 | while getopts u:d:f:p flag 16 | do 17 | case "${flag}" in 18 | u) username=${OPTARG};; 19 | esac 20 | done 21 | 22 | if [ -z "$username" ] 23 | then 24 | echo "Please provide a username using -u " 25 | exit 26 | fi 27 | 28 | 29 | ##Create user 30 | user_password="$(openssl rand -hex 12)" 31 | 32 | htpasswd /etc/nginx/htpasswd $username 33 | 34 | echo "" 35 | echo "Username: $username" 36 | echo "Password: $password" 37 | echo "" -------------------------------------------------------------------------------- /bin/create-filezilla-link: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | 15 | while [ $# -gt 0 ]; do 16 | case "$1" in 17 | -u|--username) 18 | username="$2" 19 | shift 20 | ;; 21 | *) 22 | printf "***************************\n" 23 | printf "* Error: Invalid argument. $1 *\n" 24 | printf "***************************\n" 25 | exit 1 26 | esac 27 | shift 28 | done 29 | 30 | 31 | if [ -z "$username" ] 32 | then 33 | echo "Please provide a username using -u " 34 | exit 35 | fi 36 | 37 | 38 | if ! id "$username" &>/dev/null 39 | then 40 | echo "The $username doesn't exist" 41 | exit; 42 | fi 43 | 44 | 45 | chroot_home=/var/www/home/$username 46 | www_path=$chroot_home/www 47 | 48 | -------------------------------------------------------------------------------- /bin/create-jail-user: -------------------------------------------------------------------------------- 1 | 2 | #!/bin/bash 3 | 4 | DIR=$(dirname "${BASH_SOURCE[0]}") 5 | DIR=$(realpath "${DIR}") 6 | 7 | template_path="$(cd $DIR/../ && pwd)/templates" 8 | source $DIR/../includes/helpers.sh 9 | 10 | if [ "$EUID" -ne 0 ] 11 | then echo "Please run as root" 12 | exit 13 | fi 14 | 15 | while getopts u:d:f:p flag 16 | do 17 | case "${flag}" in 18 | u) username=${OPTARG};; 19 | esac 20 | done 21 | 22 | if [ -z "$username" ] 23 | then 24 | echo "Please provide a username using -u " 25 | exit 26 | fi 27 | 28 | 29 | 30 | if id "$username" &>/dev/null 31 | then 32 | echo "Username $username exists!" 33 | exit; 34 | else 35 | echo "The $username doesn't exist" 36 | fi 37 | 38 | ##Create user 39 | user_password="$(openssl rand -hex 12)" 40 | 41 | adduser --gecos "" --disabled-password $username 42 | echo "$username:$user_password" | sudo chpasswd 43 | usermod -a -G web $username 44 | usermod -a -G sftp $username 45 | bash jail-user -u $username 46 | 47 | 48 | -------------------------------------------------------------------------------- /bin/create-mysql-db: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | ## Creating mysql user and database 15 | 16 | database_name="$(openssl rand -hex 6)" 17 | database_user="$(openssl rand -hex 6)" 18 | database_password="$(openssl rand -hex 8)" 19 | 20 | mysql -e "CREATE DATABASE IF NOT EXISTS $database_name" 21 | mysql -e "CREATE USER '$database_user'@'localhost' IDENTIFIED WITH mysql_native_password BY '$database_password'" 22 | mysql -e "GRANT ALL PRIVILEGES ON $database_name.* To '$database_user'@'localhost'" 23 | mysql -e "GRANT SESSION_VARIABLES_ADMIN ON *.* TO '$database_user'@'localhost'"; 24 | mysql -e "FLUSH PRIVILEGES;" 25 | 26 | 27 | echo "" 28 | echo "MYSQL Database Credentials" 29 | echo "Database name: $database_name" 30 | echo "Database user: $database_user" 31 | echo "Database password: $database_password" 32 | echo "" -------------------------------------------------------------------------------- /bin/create-postgres-db: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | 15 | if ! systemctl is-active --quiet postgresql 16 | then 17 | echo "postgresql is not running! Aborting!" 18 | exit 19 | fi 20 | 21 | ## Creating postgres user and database 22 | 23 | database_name="db_$(openssl rand -hex 6)" 24 | database_user=$database_name 25 | database_password="$(openssl rand -hex 8)" 26 | 27 | psql -c "CREATE DATABASE $database_name;" 28 | psql -c "CREATE USER $database_user WITH PASSWORD '$database_password';" 29 | psql -c "GRANT ALL PRIVILEGES ON DATABASE "$database_name" to $database_user;" 30 | psql -c "REVOKE connect ON DATABASE $database_name FROM PUBLIC;" 31 | 32 | 33 | 34 | 35 | echo "" 36 | echo "Postgres Database Credentials" 37 | echo "Database name: $database_name" 38 | echo "Database user: $database_user" 39 | echo "Database password: $database_password" 40 | echo "" -------------------------------------------------------------------------------- /bin/create-redis-user: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | 15 | while [ $# -gt 0 ]; do 16 | case "$1" in 17 | -u|--username) 18 | username="$2" 19 | shift 20 | ;; 21 | *) 22 | printf "***************************\n" 23 | printf "* Error: Invalid argument. $1 *\n" 24 | printf "***************************\n" 25 | exit 1 26 | esac 27 | shift 28 | done 29 | 30 | 31 | if [ -z "$username" ] 32 | then 33 | echo "Please provide a username using -u " 34 | exit 35 | fi 36 | 37 | 38 | if ! id "$username" &>/dev/null 39 | then 40 | echo "The $username doesn't exist" 41 | exit; 42 | fi 43 | 44 | 45 | if ! systemctl is-active --quiet redis 46 | then 47 | echo "redis server is not running! Aborting!" 48 | exit 49 | fi 50 | 51 | 52 | ## TODO Implement Redis ACL. 53 | -------------------------------------------------------------------------------- /bin/create-wp-user: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | while getopts u: flag 15 | do 16 | case "${flag}" in 17 | u) username=${OPTARG};; 18 | esac 19 | done 20 | 21 | if [ -z "$username" ] 22 | then 23 | echo "Please provide a username using -u " 24 | exit 25 | fi 26 | 27 | 28 | if ! id "$username" &>/dev/null 29 | then 30 | echo "The $username doesn't exist" 31 | exit; 32 | fi 33 | 34 | www_path=/var/www/home/$username/www 35 | 36 | if [ ! -f "$www_path/wp-config.php" ] 37 | then 38 | echo "There is not a wordpress site" 39 | exit; 40 | fi 41 | 42 | 43 | wp --allow-root --skip-plugins --skip-themes --path=$www_path user delete support_$username --reassign=1 44 | wp --allow-root --skip-plugins --skip-themes --path=$www_path user create support_$username support_$username@$HOSTNAME --role=administrator -------------------------------------------------------------------------------- /bin/delete-backup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | while getopts u:n: flag 15 | do 16 | case "${flag}" in 17 | u) username=${OPTARG};; 18 | n) backup_name=${OPTARG};; 19 | esac 20 | done 21 | 22 | if [ -z "$username" ] 23 | then 24 | echo "Please provide a username using -u " 25 | exit 26 | fi 27 | 28 | 29 | 30 | if ! id "$username" &>/dev/null 31 | then 32 | echo "The $username doesn't exist" 33 | exit; 34 | fi 35 | 36 | 37 | 38 | if [ -z "$backup_name" ] 39 | then 40 | echo "Please provide a backup_name using -n " 41 | exit 42 | fi 43 | 44 | 45 | if [ ! -d "/backups/$username/$backup_name" ] 46 | then 47 | echo "There is no backup found at this location /backups/$username/$backup_name" 48 | exit; 49 | fi 50 | 51 | 52 | 53 | echo "Deleting backup files" 54 | rm -rf /backups/$username/$backup_name 55 | echo "Backup Deleted" -------------------------------------------------------------------------------- /bin/delete-mysql-db: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | while getopts d: flag 15 | do 16 | case "${flag}" in 17 | d) database=${OPTARG};; 18 | esac 19 | done 20 | 21 | 22 | if [ -z "$database" ] 23 | then 24 | echo "Please provide a database using -d " 25 | exit 26 | fi 27 | 28 | 29 | mysql -e "DROP DATABASE IF EXISTS $database" -------------------------------------------------------------------------------- /bin/disable-app: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | while getopts a: flag 15 | do 16 | case "${flag}" in 17 | a) app=${OPTARG};; 18 | esac 19 | done 20 | 21 | if [ -z "$app" ] 22 | then 23 | echo "Please provide a app using -a " 24 | exit 25 | fi 26 | 27 | 28 | 29 | if [ ! -f "/etc/nginx/apps-available/$app.conf" ] 30 | then 31 | echo "No Vhost found for this app" 32 | exit; 33 | fi 34 | 35 | 36 | if [ ! -L "/etc/nginx/apps-enabled/$app.conf" ] 37 | then 38 | echo "This site is already disabled!" 39 | exit; 40 | fi 41 | 42 | 43 | if [ -f "/etc/nginx/apps-available/$app.conf" ] 44 | then 45 | nginx_vhost_enabled="/etc/nginx/apps-enabled/$app.conf" 46 | rm $nginx_vhost_enabled 47 | fi 48 | 49 | nginx -t && service nginx reload 50 | 51 | echo "App $app Disabled" 52 | -------------------------------------------------------------------------------- /bin/edit-nginx-vhost: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | while getopts u:p: flag 15 | do 16 | case "${flag}" in 17 | u) username=${OPTARG};; 18 | esac 19 | done 20 | 21 | if [ -z "$username" ] 22 | then 23 | echo "Please provide a username using -u " 24 | exit 1; 25 | fi 26 | 27 | 28 | 29 | 30 | 31 | if ! id "$username" &>/dev/null 32 | then 33 | echo "The $username doesn't exist" 34 | exit 1; 35 | fi 36 | 37 | 38 | if [ ! -f "/etc/nginx/sites-available/$username.conf" ] && [ ! -f "/etc/nginx/apps-available/$username.conf" ] 39 | then 40 | echo "No Vhost found for this user/app" 41 | exit; 42 | fi 43 | 44 | 45 | if [ -f "/etc/nginx/sites-available/$username.conf" ] 46 | then 47 | nano /etc/nginx/sites-available/$username.conf 48 | nginx -t 49 | exit; 50 | fi 51 | 52 | 53 | if [ -f "/etc/nginx/apps-available/$username.conf" ] 54 | then 55 | nano /etc/nginx/apps-available/$username.conf 56 | nginx -t 57 | exit; 58 | fi 59 | -------------------------------------------------------------------------------- /bin/edit-php-fpm-pool: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | while getopts u:p: flag 15 | do 16 | case "${flag}" in 17 | u) username=${OPTARG};; 18 | esac 19 | done 20 | 21 | if [ -z "$username" ] 22 | then 23 | echo "Please provide a username using -u " 24 | exit 1; 25 | fi 26 | 27 | 28 | 29 | 30 | 31 | if ! id "$username" &>/dev/null 32 | then 33 | echo "The $username doesn't exist" 34 | exit 1; 35 | fi 36 | 37 | if [ ! -L "/var/www/home/$username/bin/php" ] && [ ! -S "/var/run/php/$username-php-fpm.sock" ] 38 | then 39 | echo "This is not a PHP site" 40 | exit 1; 41 | fi 42 | 43 | 44 | for php_v in ${php_versions_array[@]}; do 45 | if [ -f "/etc/php/$php_v/fpm/pool.d/$username.conf" ] 46 | then 47 | nano /etc/php/$php_v/fpm/pool.d/$username.conf 48 | break 49 | fi 50 | done 51 | 52 | 53 | exit 0; -------------------------------------------------------------------------------- /bin/enable-app: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | 15 | while getopts a: flag 16 | do 17 | case "${flag}" in 18 | a) app=${OPTARG};; 19 | esac 20 | done 21 | 22 | if [ -z "$app" ] 23 | then 24 | echo "Please provide the name of app using -a " 25 | exit 26 | fi 27 | 28 | if [ ! -f "/etc/nginx/apps-available/$app.conf" ] 29 | then 30 | echo "No Vhost found for this user" 31 | exit; 32 | fi 33 | 34 | 35 | if [ -L "/etc/nginx/apps-enabled/$app.conf" ] 36 | then 37 | echo "This app is already enabled" 38 | exit; 39 | fi 40 | 41 | 42 | if [ -f "/etc/nginx/apps-available/$app.conf" ] 43 | then 44 | nginx_vhost_file="/etc/nginx/apps-available/$app.conf" 45 | nginx_vhost_enabled="/etc/nginx/apps-enabled/$app.conf" 46 | ln -s $nginx_vhost_file $nginx_vhost_enabled 47 | fi 48 | 49 | 50 | nginx -t && service nginx reload 51 | 52 | echo "App: $app is enabled now" 53 | -------------------------------------------------------------------------------- /bin/enable-ramdisk: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | while getopts u: flag 15 | do 16 | case "${flag}" in 17 | u) username=${OPTARG};; 18 | esac 19 | done 20 | 21 | if [ -z "$username" ] 22 | then 23 | echo "Please provide a username using -u " 24 | exit 25 | fi 26 | 27 | 28 | 29 | if ! id "$username" &>/dev/null 30 | then 31 | echo "The $username doesn't exist" 32 | exit; 33 | fi 34 | 35 | 36 | 37 | if [ ! -f "/etc/nginx/sites-available/$username.conf" ] 38 | then 39 | echo "This site is unavailable!" 40 | exit; 41 | fi 42 | 43 | 44 | if mountpoint -q /var/www/home/$username/cache/nginx/ 45 | then 46 | echo "Ramdisk is already enabled on this site. Aborting!" 47 | exit 1; 48 | fi 49 | 50 | rm -rf /var/www/home/$username/cache/nginx/ 51 | sudo mkdir -p /var/www/home/$username/cache/nginx/ 52 | sudo mount -t tmpfs -o size=64M tmpfs /var/www/home/$username/cache/nginx/ 53 | sudo chown -R nginx:nginx /var/www/home/$username/cache/nginx/ 54 | 55 | echo "Ram Disk Enabled" 56 | -------------------------------------------------------------------------------- /bin/enter-site: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | 15 | while getopts u: flag 16 | do 17 | case "${flag}" in 18 | u) username=${OPTARG};; 19 | esac 20 | done 21 | 22 | if [ -z "$username" ] 23 | then 24 | echo "Please provide a username using -u " 25 | exit 26 | fi 27 | 28 | 29 | if ! id "$username" &>/dev/null 30 | then 31 | echo "The $username doesn't exist" 32 | exit; 33 | fi 34 | 35 | domin="" 36 | 37 | if [ -f "/etc/nginx/sites-available/$username.conf" ] 38 | then 39 | domain=$(cat /etc/nginx/sites-available/$username.conf | grep -m1 -Poe 'server_name \K[^; ]+') 40 | fi 41 | 42 | USER=$username HOME=/home/$username chroot --userspec=$username:$username /var/www/ /bin/bash -c "source ~/.profile; clear ; \ 43 | echo \"***************************\" && \ 44 | echo \"User: $username\" && \ 45 | echo \"Domain: $domain\" && \ 46 | echo \"***************************\" && \ 47 | cd /home/$username/ && \ 48 | bash " 49 | 50 | 51 | -------------------------------------------------------------------------------- /bin/enter-site-sudo: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | 15 | while getopts u: flag 16 | do 17 | case "${flag}" in 18 | u) username=${OPTARG};; 19 | esac 20 | done 21 | 22 | if [ -z "$username" ] 23 | then 24 | echo "Please provide a username using -u " 25 | exit 26 | fi 27 | 28 | 29 | if ! id "$username" &>/dev/null 30 | then 31 | echo "The $username doesn't exist" 32 | exit; 33 | fi 34 | 35 | domin="" 36 | 37 | if [ -f "/etc/nginx/sites-available/$username.conf" ] 38 | then 39 | domain=$(cat /etc/nginx/sites-available/$username.conf | grep -m1 -Poe 'server_name \K[^; ]+') 40 | fi 41 | 42 | sudo /bin/bash -c " 43 | echo \"***************************\" && \ 44 | echo \"User: root\" && \ 45 | echo \"SiteUser: $username\" && \ 46 | echo \"Domain: $domain\" && \ 47 | echo \"***************************\" && \ 48 | cd /var/www/home/$username/ && \ 49 | bash " 50 | 51 | 52 | -------------------------------------------------------------------------------- /bin/install-django: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | 15 | while getopts u: flag 16 | do 17 | case "${flag}" in 18 | u) username=${OPTARG};; 19 | esac 20 | done 21 | 22 | if [ -z "$username" ] 23 | then 24 | echo "Please provide a username using -u " 25 | exit 26 | fi 27 | 28 | 29 | if ! id "$username" &>/dev/null 30 | then 31 | echo "The $username doesn't exist" 32 | exit; 33 | fi 34 | 35 | 36 | if [ ! -L "/var/www/home/$username/.local/bin/pip" ] || [ ! -f "/var/www/home/$username/.local/bin/pip" ] 37 | then 38 | echo "PIP is not installed for this site. Are you sure this is a python site?" 39 | exit; 40 | fi 41 | 42 | chroot --userspec=$username:$username /var/www/ /bin/bash -c "\ 43 | export HOME=/home/$username && \ 44 | export USER=$username && \ 45 | source ~/.profile && \ 46 | ~/.local/bin/pip install django" 47 | -------------------------------------------------------------------------------- /bin/iops-benchmark: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | -------------------------------------------------------------------------------- /bin/iops-stats: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | disk=sda1 15 | 16 | echo 'Reads/sec and Writes/sec' 17 | iostat -dx $disk | grep $disk | awk '{ print $4"/"$5; }' 18 | echo 'Overall IOPS' 19 | iostat -dx $disk | grep $disk | awk '{ print $2; }' 20 | 21 | 22 | fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=512M --readwrite=randread 23 | fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=512M --readwrite=randwrite -------------------------------------------------------------------------------- /bin/jail-binary: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | 15 | while getopts b: flag 16 | do 17 | case "${flag}" in 18 | b) binary=${OPTARG};; 19 | esac 20 | done 21 | 22 | if [ -z "$binary" ] 23 | then 24 | echo "Please provide a binary using -b " 25 | exit 26 | fi 27 | 28 | chroot_path=/var/www/ 29 | 30 | if [ -f "$binary" ] 31 | then 32 | jk_cp -j $chroot_path $binary 33 | for lib in `ldd $binary | cut -d'>' -f2 | awk '{print $1}'` ; do 34 | if [ -f "$lib" ] ; then 35 | jk_cp -j $chroot_path $lib 36 | fi 37 | done 38 | else 39 | jk_cp -j $chroot_path "$(which $binary)" 40 | for lib in `ldd "$(which $binary)" | cut -d'>' -f2 | awk '{print $1}'` ; do 41 | if [ -f "$lib" ] ; then 42 | jk_cp -j $chroot_path $lib 43 | fi 44 | done 45 | fi 46 | 47 | 48 | -------------------------------------------------------------------------------- /bin/list-apps: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | if [ "$EUID" -ne 0 ] 9 | then echo "Please run as root" 10 | exit 11 | fi 12 | 13 | 14 | apps="$(ls /etc/nginx/apps-available | sed 's/.conf//')" 15 | 16 | for app in $apps 17 | do 18 | disallowed_users=("web" "nginx" "sftp" ) 19 | if [[ " ${disallowed_users[*]} " =~ " ${app} " ]]; then 20 | continue 21 | fi 22 | bash app-details -a $app 23 | done -------------------------------------------------------------------------------- /bin/list-sites: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | if [ "$EUID" -ne 0 ] 9 | then echo "Please run as root" 10 | exit 11 | fi 12 | 13 | 14 | sites="$(members web)" 15 | 16 | site_info="Domain" 17 | site_info+="\t" 18 | site_info+="Username" 19 | site_info+="\n" 20 | 21 | for user in $sites 22 | do 23 | disallowed_users=("web" "nginx" "sftp" "$LEMP_LOCAL_LINUX_USER" ) 24 | if [[ " ${disallowed_users[*]} " =~ " ${user} " ]]; then 25 | continue 26 | fi 27 | 28 | site_info+="$(/opt/lemp/bin/site-details -u $user)" 29 | site_info+="\n" 30 | done 31 | 32 | printf "$site_info" | sed 's/\t/,|,/g' | column -s ',' -t 33 | 34 | # for site in $sites 35 | # do 36 | # site_info+="$site" 37 | # site_info+="\t" 38 | # site_info+="$(date -r . +'%F %T' | tr '\n' ' ' )" 39 | # site_info+="\t" 40 | # site_info+="$(du -h db.sql.gz | sed 's/db.sql.gz//' | tr '\n' ' ' )" 41 | # site_info+="$(du -h www.gz | sed 's/www.gz//' | tr '\n' ' ')" 42 | # done 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /bin/logrotate-site: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | while getopts u:d:e:a flag 15 | do 16 | case "${flag}" in 17 | u) username=${OPTARG};; 18 | d) disable=${OPTARG};; 19 | e) enable=${OPTARG};; 20 | a) app=${OPTARG};; 21 | esac 22 | done 23 | 24 | if [ -z "$username" ] 25 | then 26 | echo "Please provide a username using -u " 27 | exit 28 | fi 29 | 30 | 31 | if ! id "$username" &>/dev/null 32 | then 33 | echo "The $username doesn't exist" 34 | exit; 35 | fi 36 | 37 | 38 | cp $template_path/logrotate/site.conf /etc/logrotate.d/site-$username.conf 39 | sed -i "s/{{username}}/$username/" /etc/logrotate.d/site-$username.conf 40 | 41 | -------------------------------------------------------------------------------- /bin/ramdisk-status: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | while getopts u: flag 15 | do 16 | case "${flag}" in 17 | u) username=${OPTARG};; 18 | esac 19 | done 20 | 21 | if [ -z "$username" ] 22 | then 23 | echo "Please provide a username using -u " 24 | exit 25 | fi 26 | 27 | 28 | 29 | if ! id "$username" &>/dev/null 30 | then 31 | echo "The $username doesn't exist" 32 | exit; 33 | fi 34 | 35 | 36 | status="disabled" 37 | 38 | if mountpoint -q /var/www/home/$username/cache/nginx/ 39 | then 40 | status="enabled" 41 | fi 42 | 43 | echo "RamDisk Status: $status" 44 | -------------------------------------------------------------------------------- /bin/reset-user-mysql: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | while getopts u: flag 15 | do 16 | case "${flag}" in 17 | u) username=${OPTARG};; 18 | esac 19 | done 20 | if [ -z "$username" ] 21 | then 22 | echo "Please provide a username using -u " 23 | exit 24 | fi 25 | 26 | database_password="$(openssl rand -hex 8)" 27 | database_user=$username 28 | mysql -e "ALTER USER '$database_user'@'localhost' IDENTIFIED WITH mysql_native_password BY '$database_password'" 29 | mysql -e "FLUSH PRIVILEGES" 30 | 31 | 32 | echo "MYSQL Username : " $database_user 33 | echo "MYSQL Password : " $database_password -------------------------------------------------------------------------------- /bin/restart-php-fpm-pool: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | while getopts u:p: flag 15 | do 16 | case "${flag}" in 17 | u) username=${OPTARG};; 18 | esac 19 | done 20 | 21 | if [ -z "$username" ] 22 | then 23 | echo "Please provide a username using -u " 24 | exit 1; 25 | fi 26 | 27 | 28 | 29 | 30 | 31 | if ! id "$username" &>/dev/null 32 | then 33 | echo "The $username doesn't exist" 34 | exit 1; 35 | fi 36 | 37 | if [ ! -L "/var/www/home/$username/bin/php" ] && [ ! -S "/var/run/php/$username-php-fpm.sock" ] 38 | then 39 | echo "This is not a PHP site" 40 | exit 1; 41 | fi 42 | 43 | 44 | for php_v in ${php_versions_array[@]}; do 45 | if [ -f "/etc/php/$php_v/fpm/pool.d/$username.conf" ] 46 | then 47 | systemctl restart php$php_v-fpm 48 | fi 49 | done 50 | 51 | 52 | exit 0; -------------------------------------------------------------------------------- /bin/restart-site: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | while getopts u:p: flag 15 | do 16 | case "${flag}" in 17 | u) username=${OPTARG};; 18 | esac 19 | done 20 | 21 | if [ -z "$username" ] 22 | then 23 | echo "Please provide a username using -u " 24 | exit 1; 25 | fi 26 | 27 | 28 | 29 | 30 | 31 | if ! id "$username" &>/dev/null 32 | then 33 | echo "The $username doesn't exist" 34 | exit 1; 35 | fi 36 | 37 | 38 | 39 | if [ ! -f "/etc/systemd/system/$username-site.service" ] 40 | then 41 | echo "There is no systemd file present to restart" 42 | exit 1; 43 | fi 44 | 45 | echo "Restarting systemd service $username-site.service" 46 | systemctl restart $username-site -------------------------------------------------------------------------------- /bin/site-status: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | while getopts u: flag 15 | do 16 | case "${flag}" in 17 | u) username=${OPTARG};; 18 | esac 19 | done 20 | 21 | if [ -z "$username" ] 22 | then 23 | echo "Please provide a username using -u " 24 | exit 25 | fi 26 | 27 | 28 | 29 | if ! id "$username" &>/dev/null 30 | then 31 | echo "The $username doesn't exist" 32 | exit; 33 | fi 34 | 35 | 36 | if [ ! -f "/etc/nginx/sites-available/$username.conf" ] 37 | then 38 | echo "No Vhost found for this user" 39 | exit; 40 | fi 41 | 42 | 43 | 44 | status='' 45 | 46 | if [ -f "/etc/nginx/sites-available/$username.conf" ] 47 | then 48 | status="disabled" 49 | fi 50 | 51 | 52 | 53 | if [ -L "/etc/nginx/sites-enabled/$username.conf" ] 54 | then 55 | status="enabled" 56 | fi 57 | 58 | echo "Site Status: $status" -------------------------------------------------------------------------------- /bin/update-bash-completion: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | source $DIR/../includes/helpers.sh 7 | template_path="$(cd $DIR/../ && pwd)/templates" 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | 15 | cp -rf $template_path/ssh/bash_completion.d/* /etc/bash_completion.d/ -------------------------------------------------------------------------------- /bin/update-jail: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | if [ "$EUID" -ne 0 ] 9 | then echo "Please run as root" 10 | exit 11 | fi 12 | 13 | 14 | bash $DIR/../installers/jailkit.sh 15 | 16 | home_users=`ls /var/www/home/` 17 | 18 | for user in $home_users 19 | do 20 | echo "Jailing User : $user" 21 | bash jail-user -u $user 22 | done -------------------------------------------------------------------------------- /bin/update-lemp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | source $DIR/../includes/helpers.sh 7 | 8 | if [ "$EUID" -ne 0 ] 9 | then echo "Please run as root" 10 | exit 11 | fi 12 | 13 | if [ ! -f "$LEMP_FLAG_DIR/VERSION" ] 14 | then 15 | echo "LEMP Version file not found at $LEMP_FLAG_DIR/VERSION" 16 | exit; 17 | fi 18 | 19 | INSTALLED_VERSION=$(cat $LEMP_FLAG_DIR/VERSION) 20 | 21 | if [ -z "$INSTALLED_VERSION" ] 22 | then 23 | echo "Invalid Version found at $LEMP_FLAG_DIR/VERSION" 24 | exit; 25 | fi 26 | 27 | echo "LEMP Current verison: $INSTALLED_VERSION" 28 | 29 | updates=$(ls /opt/lemp/updates/ | sort) 30 | 31 | for update in $updates 32 | do 33 | if (( $(echo "$update > $INSTALLED_VERSION" |bc -l) )) 34 | then 35 | echo "Running LEMP Update $update" 36 | bash /opt/lemp/updates/$update/update.sh 37 | echo "$update" > $LEMP_FLAG_DIR/VERSION 38 | fi 39 | done 40 | 41 | -------------------------------------------------------------------------------- /bin/update-lemp-repo: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | source $DIR/../includes/helpers.sh 7 | 8 | if [ "$EUID" -ne 0 ] 9 | then echo "Please run as root" 10 | exit 11 | fi 12 | 13 | 14 | cd $DIR/../ 15 | git reset --hard 16 | git pull origin 17 | -------------------------------------------------------------------------------- /bin/wp-users: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | 15 | username=$(pwd | cut -d / -f 5) 16 | 17 | if [ -z "$username" ] 18 | then 19 | echo "Please provide a username using -u " 20 | exit 21 | fi 22 | 23 | 24 | if ! id "$username" &>/dev/null 25 | then 26 | echo "The $username doesn't exist" 27 | exit; 28 | fi 29 | 30 | chroot_home=/var/www/home/$username 31 | www_path=$chroot_home/www 32 | 33 | <<<<<<< Updated upstream 34 | $chroot_home/.local/bin/php /var/www/bin/wp --allow-root --path=$www_path user list 35 | ======= 36 | /var/www/home/forexdf/.local/bin/php /var/www/bin/wp --allow-root --path=$www_path user list 37 | >>>>>>> Stashed changes 38 | -------------------------------------------------------------------------------- /includes/helpers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exists() 4 | { 5 | command -v "$1" >/dev/null 2>&1 6 | } 7 | 8 | is_mounted() { 9 | mount | awk -v DIR="$1" '{if ($3 == DIR) { exit 0}} ENDFILE{exit -1}' 10 | } 11 | 12 | 13 | php_versions_array=("8.3" "8.2" "8.1" "8.0" "7.4" "7.3" "7.2" "7.1" "7.0" "5.6" ) 14 | 15 | LEMP_HOSTNAME_USERNAME='default_site' 16 | LEMP_LOCAL_LINUX_USER='noaman' ## Modify this to the username which you are using in Ubuntu GUI 17 | 18 | LEMP_FLAG_DIR=/opt/lemp_installed 19 | LEMP_CURRENT_VERSION=100 20 | 21 | 22 | RED="\e[31m" 23 | GREEN="\e[32m" 24 | ENDCOLOR="\e[0m" 25 | 26 | 27 | # Add Local flag 28 | if [ -f "/opt/lemp_local_install" ] 29 | then 30 | local=yes 31 | # Disable SSL certbot validation for local domain 32 | nossl=yes 33 | fi -------------------------------------------------------------------------------- /installers/amavisd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | DIR=$(dirname "${BASH_SOURCE[0]}") 5 | DIR=$(realpath "${DIR}") 6 | 7 | template_path="$(cd $DIR/../ && pwd)/templates" 8 | 9 | 10 | if [ "$EUID" -ne 0 ] 11 | then echo "Please run as root" 12 | exit 13 | fi 14 | 15 | apt install arj bzip2 cabextract cpio rpm2cpio file gzip lhasa nomarch pax rar unrar p7zip-full unzip zip lrzip lzip liblz4-tool lzop unrar-free -qqy 16 | apt install amavisd-new -qqy 17 | 18 | 19 | touch $LEMP_FLAG_DIR/AMAVISD_INSTALLED 20 | 21 | 22 | -------------------------------------------------------------------------------- /installers/backup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | 8 | if [ "$EUID" -ne 0 ] 9 | then echo "Please run as root" 10 | exit 11 | fi 12 | 13 | mkdir -p /backups 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /installers/clamav.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/installers/clamav.sh -------------------------------------------------------------------------------- /installers/cron.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | 10 | if [ "$EUID" -ne 0 ] 11 | then echo "Please run as root" 12 | exit 13 | fi 14 | 15 | /var/spool/cron/crontabs/root 16 | (crontab -u root -l; echo "$(cat $template_path/cron/certbot)" ) | sort -u | crontab -u root - 17 | (crontab -u root -l; echo "$(cat $template_path/cron/backup-sites)" ) | sort -u | crontab -u root - 18 | (crontab -u root -l; echo "$(cat $template_path/cron/mailserver)" ) | sort -u | crontab -u root - 19 | (crontab -u root -l; echo "$(cat $template_path/cron/lemp)" ) | sort -u | crontab -u root - 20 | 21 | 22 | 23 | touch $LEMP_FLAG_DIR/CRON_INSTALLED -------------------------------------------------------------------------------- /installers/docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | 10 | if [ "$EUID" -ne 0 ] 11 | then echo "Please run as root" 12 | exit 13 | fi 14 | 15 | 16 | 17 | #Installing Docker 18 | 19 | apt install apt-transport-https ca-certificates curl software-properties-common -qqy 20 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 21 | add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" -y 22 | apt-cache policy docker-ce 23 | apt install docker-ce -qqy 24 | apt install docker-compose -qqy 25 | 26 | 27 | # For Permission Issues 28 | # sudo usermod -aG docker ${USER} 29 | 30 | 31 | touch $LEMP_FLAG_DIR/DOCKER_INSTALLED -------------------------------------------------------------------------------- /installers/dovecot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | apt install dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-lmtpd -qqy 15 | systemctl stop dovecot 16 | cp $template_path/dovecot/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext 17 | cp $template_path/dovecot/dovecot.conf /etc/dovecot/dovecot.conf 18 | cp $template_path/dovecot/conf.d/* /etc/dovecot/conf.d/ 19 | sed -i "s/{{domain}}/$HOSTNAME/" /etc/dovecot/dovecot.conf 20 | adduser dovecot mail 21 | 22 | 23 | dovecot_files_array=( "10-auth.conf" "10-mail.conf" "10-master.conf" "10-ssl.conf" "15-mailboxes.conf" ) 24 | 25 | 26 | for dovecot_file in ${dovecot_files_array[@]}; do 27 | sed -i "s/{{db_name}}/$database_name/" /etc/dovecot/conf.d/$dovecot_file 28 | sed -i "s/{{db_username}}/$database_user/" /etc/dovecot/conf.d/$dovecot_file 29 | sed -i "s/{{db_password}}/$database_password/" /etc/dovecot/conf.d/$dovecot_file 30 | sed -i "s/{{domain}}/$HOSTNAME/" /etc/dovecot/conf.d/$dovecot_file 31 | done 32 | 33 | 34 | 35 | touch $LEMP_FLAG_DIR/DOVECOT_INSTALLED -------------------------------------------------------------------------------- /installers/fail2ban.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | apt install fail2ban -qqy 15 | cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local 16 | 17 | 18 | touch $LEMP_FLAG_DIR/FAIL2BAN_INSTALLED 19 | -------------------------------------------------------------------------------- /installers/hostname.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | if [ "$EUID" -ne 0 ] 5 | then echo "Please run as root" 6 | exit 7 | fi 8 | 9 | 10 | while getopts h: flag 11 | do 12 | case "${flag}" in 13 | h) hostname=${OPTARG};; 14 | esac 15 | done 16 | 17 | 18 | 19 | if [ -z "$hostname" ] 20 | then 21 | echo "Please provide a hostname using -h " 22 | exit 23 | fi 24 | 25 | 26 | sed -i "s/$HOSTNAME/$hostname/" /etc/hostname 27 | sed -i "s/$HOSTNAME/$hostname/" /etc/hosts 28 | hostnamectl 29 | 30 | -------------------------------------------------------------------------------- /installers/java.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | apt install default-jre -y 15 | 16 | 17 | touch $LEMP_FLAG_DIR/JAVA_INSTALLED -------------------------------------------------------------------------------- /installers/kafka.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | DIR=$(dirname "${BASH_SOURCE[0]}") 5 | DIR=$(realpath "${DIR}") 6 | 7 | template_path="$(cd $DIR/../ && pwd)/templates" 8 | 9 | 10 | if [ "$EUID" -ne 0 ] 11 | then echo "Please run as root" 12 | exit 13 | fi 14 | 15 | adduser --gecos "" --disabled-password --no-create-home kafka 16 | 17 | 18 | mkdir -p /opt/kafka 19 | curl "https://downloads.apache.org/kafka/3.1.0/kafka_2.12-3.1.0.tgz" -o /opt/kafka/kafka.tgz 20 | tar -xvzf /opt/kafka/kafka.tgz -C /opt/kafka/ 21 | mv /opt/kafka/kafka_2.12-3.1.0/* /opt/kafka/ 22 | rm -rf kafka_2.12-3.1.0 23 | rm -rf kafka.tgz 24 | mkdir -p /opt/kafka/logs/ 25 | cp $template_path/kafka/kafka.service /etc/systemd/system/ 26 | cp $template_path/kafka/zookeeper.service /etc/systemd/system/ 27 | chown -R kafka:kafka /opt/kafka/ 28 | systemctl daemon-reload 29 | systemctl start kafka 30 | systemctl enable zookeeper 31 | systemctl enable kafka 32 | 33 | 34 | 35 | touch $LEMP_FLAG_DIR/KAFKA_INSTALLED 36 | touch $LEMP_FLAG_DIR/ZOOKEEPER_INSTALLED 37 | -------------------------------------------------------------------------------- /installers/kernel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | 8 | cp $template_path/kernel/sysctl.conf /etc/sysctl.conf 9 | sysctl -p /etc/sysctl.conf -------------------------------------------------------------------------------- /installers/mailserver.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | DIR=$(dirname "${BASH_SOURCE[0]}") 5 | DIR=$(realpath "${DIR}") 6 | 7 | template_path="$(cd $DIR/../ && pwd)/templates" 8 | source $DIR/../includes/helpers.sh 9 | 10 | if [ "$EUID" -ne 0 ] 11 | then echo "Please run as root" 12 | exit 13 | fi 14 | 15 | # Helper file to setup complete mailserver as this process is a little complicated 16 | # Install.sh would have been alot compliciated 17 | bash $DIR/postfix.sh 18 | systemctl stop postfix 19 | bash $DIR/dovecot.sh 20 | systemctl stop dovecot 21 | bash $DIR/postfixadmin.sh 22 | bash $DIR/roundcube.sh 23 | bash $DIR/dkim.sh 24 | systemctl start opendkim 25 | systemctl start postfix 26 | systemctl start dovecot 27 | systemctl restart nginx 28 | 29 | #TODO 30 | #https://www.linuxbabe.com/mail-server/postfix-amavis-spamassassin-clamav-ubuntu 31 | #https://www.linuxbabe.com/mail-server/block-email-spam-check-header-body-with-postfix-spamassassin 32 | 33 | 34 | 35 | touch $LEMP_FLAG_DIR/MAILSERVER_INSTALLED 36 | -------------------------------------------------------------------------------- /installers/meilisearch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | DIR=$(dirname "${BASH_SOURCE[0]}") 5 | DIR=$(realpath "${DIR}") 6 | 7 | template_path="$(cd $DIR/../ && pwd)/templates" 8 | source $DIR/../includes/helpers.sh 9 | 10 | 11 | if [ "$EUID" -ne 0 ] 12 | then echo "Please run as root" 13 | exit 14 | fi 15 | 16 | 17 | 18 | apt install curl -qqy 19 | 20 | curl -L https://install.meilisearch.com | sh 21 | mv ./meilisearch /usr/bin/ 22 | 23 | cp $template_path/meilisearch/meilisearch.service /etc/systemd/system/ 24 | 25 | 26 | sed -i "s/{{security_key}}/$(openssl rand -hex 24)/" /etc/systemd/system/meilisearch.service 27 | systemctl daemon-reload 28 | systemctl start meilisearch 29 | systemctl enable meilisearch 30 | 31 | 32 | touch $LEMP_FLAG_DIR/MEILISEARCH_INSTALLED -------------------------------------------------------------------------------- /installers/mongodb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common -qqy 15 | 16 | wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - 17 | add-apt-repository 'deb [arch=amd64] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse' -y 18 | apt update -qqy 19 | 20 | 21 | apt install mongodb -qqy 22 | cp $template_path/mongodb/mongodb.conf /etc/mongodb/mongodb.conf 23 | systemctl stop mongodb 24 | systemctl enable --now mongodb 25 | 26 | touch $LEMP_FLAG_DIR/MONGODB_INSTALLED -------------------------------------------------------------------------------- /installers/mysql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | DIR=$(dirname "${BASH_SOURCE[0]}") 5 | DIR=$(realpath "${DIR}") 6 | 7 | template_path="$(cd $DIR/../ && pwd)/templates" 8 | source $DIR/../includes/helpers.sh 9 | 10 | if [ "$EUID" -ne 0 ] 11 | then echo "Please run as root" 12 | exit 13 | fi 14 | 15 | 16 | # Install mysql-server 17 | apt install mysql-server -qqy 18 | systemctl stop mysql 19 | cp $template_path/mysql/10-lemp.cnf /etc/mysql/conf.d/ 20 | systemctl start mysql 21 | systemctl enable mysql 22 | 23 | # Create MYSQL Admin User 24 | 25 | masterUser="noaman" 26 | masterPassword="$(openssl rand -hex 12)" 27 | 28 | mysql -ve "CREATE USER '$masterUser'@'localhost' IDENTIFIED BY '$masterPassword'" 29 | mysql -ve "GRANT ALL PRIVILEGES ON *.* To '$masterUser'@'localhost'" 30 | mysql -ve "GRANT SESSION_VARIABLES_ADMIN ON *.* TO '$masterUser'@'localhost'"; 31 | mysql -ve "FLUSH PRIVILEGES;" 32 | 33 | 34 | echo "Database Username : $masterUser" 35 | echo "Database Password : $masterPassword" 36 | 37 | touch $LEMP_FLAG_DIR/MYSQL_INSTALLED -------------------------------------------------------------------------------- /installers/netdata.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | DIR=$(dirname "${BASH_SOURCE[0]}") 5 | DIR=$(realpath "${DIR}") 6 | 7 | template_path="$(cd $DIR/../ && pwd)/templates" 8 | 9 | 10 | if [ "$EUID" -ne 0 ] 11 | then echo "Please run as root" 12 | exit 13 | fi 14 | 15 | 16 | while getopts h: flag 17 | do 18 | case "${flag}" in 19 | h) hostname=${OPTARG};; 20 | esac 21 | done 22 | 23 | 24 | if [ -z "$hostname" ] 25 | then 26 | echo "Please provide a hostname using -h " 27 | exit 28 | fi 29 | 30 | 31 | apt install netdata -y 32 | 33 | systemctl stop netdata 34 | cp $template_path/netdata/netdata.conf /etc/netdata/ 35 | 36 | systemctl start netdata 37 | systemctl enable netdata 38 | 39 | 40 | 41 | nginx_vhost_file="/etc/nginx/apps-available/netdata.conf" 42 | nginx_vhost_enabled="/etc/nginx/apps-enabled/netdata.conf" 43 | cp $template_path/netdata/vhost.conf $nginx_vhost_file 44 | 45 | sed -i "s/{{domain}}/$HOSTNAME/" $nginx_vhost_file 46 | 47 | ln -s $nginx_vhost_file $nginx_vhost_enabled 48 | systemctl reload nginx 49 | 50 | touch $LEMP_FLAG_DIR/NETDATA_INSTALLED 51 | -------------------------------------------------------------------------------- /installers/nvm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | 10 | if [ "$EUID" -ne 0 ] 11 | then echo "Please run as root" 12 | exit 13 | fi 14 | 15 | # Remove already exisitng versions 16 | rm -rf $(which node) 17 | rm -rf $(which npm) 18 | 19 | # Install NVM -- Node Version Manager 20 | curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash 21 | export NVM_DIR="$HOME/.nvm" 22 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm 23 | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" 24 | nvm install node 25 | nvm use stable 26 | npm install --global yarn 27 | 28 | 29 | touch $LEMP_FLAG_DIR/NVM_INSTALLED -------------------------------------------------------------------------------- /installers/openldap.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/installers/openldap.sh -------------------------------------------------------------------------------- /installers/openresty.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run this as root" 11 | exit 12 | fi 13 | 14 | 15 | 16 | wget -O - https://openresty.org/package/pubkey.gpg | sudo apt-key add - 17 | 18 | echo "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main" \ 19 | | sudo tee /etc/apt/sources.list.d/openresty.list 20 | 21 | apt update -qqy 22 | apt install openresty -qqy 23 | systemctl stop nginx 24 | systemctl disable nginx 25 | cp $template_path/openresty/nginx-openresty.service /lib/systemd/system/nginx-openresty.service 26 | cp $template_path/openresty/nginx.conf /usr/local/openresty/nginx/conf/ 27 | cp -rf /etc/nginx/snippets /usr/local/openresty/nginx/conf/ 28 | sed -i "s/{{cpu_cores}}/$(grep -c ^processor /proc/cpuinfo)/" /usr/local/openresty/nginx/conf/nginx.conf 29 | 30 | 31 | systemctl daemon-reload 32 | systemctl restart nginx-openresty -------------------------------------------------------------------------------- /installers/phppgadmin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | while getopts u: flag 15 | do 16 | case "${flag}" in 17 | u) username=${OPTARG};; 18 | esac 19 | done 20 | 21 | 22 | 23 | if [ -z "$username" ] 24 | then 25 | username=$LEMP_HOSTNAME_USERNAME 26 | fi 27 | 28 | if ! id "$username" &>/dev/null 29 | then 30 | echo "The $username doesn't exist!" 31 | exit 32 | fi 33 | 34 | git clone https://github.com/phppgadmin/phppgadmin /var/www/home/$username/www/public/phppgadmin 35 | cp /var/www/home/$username/www/public/phppgadmin/conf/config.inc.php-dist /var/www/home/$username/www/public/phppgadmin/conf/config.inc.php 36 | fix-permissions -u $username 37 | 38 | 39 | touch $LEMP_FLAG_DIR/PHPPGADMIN_INSTALLED -------------------------------------------------------------------------------- /installers/postfix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | debconf-set-selections <<< "postfix postfix/mailname string ${HOSTNAME}" 15 | debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Site'" 16 | apt-get install --assume-yes postfix postfix-mysql 17 | touch /etc/aliases 18 | postalias /etc/aliases 19 | systemctl stop postfix 20 | 21 | 22 | 23 | touch $LEMP_FLAG_DIR/POSTFIX_INSTALLED 24 | -------------------------------------------------------------------------------- /installers/postgres.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | DIR=$(dirname "${BASH_SOURCE[0]}") 5 | DIR=$(realpath "${DIR}") 6 | 7 | template_path="$(cd $DIR/../ && pwd)/templates" 8 | 9 | 10 | if [ "$EUID" -ne 0 ] 11 | then echo "Please run as root" 12 | exit 13 | fi 14 | 15 | 16 | sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' 17 | wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - 18 | apt update 19 | apt install postgresql-14 -qqy 20 | sudo -u postgres createuser -s $(whoami); createdb $(whoami) 21 | psql -c 'REVOKE connect ON DATABASE root FROM PUBLIC' 22 | psql -c 'REVOKE connect ON DATABASE postgres FROM PUBLIC' 23 | 24 | touch $LEMP_FLAG_DIR/POSTGRES_INSTALLED -------------------------------------------------------------------------------- /installers/prereq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | source $DIR/../includes/helpers.sh 6 | 7 | if [ "$EUID" -ne 0 ] 8 | then echo "Please run as root" 9 | exit 10 | fi 11 | 12 | 13 | #Install prereq 14 | echo "" 15 | echo "" 16 | echo "_________________________" 17 | echo "" 18 | echo "Installing Pre Req Binaries" 19 | echo "" 20 | 21 | 22 | binaries_array=( "software-properties-common" "screen" "htop" "nload" "curl" "wget" "git" "unrar" "unzip" "zip" "speedtest-cli gzip" "pv" "logrotate" "rig" "runuser" "gnupg" "ca-certificates" "gnupg2" "sqlite3" "jq" "bc" "xclip" "tree" "dnsutils" "lsof" "members") 23 | 24 | for binary in ${binaries_array[@]}; do 25 | if ! command -v $binary &> /dev/null 26 | then 27 | echo "Installing $binary" 28 | apt-get install $binary -qqy 29 | fi 30 | done 31 | 32 | if ! command -v ifconfig &> /dev/null 33 | then 34 | apt-get install net-tools -qqy 35 | fi 36 | 37 | 38 | if ! command -v iotop &> /dev/null 39 | then 40 | apt-get install sysstat -qqy 41 | fi 42 | 43 | echo "" 44 | echo "All Binaries have been installed" 45 | echo "" 46 | echo "_________________________" 47 | -------------------------------------------------------------------------------- /installers/proftpd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -e 0 ] 10 | then echo "Please don't run this as root" 11 | exit 12 | fi 13 | 14 | # Install OpenSSL 15 | sudo apt-get install openssl -qqy 16 | 17 | # Install Proftpd 18 | sudo apt-get install proftpd -qqy 19 | 20 | useradd -s /bin/false sftp 21 | 22 | 23 | sudo systemctl start proftpd 24 | sudo systemctl enable proftpd 25 | 26 | 27 | touch $LEMP_FLAG_DIR/PROFTPD_INSTALLED -------------------------------------------------------------------------------- /installers/rabbitmq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | DIR=$(dirname "${BASH_SOURCE[0]}") 5 | DIR=$(realpath "${DIR}") 6 | 7 | template_path="$(cd $DIR/../ && pwd)/templates" 8 | 9 | 10 | if [ "$EUID" -ne 0 ] 11 | then echo "Please run as root" 12 | exit 13 | fi 14 | 15 | 16 | echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee /etc/apt/sources.list.d/rabbitmq.list 17 | wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add - 18 | 19 | apt update 20 | 21 | apt install rabbitmq-server -y 22 | 23 | systemctl start rabbitmq-server 24 | systemctl enable rabbitmq-server 25 | 26 | rabbitmq_password="$(openssl rand -hex 12)" 27 | rabbitmqctl add_user admin $rabbitmq_password 28 | rabbitmqctl set_user_tags admin administrator 29 | rabbitmqctl set_permissions -p / admin ".*" ".*" ".*" 30 | rabbitmq-plugins enable rabbitmq_management 31 | 32 | 33 | nginx_vhost_file="/etc/nginx/apps-available/rabbitmq.conf" 34 | nginx_vhost_enabled="/etc/nginx/apps-enabled/rabbitmq.conf" 35 | cp $template_path/rabbitmq/vhost.conf $nginx_vhost_file 36 | 37 | sed -i "s/{{domain}}/$HOSTNAME/" $nginx_vhost_file 38 | 39 | ln -s $nginx_vhost_file $nginx_vhost_enabled 40 | systemctl reload nginx 41 | 42 | 43 | touch $LEMP_FLAG_DIR/RABBITMQ_INSTALLED 44 | -------------------------------------------------------------------------------- /installers/ramdisk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | if [ "$EUID" -ne 0 ] 7 | then echo "Please run as root" 8 | exit 9 | fi 10 | 11 | 12 | sudo mkdir -p /var/cache/nginx/ramcache 13 | sudo mount -t tmpfs -o size=1G tmpfs /var/cache/nginx/ramcache 14 | 15 | 16 | touch $LEMP_FLAG_DIR/RAMDISK_INSTALLED 17 | -------------------------------------------------------------------------------- /installers/redis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | 15 | 16 | #Install Redis 17 | 18 | sudo apt install redis-server -qqy 19 | 20 | cp $template_path/redis/redis.conf /etc/redis/redis.conf 21 | #password=$(openssl rand 60 | openssl base64 -A) 22 | password=$(openssl rand -hex 32) 23 | sed -i "s/{{password}}/$password/" /etc/redis/redis.conf 24 | usermod -a -G nginx redis 25 | systemctl restart redis.service 26 | 27 | touch $LEMP_FLAG_DIR/REDIS_INSTALLED -------------------------------------------------------------------------------- /installers/rkhunter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | 10 | if [ "$EUID" -ne 0 ] 11 | then echo "Please run as root" 12 | exit 13 | fi 14 | 15 | apt install rkhunter -qqy 16 | cp -rf $template_path/rkhunter/rkhunter.conf /etc/rkhunter.conf 17 | 18 | 19 | touch $LEMP_FLAG_DIR/RKHUNTER_INSTALLED 20 | -------------------------------------------------------------------------------- /installers/scripts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | 15 | cp -rf $template_path/ssh/.profile $HOME/.profile 16 | cp -rf $template_path/ssh/.bashrc $HOME/.bashrc 17 | 18 | source $HOME/.profile 19 | source $HOME/.bashrc 20 | 21 | mkdir -p $HOME/.ssh/ 22 | cp -rf $template_path/ssh/.ssh/* $HOME/.ssh/ 23 | 24 | 25 | # Installing WP CLI 26 | 27 | curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -o /usr/bin/wp 28 | chmod +x /usr/bin/wp 29 | 30 | 31 | COMPOSER_ALLOW_SUPERUSER=1 composer global require laravel/installer 32 | 33 | -------------------------------------------------------------------------------- /installers/sentry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | 15 | 16 | 17 | 18 | nginx_vhost_file="/etc/nginx/apps-available/sentry.conf" 19 | nginx_vhost_enabled="/etc/nginx/apps-enabled/sentry.conf" 20 | cp $template_path/sentry/vhost.conf $nginx_vhost_file 21 | 22 | sed -i "s/{{domain}}/$HOSTNAME/" $nginx_vhost_file 23 | 24 | ln -s $nginx_vhost_file $nginx_vhost_enabled 25 | systemctl reload nginx 26 | 27 | 28 | touch $LEMP_FLAG_DIR/SENTRY_INSTALLED 29 | -------------------------------------------------------------------------------- /installers/shellinabox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | DIR=$(dirname "${BASH_SOURCE[0]}") 5 | DIR=$(realpath "${DIR}") 6 | 7 | template_path="$(cd $DIR/../ && pwd)/templates" 8 | 9 | 10 | if [ "$EUID" -ne 0 ] 11 | then echo "Please run as root" 12 | exit 13 | fi 14 | 15 | sudo apt-get install openssl shellinabox -qqy 16 | cp $template_path/shellinabox/shellinabox /etc/default/shellinabox 17 | cp $template_path/shellinabox/shellinabox.service /etc/systemd/system/shellinabox.service 18 | systemctl daemon-reload 19 | systemctl restart shellinabox 20 | 21 | 22 | 23 | nginx_vhost_file="/etc/nginx/apps-available/shellinabox.conf" 24 | nginx_vhost_enabled="/etc/nginx/apps-enabled/shellinabox.conf" 25 | cp $template_path/shellinabox/vhost.conf $nginx_vhost_file 26 | 27 | sed -i "s/{{domain}}/$HOSTNAME/" $nginx_vhost_file 28 | 29 | ln -s $nginx_vhost_file $nginx_vhost_enabled 30 | systemctl reload nginx 31 | 32 | 33 | touch $LEMP_FLAG_DIR/SHELLINABOX_INSTALLED 34 | -------------------------------------------------------------------------------- /installers/sogogroupware.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/installers/sogogroupware.sh -------------------------------------------------------------------------------- /installers/ssl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | # # Install python3 15 | # sudo apt install python3 python3-pip -y 16 | 17 | 18 | # Install Certbot 19 | #sudo apt install certbot python3-certbot-nginx -y 20 | mkdir -p /opt/certbot 21 | virtualenv /opt/certbot 22 | /opt/certbot/bin/pip install --upgrade pip 23 | /opt/certbot/bin/pip install certbot 24 | /opt/certbot/bin/pip install certbot-nginx 25 | ln -s /opt/certbot/bin/certbot /usr/bin/certbot 26 | mkdir -p /etc/letsencrypt/ 27 | cp -rf $template_path/letsencrypt/* /etc/letsencrypt/ 28 | 29 | 30 | 31 | touch $LEMP_FLAG_DIR/LETSENCRYPT_INSTALLED -------------------------------------------------------------------------------- /installers/supervisor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | 10 | 11 | if [ "$EUID" -ne 0 ] 12 | then echo "Please run as root" 13 | exit 14 | fi 15 | 16 | # Install supervisor 17 | apt-get install supervisor -qqy 18 | 19 | 20 | touch $LEMP_FLAG_DIR/SUPERVISOR_INSTALLED -------------------------------------------------------------------------------- /installers/zabbix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | 15 | wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-1+ubuntu20.04_all.deb -O /tmp/zabbix.deb 16 | dpkg -i /tmp/zabbix.deb 17 | apt update 18 | apt install zabbix-agent -qqy 19 | 20 | cp $template_path/zabbix/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.conf 21 | server_ip=$(ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p') 22 | sed -i "s/{{server_ip}}/$server_ip/" /etc/zabbix/zabbix_agentd.conf 23 | sed -i "s/{{domain}}/$HOSTNAME/" /etc/zabbix/zabbix_agentd.conf 24 | systemctl restart zabbix-agent 25 | 26 | 27 | touch $LEMP_FLAG_DIR/ZABBIX_INSTALLED -------------------------------------------------------------------------------- /templates/adminer/index.php: -------------------------------------------------------------------------------- 1 | array( "server" =>"127.0.0.1", "driver"=> "server" ), 17 | "PostgreSQL" => array( "server" =>"127.0.0.1", "driver"=> "pgsql" ) 18 | ]), 19 | new AdminerCSS([ 20 | 'adminer/adminer.css' 21 | ]) 22 | ); 23 | 24 | 25 | return new AdminerPlugin($plugins); 26 | } 27 | 28 | // include original Adminer or Adminer Editor 29 | include "./adminer.php"; 30 | ?> 31 | -------------------------------------------------------------------------------- /templates/adminer/plugins/css.php: -------------------------------------------------------------------------------- 1 | css = $css; 9 | } 10 | 11 | function css() { 12 | $return = array(); 13 | 14 | foreach($this->css as $css) 15 | { 16 | $return[] = $css; 17 | } 18 | 19 | return $return; 20 | } 21 | } -------------------------------------------------------------------------------- /templates/adminer/vhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 6240 ssl; 3 | 4 | root {{www_path}}; 5 | index index.php index.html index.htm; 6 | server_name {{domain}}; 7 | 8 | error_log {{user_root}}/logs/nginx/error.log; 9 | 10 | #include /etc/nginx/performance.conf; 11 | 12 | 13 | location / { 14 | # First attempt to serve request as file, then 15 | # as directory, then fall back to displaying a 404. 16 | try_files $uri $uri/ /index.php?$args; 17 | } 18 | 19 | location ~ \.php$ 20 | { 21 | include snippets/fastcgi-php.conf; 22 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 23 | fastcgi_pass unix:/var/run/php/{{username}}-php-fpm.sock; 24 | } 25 | 26 | location ~ /\.ht { 27 | deny all; 28 | } 29 | 30 | error_page 497 https://$server_name:$server_port$request_uri; 31 | 32 | ssl_certificate /etc/letsencrypt/live/{{domain}}/fullchain.pem; # managed by Certbot 33 | ssl_certificate_key /etc/letsencrypt/live/{{domain}}/privkey.pem; # managed by Certbot 34 | include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot 35 | ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot 36 | 37 | } -------------------------------------------------------------------------------- /templates/cron/backup-sites: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/cron/backup-sites -------------------------------------------------------------------------------- /templates/cron/certbot: -------------------------------------------------------------------------------- 1 | 0 0 * * * /usr/bin/certbot renew --nginx --nginx-ctl /usr/sbin/nginx 2 | -------------------------------------------------------------------------------- /templates/cron/lemp: -------------------------------------------------------------------------------- 1 | # Update Git Repo 2 | 0 22 * * * /opt/lemp/bin/update-lemp-repo 3 | 4 | # Run updater 5 | 0 23 * * * /opt/lemp/bin/update-lemp 6 | -------------------------------------------------------------------------------- /templates/cron/mailserver: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/cron/mailserver -------------------------------------------------------------------------------- /templates/dkim/opendkim: -------------------------------------------------------------------------------- 1 | # Command-line options specified here will override the contents of 2 | # /etc/opendkim.conf. See opendkim(8) for a complete list of options. 3 | #DAEMON_OPTS="" 4 | # Change to /var/spool/postfix/run/opendkim to use a Unix socket with 5 | # postfix in a chroot: 6 | #RUNDIR=/var/spool/postfix/run/opendkim 7 | RUNDIR=/run/opendkim 8 | # 9 | # Uncomment to specify an alternate socket 10 | # Note that setting this will override any Socket value in opendkim.conf 11 | # default: 12 | SOCKET=local:/var/spool/postfix/opendkim/opendkim.sock 13 | # listen on all interfaces on port 54321: 14 | #SOCKET=inet:54321 15 | # listen on loopback on port 12345: 16 | #SOCKET=inet:12345@localhost 17 | # listen on 192.0.2.1 on port 12345: 18 | #SOCKET=inet:12345@192.0.2.1 19 | USER=opendkim 20 | GROUP=opendkim 21 | PIDFILE=$RUNDIR/$NAME.pid 22 | EXTRAAFTER= 23 | -------------------------------------------------------------------------------- /templates/glitchtip/.env: -------------------------------------------------------------------------------- 1 | DATABASE_URL="postgres://glitchtip@/glitchtip?host=/var/run/postgresql" 2 | SECRET_KEY="{{hash}}" 3 | REDIS_HOST=127.0.0.1 4 | REDIS_DATABASE=13 5 | EMAIL_URL="smtp://glitchtip@localhost" 6 | DEFAULT_FROM_EMAIL="glitchtip@{{domain}}" 7 | GLITCHTIP_DOMAIN="{{domain}}" -------------------------------------------------------------------------------- /templates/glitchtip/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.4" 2 | x-environment: 3 | &default-environment 4 | DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres 5 | SECRET_KEY: change_me 6 | PORT: 6145 7 | x-depends_on: 8 | &default-depends_on 9 | - postgres 10 | - redis 11 | 12 | services: 13 | postgres: 14 | image: postgres:13 15 | environment: 16 | POSTGRES_HOST_AUTH_METHOD: "trust" 17 | restart: unless-stopped 18 | redis: 19 | image: redis 20 | restart: unless-stopped 21 | web: 22 | image: glitchtip/glitchtip 23 | depends_on: *default-depends_on 24 | ports: 25 | - "6145:6145" 26 | environment: *default-environment 27 | restart: unless-stopped 28 | worker: 29 | image: glitchtip/glitchtip 30 | command: ./bin/run-celery-with-beat.sh 31 | depends_on: *default-depends_on 32 | environment: *default-environment 33 | restart: unless-stopped 34 | migrate: 35 | image: glitchtip/glitchtip 36 | depends_on: *default-depends_on 37 | command: "./manage.py migrate" 38 | environment: *default-environment -------------------------------------------------------------------------------- /templates/glitchtip/glitchtip.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=GlitchTip Container 3 | After=docker.service 4 | Requires=docker.service 5 | 6 | [Service] 7 | TimeoutStartSec=0 8 | Restart=always 9 | User=docker 10 | Type=forking 11 | ExecStart=/usr/bin/docker-compose -f /opt/glitchtip/docker-compose.yml up -d 12 | ExecStop=/usr/bin/docker-compose -f /opt/glitchtip/docker-compose.yml down 13 | 14 | [Install] 15 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /templates/glitchtip/vhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 6140 ssl; 3 | 4 | server_name {{domain}}; 5 | 6 | auth_basic "Restricted Access"; 7 | auth_basic_user_file /etc/nginx/htpasswd; 8 | 9 | location / { 10 | 11 | #Defauly ProxyPass configurations 12 | include /etc/nginx/proxypass.conf; 13 | 14 | #Required for basic auth 15 | proxy_set_header Authorization ""; 16 | #Finally forwared it the reverse proxy app 17 | proxy_pass http://127.0.0.1:7150; 18 | 19 | } 20 | 21 | error_page 497 https://$server_name:$server_port$request_uri; 22 | 23 | ssl_certificate /etc/letsencrypt/live/{{domain}}/fullchain.pem; # managed by Certbot 24 | ssl_certificate_key /etc/letsencrypt/live/{{domain}}/privkey.pem; # managed by Certbot 25 | include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot 26 | ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot 27 | 28 | } -------------------------------------------------------------------------------- /templates/jailkit/bin/clear-cache: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | rm -rf /home/$username/cache/nginx/* 5 | echo "Cache Purged" 6 | -------------------------------------------------------------------------------- /templates/jailkit/bin/delete-wp-plugin: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | 5 | if [ ! -f "/home/$username/www/wp-config.php" ] 6 | then 7 | echo "There is not a wordpress site" 8 | exit; 9 | fi 10 | 11 | wp --path=/home/$username/www plugin delete $plugin 12 | 13 | 14 | -------------------------------------------------------------------------------- /templates/jailkit/bin/disable-cache: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # TODO 4 | # Allow jailed users to disable cache from inside the chroot 5 | 6 | -------------------------------------------------------------------------------- /templates/jailkit/bin/enable-cache: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # TODO 4 | # Allow jailed users to disable cache from inside the chroot 5 | 6 | -------------------------------------------------------------------------------- /templates/jailkit/bin/toggle-php: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | while getopts p: flag 5 | do 6 | case "${flag}" in 7 | p) php=${OPTARG};; 8 | esac 9 | done 10 | 11 | if [ -z "$username" ] 12 | then 13 | echo "Please provide a username using -u " 14 | exit 1; 15 | fi 16 | 17 | 18 | if [ ! -L "/home/$username/bin/php" ] 19 | then 20 | echo "This is not a PHP site" 21 | exit 1; 22 | fi 23 | 24 | # TODO 25 | # Allow jailed users to toggle php from inside the chroot 26 | 27 | -------------------------------------------------------------------------------- /templates/jailkit/bin/wp-users: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$(dirname "${BASH_SOURCE[0]}") 4 | DIR=$(realpath "${DIR}") 5 | 6 | template_path="$(cd $DIR/../ && pwd)/templates" 7 | source $DIR/../includes/helpers.sh 8 | 9 | if [ "$EUID" -ne 0 ] 10 | then echo "Please run as root" 11 | exit 12 | fi 13 | 14 | 15 | username=$(pwd | cut -d / -f 5) 16 | 17 | if [ -z "$username" ] 18 | then 19 | echo "Please provide a username using -u " 20 | exit 21 | fi 22 | 23 | 24 | if ! id "$username" &>/dev/null 25 | then 26 | echo "The $username doesn't exist" 27 | exit; 28 | fi 29 | 30 | chroot_home=/var/www/home/$username 31 | www_path=$chroot_home/www 32 | 33 | $chroot_home/.local/bin/php /var/www/bin/wp --allow-root --path=$www_path user list -------------------------------------------------------------------------------- /templates/jenkins/basic-security.groovy: -------------------------------------------------------------------------------- 1 | #!groovy 2 | 3 | import jenkins.model.* 4 | import hudson.security.* 5 | import jenkins.install.*; 6 | 7 | def instance = Jenkins.getInstance() 8 | instance.setInstallState(InstallState.INITIAL_SETUP_COMPLETED) 9 | 10 | def hudsonRealm = new HudsonPrivateSecurityRealm(false) 11 | 12 | hudsonRealm.createAccount("{{username}}","{{password}}") 13 | instance.setSecurityRealm(hudsonRealm) 14 | instance.save() -------------------------------------------------------------------------------- /templates/jenkins/vhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 6150 ssl; 3 | 4 | server_name {{domain}}; 5 | 6 | auth_basic "Restricted Access"; 7 | auth_basic_user_file /etc/nginx/htpasswd; 8 | 9 | 10 | 11 | location / { 12 | 13 | #Defauly ProxyPass configurations 14 | include /etc/nginx/proxypass.conf; 15 | 16 | #Required for basic auth 17 | proxy_set_header Authorization ""; 18 | #Finally forwared it the reverse proxy app 19 | proxy_pass http://127.0.0.1:7150; 20 | 21 | 22 | } 23 | 24 | error_page 497 https://$server_name:$server_port$request_uri; 25 | 26 | ssl_certificate /etc/letsencrypt/live/{{domain}}/fullchain.pem; # managed by Certbot 27 | ssl_certificate_key /etc/letsencrypt/live/{{domain}}/privkey.pem; # managed by Certbot 28 | include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot 29 | ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot 30 | 31 | } -------------------------------------------------------------------------------- /templates/kafka/kafka.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Requires=zookeeper.service 3 | After=zookeeper.service 4 | 5 | [Service] 6 | Type=simple 7 | User=kafka 8 | ExecStart=/bin/sh -c '/opt/kafka/bin/kafka-server-start.sh /opt/kafka/config/server.properties > /opt/kafka/logs/kafka.log 2>&1' 9 | ExecStop=/opt/kafka/bin/kafka-server-stop.sh 10 | Restart=on-abnormal 11 | 12 | [Install] 13 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /templates/kafka/zookeeper.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Requires=network.target remote-fs.target 3 | After=network.target remote-fs.target 4 | 5 | [Service] 6 | Type=simple 7 | User=kafka 8 | ExecStart=/opt/kafka/bin/zookeeper-server-start.sh /opt/kafka/config/zookeeper.properties 9 | ExecStop=/opt/kafka/bin/zookeeper-server-stop.sh 10 | Restart=on-abnormal 11 | 12 | [Install] 13 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /templates/kibana/vhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 6100 ssl; 3 | 4 | server_name {{domain}}; 5 | 6 | auth_basic "Restricted Access"; 7 | auth_basic_user_file /etc/nginx/htpasswd; 8 | 9 | location / { 10 | 11 | #Defauly ProxyPass configurations 12 | include /etc/nginx/proxypass.conf; 13 | 14 | #Required for basic auth 15 | proxy_set_header Authorization ""; 16 | #Finally forwared it the reverse proxy app 17 | proxy_pass http://127.0.0.1:7100; 18 | } 19 | 20 | error_page 497 https://$server_name:$server_port$request_uri; 21 | 22 | ssl_certificate /etc/letsencrypt/live/{{domain}}/fullchain.pem; # managed by Certbot 23 | ssl_certificate_key /etc/letsencrypt/live/{{domain}}/privkey.pem; # managed by Certbot 24 | include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot 25 | ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot 26 | 27 | } -------------------------------------------------------------------------------- /templates/letsencrypt/options-ssl-nginx.conf: -------------------------------------------------------------------------------- 1 | # This file contains important security parameters. If you modify this file 2 | # manually, Certbot will be unable to automatically provide future security 3 | # updates. Instead, Certbot will print and log an error message with a path to 4 | # the up-to-date file that you will need to refer to when manually updating 5 | # this file. 6 | 7 | ssl_session_cache shared:le_nginx_SSL:10m; 8 | ssl_session_timeout 1440m; 9 | ssl_session_tickets off; 10 | 11 | ssl_protocols TLSv1.2 TLSv1.3; 12 | ssl_prefer_server_ciphers off; 13 | 14 | ssl_stapling on; 15 | ssl_stapling_verify on; 16 | resolver 8.8.8.8 8.8.4.4 valid=300s; 17 | 18 | ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA"; -------------------------------------------------------------------------------- /templates/letsencrypt/renewal-hooks/deploy/reload-dovecot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | systemctl reload dovecot -------------------------------------------------------------------------------- /templates/letsencrypt/renewal-hooks/deploy/reload-nginx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | systemctl reload nginx -------------------------------------------------------------------------------- /templates/letsencrypt/ssl-dhparams.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIIBCAKCAQEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz 3 | +8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a 4 | 87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7 5 | YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi 6 | 7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD 7 | ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg== 8 | -----END DH PARAMETERS----- -------------------------------------------------------------------------------- /templates/logrotate/site.conf: -------------------------------------------------------------------------------- 1 | /home/{{username}}/logs/nginx/access.log { 2 | daily 3 | rotate 7 4 | size 10M 5 | compress 6 | delaycompress 7 | } 8 | 9 | /home/{{username}}/logs/nginx/error.log { 10 | daily 11 | rotate 7 12 | size 10M 13 | compress 14 | delaycompress 15 | } -------------------------------------------------------------------------------- /templates/logstash/conf.d/02-beats-input.conf: -------------------------------------------------------------------------------- 1 | input { 2 | beats { 3 | port => 5044 4 | } 5 | } -------------------------------------------------------------------------------- /templates/logstash/conf.d/30-elasticsearch-output.conf: -------------------------------------------------------------------------------- 1 | output { 2 | if [@metadata][pipeline] { 3 | elasticsearch { 4 | hosts => ["localhost:9200"] 5 | manage_template => false 6 | index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}" 7 | pipeline => "%{[@metadata][pipeline]}" 8 | } 9 | } else { 10 | elasticsearch { 11 | hosts => ["localhost:9200"] 12 | manage_template => false 13 | index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}" 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /templates/mailhog/vhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 6120 ssl; 3 | 4 | server_name {{domain}}; 5 | 6 | auth_basic "Restricted Access"; 7 | auth_basic_user_file /etc/nginx/htpasswd; 8 | 9 | location / { 10 | 11 | #Defauly ProxyPass configurations 12 | include /etc/nginx/proxypass.conf; 13 | 14 | #Required for basic auth 15 | proxy_set_header Authorization ""; 16 | #Finally forwared it the reverse proxy app 17 | proxy_pass http://127.0.0.1:7150; 18 | 19 | } 20 | 21 | error_page 497 https://$server_name:$server_port$request_uri; 22 | 23 | ssl_certificate /etc/letsencrypt/live/{{domain}}/fullchain.pem; # managed by Certbot 24 | ssl_certificate_key /etc/letsencrypt/live/{{domain}}/privkey.pem; # managed by Certbot 25 | include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot 26 | ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot 27 | 28 | } -------------------------------------------------------------------------------- /templates/meilisearch/meilisearch.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Meilisearch 3 | After=systemd-user-sessions.service 4 | 5 | [Service] 6 | Type=simple 7 | ExecStart=/usr/bin/meilisearch --http-addr 127.0.0.1:7700 --env production --master-key {{security_key}} 8 | 9 | [Install] 10 | WantedBy=default.target -------------------------------------------------------------------------------- /templates/mongodb_express/mongodb_express.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Mongodb Express A GUI Tool for mongodb 3 | Requires=mongodb.service 4 | After=network.target 5 | 6 | [Service] 7 | Type=simple 8 | Environment=NVM_DIR=/opt/mongodb_express/.nvm 9 | Environment=VCAP_APP_PORT=7180 10 | Environment=VCAP_APP_HOST=127.0.0.1 11 | Environment=ME_CONFIG_BASICAUTH_USERNAME='' 12 | User=mongodb_express 13 | WorkingDirectory=/opt/mongodb_express/node_modules/mongo-express 14 | ExecStart=/bin/bash -l -c 'exec "$@"' _ node app.js 15 | #Restart=on-failure 16 | 17 | [Install] 18 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /templates/mongodb_express/vhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 6180 ssl; 3 | 4 | server_name {{domain}}; 5 | 6 | auth_basic "Restricted Access"; 7 | auth_basic_user_file /etc/nginx/htpasswd; 8 | 9 | location / { 10 | proxy_pass http://127.0.0.1:7180; 11 | proxy_http_version 1.1; 12 | proxy_set_header Upgrade $http_upgrade; 13 | proxy_set_header Connection 'upgrade'; 14 | proxy_set_header Host $host; 15 | proxy_cache_bypass $http_upgrade; 16 | } 17 | 18 | error_page 497 https://$server_name:$server_port$request_uri; 19 | 20 | ssl_certificate /etc/letsencrypt/live/{{domain}}/fullchain.pem; # managed by Certbot 21 | ssl_certificate_key /etc/letsencrypt/live/{{domain}}/privkey.pem; # managed by Certbot 22 | include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot 23 | ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot 24 | 25 | } -------------------------------------------------------------------------------- /templates/monit/alert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -------------------------------------------------------------------------------- /templates/monit/cron.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/monit/cron.conf -------------------------------------------------------------------------------- /templates/monit/diskspace.conf: -------------------------------------------------------------------------------- 1 | check filesystem rootfs with path / 2 | if space usage > 80% then exec "/usr/local/bin/slack.sh" else if succeeded then exec "/usr/local/bin/slack.sh" 3 | -------------------------------------------------------------------------------- /templates/monit/mysql.conf: -------------------------------------------------------------------------------- 1 | check process mysqld with pidfile /var/run/mysqld/mysqld.pid 2 | group database 3 | group mysql 4 | start program = "/etc/init.d/mysql start" 5 | stop program = "/etc/init.d/mysql stop" 6 | if failed host localhost port 3306 protocol mysql with timeout 15 seconds for 3 times within 4 cycles 7 | then exec "/usr/local/bin/slack.sh" 8 | else if succeeded then exec "/usr/local/bin/slack.sh" 9 | if failed host localhost port 3306 protocol mysql with timeout 15 seconds for 3 times within 4 cycles then restart 10 | if failed unixsocket /var/run/mysqld/mysqld.sock protocol mysql for 3 times within 4 cycles then restart 11 | if 5 restarts with 5 cycles then timeout 12 | depend mysql_bin 13 | depend mysql_rc 14 | 15 | check file mysql_bin with path /usr/sbin/mysqld 16 | group mysql 17 | include /etc/monit/templates/rootbin 18 | 19 | check file mysql_rc with path /etc/init.d/mysql 20 | group mysql 21 | include /etc/monit/templates/rootbin 22 | -------------------------------------------------------------------------------- /templates/monit/nginx.conf: -------------------------------------------------------------------------------- 1 | check process nginx with pidfile /var/run/nginx.pid 2 | group www 3 | group nginx 4 | start program = "/etc/init.d/nginx start" 5 | stop program = "/etc/init.d/nginx stop" 6 | if failed port 80 protocol http 7 | then exec "/usr/local/bin/slack.sh" 8 | else if succeeded then exec "/usr/local/bin/slack.sh" 9 | if failed port 80 protocol http request "/" then restart 10 | if 5 restarts with 5 cycles then timeout 11 | depend nginx_bin 12 | depend nginx_rc 13 | 14 | check file nginx_bin with path /usr/sbin/nginx 15 | group nginx 16 | include /etc/monit/templates/rootbin 17 | 18 | check file nginx_rc with path /etc/init.d/nginx 19 | group nginx 20 | include /etc/monit/templates/rootbin 21 | -------------------------------------------------------------------------------- /templates/monit/php-fpm/5.6.conf: -------------------------------------------------------------------------------- 1 | check process php5.6-fpm with pidfile /var/run/php/php5.6-fpm.pid 2 | start program = "/etc/init.d/php5.6-fpm start" 3 | stop program = "/etc/init.d/php5.6-fpm stop" 4 | if failed unixsocket /run/php/php5.6-fpm.sock then restart 5 | if 5 restarts within 5 cycles then timeout 6 | -------------------------------------------------------------------------------- /templates/monit/php-fpm/7.0.conf: -------------------------------------------------------------------------------- 1 | check process php7.0-fpm with pidfile /var/run/php/php7.0-fpm.pid 2 | start program = "/etc/init.d/php7.0-fpm start" 3 | stop program = "/etc/init.d/php7.0-fpm stop" 4 | if failed unixsocket /run/php/php7.0-fpm.sock then restart 5 | if 5 restarts within 5 cycles then timeout 6 | -------------------------------------------------------------------------------- /templates/monit/php-fpm/7.1.conf: -------------------------------------------------------------------------------- 1 | check process php7.1-fpm with pidfile /var/run/php/php7.1-fpm.pid 2 | start program = "/etc/init.d/php7.1-fpm start" 3 | stop program = "/etc/init.d/php7.1-fpm stop" 4 | if failed unixsocket /run/php/php7.1-fpm.sock then restart 5 | if 5 restarts within 5 cycles then timeout 6 | -------------------------------------------------------------------------------- /templates/monit/php-fpm/7.2.conf: -------------------------------------------------------------------------------- 1 | check process php7.2-fpm with pidfile /var/run/php/php7.2-fpm.pid 2 | start program = "/etc/init.d/php7.2-fpm start" 3 | stop program = "/etc/init.d/php7.2-fpm stop" 4 | if failed unixsocket /run/php/php7.2-fpm.sock then restart 5 | if 5 restarts within 5 cycles then timeout 6 | -------------------------------------------------------------------------------- /templates/monit/php-fpm/7.3.conf: -------------------------------------------------------------------------------- 1 | check process php7.3-fpm with pidfile /var/run/php/php7.3-fpm.pid 2 | start program = "/etc/init.d/php7.3-fpm start" 3 | stop program = "/etc/init.d/php7.3-fpm stop" 4 | if failed unixsocket /run/php/php7.3-fpm.sock then restart 5 | if 5 restarts within 5 cycles then timeout 6 | -------------------------------------------------------------------------------- /templates/monit/php-fpm/7.4.conf: -------------------------------------------------------------------------------- 1 | check process php7.4-fpm with pidfile /var/run/php/php7.4-fpm.pid 2 | start program = "/etc/init.d/php7.4-fpm start" 3 | stop program = "/etc/init.d/php7.4-fpm stop" 4 | if failed unixsocket /run/php/php7.4-fpm.sock then restart 5 | if 5 restarts within 5 cycles then timeout 6 | -------------------------------------------------------------------------------- /templates/monit/php-fpm/8.0.conf: -------------------------------------------------------------------------------- 1 | check process php8.0-fpm with pidfile /var/run/php/php8.0-fpm.pid 2 | start program = "/etc/init.d/php8.0-fpm start" 3 | stop program = "/etc/init.d/php8.0-fpm stop" 4 | if failed unixsocket /run/php/php8.0-fpm.sock then restart 5 | if 5 restarts within 5 cycles then timeout 6 | -------------------------------------------------------------------------------- /templates/monit/php-fpm/8.1.conf: -------------------------------------------------------------------------------- 1 | check process php8.1-fpm with pidfile /var/run/php/php8.1-fpm.pid 2 | start program = "/etc/init.d/php8.1-fpm start" 3 | stop program = "/etc/init.d/php8.1-fpm stop" 4 | if failed unixsocket /run/php/php8.1-fpm.sock then restart 5 | if 5 restarts within 5 cycles then timeout 6 | -------------------------------------------------------------------------------- /templates/monit/php-fpm/8.2.conf: -------------------------------------------------------------------------------- 1 | check process php8.2-fpm with pidfile /var/run/php/php8.2-fpm.pid 2 | start program = "/etc/init.d/php8.2-fpm start" 3 | stop program = "/etc/init.d/php8.2-fpm stop" 4 | if failed unixsocket /run/php/php8.2-fpm.sock then restart 5 | if 5 restarts within 5 cycles then timeout 6 | -------------------------------------------------------------------------------- /templates/monit/site.conf: -------------------------------------------------------------------------------- 1 | check host {{domain}} with address {{domain}} 2 | if failed 3 | port 80 protocol http request / 4 | with timeout 1 seconds 5 | status >= "200" 6 | status < "400" 7 | then exec "/usr/local/bin/slack.sh" 8 | else if succeeded then exec "/usr/local/bin/slack.sh" 9 | 10 | if failed 11 | port 443 protocol https request / 12 | with timeout 1 seconds 13 | certificate valid > 10 days 14 | status >= "200" 15 | status < "400" 16 | then exec "/usr/local/bin/slack.sh" 17 | else if succeeded then exec "/usr/local/bin/slack.sh" 18 | -------------------------------------------------------------------------------- /templates/monit/slack.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Slack webhook URL was never setup 4 | if [ ! -f "/opt/slack_webhook_url" ] 5 | then 6 | exit 7 | fi 8 | 9 | 10 | URL=$(cat /opt/slack_webhook_url) 11 | 12 | if [ -z "$URL" ] 13 | then 14 | exit 15 | fi 16 | 17 | COLOR=${MONIT_COLOR:-$([[ $MONIT_EVENT == *"succeeded"* ]] && echo good || echo danger)} 18 | TEXT=$(echo -e "$MONIT_EVENT: $MONIT_DESCRIPTION" | python3 -c "import json,sys;print(json.dumps(sys.stdin.read()))") 19 | 20 | PAYLOAD="{ 21 | \"attachments\": [ 22 | { 23 | \"text\": $TEXT, 24 | \"color\": \"$COLOR\", 25 | \"mrkdwn_in\": [\"text\"], 26 | \"fields\": [ 27 | { \"title\": \"Date\", \"value\": \"$MONIT_DATE\", \"short\": true }, 28 | { \"title\": \"Host\", \"value\": \"$MONIT_HOST\", \"short\": true } 29 | ] 30 | } 31 | ] 32 | }" 33 | 34 | curl -s -X POST --data-urlencode "payload=$PAYLOAD" $URL 35 | -------------------------------------------------------------------------------- /templates/monit/ssh.conf: -------------------------------------------------------------------------------- 1 | check process sshd with pidfile /var/run/sshd.pid 2 | group system 3 | group sshd 4 | start program = "/etc/init.d/ssh start" 5 | stop program = "/etc/init.d/ssh stop" 6 | if failed host localhost port 6000 with proto ssh 7 | then exec "/usr/local/bin/slack.sh" 8 | else if succeeded then exec "/usr/local/bin/slack.sh" 9 | if failed host localhost port 6000 with proto ssh then restart 10 | if 5 restarts with 5 cycles then timeout 11 | depend on sshd_bin 12 | depend on sftp_bin 13 | depend on sshd_rc 14 | depend on sshd_rsa_key 15 | depend on sshd_dsa_key 16 | 17 | check file sshd_bin with path /usr/sbin/sshd 18 | group sshd 19 | include /etc/monit/templates/rootbin 20 | 21 | check file sftp_bin with path /usr/lib/openssh/sftp-server 22 | group sshd 23 | include /etc/monit/templates/rootbin 24 | 25 | check file sshd_rsa_key with path /etc/ssh/ssh_host_rsa_key 26 | group sshd 27 | include /etc/monit/templates/rootstrict 28 | 29 | check file sshd_dsa_key with path /etc/ssh/ssh_host_dsa_key 30 | group sshd 31 | include /etc/monit/templates/rootstrict 32 | 33 | check file sshd_rc with path /etc/ssh/sshd_config 34 | group sshd 35 | include /etc/monit/templates/rootrc -------------------------------------------------------------------------------- /templates/monit/system.conf: -------------------------------------------------------------------------------- 1 | check system $HOST 2 | if memory > 80% for 2 cycles then exec "/usr/local/bin/slack.sh" else if succeeded then exec "/usr/local/bin/slack.sh" 3 | if swap > 80% for 2 cycles then exec "/usr/local/bin/slack.sh" else if succeeded then exec "/usr/local/bin/slack.sh" 4 | if cpu > 80% for 2 cycles then exec "/usr/local/bin/slack.sh" else if succeeded then exec "/usr/local/bin/slack.sh" 5 | if loadavg (5min) > 1 for 2 cycles then exec "/usr/local/bin/slack.sh" else if succeeded then exec "/usr/local/bin/slack.sh" 6 | -------------------------------------------------------------------------------- /templates/monit/vhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 6170 ssl; 3 | 4 | server_name {{domain}}; 5 | 6 | auth_basic "Restricted Access"; 7 | auth_basic_user_file /etc/nginx/htpasswd; 8 | 9 | 10 | 11 | location / { 12 | 13 | #Defauly ProxyPass configurations 14 | include /etc/nginx/proxypass.conf; 15 | 16 | #Required for basic auth 17 | proxy_set_header Authorization ""; 18 | #Finally forwared it the reverse proxy app 19 | proxy_pass http://127.0.0.1:7170; 20 | 21 | 22 | } 23 | error_page 497 https://$server_name:$server_port$request_uri; 24 | 25 | ssl_certificate /etc/letsencrypt/live/{{domain}}/fullchain.pem; # managed by Certbot 26 | ssl_certificate_key /etc/letsencrypt/live/{{domain}}/privkey.pem; # managed by Certbot 27 | include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot 28 | ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot 29 | 30 | } -------------------------------------------------------------------------------- /templates/mysql/10-lemp.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | default_authentication_plugin=mysql_native_password 3 | max_connections=24 4 | connect_timeout=30 5 | wait_timeout=30 6 | thread_cache_size=24 7 | sort_buffer_size=1M 8 | join_buffer_size=1M 9 | tmp_table_size=8M 10 | max_heap_table_size=8M 11 | binlog_cache_size=8M 12 | performance_schema=ON 13 | binlog_stmt_cache_size=8M 14 | key_buffer_size=1M 15 | table_open_cache=64 16 | read_buffer_size=1M 17 | # Removed in MySQL 8 18 | #query_cache_limit=1M 19 | #query_cache_type=OFF 20 | #query_cache_size=0 21 | innodb_buffer_pool_size=96M 22 | innodb_open_files=1024 23 | innodb_io_capacity=1024 24 | innodb_buffer_pool_instances=5 25 | default-storage-engine=InnoDB 26 | #skip-name-resolve 27 | max_allowed_packet=128M 28 | skip-log-bin 29 | 30 | -------------------------------------------------------------------------------- /templates/netdata/netdata.conf: -------------------------------------------------------------------------------- 1 | # NetData Configuration 2 | 3 | # The current full configuration can be retrieved from the running 4 | # server at the URL 5 | # 6 | # http://localhost:19999/netdata.conf 7 | # 8 | # for example: 9 | # 10 | # wget -O /etc/netdata/netdata.conf http://localhost:19999/netdata.conf 11 | # 12 | 13 | [global] 14 | run as user = netdata 15 | web files owner = root 16 | web files group = root 17 | # Netdata is not designed to be exposed to potentially hostile 18 | # networks. See https://github.com/netdata/netdata/issues/164 19 | bind socket to IP = 127.0.0.1 20 | default port = 7130 21 | -------------------------------------------------------------------------------- /templates/netdata/vhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 6130 ssl; 3 | 4 | server_name {{domain}}; 5 | 6 | auth_basic "Restricted Access"; 7 | auth_basic_user_file /etc/nginx/htpasswd; 8 | 9 | location / { 10 | proxy_pass http://127.0.0.1:7130; 11 | proxy_http_version 1.1; 12 | proxy_set_header Upgrade $http_upgrade; 13 | proxy_set_header Connection 'upgrade'; 14 | proxy_set_header Host $host; 15 | proxy_cache_bypass $http_upgrade; 16 | } 17 | 18 | error_page 497 https://$server_name:$server_port$request_uri; 19 | 20 | ssl_certificate /etc/letsencrypt/live/{{domain}}/fullchain.pem; # managed by Certbot 21 | ssl_certificate_key /etc/letsencrypt/live/{{domain}}/privkey.pem; # managed by Certbot 22 | include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot 23 | ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot 24 | 25 | } -------------------------------------------------------------------------------- /templates/nginx/angular/vhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | root {{www_path}}; 4 | index index.html index.htm; 5 | server_name {{domain}}; 6 | 7 | error_log {{user_root}}/logs/nginx/error.log; 8 | 9 | include /etc/nginx/performance.conf; 10 | 11 | location /{ 12 | try_files $uri $uri/ =404; 13 | } 14 | 15 | location ~ /\.ht { 16 | deny all; 17 | } 18 | 19 | #SSL_DISABLED if ($https != on) { return 301 https://$host$request_uri; } 20 | #SSL_DISABLED listen 443 ssl http2; # managed by Certbot 21 | #SSL_DISABLED ssl_certificate /etc/letsencrypt/live/{{domain}}/fullchain.pem; # managed by Certbot 22 | #SSL_DISABLED ssl_certificate_key /etc/letsencrypt/live/{{domain}}/privkey.pem; # managed by Certbot 23 | #SSL_DISABLED ssl_trusted_certificate /etc/letsencrypt/live/{{domain}}/chain.pem; # managed by Certbot 24 | #SSL_DISABLED include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot 25 | #SSL_DISABLED ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot 26 | 27 | } -------------------------------------------------------------------------------- /templates/nginx/basic/vhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | root {{www_path}}; 4 | index index.html index.htm; 5 | server_name {{domain}}; 6 | 7 | error_log {{user_root}}/logs/nginx/error.log; 8 | 9 | include /etc/nginx/performance.conf; 10 | 11 | location /{ 12 | try_files $uri $uri/ =404; 13 | } 14 | 15 | location ~ /\.ht { 16 | deny all; 17 | } 18 | } -------------------------------------------------------------------------------- /templates/nginx/htpasswd: -------------------------------------------------------------------------------- 1 | noaman:$apr1$eDUUoohA$yn90ehVF8t2qvKTZ2Ev4u. 2 | -------------------------------------------------------------------------------- /templates/nginx/htpasswd.users: -------------------------------------------------------------------------------- 1 | noaman:$apr1$eDUUoohA$yn90ehVF8t2qvKTZ2Ev4u. -------------------------------------------------------------------------------- /templates/nginx/laravel-vhost.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/nginx/laravel-vhost.conf -------------------------------------------------------------------------------- /templates/nginx/proxypass.conf: -------------------------------------------------------------------------------- 1 | 2 | #Proxy Pass Configurations 3 | proxy_buffers 16 32k; 4 | proxy_buffer_size 64k; 5 | proxy_busy_buffers_size 128k; 6 | proxy_connect_timeout 59s; 7 | proxy_hide_header X-Powered-By; 8 | proxy_http_version 1.1; 9 | proxy_ignore_headers Cache-Control Expires; 10 | proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_404; 11 | proxy_pass_header Set-Cookie; 12 | proxy_read_timeout 600; 13 | proxy_redirect off; 14 | proxy_send_timeout 600; 15 | proxy_temp_file_write_size 64k; 16 | proxy_set_header Accept-Encoding ''; 17 | proxy_set_header Cookie $http_cookie; 18 | proxy_set_header Host $host:$server_port; 19 | proxy_set_header Proxy ''; 20 | proxy_set_header Referer $http_referer; 21 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 22 | proxy_set_header X-Forwarded-Host $host; 23 | proxy_set_header X-Forwarded-Server $host:$server_port; 24 | proxy_set_header X-Real-IP $remote_addr; 25 | proxy_set_header X-Forwarded-Proto $scheme; 26 | proxy_set_header X-Original-Request $request_uri; -------------------------------------------------------------------------------- /templates/nginx/react/vhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | root {{www_path}}; 4 | index index.html index.htm; 5 | server_name {{domain}}; 6 | 7 | error_log {{user_root}}/logs/nginx/error.log; 8 | 9 | include /etc/nginx/performance.conf; 10 | 11 | location /{ 12 | try_files $uri $uri/ /index.html =404; 13 | } 14 | 15 | location ~ /\.ht { 16 | deny all; 17 | } 18 | 19 | #SSL_DISABLED if ($https != on) { return 301 https://$host$request_uri; } 20 | #SSL_DISABLED listen 443 ssl http2; # managed by Certbot 21 | #SSL_DISABLED ssl_certificate /etc/letsencrypt/live/{{domain}}/fullchain.pem; # managed by Certbot 22 | #SSL_DISABLED ssl_certificate_key /etc/letsencrypt/live/{{domain}}/privkey.pem; # managed by Certbot 23 | #SSL_DISABLED ssl_trusted_certificate /etc/letsencrypt/live/{{domain}}/chain.pem; # managed by Certbot 24 | #SSL_DISABLED include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot 25 | #SSL_DISABLED ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot 26 | 27 | } -------------------------------------------------------------------------------- /templates/nginx/svelte/vhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | root {{www_path}}; 4 | index index.html index.htm; 5 | server_name {{domain}}; 6 | 7 | error_log {{user_root}}/logs/nginx/error.log; 8 | 9 | include /etc/nginx/performance.conf; 10 | 11 | location /{ 12 | try_files $uri $uri/ =404; 13 | } 14 | 15 | location ~ /\.ht { 16 | deny all; 17 | } 18 | 19 | #SSL_DISABLED if ($https != on) { return 301 https://$host$request_uri; } 20 | #SSL_DISABLED listen 443 ssl http2; # managed by Certbot 21 | #SSL_DISABLED ssl_certificate /etc/letsencrypt/live/{{domain}}/fullchain.pem; # managed by Certbot 22 | #SSL_DISABLED ssl_certificate_key /etc/letsencrypt/live/{{domain}}/privkey.pem; # managed by Certbot 23 | #SSL_DISABLED ssl_trusted_certificate /etc/letsencrypt/live/{{domain}}/chain.pem; # managed by Certbot 24 | #SSL_DISABLED include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot 25 | #SSL_DISABLED ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot 26 | 27 | } -------------------------------------------------------------------------------- /templates/nginx/vue/vhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | root {{www_path}}; 4 | index index.php index.html index.htm; 5 | server_name {{domain}}; 6 | 7 | error_log {{user_root}}/logs/nginx/error.log; 8 | 9 | include /etc/nginx/performance.conf; 10 | 11 | location /{ 12 | try_files $uri $uri/ =404; 13 | } 14 | 15 | location ~ /\.ht { 16 | deny all; 17 | } 18 | 19 | #SSL_DISABLED if ($https != on) { return 301 https://$host$request_uri; } 20 | #SSL_DISABLED listen 443 ssl http2; # managed by Certbot 21 | #SSL_DISABLED ssl_certificate /etc/letsencrypt/live/{{domain}}/fullchain.pem; # managed by Certbot 22 | #SSL_DISABLED ssl_certificate_key /etc/letsencrypt/live/{{domain}}/privkey.pem; # managed by Certbot 23 | #SSL_DISABLED ssl_trusted_certificate /etc/letsencrypt/live/{{domain}}/chain.pem; # managed by Certbot 24 | #SSL_DISABLED include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot 25 | #SSL_DISABLED ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot 26 | 27 | } -------------------------------------------------------------------------------- /templates/nginx/wordpress-vhost.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/nginx/wordpress-vhost.conf -------------------------------------------------------------------------------- /templates/openresty/nginx-openresty.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Open Resty Nginx is a high performance web server and a reverse proxy server 3 | Documentation=man:nginx(8) 4 | After=network.target 5 | 6 | [Service] 7 | Type=forking 8 | PIDFile=/var/run/nginx-openresty.pid 9 | ExecStartPre=/usr/local/openresty/nginx/sbin/nginx -t -q -g 'daemon on; master_process on;' 10 | ExecStart=/usr/local/openresty/nginx/sbin/nginx -g 'daemon on; master_process on;' 11 | ExecReload=/usr/local/openresty/nginx/sbin/nginx -g 'daemon on; master_process on;' -s reload 12 | ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /var/run/nginx-openresty.pid 13 | TimeoutStopSec=5 14 | KillMode=mixed 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | -------------------------------------------------------------------------------- /templates/pgadmin/config_local.py: -------------------------------------------------------------------------------- 1 | LOG_FILE = '/var/log/pgadmin4/pgadmin4.log' 2 | SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db' 3 | SESSION_DB_PATH = '/var/lib/pgadmin4/sessions' 4 | STORAGE_DIR = '/var/lib/pgadmin4/storage' 5 | SERVER_MODE = True -------------------------------------------------------------------------------- /templates/pgadmin/pgadmin.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=A Postgres administrative tool 3 | After=network.target 4 | 5 | [Service] 6 | User=pgadmin 7 | Group=pgadmin 8 | WorkingDirectory={{user_root}} 9 | ExecStart={{user_root}}/.virtualenv/bin/gunicorn --chdir {{user_root}}/.virtualenv/lib/python{{python}}/site-packages/pgadmin4/ --bind 127.0.0.1:7210 pgAdmin4:app 10 | 11 | [Install] 12 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /templates/pgadmin/vhost.conf: -------------------------------------------------------------------------------- 1 | 2 | server { 3 | listen 6210 ssl; 4 | 5 | server_name {{domain}}; 6 | 7 | auth_basic "Restricted Access"; 8 | auth_basic_user_file /etc/nginx/htpasswd; 9 | 10 | # Finally, send all non-media requests to the uwsgi_upstream. 11 | location / { 12 | proxy_pass http://127.0.0.1:7210; 13 | #include {{www_root}}/uwsgi_params; # the uwsgi_params file you installed 14 | } 15 | 16 | error_page 497 https://$server_name:$server_port$request_uri; 17 | ssl_certificate /etc/letsencrypt/live/{{domain}}/fullchain.pem; # managed by Certbot 18 | ssl_certificate_key /etc/letsencrypt/live/{{domain}}/privkey.pem; # managed by Certbot 19 | include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot 20 | ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot 21 | 22 | } -------------------------------------------------------------------------------- /templates/phpmyadmin/config.inc.php: -------------------------------------------------------------------------------- 1 | . 8 | */ 9 | 10 | declare(strict_types=1); 11 | 12 | /** 13 | * This is needed for cookie based authentication to encrypt password in 14 | * cookie. Needs to be 32 chars long. 15 | */ 16 | $cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ 17 | 18 | /** 19 | * Servers configuration 20 | */ 21 | $i = 0; 22 | 23 | /** 24 | * First server 25 | */ 26 | $i++; 27 | /* Authentication type */ 28 | $cfg['Servers'][$i]['auth_type'] = 'cookie'; 29 | /* Server parameters */ 30 | $cfg['Servers'][$i]['host'] = '127.0.0.1'; 31 | $cfg['Servers'][$i]['compress'] = false; 32 | $cfg['Servers'][$i]['AllowNoPassword'] = false; 33 | 34 | $cfg['UploadDir'] = ''; 35 | $cfg['SaveDir'] = ''; 36 | -------------------------------------------------------------------------------- /templates/phpmyadmin/vhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 6230 ssl; 3 | 4 | root {{www_path}}; 5 | index index.php index.html index.htm; 6 | server_name {{domain}}; 7 | 8 | error_log {{user_root}}/logs/nginx/error.log; 9 | 10 | #include /etc/nginx/performance.conf; 11 | 12 | 13 | location / { 14 | # First attempt to serve request as file, then 15 | # as directory, then fall back to displaying a 404. 16 | try_files $uri $uri/ /index.php?$args; 17 | } 18 | 19 | location ~ \.php$ 20 | { 21 | include snippets/fastcgi-php.conf; 22 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 23 | fastcgi_pass unix:/var/run/php/{{username}}-php-fpm.sock; 24 | } 25 | 26 | location ~ /\.ht { 27 | deny all; 28 | } 29 | 30 | error_page 497 https://$server_name:$server_port$request_uri; 31 | 32 | ssl_certificate /etc/letsencrypt/live/{{domain}}/fullchain.pem; # managed by Certbot 33 | ssl_certificate_key /etc/letsencrypt/live/{{domain}}/privkey.pem; # managed by Certbot 34 | include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot 35 | ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot 36 | 37 | } -------------------------------------------------------------------------------- /templates/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf: -------------------------------------------------------------------------------- 1 | user = {{db_username}} 2 | password = {{db_password}} 3 | hosts = 127.0.0.1 4 | dbname = {{db_name}} 5 | query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1' -------------------------------------------------------------------------------- /templates/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf: -------------------------------------------------------------------------------- 1 | user = {{db_username}} 2 | password = {{db_password}} 3 | hosts = 127.0.0.1 4 | dbname = {{db_name}} 5 | query = SELECT maildir FROM mailbox,alias_domain WHERE alias_domain.alias_domain = '%d' and mailbox.username = CONCAT('%u', '@', alias_domain.target_domain) AND mailbox.active = 1 AND alias_domain.active='1' 6 | -------------------------------------------------------------------------------- /templates/postfix/sql/mysql_virtual_alias_domain_maps.cf: -------------------------------------------------------------------------------- 1 | user = {{db_username}} 2 | password = {{db_password}} 3 | hosts = 127.0.0.1 4 | dbname = {{db_name}} 5 | query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('%u', '@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1' 6 | -------------------------------------------------------------------------------- /templates/postfix/sql/mysql_virtual_alias_maps.cf: -------------------------------------------------------------------------------- 1 | user = {{db_username}} 2 | password = {{db_password}} 3 | hosts = 127.0.0.1 4 | dbname = {{db_name}} 5 | query = SELECT goto FROM alias WHERE address='%s' AND active = '1' 6 | #expansion_limit = 100 7 | -------------------------------------------------------------------------------- /templates/postfix/sql/mysql_virtual_domains_maps.cf: -------------------------------------------------------------------------------- 1 | user = {{db_username}} 2 | password = {{db_password}} 3 | hosts = 127.0.0.1 4 | dbname = {{db_name}} 5 | query = SELECT domain FROM domain WHERE domain='%s' AND active = '1' 6 | #query = SELECT domain FROM domain WHERE domain='%s' 7 | #optional query to use when relaying for backup MX 8 | #query = SELECT domain FROM domain WHERE domain='%s' AND backupmx = '0' AND active = '1' 9 | #expansion_limit = 100 -------------------------------------------------------------------------------- /templates/postfix/sql/mysql_virtual_mailbox_maps.cf: -------------------------------------------------------------------------------- 1 | user = {{db_username}} 2 | password = {{db_password}} 3 | hosts = 127.0.0.1 4 | dbname = {{db_name}} 5 | query = SELECT maildir FROM mailbox WHERE username='%s' AND active = '1' 6 | #expansion_limit = 100 -------------------------------------------------------------------------------- /templates/postfixadmin/config.local.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | App 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /templates/www/angular/dist/runtime.231e96734c9fdc57.js: -------------------------------------------------------------------------------- 1 | (()=>{"use strict";var e,p={},_={};function n(e){var a=_[e];if(void 0!==a)return a.exports;var r=_[e]={exports:{}};return p[e](r,r.exports,n),r.exports}n.m=p,e=[],n.O=(a,r,u,l)=>{if(!r){var o=1/0;for(f=0;f=l)&&Object.keys(n.O).every(h=>n.O[h](r[t]))?r.splice(t--,1):(s=!1,l0&&e[f-1][2]>l;f--)e[f]=e[f-1];e[f]=[r,u,l]},n.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return n.d(a,{a}),a},n.d=(e,a)=>{for(var r in a)n.o(a,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})},n.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),(()=>{var e={666:0};n.O.j=u=>0===e[u];var a=(u,l)=>{var t,c,[f,o,s]=l,v=0;if(f.some(d=>0!==e[d])){for(t in o)n.o(o,t)&&(n.m[t]=o[t]);if(s)var b=s(n)}for(u&&u(l);v { 6 | beforeEach(async () => { 7 | await TestBed.configureTestingModule({ 8 | imports: [ 9 | RouterTestingModule 10 | ], 11 | declarations: [ 12 | AppComponent 13 | ], 14 | }).compileComponents(); 15 | }); 16 | 17 | it('should create the app', () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.componentInstance; 20 | expect(app).toBeTruthy(); 21 | }); 22 | 23 | it(`should have as title 'app'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.componentInstance; 26 | expect(app.title).toEqual('app'); 27 | }); 28 | 29 | it('should render title', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.nativeElement as HTMLElement; 33 | expect(compiled.querySelector('.content span')?.textContent).toContain('app app is running!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /templates/www/angular/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.sass'] 7 | }) 8 | export class AppComponent { 9 | title = 'app'; 10 | } 11 | -------------------------------------------------------------------------------- /templates/www/angular/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | import { AppRoutingModule } from './app-routing.module'; 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | declarations: [ 9 | AppComponent 10 | ], 11 | imports: [ 12 | BrowserModule, 13 | AppRoutingModule 14 | ], 15 | providers: [], 16 | bootstrap: [AppComponent] 17 | }) 18 | export class AppModule { } 19 | -------------------------------------------------------------------------------- /templates/www/angular/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/www/angular/src/assets/.gitkeep -------------------------------------------------------------------------------- /templates/www/angular/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /templates/www/angular/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/plugins/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /templates/www/angular/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/www/angular/src/favicon.ico -------------------------------------------------------------------------------- /templates/www/angular/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | App 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /templates/www/angular/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /templates/www/angular/src/styles.sass: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /templates/www/angular/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: { 11 | context(path: string, deep?: boolean, filter?: RegExp): { 12 | (id: string): T; 13 | keys(): string[]; 14 | }; 15 | }; 16 | 17 | // First, initialize the Angular testing environment. 18 | getTestBed().initTestEnvironment( 19 | BrowserDynamicTestingModule, 20 | platformBrowserDynamicTesting(), 21 | ); 22 | 23 | // Then we find all the tests. 24 | const context = require.context('./', true, /\.spec\.ts$/); 25 | // And load the modules. 26 | context.keys().map(context); 27 | -------------------------------------------------------------------------------- /templates/www/angular/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts", 10 | "src/polyfills.ts" 11 | ], 12 | "include": [ 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /templates/www/angular/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "forceConsistentCasingInFileNames": true, 8 | "strict": true, 9 | "noImplicitOverride": true, 10 | "noPropertyAccessFromIndexSignature": true, 11 | "noImplicitReturns": true, 12 | "noFallthroughCasesInSwitch": true, 13 | "sourceMap": true, 14 | "declaration": false, 15 | "downlevelIteration": true, 16 | "experimentalDecorators": true, 17 | "moduleResolution": "node", 18 | "importHelpers": true, 19 | "target": "es2017", 20 | "module": "es2020", 21 | "lib": [ 22 | "es2020", 23 | "dom" 24 | ] 25 | }, 26 | "angularCompilerOptions": { 27 | "enableI18nLegacyMessageIdFormat": false, 28 | "strictInjectionParameters": true, 29 | "strictInputAccessModifiers": true, 30 | "strictTemplates": true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /templates/www/angular/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /templates/www/default_site/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | indent_style = space 8 | indent_size = 4 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | 17 | [docker-compose.yml] 18 | indent_size = 4 19 | -------------------------------------------------------------------------------- /templates/www/default_site/.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | LOG_DEPRECATIONS_CHANNEL=null 9 | LOG_LEVEL=debug 10 | 11 | DB_CONNECTION=mysql 12 | DB_HOST=127.0.0.1 13 | DB_PORT=3306 14 | DB_DATABASE=default_site 15 | DB_USERNAME=root 16 | DB_PASSWORD= 17 | 18 | BROADCAST_DRIVER=log 19 | CACHE_DRIVER=file 20 | FILESYSTEM_DRIVER=local 21 | QUEUE_CONNECTION=sync 22 | SESSION_DRIVER=file 23 | SESSION_LIFETIME=120 24 | 25 | MEMCACHED_HOST=127.0.0.1 26 | 27 | REDIS_HOST=127.0.0.1 28 | REDIS_PASSWORD=null 29 | REDIS_PORT=6379 30 | 31 | MAIL_MAILER=smtp 32 | MAIL_HOST=mailhog 33 | MAIL_PORT=1025 34 | MAIL_USERNAME=null 35 | MAIL_PASSWORD=null 36 | MAIL_ENCRYPTION=null 37 | MAIL_FROM_ADDRESS=null 38 | MAIL_FROM_NAME="${APP_NAME}" 39 | 40 | AWS_ACCESS_KEY_ID= 41 | AWS_SECRET_ACCESS_KEY= 42 | AWS_DEFAULT_REGION=us-east-1 43 | AWS_BUCKET= 44 | AWS_USE_PATH_STYLE_ENDPOINT=false 45 | 46 | PUSHER_APP_ID= 47 | PUSHER_APP_KEY= 48 | PUSHER_APP_SECRET= 49 | PUSHER_APP_CLUSTER=mt1 50 | 51 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 52 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 53 | -------------------------------------------------------------------------------- /templates/www/default_site/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.blade.php diff=html 4 | *.css diff=css 5 | *.html diff=html 6 | *.md diff=markdown 7 | *.php diff=php 8 | 9 | /.github export-ignore 10 | CHANGELOG.md export-ignore 11 | -------------------------------------------------------------------------------- /templates/www/default_site/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/hot 3 | /public/storage 4 | /storage/*.key 5 | /vendor 6 | .env 7 | .env.backup 8 | .phpunit.result.cache 9 | docker-compose.override.yml 10 | Homestead.json 11 | Homestead.yaml 12 | npm-debug.log 13 | yarn-error.log 14 | /.idea 15 | /.vscode 16 | -------------------------------------------------------------------------------- /templates/www/default_site/.styleci.yml: -------------------------------------------------------------------------------- 1 | php: 2 | preset: laravel 3 | version: 8 4 | disabled: 5 | - no_unused_imports 6 | finder: 7 | not-name: 8 | - index.php 9 | - server.php 10 | js: 11 | finder: 12 | not-name: 13 | - webpack.mix.js 14 | css: true 15 | -------------------------------------------------------------------------------- /templates/www/default_site/app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire')->hourly(); 19 | } 20 | 21 | /** 22 | * Register the commands for the application. 23 | * 24 | * @return void 25 | */ 26 | protected function commands() 27 | { 28 | $this->load(__DIR__.'/Commands'); 29 | 30 | require base_path('routes/console.php'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /templates/www/default_site/app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | > 14 | */ 15 | protected $dontReport = [ 16 | // 17 | ]; 18 | 19 | /** 20 | * A list of the inputs that are never flashed for validation exceptions. 21 | * 22 | * @var array 23 | */ 24 | protected $dontFlash = [ 25 | 'current_password', 26 | 'password', 27 | 'password_confirmation', 28 | ]; 29 | 30 | /** 31 | * Register the exception handling callbacks for the application. 32 | * 33 | * @return void 34 | */ 35 | public function register() 36 | { 37 | $this->reportable(function (Throwable $e) { 38 | // 39 | }); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /templates/www/default_site/app/Http/Controllers/BackupController.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /templates/www/default_site/app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /templates/www/default_site/app/Http/Middleware/PreventRequestsDuringMaintenance.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /templates/www/default_site/app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 26 | return redirect(RouteServiceProvider::HOME); 27 | } 28 | } 29 | 30 | return $next($request); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /templates/www/default_site/app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | 'current_password', 16 | 'password', 17 | 'password_confirmation', 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /templates/www/default_site/app/Http/Middleware/TrustHosts.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public function hosts() 15 | { 16 | return [ 17 | $this->allSubdomainsOfApplicationUrl(), 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /templates/www/default_site/app/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | |string|null 14 | */ 15 | protected $proxies; 16 | 17 | /** 18 | * The headers that should be used to detect proxies. 19 | * 20 | * @var int 21 | */ 22 | protected $headers = 23 | Request::HEADER_X_FORWARDED_FOR | 24 | Request::HEADER_X_FORWARDED_HOST | 25 | Request::HEADER_X_FORWARDED_PORT | 26 | Request::HEADER_X_FORWARDED_PROTO | 27 | Request::HEADER_X_FORWARDED_AWS_ELB; 28 | } 29 | -------------------------------------------------------------------------------- /templates/www/default_site/app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /templates/www/default_site/app/Http/Requests/FileZilla.php: -------------------------------------------------------------------------------- 1 | 'string|required' 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /templates/www/default_site/app/Models/User.php: -------------------------------------------------------------------------------- 1 | 19 | */ 20 | protected $fillable = [ 21 | 'name', 22 | 'email', 23 | 'password', 24 | ]; 25 | 26 | /** 27 | * The attributes that should be hidden for serialization. 28 | * 29 | * @var array 30 | */ 31 | protected $hidden = [ 32 | 'password', 33 | 'remember_token', 34 | ]; 35 | 36 | /** 37 | * The attributes that should be cast. 38 | * 39 | * @var array 40 | */ 41 | protected $casts = [ 42 | 'email_verified_at' => 'datetime', 43 | ]; 44 | } 45 | -------------------------------------------------------------------------------- /templates/www/default_site/app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | protected $policies = [ 16 | // 'App\Models\Model' => 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /templates/www/default_site/app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | > 16 | */ 17 | protected $listen = [ 18 | Registered::class => [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | * 26 | * @return void 27 | */ 28 | public function boot() 29 | { 30 | // 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /templates/www/default_site/app/Services/Backup.php: -------------------------------------------------------------------------------- 1 | generateConfigFile($request); 11 | } 12 | 13 | public function generateConfigFile(Request $request) 14 | { 15 | 16 | } 17 | 18 | 19 | } -------------------------------------------------------------------------------- /templates/www/default_site/bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /templates/www/default_site/config/cors.php: -------------------------------------------------------------------------------- 1 | ['api/*', 'sanctum/csrf-cookie'], 19 | 20 | 'allowed_methods' => ['*'], 21 | 22 | 'allowed_origins' => ['*'], 23 | 24 | 'allowed_origins_patterns' => [], 25 | 26 | 'allowed_headers' => ['*'], 27 | 28 | 'exposed_headers' => [], 29 | 30 | 'max_age' => 0, 31 | 32 | 'supports_credentials' => false, 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /templates/www/default_site/config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | ], 22 | 23 | 'postmark' => [ 24 | 'token' => env('POSTMARK_TOKEN'), 25 | ], 26 | 27 | 'ses' => [ 28 | 'key' => env('AWS_ACCESS_KEY_ID'), 29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 30 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 31 | ], 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /templates/www/default_site/config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /templates/www/default_site/database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /templates/www/default_site/database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->name(), 19 | 'email' => $this->faker->unique()->safeEmail(), 20 | 'email_verified_at' => now(), 21 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 22 | 'remember_token' => Str::random(10), 23 | ]; 24 | } 25 | 26 | /** 27 | * Indicate that the model's email address should be unverified. 28 | * 29 | * @return \Illuminate\Database\Eloquent\Factories\Factory 30 | */ 31 | public function unverified() 32 | { 33 | return $this->state(function (array $attributes) { 34 | return [ 35 | 'email_verified_at' => null, 36 | ]; 37 | }); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /templates/www/default_site/database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->timestamp('email_verified_at')->nullable(); 21 | $table->string('password'); 22 | $table->rememberToken(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('users'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /templates/www/default_site/database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token'); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /templates/www/default_site/database/migrations/2019_08_19_000000_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('uuid')->unique(); 19 | $table->text('connection'); 20 | $table->text('queue'); 21 | $table->longText('payload'); 22 | $table->longText('exception'); 23 | $table->timestamp('failed_at')->useCurrent(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('failed_jobs'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /templates/www/default_site/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->morphs('tokenable'); 19 | $table->string('name'); 20 | $table->string('token', 64)->unique(); 21 | $table->text('abilities')->nullable(); 22 | $table->timestamp('last_used_at')->nullable(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('personal_access_tokens'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /templates/www/default_site/database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /templates/www/default_site/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "mix", 6 | "watch": "mix watch", 7 | "watch-poll": "mix watch -- --watch-options-poll=1000", 8 | "hot": "mix watch --hot", 9 | "prod": "npm run production", 10 | "production": "mix --production" 11 | }, 12 | "devDependencies": { 13 | "axios": "^0.21", 14 | "laravel-mix": "^6.0.6", 15 | "lodash": "^4.17.19", 16 | "postcss": "^8.1.14" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /templates/www/default_site/public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Send Requests To Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /templates/www/default_site/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/www/default_site/public/favicon.ico -------------------------------------------------------------------------------- /templates/www/default_site/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /templates/www/default_site/resources/css/app.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/www/default_site/resources/css/app.css -------------------------------------------------------------------------------- /templates/www/default_site/resources/js/app.js: -------------------------------------------------------------------------------- 1 | require('./bootstrap'); 2 | -------------------------------------------------------------------------------- /templates/www/default_site/resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | window._ = require('lodash'); 2 | 3 | /** 4 | * We'll load the axios HTTP library which allows us to easily issue requests 5 | * to our Laravel back-end. This library automatically handles sending the 6 | * CSRF token as a header based on the value of the "XSRF" token cookie. 7 | */ 8 | 9 | window.axios = require('axios'); 10 | 11 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 12 | 13 | /** 14 | * Echo exposes an expressive API for subscribing to channels and listening 15 | * for events that are broadcast by Laravel. Echo and event broadcasting 16 | * allows your team to easily build robust real-time web applications. 17 | */ 18 | 19 | // import Echo from 'laravel-echo'; 20 | 21 | // window.Pusher = require('pusher-js'); 22 | 23 | // window.Echo = new Echo({ 24 | // broadcaster: 'pusher', 25 | // key: process.env.MIX_PUSHER_APP_KEY, 26 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER, 27 | // forceTLS: true 28 | // }); 29 | -------------------------------------------------------------------------------- /templates/www/default_site/resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'password' => 'The provided password is incorrect.', 18 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 19 | 20 | ]; 21 | -------------------------------------------------------------------------------- /templates/www/default_site/resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /templates/www/default_site/resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Your password has been reset!', 17 | 'sent' => 'We have emailed your password reset link!', 18 | 'throttled' => 'Please wait before retrying.', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that email address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /templates/www/default_site/resources/views/filezilla.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{$domain}} 6 | {{$port}} 7 | 1 8 | 0 9 | {{$username}} 10 | {{$password}} 11 | 1 12 | Auto 13 | 0 14 | site_{{$username}} 15 | 0 16 | 0 17 | 18 | 19 | -------------------------------------------------------------------------------- /templates/www/default_site/routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 18 | return $request->user(); 19 | }); 20 | -------------------------------------------------------------------------------- /templates/www/default_site/routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /templates/www/default_site/routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 19 | })->purpose('Display an inspiring quote'); 20 | -------------------------------------------------------------------------------- /templates/www/default_site/routes/web.php: -------------------------------------------------------------------------------- 1 | name('filezilla.download'); 18 | -------------------------------------------------------------------------------- /templates/www/default_site/server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? '' 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /templates/www/default_site/storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /templates/www/default_site/storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /templates/www/default_site/storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | compiled.php 2 | config.php 3 | down 4 | events.scanned.php 5 | maintenance.php 6 | routes.php 7 | routes.scanned.php 8 | schedule-* 9 | services.json 10 | -------------------------------------------------------------------------------- /templates/www/default_site/storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /templates/www/default_site/storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /templates/www/default_site/storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /templates/www/default_site/storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /templates/www/default_site/storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /templates/www/default_site/storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /templates/www/default_site/tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /templates/www/default_site/tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /templates/www/default_site/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /templates/www/default_site/webpack.mix.js: -------------------------------------------------------------------------------- 1 | const mix = require('laravel-mix'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Mix Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Mix provides a clean, fluent API for defining some Webpack build steps 9 | | for your Laravel applications. By default, we are compiling the CSS 10 | | file for the application as well as bundling up all the JS files. 11 | | 12 | */ 13 | 14 | mix.js('resources/js/app.js', 'public/js') 15 | .postCss('resources/css/app.css', 'public/css', [ 16 | // 17 | ]); 18 | -------------------------------------------------------------------------------- /templates/www/mongodb_express/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | pnpm-debug.log* 14 | 15 | # Editor directories and files 16 | .idea 17 | .vscode 18 | *.suo 19 | *.ntvs* 20 | *.njsproj 21 | *.sln 22 | *.sw? 23 | -------------------------------------------------------------------------------- /templates/www/node/app.js: -------------------------------------------------------------------------------- 1 | const express = require('express') 2 | const http = require('http'); 3 | const app = express() 4 | const port = {{port}} 5 | 6 | var server = http.createServer(app); 7 | 8 | app.get('/', (req, res) => { 9 | res.send('A starter app.js has been setup for you on node version: ' + process.versions.node) 10 | }) 11 | 12 | server.listen(port, '127.0.0.1'); 13 | 14 | server.on('listening', function() { 15 | console.log(`Example app listening on port http:\/\/${server.address().address}:${port}`) 16 | }) -------------------------------------------------------------------------------- /templates/www/node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mern-stack-dummy-app", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "express": "^4.17.3" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /templates/www/php/info.php: -------------------------------------------------------------------------------- 1 | https://pythonbasics.org", "utf-8")) 15 | self.wfile.write(bytes("

Request: %s

" % self.path, "utf-8")) 16 | self.wfile.write(bytes("", "utf-8")) 17 | self.wfile.write(bytes("

Python Version %s

" % sys.version, "utf-8")) 18 | self.wfile.write(bytes("", "utf-8")) 19 | 20 | if __name__ == "__main__": 21 | webServer = HTTPServer((hostName, serverPort), MyServer) 22 | print("Server started http://%s:%s" % (hostName, serverPort)) 23 | 24 | try: 25 | webServer.serve_forever() 26 | except KeyboardInterrupt: 27 | pass 28 | 29 | webServer.server_close() 30 | print("Server stopped.") -------------------------------------------------------------------------------- /templates/www/react/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | -------------------------------------------------------------------------------- /templates/www/react/build/asset-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": { 3 | "main.css": "/static/css/main.073c9b0a.css", 4 | "main.js": "/static/js/main.1ce6189d.js", 5 | "static/js/787.d6dd7736.chunk.js": "/static/js/787.d6dd7736.chunk.js", 6 | "static/media/logo.svg": "/static/media/logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg", 7 | "index.html": "/index.html", 8 | "main.073c9b0a.css.map": "/static/css/main.073c9b0a.css.map", 9 | "main.1ce6189d.js.map": "/static/js/main.1ce6189d.js.map", 10 | "787.d6dd7736.chunk.js.map": "/static/js/787.d6dd7736.chunk.js.map" 11 | }, 12 | "entrypoints": [ 13 | "static/css/main.073c9b0a.css", 14 | "static/js/main.1ce6189d.js" 15 | ] 16 | } -------------------------------------------------------------------------------- /templates/www/react/build/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/www/react/build/favicon.ico -------------------------------------------------------------------------------- /templates/www/react/build/index.html: -------------------------------------------------------------------------------- 1 | React App
-------------------------------------------------------------------------------- /templates/www/react/build/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/www/react/build/logo192.png -------------------------------------------------------------------------------- /templates/www/react/build/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/www/react/build/logo512.png -------------------------------------------------------------------------------- /templates/www/react/build/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /templates/www/react/build/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /templates/www/react/build/static/css/main.073c9b0a.css: -------------------------------------------------------------------------------- 1 | body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;margin:0}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.App{text-align:center}.App-logo{height:40vmin;pointer-events:none}@media (prefers-reduced-motion:no-preference){.App-logo{-webkit-animation:App-logo-spin 20s linear infinite;animation:App-logo-spin 20s linear infinite}}.App-header{align-items:center;background-color:#282c34;color:#fff;display:flex;flex-direction:column;font-size:calc(10px + 2vmin);justify-content:center;min-height:100vh}.App-link{color:#61dafb}@-webkit-keyframes App-logo-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes App-logo-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}} 2 | /*# sourceMappingURL=main.073c9b0a.css.map*/ -------------------------------------------------------------------------------- /templates/www/react/build/static/js/main.1ce6189d.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * @license React 3 | * react-dom.production.min.js 4 | * 5 | * Copyright (c) Facebook, Inc. and its affiliates. 6 | * 7 | * This source code is licensed under the MIT license found in the 8 | * LICENSE file in the root directory of this source tree. 9 | */ 10 | 11 | /** 12 | * @license React 13 | * react-jsx-runtime.production.min.js 14 | * 15 | * Copyright (c) Facebook, Inc. and its affiliates. 16 | * 17 | * This source code is licensed under the MIT license found in the 18 | * LICENSE file in the root directory of this source tree. 19 | */ 20 | 21 | /** 22 | * @license React 23 | * react.production.min.js 24 | * 25 | * Copyright (c) Facebook, Inc. and its affiliates. 26 | * 27 | * This source code is licensed under the MIT license found in the 28 | * LICENSE file in the root directory of this source tree. 29 | */ 30 | 31 | /** 32 | * @license React 33 | * scheduler.production.min.js 34 | * 35 | * Copyright (c) Facebook, Inc. and its affiliates. 36 | * 37 | * This source code is licensed under the MIT license found in the 38 | * LICENSE file in the root directory of this source tree. 39 | */ 40 | -------------------------------------------------------------------------------- /templates/www/react/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react2", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.16.4", 7 | "@testing-library/react": "^13.1.1", 8 | "@testing-library/user-event": "^13.5.0", 9 | "react": "^18.1.0", 10 | "react-dom": "^18.1.0", 11 | "react-scripts": "5.0.1", 12 | "web-vitals": "^2.1.4" 13 | }, 14 | "scripts": { 15 | "start": "react-scripts start", 16 | "build": "react-scripts build", 17 | "test": "react-scripts test", 18 | "eject": "react-scripts eject" 19 | }, 20 | "eslintConfig": { 21 | "extends": [ 22 | "react-app", 23 | "react-app/jest" 24 | ] 25 | }, 26 | "browserslist": { 27 | "production": [ 28 | ">0.2%", 29 | "not dead", 30 | "not op_mini all" 31 | ], 32 | "development": [ 33 | "last 1 chrome version", 34 | "last 1 firefox version", 35 | "last 1 safari version" 36 | ] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /templates/www/react/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/www/react/public/favicon.ico -------------------------------------------------------------------------------- /templates/www/react/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/www/react/public/logo192.png -------------------------------------------------------------------------------- /templates/www/react/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/www/react/public/logo512.png -------------------------------------------------------------------------------- /templates/www/react/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /templates/www/react/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /templates/www/react/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /templates/www/react/src/App.js: -------------------------------------------------------------------------------- 1 | import logo from './logo.svg'; 2 | import './App.css'; 3 | 4 | function App() { 5 | return ( 6 |
7 |
8 | logo 9 |

10 | Edit src/App.js and save to reload. 11 |

12 | 18 | Learn React 19 | 20 |
21 |
22 | ); 23 | } 24 | 25 | export default App; 26 | -------------------------------------------------------------------------------- /templates/www/react/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /templates/www/react/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /templates/www/react/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | const root = ReactDOM.createRoot(document.getElementById('root')); 8 | root.render( 9 | 10 | 11 | 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /templates/www/react/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /templates/www/react/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /templates/www/svelte/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /templates/www/svelte/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "svelte-app", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "build": "rollup -c", 7 | "dev": "rollup -c -w", 8 | "start": "sirv public --no-clear" 9 | }, 10 | "devDependencies": { 11 | "@rollup/plugin-commonjs": "^17.0.0", 12 | "@rollup/plugin-node-resolve": "^11.0.0", 13 | "rollup": "^2.3.4", 14 | "rollup-plugin-css-only": "^3.1.0", 15 | "rollup-plugin-livereload": "^2.0.0", 16 | "rollup-plugin-svelte": "^7.0.0", 17 | "rollup-plugin-terser": "^7.0.0", 18 | "svelte": "^3.0.0" 19 | }, 20 | "dependencies": { 21 | "sirv-cli": "^2.0.0" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /templates/www/svelte/public/build/bundle.css: -------------------------------------------------------------------------------- 1 | main.svelte-1tky8bj{text-align:center;padding:1em;max-width:240px;margin:0 auto}h1.svelte-1tky8bj{color:#ff3e00;text-transform:uppercase;font-size:4em;font-weight:100}@media(min-width: 640px){main.svelte-1tky8bj{max-width:none}} -------------------------------------------------------------------------------- /templates/www/svelte/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/www/svelte/public/favicon.png -------------------------------------------------------------------------------- /templates/www/svelte/public/global.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | position: relative; 3 | width: 100%; 4 | height: 100%; 5 | } 6 | 7 | body { 8 | color: #333; 9 | margin: 0; 10 | padding: 8px; 11 | box-sizing: border-box; 12 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; 13 | } 14 | 15 | a { 16 | color: rgb(0,100,200); 17 | text-decoration: none; 18 | } 19 | 20 | a:hover { 21 | text-decoration: underline; 22 | } 23 | 24 | a:visited { 25 | color: rgb(0,80,160); 26 | } 27 | 28 | label { 29 | display: block; 30 | } 31 | 32 | input, button, select, textarea { 33 | font-family: inherit; 34 | font-size: inherit; 35 | -webkit-padding: 0.4em 0; 36 | padding: 0.4em; 37 | margin: 0 0 0.5em 0; 38 | box-sizing: border-box; 39 | border: 1px solid #ccc; 40 | border-radius: 2px; 41 | } 42 | 43 | input:disabled { 44 | color: #ccc; 45 | } 46 | 47 | button { 48 | color: #333; 49 | background-color: #f4f4f4; 50 | outline: none; 51 | } 52 | 53 | button:disabled { 54 | color: #999; 55 | } 56 | 57 | button:not(:disabled):active { 58 | background-color: #ddd; 59 | } 60 | 61 | button:focus { 62 | border-color: #666; 63 | } 64 | -------------------------------------------------------------------------------- /templates/www/svelte/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Svelte app 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /templates/www/svelte/src/App.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 |
6 |

Hello {name}!

7 |

Visit the Svelte tutorial to learn how to build Svelte apps.

8 |
9 | 10 | -------------------------------------------------------------------------------- /templates/www/svelte/src/main.js: -------------------------------------------------------------------------------- 1 | import App from './App.svelte'; 2 | 3 | const app = new App({ 4 | target: document.body, 5 | props: { 6 | name: 'world' 7 | } 8 | }); 9 | 10 | export default app; -------------------------------------------------------------------------------- /templates/www/vue/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | pnpm-debug.log* 14 | 15 | # Editor directories and files 16 | .idea 17 | .vscode 18 | *.suo 19 | *.ntvs* 20 | *.njsproj 21 | *.sln 22 | *.sw? 23 | -------------------------------------------------------------------------------- /templates/www/vue/README.md: -------------------------------------------------------------------------------- 1 | # vue 2 | 3 | ## Project setup 4 | ``` 5 | npm install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | npm run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | npm run build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | npm run lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /templates/www/vue/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /templates/www/vue/dist/css/app.2cf79ad6.css: -------------------------------------------------------------------------------- 1 | h3[data-v-b9167eee]{margin:40px 0 0}ul[data-v-b9167eee]{list-style-type:none;padding:0}li[data-v-b9167eee]{display:inline-block;margin:0 10px}a[data-v-b9167eee]{color:#42b983}#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50;margin-top:60px} -------------------------------------------------------------------------------- /templates/www/vue/dist/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/www/vue/dist/favicon.ico -------------------------------------------------------------------------------- /templates/www/vue/dist/index.html: -------------------------------------------------------------------------------- 1 | vue
-------------------------------------------------------------------------------- /templates/www/vue/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "esnext", 5 | "baseUrl": "./", 6 | "moduleResolution": "node", 7 | "paths": { 8 | "@/*": [ 9 | "src/*" 10 | ] 11 | }, 12 | "lib": [ 13 | "esnext", 14 | "dom", 15 | "dom.iterable", 16 | "scripthost" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /templates/www/vue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "core-js": "^3.8.3", 12 | "vue": "^3.2.13" 13 | }, 14 | "devDependencies": { 15 | "@babel/core": "^7.12.16", 16 | "@babel/eslint-parser": "^7.12.16", 17 | "@vue/cli-plugin-babel": "~5.0.0", 18 | "@vue/cli-plugin-eslint": "~5.0.0", 19 | "@vue/cli-service": "~5.0.0", 20 | "eslint": "^7.32.0", 21 | "eslint-plugin-vue": "^8.0.3" 22 | }, 23 | "eslintConfig": { 24 | "root": true, 25 | "env": { 26 | "node": true 27 | }, 28 | "extends": [ 29 | "plugin:vue/vue3-essential", 30 | "eslint:recommended" 31 | ], 32 | "parserOptions": { 33 | "parser": "@babel/eslint-parser" 34 | }, 35 | "rules": {} 36 | }, 37 | "browserslist": [ 38 | "> 1%", 39 | "last 2 versions", 40 | "not dead", 41 | "not ie 11" 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /templates/www/vue/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/www/vue/public/favicon.ico -------------------------------------------------------------------------------- /templates/www/vue/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /templates/www/vue/src/App.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 16 | 17 | 27 | -------------------------------------------------------------------------------- /templates/www/vue/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noamanahmed/LEMP/a2827ab5b7c183a4d3dca259b651ec5e4883b8a1/templates/www/vue/src/assets/logo.png -------------------------------------------------------------------------------- /templates/www/vue/src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | 4 | createApp(App).mount('#app') 5 | -------------------------------------------------------------------------------- /templates/www/vue/vue.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('@vue/cli-service') 2 | module.exports = defineConfig({ 3 | transpileDependencies: true 4 | }) 5 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | # Local .terraform directories 2 | **/.terraform/* 3 | 4 | # .tfstate files 5 | *.tfstate 6 | *.tfstate.* 7 | 8 | # Crash log files 9 | crash.log 10 | crash.*.log 11 | 12 | # Exclude all .tfvars files, which are likely to contain sensitive data, such as 13 | # password, private keys, and other secrets. These should not be part of version 14 | # control as they are data points which are potentially sensitive and subject 15 | # to change depending on the environment. 16 | *.tfvars 17 | *.tfvars.json 18 | 19 | # Ignore override files as they are usually used to override resources locally and so 20 | # are not checked in 21 | override.tf 22 | override.tf.json 23 | *_override.tf 24 | *_override.tf.json 25 | 26 | # Include override files you do wish to add to version control using negated pattern 27 | # !example_override.tf 28 | 29 | # Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan 30 | # example: *tfplan* 31 | 32 | # Ignore CLI configuration files 33 | .terraformrc 34 | terraform.rc -------------------------------------------------------------------------------- /tests/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | libvirt = { 4 | source = "dmacvicar/libvirt" 5 | # version = "0.6.14" 6 | } 7 | } 8 | } 9 | 10 | 11 | provider "libvirt" { 12 | ## Configuration options 13 | uri = "qemu:///system" 14 | #alias = "server2" 15 | #uri = "qemu+ssh://root@192.168.100.10/system" 16 | } 17 | -------------------------------------------------------------------------------- /tests/network.xml: -------------------------------------------------------------------------------- 1 | 2 | terraform_network 3 | d0e9964a-f91a-40c0-b769-a609aee41bf2 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/terraform.tfstate.backup: -------------------------------------------------------------------------------- 1 | { 2 | "version": 4, 3 | "terraform_version": "1.1.9", 4 | "serial": 43, 5 | "lineage": "f0119d94-9ced-a2d4-50c9-40961c292678", 6 | "outputs": {}, 7 | "resources": [ 8 | { 9 | "mode": "managed", 10 | "type": "libvirt_domain", 11 | "name": "ubuntu22", 12 | "provider": "provider[\"registry.terraform.io/dmacvicar/libvirt\"]", 13 | "instances": [] 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /tests/ubuntu22.tf: -------------------------------------------------------------------------------- 1 | resource "libvirt_volume" "ubuntu22-img" { 2 | name = "ubuntu22.img2" 3 | pool = "images" # List storage pools using virsh pool-list 4 | #source = "https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.img2" 5 | source = "/home/noaman/Downloads/ubuntu22.qcow2" 6 | format = "qcow2" 7 | } 8 | 9 | 10 | 11 | 12 | resource "libvirt_domain" "ubuntu22" { 13 | name = "ubuntu-testing" 14 | memory = "4096" 15 | vcpu = 2 16 | network_interface { 17 | network_name = "default" # List networks with virsh net-list 18 | } 19 | 20 | disk { 21 | volume_id = "${libvirt_volume.ubuntu22-img.id}" 22 | } 23 | console { 24 | type = "pty" 25 | target_type = "serial" 26 | target_port = "0" 27 | } 28 | graphics { 29 | type = "spice" 30 | listen_type = "address" 31 | autoport = true 32 | } 33 | } 34 | 35 | # Output Server IP 36 | # output "ip" { 37 | # value = "${libvirt_domain.ubuntu22.network_interface.0.addresses.0}" 38 | # } --------------------------------------------------------------------------------