Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added HAProxy configuration language #4303

Merged
merged 5 commits into from
Nov 7, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@
[submodule "vendor/grammars/atom-language-clean"]
path = vendor/grammars/atom-language-clean
url = https://github.com/timjs/atom-language-clean.git
[submodule "vendor/grammars/atom-language-haproxy"]
path = vendor/grammars/atom-language-haproxy
url = https://github.com/abulimov/atom-language-haproxy
[submodule "vendor/grammars/atom-language-julia"]
path = vendor/grammars/atom-language-julia
url = https://github.com/JuliaEditorSupport/atom-language-julia
Expand Down
2 changes: 2 additions & 0 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ vendor/grammars/atom-language-1c-bsl:
vendor/grammars/atom-language-clean:
- source.clean
- text.restructuredtext.clean
vendor/grammars/atom-language-haproxy:
- source.haproxy-config
vendor/grammars/atom-language-julia:
- source.julia
- source.julia.console
Expand Down
10 changes: 10 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1758,6 +1758,16 @@ Groovy Server Pages:
codemirror_mode: htmlembedded
codemirror_mime_type: application/x-jsp
language_id: 143
HAProxy:
type: data
extensions:
- ".cfg"
pchaigno marked this conversation as resolved.
Show resolved Hide resolved
filenames:
- hapee-lb.cfg
pchaigno marked this conversation as resolved.
Show resolved Hide resolved
- haproxy.cfg
tm_scope: source.haproxy-config
ace_mode: text
language_id: 366607477
HCL:
type: programming
extensions:
Expand Down
31 changes: 31 additions & 0 deletions samples/HAProxy/hapee-lb.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
user hapee-lb
group hapee
chroot /var/empty
pidfile /var/run/hapee-1.8/hapee-lb.pid
stats socket /var/run/hapee-1.8/hapee-lb.sock user hapee-lb group hapee mode 660 level admin
stats timeout 10m
module-path /opt/hapee-1.8/modules
daemon

defaults
mode http
log global
option httplog
option dontlognull
option forwardfor except 127.0.0.0/8
option tcp-smart-accept
option tcp-smart-connect
option redispatch
retries 3
timeout connect 10s
timeout client 30s
timeout server 30s

listen webapp
bind *:80
balance roundrobin
cookie SERVERID insert indirect nocache
server server1 10.0.0.2:80 cookie check
46 changes: 46 additions & 0 deletions samples/HAProxy/haproxy.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
global
pchaigno marked this conversation as resolved.
Show resolved Hide resolved
maxconn 50000
log /dev/log local0
user haproxy
group haproxy
stats socket /run/haproxy/haproxy.sock user haproxy group haproxy mode 660 level admin
nbproc 1
nbthread 4
cpu-map auto:1/1-4 0-3
ssl-default-bind-ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256
ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets

defaults
timeout connect 10s
timeout client 30s
timeout server 30s
log global
mode http
option httplog

frontend www.mysite.com
bind 10.0.0.3:80
bind 10.0.0.3:443 ssl crt /etc/ssl/certs/mysite.pem
redirect scheme https if !{ ssl_fc }
use_backend api_servers if { path_beg /api/ }
default_backend web_servers

backend web_servers
balance roundrobin
cookie PHPSESSID prefix nocache
option httpchk HEAD /
default-server check maxconn 20
server server1 10.0.1.3:80 cookie server1
server server2 10.0.1.4:80 cookie server2

backend api_servers
balance roundrobin
option httpchk HEAD /
server server1 10.0.1.5:80 check
server server2 10.0.1.6:80 check

listen admin
bind 0.0.0.0:8404
stats enable
stats uri /monitor
stats refresh 5
6 changes: 6 additions & 0 deletions samples/INI/ms.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
title=Mindstorms
isbn=0465046290
author=Seymour Papert
pubmonth=198001
subject=children computers powerful ideas LOGO education
url=http://www.papert.org/
1 change: 1 addition & 0 deletions vendor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting
- **Hack:** [textmate/php.tmbundle](https://github.com/textmate/php.tmbundle)
- **Haml:** [ezekg/language-haml](https://github.com/ezekg/language-haml)
- **Handlebars:** [daaain/Handlebars](https://github.com/daaain/Handlebars)
- **HAProxy:** [abulimov/atom-language-haproxy](https://github.com/abulimov/atom-language-haproxy)
- **Harbour:** [hernad/atom-language-harbour](https://github.com/hernad/atom-language-harbour)
- **Haskell:** [atom-haskell/language-haskell](https://github.com/atom-haskell/language-haskell)
- **Haxe:** [vshaxe/haxe-TmLanguage](https://github.com/vshaxe/haxe-TmLanguage)
Expand Down
1 change: 1 addition & 0 deletions vendor/grammars/atom-language-haproxy
Submodule atom-language-haproxy added at bc1e39
26 changes: 26 additions & 0 deletions vendor/licenses/grammar/atom-language-haproxy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
type: grammar
name: atom-language-haproxy
version: bc1e39d523ed78f29284e3da13cb579dc0d29e30
license: mit
---
Copyright (c) 2016 Alexander Bulimov

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.