Giter VIP home page Giter VIP logo

vscode-netscaler's Introduction

Syntax highlighting and snippets for Citrix ADC/NetScaler configuration (ns.conf) files in Visual Studio Code.

Features

  • Syntax highlighting for ns.conf files and CLI commands
  • Snippets for common CLI commands such as creating and binding objects to vServers; tab-completion is available for various parameters

example

Installation

You can install this extension by following the steps in the Visual Studio Code documentation. In the Extensions pane, search for netscaler and install it there. You will get notified automatically about any future extension updates.

This extension is published on the Visual Studio Marketplace.

Enable support for auto-complete in snippets (optional)

By default Visual Studio Code will prevent auto-complete/quick suggestions for the values that you enter into the snippet arguments e.g. a vServer or Service Group name. To enable auto-completion, add the following line to your Visual Studio Code settings.json file:

"editor.suggest.snippetsPreventQuickSuggestions": false

Snippets

The following snippets provide shortcuts to common commands as well as scaffolding configuration based on Citrix Tech Zone recommendations.

Base configuration

  • apply base config: Apply Base Configuration Settings to a Citrix ADC, see more information

Basic

  • add server: Add Server
  • add service: Add Service
  • add servicegroup: Add Service Group
  • bind servicegroup MONITOR: Bind Service Group to Monitor
  • bind servicegroup SERVER: Bind Service Group to Server

Content Switching

  • add cs action: Add Content Switching Action
  • add cs policy: Add Content Switching Policy
  • add cs vserver: Add Content Switching vServer
  • bind cs vserver POLICY: Bind Content Switching vServer to Content Switching Policy

Load Balancing

  • add lb monitor HTTP-ECV: Add Load Balancing Monitor of type HTTP-ECV
  • add lb monitor TCP-ECV: Add Load Balancing Monitor of type TCP-ECV
  • add lb vserver: Add Load Balancing vServer
  • bind lb vserver POLICY: Bind Load Balancing vServer to Policy
  • bind lb vserver SERVICE GROUP: Bind Load Balancing vServer to Service Group

Networking

  • add ns acl: Add ACL
  • add ns ip SNIP: Add Subnet IP (SNIP)
  • add ns ip VIP: Add Virtual IP (VIP)

SSL

  • add ssl cipher, add ssl profile: Add SSL Cipher Group and SSL Profile based on SSL Labs A+ Q4 2021 recommendation, see more information
  • bind ssl vserver CERTIFICATE: Bind SSL vServer to Certificate
  • set ssl vserver PROFILE: Bind SSL vServer to SSL Profile

Reporting issues

If you experience any issues with the extension, please report them here.

Credits

License

Licensed under the Apache License, Version 2.0

© Tim Denholm

vscode-netscaler's People

Contributors

alphaskade avatar timdenholm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vscode-netscaler's Issues

AppFW denyURL pattern breaks strings

The standard line below breaks string formatting:
bind appfw profile -denyURL q{([ /=]|\t|\n)(ls|rm|cat)([ ;'"&].*)?$} -comment "Command injection attack" -state DISABLED

Syntax highlighting doesn't work as shown in demo gif

Hi,

  • Visual Studio Code 1.41.1
  • ns.conf 0.2.2

Highlighting doesn't work like your demo. For example:

  • "add", "bind", "SSL", "HTTP", "NEXT", "RESPONSE", "ENABLED" are successfully highlighted blue.
  • Anything in quotes ("xxxxxx") is successfully highlighted purple.
  • Numbers are successfully highlighted green-ish.
  • Comments are successfully highlighted green.

Anything else isn't. For example

  • "server", "service" or "servicegroup" are not highlighted.

the word "disable" is appearing coloured when it shouldn't be

when the word "disabled" appears anywhere as an argument or option to a command, it appears as coloured (instead of the normal text colour).

It SHOULD appear as a normal text colour.

Try out this command:
add rewrite policy rw_pol-res-disable-receiver-check "HTTP.REQ.HOSTNAME.SERVER.SET_TEXT_MODE(IGNORECASE).EQ(\"connect-dev.example\")" rw_at-res-disable-receiver-check

This is how it looks on my vscode:

Screenshot_49

Numeric strings are highlighted out of context

Numeric strings are highlighted when they shouldn't be, for example the following line will highlight the IP address in the policy name e.g. AUTH_POL_ALLOW_10.71.245.3_TCP_8080
add authorization policy AUTH_POL_ALLOW_10.71.245.3_TCP_8080 "REQ.IP.DESTIP == 10.71.245.3 && REQ.TCP.DESTPORT == 8080" ALLOW

Applies to all constant.numeric.netscaler patterns.

Missing commands

Describe the bug
Not sure which version the syntax here is based upon but a number of commands are missing, Unless your are only using syntax specific to configuration.

Expected behavior
I type shell and shell is highlighted

Screenshots
image

Additional context
Example of some are the 'Utility' commands found here

Color theme: Gruvbox Dark Medium

content inspection

Please add contentinspection as a keyword that is highlighted. Also, can something be done to make entire interfaces 0/1, 1/1, 10/1, LA/1, LR/1, LO/1, etc show up a single color instead of multiple?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.