Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rohieb/StratumOpenCloseMonitor
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: stratum0/StratumOpenCloseMonitor
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 16 commits
  • 14 files changed
  • 2 contributors

Commits on Oct 6, 2015

  1. Merge pull request #5 from rohieb/master

    JavaScript in-browser polling client
    rohieb committed Oct 6, 2015
    Copy the full SHA
    36bca28 View commit details

Commits on Mar 23, 2016

  1. Copy the full SHA
    a721420 View commit details

Commits on Jan 19, 2017

  1. Copy the full SHA
    7381c03 View commit details
  2. Copy the full SHA
    18f9b35 View commit details
  3. Copy the full SHA
    0722c03 View commit details
  4. Copy the full SHA
    ab9f809 View commit details
  5. Copy the full SHA
    f987a8b View commit details

Commits on Aug 2, 2020

  1. Copy the full SHA
    d0ccc37 View commit details
  2. Copy the full SHA
    e9f0279 View commit details
  3. server: "open" is now "open with COVID restrictions"

    Sadly we cannot really indicate that in the SpaceAPI, but the texts in
    the IRC topic and on the homepage should reflect that.
    
    If everything returns to normal, just revert this change.
    rohieb committed Aug 2, 2020
    Copy the full SHA
    f35dd94 View commit details
  4. Copy the full SHA
    3684d1c View commit details

Commits on Jan 13, 2023

  1. server: supybot: migrate IRC to libera.chat

    Roland Hieber authored and rohieb committed Jan 13, 2023
    Copy the full SHA
    2efd423 View commit details

Commits on Jul 10, 2023

  1. Revert "server: "open" is now "open with COVID restrictions""

    This reverts commit f35dd94.
    rohieb committed Jul 10, 2023
    Copy the full SHA
    829c7d8 View commit details

Commits on Nov 13, 2023

  1. Copy the full SHA
    016f215 View commit details
  2. Copy the full SHA
    ed4101f View commit details

Commits on Dec 1, 2023

  1. Copy the full SHA
    de87910 View commit details
4 changes: 2 additions & 2 deletions client/html-js-poll/status.html
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
return sprintf("%s, %d-%02d-%02d, %02d:%02d",
days[date.getDay()],
date.getFullYear(),
date.getMonth(),
date.getMonth() + 1, // 0-based
date.getDate(),
date.getHours(),
date.getMinutes()
@@ -42,7 +42,7 @@
$("#icon").prop("src", "open.svg");
}
function fetchStatus() {
$.getJSON("http://status.stratum0.org/status.json", function (data) {
$.getJSON("https://status.stratum0.org/status.json", function (data) {
if(data.state !== undefined &&
data.state.lastchange !== undefined &&
data.state.open !== undefined &&
32 changes: 21 additions & 11 deletions server/supybot/plugins/StratumMonitor/plugin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
###
# vim: set fileencoding=utf-8
# Copyright (c) 2012, Roland Hieber
# All rights reserved.
#
@@ -50,10 +51,8 @@ class StratumMonitor(callbacks.Plugin):
access_log off;
location / {
rewrite ^/status.png$ https://$http_host/{{{STATUS}}}.png redirect;
rewrite ^/favicon.ico$ https://$http_host/{{{STATUS}}}.ico redirect;
#rewrite ^/status.png$ $scheme://$http_host/{{{STATUS}}}.png redirect;
#rewrite ^/favicon.ico$ $scheme://$http_host/{{{STATUS}}}.ico redirect;
rewrite ^/status.png$ https://stratum0.org/status/{{{STATUS}}}.png redirect;
rewrite ^/favicon.ico$ https://stratum0.org/status/{{{STATUS}}}.ico redirect;
expires +5m;
}
location ~* /(open|closed)(_square)?\.(ico|png)$ {
@@ -63,6 +62,9 @@ class StratumMonitor(callbacks.Plugin):
expires +5m;
add_header Access-Control-Allow-Origin *;
}
location /update {
proxy_pass http://localhost:8766;
}
}
"""
API_PATH = "/srv/status.stratum0.org/%s"
@@ -93,22 +95,23 @@ class StratumMonitor(callbacks.Plugin):
"lat": 52.2785658\r
},\r
"contact": {\r
"phone": "+49 531 287 69 245",\r
"twitter": "@stratum0",\r
"email": "kontakt@stratum0.org",\r
"ml": "normalverteiler@stratum0.org",\r
"issue_mail": "cm9oaWViK3NwYWNlYXBpLWlzc3Vlc0Byb2hpZWIubmFtZQ==",\r
"irc": "irc://chat.freenode.net/#stratum0",\r
"foursquare": "4f243fd0e4b0b653a35e3ae4"\r
"irc": "ircs://irc.libera.net/#stratum0",\r
"mastodon": "@stratum0@chaos.social",\r
"matrix": "#stratum0:stratum0.org"\r
},\r
"issue_report_channels": [\r
"issue_mail"\r
],\r
"state": {\r
"ext_since": {{{SINCE_EPOCH}}},\r
"lastchange": {{{LASTCHANGE_EPOCH}}},\r
"open": {{{ISOPEN}}},\r
"icon": {\r
"open": "http://status.stratum0.org/open_square.png",\r
"closed": "http://status.stratum0.org/closed_square.png"\r
"open": "https://status.stratum0.org/open_square.png",\r
"closed": "https://status.stratum0.org/closed_square.png"\r
},\r
"trigger_person": "{{{OPENER}}}",
"lastchange": {{{SINCE_EPOCH}}}\r
@@ -124,7 +127,7 @@ class StratumMonitor(callbacks.Plugin):
},\r
"calendar": {\r
"type": "ical",\r
"url": "https://stratum0.org/calendar/events.ics"\r
"url": "https://stratum0.org/kalender/events.ics"\r
}\r
}\r
}\r
@@ -171,6 +174,7 @@ def __init__(self, irc):
self.openedBy = ""
self.since = datetime.now()
self.presentEntities = None
self.lastchange = datetime.now()
self.lastCalled = int(time.time())
self.lastBroadcast = 0

@@ -279,6 +283,8 @@ def replaceVariables(self, text):
text = text.replace("{{{SINCE}}}", self.since.isoformat())
text = text.replace("{{{SINCE_EPOCH}}}",
str(int(time.mktime(self.since.timetuple()))))
text = text.replace("{{{LASTCHANGE_EPOCH}}}",
str(int(time.mktime(self.lastchange.timetuple()))))
text = text.replace("{{{ISOPEN}}}", "true" if self.isOpen else "false")
text = text.replace("{{{STATUS}}}", "open" if self.isOpen else "closed")
text = text.replace("{{{ACTION}}}", "Opened" if self.isOpen else "Closed")
@@ -323,6 +329,8 @@ def spaceopen(self, irc, msg, args, nick):
empty, the nick of the caller is used instead.
"""
self.since = datetime.now()
if not self.isOpen:
self.lastchange = datetime.now()
self.isOpen = True;
self.openedBy = nick if nick else msg.nick
self.writeFiles()
@@ -344,6 +352,8 @@ def spaceclosed(self, irc, msg, args):
the channel topic.
"""
self.since = datetime.now()
if self.isOpen:
self.lastchange = datetime.now()
self.isOpen = False;
self.openedBy = ""
self.writeFiles()
8 changes: 5 additions & 3 deletions server/supybot/supybot.conf.example
Original file line number Diff line number Diff line change
@@ -56,14 +56,14 @@ supybot.networks.freenode.password:
#
# Default value:
###
supybot.networks.freenode.servers: irc.freenode.net:6667
supybot.networks.freenode.servers: chat.freenode.net:6667 kornbluth.freenode.net:6667 hitchcock.freenode.net:6667 verne.freenode.net:6667

###
# Determines what channels the bot will join only on freenode.
#
# Default value:
###
supybot.networks.freenode.channels: #stratum0 #stratum0v
supybot.networks.freenode.channels: #stratum0

###
# Determines what key (if any) will be used to join the channel.
@@ -286,7 +286,7 @@ supybot.reply.whenAddressedBy.chars: @
#
# Default value:
###
supybot.reply.whenAddressedBy.strings: sudo mach
supybot.reply.whenAddressedBy.strings: sudo mach Sudo Mach

###
# Determines whether the bot will reply when people address it by its
@@ -696,6 +696,8 @@ supybot.plugins.Alias.aliases.auf: offen $*
supybot.plugins.Alias.aliases.auf.locked: True
supybot.plugins.Alias.aliases.make: echo $nick: Here, have a sandwich: https://www.google.com/images?q=sandwich
supybot.plugins.Alias.aliases.make.locked: True
supybot.plugins.Alias.aliases.space: offen $*
supybot.plugins.Alias.aliases.space.locked: False
supybot.plugins.Alias.aliases.neuhier: echo Neu hier? https://stratum0.org/wiki/Neu_hier
supybot.plugins.Alias.aliases.neuhier.locked: False
supybot.plugins.Alias.aliases.kekse: action hat kein mehl
99 changes: 99 additions & 0 deletions server/www/closed-badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified server/www/closed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified server/www/closed_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading