Ocserv installation script with config and web panel to manage users and Ocserv service in Ubuntu distribution . Ubuntu 20.04 tested.
https://github.com/topics/ocserv
1- create an account with a limit of gigabytes or monthly usage
2- users: add, edit, update, remove, block and disconnect
3- group: add, edit, update and remove
4- occtl command tools
5- statistics
6- Calculation of users' rx and tx
Choose Your Installation Method:
1- Use install.sh script
>>> chmod +x install.sh
>>> ./install.sh
2- Installing panel without script
>>> chmod +x ./configs/panel.sh
>>> HOST=http://YOUR_DOMAIN_OR_IP ./configs/panel.sh
3- Docker host
>>> touch prod.env
>>> cat << EOF >> prod.envORG=End-wayEXPIRE=3650CN=End-way-Cisco-VPNOC_NET=172.16.24.0/24# change it to your ip or domainCORS_ALLOWED=http://HOST_IP_OR_DOMAIN,https://HOST_IP_OR_DOMAIN# change it to your ip or domainHOST=HOST_IP_OR_DOMAINDOMAIN=PORT=20443EOF>>> DOCKER_SCAN_SUGGEST=false docker-compose up -d --build
4- frontend developing
>>> docker compose -f docker-compose.dev.yml up --build
*docker mode -- in container
python3 /app/manage.py createadmin -u USERNAME -p PASSWORD
*systemd
/var/www/site/back-end/venv/bin/python3 /var/www/site/back-end/manage.py createadmin -u USERNAME -p PASSWORD
1- Launch your web browser.
2- Navigate to http://YOUR-DOMAIN-OR-IP in the address bar.
3- Configure the administrative settings as needed and proceed with the setup.
1- --free-traffic: migrate users with free usage traffic
2- --old-path: Path to the old SQLite database
1- rename /tmp/db.sqlite3 to /tmp/
>>> mv /tmp/db.sqlite3 /tmp/db-old.sqlite3
2- run script to migrate users
>>> /var/www/site/back-end/venv/bin/python3 manage.py migrate_to_new --old-path /tmp/db-old.sqlite3
1- rename db.sqlite3 to db-old.sqlite3
>>> mv db.sqlite3 db-old.sqlite3
2- copy db-old.sqlite3 to volumes/db
>>> cp db-old.sqlite3 volumes/db
3- run command in docker container
>>> python3 /app/manage.py migrate_to_new --old-path /app/db/db-old.sqlite3
1- create dev.env file
>>> touch dev.env
2- copy to dev.env
>>> cat << EOF >> dev.envDEBUG=TrueORG=End-wayEXPIRE=3650CN=End-way-Cisco-VPNOC_NET=172.16.24.0/24# change it to your ip or domainCORS_ALLOWED=http://127.0.0.1:9000# change it to your ip or domainHOST=127.0.0.1DOMAIN=PORT=20443EOF
3- run backend service
>>> docker compose -f docker-compose.dev.yml up -d --build
4- run frontend service
>>> cd front-end
>>> npm install && npm run serve
5- swagger documents api
Navigate to http://127.0.0.1:8000/doc/ in the address bar.
https://github.com/mmtaee/ocserv-users-management
推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:https://hqyman.cn/post/6780.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
休息一下~~