Skip to content
Snippets Groups Projects
Select Git revision
  • 49aa2a3d692482c9191c69e3c27e99c718e6f500
  • experimental default protected
  • v2023.2.5-ffs
  • nrb/ex400-remove-wps
  • nrb/airmax-test
  • v2023.2.4-ffs
  • nrb/ar9344-reset-sequence
  • autinerd/experimental-openwrt-24.10
  • v2023.2.3-ffs
  • v2023.2.2-ffs
  • v2023.2-ffs
  • v2023.1-ffs
  • v2022.1.4-ffs
  • feature/addMikrotikwAP
  • v2022.1.3-ffs
  • v2021.1.2-ffs
  • v2022.1.1-ffs
  • master protected
  • v2021.1.1-ffs
  • nrb/gluon-master-cpe510
  • v2021.1-ffs
  • experimental-2025-08-26
  • experimental-2025-08-26-base
  • experimental-2025-08-25
  • experimental-2025-08-25-base
  • experimental-2025-08-20
  • experimental-2025-08-20-base
  • experimental-2025-08-13
  • experimental-2025-08-13-base
  • experimental-2025-08-04
  • experimental-2025-08-04-base
  • experimental-2025-07-31
  • experimental-2025-07-31-base
  • experimental-2025-07-29
  • experimental-2025-07-29-base
  • experimental-2025-07-28
  • experimental-2025-07-28-base
  • experimental-2025-07-26
  • experimental-2025-07-26-base
  • experimental-2025-07-24
  • experimental-2025-07-24-base
41 results

0100-mesh-vpn.lua

Blame
  • user avatar
    David Bauer authored
    This fully abstracts VPN methods, making gluon-mesh-vpn-fastd and
    gluon-mesh-vpn-tunneldigger completely self-contained.
    
    Provide a LUA interface for generic interacting with VPN methods in
    gluon-mesh-vpn-core and web packages.
    
    This also adds the ability to install tunneldigger and fastd to the same
    image, selecting the VPN method based on the selected domain.
    
    Signed-off-by: default avatarDavid Bauer <mail@david-bauer.net>
    98a1c196
    History
    0100-mesh-vpn.lua 898 B
    local site_i18n = i18n 'gluon-site'
    
    local uci = require("simple-uci").cursor()
    
    local platform = require 'gluon.platform'
    local site = require 'gluon.site'
    local sysconfig = require 'gluon.sysconfig'
    local vpn = require 'gluon.mesh-vpn'
    
    local pretty_hostname = require 'pretty_hostname'
    
    local hostname = pretty_hostname.get(uci)
    local contact = uci:get_first("gluon-node-info", "owner", "contact")
    
    local pubkey
    local msg
    
    
    if vpn.enabled() then
    	local _, active_vpn = vpn.get_active_provider()
    
    	if active_vpn ~= nil then
    		pubkey = active_vpn.public_key()
    	end
    
    	if pubkey ~= nil then
    		msg = site_i18n._translate('gluon-config-mode:pubkey')
    	end
    else
    	msg = site_i18n._translate('gluon-config-mode:novpn')
    end
    
    if not msg then return end
    
    renderer.render_string(msg, {
    	pubkey = pubkey,
    	hostname = hostname,
    	site = site,
    	platform = platform,
    	sysconfig = sysconfig,
    	contact = contact,
    })