From 50b4db172357e2612f93306d991c5eb57cd82f71 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Mon, 29 Jul 2024 14:28:03 +0700 Subject: [PATCH] update docs --- docs/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/index.html b/docs/index.html index 777780f8..6889f66a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -306,7 +306,7 @@ Error message and password prompt {"created":"20240712071211426","creator":"ibnux","title":"$:/state/tabs/controlpanel/toolbars-1345989671","text":"$:/core/ui/ControlPanel/Toolbars/PageControls","modified":"20240712071211426","modifier":"ibnux"}, {"title":"$:/status/RequireReloadDueToPluginChange","text":"no"}, {"created":"20240712071004482","creator":"i","title":"$:/status/UserName","text":"ibnux","modified":"20240712071005201","modifier":"ibnu"}, -{"title":"$:/StoryList","created":"20240715043644730","creator":"ibnux","text":"","list":"GettingStarted [[Additional Billing]] [[PPPOE System]] [[Hotspot System]] [[Internet Voucher]]","modified":"20240715064524082","modifier":"ibnux"}, +{"title":"$:/StoryList","text":"","list":"GettingStarted"}, {"created":"20240712071159691","creator":"ibnux","title":"$:/theme","text":"$:/themes/tiddlywiki/snowwhite","modified":"20240713151537740","modifier":"ibnux"}, {"title":"$:/themes/tiddlywiki/readonly","name":"ReadOnly","author":"JeremyRuston","core-version":">=5.0.0","plugin-type":"theme","description":"Hides the ability to edit tiddlers","dependents":"$:/themes/tiddlywiki/snowwhite","version":"5.3.5","type":"application/json","text":"{\"tiddlers\":{\"$:/themes/tiddlywiki/readonly/styles.tid\":{\"title\":\"$:/themes/tiddlywiki/readonly/styles.tid\",\"tags\":\"[[$:/tags/Stylesheet]]\",\"text\":\"\\\\define button-selector(title)\\nbutton.$title$, .tc-drop-down button.$title$, div.$title$\\n\\\\end\\n\\n\\\\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline\\n\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fclone>>,\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fdelete>>,\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fedit>>,\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fnew-here>>,\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fnew-journal-here>>,\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fimport>>,\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fmanager>>,\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fnew-image>>,\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fnew-journal>>,\\n\u003C\u003Cbutton-selector tc-btn-\\\\%24\\\\%3A\\\\%2Fcore\\\\%2Fui\\\\%2FButtons\\\\%2Fnew-tiddler>> {\\n\\tdisplay: none;\\n}\"}}}"}, {"title":"$:/themes/tiddlywiki/snowwhite","name":"Snow White","author":"JeremyRuston","core-version":">=5.0.0","plugin-type":"theme","description":"Emphasises individual tiddlers","dependents":"$:/themes/tiddlywiki/vanilla","plugin-priority":"0","version":"5.3.5","type":"application/json","text":"{\"tiddlers\":{\"$:/themes/tiddlywiki/snowwhite/base\":{\"title\":\"$:/themes/tiddlywiki/snowwhite/base\",\"tags\":\"[[$:/tags/Stylesheet]]\",\"text\":\"\\\\define sidebarbreakpoint-minus-one()\\n\u003C$text text={{{ [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}removesuffix[px]subtract[1]addsuffix[px]] ~[{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] }}}/>\\n\\\\end\\n\\n\\\\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline\\n\\n.tc-sidebar-header {\\n\\ttext-shadow: 0 1px 0 \u003C\u003Ccolour sidebar-foreground-shadow>>;\\n}\\n\\n.tc-tiddler-info {\\n\\t\u003C\u003Cbox-shadow \\\"inset 1px 2px 3px rgba(0,0,0,0.1)\\\">>\\n}\\n\\n@media screen {\\n\\t.tc-tiddler-frame {\\n\\t\\t\u003C\u003Cbox-shadow \\\"1px 1px 5px rgba(0, 0, 0, 0.3)\\\">>\\n\\t}\\n}\\n\\n@media (max-width: \u003C\u003Csidebarbreakpoint-minus-one>>) {\\n\\t.tc-tiddler-frame {\\n\\t\\t\u003C\u003Cbox-shadow none>>\\n\\t}\\n}\\n\\n.tc-page-controls button svg, .tc-tiddler-controls button svg, .tc-topbar button svg {\\n\\t\u003C\u003Ctransition \\\"fill 150ms ease-in-out\\\">>\\n}\\n\\n.tc-tiddler-controls button.tc-selected,\\n.tc-page-controls button.tc-selected {\\n\\t\u003C\u003Cfilter \\\"drop-shadow(0px -1px 2px rgba(0,0,0,0.25))\\\">>\\n}\\n\\n.tc-tiddler-frame input.tc-edit-texteditor,\\n.tc-tiddler-frame select.tc-edit-texteditor {\\n\\t\u003C\u003Cbox-shadow \\\"inset 0 1px 8px rgba(0, 0, 0, 0.15)\\\">>\\n}\\n\\n.tc-edit-tags {\\n\\t\u003C\u003Cbox-shadow \\\"inset 0 1px 8px rgba(0, 0, 0, 0.15)\\\">>\\n}\\n\\n.tc-tiddler-frame .tc-edit-tags input.tc-edit-texteditor {\\n\\t\u003C\u003Cbox-shadow \\\"none\\\">>\\n\\tborder: none;\\n\\toutline: none;\\n}\\n\\ntextarea.tc-edit-texteditor {\\n\\tfont-family: {{$:/themes/tiddlywiki/vanilla/settings/editorfontfamily}};\\n}\\n\\ncanvas.tc-edit-bitmapeditor {\\n\\t\u003C\u003Cbox-shadow \\\"2px 2px 5px rgba(0, 0, 0, 0.5)\\\">>\\n}\\n\\n.tc-drop-down {\\n\\tborder-radius: 4px;\\n\\t\u003C\u003Cbox-shadow \\\"2px 2px 10px rgba(0, 0, 0, 0.5)\\\">>\\n}\\n\\n.tc-block-dropdown {\\n\\tborder-radius: 4px;\\n\\t\u003C\u003Cbox-shadow \\\"2px 2px 10px rgba(0, 0, 0, 0.5)\\\">>\\n}\\n\\n.tc-modal {\\n\\tborder-radius: 6px;\\n\\t\u003C\u003Cbox-shadow \\\"0 3px 7px rgba(0,0,0,0.3)\\\">>\\n}\\n\\n.tc-modal-footer {\\n\\tborder-radius: 0 0 6px 6px;\\n\\t\u003C\u003Cbox-shadow \\\"inset 0 1px 0 #fff\\\">>;\\n}\\n\\n\\n.tc-alert {\\n\\tborder-radius: 6px;\\n\\t\u003C\u003Cbox-shadow \\\"0 3px 7px rgba(0,0,0,0.6)\\\">>\\n}\\n\\n.tc-notification {\\n\\tborder-radius: 6px;\\n\\t\u003C\u003Cbox-shadow \\\"0 3px 7px rgba(0,0,0,0.3)\\\">>\\n\\ttext-shadow: 0 1px 0 rgba(255,255,255, 0.8);\\n}\\n\\n.tc-sidebar-lists .tc-tab-set .tc-tab-divider {\\n\\tborder-top: none;\\n\\theight: 1px;\\n\\t\u003C\u003Cbackground-linear-gradient \\\"left, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.0) 100%\\\">>\\n}\\n\\n.tc-more-sidebar > .tc-tab-set > .tc-tab-buttons > button {\\n\\t\u003C\u003Cbackground-linear-gradient \\\"left, rgba(0,0,0,0.01) 0%, rgba(0,0,0,0.1) 100%\\\">>\\n}\\n\\n.tc-more-sidebar > .tc-tab-set > .tc-tab-buttons > button.tc-tab-selected {\\n\\t\u003C\u003Cbackground-linear-gradient \\\"left, rgba(0,0,0,0.05) 0%, rgba(255,255,255,0.05) 100%\\\">>\\n}\\n\\n.tc-message-box img {\\n\\t\u003C\u003Cbox-shadow \\\"1px 1px 3px rgba(0,0,0,0.5)\\\">>\\n}\\n\\n.tc-plugin-info {\\n\\t\u003C\u003Cbox-shadow \\\"1px 1px 3px rgba(0,0,0,0.5)\\\">>\\n}\\n\"}}}"}, @@ -320,7 +320,7 @@ Error message and password prompt {"created":"20240712104547248","creator":"ibnux","text":"Bandwidth is to limit your customers internet speed. you need to specify Bandwidth limit for every internet plan. 1 Bandwidth Plan can be used for multiple Internet Plan.\n\nNow [ext[Create Bandwidth Plan|../?_route=bandwidth/list]].\n\n''Upload'' and ''Download'' Limit is required.\n\nBurst is Optional, you need to understand how burst works, you can search for Burst Calculator in the Internet, or in the [[Mikrotik Page|https://help.mikrotik.com/docs/display/ROS/Queue+Burst]].\n\nNext\n\n\u003Cbutton>[[Create Hotspot Plan]]\u003C/button>\n\u003Cbutton>[[Create PPPOE Plan]]\u003C/button>\n","title":"Create Bandwidth Plan","modified":"20240713061927065","modifier":"ibnux"}, {"created":"20240712105508771","creator":"ibnux","text":"Hotspot Plan is the Internet Plan you sell to customer.\n\n* ''Status'' is where you can enable or disable Internet Plan, Admin can activate the Internet Plan, but Customer cannot buy it, it will not show in the order page Customer, Customer can recharge it.\n* ''Type'' is to set is Prepaid Plan or Postpaid Plan. if it PostPaid, it will only have Period Validity and fix expired date.\n* ''Plan Type '' is to set wether Internet Plan for Personal Customer or Business Customer\n* ''Radius'' is this Plan for radius system then check it\n* ''Device'' is the logic how PHPNuxBill Talk to Mikrotik or Radius or other Device. Choose wisely, Hotspot plan choose the Hotspot Device, or Radius if it Radius Plan.\n\n** ''Dummy'' will not do anything, some user just need PHPNuxBill just for tracking sales.\n** ''MikrotikHotspot'' for Hotspot Plan\n** ''MikrotikPppoe'' for PPPOE Plan\n** ''Radius'' for [[Radius System with Mysql]]\n** ''RadiusRest'' for [[Integrated Radius System]]\n\n* ''Plan Type'' you can choose how you limit your customer, is Unlimited, or Data Limited or Time Limited or Data and Time Limited.\n\u003C\u003C\u003C\nFor Time Limited, your Plan Validity need more bigger dan Time Limit\n\nIf Time Limit 6 Hours and Plan Validity 1 Day, in 1 day customer only can use internet for 6 Hours, after 1 day it will expired even if customer only use 1 Hour, but if customer use all 6 hours, Mikrotik will decline login as it has reach limit, but PHPNuxBill will expired it after 1 day.\n\nThis 1 day count after activation, or first login for [[Integrated Radius System]]\n\u003C\u003C\u003C\n\n\u003C\u003C\u003C\nFor Data Limit is quota based Internet\n\u003C\u003C\u003C\n\n* ''Bandwidth Name'' is your Bandwidth Plan for Internet Plan\n* ''Shared Users'' 1 account can be used for how many devices can be online\n* ''Plan Validity'' How long Plan will be expired?\n* ''Router Name'' if it not Radius, you must select which Mikrotik will have this Hotspot Plan\n\nAfter you save it, you can customize another options\n\n* ''Expired Internet Plan'', if customer plan expired, it will move to this plan, you need to create Expired plan first, and the expired plan set expired plan to expired plan too. //''Default''// just remove the customer from Mikrotik.\n* ''on-login / on-up'' is helper to add custome script to Mikrotik\n* ''on-logout / on-down'' is helper to add custome script to Mikrotik\n\n\u003Cbutton>[[Back|Hotspot System]]\u003C/button>","title":"Create Hotspot Plan","modified":"20240715042745349","modifier":"ibnux"}, {"created":"20240715042750725","creator":"ibnux","text":"Hotspot Plan is the Internet Plan you sell to customer.\n\n* ''Status'' is where you can enable or disable Internet Plan, Admin can activate the Internet Plan, but Customer cannot buy it, it will not show in the order page Customer, Customer can recharge it.\n* ''Type'' is to set is Prepaid Plan or Postpaid Plan. if it PostPaid, it will only have Period Validity and fix expired date.\n* ''Plan Type '' is to set wether Internet Plan for Personal Customer or Business Customer\n* ''Radius'' is this Plan for radius system then check it\n* ''Device'' is the logic how PHPNuxBill Talk to Mikrotik or Radius or other Device. Choose wisely, Hotspot plan choose the Hotspot Device, or Radius if it Radius Plan.\n\n** ''Dummy'' will not do anything, some user just need PHPNuxBill just for tracking sales.\n** ''MikrotikHotspot'' for Hotspot Plan\n** ''MikrotikPppoe'' for PPPOE Plan\n** ''Radius'' for [[Radius System with Mysql]]\n** ''RadiusRest'' for [[Integrated Radius System]]\n* ''Bandwidth Name'' is your Bandwidth Plan for Internet Plan\n* ''Shared Users'' 1 account can be used for how many devices can be online\n* ''Plan Validity'' How long Plan will be expired?\n* ''Router Name'' if it not Radius, you must select which Mikrotik will have this Hotspot Plan\n* ''IP Pool'' is [ext[IP Pool|../?_route=pool/list]] you created before. \n\nAfter you save it, you can customize another options\n\n* ''Expired Internet Plan'', if customer plan expired, it will move to this plan, you need to create Expired plan first, and the expired plan set expired plan to expired plan too. //''Default''// just remove the customer from Mikrotik.\n* ''on-login / on-up'' is helper to add custome script to Mikrotik\n* ''on-logout / on-down'' is helper to add custome script to Mikrotik\n\n\u003Cbutton>[[Back|Hotspot System]]\u003C/button>","title":"Create PPPOE Plan","modified":"20240715043523134","modifier":"ibnux"}, -{"created":"20240712072200400","creator":"ibnux","text":"! ''Congratulations!!''\n\nNow you already install PHPNuxBill\n\nWhere to go now?\n\nConfigure The PHPNuxBill as you need, go to [ext[Settings|../index.php?_route=settings/app]], after that got to [ext[Localisation|../index.php?_route=settings/localisation]].\n\nAfter that, which one do you want to accomplish?\n\n\u003Cbutton>[[Hotspot System]]\u003C/button> ^^most user just need this^^\n\n\u003Cbutton>[[PPPOE System]]\u003C/button>\n\n\u003Cbutton>[[Radius System with Mysql]]\u003C/button> ^^Advanced^^\n\n\u003Cbutton>[[Integrated Radius System]]\u003C/button> ^^Easy^^\n\nAlthough all the system can run together, you need to setup one by one\n\nVoucher or Payment Gateway, just follow above tutorial, it will Guide you.\n\n\u003C\u003C\u003C\nIf you like PHPNuxBill, don't forget to [ext[donate|index.php?_route=community]] some of your profits to this project.\n\u003C\u003C\u003C\n\n!! Other Features\n\n* [[Additional Billing]]\n* [[Creating Theme|https://github.com/hotspotbilling/phpnuxbill/wiki/Themes]]\n","title":"GettingStarted","modified":"20240715065316054","modifier":"ibnux","tags":"","type":"text/vnd.tiddlywiki"}, +{"created":"20240712072200400","creator":"ibnux","text":"! ''Congratulations!!''\n\nNow you already install PHPNuxBill\n\nWhere to go now?\n\nConfigure The PHPNuxBill as you need, go to [ext[Settings|../index.php?_route=settings/app]], after that got to [ext[Localisation|../index.php?_route=settings/localisation]].\n\nAfter that, which one do you want to accomplish?\n\n*\u003Cbutton>[[Hotspot System]]\u003C/button> ^^most user just need this^^\n** Voucher system with or without Registration (''Activation'')\n** Payment Gateway only with Registration\n** Prepaid and or Postpaid system\n** 1 plan for 1 router \n\n* \u003Cbutton>[[PPPOE System]]\u003C/button>\n** Voucher system and or Payment Gateway\n** ''Only with Registration''\n** Prepaid and or Postpaid system\n** 1 plan for 1 router\n\n* \u003Cbutton>[[Radius System with Mysql]]\u003C/button> ^^Advanced^^\n** Hotspot and or PPPOE\n** Voucher system with or without Registration (Activation)\n** Payment Gateway only with Registration\n** Prepaid and or Postpaid system\n** PPPOE only with Registration\n** ''1 Plan for Multiple Router''\n\n* \u003Cbutton>[[Integrated Radius System]]\u003C/button> ^^Easy^^\n** Hotspot and or PPPOE\n** Voucher system with or without Registration\u003Cbr>(Activation or ''Direct voucher login'')\n** Payment Gateway only with Registration\n** Prepaid and or Postpaid system\n** PPPOE only with Registration\n** 1 Plan for Multiple Router\n\nAlthough all the system can run together, you need to setup one by one\n\nVoucher or Payment Gateway, just follow above tutorial, it will Guide you.\n\n\u003C\u003C\u003C\nIf you like PHPNuxBill, don't forget to [ext[donate|index.php?_route=community]] some of your profits to this project.\n\u003C\u003C\u003C\n\n!! Other Features\n\n* [[Additional Billing]]\n* [[Creating Theme|https://github.com/hotspotbilling/phpnuxbill/wiki/Themes]]\n\n!! Mikrotik Template\n\n* [[Simple Template|https://github.com/hotspotbilling/phpnuxbill-mikrotik-login-template/]]\n* [[Redirect Directly to PHPNuxBill|https://github.com/agstrxyz/phpnuxbill-login-hotspot]]\n","title":"GettingStarted","modified":"20240729072718586","modifier":"ibnux","tags":"","type":"text/vnd.tiddlywiki"}, {"created":"20240712084946106","creator":"ibnux","text":"!Step to create Hotspot Plan\n\nHotspot System based on the Mikrotik Feature inside `IP > Hotspot`, You need to configure it first.\n\n\n!! For [[Radius System with Mysql]]\n \n# [[Add NAS]]\n# [[Create Bandwidth Plan]]\n# [[Create Hotspot Plan]]\n\n!! For [[Integrated Radius System]]\n\n# [[Create Bandwidth Plan]]\n# [[Create Hotspot Plan]]\n\n!! Without Radius\n\n# [[Add Mikrotik]]\n# [[Create Bandwidth Plan]]\n# [[Create Hotspot Plan]]\n\nAfter That, how do you want to sell Internet Plan?\n\n* Customer self services buy internet using Payment Gateway\n* Customer Buy Voucher and activate it at PHPNuxBill\n\nWhich one do you want?\n\n\u003Cbutton>[[Payment Gateway]]\u003C/button> \u003Cbutton>[[Internet Voucher]]\u003C/button>\n","title":"Hotspot System","modified":"20240714053827041","modifier":"ibnux"}, {"created":"20240712080714532","creator":"ibnux","text":"Radius System is complicated, But with [[REST API|https://www.google.com/search?q=REST+API]] is Easy enough.\n\nFreeradius REST API is configuration to make Freeradius talk to PHPNuxBill via HTTP Connection, configuration is more simple.\n\nWith Freeradius REST, it will use current PHPNuxBill Core, and you don't need IP Public for Mikrotik, but still need static IP, as the IP need to be registered to clients.conf, or [[allow all IP|https://serverfault.com/questions/114780/is-there-a-way-to-allow-all-external-ip-connections-in-freeradius]], but be careful.\n\n\u003C\u003C\u003C\nFor now is only support PAP Authentication, i am still working with CHAP\n\u003C\u003C\u003C\n\n\u003C\u003C\u003C\nPassword can be sniffed when login to Mikrotik if using PAP\n\u003C\u003C\u003C\n\n```\n \n ┌──────────────┐\n │ PHPNUXBILL │\n └──────────────┘\n ▲ \n │ \n ▼ \n ┌──────────────┐\n │ Freeradius │\n └──────────────┘\n ▲ \n │ \n ▼ \n ┌──────────┐ \n │ Mikrotik │ \n └──────────┘ \n```\n\n!! Installing freeradius\n\nThis Tutorial tested in Ubuntu 20.04 and 22.04\n\n`apt-get -y install freeradius freeradius-rest`\n\nedit clients.conf\n\n`nano /etc/freeradius/3.0/clients.conf`\n\nAdd your Mikrotik IP or your Public IP, this is example\n\n\u003C\u003C\u003C\neverytime you add/edit Client, restart freeradius\n\u003C\u003C\u003C\n\n```\nclient myRouterA {\n\tipaddr\t\t= 10.0.1.0/24\n\tsecret\t\t= verysecret\n}\n\nclient myRouterB {\n\tipaddr\t\t= 10.0.2.0/24\n\tsecret\t\t= secretvery\n}\n```\n\nor allow all IP\n\n```\n# All IPv4\nclient 0.0.0.0/0 {\n secret = verysecret\n}\n# All IPv6\nclient ::/0 {\n secret = secretvery\n}\n```\n\nCreate rest Configuration\n\n`nano /etc/freeradius/3.0/mods-enabled/rest`\n\nuse this configuration, change phpnuxbill.domain with your domain\n\n```\nrest {\n tls {\n # ca_file = ${certdir}/ca.pem\n\t\t# ca_info_file = ${certdir}/cacert_bundle.pem\n\t\t# ca_path = ${certdir}\n check_cert = no\n check_cert_cn = no\n }\n\tconnect_uri = \"https://phpnuxbill.domain/radius.php\"\n\n\tauthenticate {\n\t\turi = \"${..connect_uri}?action=authenticate\"\n method = 'post'\n body = 'post'\n data = \"username=%{urlquote:%{User-Name}}&password=%{urlquote:%{User-Password}}&CHAPchallenge=%{urlquote:%{CHAP-Challenge}}&CHAPassword=%{urlquote:%{CHAP-Password}}&realm=%{urlquote:%{Mikrotik-Realm}}&macAddr=%{urlquote:%{Calling-Station-Id}}&nasip=%{urlquote:%{NAS-IP-Address}}\"\n\t\ttls = ${..tls}\n\t}\n\n authorize {\n uri = \"${..connect_uri}?action=authorize\"\n method = 'post'\n body = 'post'\n data = \"username=%{urlquote:%{User-Name}}&password=%{urlquote:%{User-Password}}&CHAPchallenge=%{urlquote:%{CHAP-Challenge}}&CHAPassword=%{urlquote:%{CHAP-Password}}&realm=%{urlquote:%{Mikrotik-Realm}}&macAddr=%{urlquote:%{Calling-Station-Id}}&nasip=%{urlquote:%{NAS-IP-Address}}\"\n\t\ttls = ${..tls}\n }\n\n\taccounting {\n\t\turi = \"${..connect_uri}?action=accounting\"\n\t\tmethod = 'post'\n\t\tbody = 'post'\n data = \"username=%{urlquote:%{User-Name}}&nasIpAddress=%{urlquote:%{NAS-IP-Address}}&realm=%{urlquote:%{Mikrotik-Realm}}&nasid=%{urlquote:%{NAS-Identifier}}\\\n&acctSessionId=%{urlquote:%{Acct-Session-Id}}&macAddr=%{urlquote:%{Calling-Station-Id}}&acctSessionTime=%{urlquote:%{Acct-Session-Time}}\\\n&acctInputOctets=%{urlquote:%{Acct-Input-Octets}}&acctOutputOctets=%{urlquote:%{Acct-Output-Octets}}\\\n&acctInputGigawords=%{urlquote:%{Acct-Input-Gigawords}}&acctOutputGigawords=%{urlquote:%{Acct-Output-Gigawords}}\\\n&acctInputPackets=%{urlquote:%{Acct-Input-Packets}}&acctOutputPackets=%{urlquote:%{Acct-Output-Packets}}\\\n&nasPortId=%{urlquote:%{NAS-Port-Id}}&framedIPAddress=%{urlquote:%{Framed-IP-Address}}\\\n&sessionTimeout=%{urlquote:%{Session-Timeout}}&framedIPNetmask=%{urlquote:%{Framed-IP-Netmask}}\\\n&acctStatusType=%{urlquote:%{Acct-Status-Type}}&nasPortType=%{urlquote:%{NAS-Port-Type}}\"\n\t\ttls = ${..tls}\n\t}\n\n post-auth {\n uri = \"${..connect_uri}?action=post-auth\"\n method = 'post'\n body = 'post'\n data = \"username=%{urlquote:%{User-Name}}\"\n\t\ttls = ${..tls}\n }\n\n\tpool {\n\t\tstart = ${thread[pool].start_servers}\n\t\tmin = ${thread[pool].min_spare_servers}\n\t\tmax = ${thread[pool].max_servers}\n\t\tspare = ${thread[pool].max_spare_servers}\n\t\tuses = 0\n\t\tretry_delay = 30\n\t\tlifetime = 0\n\t\tidle_timeout = 60\n\t}\n}\n```\n\nedit sites\n\n`nano /etc/freeradius/3.0/sites-enabled/default `\n\nConfigure just like this, don't delete others\n\n```\nauthorize {\n# filter_username\n#\tfilter_password\n#\tpreprocess\n#\toperator-name\n#\tcui\n#\tauth_log\n\trest\n if (ok) {\n update control {\n Auth-Type := rest\n }\n }\n\n ....\n}\n\nauthenticate {\n Auth-Type rest {\n rest {\n updated = 1\n }\n if (updated) {\n ok\n }\n }\n\tAuth-Type rest {\n\t\trest\n\t}\n\n ....\n}\n\naccounting {\n\tdetail\n\trest\n\n ....\n}\n\nsession {\n\tradutmp\n \n ....\n}\n\npost-auth {\n\tif (reply:Group-Name) {\n update control {\n &Group := \"%{reply:Group-Name}\"\n }\n }\n if (reply:Mikrotik-Rate-Limit) {\n update reply {\n Mikrotik-Rate-Limit := \"%{reply:Mikrotik-Rate-Limit}\"\n }\n }\n if (reply:Expiration) {\n update reply {\n Expiration := \"%{reply:Expiration}\"\n }\n }\n\tupdate {\n\t\t&reply: += &session-state:\n\t}\n}\n```\n\nrestart services\n\n`systemctl restart freeradius.service`\n\n!! DEBUG\n\nTo check if someting wrong, stop freeradius\n\n`systemctl stop freeradius.service`\n\nActivate log in Mikrotik\n\n`/system logging add topics=radius,debug action=memory`\n\nrun radius just like this\n\n`freeradius -X`\n\nthen try to login\n\n!! Next\n\nGo to [ext[Settings|../index.php?_route=settings/app]] and Enable Radius.\n\nYou want to sell Hotspot or PPPOE?\n\n * [[Hotspot System]]\n * [[PPPOE System]]\n","title":"Integrated Radius System","modified":"20240713053828920","modifier":"ibnux","tags":"[[radius rest]]"}, {"created":"20240714052949493","creator":"ibnux","text":"There's 3 Voucher version\n\n!! With customer registration\n\nPHPNuxBill Voucher is to activate internet plan for an account.\n\nCustomer must register, then buy Voucher from some place you sell, then activate the voucher. \n\n[ext[Create Voucher|../?_route=plan/voucher]] based your already created Plan.\n\n!! Without Registration\n\nIs not actually without registration, it will register only username, and the voucher will be password, From Hotspot Login, customer need to redirect to PHPNuxBill, then activate the voucher, then they can login for Internet.\n\n# Go to [ext[Settings|../?_route=settings/app]]\n# Disable Registration at Voucher Settings\n# [ext[Create Voucher|../?_route=plan/voucher]] based your already created Plan.\n\n\n!! Voucher direct login\n\nFor Voucher directly login from Mikrotik Hotspot Login without activation, you need to use [[Integrated Radius System]], customer no need to activate voucher, as long username same as password it will detected as Voucher, automatically activate the voucher\n\nJust [ext[Create Voucher|../?_route=plan/voucher]] based your already created Plan. This will run together with PHPNuxBill Customer system, you can sell voucher directly, with or without Registration system.\n\nOnly Plan with Radius selected as Router will be activated as Voucher.\n","title":"Internet Voucher","modified":"20240715063639438","modifier":"ibnux"},