25
2024
06
00:03:38

Ocserv web panel to manage users and Ocserv service in Ubuntu

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






ocserv-users-management

Web panel to manage ocserv and openconnect users

Requirements(Ubuntu 20.04 or Docker host)

Features:

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

Installation :

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

create extra admin user in terminal

*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

Admin panel configuration:

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.

Migrate accounts from old panel to new panel:

commands

1- --free-traffic: migrate users with free usage traffic

2- --old-path: Path to the old SQLite database

in os

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

in docker host:

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

developer mode

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




推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

本文链接:https://hqyman.cn/post/6780.html 非本站原创文章欢迎转载,原创文章需保留本站地址!

分享到:
打赏





休息一下~~


« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

请先 登录 再评论,若不是会员请先 注册

您的IP地址是: