Change fic2014 to fic
This commit is contained in:
parent
4a67552a29
commit
cfc7c2ba0b
22
Dockerfile
22
Dockerfile
@ -12,34 +12,34 @@ RUN apt-get install -y nginx-light php5-fpm mysql-server php5-mysql php5-mcrypt
|
||||
|
||||
# Copying files #######################################################
|
||||
|
||||
ADD . /var/www/fic2014-server/
|
||||
ADD . /var/www/fic-server/
|
||||
|
||||
# Configure softwares #################################################
|
||||
|
||||
RUN ln -sf /var/www/fic2014-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/nginx-server.conf /etc/nginx/sites-enabled/default
|
||||
RUN ln -sf /var/www/fic-server/php-fpm.conf /etc/php5/fpm/pool.d/www.conf
|
||||
|
||||
# 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 ###########################################################
|
||||
|
||||
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
|
||||
#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 ######################################################
|
||||
|
||||
RUN ln -sf /var/www/fic2014-server/onyx/config/sample.root.xml /var/www/fic2014-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/challenge-public//" /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/fic-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 #######################################################
|
||||
|
||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
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"]
|
||||
|
@ -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:
|
||||
```
|
||||
docker build -t fic2014 .
|
||||
docker build -t fic .
|
||||
```
|
||||
|
||||
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
|
||||
characters. This key is used to generate the server certificate.
|
||||
|
||||
When you see:
|
||||
```
|
||||
root@xxxxxxxxxxxx:/var/www/fic2014-server/misc#
|
||||
root@xxxxxxxxxxxx:/var/www/fic-server/misc#
|
||||
```
|
||||
congratulations, the container is running!
|
||||
|
||||
|
@ -15,7 +15,7 @@ fi
|
||||
if mount | grep "$TO_BCKP" > /dev/null
|
||||
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 .git "$TO_BCKP"
|
||||
|
@ -62,7 +62,7 @@ case $1 in
|
||||
ESCAPED=$(echo "${TOP_DIR}" | sed 's/[\/\.]/\\&/g')
|
||||
|
||||
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
|
||||
|
||||
type pwgen > /dev/null
|
||||
|
@ -15,7 +15,7 @@ oid_section = new_oids
|
||||
# To use this configuration file with the "-extfile" option of the
|
||||
# "openssl x509" utility, name here the section containing the
|
||||
# X.509v3 extensions to use:
|
||||
# extensions =
|
||||
# extensions =
|
||||
# (Alternatively, use a configuration file that has only
|
||||
# X.509v3 extensions in its main [= default] section.)
|
||||
|
||||
@ -39,7 +39,7 @@ default_ca = CA_default # The default ca section
|
||||
####################################################################
|
||||
[ 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
|
||||
crl_dir = $dir/crl # Where the issued crl are kept
|
||||
database = $dir/index.txt # database index file.
|
||||
@ -111,7 +111,7 @@ x509_extensions = v3_ca # The extentions to add to the self signed cert
|
||||
# input_password = secret
|
||||
# output_password = secret
|
||||
|
||||
# This sets a mask for permitted string types. There are several options.
|
||||
# This sets a mask for permitted string types. There are several options.
|
||||
# default: PrintableString, T61String, BMPString.
|
||||
# pkix : PrintableString, BMPString (PKIX recommendation before 2004)
|
||||
# utf8only: only UTF8Strings (PKIX recommendation after 2004).
|
||||
@ -162,7 +162,7 @@ challengePassword_max = 20
|
||||
unstructuredName = An optional company name
|
||||
|
||||
[CORE_CA]
|
||||
nsComment = "FIC2014 CA"
|
||||
nsComment = "FIC CA"
|
||||
basicConstraints = critical,CA:TRUE,pathlen:1
|
||||
subjectKeyIdentifier = hash
|
||||
authorityKeyIdentifier = keyid,issuer:always
|
||||
@ -173,7 +173,7 @@ subjectKeyIdentifier=hash
|
||||
authorityKeyIdentifier=keyid:always,issuer
|
||||
|
||||
[SERVER_SSL]
|
||||
nsComment = "FIC2014 Server"
|
||||
nsComment = "FIC Server"
|
||||
subjectKeyIdentifier = hash
|
||||
authorityKeyIdentifier = keyid,issuer:always
|
||||
issuerAltName = issuer:copy
|
||||
@ -185,7 +185,7 @@ subjectKeyIdentifier=hash
|
||||
authorityKeyIdentifier=keyid:always,issuer
|
||||
|
||||
[CLIENT_SSL]
|
||||
nsComment = "FIC2014 Client"
|
||||
nsComment = "FIC Client"
|
||||
subjectKeyIdentifier = hash
|
||||
authorityKeyIdentifier = keyid,issuer:always
|
||||
issuerAltName = issuer:copy
|
||||
|
@ -1,7 +1,7 @@
|
||||
access_log /var/log/nginx/fic.access_log;
|
||||
error_log /var/log/nginx/fic.error_log;
|
||||
|
||||
root /var/www/fic2014-server/htdocs;
|
||||
root /var/www/fic-server/htdocs;
|
||||
index index.php;
|
||||
|
||||
add_header Strict-Transport-Security "max-age=2592000; includeSubdomains";
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
location /files
|
||||
{
|
||||
root /var/www/fic2014-server/;
|
||||
root /var/www/fic-server/;
|
||||
}
|
||||
|
||||
location ~* \favicon.ico$ {
|
||||
|
@ -2,17 +2,17 @@ server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ipv6only=on ssl;
|
||||
|
||||
ssl_certificate /var/www/fic2014-server/misc/server.crt;
|
||||
ssl_certificate_key /var/www/fic2014-server/misc/server.key;
|
||||
ssl_certificate /var/www/fic-server/misc/server.crt;
|
||||
ssl_certificate_key /var/www/fic-server/misc/server.key;
|
||||
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
# ssl_prefer_server_ciphers on;
|
||||
# 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 {
|
||||
listen 80;
|
||||
|
||||
include /var/www/fic2014-server/nginx-server-common.conf;
|
||||
include /var/www/fic-server/nginx-server-common.conf;
|
||||
}
|
||||
|
24
nginx.conf
24
nginx.conf
@ -13,21 +13,21 @@ server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ipv6only=on ssl;
|
||||
|
||||
root /var/www/fic2014-server/htdocs/;
|
||||
root /var/www/fic-server/htdocs/;
|
||||
|
||||
server_tokens off;
|
||||
|
||||
access_log /var/log/nginx/fic.access_log;
|
||||
error_log /var/log/nginx/fic.error_log;
|
||||
|
||||
ssl_certificate /var/www/fic2014-server/server.crt;
|
||||
ssl_certificate_key /var/www/fic2014-server/server.key;
|
||||
ssl_certificate /var/www/fic-server/server.crt;
|
||||
ssl_certificate_key /var/www/fic-server/server.key;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_prefer_server_ciphers on;
|
||||
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_crl /var/www/fic2014-server/crl.pem;
|
||||
ssl_crl /var/www/fic-server/crl.pem;
|
||||
|
||||
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 ($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;
|
||||
}
|
||||
if ($team = 0) {
|
||||
root /var/www/fic2014-server/htdocs/;
|
||||
root /var/www/fic-server/htdocs/;
|
||||
}
|
||||
}
|
||||
|
||||
location /errors
|
||||
{
|
||||
root /var/www/fic2014-server/;
|
||||
root /var/www/fic-server/;
|
||||
}
|
||||
|
||||
location /connected
|
||||
@ -90,7 +90,7 @@ server {
|
||||
|
||||
location /files
|
||||
{
|
||||
root /var/www/fic2014-server/;
|
||||
root /var/www/fic-server/;
|
||||
|
||||
aio on;
|
||||
directio 512;
|
||||
@ -98,14 +98,14 @@ server {
|
||||
}
|
||||
|
||||
location ~* \favicon.ico$ {
|
||||
root /var/www/fic2014-server/htdocs/;
|
||||
root /var/www/fic-server/htdocs/;
|
||||
access_log off;
|
||||
expires 1d;
|
||||
add_header Cache-Control public;
|
||||
}
|
||||
|
||||
location ~ ^/(assets|img|js|css|fonts)/ {
|
||||
root /var/www/fic2014-server/htdocs/;
|
||||
root /var/www/fic-server/htdocs/;
|
||||
access_log off;
|
||||
expires 7d;
|
||||
add_header Cache-Control public;
|
||||
@ -117,7 +117,7 @@ server {
|
||||
|
||||
location /submission.php
|
||||
{
|
||||
root /var/www/fic2014-server/;
|
||||
root /var/www/fic-server/;
|
||||
|
||||
limit_rate 4k;
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?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">
|
||||
<var name="end_challenge">1386827772</var>
|
||||
<var name="files_dir">/var/www/fic2014-server/files/</var>
|
||||
<var name="misc_dir">/var/www/fic2014-server/misc/</var>
|
||||
<var name="submission_dir">/var/www/fic2014-server/submission/</var>
|
||||
<var name="files_dir">/var/www/fic-server/files/</var>
|
||||
<var name="misc_dir">/var/www/fic-server/misc/</var>
|
||||
<var name="submission_dir">/var/www/fic-server/submission/</var>
|
||||
<var name="prefix_public">challenge-public</var>
|
||||
<var name="prefix_teams">challenge</var>
|
||||
<var name="prefix_admin">challenge-admin</var>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
if(!defined('ONYX')) exit;
|
||||
|
||||
$___profile['db'] = 'fic2014';
|
||||
$___profile['db'] = 'fic';
|
||||
$___profile['host'] = 'localhost';
|
||||
$___profile['user'] = 'root';
|
||||
$___profile['pass'] = '';
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<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">
|
||||
<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">
|
||||
@ -35,7 +35,7 @@
|
||||
<div class="container">
|
||||
<hr>
|
||||
<footer>
|
||||
<p>© <a href="http://www.forum-fic.com/">FIC</a> 2014
|
||||
<p>© <a href="http://www.forum-fic.com/">FIC</a> 2015
|
||||
© <a href="http://www.epita.fr/">EPITA</a></p>
|
||||
</footer>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user