Commit 9fdefc84 authored by Dominik Rosiek's avatar Dominik Rosiek

Merge branch 'master' of gitlab.telemabk.pl:jifwin/CTF

parents ada7fde6 da59c9b5
...@@ -94,4 +94,4 @@ module.exports = function (grunt) { ...@@ -94,4 +94,4 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('default', ['clean', 'jshint', 'copy', 'htmlmin', 'cssmin', 'uglify']); grunt.registerTask('default', ['clean', 'jshint', 'copy', 'htmlmin', 'cssmin', 'uglify']);
}; };
\ No newline at end of file
...@@ -4,7 +4,7 @@ server: ...@@ -4,7 +4,7 @@ server:
- type: http - type: http
port: 8080 port: 8080
dbHost: 57.37.192.46 dbHost: 92f653f4-cf83-4801-8475-cd748954c3b6.node.dockerapp.io
dbPort: 27017 dbPort: 27017
dbName: db dbName: db
......
...@@ -4,12 +4,12 @@ server: ...@@ -4,12 +4,12 @@ server:
- type: http - type: http
port: 8080 port: 8080
dbHost: 52.37.192.46 dbHost: 52.58.79.68
dbPort: 27017 dbPort: 27017
dbName: db dbName: db
startupConfiguration: startupConfiguration:
domainName: "52.25.28.64" domainName: "52.28.244.24"
port: 8080 port: 8080
schema: "http" schema: "http"
...@@ -113,7 +113,7 @@ textTasks: ...@@ -113,7 +113,7 @@ textTasks:
webTasks: webTasks:
- name: "SQL Injection" - name: "SQL Injection"
url: "http://google.pl" url: "http://52.29.190.67"
level: 3 level: 3
flags: flags:
- value: "AGH_sdfg1fs" - value: "AGH_sdfg1fs"
......
configuration.prod.yml
\ No newline at end of file
...@@ -6,7 +6,6 @@ import com.telephoners.krakyournet.ctf.beans.User; ...@@ -6,7 +6,6 @@ import com.telephoners.krakyournet.ctf.beans.User;
import com.telephoners.krakyournet.ctf.core.ApplicationConfiguration; import com.telephoners.krakyournet.ctf.core.ApplicationConfiguration;
import com.telephoners.krakyournet.ctf.repositories.TeamsRepository; import com.telephoners.krakyournet.ctf.repositories.TeamsRepository;
import io.dropwizard.auth.Auth; import io.dropwizard.auth.Auth;
import org.apache.commons.io.FileUtils;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Singleton; import javax.inject.Singleton;
...@@ -16,7 +15,6 @@ import javax.ws.rs.Produces; ...@@ -16,7 +15,6 @@ import javax.ws.rs.Produces;
import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import java.io.File;
import java.io.IOException; import java.io.IOException;
@Singleton @Singleton
...@@ -24,6 +22,7 @@ import java.io.IOException; ...@@ -24,6 +22,7 @@ import java.io.IOException;
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public class UtilResource public class UtilResource
{ {
private static String redirectHtml = "<!DOCTYPE html><html lang=\"en\" ng-app=\"ctfApp\"><head></head><script type=\"text/javascript\">window.location = \"http://\" + window.location.host;</script></html>";
private final TeamsRepository teamsRepository; private final TeamsRepository teamsRepository;
private final ApplicationConfiguration applicationConfiguration; private final ApplicationConfiguration applicationConfiguration;
...@@ -65,7 +64,6 @@ public class UtilResource ...@@ -65,7 +64,6 @@ public class UtilResource
@Path("/auth") @Path("/auth")
public Response auth(@Auth User user) throws IOException public Response auth(@Auth User user) throws IOException
{ {
String redirectHtml = new String(FileUtils.readFileToByteArray(new File("service/src/main/resources/assets/redirect.html")));
return Response.ok() return Response.ok()
.entity(redirectHtml) .entity(redirectHtml)
.header(HttpHeaders.CONTENT_TYPE, "text/html") .header(HttpHeaders.CONTENT_TYPE, "text/html")
......
<!DOCTYPE html>
<html lang="en" ng-app="ctfApp">
<head>
</head>
<script type="text/javascript">
window.location = "http://" + window.location.host;
</script>
</body>
</html>
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
$location.path('/'); $location.path('/');
AuthenticationService.setCredentials($scope.username, $scope.password, response.team); AuthenticationService.setCredentials($scope.username, $scope.password, response.team);
// redirect to additional external auth point // redirect to additional external auth point
$window.location.href = "http://"+$scope.username+":"+$scope.password+"@52.25.28.64/:8080/api/v1/auth"; $window.location.href = "http://"+$scope.username+":"+$scope.password+"@52.28.244.24:8080/api/v1/auth";
} else { } else {
Materialize.toast('Błąd logowania! Spróbuj jeszcze raz.', 5000 ,'toast-error'); Materialize.toast('Błąd logowania! Spróbuj jeszcze raz.', 5000 ,'toast-error');
$scope.dataLoading = false; $scope.dataLoading = false;
...@@ -23,4 +23,4 @@ ...@@ -23,4 +23,4 @@
}]); }]);
})(); })();
\ No newline at end of file
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
}]); }]);
app.factory('AppSettings', function() { app.factory('AppSettings', function() {
var dev = "localhost:8080/api/v1", prod = "52.25.28.64:8080/api/v1"; var dev = "localhost:8080/api/v1", prod = "52.28.244.24:8080/api/v1";
return { return {
apiAddress: prod apiAddress: prod
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment