Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
CTF
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Grzegorz
CTF
Commits
e554e916
Commit
e554e916
authored
Apr 02, 2016
by
Grzegorz Pietrusza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add endpoint for startup configuration
parent
7d00ee50
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
220 additions
and
5 deletions
+220
-5
configuration.local.yml
service/configuration.local.yml
+5
-1
configuration.prod.yml
service/configuration.prod.yml
+135
-0
ApplicationConfiguration.java
...honers/krakyournet/ctf/core/ApplicationConfiguration.java
+18
-0
StartupConfiguration.java
...elephoners/krakyournet/ctf/core/StartupConfiguration.java
+49
-0
UtilResource.java
...m/telephoners/krakyournet/ctf/resources/UtilResource.java
+13
-4
No files found.
service/configuration.yml
→
service/configuration.
local.
yml
View file @
e554e916
...
...
@@ -5,10 +5,14 @@ server:
port
:
8080
dbHost
:
92f653f4-cf83-4801-8475-cd748954c3b6.node.dockerapp.io
#dbHost: 127.0.0.1
dbPort
:
27017
dbName
:
db
startupConfiguration
:
domainName
:
"
localhost"
port
:
8080
schema
:
"
http"
digestMethod
:
"
MD5"
admins
:
...
...
service/configuration.prod.yml
0 → 100644
View file @
e554e916
server
:
rootPath
:
/api/v1/*
applicationConnectors
:
-
type
:
http
port
:
8080
dbHost
:
92f653f4-cf83-4801-8475-cd748954c3b6.node.dockerapp.io
dbPort
:
27017
dbName
:
db
startupConfiguration
:
domainName
:
"
52.25.28.64"
port
:
8080
schema
:
"
http"
digestMethod
:
"
MD5"
admins
:
-
name
:
"
gpietrus_admin"
password
:
"
41b450e73c974fca46911eba84e114f2"
#gpietrus md5
email
:
"
gpietrusza@gmail.com"
admin
:
true
-
name
:
"
anteq_admin"
password
:
"
1a7fcdd5a9fd433523268883cfded9d0"
#gpietrus md5
email
:
"
antonigrzanka@gmail.com"
admin
:
true
teams
:
-
name
:
"
misiaczki"
description
:
"
misiaczki
opis"
members
:
-
name
:
"
gpietrus1"
password
:
"
41b450e73c974fca46911eba84e114f2"
#gpietrus md5
email
:
"
gpietrusza@gmail.com"
-
name
:
"
mehow1"
password
:
"
c4d24515428cb3ad50e7840be8718f23"
#mehos123 md5
email
:
"
mehow@gmail.com"
-
name
:
"
rosiu1"
password
:
"
188ed9df2dac8e10f5c5fd2e02383765"
#rosiu321 md5
email
:
"
rosiu@gmail.com"
-
name
:
"
anteq1"
password
:
"
1a7fcdd5a9fd433523268883cfded9d0"
#anteq1 md5
email
:
"
antonigrzanka@gmail.com"
-
name
:
"
prosiaczki"
description
:
"
prosiaczki
opis"
members
:
-
name
:
"
gpietrus2"
password
:
"
41b450e73c974fca46911eba84e114f2"
#gpietrus md5
email
:
"
gpietrusza@gmail.com"
-
name
:
"
mehow2"
password
:
"
c4d24515428cb3ad50e7840be8718f23"
#mehos123 md5
email
:
"
mehow@gmail.com"
-
name
:
"
rosiu2"
password
:
"
188ed9df2dac8e10f5c5fd2e02383765"
#rosiu321 md5
email
:
"
rosiu@gmail.com"
-
name
:
"
anteq2"
password
:
"
1a7fcdd5a9fd433523268883cfded9d0"
#anteq1 md5
email
:
"
antonigrzanka@gmail.com"
-
name
:
"
dupeczki"
description
:
"
dupeczki
opis"
members
:
-
name
:
"
gpietrus3"
password
:
"
41b450e73c974fca46911eba84e114f2"
#gpietrus md5
email
:
"
gpietrusza@gmail.com"
-
name
:
"
mehow3"
password
:
"
c4d24515428cb3ad50e7840be8718f23"
#mehos123 md5
email
:
"
mehow@gmail.com"
-
name
:
"
rosiu3"
password
:
"
188ed9df2dac8e10f5c5fd2e02383765"
#rosiu321 md5
email
:
"
rosiu@gmail.com"
-
name
:
"
anteq3"
password
:
"
1a7fcdd5a9fd433523268883cfded9d0"
#anteq1 md5
email
:
"
antonigrzanka@gmail.com"
textTasks
:
-
name
:
"
Szyfro1"
text
:
"
Odszyfruj1"
level
:
1
flags
:
-
value
:
"
AGH_sdfg1f1"
description
:
"
flaga
1"
-
value
:
"
AGH_sdfg1f2"
description
:
"
flaga
2"
-
value
:
"
AGH_sdfgf13"
description
:
"
flaga
3"
-
name
:
"
Szyfro2"
text
:
"
Odszyfruj2"
level
:
2
flags
:
-
value
:
"
AGH_sdfg1"
description
:
"
AGH_flaga
1"
-
value
:
"
sdfg1"
description
:
"
flaga
2"
-
name
:
"
UI"
text
:
"
Znajdz
flagi
w
jułaju"
level
:
5
flags
:
-
value
:
"
KYN2016_TervetullutKotisivuilleni"
description
:
"
Tytuł"
-
value
:
"
KYN2016_ToNieprawda"
description
:
"
Poezja"
-
value
:
"
KYN2016_EmacsemPrzezSendmaila"
description
:
"
Konsola"
-
value
:
"
KYN2016_SzukajDalejAZnajdzieszWiecej"
description
:
"
QR"
-
value
:
"
KYN2016_BROWAR"
description
:
"
Rebus"
-
value
:
"
KYN2016_RUAHACKER?"
description
:
"
Tunel"
webTasks
:
-
name
:
"
SQL
Injection"
url
:
"
http://google.pl"
level
:
3
flags
:
-
value
:
"
AGH_sdfg1fs"
description
:
"
flaga
11"
-
value
:
"
AGH_sdfdg1f"
description
:
"
flaga
22"
-
value
:
"
AGH_sfdfgf1"
description
:
"
flaga
33"
-
name
:
"
Inna
dziura"
url
:
"
http://wikipedia.pl"
level
:
4
flags
:
-
value
:
"
AGH_sdfffg1fs"
description
:
"
flaga
11"
-
value
:
"
AGH_sffdfdg1f"
description
:
"
flaga
22"
-
value
:
"
AGH_sdfassfdfgf1"
description
:
"
flaga
33"
\ No newline at end of file
service/src/main/java/com/telephoners/krakyournet/ctf/core/ApplicationConfiguration.java
View file @
e554e916
...
...
@@ -35,6 +35,9 @@ public class ApplicationConfiguration extends Configuration
@NotNull
private
List
<
User
>
admins
;
@NotNull
private
StartupConfiguration
startupConfiguration
;
public
List
<
User
>
getAdmins
()
{
return
admins
;
...
...
@@ -114,4 +117,19 @@ public class ApplicationConfiguration extends Configuration
{
this
.
webTasks
=
webTasks
;
}
public
void
setDigestMethod
(
String
digestMethod
)
{
this
.
digestMethod
=
digestMethod
;
}
public
StartupConfiguration
getStartupConfiguration
()
{
return
startupConfiguration
;
}
public
void
setStartupConfiguration
(
StartupConfiguration
startupConfiguration
)
{
this
.
startupConfiguration
=
startupConfiguration
;
}
}
service/src/main/java/com/telephoners/krakyournet/ctf/core/StartupConfiguration.java
0 → 100644
View file @
e554e916
package
com
.
telephoners
.
krakyournet
.
ctf
.
core
;
public
class
StartupConfiguration
{
private
String
domainName
;
private
int
port
;
private
String
schema
;
public
StartupConfiguration
(
String
domainName
,
int
port
,
String
schema
)
{
this
.
domainName
=
domainName
;
this
.
port
=
port
;
this
.
schema
=
schema
;
}
public
StartupConfiguration
()
{
}
public
String
getDomainName
()
{
return
domainName
;
}
public
void
setDomainName
(
String
domainName
)
{
this
.
domainName
=
domainName
;
}
public
int
getPort
()
{
return
port
;
}
public
void
setPort
(
int
port
)
{
this
.
port
=
port
;
}
public
String
getSchema
()
{
return
schema
;
}
public
void
setSchema
(
String
schema
)
{
this
.
schema
=
schema
;
}
}
service/src/main/java/com/telephoners/krakyournet/ctf/resources/UtilResource.java
View file @
e554e916
...
...
@@ -3,6 +3,7 @@ package com.telephoners.krakyournet.ctf.resources;
import
com.google.common.collect.ImmutableMap
;
import
com.telephoners.krakyournet.ctf.beans.Team
;
import
com.telephoners.krakyournet.ctf.beans.User
;
import
com.telephoners.krakyournet.ctf.core.ApplicationConfiguration
;
import
com.telephoners.krakyournet.ctf.repositories.TeamsRepository
;
import
io.dropwizard.auth.Auth
;
import
org.apache.commons.io.FileUtils
;
...
...
@@ -23,13 +24,22 @@ import java.io.IOException;
@Produces
(
MediaType
.
APPLICATION_JSON
)
public
class
UtilResource
{
private
final
TeamsRepository
teamsRepository
;
private
final
ApplicationConfiguration
applicationConfiguration
;
@Inject
public
UtilResource
(
TeamsRepository
teamsRepository
)
public
UtilResource
(
TeamsRepository
teamsRepository
,
ApplicationConfiguration
applicationConfiguration
)
{
this
.
teamsRepository
=
teamsRepository
;
this
.
applicationConfiguration
=
applicationConfiguration
;
}
@GET
@Path
(
"/startup"
)
public
Response
getStartupConfiguration
()
{
return
Response
.
ok
().
entity
(
applicationConfiguration
.
getStartupConfiguration
()).
build
();
}
@GET
...
...
@@ -42,8 +52,7 @@ public class UtilResource
if
(!
user
.
isAdmin
())
{
Team
team
=
teamsRepository
.
getTeamByUserName
(
userName
);
responseBuilder
.
put
(
"teamName"
,
team
.
getName
());
}
else
{
}
else
{
responseBuilder
.
put
(
"isAdmin"
,
true
);
}
return
Response
.
ok
()
...
...
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