Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
Noah
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Noah
Commits
997752f2
Commit
997752f2
authored
Oct 06, 2011
by
John E. Vincent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make max ephemeral size configurable
parent
e11b5219
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
noah
bin/noah
+1
-0
app.rb
lib/noah/app.rb
+7
-1
ephemerals.rb
lib/noah/routes/ephemerals.rb
+1
-1
No files found.
bin/noah
View file @
997752f2
...
...
@@ -6,4 +6,5 @@ require 'vegas'
Vegas
::
Runner
.
new
(
Noah
::
App
,
'noah'
)
do
|
runner
,
opts
,
app
|
opts
.
on
(
"-r"
,
"--redis URL"
,
"redis url to connect to (default: redis://localhost:6379/0)"
)
{
|
r
|
ENV
[
"REDIS_URL"
]
=
r
;
Noah
::
App
.
set
:redis_url
,
r
}
opts
.
on
(
"--esize SIZE"
,
Integer
,
"Max allowed ephemeral size in bytes"
)
{
|
esize
|
Noah
::
App
.
set
:ephemeral_size
,
esize
}
end
lib/noah/app.rb
View file @
997752f2
...
...
@@ -16,6 +16,7 @@ module Noah
set
:show_exceptions
,
false
set
:run
,
false
set
:redis_url
,
ENV
[
'REDIS_URL'
]
||
'redis://localhost:6379/0'
set
:ephemeral_size
,
ENV
[
'NOAH_ESIZE'
]
||
512
end
configure
(
:development
)
do
...
...
@@ -48,7 +49,12 @@ module Noah
haml
:index
,
:format
=>
:html5
,
:locals
=>
{
:redis_version
=>
Ohm
.
redis
.
info
[
"redis_version"
].
to_s
,
:noah_version
=>
Noah
::
VERSION
}
end
get
'/'
,
:provides
=>
:json
do
content_type
"application/json"
erb
:'index.json'
,
:locals
=>
{
:redis_version
=>
Ohm
.
redis
.
info
[
"redis_version"
].
to_s
,
:noah_version
=>
Noah
::
VERSION
}
end
get
'/version'
do
content_type
"application/json"
{
:redis_version
=>
Ohm
.
redis
.
info
[
"redis_version"
].
to_s
,
:noah_version
=>
Noah
::
VERSION
}.
to_json
...
...
lib/noah/routes/ephemerals.rb
View file @
997752f2
...
...
@@ -19,7 +19,7 @@ class Noah::App
end
put
'/ephemerals/*'
do
raise
(
"Data too large"
)
if
request
.
body
.
size
>
512
raise
(
"Data too large"
)
if
request
.
body
.
size
>
settings
.
ephemeral_size
d
=
request
.
body
.
read
||
nil
opts
=
{
:path
=>
"/
#{
params
[
:splat
][
0
]
}
"
,
:data
=>
d
}
e
=
Noah
::
Ephemeral
.
find_or_create
(
opts
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment