Browse Source

first commit

encrypt 9 years ago
commit
cc368e67c6
3 changed files with 41 additions and 0 deletions
  1. 1 0
      .gitignore
  2. 14 0
      views/index.erb
  3. 26 0
      webapp.rb

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+*~

+ 14 - 0
views/index.erb

@@ -0,0 +1,14 @@
+<html>
+  <head>
+    <title>Is Hacklabbo open?</title>
+  </head>
+  <body>
+    <center><h1>
+      <% if settings.open %>
+      <%= "yes" %>
+      <% else %>
+      <%= "no"%>
+      <% end %>
+      </h1></center>
+  </body>
+</html>

+ 26 - 0
webapp.rb

@@ -0,0 +1,26 @@
+require 'sinatra'
+
+set :secret_token, "unsecure_token"
+set :open, false
+
+get '/' do
+  erb :index
+end
+
+get '/hacklabbo/open/:token' do |token|
+  if token == settings.secret_token
+    settings.open = true
+    200
+  else
+    403
+  end
+end
+
+get '/hacklabbo/close/:token' do |token|
+  if token == settings.secret_token
+    settings.open = false
+    200
+  else
+    403
+  end
+end