1<?php
2/*************************************************************************************
3 * sshconfig.php
4 * --------
5 * Author: Kevin Ernst (kevin.ernst -at- cchmc.org)
6 * Copyright: (c) 2017 Kevin Ernst
7 * Release Version: 1.0.9.1
8 * Date Started: 2017/12/01
9 *
10 * OpenSSH config file (~/.ssh/config) language file for GeSHi.
11 *
12 * CHANGES
13 * -------
14 * 2017/12/02 (1.0.0)
15 *   -  First release; couldn't figure out how to separately highlight negated
16 *      hostnames/wildcards, but it's good enough for a basic ~/.ssh/config
17 *
18 *************************************************************************************
19 *
20 *     This file is part of GeSHi.
21 *
22 *   GeSHi is free software; you can redistribute it and/or modify
23 *   it under the terms of the GNU General Public License as published by
24 *   the Free Software Foundation; either version 2 of the License, or
25 *   (at your option) any later version.
26 *
27 *   GeSHi is distributed in the hope that it will be useful,
28 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
29 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30 *   GNU General Public License for more details.
31 *
32 *   You should have received a copy of the GNU General Public License
33 *   along with GeSHi; if not, write to the Free Software
34 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
35 *
36 ************************************************************************************/
37
38$language_data = array (
39    'LANG_NAME' => 'sshconfig',
40    'COMMENT_SINGLE' => array(),
41    'COMMENT_MULTI' => array(),
42    'COMMENT_REGEXP' => array(0 => '/^\s*#.*?$/m'),
43    'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
44    'QUOTEMARKS' => array('"'),
45    'ESCAPE_CHAR' => '',
46    'KEYWORDS' => array(
47        0 => array(
48            'Host',
49            ),
50        1 => array(
51            "Hostname", "Match", "AddKeysToAgent", "AddressFamily", "BatchMode",
52            "BindAddress", "CanonicalDomains", "CanonicalizeFallbackLocal",
53            "CanonicalizeHostname", "CanonicalizeMaxDots",
54            "CanonicalizePermittedCNAMEs", "CertificateFile",
55            "ChallengeResponseAuthentication", "CheckHostIP", "Ciphers",
56            "ClearAllForwardings", "Compression", "ConnectionAttempts",
57            "ConnectTimeout", "ControlMaster", "ControlPath", "ControlPersist",
58            "DynamicForward", "EnableSSHKeysign", "EscapeChar",
59            "ExitOnForwardFailure", "FingerprintHash", "ForwardAgent",
60            "ForwardX11", "ForwardX11Timeout", "ForwardX11Trusted",
61            "GatewayPorts", "GlobalKnownHostsFile", "GSSAPIAuthentication",
62            "GSSAPIDelegateCredentials", "HashKnownHosts",
63            "HostbasedAuthentication", "HostbasedKeyTypes", "HostKeyAlgorithms",
64            "HostKeyAlias", "HostName", "IdentitiesOnly", "IdentityAgent",
65            "IdentityFile", "IgnoreUnknown", "Include", "IPQoS",
66            "KbdInteractiveAuthentication", "KbdInteractiveDevices",
67            "KexAlgorithms", "LocalCommand", "LocalForward", "LogLevel", "MACs",
68            "NoHostAuthenticationForLocalhost", "NumberOfPasswordPrompts",
69            "PasswordAuthentication", "PermitLocalCommand", "PKCS11Provider",
70            "Port", "PreferredAuthentications", "ProxyCommand", "ProxyJump",
71            "ProxyUseFdpass", "PubkeyAcceptedKeyTypes", "PubkeyAuthentication",
72            "RekeyLimit", "RemoteCommand", "RemoteForward", "RequestTTY",
73            "RevokedHostKeys", "SendEnv", "ServerAliveCountMax",
74            "ServerAliveInterval", "StreamLocalBindMask",
75            "StreamLocalBindUnlink", "StrictHostKeyChecking", "SyslogFacility",
76            "TCPKeepAlive", "Tunnel", "TunnelDevice", "UpdateHostKeys",
77            "UsePrivilegedPort", "User", "UserKnownHostsFile",
78            "VerifyHostKeyDNS", "VisualHostKey", "XAuthLocation",
79            ),
80        ),
81    'SYMBOLS' => array(
82        0 => array(
83            '%h', '%p',
84            ),
85        // these get clobbered by regexes anyway
86        //1 => array( '!'),
87        //2 => array( '*')
88        ),
89    'CASE_SENSITIVE' => array(
90        GESHI_COMMENTS => false,
91        0 => true,
92        1 => true,
93        ),
94    'STYLES' => array(
95        'KEYWORDS' => array(
96            0 => 'color: green; font-weight: bold',
97            1 => 'color: blue',
98            ),
99        'COMMENTS' => array(
100            0 => 'color: #666666; font-style: italic;'
101            ),
102        'ESCAPE_CHAR' => array(
103            0 => ''
104            ),
105        'BRACKETS' => array(
106            0 => ''
107            ),
108        'STRINGS' => array(
109            0 => 'color: #933;'
110            ),
111        'NUMBERS' => array(
112            0 => ''
113            ),
114        'METHODS' => array(
115            0 => ''
116            ),
117        'SYMBOLS' => array(
118            0 => 'color: lightseagreen; font-weight: bold',
119            // these two get clobbered by regexes below anyway
120            1 => 'color: red; font-weight: bold',
121            1 => 'color: darkmagenta; font-weight: bold',
122            ),
123        'REGEXPS' => array(
124            0 => 'color: darkmagenta;',
125            //1 => 'color: red; font-weight: bold',
126            2 => 'color: magenta; font-weight: bold',
127            ),
128        'SCRIPT' => array(
129            0 => ''
130            )
131        ),
132    'URLS' => array(
133        0=> 'https://man.openbsd.org/ssh_config#{FNAME}',
134        1=> 'https://man.openbsd.org/ssh_config#{FNAME}',
135        ),
136    'OOLANG' => false,
137    'OBJECT_SPLITTERS' => array(
138        ),
139    'REGEXPS' => array(
140        // Hostnames
141        0 => array(
142            GESHI_SEARCH => '(Host(name)?.*?)(?<=\s)(.*)',
143            GESHI_REPLACE => '\\3',
144            GESHI_MODIFIERS => '',
145            GESHI_BEFORE => '\\1',
146            GESHI_AFTER => ''
147            ),
148        // Negated hostanmes (doesn't work)
149        //1 => array(
150        //    GESHI_SEARCH => '([([{,<+*-\/=\s!]|&lt;)(?!(?:PIPE|SEMI|DOT|NUM|REG3XP\d*)\W)(![a-zA-Z*]\w*)(?!\w)',
151        //    GESHI_SEARCH => '(?<=!)(.*?)',
152        //    GESH_REPLACE => '\\2',
153        //    GESHI_MODIFIERS => '',
154        //    GESHI_BEFORE => '\\1',
155        //    GESHI_AFTER => ''
156        //    ),
157        // Wildcards
158        2 => '\*'
159        ),
160    'STRICT_MODE_APPLIES' => GESHI_NEVER,
161    'SCRIPT_DELIMITERS' => array(
162        ),
163    'HIGHLIGHT_STRICT_BLOCK' => array(
164        )
165);
166