├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ └── codeql-analysis.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── Old_Content ├── mysqlQuery │ └── readme.md └── shell_script │ └── vipLive.sh ├── Panel_Server ├── .eslintrc.json ├── app │ ├── config │ │ ├── example_config.json │ │ ├── index.js │ │ └── sample_config.txt │ ├── controllers │ │ ├── auditLogs.js │ │ ├── deleteVip.js │ │ ├── insertAdmin.js │ │ ├── insertVip.js │ │ ├── login.js │ │ ├── panelAdmins.js │ │ ├── panelServerBundles.js │ │ ├── panelServers.js │ │ ├── panelSettings.js │ │ ├── payU.js │ │ ├── razorPay.js │ │ ├── salesRecord.js │ │ ├── sendMessageOnDiscord.js │ │ ├── sourceBans.js │ │ ├── steamProfileDataFetch.js │ │ ├── userDashboard.js │ │ └── vipController.js │ ├── db │ │ ├── bootstrap.js │ │ ├── connection.js │ │ └── db_bridge.js │ ├── middleWares │ │ ├── auth.js │ │ ├── not_found.js │ │ └── request.js │ ├── models │ │ ├── auditLogsModel.js │ │ ├── bundleModel.js │ │ ├── myDashboardModel.js │ │ ├── panelServerModal.js │ │ ├── panelSettingModal.js │ │ ├── salesModel.js │ │ ├── userModel.js │ │ └── vipModel.js │ ├── modules │ │ ├── logger.js │ │ ├── steam.js │ │ └── user.js │ ├── routes │ │ └── router.js │ └── utils │ │ ├── activityLogger.js │ │ ├── crypto.js │ │ ├── csgoServerRconExecuter.js │ │ ├── misc.js │ │ ├── refreshCFGInServer.js │ │ └── steamIdConvertor.js ├── package.json ├── public │ ├── css │ │ └── material-dashboard.css │ ├── images │ │ ├── 404.png │ │ ├── favicon.ico │ │ ├── gear.gif │ │ ├── icon.png │ │ ├── payumini.png │ │ ├── payumoney.png │ │ ├── razorpay.svg │ │ ├── sidebar-1.jpg │ │ ├── sidebar-2.jpg │ │ ├── sidebar-3.jpg │ │ └── vmp.png │ └── js │ │ ├── ManageAdmin.js │ │ ├── ManageVIP.js │ │ ├── PanelSettings.js │ │ ├── customConfirm.js │ │ ├── myDashboard.js │ │ ├── notifications.js │ │ ├── panelAduitLog.js │ │ ├── payU.js │ │ ├── paymentForm.js │ │ ├── paypalPayment.js │ │ ├── razorPay.js │ │ ├── salesRecord.js │ │ ├── sourceBans.js │ │ ├── steamIdFinder.js │ │ ├── steamIdOperations │ │ ├── BigInteger.min.js │ │ └── steamIDconverter.js │ │ ├── theme │ │ ├── bootstrap-material-design.min.js │ │ ├── bootstrap-notify.js │ │ ├── jquery.min.js │ │ ├── material-dashboard.js │ │ ├── perfect-scrollbar.jquery.min.js │ │ └── popper.min.js │ │ └── utils.js ├── server.js └── views │ ├── 404.ejs │ ├── AboutCreator.ejs │ ├── Dashboard.ejs │ ├── Footer.ejs │ ├── Header.ejs │ ├── Login.ejs │ ├── ManageAdmin.ejs │ ├── ManageVIP.ejs │ ├── PanelAuditLogs.ejs │ ├── PanelSetting.ejs │ ├── SaleRecords.ejs │ ├── SteamDataFetchTool.ejs │ ├── TbodyAdminFlags.ejs │ ├── UserDashboard.ejs │ └── sourceBans.ejs ├── README.md ├── Screen_Shots ├── VMP_SS.jpg ├── VMP_SS_1.png ├── VMP_SS_10.png ├── VMP_SS_11.png ├── VMP_SS_12.png ├── VMP_SS_13.png ├── VMP_SS_14.png ├── VMP_SS_15.png ├── VMP_SS_2.png ├── VMP_SS_3.png ├── VMP_SS_4.png ├── VMP_SS_5.png ├── VMP_SS_6.png ├── VMP_SS_7.png ├── VMP_SS_8.png ├── VMP_SS_9.png └── icon.png ├── Server_Plugin ├── addons │ └── sourcemod │ │ ├── plugins │ │ └── vmpanel.smx │ │ ├── scripting │ │ └── vmpanel.sp │ │ └── translations │ │ └── vmpanel.phrases.txt ├── cfg │ └── sourcemod │ │ └── VMPanel.cfg └── readme.md └── _config.yml /.gitattributes: -------------------------------------------------------------------------------- 1 | *.css linguist-detectable=false 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | push: 5 | branches: [master, ] 6 | pull_request: 7 | # The branches below must be a subset of the branches above 8 | branches: [master] 9 | schedule: 10 | - cron: '0 2 * * 2' 11 | 12 | jobs: 13 | analyze: 14 | name: Analyze 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - name: Checkout repository 19 | uses: actions/checkout@v2 20 | with: 21 | # We must fetch at least the immediate parents so that if this is 22 | # a pull request then we can checkout the head. 23 | fetch-depth: 2 24 | 25 | # If this run was triggered by a pull request event, then checkout 26 | # the head of the pull request instead of the merge commit. 27 | - run: git checkout HEAD^2 28 | if: ${{ github.event_name == 'pull_request' }} 29 | 30 | # Initializes the CodeQL tools for scanning. 31 | - name: Initialize CodeQL 32 | uses: github/codeql-action/init@v1 33 | # Override language selection by uncommenting this and choosing your languages 34 | # with: 35 | # languages: go, javascript, csharp, python, cpp, java 36 | 37 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 38 | # If this step fails, then you should remove it and run the build manually (see below) 39 | - name: Autobuild 40 | uses: github/codeql-action/autobuild@v1 41 | 42 | # ℹ️ Command-line programs to run using the OS shell. 43 | # 📚 https://git.io/JvXDl 44 | 45 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 46 | # and modify them (or add more) to build your code if your project 47 | # uses a compiled language 48 | 49 | #- run: | 50 | # make bootstrap 51 | # make release 52 | 53 | - name: Perform CodeQL Analysis 54 | uses: github/codeql-action/analyze@v1 55 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | config.json 2 | node_modules 3 | .vscode 4 | VMPanel.log 5 | package-lock.json -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at shivamparashar33@gmail.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | ## General 4 | - Contributions can be done by forking the source repo and creating the pull request with the changes to the source repo. 5 | - Create a PR with 6 | - Brief description having why it is required and what has been changed 7 | - Title with overview of PR 8 | - If adding a new module or concept to the application, please create a new PR for it. And if it's a big change and affect the large part of the code base or it's operations then create the issue for discussion before any development. 9 | - Not mandatory but recommended to squash the commits to one commit pertaining to the PR. 10 | 11 | ## Panel Server 12 | - Follow the ES Lint rules according to `.eslintrc.json`, at least for your own deltas. -------------------------------------------------------------------------------- /Old_Content/mysqlQuery/readme.md: -------------------------------------------------------------------------------- 1 | # Below are the queries mentioned in case you want to or had to manually perform any actions in MYSQL 2 | 3 | - Query to manually create tables for server 4 | ```mysql 5 | CREATE TABLE `table_name_here` ( 6 | `authId` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, 7 | `flag` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT '"0:a"', 8 | `name` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL, 9 | `expireStamp` int(20) NOT NULL, 10 | `created_at` datetime NOT NULL, 11 | `type` int(20) NOT NULL, 12 | PRIMARY KEY (`authId`) 13 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci 14 | ``` 15 | 16 | - Query to manually create user table 17 | ```mysql 18 | CREATE TABLE `tbl_users` ( 19 | `id` int(11) NOT NULL AUTO_INCREMENT, 20 | `username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, 21 | `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, 22 | `sec_key` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL, 23 | `user_type` int(11) NOT NULL, 24 | PRIMARY KEY (`id`) 25 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci 26 | ``` 27 | 28 | - Query to manually insert and admin 29 | ```mysql 30 | INSERT INTO `GGVIPlist`.`tbl_users` (`username`, `password`, `sec_key`, `user_type`) VALUES ('your_admin_name_here', 'your_Admin_pass_here', 'your_admin_auth_key_here','1 for superuser, 0 for normal'); 31 | ``` 32 | 33 | - Query to create sales table manually 34 | ```mysql 35 | CREATE TABLE `tbl_sales` ( 36 | `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 37 | `order_id` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, 38 | `payer_id` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, 39 | `payer_steamid` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, 40 | `payer_email` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, 41 | `payer_name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, 42 | `payer_surname` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, 43 | `product_desc` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, 44 | `amount_paid` int(20) NOT NULL, 45 | `amount_currency` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, 46 | `status` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, 47 | `sale_type` tinyint(4) NOT NULL, 48 | `created_on` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, 49 | PRIMARY KEY (`id`) 50 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci 51 | ``` 52 | 53 | - Query to create tbl_servers table manually 54 | ```mysql 55 | CREATE TABLE `tbl_servers` ( 56 | `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 57 | `tbl_name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, 58 | `server_name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, 59 | `server_ip` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, 60 | `server_port` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, 61 | `server_rcon_pass` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, 62 | `vip_slots` int(20) DEFAULT NULL, 63 | `vip_price` int(20) DEFAULT NULL, 64 | `vip_currency` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, 65 | `vip_flag` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, 66 | `created_at` datetime DEFAULT NULL, 67 | PRIMARY KEY (`id`) 68 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci 69 | ``` 70 | 71 | - Query to create tbl_settings table manually 72 | ```mysql 73 | CREATE TABLE `tbl_settings` ( 74 | `id` int(11) NOT NULL AUTO_INCREMENT, 75 | `setting_key` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, 76 | `setting_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, 77 | PRIMARY KEY (`id`) 78 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci 79 | ``` 80 | 81 | - Query to update table accroding to changes of v1.6 82 | ```mysql 83 | ALTER TABLE `tbl_sales` CHANGE `payer_surname` `payer_surname` VARCHAR(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL; 84 | ALTER TABLE `tbl_sales` ADD `payment_gateway` VARCHAR(20) NOT NULL AFTER `id`; 85 | ``` -------------------------------------------------------------------------------- /Old_Content/shell_script/vipLive.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Locations of Simpleadminfile 4 | # Example for Pterodactyl server manager 5 | FILE="/srv/daemon-data/ba4462c0-76a8-42c8-a034-d47b7ac72ead/csgo/addons/sourcemod/configs/admins_simple.ini" 6 | # Example for LInuxGSM Server manager 7 | FILE1="/home/ss/csgo_Servers/Execute_server/csgoserver/serverfiles/csgo/addons/sourcemod/configs/admins_simple.in" 8 | # File variable will hold the path of your admins_simple.ini file in which admins and vips get stored 9 | 10 | #connect with db, read data and store it in myvar (replace user with your sql user, host_ip with your sql server ip, user_password with your sql user password table_name_here_server1 with the name of table you used to store name, flag and steam id) 11 | myvar=$(mysql testdb -u 'user' -h 'host_ip' -p'user_password' -se "SELECT authId,flag,name FROM table_name_here_server1 ") 12 | echo "$myvar" 13 | 14 | myvar2=$(mysql testdb -u 'user' -h 'host_ip' -p'user_password' -se "SELECT authId,flag,name FROM table_name_here_server2 ") 15 | echo "$myvar2" 16 | 17 | #fill in admins_simple.ini of first server 18 | /bin/cat <$FILE 19 | $myvar 20 | EOM 21 | 22 | #fillin admins_simple.ini of second server 23 | /bin/cat <$FILE1 24 | $myvar2 25 | EOM 26 | 27 | # add more File, myvar, and file writing code for multiple servers keep in mind to use distict names for all servers 28 | 29 | #Notify user on discord that all vips are refreshed 30 | echo "Sending vip update notif" 31 | curl -X POST \ 32 | Your_discord_server_webhook_here \ 33 | -H 'Content-Type: application/json' \ 34 | -H 'Postman-Token: a47466ea-0446-44bf-ae2c-aed37a9421a1' \ 35 | -H 'cache-control: no-cache' \ 36 | -d '{ 37 | "username": "botname", 38 | "avatar_url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSGwlp38Uh7kH-ySdc-miJh5DwvEi_AmTOCHKmjFKx2ZhdacrBDYA", 39 | "content": "hello there!", 40 | "embeds": [{ 41 | "title": "VIP entries refreshed!", 42 | "description": "Main Server machine\n" 43 | }] 44 | }' 45 | -------------------------------------------------------------------------------- /Panel_Server/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "node": true, 4 | "browser": false, 5 | "commonjs": true, 6 | "es2020": true 7 | }, 8 | "extends": "eslint:recommended", 9 | "parserOptions": { 10 | "ecmaVersion": 11 11 | }, 12 | "rules": { 13 | } 14 | } -------------------------------------------------------------------------------- /Panel_Server/app/config/example_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "db": { 3 | "db_host": "your_db_host", 4 | "db_port": 3306, 5 | "db_user": "your_db_username", 6 | "db_password": "your_db_user's_password", 7 | "db_name": "dbname" 8 | }, 9 | "hostname": "localhost", 10 | "serverPort": "3535", 11 | "apacheProxy": false, 12 | "scheduleConfig": { 13 | "delete": "12", 14 | "notif": "24" 15 | }, 16 | "usersTable": "tbl_users", 17 | "settingTable": "tbl_settings", 18 | "serverTable": "tbl_servers", 19 | "salestable": "tbl_sales", 20 | "audittable": "tbl_audit_logs", 21 | "bundletable": "tbl_bundles", 22 | "bundleRelTable": "tbl_rel_bundle_server", 23 | "jwt": { 24 | "key": "add some random generated string here min 32length" 25 | }, 26 | "app": { 27 | "secret": "add some random generated string here min 32length" 28 | }, 29 | "steam_api_key": "Your Steam API Key Here (Leave Empty to disable steam login)", 30 | "payment_gateways": { 31 | "paypal": { 32 | "paypal_client_id": "Your paypal client id here (Leave Empty to disable Paypal Feature)" 33 | }, 34 | "payU": { 35 | "enabled": "write true to enable payu and false to disable payu, make sure to write true or false without double codes as it is boolean value", 36 | "environment": "write test to run payu in test environment, live to make payu work with live payments", 37 | "merchantKey": "your payu merchant key (test key for test, live key for live)", 38 | "merchantSalt": "your payu merchant salt (test salt for test, live salt for live)" 39 | }, 40 | "razorPay": { 41 | "enabled": "write true to enable razorPay and false to disable razorPay, make sure to write true or false without double codes as it is boolean value", 42 | "environment": "write test to run razorPay in test environment, live to make razorPay work with live payments", 43 | "keyId": "your razorPay key_id (test key for test, live key for live)", 44 | "keySecret": "your razorPay key_secret (test key_secret for test, live key_secret for live)" 45 | } 46 | }, 47 | "logging": { 48 | "logLevel": "INFO" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Panel_Server/app/config/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const config = {}; 4 | 5 | const rawConfig = require('./config.json'); 6 | Object.assign(config, rawConfig); 7 | 8 | module.exports = config; -------------------------------------------------------------------------------- /Panel_Server/app/config/sample_config.txt: -------------------------------------------------------------------------------- 1 | // Below is the example of a config with random values , replace them with your values, rename the example_config.json to config.json and create your config 2 | 3 | // { 4 | // "db": { 5 | // "db_host": "some.example.com", 6 | // "db_port": 3306, 7 | // "db_user": "user", 8 | // "db_password": "password", 9 | // "db_name": "vmpanel" 10 | // }, 11 | // "hostname": "vip.example.com", 12 | // "serverPort": "3535", 13 | // "apacheProxy": false, 14 | // "usersTable": "tbl_users", 15 | // "settingTable": "tbl_settings", 16 | // "serverTable": "tbl_servers", 17 | // "salestable": "tbl_sales", 18 | // "audittable": "tbl_audit_logs", 19 | // "bundletable": "tbl_bundles", 20 | // "bundleRelTable": "tbl_rel_bundle_server", 21 | // "scheduleConfig": { 22 | // "delete": "12", 23 | // "notif": "24" 24 | // }, 25 | // "jwt": { 26 | // "key": "|@MaDevL0p3R" 27 | // }, 28 | // "app": { 29 | // "secret": "add some random generated string here min 32length" 30 | // }, 31 | // "steam_api_key": "DFGH4567SDFGH567DFGHJ", 32 | // "payment_gateways": { 33 | // "paypal": { 34 | // "paypal_client_id": "wertyjkjhgfdsertghjknbvfdr567uijnbvfdertyujnbvcdrtyujnbvfrtyujhbvfr567ujbvfrtyu" 35 | // }, 36 | // "payU": { 37 | // "enabled": true, 38 | // "environment": "test", 39 | // "merchantKey": "*****", 40 | // "merchantSalt": "******" 41 | // } 42 | // } 43 | // } -------------------------------------------------------------------------------- /Panel_Server/app/controllers/auditLogs.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | const logger = require('../modules/logger')('Audit Logs Controller'); 22 | 23 | const auditModal = require("../models/auditLogsModel.js"); 24 | 25 | //----------------------------------------------------------------------------------------------------- 26 | // 27 | 28 | exports.auditRecords = async (req, res) => { 29 | try { 30 | if (req.session.user_type == 1) { 31 | res.render('PanelAuditLogs'); 32 | } else { 33 | res.redirect('dashboard'); 34 | } 35 | } catch (error) { 36 | logger.error("error in auditRecords-->", error); 37 | if (req.session.user_type == 1) { 38 | res.render('PanelAuditLogs'); 39 | } else { 40 | res.redirect('dashboard'); 41 | } 42 | } 43 | } 44 | //----------------------------------------------------------------------------------------------------- 45 | 46 | 47 | //----------------------------------------------------------------------------------------------------- 48 | // 49 | 50 | exports.getAuditRecord = async (req, res) => { 51 | try { 52 | if (req.session.user_type == 1) { 53 | let result = await getAuditRecordFunc(req.body); 54 | res.json({ 55 | success: true, 56 | data: { "res": result, "message": "Audit Logs Fetched" } 57 | }); 58 | } else { 59 | return reject("You don't have permissions to access records") 60 | } 61 | } catch (error) { 62 | logger.error("error in getAuditRecord->", error); 63 | res.json({ 64 | success: false, 65 | data: { "error": error } 66 | }); 67 | } 68 | } 69 | 70 | const getAuditRecordFunc = (reqBody) => { 71 | return new Promise(async (resolve, reject) => { 72 | try { 73 | 74 | let salesRecord = await auditModal.getAllAuditRecords(reqBody) 75 | resolve(salesRecord) 76 | } catch (error) { 77 | logger.error("error in getAuditRecordFunc->", error); 78 | reject(error + ", Please try again") 79 | } 80 | }); 81 | } 82 | 83 | exports.getAuditRecordFunc = getAuditRecordFunc; 84 | //----------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------- /Panel_Server/app/controllers/deleteVip.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | const logger = require('../modules/logger')('Delete VIP controller'); 22 | const vipModel = require("../models/vipModel.js"); 23 | const userModel = require("../models/userModel.js"); 24 | const { refreshAdminsInServer } = require("../utils/refreshCFGInServer") 25 | const { logThisActivity } = require("../utils/activityLogger.js"); 26 | var rconStatus 27 | 28 | //----------------------------------------------------------------------------------------------------- 29 | // 30 | 31 | exports.deleteVipData = async (req, res) => { 32 | try { 33 | req.body.secKey = req.session.sec_key 34 | let result = await deleteVipDataFunc(req.body, req.session.username); 35 | logThisActivity({ 36 | "activity": "VIP deleted", 37 | "additional_info": req.body.primaryKey, 38 | "created_by": req.session.username 39 | }) 40 | res.json({ 41 | success: true, 42 | data: { 43 | "res": result, 44 | "message": "VIP deleted Successfully" + (rconStatus ? ", RCON Executed" : ", RCON Not Executed"), 45 | "notifType": "success" 46 | } 47 | }); 48 | } catch (error) { 49 | logger.error("error in delete vip->", error); 50 | res.json({ 51 | success: false, 52 | data: { "error": error } 53 | }); 54 | } 55 | } 56 | 57 | const deleteVipDataFunc = (reqBody, username) => { 58 | return new Promise(async (resolve, reject) => { 59 | try { 60 | let userData = await userModel.getUserDataByUsername(username) 61 | 62 | if (reqBody.secKey && reqBody.secKey === userData.sec_key) { 63 | reqBody.primaryKey = '"' + reqBody.primaryKey + '"' 64 | let deleteRes = await vipModel.deleteVipByAdmin(reqBody) 65 | if (deleteRes) { 66 | rconStatus = await refreshAdminsInServer(reqBody.tableName); 67 | resolve(deleteRes) 68 | } 69 | } else { 70 | reject("Unauthorized Access, Key Missing") 71 | } 72 | 73 | } catch (error) { 74 | logger.error("error in deleteVipDataFunc->", error); 75 | reject(error + ", Please try again") 76 | } 77 | }); 78 | } 79 | 80 | exports.deleteVipDataFunc = deleteVipDataFunc; 81 | //----------------------------------------------------------------------------------------------------- 82 | 83 | 84 | //----------------------------------------------------------------------------------------------------- 85 | // 86 | 87 | exports.deleteOldVipData = async (req, res) => { 88 | try { 89 | 90 | let result = await deleteOldVipDataFunc(req.session.username, req.session.sec_key); 91 | logThisActivity({ 92 | "activity": "Manual Refresh Executed", 93 | "additional_info": "Old VIPs and deleted and new data is updated in servers", 94 | "created_by": req.session.username 95 | }) 96 | res.json({ 97 | success: true, 98 | data: { 99 | "res": result, 100 | "message": "Operation Successfully Executed", 101 | "notifType": "success" 102 | } 103 | }); 104 | } catch (error) { 105 | logger.error("error in delete vip->", error); 106 | res.json({ 107 | success: false, 108 | data: { "error": error } 109 | }); 110 | } 111 | } 112 | 113 | const deleteOldVipDataFunc = (username, secKey) => { 114 | return new Promise(async (resolve, reject) => { 115 | try { 116 | let userData = await userModel.getUserDataByUsername(username) 117 | 118 | if (secKey && secKey === userData.sec_key) { 119 | 120 | let deleteRes = await vipModel.deleteOldVip() 121 | if (deleteRes) { 122 | resolve(deleteRes) 123 | } 124 | } else { 125 | reject("Unauthorized Access, Key Missing") 126 | } 127 | } catch (error) { 128 | logger.error("error in deleteOldVipDataFunc->", error); 129 | reject(error + ", Please try again") 130 | } 131 | }); 132 | } 133 | 134 | exports.deleteOldVipDataFunc = deleteOldVipDataFunc; -------------------------------------------------------------------------------- /Panel_Server/app/controllers/insertAdmin.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | const logger = require('../modules/logger')('Insert Admin Controller'); 22 | 23 | const userModel = require("../models/userModel.js"); 24 | const vipModel = require("../models/vipModel.js"); 25 | const panelServerModal = require("../models/panelServerModal.js"); 26 | const { refreshAdminsInServer } = require("../utils/refreshCFGInServer") 27 | const { logThisActivity } = require("../utils/activityLogger.js"); 28 | var rconStatus = [] 29 | 30 | //----------------------------------------------------------------------------------------------------- 31 | // 32 | 33 | exports.formAdmin = async (req, res) => { 34 | try { 35 | let serverList = await panelServerModal.getPanelServersDisplayList(); 36 | res.render('ManageAdmin', { "serverList": serverList }); 37 | } catch (error) { 38 | res.render('ManageAdmin', { "serverList": null }); 39 | } 40 | } 41 | //----------------------------------------------------------------------------------------------------- 42 | 43 | 44 | //----------------------------------------------------------------------------------------------------- 45 | // 46 | 47 | exports.insertAdminData = async (req, res) => { 48 | try { 49 | req.body.secKey = req.session.sec_key 50 | let result = await insertAdminDataFunc(req.body, req.session.username); 51 | logThisActivity({ 52 | "activity": "New Admin added", 53 | "additional_info": `${req.body.name.replace("//", "")} ( ${req.body.steamId} )`, 54 | "created_by": req.session.username 55 | }) 56 | res.json({ 57 | success: true, 58 | data: { 59 | "res": result, 60 | "message": "New Admin added Successfully" + (rconStatus.includes(0) ? ", RCON Not Executed for all Servers" : ", RCON Executed for all Servers"), 61 | "notifType": "success" 62 | } 63 | }); 64 | } catch (error) { 65 | logger.error("error in add Admin->", error); 66 | res.json({ 67 | success: false, 68 | data: { "error": error } 69 | }); 70 | } 71 | } 72 | 73 | const insertAdminDataFunc = (reqBody, username) => { 74 | return new Promise(async (resolve, reject) => { 75 | try { 76 | 77 | let userData = await userModel.getUserDataByUsername(username) 78 | 79 | if (reqBody.secKey && reqBody.secKey === userData.sec_key) { 80 | if (reqBody.submit === "insert") { 81 | 82 | //validations 83 | if (!reqBody.steamId) return reject("Operation Fail!, Steam Id Missing"); 84 | if (!reqBody.name) return reject("Operation Fail!, Name Missing"); 85 | if (!reqBody.flag) return reject("Operation Fail!, Flags Missing"); 86 | if (!reqBody.server) return reject("Operation Fail!, Server list Missing"); 87 | 88 | let serverList = reqBody.server 89 | if (!Array.isArray(serverList)) return reject("Operation Fail!, Server list is not an Array"); 90 | let allServersList = await panelServerModal.getPanelServersDisplayList(); 91 | let serverListLength 92 | if (serverList.length <= allServersList.length) { 93 | serverListLength = serverList.length 94 | } else { 95 | return reject("Length of given server list is more then max servers added in panel, something is fishy"); 96 | } 97 | 98 | reqBody.name = "//" + reqBody.name; 99 | reqBody.steamId = '"' + reqBody.steamId + '"'; 100 | reqBody.day = 0; 101 | reqBody.userType = 1; 102 | 103 | let insertRes = await vipModel.insertVIPData(reqBody) 104 | if (insertRes) { 105 | for (let i = 0; i < serverListLength; i++) { 106 | let result = await refreshAdminsInServer(serverList[i]); 107 | rconStatus.push(result) 108 | } 109 | resolve(insertRes) 110 | } 111 | } 112 | } else { 113 | reject("Unauthorized Access, Key Missing") 114 | } 115 | } catch (error) { 116 | logger.error("error in insertAdminDataFunc->", error); 117 | reject(error + ", Please try again") 118 | } 119 | }); 120 | } 121 | 122 | exports.insertAdminDataFunc = insertAdminDataFunc; 123 | -------------------------------------------------------------------------------- /Panel_Server/app/controllers/login.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | const jwt = require('jsonwebtoken'); 22 | const bcrypt = require('bcrypt'); 23 | const config = require('../config'); 24 | const logger = require('../modules/logger')('Login Controller'); 25 | const User = require('../modules/user'); 26 | 27 | const jwtSecretKey = config.jwt.key; 28 | const steamApi = config.steam_api_key; 29 | 30 | exports.loginPage = async (req, res) => { 31 | const isAdminRoute = (req.route.path === "/adminlogin") || (req.headers.referer && req.headers.referer.indexOf("/adminlogin") != -1); 32 | try { 33 | if (req.session.token || req.session.passport) return res.redirect('/'); 34 | res.render('Login', { 35 | "steamLogin": (steamApi ? true : false), 36 | "adminRoute": isAdminRoute, 37 | "error": null 38 | }); 39 | } catch (error) { 40 | logger.error("error in login-->", error); 41 | res.render('Login', { 42 | "steamLogin": (steamApi ? true : false), 43 | "adminRoute": isAdminRoute, 44 | "error": "Something went wrong contact Admin for more Info" 45 | }); 46 | } 47 | } 48 | 49 | exports.authUserLogin = async (req, res) => { 50 | const isAdminRoute = req.headers.referer.indexOf("/adminlogin") != -1; 51 | try { 52 | let username = req.body.username; 53 | let password = req.body.password; 54 | // For the given username fetch user from DB 55 | const user = new User({ 56 | username 57 | }); 58 | const userData = await user.userInfo(); 59 | if (!(username && password)) { 60 | return res.render('Login', { 61 | "steamLogin": (steamApi ? true : false), 62 | "adminRoute": isAdminRoute, 63 | "error": 'Authentication failed! Please check the request' 64 | }); 65 | } 66 | bcrypt.compare(password, userData.password, function (err, result) { 67 | if (err || result != true) return res.render('Login', { 68 | "steamLogin": (steamApi ? true : false), 69 | "adminRoute": isAdminRoute, 70 | "error": 'Incorrect Username or Password' 71 | }); 72 | 73 | const token = jwt.sign({ username: username }, 74 | jwtSecretKey, 75 | { 76 | expiresIn: '7d' // expires in 7 day 77 | } 78 | ); 79 | // return the JWT token for the future API calls 80 | req.session.token = token; 81 | req.session.username = userData.username; 82 | req.session.sec_key = userData.sec_key; 83 | req.session.user_type = userData.user_type; 84 | return res.redirect('/managevip'); 85 | }); 86 | } catch (error) { 87 | logger.error("error in authUserLogin-->", error); 88 | res.render('Login', { 89 | "steamLogin": (steamApi ? true : false), 90 | "adminRoute": isAdminRoute, 91 | "error": "Something went wrong contact Admin for more Info" 92 | }) 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /Panel_Server/app/controllers/panelServerBundles.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | const logger = require('../modules/logger')('Panel Server Bundles Controller'); 22 | const userModel = require("../models/userModel.js"); 23 | const bundleModel = require("../models/bundleModel.js"); 24 | const { logThisActivity } = require("../utils/activityLogger.js"); 25 | 26 | //----------------------------------------------------------------------------------------------------- 27 | // 28 | 29 | exports.addPanelServerBundle = async (req, res) => { 30 | try { 31 | 32 | req.body.secKey = req.session.sec_key 33 | let result = await addPanelServerBundleFunc(req.body, req.session.username); 34 | 35 | logThisActivity({ 36 | "activity": "New Server Bundle added in Panel", 37 | "additional_info": req.body.bundlename, 38 | "created_by": req.session.username 39 | }) 40 | 41 | res.json({ 42 | success: true, 43 | data: { "res": result, "message": "New Server Bundle added in Panel" } 44 | }); 45 | } catch (error) { 46 | logger.error("error in addPanelServerBundle->", error); 47 | res.json({ 48 | success: false, 49 | data: { "error": error } 50 | }); 51 | } 52 | } 53 | 54 | const addPanelServerBundleFunc = (reqBody, username) => { 55 | return new Promise(async (resolve, reject) => { 56 | try { 57 | 58 | // validation 59 | if (reqBody.bundleserverarray < 2) return reject("Operation Fail!, Select at-least two servers to create a bundle"); 60 | if (!reqBody.bundlename) return reject("Operation Fail!, Bundle name is Missing"); 61 | if (!reqBody.bundleprice) return reject("Operation Fail!, Bundle Price is Missing"); 62 | if (!reqBody.bundlecurrency) return reject("Operation Fail!, Bundle Currency is Missing"); 63 | if (!reqBody.bundlesubdays) return reject("Operation Fail!, Bundle Subscription days are Missing"); 64 | if (!reqBody.bundlevipflag) return reject("Operation Fail!, Bundle VIP Flag is Missing"); 65 | 66 | let userData = await userModel.getUserDataByUsername(username) 67 | 68 | if (reqBody.secKey && reqBody.secKey === userData.sec_key) { 69 | if (reqBody.submit === "insert") { 70 | let insertRes = await bundleModel.insertNewPanelBundle(reqBody) 71 | if (insertRes) { 72 | resolve(insertRes) 73 | } 74 | } 75 | } else { 76 | reject("Unauthorized Access, Key Missing") 77 | } 78 | } catch (error) { 79 | logger.error("error in addPanelServerBundleFunc->", error); 80 | reject(error + ", Please try again") 81 | } 82 | }); 83 | } 84 | 85 | exports.addPanelServerBundleFunc = addPanelServerBundleFunc; 86 | //----------------------------------------------------------------------------------------------------- 87 | 88 | 89 | //----------------------------------------------------------------------------------------------------- 90 | // 91 | 92 | exports.getPanelBundlesList = async (req, res) => { 93 | try { 94 | 95 | req.body.secKey = req.session.sec_key 96 | let result = await getPanelBundlesListFunc(req.body); 97 | res.json({ 98 | success: true, 99 | data: { "res": result, "message": "Bundles List Fetched" } 100 | }); 101 | } catch (error) { 102 | logger.error("error in getPanelBundlesList->", error); 103 | res.json({ 104 | success: false, 105 | data: { "error": error } 106 | }); 107 | } 108 | } 109 | 110 | const getPanelBundlesListFunc = (reqBody) => { 111 | return new Promise(async (resolve, reject) => { 112 | try { 113 | 114 | let serverData = await bundleModel.getAllBundles() 115 | resolve(serverData) 116 | 117 | } catch (error) { 118 | logger.error("error in getPanelBundlesListFunc->", error); 119 | reject(error + ", Please try again") 120 | } 121 | }); 122 | } 123 | 124 | exports.getPanelBundlesListFunc = getPanelBundlesListFunc; 125 | //----------------------------------------------------------------------------------------------------- 126 | 127 | 128 | //----------------------------------------------------------------------------------------------------- 129 | // 130 | 131 | exports.deletePanelBundle = async (req, res) => { 132 | try { 133 | 134 | req.body.secKey = req.session.sec_key 135 | let result = await deletePanelBundleFunc(req.body, req.session.username); 136 | 137 | logThisActivity({ 138 | "activity": "Panel Bundle Deleted", 139 | "additional_info": req.body.bundlename, 140 | "created_by": req.session.username 141 | }) 142 | 143 | res.json({ 144 | success: true, 145 | data: { "res": result, "message": "Bundle Deleted Successfully" } 146 | }); 147 | } catch (error) { 148 | logger.error("error in deletePanelBundle->", error); 149 | res.json({ 150 | success: false, 151 | data: { "error": error } 152 | }); 153 | } 154 | } 155 | 156 | const deletePanelBundleFunc = (reqBody, username) => { 157 | return new Promise(async (resolve, reject) => { 158 | try { 159 | 160 | // validation 161 | if (!reqBody.bundlename) return reject("Operation Fail!, Bundle Name is not provided"); 162 | if (!reqBody.id) return reject("Operation Fail!, Id is not provided"); 163 | 164 | let userData = await userModel.getUserDataByUsername(username) 165 | 166 | if (reqBody.secKey && reqBody.secKey === userData.sec_key) { 167 | if (reqBody.submit === "delete") { 168 | let deleteRes = await bundleModel.deletePanelBundle(reqBody) 169 | if (deleteRes) { 170 | resolve(deleteRes) 171 | } 172 | } 173 | } else { 174 | reject("Unauthorized Access, Key Missing") 175 | } 176 | } catch (error) { 177 | logger.error("error in deletePanelBundleFunc->", error); 178 | reject(error + ", Please try again") 179 | } 180 | }); 181 | } 182 | 183 | exports.deletePanelBundleFunc = deletePanelBundleFunc; 184 | -------------------------------------------------------------------------------- /Panel_Server/app/controllers/panelSettings.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | const logger = require('../modules/logger')('Panel Setting Controller'); 22 | const userModel = require("../models/userModel.js"); 23 | const settingsModal = require("../models/panelSettingModal.js"); 24 | const { logThisActivity } = require("../utils/activityLogger.js"); 25 | 26 | //----------------------------------------------------------------------------------------------------- 27 | // 28 | 29 | exports.PanelSettings = async (req, res) => { 30 | try { 31 | 32 | if (req.session.user_type == 1) { 33 | res.render('PanelSetting'); 34 | } else { 35 | let settings = await settingsModal.getAllSettings(); 36 | if (settings.normiadmin_settings == 1) { 37 | res.render('PanelSetting'); 38 | } else { 39 | res.redirect('dashboard'); 40 | } 41 | } 42 | } catch (error) { 43 | logger.error("Error in PanelSettings->", error); 44 | if (req.session.user_type == 1) { 45 | res.render('PanelSetting'); 46 | } else { 47 | res.redirect('dashboard'); 48 | } 49 | } 50 | } 51 | //----------------------------------------------------------------------------------------------------- 52 | 53 | 54 | //----------------------------------------------------------------------------------------------------- 55 | // 56 | 57 | exports.fetchPanelSettings = async (req, res) => { 58 | try { 59 | let result = await fetchPanelSettingsFunc(req.body); 60 | res.json({ 61 | success: true, 62 | data: { "res": result, "message": "Panel settings Fetched" } 63 | }); 64 | } catch (error) { 65 | logger.error("error in add/update vip->", error); 66 | res.json({ 67 | success: false, 68 | data: { "error": error, "message": "Error in fetching Panel settings" } 69 | }); 70 | } 71 | } 72 | 73 | const fetchPanelSettingsFunc = (reqBody) => { 74 | return new Promise(async (resolve, reject) => { 75 | try { 76 | let data = await settingsModal.getAllSettings() 77 | resolve(data) 78 | } catch (error) { 79 | logger.error("error in fetchPanelSettingsFunc->", error); 80 | reject(error) 81 | } 82 | }); 83 | } 84 | 85 | exports.fetchPanelSettingsFunc = fetchPanelSettingsFunc; 86 | //----------------------------------------------------------------------------------------------------- 87 | 88 | 89 | //----------------------------------------------------------------------------------------------------- 90 | // 91 | 92 | exports.updatePanelSettings = async (req, res) => { 93 | try { 94 | req.body.secKey = req.session.sec_key 95 | await updatePanelSettingsFunc(req.body, req.session.username); 96 | 97 | logThisActivity({ 98 | "activity": "Panel Settings Updated", 99 | "additional_info": "Panel Settings Updated", 100 | "created_by": req.session.username 101 | }) 102 | 103 | res.redirect('PanelSetting'); 104 | } catch (error) { 105 | logger.error("Error in PanelSettings->", error); 106 | res.render('PanelSetting'); 107 | } 108 | } 109 | 110 | const updatePanelSettingsFunc = (reqBody, username) => { 111 | return new Promise(async (resolve, reject) => { 112 | try { 113 | 114 | let userData = await userModel.getUserDataByUsername(username) 115 | 116 | if (reqBody.secKey && reqBody.secKey === userData.sec_key) { 117 | 118 | let keyArray = Object.keys(reqBody) 119 | for (let i = 0; i < keyArray.length; i++) { 120 | await settingsModal.updateSetting(keyArray[i], reqBody[keyArray[i]]) 121 | } 122 | resolve(true) 123 | } 124 | } catch (error) { 125 | logger.error("error in updatePanelSettingsFunc->", error); 126 | reject(error + ", Please try again") 127 | } 128 | }); 129 | } -------------------------------------------------------------------------------- /Panel_Server/app/controllers/payU.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | const logger = require('../modules/logger')('pay U controller'); 22 | const SteamIDConverter = require('../utils/steamIdConvertor') 23 | const crypto = require('crypto'); 24 | const config = require('../config'); 25 | const payUConfig = config.payment_gateways.payU 26 | 27 | //----------------------------------------------------------------------------------------------------- 28 | // 29 | 30 | exports.initPayUPayment = async (req, res) => { 31 | try { 32 | const secKey = req.session.passport.user.id 33 | let result = await initPayUPaymentFunc(req.body, req.user, secKey); 34 | 35 | res.json({ 36 | success: true, 37 | data: { 38 | "res": result, 39 | "message": "PayU initiated", 40 | "notifType": "success" 41 | } 42 | }); 43 | } catch (error) { 44 | logger.error("error in add/update vip->", error); 45 | res.json({ 46 | success: false, 47 | data: { "error": error } 48 | }); 49 | } 50 | } 51 | 52 | const initPayUPaymentFunc = (reqBody, reqUser, secKey) => { 53 | return new Promise(async (resolve, reject) => { 54 | try { 55 | 56 | const steamId = SteamIDConverter.toSteamID(reqUser.id); 57 | 58 | let productData = reqBody.serverData 59 | let productInfo = productData.vip_days + " days VIP for " + productData.server_name + (reqBody.type == 'newPurchase' ? " (New Buy)" : reqBody.type == 'renewPurchase' ? " (Renewal)" : "") 60 | 61 | let txnID = createTXNid() 62 | let successURL = ((config.apacheProxy) ? ('http://' + config.hostname) : ('http://' + config.hostname + ':' + config.serverPort)) + '/txnsuccesspayu' 63 | let errorURL = ((config.apacheProxy) ? ('http://' + config.hostname) : ('http://' + config.hostname + ':' + config.serverPort)) + '/txnerrorpayu' 64 | 65 | let crypt = crypto.createHash('sha512'); 66 | let text = payUConfig.merchantKey + '|' + txnID + '|' + productData.vip_price + '|' + productInfo + '|' + reqBody.userFirstName + '|' + reqBody.userEmail + '|||||' + steamId + '||||||' + payUConfig.merchantSalt; 67 | crypt.update(text); 68 | let payUHash = crypt.digest('hex'); 69 | 70 | let payuFormData = { 71 | "key": payUConfig.merchantKey, 72 | "txnid": txnID, 73 | "hash": payUHash, 74 | "amount": productData.vip_price, 75 | "firstname": reqBody.userFirstName, 76 | "email": reqBody.userEmail, 77 | "phone": reqBody.userMobile, 78 | "productinfo": productInfo, 79 | "udf5": steamId, 80 | "surl": successURL, 81 | "furl": errorURL 82 | } 83 | 84 | resolve(payuFormData) 85 | } catch (error) { 86 | logger.error("error in initPayUPaymentFunc->", error); 87 | reject(error + ", Please try again") 88 | } 89 | }); 90 | } 91 | 92 | exports.initPayUPaymentFunc = initPayUPaymentFunc; 93 | //----------------------------------------------------------------------------------------------------- 94 | 95 | function createTXNid() { 96 | let txID = 'PAYUORD-' 97 | txID += randomString(2) 98 | const now = new Date() 99 | const secondsSinceEpoch = Math.round(now.getTime() / 1000) 100 | txID += secondsSinceEpoch 101 | return txID 102 | } 103 | 104 | function randomString(length) { 105 | var result = ''; 106 | var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; 107 | var charactersLength = characters.length; 108 | for (var i = 0; i < length; i++) { 109 | result += characters.charAt(Math.floor(Math.random() * charactersLength)); 110 | } 111 | return result; 112 | } -------------------------------------------------------------------------------- /Panel_Server/app/controllers/razorPay.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | "use strict"; 21 | const logger = require("../modules/logger")("RazorPay controller"); 22 | const SteamIDConverter = require("../utils/steamIdConvertor"); 23 | const config = require("../config"); 24 | const RazorPay = require("razorpay"); 25 | const { getUUID } = require("../utils/crypto"); 26 | const razorpayConfig = config.payment_gateways.razorPay; 27 | 28 | exports.initRazorpayPayment = async (req, res) => { 29 | try { 30 | const result = await initRazorpayPaymentFunc(req.body, req.user); 31 | res.json({ 32 | success: true, 33 | data: { 34 | res: result, 35 | message: "RazorPay initiated", 36 | notifType: "success" 37 | } 38 | }); 39 | } catch (error) { 40 | logger.error("error in add/update vip->", error); 41 | res.json({ 42 | success: false, 43 | data: { error: error } 44 | }); 45 | } 46 | }; 47 | 48 | const initRazorpayPaymentFunc = async (reqBody, reqUser) => { 49 | try { 50 | const steamId = SteamIDConverter.toSteamID(reqUser.id); 51 | return await createRzpOrder(reqBody, steamId); 52 | } catch (error) { 53 | logger.error("error in initRazorPayPaymentFunc->", error); 54 | throw JSON.stringify(error) + ", Please try again."; 55 | } 56 | }; 57 | 58 | const createRzpOrder = async (reqBody, steamId) => { 59 | const { server_name, vip_price, vip_currency, vip_days } = reqBody.serverData; 60 | const productInfo = `${vip_days} days VIP for ${server_name} ${purchaseType(reqBody.type)}`; 61 | 62 | const rzpOrderOptions = { 63 | amount: vip_price * 100, // Convert price to smallest subunit (50 rupees -> 5000 paise)., 64 | currency: vip_currency, 65 | receipt: createReceiptNumber(), 66 | notes: { steamId, productInfo } 67 | }; 68 | 69 | let rzpInst = new RazorPay({ key_id: razorpayConfig.keyId, key_secret: razorpayConfig.keySecret }); 70 | return { 71 | ...(await rzpInst.orders.create(rzpOrderOptions)), 72 | keyId: razorpayConfig.keyId, 73 | serverData: reqBody.serverData 74 | }; 75 | }; 76 | 77 | const purchaseType = type => { 78 | if (type == "newPurchase") return "(New Buy)"; 79 | else if (type == "renewPurchase") return "(Renewal)"; 80 | else return ""; 81 | }; 82 | 83 | const createReceiptNumber = () => { 84 | return `RZPRCPT-${getUUID(6)}`; 85 | }; 86 | -------------------------------------------------------------------------------- /Panel_Server/app/controllers/salesRecord.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | const logger = require('../modules/logger')('Sales Record Controller'); 22 | const salesModal = require("../models/salesModel.js"); 23 | 24 | //----------------------------------------------------------------------------------------------------- 25 | // 26 | 27 | exports.saleRecords = async (req, res) => { 28 | try { 29 | if (req.session.user_type == 1) { 30 | res.render('SaleRecords'); 31 | } else { 32 | res.redirect('dashboard'); 33 | } 34 | } catch (error) { 35 | logger.error("error in saleRecords-->", error); 36 | if (req.session.user_type == 1) { 37 | res.render('SaleRecords'); 38 | } else { 39 | res.redirect('dashboard'); 40 | } 41 | } 42 | } 43 | //----------------------------------------------------------------------------------------------------- 44 | 45 | 46 | //----------------------------------------------------------------------------------------------------- 47 | // 48 | 49 | exports.getSalesRecord = async (req, res) => { 50 | try { 51 | if (req.session.user_type == 1) { 52 | let result = await getSalesRecordFunc(req.body); 53 | res.json({ 54 | success: true, 55 | data: { "res": result, "message": "Sale Records Fetched" } 56 | }); 57 | } else { 58 | return reject("You don't have permissions to access records") 59 | } 60 | } catch (error) { 61 | logger.error("error in getSalesRecord->", error); 62 | res.json({ 63 | success: false, 64 | data: { "error": error } 65 | }); 66 | } 67 | } 68 | 69 | const getSalesRecordFunc = (reqBody) => { 70 | return new Promise(async (resolve, reject) => { 71 | try { 72 | 73 | let salesRecord = await salesModal.getAllSalesRecords(reqBody) 74 | resolve(salesRecord) 75 | } catch (error) { 76 | logger.error("error in getSalesRecordFunc->", error); 77 | reject(error + ", Please try again") 78 | } 79 | }); 80 | } 81 | 82 | exports.getSalesRecordFunc = getSalesRecordFunc; 83 | //----------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------- /Panel_Server/app/controllers/sourceBans.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | const logger = require('../modules/logger')('Source Bans'); 22 | 23 | const panelServerModal = require("../models/panelServerModal.js"); 24 | const { executeRconInServer } = require("../utils/csgoServerRconExecuter") 25 | const { logThisActivity } = require("../utils/activityLogger.js"); 26 | const userModel = require("../models/userModel.js"); 27 | 28 | var rconStatus = [] 29 | 30 | //----------------------------------------------------------------------------------------------------- 31 | // 32 | 33 | exports.sourceBans = async (req, res) => { 34 | try { 35 | let serverList = await panelServerModal.getPanelServersDisplayList(); 36 | res.render('sourceBans', { "serverList": serverList }); 37 | } catch (error) { 38 | logger.error("error in sourceBans-->", error); 39 | res.render('sourceBans', { "serverList": null }); 40 | } 41 | } 42 | //----------------------------------------------------------------------------------------------------- 43 | 44 | 45 | //----------------------------------------------------------------------------------------------------- 46 | // 47 | 48 | exports.sourceBansAddBan = async (req, res) => { 49 | try { 50 | req.body.secKey = req.session.sec_key 51 | let result = await sourceBansAddBanFunc(req.body, req.session.username); 52 | logThisActivity({ 53 | "activity": req.body.bantype == "serverBan" ? "New Server Ban Added" : "New Comm Ban Added", 54 | "additional_info": (req.body.bantype == "serverBan" ? 55 | `${req.body.username} (${req.body.steamid}) banned for ${req.body.banlength} Minutes` : 56 | `${req.body.username} (${req.body.steamid}) Comm Banned for ${req.body.banlength} Minutes`), 57 | "created_by": req.session.username 58 | }) 59 | res.json({ 60 | success: true, 61 | data: { 62 | "res": result, 63 | "message": req.body.bantype == "serverBan" ? "Server Ban added Successfully" : "Comm Ban added Successfully", 64 | "notifType": "success" 65 | } 66 | }); 67 | } catch (error) { 68 | logger.error("error in adding ban in sourceBansAddBan->", error); 69 | res.json({ 70 | success: false, 71 | data: { "error": error } 72 | }); 73 | } 74 | } 75 | 76 | const sourceBansAddBanFunc = (reqBody, username) => { 77 | return new Promise(async (resolve, reject) => { 78 | try { 79 | 80 | let userData = await userModel.getUserDataByUsername(username) 81 | 82 | if (reqBody.secKey && reqBody.secKey === userData.sec_key) { 83 | 84 | logger.info("req body in sourceBansAddBanFunc==> ", reqBody); 85 | 86 | if (reqBody.bantype === "serverBan") { 87 | if (reqBody.serverbantype == "steamid") { 88 | const banCommand = `sm_addban ${reqBody.banlength} ${reqBody.steamid} [${reqBody.banreason}]` 89 | await executeRconInServer(reqBody.banserver, banCommand) 90 | resolve("Ban Added") 91 | } else { 92 | return reject("Wrong ban type passed in API") 93 | } 94 | } else if (reqBody.bantype === "commBan") { 95 | 96 | if (reqBody.commbantype == "chatonly") { 97 | const banCommand = `sm_gag #${reqBody.steamid}|${reqBody.username} ${reqBody.banlength} [${reqBody.banreason}]` 98 | await executeRconInServer(reqBody.banserver, banCommand) 99 | resolve("Ban Added") 100 | } else if (reqBody.commbantype == "voiceonly") { 101 | const banCommand = `sm_mute #${reqBody.steamid}|${reqBody.username} ${reqBody.banlength} [${reqBody.banreason}]` 102 | await executeRconInServer(reqBody.banserver, banCommand) 103 | resolve("Ban Added") 104 | } else if (reqBody.commbantype == "chatandvoice") { 105 | const banCommand = `sm_unsilence #${reqBody.steamid}|${reqBody.username} ${reqBody.banlength} [${reqBody.banreason}]` 106 | await executeRconInServer(reqBody.banserver, banCommand) 107 | resolve("Ban Added") 108 | } else { 109 | return reject("Wrong ban type passed in API") 110 | } 111 | } else { 112 | return reject("Wrong ban type passed in API") 113 | } 114 | } else { 115 | reject("Unauthorized Access, Key Missing") 116 | } 117 | } catch (error) { 118 | logger.error("error in sourceBansAddBanFunc->", error); 119 | reject(error + ", Please try again") 120 | } 121 | }); 122 | } 123 | 124 | exports.sourceBansAddBanFunc = sourceBansAddBanFunc; 125 | //----------------------------------------------------------------------------------------------------- 126 | -------------------------------------------------------------------------------- /Panel_Server/app/controllers/steamProfileDataFetch.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | const logger = require('../modules/logger')('Steam Profile Data Fetch'); 22 | const Steam = require('../modules/steam'); 23 | 24 | //----------------------------------------------------------------------------------------------------- 25 | // 26 | 27 | exports.fetchProfileData = async (req, res) => { 28 | try { 29 | const steam = new Steam(); 30 | const result = await steam.getProfile(req.body.profileUrl); 31 | res.json({ 32 | success: true, 33 | data: { "res": result, "message": "Data fetched", "notifType": "success" } 34 | }); 35 | } catch (error) { 36 | logger.error("Error fetching user data->", error); 37 | res.json({ 38 | success: false, 39 | data: { "error": "Something went Wrong!, Error in Fetching user Data" } 40 | }); 41 | } 42 | }; -------------------------------------------------------------------------------- /Panel_Server/app/db/bootstrap.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | 22 | const userModel = require("../models/userModel.js"); 23 | const settingsModal = require("../models/panelSettingModal.js"); 24 | const panelServerModal = require("../models/panelServerModal.js"); 25 | const salesModal = require("../models/salesModel.js"); 26 | const auditModal = require("../models/auditLogsModel.js"); 27 | const bundleModel = require("../models/bundleModel.js"); 28 | 29 | /** 30 | * Bootstrap the db tables and some initial data insertions 31 | */ 32 | const bootstrap = async ()=>{ 33 | await userModel.createTheTableIfNotExists(); 34 | await settingsModal.createTheTableIfNotExists(); 35 | await panelServerModal.createTheTableIfNotExists(); 36 | await salesModal.createTheTableIfNotExists(); 37 | await auditModal.createTheTableIfNotExists(); 38 | await bundleModel.createTheTableIfNotExists(); 39 | }; 40 | 41 | module.exports = bootstrap; -------------------------------------------------------------------------------- /Panel_Server/app/db/connection.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | const logger = require('../modules/logger')('MySQL Connection'); 22 | 23 | const mysql = require('mysql2/promise'); 24 | const config = require('../config'); 25 | const dbConfig = config.db; 26 | 27 | var pool; 28 | const sqlOptions = { 29 | connectionLimit: 20, //important 30 | host: dbConfig.db_host, 31 | user: dbConfig.db_user, 32 | password: dbConfig.db_password, 33 | database: dbConfig.db_name, 34 | port: dbConfig.db_port, 35 | multipleStatements: true, 36 | supportBigNumbers: true, 37 | bigNumberStrings: true, 38 | waitForConnections: true, 39 | // debug: true 40 | } 41 | 42 | try { 43 | pool = mysql.createPool(sqlOptions); 44 | } catch (error) { 45 | logger.error("Connection Pool Error : ", error); 46 | } 47 | 48 | // pool.getConnection((err, connection) => { 49 | // if (err) { 50 | // if (err.code === 'PROTOCOL_CONNECTION_LOST') { 51 | // console.error('Database connection was closed.'); 52 | // } 53 | // if (err.code === 'ER_CON_COUNT_ERROR') { 54 | // console.error('Database has too many connections.'); 55 | // } 56 | // if (err.code === 'ECONNREFUSED') { 57 | // console.error('Database connection was refused.'); 58 | // } 59 | // } 60 | 61 | // if (connection) { 62 | // logger.info("MYSQL connection established"); 63 | // connection.release(); 64 | // } 65 | 66 | // return; 67 | // }); 68 | 69 | module.exports = pool; -------------------------------------------------------------------------------- /Panel_Server/app/db/db_bridge.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | 22 | const pool = require('./connection'); 23 | const mysql = require('mysql2'); 24 | 25 | /** 26 | * Executes SQL query and returns data. 27 | * @constructor 28 | * @param {string} queryText - SQL query string 29 | * @param {boolean} singleRecord - single record 30 | */ 31 | const query = async function (queryText, singleRecord) { 32 | const [results] = await pool.query(queryText); 33 | if (Array.isArray(results)) { 34 | const finalResults = []; 35 | const resultsLength = results.length; 36 | for (let index = 0; index < resultsLength; index++) { 37 | finalResults.push({ ...results[index] }); 38 | } 39 | // For single record 40 | if (typeof (singleRecord) == "boolean" && singleRecord) return finalResults[0]; 41 | // For multiple records 42 | return finalResults; 43 | } 44 | return results; 45 | }; 46 | 47 | /** 48 | * shim for formatting the query 49 | */ 50 | var queryFormat = mysql.format; 51 | 52 | /** 53 | * escaping the data 54 | */ 55 | var dataEscape = mysql.escape; 56 | 57 | module.exports = { 58 | dbPool: pool, 59 | query, 60 | queryFormat, 61 | dataEscape 62 | }; -------------------------------------------------------------------------------- /Panel_Server/app/middleWares/auth.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | 22 | const jwt = require('jsonwebtoken'); 23 | const config = require('../config'); 24 | const jwtSecretKey = config.jwt.key; 25 | const steamAPIKey = config.steam_api_key; 26 | 27 | /** 28 | * check token middleware 29 | * @param {Object} req 30 | * @param {Object} res 31 | * @param {Function} next 32 | */ 33 | const checkToken = (req, res, next) => { 34 | const token = req.session.token || req.headers['x-access-token'] || req.headers['authorization']; // Express headers are auto converted to lowercase 35 | 36 | let jwtToken = token; 37 | const isAdminRoute = req.route.path === "/adminlogin" || req.headers.referer.indexOf("/adminlogin") != -1; 38 | if (token) { 39 | if (token.startsWith('Bearer ')) { 40 | // Remove Bearer from string 41 | jwtToken = token.slice(7, token.length); 42 | } 43 | 44 | jwt.verify(jwtToken, jwtSecretKey, (err, decoded) => { 45 | if (err) { 46 | if (req.body.apiCall) { 47 | res.json({ 48 | success: false, 49 | data: { "error": err, "message": "Unauthorized Access, If you are an Admin try logging in" } 50 | }); 51 | } else { 52 | return res.render('Login', { 53 | "steamLogin": (steamAPIKey ? true : false), 54 | "adminRoute": isAdminRoute, 55 | "error": "Unauthorized Access, If you are an Admin try logging in" 56 | }); 57 | } 58 | } else { 59 | req.decoded = decoded; 60 | next(); 61 | } 62 | }); 63 | } else { 64 | if (req.body.apiCall) { 65 | res.json({ 66 | success: false, 67 | data: { "error": "Token Missing, Looks like Session expired", "message": "Unauthorized Access, If you are an Admin try logging in" } 68 | }); 69 | }else{ 70 | return res.render('Login', 71 | { 72 | "steamLogin": (steamAPIKey ? true : false), 73 | "adminRoute": isAdminRoute, 74 | "error": "Unauthorized Access, If you are an Admin try logging in" 75 | });} 76 | } 77 | }; 78 | 79 | /** 80 | * check steam authentication middleware 81 | * @param {Object} req 82 | * @param {Object} res 83 | * @param {Function} next 84 | */ 85 | const checkSteamAuthenticated = (req, res, next) => { 86 | if (req.isAuthenticated()) { return next(); } 87 | res.redirect('/'); 88 | }; 89 | 90 | module.exports = { 91 | checkToken, 92 | checkSteamAuthenticated 93 | }; -------------------------------------------------------------------------------- /Panel_Server/app/middleWares/not_found.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 'use strict'; 20 | 21 | /** 22 | * Not Found middleware 23 | * @param {Object} req 24 | * @param {Object} res 25 | * @param {Function} next 26 | */ 27 | const notFound = (req, res, next) => { 28 | if (req.method === 'GET') { 29 | return res.status(404).render('404'); 30 | } 31 | res.status(404).json({ 32 | id: req.uuid, 33 | method: req.method, 34 | message: `Route: '${req.originalUrl}' not found` 35 | }); 36 | }; 37 | 38 | module.exports = { 39 | notFound 40 | }; -------------------------------------------------------------------------------- /Panel_Server/app/middleWares/request.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 'use strict'; 20 | 21 | const { getUUID } = require('../utils/crypto'); 22 | 23 | /** 24 | * Middleware to add unique request ID to each request object 25 | * It can be retrieved by `req.uuid` 26 | * @param {Object} req 27 | * @param {Object} res 28 | * @param {Function} next 29 | */ 30 | const addRequestUUID = (req, res, next) => { 31 | const requestUUID = getUUID(); 32 | req.uuid = requestUUID; 33 | next(); 34 | }; 35 | 36 | module.exports = { 37 | addRequestUUID 38 | }; -------------------------------------------------------------------------------- /Panel_Server/app/models/auditLogsModel.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | const logger = require('../modules/logger')('Audit Logs Model'); 22 | 23 | var db = require('../db/db_bridge'); 24 | const config = require('../config'); 25 | const table = config.audittable 26 | 27 | /** 28 | * sales Model 29 | */ 30 | var salesModel = { 31 | 32 | /** 33 | * create table if not exists 34 | */ 35 | createTheTableIfNotExists: function () { 36 | return new Promise(async (resolve, reject) => { 37 | try { 38 | 39 | let query = db.queryFormat(`CREATE TABLE IF NOT EXISTS ${table} ( 40 | id int(10) unsigned NOT NULL AUTO_INCREMENT, 41 | activity varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, 42 | additional_info varchar(255) COLLATE utf8mb4_unicode_ci NULL, 43 | created_by varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, 44 | created_at datetime NOT NULL, 45 | PRIMARY KEY (id) 46 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci`); 47 | let queryRes = await db.query(query, true); 48 | if (!queryRes) { 49 | return reject("Error in creating user table"); 50 | } 51 | return resolve(true); 52 | } catch (error) { 53 | logger.error("error in createTheTableIfNotExists->", error); 54 | reject(error) 55 | } 56 | }); 57 | }, 58 | 59 | /** 60 | * get all the servers 61 | */ 62 | insertNewAuditRecord: function (dataObj) { 63 | return new Promise(async (resolve, reject) => { 64 | try { 65 | 66 | // validation 67 | if (!dataObj.activity) return reject("Activity can't be null"); 68 | if (!dataObj.created_by) return reject("Created by can't be null"); 69 | 70 | 71 | let currentDateTime = new Date() 72 | 73 | const query = db.queryFormat(`INSERT INTO ${table} 74 | (activity, 75 | additional_info, 76 | created_by, 77 | created_at) VALUES (?, ?, ?, ?)`, [dataObj.activity, dataObj.additional_info, dataObj.created_by, currentDateTime]); 78 | 79 | const queryRes = await db.query(query); 80 | if (!queryRes) { 81 | return reject("error in insertion"); 82 | } 83 | return resolve(true); 84 | } catch (error) { 85 | logger.error("error in insertNewAuditRecord->", error); 86 | reject(error) 87 | } 88 | }); 89 | }, 90 | 91 | /** 92 | * get all the sale data form the table 93 | */ 94 | getAllAuditRecords: function (dataObj) { 95 | return new Promise(async (resolve, reject) => { 96 | try { 97 | 98 | let query = db.queryFormat(`SELECT * FROM ${table} 99 | WHERE created_at >= ( Curdate() - INTERVAL 30 day ) 100 | order by created_at DESC 101 | LIMIT ${dataObj.recordPerPage} OFFSET ${(dataObj.currentPage - 1) * dataObj.recordPerPage}`); 102 | 103 | let queryRes = await db.query(query); 104 | if (!queryRes) { 105 | return reject("No Data Found"); 106 | } 107 | let queryData = queryRes 108 | 109 | query = db.queryFormat(`SELECT COUNT(id) as count FROM ${table}`); 110 | queryRes = await db.query(query, true); 111 | if (!queryRes) { 112 | return reject("No Data Found"); 113 | } 114 | let totalRecords = queryRes.count 115 | return resolve({ 116 | auditRecords: queryData, 117 | totalRecords: totalRecords 118 | }); 119 | } catch (error) { 120 | logger.error("error in getAllAuditRecords->", error); 121 | reject(error) 122 | } 123 | }); 124 | }, 125 | 126 | } 127 | 128 | module.exports = salesModel; -------------------------------------------------------------------------------- /Panel_Server/app/models/myDashboardModel.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | const logger = require('../modules/logger')('My Dashboard Model'); 22 | 23 | var db = require('../db/db_bridge'); 24 | const panelServerModal = require("./panelServerModal.js"); 25 | const config = require('../config'); 26 | const salestable = config.salestable 27 | const serverTable = config.serverTable 28 | 29 | 30 | /** 31 | * myDashboardModel Model 32 | */ 33 | var myDashboardModel = { 34 | 35 | /** 36 | * get User Data From All Servers 37 | */ 38 | getUserDataFromAllServers: function (steamId) { 39 | return new Promise(async (resolve, reject) => { 40 | try { 41 | let finalResult = [] 42 | let serverList = await panelServerModal.getPanelServersDisplayList(); 43 | 44 | for (let i = 0; i < serverList.length; i++) { 45 | let query = db.queryFormat(`SELECT authId, 46 | name, 47 | expireStamp, 48 | created_at, 49 | type 50 | FROM ${serverList[i].tbl_name} WHERE authId = ?`, [steamId]); 51 | let queryRes = await db.query(query); 52 | if (!queryRes) { 53 | return reject("No Data Found"); 54 | } 55 | if (queryRes.length) 56 | finalResult.push({ "servername": serverList[i].server_name, "data": queryRes[0] }) 57 | } 58 | return resolve(finalResult); 59 | } catch (error) { 60 | logger.error("error in getUserDataFromAllServers->", error); 61 | reject(error) 62 | } 63 | }); 64 | }, 65 | 66 | 67 | /** 68 | * get stats for admin 69 | */ 70 | getStatsForAdmin: function () { 71 | return new Promise(async (resolve, reject) => { 72 | try { 73 | let finalResult = {} 74 | let userCount = 0 75 | 76 | let serverList = await panelServerModal.getPanelServersDisplayList(); 77 | 78 | for (let i = 0; i < serverList.length; i++) { 79 | let query = db.queryFormat(`SELECT COUNT(authId) AS usercount FROM ${serverList[i].tbl_name}`); 80 | let queryRes = await db.query(query, true); 81 | if (!queryRes) { 82 | return reject("No Data Found"); 83 | } 84 | userCount = userCount + (queryRes.usercount / 1) 85 | } 86 | 87 | let query = db.queryFormat(`SELECT COUNT(id) AS totalservers FROM ${serverTable}`); 88 | let queryRes = await db.query(query, true); 89 | if (!queryRes) { 90 | return reject("No Data Found"); 91 | } 92 | const totalservers = queryRes.totalservers 93 | 94 | query = db.queryFormat(`SELECT (SELECT COUNT(id) FROM ${salestable} WHERE sale_type=1) as buycount, (SELECT COUNT(id) FROM ${salestable} WHERE sale_type=2) as renewcount `); 95 | queryRes = await db.query(query, true); 96 | if (!queryRes) { 97 | return reject("No Data Found"); 98 | } 99 | const totalbuy = queryRes.buycount 100 | const totalrenew = queryRes.renewcount 101 | 102 | finalResult = { 103 | "serverCount": totalservers, 104 | "userCount": userCount, 105 | "saleCount": totalbuy, 106 | "renewSaleCount": totalrenew 107 | } 108 | 109 | return resolve(finalResult); 110 | } catch (error) { 111 | logger.error("error in getStatsForAdmin->", error); 112 | reject(error) 113 | } 114 | }); 115 | }, 116 | 117 | 118 | /** 119 | * get server listing 120 | */ 121 | getSaleServerListing: function () { 122 | return new Promise(async (resolve, reject) => { 123 | try { 124 | let serverArray = [] 125 | 126 | let serverList = await panelServerModal.getPanelServersList(); 127 | 128 | for (let i = 0; i < serverList.length; i++) { 129 | let query = db.queryFormat(`SELECT COUNT(authId) AS usercount FROM ${serverList[i].tbl_name} WHERE type = 0`); 130 | let queryRes = await db.query(query, true); 131 | if (!queryRes) { 132 | return reject("No Data Found"); 133 | } 134 | 135 | if (queryRes.usercount < serverList[i].vip_slots) { 136 | delete serverList[i].server_rcon_pass 137 | serverArray.push(serverList[i]) 138 | } 139 | } 140 | return resolve(serverArray); 141 | } catch (error) { 142 | logger.error("error in getStatsForAdmin->", error); 143 | reject(error) 144 | } 145 | }); 146 | }, 147 | 148 | 149 | } 150 | 151 | module.exports = myDashboardModel; 152 | -------------------------------------------------------------------------------- /Panel_Server/app/models/panelSettingModal.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | const logger = require('../modules/logger')('Panel Setting Model'); 22 | 23 | var db = require('../db/db_bridge'); 24 | const config = require('../config'); 25 | const table = config.settingTable 26 | const valueArray = [["color_theme", "danger"], 27 | ["dash_vip_show", "1"], 28 | ["dash_admin_show", "1"], 29 | ["webhook_url", ""], 30 | ["community_name", "VMPanel"], 31 | ["normiadmin_settings", "1"], 32 | ["community_logo_url", ""], 33 | ["community_info", ""], 34 | ["community_website", ""], 35 | ["platform_currency", "USD"], 36 | ["hiddenadmin_login", "0"], 37 | ["salenotification_discord", "0"], 38 | ["disable_about", "0"]] 39 | 40 | /** 41 | * setting Model 42 | */ 43 | var settingsModal = { 44 | 45 | /** 46 | * create table if not exists 47 | */ 48 | createTheTableIfNotExists: function () { 49 | return new Promise(async (resolve, reject) => { 50 | try { 51 | 52 | let query = db.queryFormat(`CREATE TABLE IF NOT EXISTS ${table} ( 53 | id int(11) NOT NULL AUTO_INCREMENT, 54 | setting_key varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL, 55 | setting_value varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, 56 | PRIMARY KEY(id) 57 | ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci`); 58 | let queryRes = await db.query(query, true); 59 | if (!queryRes) { 60 | return reject("Error in creating user table"); 61 | } 62 | 63 | query = db.queryFormat(`SELECT * FROM ${table}`); 64 | queryRes = await db.query(query); 65 | if (!queryRes) { 66 | return reject("Error in querying settings, This can be ignored"); 67 | } 68 | 69 | if (queryRes.length === 0) { 70 | query = db.queryFormat(`INSERT INTO ${table} 71 | (setting_key,setting_value) 72 | VALUES ?`, [valueArray]); 73 | queryRes = await db.query(query, true); 74 | if (!queryRes) { 75 | return reject("Error while filling entry in table"); 76 | } 77 | } 78 | return resolve(true); 79 | } catch (error) { 80 | logger.error("error in createTheTableIfNotExists->", error); 81 | reject(error) 82 | } 83 | }); 84 | }, 85 | 86 | /** 87 | * get all the settings data form the table 88 | */ 89 | getAllSettings: function () { 90 | return new Promise(async (resolve, reject) => { 91 | try { 92 | 93 | let query = db.queryFormat(`SELECT * FROM ${table}`); 94 | let queryRes = await db.query(query); 95 | if (!queryRes) { 96 | return reject("No Data Found"); 97 | } 98 | let settingObj = {} 99 | for (let i = 0; i < queryRes.length; i++) { 100 | settingObj[queryRes[i].setting_key] = queryRes[i].setting_value 101 | } 102 | return resolve(settingObj); 103 | } catch (error) { 104 | logger.error("error in getAllSettings->", error); 105 | reject(error) 106 | } 107 | }); 108 | }, 109 | 110 | 111 | /** 112 | * Insert a new user 113 | */ 114 | updateSetting: function (key, value) { 115 | return new Promise(async (resolve, reject) => { 116 | try { 117 | 118 | // validation 119 | if (!key) return reject("Key is not provided"); 120 | //if (!value) return reject("Value is not provided"); 121 | 122 | let query = db.queryFormat(`UPDATE ${table} SET setting_value = ? WHERE setting_key = ?`, [value, key]); 123 | let queryRes = await db.query(query, true); 124 | if (!queryRes) { 125 | return reject("Error in Update"); 126 | } 127 | return resolve(queryRes); 128 | } catch (error) { 129 | logger.error("error in update setting->", error); 130 | reject(error) 131 | } 132 | }); 133 | }, 134 | 135 | /** 136 | * get all tables name 137 | */ 138 | getAllTables: function () { 139 | return new Promise(async (resolve, reject) => { 140 | try { 141 | 142 | let query = db.queryFormat(`show tables`); 143 | let queryRes = await db.query(query); 144 | if (!queryRes) { 145 | return reject("Error in Update"); 146 | } 147 | return resolve(queryRes); 148 | } catch (error) { 149 | logger.error("error in getAllTables->", error); 150 | reject(error) 151 | } 152 | }); 153 | }, 154 | 155 | } 156 | 157 | module.exports = settingsModal; -------------------------------------------------------------------------------- /Panel_Server/app/models/salesModel.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | const logger = require('../modules/logger')('Sales Model'); 22 | var db = require('../db/db_bridge'); 23 | const config = require('../config'); 24 | const table = config.salestable 25 | 26 | /** 27 | * sales Model 28 | */ 29 | var salesModel = { 30 | 31 | /** 32 | * create table if not exists 33 | */ 34 | createTheTableIfNotExists: function () { 35 | return new Promise(async (resolve, reject) => { 36 | try { 37 | 38 | let query = db.queryFormat(`CREATE TABLE IF NOT EXISTS ${table} ( 39 | id int(10) unsigned NOT NULL AUTO_INCREMENT, 40 | payment_gateway VARCHAR(20) COLLATE utf8mb4_unicode_ci NOT NULL, 41 | order_id varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, 42 | payer_id varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, 43 | payer_steamid varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, 44 | payer_email varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, 45 | payer_name varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, 46 | payer_surname varchar(150) COLLATE utf8mb4_unicode_ci NULL, 47 | product_desc varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, 48 | amount_paid int(20) NOT NULL, 49 | amount_currency varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, 50 | status varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, 51 | sale_type tinyint(4) NOT NULL, 52 | created_on datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, 53 | PRIMARY KEY (id) 54 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci`); 55 | let queryRes = await db.query(query, true); 56 | if (!queryRes) { 57 | return reject("Error in creating user table"); 58 | } 59 | return resolve(true); 60 | } catch (error) { 61 | logger.error("error in createTheTableIfNotExists->", error); 62 | reject(error) 63 | } 64 | }); 65 | }, 66 | 67 | /** 68 | * get all the servers 69 | */ 70 | insertNewSaleRecord: function (dataObj, gateway) { 71 | return new Promise(async (resolve, reject) => { 72 | try { 73 | 74 | // validation 75 | if (!dataObj.order_id) return reject("Order Id Missing"); 76 | if (!dataObj.payer_id) return reject("Payer Id Missing"); 77 | if (!dataObj.payer_steamid) return reject("Payer Steam Id Missing"); 78 | if (!dataObj.payer_email) return reject("Payer Email Missing"); 79 | if (!dataObj.payer_name) return reject("Payer Name Missing"); 80 | if (!dataObj.payer_surname) return reject("Payer Surname Missing"); 81 | if (!dataObj.product_desc) return reject("Product Desc Missing"); 82 | if (!dataObj.amount_paid) return reject("Amount Paid Missing"); 83 | if (!dataObj.amount_currency) return reject("Amount Currency Missing"); 84 | if (!dataObj.status) return reject("Payment Status Missing"); 85 | if (!dataObj.sale_type) return reject("Sale Type Missing"); 86 | 87 | let paymentGate = gateway === 'paypal' ? "PayPal" : gateway === 'payu' ? "PayU" : "NA" 88 | let currentDateTime = new Date() 89 | 90 | const query = db.queryFormat(`INSERT INTO ${table} 91 | (payment_gateway, 92 | order_id, 93 | payer_id, 94 | payer_steamid, 95 | payer_email, 96 | payer_name, 97 | payer_surname, 98 | product_desc, 99 | amount_paid, 100 | amount_currency, 101 | status, 102 | sale_type, 103 | created_on) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, 104 | [paymentGate, dataObj.order_id, dataObj.payer_id, dataObj.payer_steamid, dataObj.payer_email, dataObj.payer_name, dataObj.payer_surname, dataObj.product_desc, dataObj.amount_paid, dataObj.amount_currency, dataObj.status, dataObj.sale_type, currentDateTime]); 105 | 106 | const queryRes = await db.query(query); 107 | if (!queryRes) { 108 | return reject("error in insertion"); 109 | } 110 | return resolve(true); 111 | } catch (error) { 112 | logger.error("error in insertNewSaleRecord->", error); 113 | reject(error) 114 | } 115 | }); 116 | }, 117 | 118 | /** 119 | * get all the sale data form the table 120 | */ 121 | getAllSalesRecords: function (dataObj) { 122 | return new Promise(async (resolve, reject) => { 123 | try { 124 | 125 | let query = db.queryFormat(`SELECT * FROM ${table} order by created_on DESC 126 | LIMIT ${dataObj.recordPerPage} OFFSET ${(dataObj.currentPage - 1) * dataObj.recordPerPage}`); 127 | let queryRes = await db.query(query); 128 | if (!queryRes) { 129 | return reject("No Data Found"); 130 | } 131 | let queryData = queryRes 132 | 133 | query = db.queryFormat(`SELECT COUNT(id) as count FROM ${table}`); 134 | queryRes = await db.query(query, true); 135 | if (!queryRes) { 136 | return reject("No Data Found"); 137 | } 138 | let totalRecords = queryRes.count 139 | return resolve({ 140 | salesRecord: queryData, 141 | totalRecords: totalRecords 142 | }); 143 | } catch (error) { 144 | logger.error("error in getAllSalesRecords->", error); 145 | reject(error) 146 | } 147 | }); 148 | }, 149 | 150 | } 151 | 152 | module.exports = salesModel; -------------------------------------------------------------------------------- /Panel_Server/app/modules/logger.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | 22 | const log4js = require('log4js'); 23 | const config = require('../config'); 24 | const cryptoCustom = require('../utils/crypto'); 25 | const loggerConfig = config.logging ? config.logging : {}; 26 | 27 | // Fallback 28 | if (!loggerConfig.logLevel) { 29 | loggerConfig.logLevel = "ERROR"; 30 | } 31 | // https://log4js-node.github.io/log4js-node/layouts.html 32 | log4js.configure({ 33 | appenders: { 34 | stdout: { 35 | type: 'stdout', 36 | layout: { 37 | type: 'pattern', 38 | pattern: '%[[%x{uuid}] [%d] [%p] <%c> {%f{2}:%l}%] => %m', 39 | tokens: { 40 | uuid: function (logEvent) { 41 | return cryptoCustom.getUUID(); 42 | } 43 | } 44 | }, 45 | }, 46 | file: { 47 | type: 'file', 48 | filename: 'VMPanel.log', 49 | maxLogSize: 10485760, 50 | backups: 3, 51 | compress: true, 52 | layout: { 53 | type: 'pattern', 54 | pattern: '%[[%x{uuid}] [%d] [%p] <%c> {%f{2}:%l}%] => %m', 55 | tokens: { 56 | uuid: function (logEvent) { 57 | return cryptoCustom.getUUID(); 58 | } 59 | } 60 | }, 61 | } 62 | }, 63 | categories: { 64 | default: { 65 | appenders: ['stdout', 'file'], 66 | level: loggerConfig.logLevel, 67 | enableCallStack: true 68 | } 69 | } 70 | }); 71 | 72 | module.exports = (moduleName) => { 73 | const logger = log4js.getLogger(moduleName); 74 | return logger; 75 | }; -------------------------------------------------------------------------------- /Panel_Server/app/modules/steam.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | const needle = require('needle'); 22 | 23 | class Steam { 24 | constructor() { 25 | 26 | } 27 | 28 | /** 29 | * Retrieve profile info from steam 30 | * @param {String} profileURL 31 | */ 32 | async getProfile(profileURL) { 33 | return new Promise(async (resolve, reject) => { 34 | try { 35 | if (!profileURL) throw { 36 | type: "actor", 37 | desc: "URL not provided" 38 | } 39 | const finalURL = profileURL + "?xml=1" 40 | needle('get', finalURL) 41 | .then(res => { 42 | resolve(res.body) 43 | }) 44 | .catch(err => { 45 | return reject(err) 46 | }); 47 | } catch (error) { 48 | logger.error("error in getProfile->", error); 49 | reject(error) 50 | } 51 | }); 52 | } 53 | } 54 | 55 | module.exports = Steam; 56 | -------------------------------------------------------------------------------- /Panel_Server/app/modules/user.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | 22 | const { dbPool } = require('../db/db_bridge'); 23 | const config = require('../config'); 24 | const usersTableName = config.usersTable 25 | 26 | class User { 27 | constructor({ 28 | id, 29 | username, 30 | userType 31 | }) { 32 | this._id = null; 33 | this._username = null; 34 | this._userType = null; 35 | if (id) this._id = id; 36 | if (username) this._username = username; 37 | if (userType) this._userType = userType; 38 | } 39 | 40 | async doesExists() { 41 | } 42 | 43 | async userInfo() { 44 | let userList = []; 45 | if (this._id) { 46 | [userList] = await dbPool.execute(` 47 | SELECT * FROM ${usersTableName} 48 | WHERE id = ?`, [this._id]); 49 | } else if (this._username) { 50 | [userList] = await dbPool.execute(` 51 | SELECT * FROM ${usersTableName} 52 | WHERE username = ?`, [this._username]); 53 | } else { 54 | throw { 55 | type: "actor", 56 | desc: "either id or username is required to retrieve user info" 57 | } 58 | } 59 | if (userList.length <= 0) { 60 | throw { 61 | type: "actor", 62 | desc: "user does not exists" 63 | } 64 | } 65 | return userList[0]; 66 | } 67 | } 68 | 69 | module.exports = User; -------------------------------------------------------------------------------- /Panel_Server/app/routes/router.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | 22 | module.exports = app => { 23 | 24 | // Middleware Import 25 | const authMiddleware = require('../middleWares/auth'); 26 | const passport = require('passport'); 27 | 28 | // Controllers Import 29 | const { dashboard, getVipsDataSingleServer, getAdminsDataSingleServer } = require("../controllers/vipController.js"); 30 | const { insertVipData, formVIP } = require("../controllers/insertVip.js"); 31 | const { insertAdminData, formAdmin } = require("../controllers/insertAdmin.js"); 32 | const { deleteVipData, deleteOldVipData } = require("../controllers/deleteVip.js"); 33 | const { loginPage, authUserLogin } = require("../controllers/login.js"); 34 | const { PanelSettings, fetchPanelSettings, updatePanelSettings } = require("../controllers/panelSettings.js") 35 | const { addPanelAdmin, getPanelAdminsList, deletePanelAdmin } = require("../controllers/panelAdmins.js") 36 | const { getPanelServersList, getPanelServerSingle, addPanelServer, deletePanelServers } = require("../controllers/panelServers.js") 37 | const { fetchProfileData } = require("../controllers/steamProfileDataFetch.js") 38 | const { myDashboard, afterPaymentProcess } = require("../controllers/userDashboard.js") 39 | const { saleRecords, getSalesRecord } = require("../controllers/salesRecord.js") 40 | const { auditRecords, getAuditRecord } = require("../controllers/auditLogs.js") 41 | const { initPayUPayment } = require("../controllers/payU.js") 42 | const { initRazorpayPayment } = require('../controllers/razorPay'); 43 | const { addPanelServerBundle, getPanelBundlesList, deletePanelBundle } = require("../controllers/panelServerBundles.js") 44 | const { sourceBans, sourceBansAddBan } = require("../controllers/sourceBans.js") 45 | 46 | //Public Router 47 | app.get("/", dashboard); 48 | app.get("/dashboard", dashboard); 49 | 50 | 51 | //Login and logout 52 | app.get('/login', loginPage); 53 | app.get('/adminlogin', loginPage); 54 | app.post('/adminlogin', authUserLogin); 55 | app.get('/logout', function (req, res) { 56 | req.logout((err) => next(err)); 57 | req.session.destroy(); 58 | res.redirect('/'); 59 | }); 60 | 61 | //route to fetch user data from steam profile 62 | app.post('/fetchsteamprofiledata', fetchProfileData); 63 | 64 | //Private Router only for User (Steam Authorized) 65 | app.get('/auth/steam', 66 | passport.authenticate('steam', { failureRedirect: '/' }), 67 | function (req, res) { 68 | res.redirect('/'); 69 | }); 70 | 71 | app.get('/auth/steam/return', 72 | passport.authenticate('steam', { failureRedirect: '/' }), 73 | function (req, res) { 74 | res.redirect('/mydashboard'); 75 | }); 76 | 77 | app.get('/mydashboard', authMiddleware.checkSteamAuthenticated, myDashboard); 78 | app.post('/execafterpaymentprocess', authMiddleware.checkSteamAuthenticated, afterPaymentProcess); 79 | app.post('/initpayupayment', authMiddleware.checkSteamAuthenticated, initPayUPayment); 80 | app.get('/getpanelbundleslistud', authMiddleware.checkSteamAuthenticated, getPanelBundlesList); 81 | 82 | // RazorPay routes 83 | app.post('/initrazorpaypayment', authMiddleware.checkSteamAuthenticated, initRazorpayPayment); 84 | 85 | //Private Router only for Panel Admins (Local Authorized) 86 | //Vip routes 87 | app.post("/getvipdatasingleserver", authMiddleware.checkToken, getVipsDataSingleServer); 88 | app.get("/managevip", authMiddleware.checkToken, formVIP); 89 | app.post("/addvip", authMiddleware.checkToken, insertVipData); 90 | app.post("/deletevip", authMiddleware.checkToken, deleteVipData); 91 | 92 | //Admin routes 93 | app.post("/getadmindatasingleserver", authMiddleware.checkToken, getAdminsDataSingleServer); 94 | app.get("/manageadmin", authMiddleware.checkToken, formAdmin); 95 | app.post("/addadmin", authMiddleware.checkToken, insertAdminData); 96 | 97 | //Panel Settings routes 98 | app.get('/panelsetting', authMiddleware.checkToken, PanelSettings); 99 | app.get('/fetchpanelsetting', authMiddleware.checkToken, fetchPanelSettings); 100 | app.post('/updatepanelsetting', authMiddleware.checkToken, updatePanelSettings); 101 | 102 | //Panel server mange routes 103 | app.get("/getpanelserverlist", authMiddleware.checkToken, getPanelServersList); 104 | app.post("/getpanelserversingle", authMiddleware.checkToken, getPanelServerSingle); 105 | app.post("/addpanelserver", authMiddleware.checkToken, addPanelServer); 106 | app.post("/deletepanelserver", authMiddleware.checkToken, deletePanelServers); 107 | 108 | //Panel server bundl mange routes 109 | app.get("/getpanelbundleslist", authMiddleware.checkToken, getPanelBundlesList); 110 | app.post("/addpanelserverbundle", authMiddleware.checkToken, addPanelServerBundle); 111 | app.post("/deletepanelbundle", authMiddleware.checkToken, deletePanelBundle); 112 | 113 | //Panel Admin routes 114 | app.get("/getpaneladminslist", authMiddleware.checkToken, getPanelAdminsList); 115 | app.post("/addpaneladmin", authMiddleware.checkToken, addPanelAdmin); 116 | app.post("/updatepaneladmin", authMiddleware.checkToken, addPanelAdmin); 117 | app.post("/deletepaneladmin", authMiddleware.checkToken, deletePanelAdmin); 118 | 119 | //Route to manually refresh data in all servers 120 | app.get("/performmanualrefresh", authMiddleware.checkToken, deleteOldVipData); 121 | 122 | //Routes for Sales Records 123 | app.get("/salesrecord", authMiddleware.checkToken, saleRecords); 124 | app.post("/fetchsalesrecord", authMiddleware.checkToken, getSalesRecord); 125 | 126 | //Routes for Audit logs 127 | app.get("/auditlogs", authMiddleware.checkToken, auditRecords); 128 | app.post("/fetchauditlogs", authMiddleware.checkToken, getAuditRecord); 129 | 130 | //Routes for sourcebans 131 | app.get("/sourcebans", authMiddleware.checkToken, sourceBans); 132 | app.post("/sourcebansaddban", authMiddleware.checkToken, sourceBansAddBan); 133 | 134 | //Creator info route 135 | app.get('/aboutcreator', function (req, res) { 136 | res.render('AboutCreator'); 137 | }); 138 | }; -------------------------------------------------------------------------------- /Panel_Server/app/utils/activityLogger.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | const logger = require('../modules/logger')('Activity Logger'); 22 | const auditModal = require("../models/auditLogsModel.js"); 23 | 24 | //----------------------------------------------------------------------------------------------------- 25 | // 26 | 27 | const logThisActivity = (activityObject) => { 28 | try { 29 | 30 | // validation 31 | if (!activityObject.activity) return reject("Activity can't be null"); 32 | if (!activityObject.created_by) return reject("Created by can't be null"); 33 | 34 | auditModal.insertNewAuditRecord(activityObject) 35 | } catch (error) { 36 | logger.error("error in activity logger->", error); 37 | } 38 | } 39 | 40 | exports.logThisActivity = logThisActivity; 41 | -------------------------------------------------------------------------------- /Panel_Server/app/utils/crypto.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const crypto = require("crypto"); 3 | 4 | /** 5 | * return n (default: 32) char unique random string 6 | * @param {Number} byteLength byte length 7 | */ 8 | const getUUID = function (byteLength = 16) { 9 | return crypto.randomBytes(byteLength).toString("hex"); 10 | }; 11 | 12 | module.exports = { 13 | getUUID 14 | }; -------------------------------------------------------------------------------- /Panel_Server/app/utils/csgoServerRconExecuter.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | const logger = require('../modules/logger')('cs go rcon'); 22 | const Rcon = require('rcon'); 23 | const SourceQuery = require('sourcequery'); 24 | const panelServerModal = require("../models/panelServerModal.js"); 25 | 26 | //----------------------------------------------------------------------------------------------------- 27 | // 28 | 29 | const executeRconInServer = (server,commandString) => { 30 | return new Promise(async (resolve, reject) => { 31 | try { 32 | 33 | let serverDetails = await panelServerModal.getPanelServerDetails(server) 34 | 35 | if (serverDetails.server_ip && serverDetails.server_port && serverDetails.server_rcon_pass) { 36 | 37 | let sq = new SourceQuery(1000); // 1000ms timeout 38 | sq.open(serverDetails.server_ip, serverDetails.server_port); 39 | sq.getInfo(function (err, info) { 40 | if (err) { 41 | sq.close() 42 | return reject("Can not proceed with the Operation, Server is Offline ") 43 | } else { 44 | sq.close() 45 | var conn = new Rcon(serverDetails.server_ip, serverDetails.server_port, serverDetails.server_rcon_pass); 46 | conn.on('auth', function () { 47 | logger.info("*** Rcon Authorized! ***"); 48 | conn.send(commandString); 49 | conn.disconnect(); 50 | }).on('response', function (str) { 51 | logger.info("*** [RCON] Got response: " + str); 52 | }).on('error', function (error) { 53 | logger.error("*** [RCON] Got error: " + error); 54 | return reject("Can not proceed with the Operation, There was an error while making RCON Connection to Server ") 55 | }).on('end', function () { 56 | logger.info("*** [RCON] Socket closed!"); 57 | resolve(1) 58 | }); 59 | conn.connect(); 60 | } 61 | }); 62 | } else { 63 | reject("Can not proceed with the Operation, Server details are missing in Database ") 64 | } 65 | } catch (error) { 66 | logger.error("error in executeRconInServer->", error) 67 | reject("Operation Failed, There was an error while executing RCON Commands in Server. ") 68 | } 69 | }); 70 | } 71 | 72 | exports.executeRconInServer = executeRconInServer; 73 | -------------------------------------------------------------------------------- /Panel_Server/app/utils/misc.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 'use strict'; 21 | 22 | /** 23 | * Wait for `ms` milliseconds 24 | * @param {Number} ms Milliseconds 25 | */ 26 | const wait = ms => new Promise(r => setTimeout(r, ms)); 27 | 28 | module.exports = { 29 | wait 30 | } -------------------------------------------------------------------------------- /Panel_Server/app/utils/refreshCFGInServer.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | "use strict"; 21 | const logger = require('../modules/logger')('refresh CGF'); 22 | const Rcon = require('rcon'); 23 | const SourceQuery = require('sourcequery'); 24 | const panelServerModal = require("../models/panelServerModal.js"); 25 | 26 | //----------------------------------------------------------------------------------------------------- 27 | // 28 | 29 | const refreshAdminsInServer = (server) => { 30 | return new Promise(async (resolve, reject) => { 31 | try { 32 | 33 | let serverDetails = await panelServerModal.getPanelServerDetails(server) 34 | 35 | if (serverDetails.server_ip && serverDetails.server_port && serverDetails.server_rcon_pass) { 36 | 37 | let sq = new SourceQuery(1000); // 1000ms timeout 38 | sq.open(serverDetails.server_ip, serverDetails.server_port); 39 | sq.getInfo(function (err, info) { 40 | if (err) { 41 | sq.close() 42 | //return reject("Operation Done in VMPanel Database,\n No Rcon execution, Server is Offline ") 43 | return resolve(0) 44 | } else { 45 | sq.close() 46 | var conn = new Rcon(serverDetails.server_ip, serverDetails.server_port, serverDetails.server_rcon_pass); 47 | conn.on('auth', function () { 48 | logger.info("*** Rcon Authorized! ***"); 49 | conn.send("sm_vipRefresh"); 50 | conn.disconnect(); 51 | }).on('response', function (str) { 52 | logger.info("*** [RCON] Got response: " + str); 53 | }).on('error', function (error) { 54 | logger.error("*** [RCON] Got error: " + error); 55 | return reject("Operation Done in VMPanel Database,\n There was an error while executing rcon Command for current Operation. ") 56 | }).on('end', function () { 57 | logger.info("*** [RCON] Socket closed!"); 58 | resolve(1) 59 | }); 60 | conn.connect(); 61 | } 62 | }); 63 | } else { 64 | resolve(0) 65 | } 66 | } catch (error) { 67 | logger.error("error in refreshAdminsInServer->", error) 68 | reject("Operation Done in VMPanel Database,\n There was an error while executing rcon Command for current Operation. ") 69 | } 70 | }); 71 | } 72 | 73 | exports.refreshAdminsInServer = refreshAdminsInServer; 74 | -------------------------------------------------------------------------------- /Panel_Server/app/utils/steamIdConvertor.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 21 | const bigInt = require("big-integer"); 22 | 23 | var SteamIDConverter = { 24 | 25 | BASE_NUM: bigInt("76561197960265728"), // "V" in the conversion algorithms 26 | 27 | REGEX_STEAMID64: /^[0-9]{17}$/, 28 | REGEX_STEAMID: /^STEAM_[0-5]:[01]:\d+$/, 29 | REGEX_STEAMID3: /^\[U:1:[0-9]+\]$/, 30 | 31 | /** 32 | * Generate a SteamID64 from a SteamID or SteamID3 33 | */ 34 | toSteamID64: function (steamid) { 35 | if (!steamid || typeof steamid !== "string") { 36 | return false; 37 | } 38 | else if (this.isSteamID3(steamid)) { 39 | steamid = this.fromSteamID3(steamid); 40 | } 41 | else if (!this.isSteamID(steamid)) { 42 | throw new TypeError("Parameter must be a SteamID (e.g. STEAM_0:1:912783)"); 43 | } 44 | 45 | var split = steamid.split(":"), 46 | v = this.BASE_NUM, 47 | z = split[2], 48 | y = split[1]; 49 | 50 | if (z && y) { 51 | return v.plus(z * 2).plus(y).toString(); 52 | } 53 | return false; 54 | }, 55 | 56 | /** 57 | * Generate a SteamID from a SteamID64 or SteamID3 58 | */ 59 | toSteamID: function (steamid64) { 60 | if (!steamid64 || typeof steamid64 !== "string") { 61 | return false; 62 | } 63 | else if (this.isSteamID3(steamid64)) { 64 | return this.fromSteamID3(steamid64); 65 | } 66 | else if (!this.isSteamID64(steamid64)) { 67 | throw new TypeError("Parameter must be a SteamID64 (e.g. 76561190000000000)"); 68 | } 69 | 70 | var v = this.BASE_NUM, 71 | w = bigInt(steamid64), 72 | y = w.mod(2).toString(); 73 | 74 | w = w.minus(y).minus(v); 75 | 76 | if (w < 1) { 77 | return false; 78 | } 79 | return "STEAM_1:" + y + ":" + w.divide(2).toString(); 80 | }, 81 | 82 | /** 83 | * Generate a SteamID3 from a SteamID or SteamID64 84 | */ 85 | toSteamID3: function (steamid) { 86 | if (!steamid || typeof steamid !== "string") { 87 | return false; 88 | } 89 | else if (!this.isSteamID(steamid)) { 90 | steamid = this.toSteamID(steamid); 91 | } 92 | 93 | var split = steamid.split(":"); 94 | 95 | return "[U:1:" + (parseInt(split[1]) + parseInt(split[2]) * 2) + "]"; 96 | }, 97 | 98 | /** 99 | * Generate a SteamID from a SteamID3. 100 | */ 101 | fromSteamID3: function (steamid3) { 102 | var split = steamid3.split(":"); 103 | var last = split[2].substring(0, split[2].length - 1); 104 | 105 | return "STEAM_0:" + (last % 2) + ":" + Math.floor(last / 2); 106 | }, 107 | 108 | // ------------------------------------------------------------------------------ 109 | 110 | isSteamID: function (id) { 111 | if (!id || typeof id !== "string") { 112 | return false; 113 | } 114 | return this.REGEX_STEAMID.test(id); 115 | }, 116 | 117 | isSteamID64: function (id) { 118 | if (!id || typeof id !== "string") { 119 | return false; 120 | } 121 | return this.REGEX_STEAMID64.test(id); 122 | }, 123 | 124 | isSteamID3: function (id) { 125 | if (!id || typeof id !== "string") { 126 | return false; 127 | } 128 | return this.REGEX_STEAMID3.test(id); 129 | }, 130 | 131 | // ------------------------------------------------------------------------------ 132 | 133 | profileURL: function (steamid64) { 134 | if (!this.isSteamID64(steamid64)) { 135 | steamid64 = this.toSteamID64(steamid64); 136 | } 137 | return "http://steamcommunity.com/profiles/" + steamid64; 138 | } 139 | }; 140 | 141 | 142 | module.exports = SteamIDConverter; -------------------------------------------------------------------------------- /Panel_Server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "VMP-by-Summer-Soldier", 3 | "version": "1.0.0", 4 | "description": "Nodejs server (backend) for php application ", 5 | "main": "server.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node server.js" 9 | }, 10 | "keywords": [ 11 | "nodejs", 12 | "express", 13 | "mysql" 14 | ], 15 | "author": "Shivam Parashar (Summer Soldier)", 16 | "dependencies": { 17 | "bcrypt": "^5.0.1", 18 | "big-integer": "^1.6.48", 19 | "cors": "^2.8.5", 20 | "ejs": "^3.1.6", 21 | "express": "^4.17.1", 22 | "express-session": "^1.17.2", 23 | "jsonwebtoken": "^8.5.1", 24 | "log4js": "^6.3.0", 25 | "mysql2": "^2.3.0", 26 | "needle": "^2.8.0", 27 | "node-cron": "^3.0.0", 28 | "passport": "^0.6.0", 29 | "passport-steam": "^1.0.15", 30 | "razorpay": "^2.8.6", 31 | "rcon": "^1.0.3", 32 | "sourcequery": "0.0.2" 33 | }, 34 | "devDependencies": { 35 | "eslint": "^7.15.0" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Panel_Server/public/images/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Panel_Server/public/images/404.png -------------------------------------------------------------------------------- /Panel_Server/public/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Panel_Server/public/images/favicon.ico -------------------------------------------------------------------------------- /Panel_Server/public/images/gear.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Panel_Server/public/images/gear.gif -------------------------------------------------------------------------------- /Panel_Server/public/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Panel_Server/public/images/icon.png -------------------------------------------------------------------------------- /Panel_Server/public/images/payumini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Panel_Server/public/images/payumini.png -------------------------------------------------------------------------------- /Panel_Server/public/images/payumoney.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Panel_Server/public/images/payumoney.png -------------------------------------------------------------------------------- /Panel_Server/public/images/razorpay.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Panel_Server/public/images/sidebar-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Panel_Server/public/images/sidebar-1.jpg -------------------------------------------------------------------------------- /Panel_Server/public/images/sidebar-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Panel_Server/public/images/sidebar-2.jpg -------------------------------------------------------------------------------- /Panel_Server/public/images/sidebar-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Panel_Server/public/images/sidebar-3.jpg -------------------------------------------------------------------------------- /Panel_Server/public/images/vmp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Panel_Server/public/images/vmp.png -------------------------------------------------------------------------------- /Panel_Server/public/js/customConfirm.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | //----------------------------------------------------------------------------------------------------- 21 | // 22 | 23 | function custom_confirm(message, callback) { 24 | // put message into the body of modal 25 | //$('#userConfirmationModal-body').innerHTML = `

${message}

`; 26 | $('#userConfirmationModal').on('show.bs.modal', function (event) { 27 | // store current modal reference 28 | var modal = $(this); 29 | // update modal body help text 30 | modal.find('.modal-body').html(message); 31 | }); 32 | // show modal ringer custom confirmation 33 | $('#userConfirmationModal').modal('show'); 34 | 35 | $('#userConfirmationModal button.ok').off().on('click', function () { 36 | // close window 37 | $('#userConfirmationModal').modal('hide'); 38 | // and callback 39 | callback(true); 40 | }); 41 | 42 | $('#userConfirmationModal button.cancel').off().on('click', function () { 43 | // close window 44 | $('#userConfirmationModal').modal('hide'); 45 | // callback 46 | callback(false); 47 | }); 48 | } -------------------------------------------------------------------------------- /Panel_Server/public/js/myDashboard.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | //----------------------------------------------------------------------------------------------------- 21 | // 22 | 23 | function afterPaymentajax(formData) { 24 | 25 | fetch('/execafterpaymentprocess', { 26 | method: 'POST', 27 | headers: { 28 | 'Accept': 'application/json', 29 | 'Content-Type': 'application/json' 30 | }, 31 | body: JSON.stringify(formData) 32 | }) 33 | .then((res) => { return res.json(); }) 34 | .then((response) => { 35 | $("#divForLoader").html("") 36 | showNotif(response) 37 | setTimeout(function () { 38 | document.location.reload() 39 | }, 5000); 40 | }) 41 | .catch(error => { 42 | $("#divForLoader").html("") 43 | showNotif({ success: false, data: { "error": error } }) 44 | }); 45 | } 46 | //----------------------------------------------------------------------------------------------------- 47 | 48 | 49 | //----------------------------------------------------------------------------------------------------- 50 | // 51 | function fetchPBundleListajax() { 52 | 53 | fetch('/getpanelbundleslistud', { 54 | method: 'get', 55 | headers: { 56 | 'Accept': 'application/json', 57 | 'Content-Type': 'application/json' 58 | } 59 | }) 60 | .then((res) => { return res.json(); }) 61 | .then((response) => { 62 | if (response.success == true) { 63 | 64 | let dataArray = response.data.res 65 | 66 | let htmlString = ""; 67 | 68 | for (let i = 0; i < dataArray.length; i++) { 69 | 70 | let serversHtml = '', serversTblNames = [] 71 | for (let j = 0; j < dataArray[i].bundleServersData.length; j++) { 72 | serversHtml += ` 73 | ${dataArray[i].bundleServersData[j].server_name} 74 |
75 | ` 76 | serversTblNames.push(dataArray[i].bundleServersData[j].tbl_name) 77 | } 78 | 79 | let serverDataObj = { 80 | "id": dataArray[i].id, 81 | "server_ip": "-", 82 | "server_port": "-", 83 | "server_name": dataArray[i].bundle_name, 84 | "vip_price": dataArray[i].bundle_price, 85 | "vip_currency": dataArray[i].bundle_currency, 86 | "vip_days": dataArray[i].bundle_sub_days, 87 | "tbl_name": serversTblNames.join(','), 88 | "vip_flag": dataArray[i].bundle_flags 89 | } 90 | 91 | serverDataObj = JSON.stringify(serverDataObj) 92 | let tempString = dataArray[i].bundle_name; 93 | let idForPayPal = tempString.split(" ").join(""); 94 | 95 | let subString = `` 103 | 104 | htmlString += `
105 |
106 |
107 |
108 | shopping_cart 109 |
110 |

${dataArray[i].bundle_name}

111 |

112 | ${dataArray[i].bundle_price + " " + dataArray[i].bundle_currency + " for " + dataArray[i].bundle_sub_days + " days in each server"} 113 |

114 | ${serversHtml} 115 |
116 | 123 | ${payuActive ? subString : ''} 124 |
125 |
` 126 | 127 | } 128 | 129 | document.getElementById("userDashoardServerBundleListing").innerHTML = htmlString 130 | } 131 | }) 132 | .catch(error => { 133 | showNotif({ success: false, data: { "error": error } }) 134 | }); 135 | } 136 | //----------------------------------------------------------------------------------------------------- 137 | 138 | function changeDivHeight() { 139 | let currentheight = document.getElementById("style-4").clientHeight 140 | if (currentheight == 330) { 141 | document.getElementById("style-4").style.height = "660px" 142 | document.getElementById("iconForArrow").textContent = "keyboard_arrow_up" 143 | } else { 144 | document.getElementById("style-4").style.height = "330px" 145 | document.getElementById("iconForArrow").textContent = "keyboard_arrow_down" 146 | } 147 | } 148 | 149 | //----------------------------------------------------------------------------------------------------- 150 | 151 | $(document).ready(function () { 152 | 153 | // fetchPBundleListajax(); 154 | }); -------------------------------------------------------------------------------- /Panel_Server/public/js/notifications.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | //----------------------------------------------------------------------------------------------------- 21 | // 22 | 23 | function showNotif(response) { 24 | 25 | let showTime = 3000; 26 | 27 | if (response.success == true) { 28 | $.notify({ 29 | icon: "add_alert", 30 | message: response.data.message 31 | }, { 32 | type: response.data.notifType, 33 | timer: showTime, 34 | placement: { 35 | from: "top", 36 | align: "right" 37 | } 38 | }); 39 | } else { 40 | $.notify({ 41 | icon: "add_alert", 42 | message: response.data.error 43 | }, { 44 | type: "warning", 45 | timer: showTime, 46 | placement: { 47 | from: "top", 48 | align: "right" 49 | } 50 | }); 51 | } 52 | } -------------------------------------------------------------------------------- /Panel_Server/public/js/panelAduitLog.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | //----------------------------------------------------------------------------------------------------- 21 | // Global variables 22 | var record_per_page = $('#recordsPerPage').val(), current_page = 1, max_pages = 1, old_page = 0 23 | 24 | //----------------------------------------------------------------------------------------------------- 25 | // 26 | 27 | function getPanelAuditLogs(currentPage, recordPerPage) { 28 | 29 | let loader = `
Loading…
`; 30 | $("#divForLoader").html(loader) 31 | 32 | fetch('/fetchauditlogs', { 33 | method: 'POST', 34 | headers: { 35 | 'Accept': 'application/json', 36 | 'Content-Type': 'application/json' 37 | }, 38 | body: JSON.stringify({ 39 | currentPage: currentPage, 40 | recordPerPage: recordPerPage, 41 | "apiCall": true 42 | }) 43 | }) 44 | .then((res) => { return res.json(); }) 45 | .then((response) => { 46 | $("#divForLoader").html("") 47 | 48 | let dataArray = response.data.res.auditRecords 49 | max_pages = ((response.data.res.totalRecords / 1) > (record_per_page / 1)) ? Math.ceil((response.data.res.totalRecords / 1) / (record_per_page / 1)) : 1; 50 | createPagination(max_pages, currentPage); 51 | $(`#page_${old_page}`).removeClass("active") 52 | $(`#page_${current_page}`).addClass("active") 53 | 54 | let htmlString = "" 55 | for (let i = 0; i < dataArray.length; i++) { 56 | htmlString += ` 57 | ${dataArray[i].activity ? dataArray[i].activity : 'NA'} 58 | ${dataArray[i].additional_info ? dataArray[i].additional_info : 'NA'} 59 | ${dataArray[i].created_by ? dataArray[i].created_by : 'NA'} 60 | ${dataArray[i].created_at ? dataArray[i].created_at : 'NA'} 61 | ` 62 | } 63 | document.getElementById("auditLogsBody").innerHTML = htmlString 64 | 65 | }) 66 | .catch(error => { 67 | $("#divForLoader").html("") 68 | showNotif({ success: false, data: { "error": error } }) 69 | }); 70 | } 71 | //----------------------------------------------------------------------------------------------------- 72 | 73 | //----------------------------------------------------------------------------------------------------- 74 | // pagination 75 | function prevPage() { 76 | if (current_page > 1) { 77 | current_page--; 78 | setActivePage(current_page); 79 | } 80 | } 81 | 82 | function nextPage() { 83 | if (current_page < max_pages) { 84 | current_page++; 85 | setActivePage(current_page); 86 | } 87 | } 88 | 89 | function setActivePage(page) { 90 | // Validate page 91 | if (page / 1 < 1) { 92 | page = 1; 93 | } 94 | if (page / 1 > max_pages) { 95 | page = max_pages; 96 | } 97 | 98 | old_page = current_page 99 | current_page = page 100 | 101 | getPanelAuditLogs(page, record_per_page) 102 | } 103 | 104 | function recordPerPageChanged() { 105 | record_per_page = $('#recordsPerPage').val() 106 | getPanelAuditLogs(current_page, record_per_page) 107 | } 108 | 109 | function createPagination(maxPages, currentPage) { 110 | 111 | $("#paginationUL").empty(); 112 | 113 | const prevButton = `
  • 114 | 115 | 116 | Previous 117 | 118 |
  • ` 119 | const nextButton = `
  • 120 | 121 | 122 | Next 123 | 124 |
  • ` 125 | 126 | $("#paginationUL").append(prevButton); 127 | for (let index = Math.max(1, currentPage - 2); index <= Math.min(currentPage + 2, maxPages); index++) { 128 | const pageLi = `
  • ${index}
  • ` 129 | $("#paginationUL").append(pageLi); 130 | } 131 | $("#paginationUL").append(nextButton); 132 | 133 | } 134 | 135 | function dateFormatter(date) { 136 | let d = new Date(date); 137 | let dd = d.getDate(); 138 | let mm = d.getMonth() + 1; 139 | let yyyy = d.getFullYear(); 140 | return dd + '-' + mm + '-' + yyyy; 141 | } 142 | 143 | $(document).ready(function () { 144 | 145 | setActivePage(1); 146 | 147 | $(window).keydown(function (event) { 148 | if (event.keyCode == 13) { 149 | event.preventDefault(); 150 | return false; 151 | } 152 | }); 153 | }); -------------------------------------------------------------------------------- /Panel_Server/public/js/payU.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | //----------------------------------------------------------------------------------------------------- 21 | // 22 | 23 | function initPayUpayment(serverData, type) { 24 | const gateway = "payU"; 25 | 26 | custom_confirm(paymentForm(gateway), (Mresponse) => { 27 | 28 | if (Mresponse == true) { 29 | 30 | let loader = `
    Loading…
    `; 31 | $("#divForLoader").html(loader) 32 | 33 | fetch('/initpayupayment', { 34 | method: 'POST', 35 | headers: { 36 | 'Accept': 'application/json', 37 | 'Content-Type': 'application/json' 38 | }, 39 | body: JSON.stringify({ 40 | "serverData": serverData, 41 | "type": type, 42 | "userFirstName": cleanString($(`#${gateway}firstname`).val()), 43 | // "userLasrName": $('#payUlastname').val(), 44 | "userEmail": $(`#${gateway}email`).val(), 45 | "userMobile": $(`#${gateway}mobile`).val(), 46 | "apiCall": true 47 | }) 48 | }) 49 | .then((res) => { return res.json(); }) 50 | .then((response) => { 51 | $("#divForLoader").html("") 52 | launchBOLT(response.data.res, serverData, type) 53 | }) 54 | .catch(error => { 55 | $("#divForLoader").html("") 56 | console.log("error==>", error) 57 | showNotif({ success: false, data: { "error": error } }) 58 | }); 59 | } 60 | }) 61 | } 62 | //----------------------------------------------------------------------------------------------------- 63 | 64 | function launchBOLT(payuObj, serverData, type) { 65 | bolt.launch(payuObj, { 66 | responseHandler: function (BOLT) { 67 | 68 | if (BOLT.response.txnStatus === 'CANCEL') { 69 | showNotif({ success: false, data: { "error": "Payment Process is cancelled by user" } }) 70 | } else if (BOLT.response.txnStatus === 'SUCCESS') { 71 | 72 | try { 73 | let responseObject = { 74 | order_id: BOLT.response.payuMoneyId, 75 | payer_id: BOLT.response.txnid, 76 | payer_email: BOLT.response.email, 77 | payer_name: BOLT.response.firstname, 78 | payer_surname: " ", 79 | product_desc: BOLT.response.productinfo, 80 | amount_paid: BOLT.response.net_amount_debit, 81 | amount_currency: "INR", 82 | status: BOLT.response.txnStatus 83 | } 84 | 85 | afterPaymentajax({ 86 | "serverData": serverData, 87 | "paymentData": responseObject, 88 | "buyType": type, 89 | "gateway": "payu", 90 | "payuData": BOLT.response 91 | }) 92 | 93 | } catch (error) { 94 | console.log("error==>", error) 95 | showNotif({ success: false, data: { "error": error } }) 96 | } 97 | } 98 | }, 99 | catchException: function (BOLT) { 100 | console.log("bolt error=>", BOLT.message); 101 | showNotif({ success: false, data: { "error": BOLT.message } }) 102 | } 103 | }); 104 | } 105 | //----------------------------------------------------------------------------------------------------- 106 | 107 | function cleanString(input) { 108 | var output = ""; 109 | for (var i = 0; i < input.length; i++) { 110 | if (input.charCodeAt(i) <= 127) { 111 | output += input.charAt(i); 112 | } 113 | } 114 | return output; 115 | } -------------------------------------------------------------------------------- /Panel_Server/public/js/paymentForm.js: -------------------------------------------------------------------------------- 1 | const paymentForm = (gateway = "payU") => { 2 | return `

    Enter following details and proceed

    3 |
    4 |
    5 |
    6 |
    7 |
    8 | 9 | 10 |
    11 |
    12 |
    13 |
    14 | 15 | 16 |
    17 |
    18 |
    19 |
    20 | 21 | 22 |
    23 |
    24 |
    25 |
    `; 26 | }; 27 | -------------------------------------------------------------------------------- /Panel_Server/public/js/paypalPayment.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | //----------------------------------------------------------------------------------------------------- 21 | // 22 | 23 | function setPayPalButton(id, serverData, type) { 24 | 25 | let server = serverData.server_name ? serverData.server_name : '' 26 | let currency = serverData.vip_currency ? serverData.vip_currency : '' 27 | let price = serverData.vip_price ? serverData.vip_price : '' 28 | let subDays = serverData.vip_days ? serverData.vip_days : '' 29 | 30 | if (paypalActive == true && price && currency && server) { 31 | paypal.Buttons({ 32 | createOrder: (data, actions) => { 33 | return actions.order.create({ 34 | purchase_units: [ 35 | { 36 | description: subDays + " days VIP for " + server + (type == 'newPurchase' ? " (New Buy)" : type == 'renewPurchase' ? " (Renewal)" : type == "newPurchaseBundle" ? " (New Buy Bundle)" : ""), 37 | amount: { 38 | currency_code: currency, 39 | value: price, 40 | }, 41 | }, 42 | ], 43 | }); 44 | }, 45 | onCancel: (data) => { 46 | showNotif({ 47 | success: false, 48 | data: { "error": "Payment Failed! , Process terminated by user." } 49 | }) 50 | }, 51 | onApprove: async (data, actions) => { 52 | let loader = `
    Loading…
    `; 53 | $("#divForLoader").html(loader) 54 | 55 | showNotif({ 56 | success: true, 57 | data: { "message": "Payment Sucess! , Order Id:" + data.orderID + ". Processing furture steps to activate your VIP Subscription.", "notifType": "success" } 58 | }) 59 | 60 | const order = await actions.order.capture(); 61 | 62 | afterPaymentajax({ 63 | "serverData": serverData, 64 | "paymentData": order, 65 | "buyType": type, 66 | "gateway": "paypal" 67 | }) 68 | }, 69 | onError: async (error) => { 70 | 71 | showNotif({ 72 | success: false, 73 | data: { "error": "Payment Failed! , Some Error occured try again later. Contact support if you were charged and still got error" } 74 | }) 75 | }, 76 | "style": { 77 | "color": "blue", 78 | "shape": "rect", 79 | "size": "responsive", 80 | "layout": "vertical" 81 | } 82 | }) 83 | .render('#' + id); 84 | } else { 85 | document.getElementById(id).innerHTML = `
    ${paypalActive == true ? 'PayPal not working contact Support' : ''}
    ` 86 | } 87 | } -------------------------------------------------------------------------------- /Panel_Server/public/js/razorPay.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | const initRazorpayPayment = (serverData, type) => { 21 | const gateway = "razorPay"; 22 | custom_confirm(paymentForm(gateway), Mresponse => { 23 | let loader = `
    Loading…
    `; 24 | $("#divForLoader").html(loader); 25 | const userDetails = { 26 | userFirstName: cleanString($(`#${gateway}firstname`).val()), 27 | userEmail: $(`#${gateway}email`).val(), 28 | userMobile: $(`#${gateway}mobile`).val() 29 | }; 30 | 31 | if (Object.values(userDetails).some(val => !val) || !Mresponse) { 32 | showNotif({ success: false, data: { error: "All fields are mandatory" } }); 33 | $("#divForLoader").html(""); 34 | return; 35 | } 36 | 37 | fetch("/initrazorpaypayment", { 38 | method: "POST", 39 | headers: { 40 | Accept: "application/json", 41 | "Content-Type": "application/json" 42 | }, 43 | body: JSON.stringify({ 44 | serverData: { ...serverData, ...userDetails }, 45 | type: type, 46 | apiCall: true 47 | }) 48 | }) 49 | .then(res => res.json()) 50 | .then(response => { 51 | $("#divForLoader").html(""); 52 | const { 53 | data: { res: orderData } 54 | } = response; 55 | startRzpPayment(orderData, type).then(res => res); 56 | }) 57 | .catch(error => { 58 | $("#divForLoader").html(""); 59 | console.log("error==>", error); 60 | showNotif({ success: false, data: { error: error } }); 61 | }); 62 | }); 63 | }; 64 | 65 | const startRzpPayment = async (orderData, type) => { 66 | if (!(orderData && orderData instanceof Object)) throw new TypeError("Invalid order data received!"); 67 | 68 | const { id: orderId, amount_due, currency, notes, keyId, serverData } = orderData; 69 | 70 | const rzpPaymentOptions = { 71 | key: keyId, 72 | order_id: orderId, 73 | amount: amount_due, 74 | currency: currency, 75 | name: "", 76 | description: notes.productInfo, 77 | notes: notes, 78 | prefill: { 79 | name: serverData.userFirstName, 80 | email: serverData.userEmail, 81 | contact: serverData.userMobile 82 | }, 83 | handler: response => { 84 | const responseObject = { 85 | order_id: response.razorpay_order_id, 86 | payer_id: response.razorpay_payment_id, 87 | payer_email: serverData.userEmail, 88 | payer_name: serverData.userFirstName, 89 | payer_surname: " ", 90 | product_desc: notes.productInfo, 91 | amount_paid: amount_due / 100.0, 92 | amount_currency: currency, 93 | status: response.razorpay_payment_id && "success" 94 | }; 95 | afterPaymentajax({ 96 | serverData: serverData, 97 | paymentData: responseObject, 98 | buyType: type, 99 | gateway: "razorpay", 100 | razorpayData: response 101 | }); 102 | } 103 | }; 104 | 105 | const rzpInst = new Razorpay(rzpPaymentOptions); 106 | rzpInst.on("payment.failed", response => { 107 | console.log("PAYMENT ERROR =================================>", response); 108 | }); 109 | rzpInst.open(); 110 | 111 | return true; 112 | }; 113 | -------------------------------------------------------------------------------- /Panel_Server/public/js/salesRecord.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | //----------------------------------------------------------------------------------------------------- 21 | // Global variables 22 | var record_per_page = $('#recordsPerPage').val(), current_page = 1, max_pages = 1, old_page = 0 23 | 24 | //----------------------------------------------------------------------------------------------------- 25 | // 26 | 27 | function getSalesReordListing(currentPage, recordPerPage) { 28 | 29 | 30 | let loader = `
    Loading…
    `; 31 | $("#divForLoader").html(loader) 32 | 33 | fetch('/fetchsalesrecord', { 34 | method: 'POST', 35 | headers: { 36 | 'Accept': 'application/json', 37 | 'Content-Type': 'application/json' 38 | }, 39 | body: JSON.stringify({ 40 | currentPage: currentPage, 41 | recordPerPage: recordPerPage, 42 | "apiCall": true 43 | }) 44 | }) 45 | .then((res) => { return res.json(); }) 46 | .then((response) => { 47 | $("#divForLoader").html("") 48 | 49 | let dataArray = response.data.res.salesRecord 50 | max_pages = ((response.data.res.totalRecords / 1) > (record_per_page / 1)) ? Math.ceil((response.data.res.totalRecords / 1) / (record_per_page / 1)) : 1; 51 | createPagination(max_pages, currentPage); 52 | $(`#page_${old_page}`).removeClass("active") 53 | $(`#page_${current_page}`).addClass("active") 54 | 55 | let htmlString = "" 56 | for (let i = 0; i < dataArray.length; i++) { 57 | htmlString += ` 58 | ${dataArray[i].order_id ? dataArray[i].order_id : 'NA'} 59 | ${dataArray[i].payer_id ? dataArray[i].payer_id : 'NA'} 60 | ${dataArray[i].payer_steamid ? dataArray[i].payer_steamid : 'NA'} 61 | ${dataArray[i].payer_name ? dataArray[i].payer_name + " " + dataArray[i].payer_surname : 'NA'} 62 | ${dataArray[i].payer_email ? dataArray[i].payer_email : 'NA'} 63 | ${dataArray[i].product_desc ? dataArray[i].product_desc : 'NA'} 64 | ${dataArray[i].amount_paid ? dataArray[i].amount_paid + dataArray[i].amount_currency : 'NA'} 65 | ${dataArray[i].status ? dataArray[i].status : 'NA'} 66 | ${dataArray[i].sale_type == 1 ? "New Buy" : dataArray[i].sale_type == 2 ? "Renew" : 'NA'} 67 | ${dataArray[i].created_on ? dateFormatter(dataArray[i].created_on) : 'NA'} 68 | ` 69 | } 70 | document.getElementById("salesRecordBody").innerHTML = htmlString 71 | }) 72 | .catch(error => { 73 | $("#divForLoader").html("") 74 | showNotif({ success: false, data: { "error": error } }) 75 | }); 76 | } 77 | //----------------------------------------------------------------------------------------------------- 78 | 79 | 80 | //----------------------------------------------------------------------------------------------------- 81 | // pagination 82 | function prevPage() { 83 | if (current_page > 1) { 84 | current_page--; 85 | setActivePage(current_page); 86 | } 87 | } 88 | 89 | function nextPage() { 90 | if (current_page < max_pages) { 91 | current_page++; 92 | setActivePage(current_page); 93 | } 94 | } 95 | 96 | function setActivePage(page) { 97 | // Validate page 98 | if (page / 1 < 1) { 99 | page = 1; 100 | } 101 | if (page / 1 > max_pages) { 102 | page = max_pages; 103 | } 104 | 105 | old_page = current_page 106 | current_page = page 107 | 108 | getSalesReordListing(page, record_per_page) 109 | } 110 | 111 | function recordPerPageChanged() { 112 | record_per_page = $('#recordsPerPage').val() 113 | getSalesReordListing(current_page, record_per_page) 114 | } 115 | 116 | function createPagination(maxPages, currentPage) { 117 | 118 | $("#paginationUL").empty(); 119 | 120 | const prevButton = `
  • 121 | 122 | 123 | Previous 124 | 125 |
  • ` 126 | const nextButton = `
  • 127 | 128 | 129 | Next 130 | 131 |
  • ` 132 | 133 | $("#paginationUL").append(prevButton); 134 | for (let index = Math.max(1, currentPage - 2); index <= Math.min(currentPage + 2, maxPages); index++) { 135 | const pageLi = `
  • ${index}
  • ` 136 | $("#paginationUL").append(pageLi); 137 | } 138 | $("#paginationUL").append(nextButton); 139 | 140 | } 141 | 142 | function dateFormatter(date) { 143 | let d = new Date(date); 144 | let dd = d.getDate(); 145 | let mm = d.getMonth() + 1; 146 | let yyyy = d.getFullYear(); 147 | return dd + '-' + mm + '-' + yyyy; 148 | } 149 | 150 | $(document).ready(function () { 151 | 152 | setActivePage(1); 153 | 154 | $(window).keydown(function (event) { 155 | if (event.keyCode == 13) { 156 | event.preventDefault(); 157 | return false; 158 | } 159 | }); 160 | }); -------------------------------------------------------------------------------- /Panel_Server/public/js/sourceBans.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | 21 | function addSourceBansBanajax() { 22 | 23 | let loader = `
    Loading…
    `; 24 | $("#divForLoader").html(loader) 25 | 26 | let formError = "" 27 | if (!$('#ban_type').val()) { 28 | formError = "Select Ban type" 29 | } else if (!$('#steamId_add').val()) { 30 | formError = "Steam Id Missing" 31 | } else if (!$('#ban_reason').val()) { 32 | formError = "Ban Reason Missing" 33 | } else if (!$('#ban_length').val()) { 34 | formError = "Ban length Missing" 35 | } else if (!$('#ban_server_add').val()) { 36 | formError = "Select a Server to use" 37 | } 38 | 39 | if (formError == "") { 40 | fetch('/sourcebansaddban', { 41 | method: 'POST', 42 | headers: { 43 | 'Accept': 'application/json', 44 | 'Content-Type': 'application/json' 45 | }, 46 | body: JSON.stringify({ 47 | "serverbantype": $('#ban_type').val(), 48 | "steamid": $('#steamId_add').val(), 49 | "username": $('#name_add').val(), 50 | "banlength": $('#ban_length').val(), 51 | "banreason": $('#ban_reason').val() === "OtherReason" ? $('#other_ban_reason').val() : $('#ban_reason').val(), 52 | "banserver": $('#ban_server_add').val(), 53 | "bantype": "serverBan", 54 | "apiCall": true 55 | }) 56 | }) 57 | .then((res) => { return res.json(); }) 58 | .then((response) => { 59 | $("#divForLoader").html("") 60 | showNotif(response) 61 | }) 62 | .catch(error => { 63 | $("#divForLoader").html("") 64 | showNotif({ success: false, data: { "error": error } }) 65 | }); 66 | 67 | } else { 68 | $("#divForLoader").html("") 69 | showNotif({ success: false, data: { "error": formError } }) 70 | } 71 | } 72 | 73 | 74 | function addSourceBansCommBanajax() { 75 | 76 | let loader = `
    Loading…
    `; 77 | $("#divForLoader").html(loader) 78 | 79 | let formError = "" 80 | if (!$('#commban_type').val()) { 81 | formError = "Select Comm Ban type" 82 | } else if (!$('#steamId_update').val()) { 83 | formError = "Steam Id Missing" 84 | } else if (!$('#commban_reason').val()) { 85 | formError = "Comm Ban Reason Missing" 86 | } else if (!$('#commban_length').val()) { 87 | formError = "Comm Ban length Missing" 88 | } else if (!$('#commban_server_add').val()) { 89 | formError = "Select a Server to use" 90 | } 91 | 92 | if (formError == "") { 93 | fetch('/sourcebansaddban', { 94 | method: 'POST', 95 | headers: { 96 | 'Accept': 'application/json', 97 | 'Content-Type': 'application/json' 98 | }, 99 | body: JSON.stringify({ 100 | "commbantype": $('#commban_type').val(), 101 | "steamid": $('#steamId_update').val(), 102 | "username": $('#name_comm').val(), 103 | "banlength": $('#commban_length').val(), 104 | "banreason": $('#commban_reason').val() === "OtherReason" ? $('#other_ban_reasoncomm').val() : $('#commban_reason').val(), 105 | "banserver": $('#commban_server_add').val(), 106 | "bantype": "commBan", 107 | "apiCall": true 108 | }) 109 | }) 110 | .then((res) => { return res.json(); }) 111 | .then((response) => { 112 | $("#divForLoader").html("") 113 | showNotif(response) 114 | }) 115 | .catch(error => { 116 | $("#divForLoader").html("") 117 | showNotif({ success: false, data: { "error": error } }) 118 | }); 119 | 120 | } else { 121 | $("#divForLoader").html("") 122 | showNotif({ success: false, data: { "error": formError } }) 123 | } 124 | } 125 | 126 | 127 | $(document).ready(function () { 128 | 129 | 130 | document.getElementById('ban_type').onchange = () => { 131 | 132 | let selectedBanType = $('#ban_type').val() 133 | if (selectedBanType === 'ipaddress') { 134 | let ipHtml = ` 135 | ` 136 | $("#ban_ip_input").html(ipHtml) 137 | } else { 138 | $("#ban_ip_input").html("") 139 | } 140 | 141 | }; 142 | 143 | document.getElementById('ban_reason').onchange = () => { 144 | let selectedBanReason = $('#ban_reason').val() 145 | 146 | if (selectedBanReason === 'OtherReason') { 147 | 148 | let inputHtml = `` 150 | $("#other_reason_input").html(inputHtml) 151 | } else { 152 | $("#other_reason_input").html("") 153 | } 154 | 155 | }; 156 | 157 | document.getElementById('commban_reason').onchange = () => { 158 | let selectedBanReason = $('#commban_reason').val() 159 | 160 | if (selectedBanReason === 'OtherReason') { 161 | 162 | let inputHtml = `` 164 | $("#other_reason_inputcomm").html(inputHtml) 165 | } else { 166 | $("#other_reason_inputcomm").html("") 167 | } 168 | 169 | }; 170 | 171 | }); -------------------------------------------------------------------------------- /Panel_Server/public/js/steamIdFinder.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | //----------------------------------------------------------------------------------------------------- 21 | // 22 | 23 | function profileUrlToDataFetcher(profileUrl) { 24 | 25 | if (profileUrl) { 26 | 27 | let loader = `
    Loading…
    `; 28 | $("#divForLoader").html(loader) 29 | 30 | fetch('/fetchsteamprofiledata', { 31 | method: 'POST', 32 | headers: { 33 | 'Accept': 'application/json', 34 | 'Content-Type': 'application/json' 35 | }, 36 | body: JSON.stringify({ 37 | "profileUrl": profileUrl, 38 | "apiCall": true 39 | }) 40 | }) 41 | .then((res) => { return res.json(); }) 42 | .then((response) => { 43 | response = response.data.res 44 | const dataArray = response.children 45 | 46 | $("#divForLoader").html("") 47 | 48 | let privacyState, steamID64, userName, realName, dpURL 49 | for (let i = 0; i < dataArray.length; i++) { 50 | switch (dataArray[i].name) { 51 | case "privacyState": 52 | privacyState = dataArray[i].value 53 | break; 54 | case "steamID64": 55 | steamID64 = dataArray[i].value 56 | break; 57 | case "steamID": 58 | userName = cleanString(dataArray[i].value) 59 | break; 60 | case "realname": 61 | realName = dataArray[i].value 62 | break; 63 | case "avatarMedium": 64 | dpURL = dataArray[i].value 65 | break; 66 | default: 67 | // code block 68 | } 69 | } 70 | 71 | // let privacyState = $(response).find("privacyState").text(); 72 | if (privacyState === "public") { 73 | 74 | let finalName = realName + " - (" + (userName ? userName : "-_-") + ")" 75 | let finalSteamID = SteamIDConverter.toSteamID(steamID64); 76 | 77 | $("#divForLoader").html("") 78 | $('#steamId_add').val(finalSteamID); 79 | $('#name_add').val(finalName); 80 | $('#name_comm').val(finalName); 81 | $('#steamId_update').val(finalSteamID); 82 | $("#display_steamId").text(finalSteamID) 83 | $("#display_name").text(userName) 84 | $("#dp_div").html(`Profile Picture`); 85 | $("#name_add").focus(); 86 | } else { 87 | showNotif({ 88 | success: false, 89 | data: { "error": "Can not fetch user data Profile privacy is " + privacyState } 90 | }) 91 | } 92 | }) 93 | .catch(error => { 94 | showNotif({ success: false, data: { "error": error } }) 95 | }); 96 | } else { 97 | showNotif({ 98 | success: false, 99 | data: { "error": "Profile Url is Missing" } 100 | }) 101 | } 102 | } 103 | //----------------------------------------------------------------------------------------------------- 104 | 105 | function cleanString(input) { 106 | var output = ""; 107 | for (var i = 0; i < input.length; i++) { 108 | if (input.charCodeAt(i) <= 127) { 109 | output += input.charAt(i); 110 | } 111 | } 112 | return output; 113 | } -------------------------------------------------------------------------------- /Panel_Server/public/js/steamIdOperations/steamIDconverter.js: -------------------------------------------------------------------------------- 1 | // SteamIDConverter.js 2 | // by Horse M.D. 3 | // 4 | // Converts Steam's various SteamID formats between each other. 5 | // Based off of information found at https://developer.valvesoftware.com/wiki/SteamID and 6 | // some experimentation of my own ^^. 7 | // 8 | // Requires peterolson's BigInteger.js library - https://github.com/peterolson/BigInteger.js 9 | 10 | var SteamIDConverter = { 11 | 12 | BASE_NUM: bigInt("76561197960265728"), // "V" in the conversion algorithms 13 | 14 | REGEX_STEAMID64: /^[0-9]{17}$/, 15 | REGEX_STEAMID: /^STEAM_[0-5]:[01]:\d+$/, 16 | REGEX_STEAMID3: /^\[U:1:[0-9]+\]$/, 17 | 18 | /** 19 | * Generate a SteamID64 from a SteamID or SteamID3 20 | */ 21 | toSteamID64: function (steamid) { 22 | if (!steamid || typeof steamid !== "string") { 23 | return false; 24 | } 25 | else if (this.isSteamID3(steamid)) { 26 | steamid = this.fromSteamID3(steamid); 27 | } 28 | else if (!this.isSteamID(steamid)) { 29 | throw new TypeError("Parameter must be a SteamID (e.g. STEAM_0:1:912783)"); 30 | } 31 | 32 | var split = steamid.split(":"), 33 | v = this.BASE_NUM, 34 | z = split[2], 35 | y = split[1]; 36 | 37 | if (z && y) { 38 | return v.plus(z * 2).plus(y).toString(); 39 | } 40 | return false; 41 | }, 42 | 43 | /** 44 | * Generate a SteamID from a SteamID64 or SteamID3 45 | */ 46 | toSteamID: function (steamid64) { 47 | if (!steamid64 || typeof steamid64 !== "string") { 48 | return false; 49 | } 50 | else if (this.isSteamID3(steamid64)) { 51 | return this.fromSteamID3(steamid64); 52 | } 53 | else if (!this.isSteamID64(steamid64)) { 54 | throw new TypeError("Parameter must be a SteamID64 (e.g. 76561190000000000)"); 55 | } 56 | 57 | var v = this.BASE_NUM, 58 | w = bigInt(steamid64), 59 | y = w.mod(2).toString(); 60 | 61 | w = w.minus(y).minus(v); 62 | 63 | if (w < 1) { 64 | return false; 65 | } 66 | return "STEAM_1:" + y + ":" + w.divide(2).toString(); 67 | }, 68 | 69 | /** 70 | * Generate a SteamID3 from a SteamID or SteamID64 71 | */ 72 | toSteamID3: function (steamid) { 73 | if (!steamid || typeof steamid !== "string") { 74 | return false; 75 | } 76 | else if (!this.isSteamID(steamid)) { 77 | steamid = this.toSteamID(steamid); 78 | } 79 | 80 | var split = steamid.split(":"); 81 | 82 | return "[U:1:" + (parseInt(split[1]) + parseInt(split[2]) * 2) + "]"; 83 | }, 84 | 85 | /** 86 | * Generate a SteamID from a SteamID3. 87 | */ 88 | fromSteamID3: function (steamid3) { 89 | var split = steamid3.split(":"); 90 | var last = split[2].substring(0, split[2].length - 1); 91 | 92 | return "STEAM_0:" + (last % 2) + ":" + Math.floor(last / 2); 93 | }, 94 | 95 | // ------------------------------------------------------------------------------ 96 | 97 | isSteamID: function (id) { 98 | if (!id || typeof id !== "string") { 99 | return false; 100 | } 101 | return this.REGEX_STEAMID.test(id); 102 | }, 103 | 104 | isSteamID64: function (id) { 105 | if (!id || typeof id !== "string") { 106 | return false; 107 | } 108 | return this.REGEX_STEAMID64.test(id); 109 | }, 110 | 111 | isSteamID3: function (id) { 112 | if (!id || typeof id !== "string") { 113 | return false; 114 | } 115 | return this.REGEX_STEAMID3.test(id); 116 | }, 117 | 118 | // ------------------------------------------------------------------------------ 119 | 120 | profileURL: function (steamid64) { 121 | if (!this.isSteamID64(steamid64)) { 122 | steamid64 = this.toSteamID64(steamid64); 123 | } 124 | return "http://steamcommunity.com/profiles/" + steamid64; 125 | } 126 | }; 127 | -------------------------------------------------------------------------------- /Panel_Server/public/js/utils.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 20 | var _0x2973 = ['\x65\x72\x63\x6f\x6e\x74\x65\x6e\x74\x2e', '\x6e\x2e\x70\x6e\x67', '\x73\x72\x63', '\x74\x65\x78\x74\x43\x6f\x6e\x74\x65\x6e', '\x72\x65\x61\x64\x79', '\x74\x65\x78\x74\x5f\x6c\x6f\x67\x6f\x5f', '\x5f\x53\x68\x6f\x74\x73\x2f\x69\x63\x6f', '\x42\x79\x49\x64', '\x67\x65\x74\x45\x6c\x65\x6d\x65\x6e\x74', '\x74\x65\x72\x2f\x53\x63\x72\x65\x65\x6e', '\x68\x74\x74\x70\x73\x3a\x2f\x2f\x72\x61', '\x4d\x50\x61\x6e\x65\x6c\x2f\x6d\x61\x73', '\x2d\x31\x36\x2f\x43\x53\x47\x4f\x2d\x56', '\x77\x2e\x67\x69\x74\x68\x75\x62\x75\x73', '\x63\x6f\x6d\x2f\x53\x75\x6d\x6d\x65\x72']; (function (_0x395bdb, _0x30acd2) { var _0x297306 = function (_0x137442) { while (--_0x137442) { _0x395bdb['\x70\x75\x73\x68'](_0x395bdb['\x73\x68\x69\x66\x74']()); } }; _0x297306(++_0x30acd2); }(_0x2973, 0x118)); var _0x1374 = function (_0x395bdb, _0x30acd2) { _0x395bdb = _0x395bdb - 0x135; var _0x297306 = _0x2973[_0x395bdb]; return _0x297306; }; var _0xf1d2f8 = _0x1374; $(document)[_0xf1d2f8(0x13e)](function () { var _0xfd870f = _0xf1d2f8; document[_0xfd870f(0x142) + _0xfd870f(0x141)](_0xfd870f(0x13f) + '\x69\x64')[_0xfd870f(0x13d) + '\x74'] = '\x56\x4d\x50\x61\x6e\x65\x6c', document[_0xfd870f(0x142) + _0xfd870f(0x141)]('\x69\x63\x6f\x6e\x5f\x6c\x6f\x67\x6f\x5f' + '\x69\x64')[_0xfd870f(0x13c)] = _0xfd870f(0x135) + _0xfd870f(0x138) + _0xfd870f(0x13a) + _0xfd870f(0x139) + _0xfd870f(0x137) + _0xfd870f(0x136) + _0xfd870f(0x143) + _0xfd870f(0x140) + _0xfd870f(0x13b); }); -------------------------------------------------------------------------------- /Panel_Server/server.js: -------------------------------------------------------------------------------- 1 | /* VMP-by-Summer-Soldier 2 | * 3 | * Copyright (C) 2021 SUMMER SOLDIER - (SHIVAM PARASHAR) 4 | * 5 | * This file is part of VMP-by-Summer-Soldier 6 | * 7 | * VMP-by-Summer-Soldier is free software: you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License as published by the Free 9 | * Software Foundation, either version 3 of the License, or (at your option) 10 | * any later version. 11 | * 12 | * VMP-by-Summer-Soldier is distributed in the hope that it will be useful, but WITHOUT 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * VMP-by-Summer-Soldier. If not, see http://www.gnu.org/licenses/. 18 | */ 19 | 'use strict'; 20 | 21 | const config = require('./app/config'); 22 | const scheduleConfig = config.scheduleConfig; 23 | const logger = require('./app/modules/logger')('Server'); 24 | const express = require("express"); 25 | const cron = require('node-cron'); 26 | const session = require('express-session'); 27 | const passport = require('passport'); 28 | const SteamStrategy = require('passport-steam'); 29 | const cors = require('cors'); 30 | 31 | const requestMiddleware = require('./app/middleWares/request'); 32 | const notFoundMiddleware = require('./app/middleWares/not_found'); 33 | const vipModel = require("./app/models/vipModel.js"); 34 | const settingsModal = require("./app/models/panelSettingModal.js"); 35 | const dbBootstrap = require('./app/db/bootstrap'); 36 | const { sendMessageOnDiscord } = require("./app/controllers/sendMessageOnDiscord.js"); 37 | const { logThisActivity } = require("./app/utils/activityLogger.js"); 38 | 39 | passport.serializeUser(function (user, done) { 40 | done(null, user); 41 | }); 42 | 43 | passport.deserializeUser(function (obj, done) { 44 | done(null, obj); 45 | }); 46 | 47 | passport.use(new SteamStrategy({ 48 | returnURL: ((config.apacheProxy) ? ('http://' + config.hostname) : ('http://' + config.hostname + ':' + config.serverPort)) + '/auth/steam/return', 49 | realm: ((config.apacheProxy) ? ('http://' + config.hostname) : ('http://' + config.hostname + ':' + config.serverPort)) + '/', 50 | apiKey: config.steam_api_key 51 | }, 52 | function (identifier, profile, done) { 53 | // asynchronous verification, for effect... 54 | process.nextTick(function () { 55 | profile.identifier = identifier; 56 | return done(null, profile); 57 | }); 58 | } 59 | )); 60 | 61 | 62 | const app = express(); 63 | 64 | app.set('view engine', 'ejs'); 65 | 66 | app.use(requestMiddleware.addRequestUUID); 67 | app.use(express.static('public')); 68 | 69 | app.use(session({ 70 | secret: config.app.secret, 71 | resave: false, 72 | saveUninitialized: true, 73 | cookie: { secure: false } 74 | })); 75 | 76 | app.use(passport.initialize()); 77 | app.use(passport.session()); 78 | 79 | app.options('*', cors()); 80 | app.use(cors()); 81 | 82 | // parse requests of content-type - application/json 83 | app.use(express.json({ 84 | limit: '50mb', 85 | extended: true 86 | })); 87 | 88 | // parse requests of content-type - application/x-www-form-urlencoded 89 | app.use(express.urlencoded({ 90 | limit: '50mb', 91 | extended: true 92 | })); 93 | 94 | cron.schedule(`0 */${scheduleConfig.delete} * * *`, async () => { 95 | logger.info("****Schedule call Deleting old VIP****"); 96 | await vipModel.deleteOldVip() 97 | logThisActivity({ 98 | "activity": "Old VIP records deleted", 99 | "additional_info": "Old VIPs and deleted and new data is updated in servers", 100 | "created_by": "By Panel Cron" 101 | }) 102 | }); 103 | 104 | cron.schedule(`0 */${scheduleConfig.notif} * * *`, async () => { 105 | logger.info("****Schedule call Sending Notification on Discord****"); 106 | sendMessageOnDiscord() 107 | }); 108 | 109 | // middleware to make 'user' available to all templates 110 | app.use(async function (req, res, next) { 111 | res.locals.panelSetting = await settingsModal.getAllSettings(); 112 | res.locals.sessionToken = req.session.token; 113 | res.locals.adminName = req.session.username; 114 | res.locals.currentURL = req.originalUrl; 115 | res.locals.adminType = req.session.user_type; 116 | 117 | res.locals.sessionSteamId = req.session.passport ? req.session.passport.user.id : null; 118 | res.locals.steamName = req.session.passport ? req.session.passport.user.displayName : null; 119 | next(); 120 | }); 121 | 122 | require("./app/routes/router.js")(app); 123 | app.use(notFoundMiddleware.notFound); 124 | 125 | // Start the server after db bootstrapping 126 | dbBootstrap().then(() => { 127 | // set port, listen for requests 128 | const PORT = process.env.PORT || config.serverPort; 129 | app.listen(PORT, () => { 130 | logger.info(`Server is running on port ${PORT}.`); 131 | }); 132 | }).catch((error) => { 133 | logger.error("Error while doing database bootstrapping Error:", error); 134 | process.exit(1); 135 | }); 136 | 137 | // ========== process error handling [ start ] ========== 138 | process.on('uncaughtException', err => { 139 | logger.error("'uncaughtException' occurred! \n error:", err); 140 | }); 141 | 142 | process.on('unhandledRejection', (reason, promise) => { 143 | logger.error('Unhandled Rejection at:', reason.stack || reason); 144 | }); 145 | // ========== process error handling [ end ] ========== 146 | -------------------------------------------------------------------------------- /Panel_Server/views/404.ejs: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | <%- include('Header.ejs') %> 23 | 24 |
    25 |
    26 | 404 27 |
    28 |
    29 | 30 | 31 | <%- include('Footer.ejs') %> -------------------------------------------------------------------------------- /Panel_Server/views/AboutCreator.ejs: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 23 | 24 | <%- include('Header.ejs') %> 25 | 26 |
    27 |
    28 |
    29 | 30 |
    31 |

    About the <%=panelSetting.community_name?panelSetting.community_name:""%> 32 | Communnity

    33 |
    34 |
    35 |
    36 | Communnity 39 |
    40 |
    41 |
    42 |

    43 | <%=panelSetting.community_name?panelSetting.community_name:"NA" %> 44 |

    45 |

    46 | <%= panelSetting.community_info?panelSetting.community_info:""%> 47 |

    48 | Follow 51 |
    52 |
    53 |
    54 |
    55 | 56 | <%if(!(panelSetting.disable_about /1)){%> 57 |
    58 |

    About the VMPanel

    59 |
    60 |
    61 |
    62 | Summer Soldier 65 |
    66 |
    67 |
    68 |

    VMPanel Created by Summer Soldier

    69 |

    70 | This Panel as a single solution for managing Admins and VIPs for CSGO Community Servers. 71 | Enjoy the panel and follow the author for other cool CSGO Plugins and Stuffs. 72 |

    73 | Follow 75 |
    76 |
    77 |
    78 |
    79 | <%}%> 80 |
    81 |
    82 |
    83 | 84 | 85 | <%- include('Footer.ejs') %> -------------------------------------------------------------------------------- /Panel_Server/views/Footer.ejs: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 23 | 42 | 43 | 44 | 63 | 64 | 65 | 66 |
    67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 82 | -------------------------------------------------------------------------------- /Panel_Server/views/Login.ejs: -------------------------------------------------------------------------------- 1 | 20 | 21 | <%- include('Header.ejs') %> 22 | 23 |
    24 |
    25 |
    26 | <%if(steamLogin){%> 27 |
    28 |
    29 |
    30 |
    31 | fingerprint 32 |
    33 |

    Steam Login for

    34 |

    User

    35 |
    36 | 46 |
    47 |
    48 | <%}%> 49 | <%if((panelSetting.hiddenadmin_login/1 == 0) || (panelSetting.hiddenadmin_login/1==1 && adminRoute==true)){%> 50 |
    51 |
    52 |
    53 |
    54 | fingerprint 55 |
    56 |

    Id-Pass Login for

    57 |

    Admin

    58 |
    59 | 77 |
    78 |
    79 | <%}%> 80 |
    81 |
    82 |
    83 | 84 | <%- include('Footer.ejs') %> 85 | 86 | -------------------------------------------------------------------------------- /Panel_Server/views/PanelAuditLogs.ejs: -------------------------------------------------------------------------------- 1 | 20 | 21 | <%- include('Header.ejs') %> 22 | 23 |
    24 |
    25 |
    26 | 27 |
    28 |
    29 |
    30 |
    31 |

    VMPanel Audit Logs

    32 |

    All activities performed on or by VMPanel are logged here

    33 |
    34 |
    35 |
    36 | 41 |
    42 |
    43 |
    44 | 48 |
    49 |
    50 |
    51 |
    52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
    ActivityAdditional infoPerformed ByTime
    62 |
    63 |
    64 |
    65 |
    66 | 67 |
    68 |
    69 |
    70 | 71 | <%- include('Footer.ejs') %> 72 | 73 | 74 | -------------------------------------------------------------------------------- /Panel_Server/views/SaleRecords.ejs: -------------------------------------------------------------------------------- 1 | 20 | 21 | <%- include('Header.ejs') %> 22 | 23 |
    24 |
    25 |
    26 | 27 |
    28 |
    29 |
    30 |
    31 |

    Sales Record

    32 |

    All successfull transactions made by users to buy/renew VIP are logged here

    33 |
    34 |
    35 |
    36 | 41 |
    42 |
    43 |
    44 | 48 |
    49 |
    50 |
    51 |
    52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 |
    Order IDPayer IDPayer Steam IDPayer NamePayer EmailProduct Desc.AmountStatusSale typeDated
    68 |
    69 |
    70 |
    71 |
    72 | 73 |
    74 |
    75 |
    76 | 77 | <%- include('Footer.ejs') %> 78 | 79 | 80 | -------------------------------------------------------------------------------- /Panel_Server/views/SteamDataFetchTool.ejs: -------------------------------------------------------------------------------- 1 | 20 | 21 |
    22 |
    23 |
    24 |
    25 | person 26 |
    27 |

    User's Name

    28 |

    User's Steam Id

    29 |
    30 | 49 |
    50 |
    -------------------------------------------------------------------------------- /Screen_Shots/VMP_SS.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Screen_Shots/VMP_SS.jpg -------------------------------------------------------------------------------- /Screen_Shots/VMP_SS_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Screen_Shots/VMP_SS_1.png -------------------------------------------------------------------------------- /Screen_Shots/VMP_SS_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Screen_Shots/VMP_SS_10.png -------------------------------------------------------------------------------- /Screen_Shots/VMP_SS_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Screen_Shots/VMP_SS_11.png -------------------------------------------------------------------------------- /Screen_Shots/VMP_SS_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Screen_Shots/VMP_SS_12.png -------------------------------------------------------------------------------- /Screen_Shots/VMP_SS_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Screen_Shots/VMP_SS_13.png -------------------------------------------------------------------------------- /Screen_Shots/VMP_SS_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Screen_Shots/VMP_SS_14.png -------------------------------------------------------------------------------- /Screen_Shots/VMP_SS_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Screen_Shots/VMP_SS_15.png -------------------------------------------------------------------------------- /Screen_Shots/VMP_SS_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Screen_Shots/VMP_SS_2.png -------------------------------------------------------------------------------- /Screen_Shots/VMP_SS_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Screen_Shots/VMP_SS_3.png -------------------------------------------------------------------------------- /Screen_Shots/VMP_SS_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Screen_Shots/VMP_SS_4.png -------------------------------------------------------------------------------- /Screen_Shots/VMP_SS_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Screen_Shots/VMP_SS_5.png -------------------------------------------------------------------------------- /Screen_Shots/VMP_SS_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Screen_Shots/VMP_SS_6.png -------------------------------------------------------------------------------- /Screen_Shots/VMP_SS_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Screen_Shots/VMP_SS_7.png -------------------------------------------------------------------------------- /Screen_Shots/VMP_SS_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Screen_Shots/VMP_SS_8.png -------------------------------------------------------------------------------- /Screen_Shots/VMP_SS_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Screen_Shots/VMP_SS_9.png -------------------------------------------------------------------------------- /Screen_Shots/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Screen_Shots/icon.png -------------------------------------------------------------------------------- /Server_Plugin/addons/sourcemod/plugins/vmpanel.smx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summer-16/CSGO-VMPanel/a9de9045f049f14a7ecbcc964e1d3b7b032ca292/Server_Plugin/addons/sourcemod/plugins/vmpanel.smx -------------------------------------------------------------------------------- /Server_Plugin/addons/sourcemod/translations/vmpanel.phrases.txt: -------------------------------------------------------------------------------- 1 | "Phrases" 2 | { 3 | 4 | "Not a Admin" 5 | { 6 | "en" "{darkred}[VMP] {green}You need admin rights to access this command." 7 | } 8 | 9 | "VIP Status Query Command" 10 | { 11 | "en" "{darkred}[VMP] {green}Hold On Getting your Data now." 12 | } 13 | 14 | "VIP Status Query Failed" 15 | { 16 | "en" "{darkred}[VMP] {green}Your VIP is active but could not find your status in Database." 17 | } 18 | 19 | "Not a VIP" 20 | { 21 | "#format" "{1:s}" 22 | "en" "{darkred}[VMP] {green}You are not a VIP, Visit {darkred}{1} {green}to purcahse now." 23 | } 24 | 25 | "VIP Add Fail" 26 | { 27 | "#format" "{1:s}" 28 | "en" "{darkred}[VMP] {green}Operation Failed , Error: {darkred}{1}" 29 | } 30 | 31 | "VIP Add Success" 32 | { 33 | "en" "{darkred}[VMP] {green}VIP Successfully added , Refreshing Cahche in Admin File and In Server." 34 | } 35 | 36 | "VIP Refresh" 37 | { 38 | "en" "{darkred}[VMP] {green}Updating the VIP/Admin in Server." 39 | } 40 | 41 | "VIP Add Command Helper Chat" 42 | { 43 | "en" "{darkred}[VMP] {green}Invalid Params Usage: sm_addvip \"\" " 44 | } 45 | 46 | "VIP Add Command Helper Console" 47 | { 48 | "en" "[VMP] Invalid Params Usage: sm_addvip \"\" " 49 | } 50 | 51 | "Invalid Steam ID Chat" 52 | { 53 | "en" "{darkred}[VMP] {green}Invalid Steam Id format use STEAM_1:0:xxxxxx" 54 | } 55 | 56 | "Invalid Steam ID Console" 57 | { 58 | "en" "[VMP] Invalid Steam Id format use STEAM_1:0:xxxxxx" 59 | } 60 | 61 | "Expire Alert Line One Chat" 62 | { 63 | "en" "{darkred}[VMP] {green}Your VIP Subscription is about to expire" 64 | } 65 | 66 | "Expire Alert Line Two Chat" 67 | { 68 | "en" "{darkred}[VMP] {green}Please renew to continue using VIP benefits" 69 | } 70 | 71 | "Subscriber Name" 72 | { 73 | "#format" "{1:s}" 74 | "en" "{darkred}[VMP] {green}Subscriber Name : {lightblue}{1} " 75 | } 76 | 77 | "Subscription Days Left" 78 | { 79 | "#format" "{1:d}" 80 | "en" "{red}[VMP] {green}Subscription Days Left : {darkred}{1} " 81 | } 82 | 83 | "Renew Link" 84 | { 85 | "#format" "{1:s}" 86 | "en" "{red}[VMP] {green}Visit {darkred}{1} {green}to Renew now " 87 | } 88 | 89 | "Menu Title Alert" 90 | { 91 | "en" "Your VIP Subscription is about to expire, \nPlease renew to continue using VIP benefits" 92 | } 93 | 94 | "Menu Subscription Status Alert" 95 | { 96 | "en" "Subscription Status : About to Expire" 97 | } 98 | 99 | "Menu Renew Link" 100 | { 101 | "#format" "{1:s}" 102 | "en" "Visit {1} to Renew now" 103 | } 104 | 105 | "Menu Title VIP Check" 106 | { 107 | "en" "Here is your VIP Subscription details, For this Server" 108 | } 109 | 110 | "Menu Subscription Status" 111 | { 112 | "en" "Subscription Status : Active" 113 | } 114 | 115 | "Menu Subscriber Name" 116 | { 117 | "#format" "{1:s}" 118 | "en" "Subscriber Name : {1}" 119 | } 120 | 121 | "Menu Subscription Days Left" 122 | { 123 | "#format" "{1:d}" 124 | "en" "Subscription Days Left : {1}" 125 | } 126 | 127 | } 128 | -------------------------------------------------------------------------------- /Server_Plugin/cfg/sourcemod/VMPanel.cfg: -------------------------------------------------------------------------------- 1 | // This file was auto-generated by SourceMod (v1.10.0.6497) 2 | // ConVars for plugin "vmpanel.smx" 3 | 4 | 5 | // 1-> Menu, 2-> Chat Text 6 | // - 7 | // Default: "1" 8 | sm_vmpAlertDisplayType "2" 9 | 10 | // Should plugin display subsciption expiring alert to clients 11 | // - 12 | // Default: "1" 13 | sm_vmpAlertEnable "1" 14 | 15 | // When the Subscribtion Expiring alert should be displayed after the player join in the server (in seconds) 16 | // - 17 | // Default: "5.0" 18 | sm_vmpAlertTimer "20.0" 19 | 20 | // At how many days left user should be notified 21 | // - 22 | // Default: "10" 23 | sm_vmpAlertdays "3" 24 | 25 | // default vip flag and immunity to be used in add vip command 26 | // - 27 | // Default: "0:a" 28 | sm_vmpDefaultVIPFlag "0:a" 29 | 30 | // Enter the URL of Your panel 31 | // - 32 | // Default: "vmpanel.example" 33 | sm_vmpPanelURL "vmpanel.example" 34 | 35 | // PLEASE READ !, Enter Name for the table of current server , a table in vmpanel db will be created with this name automatically, make sure to give a unique name(name should not match with any other server connected in vmpanel) 36 | // - 37 | // Default: "sv_table" 38 | sm_vmpServerTable "delhiRetake" 39 | 40 | 41 | -------------------------------------------------------------------------------- /Server_Plugin/readme.md: -------------------------------------------------------------------------------- 1 | # Setup Instructions 2 | - add a name for the server table inside plugin cfg located in cfg folder (make it unique as plugin will add a table with same name in db, consider naming it once carefull as changing it will result server using a new table with the new name mentioned in cfg ) 3 | - Add the addon and cfg folder into your csgo folder 4 | - Add an entry in your database.cfg named "vmpanel" and add the database cred of vmpanel 5 | ``` 6 | "vmpanel" 7 | { 8 | "driver" "mysql" 9 | "host" "hostname_here" 10 | "database" "database_name_here" 11 | "user" "username_name_here" 12 | "pass" "password_name_here" 13 | //"timeout" "0" 14 | //"port" "0" // only change if using custom port 15 | } 16 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-hacker --------------------------------------------------------------------------------