Change fic2014 to fic

This commit is contained in:
nemunaire 2014-11-05 17:46:18 +01:00
parent 4a67552a29
commit cfc7c2ba0b
11 changed files with 47 additions and 47 deletions

View File

@ -12,34 +12,34 @@ RUN apt-get install -y nginx-light php5-fpm mysql-server php5-mysql php5-mcrypt
# Copying files ####################################################### # Copying files #######################################################
ADD . /var/www/fic2014-server/ ADD . /var/www/fic-server/
# Configure softwares ################################################# # Configure softwares #################################################
RUN ln -sf /var/www/fic2014-server/nginx-server.conf /etc/nginx/sites-enabled/default RUN ln -sf /var/www/fic-server/nginx-server.conf /etc/nginx/sites-enabled/default
RUN ln -sf /var/www/fic2014-server/php-fpm.conf /etc/php5/fpm/pool.d/www.conf RUN ln -sf /var/www/fic-server/php-fpm.conf /etc/php5/fpm/pool.d/www.conf
# Generate test certificates ########################################## # Generate test certificates ##########################################
RUN cd /var/www/fic2014-server/misc; bash ./CA.sh -newca RUN cd /var/www/fic-server/misc; bash ./CA.sh -newca
# Import DB ########################################################### # Import DB ###########################################################
RUN service mysql start && echo "CREATE DATABASE fic2014;" | mysql -u root && cat /var/www/fic2014-server/db/fic2014.sql | mysql -u root fic2014 RUN service mysql start && echo "CREATE DATABASE fic;" | mysql -u root && cat /var/www/fic-server/db/fic2014.sql | mysql -u root fic
# Uncomment the following line to fill with random values # Uncomment the following line to fill with random values
#RUN cat /var/www/fic2014-server/db/feed.sql | mysql -u root fic2014 #RUN cat /var/www/fic-server/db/feed.sql | mysql -u root fic
# Configure site ###################################################### # Configure site ######################################################
RUN ln -sf /var/www/fic2014-server/onyx/config/sample.root.xml /var/www/fic2014-server/onyx/config/root.xml RUN ln -sf /var/www/fic-server/onyx/config/sample.root.xml /var/www/fic-server/onyx/config/root.xml
RUN sed -i "s/1386827772/`date -d 'now + 4 hours' +%s`/" /var/www/fic2014-server/onyx/config/root.xml RUN sed -i "s/1386827772/`date -d 'now + 4 hours' +%s`/" /var/www/fic-server/onyx/config/root.xml
RUN sed -i "s/challenge-public//" /var/www/fic2014-server/onyx/config/root.xml RUN sed -i "s/challenge-public//" /var/www/fic-server/onyx/config/root.xml
RUN chmod 777 /var/www/fic2014-server/onyx/cache/ /var/www/fic2014-server/onyx/cache/templates/cache/ /var/www/fic2014-server/onyx/cache/templates/compile/ RUN chmod 777 /var/www/fic-server/onyx/cache/ /var/www/fic-server/onyx/cache/templates/cache/ /var/www/fic-server/onyx/cache/templates/compile/
# ENVIRONNEMENT ####################################################### # ENVIRONNEMENT #######################################################
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
EXPOSE 80/tcp 443/tcp EXPOSE 80/tcp 443/tcp
CMD ["sh", "-c", "cd /var/www/fic2014-server/misc; if ! [ -f server.crt ]; then bash ./CA.sh -newserver; fi; service nginx start && service php5-fpm start && service mysql start && /bin/bash"] CMD ["sh", "-c", "cd /var/www/fic-server/misc; if ! [ -f server.crt ]; then bash ./CA.sh -newserver; fi; service nginx start && service php5-fpm start && service mysql start && /bin/bash"]

View File

@ -14,19 +14,19 @@ The easiest way to have a working server is to build a Docker container.
First, build the container with the following command: First, build the container with the following command:
``` ```
docker build -t fic2014 . docker build -t fic .
``` ```
Then, run it with: Then, run it with:
``` ```
docker run -t -i -P fic2014 docker run -t -i -P fic
``` ```
It will ask you for a passphrase, you must provide one with at least 4 It will ask you for a passphrase, you must provide one with at least 4
characters. This key is used to generate the server certificate. characters. This key is used to generate the server certificate.
When you see: When you see:
``` ```
root@xxxxxxxxxxxx:/var/www/fic2014-server/misc# root@xxxxxxxxxxxx:/var/www/fic-server/misc#
``` ```
congratulations, the container is running! congratulations, the container is running!

View File

@ -15,7 +15,7 @@ fi
if mount | grep "$TO_BCKP" > /dev/null if mount | grep "$TO_BCKP" > /dev/null
then then
mysqldump -u backup --password="Riuy6of sae^W0Sh" fic2014 > "$TO_BCKP"/db/`date +%Y%m%d-%H%M`.sql mysqldump -u backup --password="Riuy6of sae^W0Sh" fic > "$TO_BCKP"/db/`date +%Y%m%d-%H%M`.sql
rsync -avL misc "$TO_BCKP" rsync -avL misc "$TO_BCKP"
rsync -avL .git "$TO_BCKP" rsync -avL .git "$TO_BCKP"

View File

@ -62,7 +62,7 @@ case $1 in
ESCAPED=$(echo "${TOP_DIR}" | sed 's/[\/\.]/\\&/g') ESCAPED=$(echo "${TOP_DIR}" | sed 's/[\/\.]/\\&/g')
echo -e "${GREEN}Making CA key and csr${COLOR_RST}" echo -e "${GREEN}Making CA key and csr${COLOR_RST}"
sed -i 's/=.*#COMMONNAME/= FIC2014 CA #COMMONNAME/' $OPENSSL_CONF sed -i 's/=.*#COMMONNAME/= FIC CA #COMMONNAME/' $OPENSSL_CONF
sed -i "s/=.*#DIR/= ${ESCAPED} #DIR/" $OPENSSL_CONF sed -i "s/=.*#DIR/= ${ESCAPED} #DIR/" $OPENSSL_CONF
type pwgen > /dev/null type pwgen > /dev/null

View File

@ -39,7 +39,7 @@ default_ca = CA_default # The default ca section
#################################################################### ####################################################################
[ CA_default ] [ CA_default ]
dir = /var/www/fic2014-server/misc//pki #DIR # Where everything is kept dir = /var/www/fic-server/misc//pki #DIR # Where everything is kept
certs = $dir/certs # Where the issued certs are kept certs = $dir/certs # Where the issued certs are kept
crl_dir = $dir/crl # Where the issued crl are kept crl_dir = $dir/crl # Where the issued crl are kept
database = $dir/index.txt # database index file. database = $dir/index.txt # database index file.
@ -162,7 +162,7 @@ challengePassword_max = 20
unstructuredName = An optional company name unstructuredName = An optional company name
[CORE_CA] [CORE_CA]
nsComment = "FIC2014 CA" nsComment = "FIC CA"
basicConstraints = critical,CA:TRUE,pathlen:1 basicConstraints = critical,CA:TRUE,pathlen:1
subjectKeyIdentifier = hash subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer:always authorityKeyIdentifier = keyid,issuer:always
@ -173,7 +173,7 @@ subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer authorityKeyIdentifier=keyid:always,issuer
[SERVER_SSL] [SERVER_SSL]
nsComment = "FIC2014 Server" nsComment = "FIC Server"
subjectKeyIdentifier = hash subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer:always authorityKeyIdentifier = keyid,issuer:always
issuerAltName = issuer:copy issuerAltName = issuer:copy
@ -185,7 +185,7 @@ subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer authorityKeyIdentifier=keyid:always,issuer
[CLIENT_SSL] [CLIENT_SSL]
nsComment = "FIC2014 Client" nsComment = "FIC Client"
subjectKeyIdentifier = hash subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer:always authorityKeyIdentifier = keyid,issuer:always
issuerAltName = issuer:copy issuerAltName = issuer:copy

View File

@ -1,7 +1,7 @@
access_log /var/log/nginx/fic.access_log; access_log /var/log/nginx/fic.access_log;
error_log /var/log/nginx/fic.error_log; error_log /var/log/nginx/fic.error_log;
root /var/www/fic2014-server/htdocs; root /var/www/fic-server/htdocs;
index index.php; index index.php;
add_header Strict-Transport-Security "max-age=2592000; includeSubdomains"; add_header Strict-Transport-Security "max-age=2592000; includeSubdomains";
@ -19,7 +19,7 @@
location /files location /files
{ {
root /var/www/fic2014-server/; root /var/www/fic-server/;
} }
location ~* \favicon.ico$ { location ~* \favicon.ico$ {

View File

@ -2,17 +2,17 @@ server {
listen 443 ssl; listen 443 ssl;
listen [::]:443 ipv6only=on ssl; listen [::]:443 ipv6only=on ssl;
ssl_certificate /var/www/fic2014-server/misc/server.crt; ssl_certificate /var/www/fic-server/misc/server.crt;
ssl_certificate_key /var/www/fic2014-server/misc/server.key; ssl_certificate_key /var/www/fic-server/misc/server.key;
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ssl_prefer_server_ciphers on; # ssl_prefer_server_ciphers on;
# ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:!ADH:!AECDH:!MD5:!DSS; # ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:!ADH:!AECDH:!MD5:!DSS;
include /var/www/fic2014-server/nginx-server-common.conf; include /var/www/fic-server/nginx-server-common.conf;
} }
server { server {
listen 80; listen 80;
include /var/www/fic2014-server/nginx-server-common.conf; include /var/www/fic-server/nginx-server-common.conf;
} }

View File

@ -13,21 +13,21 @@ server {
listen 443 ssl; listen 443 ssl;
listen [::]:443 ipv6only=on ssl; listen [::]:443 ipv6only=on ssl;
root /var/www/fic2014-server/htdocs/; root /var/www/fic-server/htdocs/;
server_tokens off; server_tokens off;
access_log /var/log/nginx/fic.access_log; access_log /var/log/nginx/fic.access_log;
error_log /var/log/nginx/fic.error_log; error_log /var/log/nginx/fic.error_log;
ssl_certificate /var/www/fic2014-server/server.crt; ssl_certificate /var/www/fic-server/server.crt;
ssl_certificate_key /var/www/fic2014-server/server.key; ssl_certificate_key /var/www/fic-server/server.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on; ssl_prefer_server_ciphers on;
ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:!ADH:!AECDH:!MD5:!DSS; ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:!ADH:!AECDH:!MD5:!DSS;
ssl_client_certificate /var/www/fic2014-server/cacert.crt; ssl_client_certificate /var/www/fic-server/cacert.crt;
ssl_verify_client optional; ssl_verify_client optional;
ssl_crl /var/www/fic2014-server/crl.pem; ssl_crl /var/www/fic-server/crl.pem;
add_header Strict-Transport-Security "max-age=2592000; includeSubdomains"; add_header Strict-Transport-Security "max-age=2592000; includeSubdomains";
@ -70,17 +70,17 @@ server {
if ($ssl_client_s_dn ~ "/C=FR/ST=France/O=Epita/OU=SRS/CN=De_Priest_Tjonck/") { set $team 365; } if ($ssl_client_s_dn ~ "/C=FR/ST=France/O=Epita/OU=SRS/CN=De_Priest_Tjonck/") { set $team 365; }
if ($team) { if ($team) {
root /var/www/fic2014-server/teams/$team$1; root /var/www/fic-server/teams/$team$1;
rewrite ^/([0-9]+-?[a-zA-Z0-9_-]*)/([a-zA-Z0-9_]+)/submission$ /submission.php?team=$team&theme=$1&exercice=$2 last; rewrite ^/([0-9]+-?[a-zA-Z0-9_-]*)/([a-zA-Z0-9_]+)/submission$ /submission.php?team=$team&theme=$1&exercice=$2 last;
} }
if ($team = 0) { if ($team = 0) {
root /var/www/fic2014-server/htdocs/; root /var/www/fic-server/htdocs/;
} }
} }
location /errors location /errors
{ {
root /var/www/fic2014-server/; root /var/www/fic-server/;
} }
location /connected location /connected
@ -90,7 +90,7 @@ server {
location /files location /files
{ {
root /var/www/fic2014-server/; root /var/www/fic-server/;
aio on; aio on;
directio 512; directio 512;
@ -98,14 +98,14 @@ server {
} }
location ~* \favicon.ico$ { location ~* \favicon.ico$ {
root /var/www/fic2014-server/htdocs/; root /var/www/fic-server/htdocs/;
access_log off; access_log off;
expires 1d; expires 1d;
add_header Cache-Control public; add_header Cache-Control public;
} }
location ~ ^/(assets|img|js|css|fonts)/ { location ~ ^/(assets|img|js|css|fonts)/ {
root /var/www/fic2014-server/htdocs/; root /var/www/fic-server/htdocs/;
access_log off; access_log off;
expires 7d; expires 7d;
add_header Cache-Control public; add_header Cache-Control public;
@ -117,7 +117,7 @@ server {
location /submission.php location /submission.php
{ {
root /var/www/fic2014-server/; root /var/www/fic-server/;
limit_rate 4k; limit_rate 4k;

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configs active="1" root="/var/www/fic2014-server/htdocs/" cache="1"> <configs active="1" root="/var/www/fic-server/htdocs/" cache="1">
<config match="index.php"> <config match="index.php">
<var name="end_challenge">1386827772</var> <var name="end_challenge">1386827772</var>
<var name="files_dir">/var/www/fic2014-server/files/</var> <var name="files_dir">/var/www/fic-server/files/</var>
<var name="misc_dir">/var/www/fic2014-server/misc/</var> <var name="misc_dir">/var/www/fic-server/misc/</var>
<var name="submission_dir">/var/www/fic2014-server/submission/</var> <var name="submission_dir">/var/www/fic-server/submission/</var>
<var name="prefix_public">challenge-public</var> <var name="prefix_public">challenge-public</var>
<var name="prefix_teams">challenge</var> <var name="prefix_teams">challenge</var>
<var name="prefix_admin">challenge-admin</var> <var name="prefix_admin">challenge-admin</var>

View File

@ -2,7 +2,7 @@
if(!defined('ONYX')) exit; if(!defined('ONYX')) exit;
$___profile['db'] = 'fic2014'; $___profile['db'] = 'fic';
$___profile['host'] = 'localhost'; $___profile['host'] = 'localhost';
$___profile['user'] = 'root'; $___profile['user'] = 'root';
$___profile['pass'] = ''; $___profile['pass'] = '';

View File

@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>{block name=title}Challenge FIC2014{/block}</title> <title>{block name=title}Challenge FIC2015{/block}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="{$SALT_CDN}/css/bootstrap.min.css" rel="stylesheet" media="screen"> <link href="{$SALT_CDN}/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="{$SALT_CDN}/css/bootstrap-theme.min.css" rel="stylesheet" media="screen"> <link href="{$SALT_CDN}/css/bootstrap-theme.min.css" rel="stylesheet" media="screen">
@ -35,7 +35,7 @@
<div class="container"> <div class="container">
<hr> <hr>
<footer> <footer>
<p>&copy; <a href="http://www.forum-fic.com/">FIC</a> 2014 <p>&copy; <a href="http://www.forum-fic.com/">FIC</a> 2015
&copy; <a href="http://www.epita.fr/">EPITA</a></p> &copy; <a href="http://www.epita.fr/">EPITA</a></p>
</footer> </footer>
</div> </div>