Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
25 changes: 25 additions & 0 deletions kong/lib/systemd/system/kong-enterprise-edition.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[Unit]
Description=Kong Enterprise Edition
Documentation=https://docs.konghq.com/enterprise/
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
ExecStartPre=/usr/local/bin/kong prepare -p /usr/local/kong
ExecStart=/usr/local/openresty/nginx/sbin/nginx -p /usr/local/kong -c nginx.conf
ExecReload=/usr/local/bin/kong prepare -p /usr/local/kong
ExecReload=/usr/local/openresty/nginx/sbin/nginx -p /usr/local/kong -c nginx.conf -s reload
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

# All environment variables prefixed with `KONG_` and capitalized will override
# the settings specified in the `/etc/kong/kong.conf.default` file.
#
# For example:
# `log_level = debug` in the .conf file -> `KONG_LOG_LEVEL=debug` env var.
Environment=KONG_NGINX_DAEMON=off

# You can control this limit through /etc/security/limits.conf
LimitNOFILE=infinity

[Install]
WantedBy=multi-user.target
Binary file added kong/lib/x86_64-linux-gnu/libc.so.6
Binary file not shown.
Binary file added kong/lib/x86_64-linux-gnu/libcrypt.so.1
Binary file not shown.
Binary file added kong/lib/x86_64-linux-gnu/libcrypto.so.1.1
Binary file not shown.
Binary file added kong/lib/x86_64-linux-gnu/libdl.so.2
Binary file not shown.
Binary file added kong/lib/x86_64-linux-gnu/libgcc_s.so.1
Binary file not shown.
Binary file added kong/lib/x86_64-linux-gnu/libm.so.6
Binary file not shown.
Binary file added kong/lib/x86_64-linux-gnu/libpthread.so.0
Binary file not shown.
Binary file added kong/lib/x86_64-linux-gnu/libssl.so.1.1
Binary file not shown.
Binary file added kong/lib/x86_64-linux-gnu/libz.so.1
Binary file not shown.
Binary file added kong/lib64/ld-linux-x86-64.so.2
Binary file not shown.
13 changes: 13 additions & 0 deletions kong/usr/bin/kkong
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env resty

ngx.say('hello world'); ngx.sleep(10)

setmetatable(_G, nil)

pcall(require, "luarocks.loader")

package.path = (os.getenv("KONG_LUA_PATH_OVERRIDE") or "") .. "./?.lua;./?/init.lua;" .. package.path

require("kong.cmd.init")(arg)

-- vim: set ft=lua ts=2 sw=2 sts=2 et :
4 changes: 4 additions & 0 deletions kong/usr/bin/kong
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env resty

ngx.say('hello world'); ngx.sleep(10)
-- vim: set ft=lua ts=2 sw=2 sts=2 et :
79 changes: 79 additions & 0 deletions kong/usr/bin/kong-health
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/usr/bin/env resty

setmetatable(_G, nil)
package.path = (os.getenv("KONG_LUA_PATH_OVERRIDE") or "") .. "./?.lua;./?/init.lua;" .. package.path

local kill = require "kong.cmd.utils.kill"
local kong_default_conf = require "kong.templates.kong_defaults"
local pl_app = require "pl.lapp"
local pl_config = require "pl.config"
local pl_path = require "pl.path"
local pl_stringio = require "pl.stringio"

local KONG_DEFAULT_PREFIX = "/usr/local/kong"


local function get_kong_prefix()
local prefix = os.getenv("KONG_PREFIX")

if not prefix then
local s = pl_stringio.open(kong_default_conf)
local defaults = pl_config.read(s, {
smart = false,
list_delim = "_blank_" -- mandatory but we want to ignore it
})
s:close()
if defaults then
prefix = defaults.prefix
end

end

return prefix or KONG_DEFAULT_PREFIX
end


local function execute(args)
local prefix = args.prefix or get_kong_prefix(args)
assert(pl_path.exists(prefix), "no such prefix: " .. prefix)

local kong_env = pl_path.join(prefix, ".kong_env")
assert(pl_path.exists(kong_env), "Kong is not running at " .. prefix)

print("")
local pid_file = pl_path.join(prefix, "pids", "nginx.pid")
kill.is_running(pid_file)
assert(kill.is_running(pid_file), "Kong is not running at " .. prefix)
print("Kong is healthy at ", prefix)
end


local lapp = [[
Usage: kong-health [OPTIONS]
Check if the necessary services are running for this node.
Options:
-p,--prefix (optional string) prefix at which Kong should be running
--v verbose
--vv debug
]]

local function run(args)
args = pl_app(lapp)
xpcall(function() execute(args) end, function(err)
if not (args.v or args.vv) then
err = err:match "^.-:.-:.(.*)$"
io.stderr:write("Error: " .. err .. "\n")
io.stderr:write("\n Run with --v (verbose) or --vv (debug) for more details\n")
else
local trace = debug.traceback(err, 2)
io.stderr:write("Error: \n")
io.stderr:write(trace .. "\n")
end
pl_app.quit(nil, true)
end)
end


run(arg)

-- vim: set ft=lua ts=2 sw=2 sts=2 et :
3 changes: 3 additions & 0 deletions kong/usr/bin/luarocks
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

LUAROCKS_SYSCONFDIR='/usr/local/etc/luarocks' exec '/usr/local/openresty/luajit/bin/luajit' -e 'package.path="/home/runner/work/kong-ee/kong-ee/bazel-bin/build/kong-dev/share/lua/5.1/?.lua;/home/runner/work/kong-ee/kong-ee/bazel-bin/build/kong-dev/share/lua/5.1/?/init.lua;bazel-out/k8-opt/bin/external/luarocks/copy_luarocks_host/luarocks_host/share/lua/5.1/?.lua;bazel-out/k8-opt/bin/external/luarocks/copy_luarocks_host/luarocks_host/share/lua/5.1/?/init.lua;./?.lua;/usr/local/openresty/luajit/share/luajit-2.1.0-beta3/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/openresty/luajit/share/lua/5.1/?.lua;/usr/local/openresty/luajit/share/lua/5.1/?/init.lua;";package.cpath="./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/openresty/luajit/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so";local k,l,_=pcall(require,"luarocks.loader") _=k and l.add_context("luarocks","3.9.2-1")' '/usr/local/lib/luarocks/rocks-5.1/luarocks/3.9.2-1/bin/luarocks' "$@"
Binary file added kong/usr/bin/perl
Binary file not shown.
1 change: 1 addition & 0 deletions kong/usr/bin/resty
11 changes: 11 additions & 0 deletions kong/usr/etc/luarocks/config-5.1.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- LuaRocks configuration
rocks_trees = {
{ name = "user", root = home .. "/.luarocks" };
{ name = "system", root = "/usr/local" };
}
lua_interpreter = "luajit";
variables = {
LUA_DIR = "/usr/local/openresty/luajit";
LUA_INCDIR = "/usr/local/openresty/luajit/include/luajit-2.1";
LUA_BINDIR = "/usr/local/openresty/luajit/bin";
}
Loading