-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathmaintenance.cgi
More file actions
executable file
·37 lines (33 loc) · 1.93 KB
/
maintenance.cgi
File metadata and controls
executable file
·37 lines (33 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env ruby
############################################################################
# Copyright 2016-2019 Benjamin Kellermann #
# #
# This file is part of Dudle. #
# #
# Dudle is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Affero General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# Dudle is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public #
# License for more details. #
# #
# You should have received a copy of the GNU Affero General Public License #
# along with dudle. If not, see <http://www.gnu.org/licenses/>. #
############################################################################
require_relative 'dudle'
# check for trailing slash
if ENV.fetch('REDIRECT_URL', nil) =~ /#{$cgi['poll']}$/
$d = Dudle.new(title: _('Maintenance'), hide_lang_chooser: true, relative_dir: "#{$cgi['poll']}/")
else
$d = Dudle.new(title: _('Maintenance'), hide_lang_chooser: true)
end
if File.exist?('maintenance.html')
$d << _('This site is currently undergoing maintenance!')
$d << File.read('maintenance.html')
else
$d << _('You should not browse to this file directly. Please create a file named "maintenance.html" to enable the maintenance mode.')
end
$d.out