Skip to content
Snippets Groups Projects
Commit a9c34382 authored by Stefan Kraus's avatar Stefan Kraus
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
credentials.json
From 57788f9e1e7ed20b1a74e9ece895c23dff5f5867 Mon Sep 17 00:00:00 2001
From: Stefan Kraus <stefan.kraus@fau.de>
Date: Fri, 25 Jan 2019 17:39:02 +0100
Subject: [PATCH] frickelpatch
---
src/score/client.go | 2 +-
src/server/main.go | 69 +++++++++++++++++++++++----------------------
2 files changed, 37 insertions(+), 34 deletions(-)
diff --git a/src/score/client.go b/src/score/client.go
index c81dc54..5dbe82b 100644
--- a/src/score/client.go
+++ b/src/score/client.go
@@ -75,7 +75,7 @@ func NewJudgeClient(judge *url.URL, username string, password string, insecure b
}
func (client *JudgeClient) InjectCid(id int64) {
- for _, m := range []APIMethod{SUBMISSIONS, JUDGINGS, PROBLEMS} {
+ for _, m := range []APIMethod{SUBMISSIONS, JUDGINGS, PROBLEMS, TEAMS, CATEGORIES} {
u := client.urls[m]
q := u.Query()
q.Set("cid", strconv.FormatInt(id, 10))
diff --git a/src/server/main.go b/src/server/main.go
index c06e4e4..0b00968 100644
--- a/src/server/main.go
+++ b/src/server/main.go
@@ -178,38 +178,6 @@ func main() {
sleep := time.Millisecond*config.Poll_ms
sanitySleep := time.Second*config.Check_s
- go judge.ChannelJson(Teams, score.TEAMS, sanitySleep, false)
- realTeams := Teams
- Teams = make(chan []score.Team)
- filter := func(team score.Team) bool{
- return true
- }
- if(config.MatchAffiliations != nil) {
- regex := regexp.MustCompile(*config.MatchAffiliations)
- f := filter
- filter = func(team score.Team) bool{
- return f(team) && regex.MatchString(team.Affiliation)
- }
- }
- if(config.MatchCategories != nil) {
- regex := regexp.MustCompile(*config.MatchCategories)
- f := filter
- filter = func(team score.Team) bool{
- return f(team) && regex.MatchString(strconv.FormatInt(team.Category,10))
- }
- }
- go func() {
- for {
- var filtered []score.Team
- for _, t := range <-realTeams {
- if(filter(t)) {
- filtered = append(filtered, t)
- }
- }
- Teams <- filtered
- }
- }()
- go judge.ChannelJson(ContestConfig, score.CONFIG, sanitySleep, false)
go judge.ChannelJson(Contests, score.CONTESTS, sanitySleep, false)
go func(Contest chan *score.Contest) {
@@ -253,8 +221,43 @@ func main() {
judge.InjectCid(ContestState.Contest.Id)
- go judge.ChannelJson(Problems, score.PROBLEMS, sanitySleep, false)
+ go judge.ChannelJson(Teams, score.TEAMS, sanitySleep, false)
+
+ realTeams := Teams
+ Teams = make(chan []score.Team)
+ filter := func(team score.Team) bool{
+ return true
+ }
+ if(config.MatchAffiliations != nil) {
+ regex := regexp.MustCompile(*config.MatchAffiliations)
+ f := filter
+ filter = func(team score.Team) bool{
+ return f(team) && regex.MatchString(team.Affiliation)
+ }
+ }
+ if(config.MatchCategories != nil) {
+ regex := regexp.MustCompile(*config.MatchCategories)
+ f := filter
+ filter = func(team score.Team) bool{
+ return f(team) && regex.MatchString(strconv.FormatInt(team.Category,10))
+ }
+ }
+ go func() {
+ for {
+ var filtered []score.Team
+ for _, t := range <-realTeams {
+ if(filter(t)) {
+ filtered = append(filtered, t)
+ }
+ }
+ Teams <- filtered
+ }
+ }()
+
+
go judge.ChannelJson(Categories, score.CATEGORIES, sanitySleep, false)
+ go judge.ChannelJson(ContestConfig, score.CONFIG, sanitySleep, false)
+ go judge.ChannelJson(Problems, score.PROBLEMS, sanitySleep, false)
go judge.ChannelJson(submissions, score.SUBMISSIONS, sleep, true)
go judge.ChannelJson(judgings, score.JUDGINGS, sleep, true)
--
2.19.1
FROM debian:9.0
RUN apt-get update && apt-get -y install \
git \
locales \
wget \
make \
time \
bsdmainutils \
build-essential \
cmake \
golang-go \
libsodium-dev \
libsodium18 \
libprotobuf-dev \
qt5-default \
qml-module-qtgraphicaleffects
RUN echo "de_DE.UTF-8 UTF-8\nen_GB.UTF-8\nen_US.UTF-8 UTF-8\n" > /etc/locale.gen
RUN locale-gen
ENV LANG de_DE.UTF-8
ENV LANGUAGE de_DE:de
ENV LC_ALL de_DE.UTF-8
WORKDIR /root
RUN git clone https://github.com/TPolzer/Carnifex
RUN apt-get -y install \
pkg-config \
libncurses5-dev \
libncurses5
WORKDIR /root/Carnifex
COPY 0001-frickelpatch.patch .
RUN git config --global user.email fml@fml.ignore
RUN git config --global user.name fm
RUN git am 0001-frickelpatch.patch
ENV GOPATH=/root/Carnifex
RUN go get github.com/golang/protobuf/proto github.com/rthornton128/goncurses golang.org/x/crypto/nacl/secretbox golang.org/x/crypto/scrypt
RUN apt-get -y install \
qtbase5-dev \
qtdeclarative5-dev \
protobuf-compiler
RUN go build server
RUN cmake src/client
RUN make -j4
WORKDIR /root
WORKDIR /root
RUN git clone https://gitlab.cs.fau.de/alice/carniprox
WORKDIR /root/carniprox
RUN apt-get -y install \
python3 \
python3-pip \
python3-dateutil \
tmux \
screen \
vim
COPY config.json /root/Carnifex
COPY credentials.json /root/Carnifex
RUN pip3 install flask
{
"baseurl": "http://localhost:5000",
"apipath": "",
"simulate": false,
"simulationSpeed": 120,
"poll_ms": 2500,
"check_s": 10,
"dumpData": false,
"cid": "2",
"matchAffiliations": ".*",
"servername": "localhost",
"minrows": 15,
"mincols": 28,
"pageInterval": 10,
"jury": false,
"sharedsecret": "Icouldnotcarelessthisisindocker Geheimes spezialwissen",
"serverport": 8080
}
{ "user": "scoreboard", "password": "pls change me" }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment