This application intended for manage(get, adding, removing) ikev2 vpn users using api routes. This application only manage users, you need to install vpn server apart.
Adding new users by api routes, revoke existing users.
For existing users you can download connection certificates/configurations using api. Configurations available for:
- Ios/MacOs
- Strogngswann app Certificates available for all platforms.
Description of all api routes you can find in swagger on route /swagger. NOTICE swagger available only inn dev mode.
You can do it using this instruction:
Clone this repository to your server, install all dependencies using npm i
Database need for collecting info about users. Install database on your server using default instructions for installation. Create new user and save credentials, it needed in next steps.
Connect to postgre and create new database named vpn
Firstly you need to create .env in application directory. File example:
PORT=3000
API_SECRET="A1B2C3D4"
DB_USER="user"
DB_PASSWORD="password"
CERTIFITES_DIRECTORY="/root"
DEV="true"
HOSTNAME="localhost"
PORT - application port
API_SECRET - generate your own secret, it will be used for make api requests. Save it in safe place, its token cricital for safety reasons.
DB_USER - database username
DB_PASSWORD - database user password
CERTIFITES_DIRECTORY - directory, where vpn server save certificates/configs. Change it on directory, where your vpn server save certs. By default it will be your root user directory
DEV - enable/disable dev mode
HOSTNAME - name or ip of your server. Used for setup swagger route.
After creating .env file you need to create folders structure for certificates. Create folder such as on scheme, in project directory
├── certificates
│ ├── common
│ ├── ios
│ ├── strongswan
├── {Another project files}
└── readme.md
In next step, you need initialize database. Copy created early .env file in ini folder and run fillDb.js script. After compliting script, you can launch this application using node.