Lzo adaptive option no longer possible?

After input command in mongosh:
db.servers.updateOne({“name” : “mtSrv”}, {$set: { “lzo_compression” : “adaptive”}})
and reboot server in config file tmp/pritunl no parametr with lzo-comp.

Next commands working:
db.servers.updateOne({“name” : “mtSrv”}, {$set: { “lzo_compression” : true}})
db.servers.updateOne({“name” : “mtSrv”}, {$set: { “lzo_compression” : false}})

Im need type “adaptive” for working VPN client on Mikrotik router.

Setting it to adaptive will leave the option blank in the server configuration pritunl/server/instance.py.

With an enterprise subscription a plugin can be added with the server_config function to change the option.

The code can also be modified at /usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/server/instance.py then run sudo systemctl restart pritunl.

1 Like

This was done. But I encountered the following problem: in the web interface it is no longer possible to save changes to server settings. This happens after the command:
db.servers.updateOne({“name” : “mtSrv”}, {$set: { “lzo_compression” : “adaptive”}})

Screen bottom i try change name server and press ‘Save’:

Change to True or False do working again.

PS: MongoDB 7.0, Pritunl v1.32.3805.95 19334b

That option was removed and the type filtering that was added in the pritunl-web process will only accept a boolean when saving from the web console. The only way to change it would be to modify the code.

Couldn’t find filtering and rewrite it. But I did it differently:

if not self.server.lzo_compression: and self.server.name == 'mtSrv':
    pass

Now, by turning off LZO via mongosh and having a specific server name, we will get a fully working option for connecting Mikrotik routers and a working web interface for server settings.

For Mikrotik v7 you need to change Pritunl server transport protocol from UDP to TCP only.

I apologize. We need to change transport protocol from to TCP and modify the code:

    #if self.server.lzo_compression == ADAPTIVE:
    if self.server.name == 'your-server-name':
        pass
    elif self.server.lzo_compression:
        server_conf += 'comp-lzo yes\npush "comp-lzo yes"\n'
    else:
        server_conf += 'ignore-unknown-option allow-compression\n'
        server_conf += 'allow-compression no\n'
        server_conf += 'comp-lzo no\npush "comp-lzo no"\n'

Because the connection is not stable and error occurred on Pritunl side: “Bad compression stub decompression header byte: xx“

In the code, we commented out the condition lzo_compression == ADAPTIVE and created a new condition that checks the name of your server on which you want to disable writing the comp-lzo configuration in parameters.