
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
This is a minimal web server, based on rack and puma. It is written in ruby. It also gives you a minimal architecture to speed up your application bootstrap.
Features provided:
Features which will not be provided by nserver:
gem install nephos # download the server and executables
ngenerator application MyApp # generate the application
cd MyApp # go in
nserver -p 8080 -h 0.0.0.0 # start the server. port is not required, neither host
nserver
is an executable designed to start the server easly. It can take few arguments, all optionnal:
-p
: port to listen-h
: host to listen (network address)-e
: environment (default is development, can be set to production)-d
: daemonize the process-k
: kill daemonized processTheses guides will provide you knowlegde about everything you can use in the application.
To avoid information leaks from your application, set the environment variable
export ENVIRONMENT=production
, or run the server with -e production
parameter. When an error occurs, the backtrace will be print to the client in
the rendered page, unless the server runs in production environment.
Every routes will call a method from a controller.
To create a controller, add a ruby file to app/
, with a class inherited by Nephos::Controller
You should user ngenerator --controller NAME
to generate a new controller.
class Example < Nephos::Controller
def root
cookies["last_visit"] = Time.now
if params["index"] == "true"
return {plain: "index"}
else
return :empty
end
end
end
To render a content to the client, you can return informations from a Controller method:
return 404
return {status: code}
return {status: code, content: "Not today"}
return {json: {status: "resource created"}, status: 201}
return {plain: "text"}
return {html: "<html><body><h1>:D</h1></body></html>"}
return {type: "image/jpeg", content: File.read("images/photo.jpg")}
return :empty
The routing (rules to execute the action the user wants), you have to write the /routes.rb
file.
If the user try to access an url not described in the file, it will automaticaly render a 404 not found.
get url: "/", controller: "MainController", method: "root" # /
post url: "/add", controller: "MainController", method: "add_url" # /add
post url: "/add/:url", controller: "MainController", method: "add_url" # /add with parameter :url
put url: "/rm", controller: "MainController", method: "rm_url" # /rm
put url: "/rm/:url", controller: "MainController", method: "rm_url" # /rm with parameter :url
resource "infos" do
get url: "/", controller: "MainController", method: "root" # generate /infos
get url: "/about", controller: "MainController", method: "root" # generate /infos/about
get url: "/notice", to: "MainController#notice" # generate /infos/notice
end
FAQs
Unknown package
We found that nephos-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.