Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulu300 committed Apr 1, 2018
2 parents 3de3187 + eba03ad commit eee739d
Show file tree
Hide file tree
Showing 40 changed files with 380 additions and 281 deletions.
8 changes: 6 additions & 2 deletions install/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ then
fi
source /etc/environment
systemctl restart docker
docker pull ubuntu
docker run --name code-chill -dti ubuntu /bin/bash

git clone https://github.com/CodeChillAlluna/DockerFiles.git
docker build -f DockerFiles/CodeChill-Ubuntu/DockerFile -t codechill/ubuntu-base .
docker build -f DockerFiles/CodeChill-Ubuntu-User/DockerFile -t codechill/ubuntu-base-user .
rm -R DockerFiles
docker run --name codechill -dti codechill/ubuntu-base-user /bin/bash
10 changes: 7 additions & 3 deletions install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ StartLimitBurst=3
StartLimitInterval=60s\n
[Install]
WantedBy=multi-user.target" > /lib/systemd/system/docker.service
systemctl daemon-reload
systemctl daemon-reload
systemctl restart docker
export DOCKER_HOST=tcp://localhost:2375
if ! grep -qF "DOCKER_HOST=tcp://localhost:2375" /etc/environment
Expand All @@ -150,8 +150,12 @@ then
fi
source /etc/environment
systemctl restart docker
docker pull ubuntu
docker run --name code-chill -dti ubuntu /bin/bash

git clone https://github.com/CodeChillAlluna/DockerFiles.git
docker build -f DockerFiles/CodeChill-Ubuntu/DockerFile -t codechill/ubuntu-base .
docker build -f DockerFiles/CodeChill-Ubuntu-User/DockerFile -t codechill/ubuntu-base-user .
rm -R DockerFiles
docker run --name codechill -dti codechill/ubuntu-base-user /bin/bash

# Install nginx
sudo apt-get install nginx
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import withAuth from "./components/withAuth";

class App extends React.Component<any, any> {
Auth: AuthService;

constructor(props?: any, context?: any) {
super(props, context);
this.Auth = new AuthService();
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/AuthService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export default class AuthService {
if (response.status >= 200 && response.status < 400) { // Success status lies between 200 to 300
return response;
} else {
var error = new Error(response.statusText);
let error = new Error(response.statusText);
// error.response = response
throw error;
}
Expand Down
30 changes: 15 additions & 15 deletions src/client/src/components/CodeChillRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ import UserProfile from "./user/UserProfile";
import NotFound from "./NotFound";
import UserForgotPassword from "./user/UserForgotPassword";
import UserResetPassword from "./user/UserResetPassword";
var config = require("../../package.json");
const config = require("../../package.json");

export default class CodeChillRouter extends React.Component<any, any> {

render() {
return (
<main>
<BrowserRouter basename={config.homepage}>
<Switch>

<Route
exact={true}
<Route
exact={true}
path={R.HOME}
component={App}
/>
Expand All @@ -29,33 +29,33 @@ export default class CodeChillRouter extends React.Component<any, any> {
path={R.PROFILE}
component={UserProfile}
/>
<Route
<Route
exact={true}
path={R.FORGOT_PASSWORD}
component={UserForgotPassword}
component={UserForgotPassword}
/>
<Route
<Route
exact={true}
path={R.RESET_PASSWORD}
component={UserResetPassword}
component={UserResetPassword}
/>
<Route
<Route
exact={true}
path={R.LOGIN}
component={UserConnection}
component={UserConnection}
/>
<Route
<Route
exact={true}
path={R.SIGNUP}
path={R.SIGNUP}
// render={(props) => <UserConnection props={...props} />}
component={UserSignUp}
component={UserSignUp}
/>
<Route
exact={true}
path={R.TERMINAL}
component={CodeChillXterm}
component={CodeChillXterm}
/>
<Route
<Route
path={R.NOTFOUND}
component={NotFound}
/>
Expand Down
7 changes: 3 additions & 4 deletions src/client/src/components/CodeChillXterm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as fit from "xterm/build/addons/fit/fit";
import * as ClassName from "classnames";
import AuthService from "../AuthService";
import withAuth from "./withAuth";
var config = require("../../package.json");
const config = require("../../package.json");

export interface IxTermProps extends React.DOMAttributes<{}> {
onChange?: (e: any) => void;
Expand All @@ -22,7 +22,6 @@ export interface IxTermProps extends React.DOMAttributes<{}> {
history?: any;
token?: any;
user?: any;

}

export interface IxTermState {
Expand Down Expand Up @@ -57,7 +56,7 @@ attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1`);
}

componentDidMount() {
var xt = this;
let xt = this;
this.xterm.open(this.refs.container);
(this.xterm as any).fit();
this.webSocket.addEventListener("open", function () {
Expand Down Expand Up @@ -86,7 +85,7 @@ attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1`);
this.props.className
);
const container = "container";
const css = `.ui.container{
const css = `.ui.container{
width: 100%!important;
margin-left: 0!important;
margin-right: 0!important;
Expand Down
10 changes: 5 additions & 5 deletions src/client/src/components/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import { Link } from "react-router-dom";
import { formatRoute } from "react-router-named-routes";
import { TERMINAL, HOME, LOGIN, PROFILE } from "../Routes";
const logo = require("../resources/logocodeandchill.png");

const NavBarChildren = ({ children }) => (
<Container style={{ marginTop: "5em" }}>{children}</Container>
);

export default class NavBar extends React.Component<any, any> {

Auth: AuthService;
Expand All @@ -33,7 +33,7 @@ export default class NavBar extends React.Component<any, any> {
visible: false
};
}

render() {
const { children } = this.props;
let rmenu: any;
Expand Down Expand Up @@ -121,14 +121,14 @@ export default class NavBar extends React.Component<any, any> {

private handlePusher() {
const { visible } = this.state;

if (visible) {
this.setState(
{ visible: false }
);
}
}

private handleToggle() {
this.setState({ visible: !this.state.visible });
}
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/components/user/DeleteUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class DeleteUser extends React.Component<any, any> {
render() {
return (
<div>
<Button
<Button
color="teal"
fluid={true}
size="medium"
Expand Down
4 changes: 2 additions & 2 deletions src/client/src/components/user/UserConnection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class UserConnection extends React.Component<any, any> {
<Image src={logo} />
{" "}Log-in to your account
</Header>
<Form
<Form
size="large"
onSubmit={this.handleFormSubmit}
>
Expand All @@ -67,7 +67,7 @@ export default class UserConnection extends React.Component<any, any> {
onChange={this.handleChange}
/>

<Button
<Button
color="teal"
fluid={true}
size="large"
Expand Down
8 changes: 4 additions & 4 deletions src/client/src/components/user/UserForgotPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class UserForgotPassword extends React.Component<any, any> {
<Image src={logo} />
{" "}Recover your password
</Header>
<Form
<Form
error={true}
success={true}
size="large"
Expand All @@ -68,7 +68,7 @@ export default class UserForgotPassword extends React.Component<any, any> {
onChange={this.handleChange}
/>
{this.displayErrors}
<Button
<Button
color="teal"
fluid={true}
size="large"
Expand Down Expand Up @@ -111,7 +111,7 @@ export default class UserForgotPassword extends React.Component<any, any> {
<Message.Header>Request sent</Message.Header>
<p>{content}</p>
</Message>
)
)
}
}
);
Expand All @@ -125,7 +125,7 @@ export default class UserForgotPassword extends React.Component<any, any> {
<Message.Header>Request failed</Message.Header>
<p>{content}</p>
</Message>
)
)
}
}
);
Expand Down
6 changes: 3 additions & 3 deletions src/client/src/components/user/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class UserProfile extends React.Component<any, any> {
<NavBar history={this.props.history} user={this.props.user}>
<Grid>
<Grid.Column width={12}>
<Form
<Form
success={true}
error={true}
size="tiny"
Expand All @@ -80,7 +80,7 @@ class UserProfile extends React.Component<any, any> {
name="email"
onChange={this.handleChange}
/>
<Button
<Button
color="teal"
fluid={true}
size="large"
Expand All @@ -93,7 +93,7 @@ class UserProfile extends React.Component<any, any> {
</Form>
</Grid.Column>
<Grid.Column width={4}>
<DeleteUser
<DeleteUser
history={this.props.history}
user={this.props.user}
/>
Expand Down
8 changes: 4 additions & 4 deletions src/client/src/components/user/UserResetPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class UserResetPassword extends React.Component<any, any> {
<Image src={logo} />
{" "}Reset your password
</Header>
<Form
<Form
error={true}
success={true}
size="large"
Expand Down Expand Up @@ -102,7 +102,7 @@ export default class UserResetPassword extends React.Component<any, any> {
onChange={this.handleChange}
/>
{this.displayErrors}
<Button
<Button
color="teal"
fluid={true}
size="large"
Expand Down Expand Up @@ -145,7 +145,7 @@ export default class UserResetPassword extends React.Component<any, any> {
<Message.Header>Password successfuly changed</Message.Header>
<p>{content}</p>
</Message>
)
)
}
}
);
Expand All @@ -159,7 +159,7 @@ export default class UserResetPassword extends React.Component<any, any> {
<Message.Header>Request failed</Message.Header>
<p>{content}</p>
</Message>
)
)
}
}
);
Expand Down
4 changes: 2 additions & 2 deletions src/client/src/components/user/UserSignUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class UserSignUp extends React.Component<any, any> {
<Image src={logo} />
{" "}Register your account
</Header>
<Form
<Form
error={true}
success={true}
size="large"
Expand Down Expand Up @@ -116,7 +116,7 @@ export default class UserSignUp extends React.Component<any, any> {
onChange={this.handleChange}
/>

<Button
<Button
color="teal"
fluid={true}
size="large"
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/components/withAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function withAuth(AuthComponent: any) {
);
} else {
return null;
}
}
}
};
}
24 changes: 24 additions & 0 deletions src/spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,30 @@
</properties>

<dependencies>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package fr.codechill.spring.exception;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

@ResponseStatus(value=HttpStatus.FORBIDDEN) // 403
public class AccessDeniedException extends Exception {

public AccessDeniedException (String message) {
super(message);
}
}
Loading

0 comments on commit eee739d

Please sign in to comment.