Commit 20f29eb8 authored by root's avatar root
parents c22082a5 b89cc910
FROM ubuntu:16.04
MAINTAINER Sebastien.Carrere@toulouse.inra.fr
MAINTAINER sebastien.carrere@inra.fr
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
RUN apt-get -q update && \
......@@ -21,19 +21,14 @@ WORKDIR $ROOTDIR
RUN chown -R www-data.www-data $ROOTDIR
RUN a2enmod rewrite
RUN a2enmod cgi
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
RUN cp $ROOTDIR/site/cfg/site-docker.cfg $ROOTDIR/site/cfg/site.cfg
RUN cp $ROOTDIR/site/cfg/authentication-docker.cfg $ROOTDIR/site/cfg/authentication.cfg
RUN export USER=root && ./bin/int/admin_install.pl --docker
RUN cp $ROOTDIR/site/cfg/apache-docker.conf /etc/apache2/sites-available/000-default.conf
RUN a2enmod rewrite && \
a2enmod cgi && \
echo "ServerName localhost" >> /etc/apache2/apache2.conf && \
cp $ROOTDIR/site/cfg/site-docker.cfg $ROOTDIR/site/cfg/site.cfg && \
cp $ROOTDIR/site/cfg/authentication-docker.cfg $ROOTDIR/site/cfg/authentication.cfg && \
export USER=root && ./bin/int/admin_install.pl --docker && \
cp $ROOTDIR/site/cfg/apache-docker.conf /etc/apache2/sites-available/000-default.conf
WORKDIR $ROOTDIR/site
CMD ["sh","-c","service apache2 start && /bin/bash && export USER=root"]
......@@ -9,7 +9,9 @@
<li><a href="#prerequisites">PREREQUISITES</a></li>
<li><a href="#build">BUILD</a></li>
<li><a href="#configure">CONFIGURE</a></li>
<li><a href="#hurry-want-to-run-locally-in-single-user-mode-">HURRY ? WANT TO RUN LOCALLY IN SINGLE USER MODE ?</a></li>
<li><a href="#local-configuration">LOCAL CONFIGURATION</a></li>
<li><a href="#standard-configuration">STANDARD CONFIGURATION</a></li>
<li><a href="#create-admin-user">CREATE ADMIN USER</a></li>
<li><a href="#run-app">RUN APP</a></li>
<li><a href="#stop-app">STOP APP</a></li>
......@@ -76,6 +78,14 @@ OPTIONNAL:
If you want to create users from host server (not from Docker image), you will need Perl and this perl module
Apache::Htpasswd perl
### HURRY ? WANT TO RUN LOCALLY IN SINGLE USER MODE ? ###
curl -s https://framagit.org/BBRIC/family-companion/raw/master/local.sh | bash
:information_source:
url to access the app: <b>http://localhost:1977/family-companion</b>
login/password to login into app: <b>guest/guest</b>
### BUILD ###
......@@ -85,8 +95,16 @@ If you want to create users from host server (not from Docker image), you will n
export FC=$PWD
$FC/build.sh
### LOCAL CONFIGURATION ###
Run Family-Companion locally:
* login/password set to guest/guest
* sendmail deactivated
* persistence directory set to $HOME/.family-companion
### CONFIGURE ###
$FC/configure.sh --local
### STANDARD CONFIGURATION ###
#### Persistence directory ####
......@@ -132,6 +150,10 @@ From the host server (need Apache::Htpasswd module):
### RUN APP ###
:information_source: Run locally (guest/guest, no mail):
$FC/run.sh --local
:information_source: To start Docker image in interactive mode run:
$FC/run.sh --login
......
......@@ -78,7 +78,7 @@ MAIN:
my $email = lc($o_param->Get('email'));
if (!IsEmailValid($email))
if ($email ne 'guest' && !IsEmailValid($email))
{
die "[ERROR] - $email is not a valid email address";
}
......@@ -131,8 +131,7 @@ Url: $url
END
$fh_mail->close;
my $ssmtp_conf = "$FindBin::RealBin/../../data/cfg/ssmtp.conf";
$ssmtp_conf = $ENV{'FC_DIR'} . '/data/cfg/ssmtp.conf'
if (defined $ENV{'FC_DIR'} && -e $ENV{'FC_DIR'} . '/data/cfg/ssmtp.conf');
$ssmtp_conf = $ENV{'FC_DIR'} . '/data/cfg/ssmtp.conf' if (defined $ENV{'FC_DIR'} && -e $ENV{'FC_DIR'} . '/data/cfg/ssmtp.conf');
if (-e $ssmtp_conf)
{
......
......@@ -100,7 +100,7 @@ sub Dependencies
my @a_cmd =
(
"apt-get -q update && apt-get install -yq cron at libtree-simple-perl libbio-perl-perl ncbi-blast+ sqlite liberror-perl libswitch-perl libxml-simple-perl libjson-perl libapache-session-perl libnet-ldap-perl libapache-htpasswd-perl ssmtp fasttree mafft biosquid python2.7 python-scipy python-sklearn python-numpy python-fastcluster mcl libarray-utils-perl libproc-processtable-perl liburi-encode-perl"
"apt-get -q update && apt-get install -yq cron at libtree-simple-perl libbio-perl-perl ncbi-blast+ sqlite liberror-perl libswitch-perl libxml-simple-perl libjson-perl libapache-session-perl libnet-ldap-perl libapache-htpasswd-perl ssmtp fasttree mafft biosquid python2.7 python-scipy python-sklearn python-numpy python-fastcluster mcl libarray-utils-perl libproc-processtable-perl liburi-encode-perl parallel"
);
my $at_allow_cmd = 'cp /etc/at.deny /etc/at.deny.ori && grep -v "www-data" /etc/at.deny.ori > /etc/at.deny';
......
#!/bin/bash
error=0;
local=0;
echo -e "\e[1m\e[100m";
if [[ $1 == *"local"* ]]; then
echo -e "\e[33m>>>> [HELP] - Local installation: login/password set to guest/guest - Sendmail not activated\nData directory set to $HOME/.family-companion\e[39m";
FC_ADMIN='guest'
FC_SMTP='local'
FC_PORT='1977'
FC_HOSTNAME='localhost'
FC_DIR="$HOME/.family-companion"
mkdir -p $FC_DIR
local=1
fi
if [ -z ${FC_DIR+x} ]
then
......@@ -59,12 +70,12 @@ if [ $error -ne 1 ]
then
if [ ! -d $FC_DIR/data ]
then
mkdir $FC_DIR/data
mkdir -p $FC_DIR/data
chown www-data.www-data $FC_DIR/data
fi
if [ ! -d $FC_DIR/etc ]
then
mkdir $FC_DIR/etc;
mkdir -p $FC_DIR/etc;
chown www-data.www-data $FC_DIR/etc
fi
if [ ! -d $FC_DIR/data/cfg ]
......@@ -118,5 +129,11 @@ cp site/cfg/authentication-docker.cfg site/cfg/authentication.cfg
cp site/cfg/site-docker.cfg site/cfg/site.cfg
chown www-data.www-data $FC_DIR/data/cfg/local.cfg
if [ $local -eq 1 ]
then
./bin/int/admin_addUser.pl --email=$FC_ADMIN --password=guest --common_name='guest' --outdir=$FC_DIR/etc
echo -e "mode=local\n" >> $FC_DIR/data/cfg/local.cfg;
fi
echo -e "\e[49m";
echo -e "\e[0m";
......@@ -98,7 +98,7 @@ sub GetOrthologousAlignments
sub __Align
{
my $infile = shift;
my $cmd = "$MAFFT --globalpair --quiet $infile > $infile.aln";
my $cmd = "$MAFFT --thread $THREADS --globalpair --quiet $infile > $infile.aln";
&System($cmd);
my %h_alignment = ();
return;
......
......@@ -20,6 +20,7 @@ sub GetAuthentication
{
$h_param{'eppn'} = $o_auth->GetEppn();
}
$h_param{'email'} = 'guest@guest.fc' if ($O_CONF->Get('mode') eq 'local');
$h_param{'success'} = &TRUE;
}
print encode_json(\%h_param);
......
......@@ -28,7 +28,7 @@ sub AdjustConfig
$O_CONF->Update("$rootdir/data/cfg/env.cfg", 'O');
}
if (!IsEmailValid($O_CONF->Get('admin_mail')))
if ($O_CONF->Get('admin_mail') ne 'guest' && !IsEmailValid($O_CONF->Get('admin_mail')))
{
&Die('ERROR - admin_mail is not set - complete site/cfg/site.cfg file ', 'early');
}
......@@ -137,6 +137,12 @@ sub SendMail
{
my ($email, $subject, $body, $cc) = @_;
#Mode local, je desactive le sendmail
if ($O_CONF->Get('mode') eq 'local')
{
return 1;
}
my @a_emails = split(',', $email);
my @a_valid_emails = ();
foreach my $email_test (@a_emails)
......
#!/bin/bash
sudo bash
git clone https://framagit.org/BBRIC/family-companion.git
cd family-companion
export FC=$PWD
$FC/build.sh
$FC/configure.sh --local
$FC/run.sh --local
......@@ -2,8 +2,25 @@
error=0;
login=$1;
args=$@;
login=0;
local=0;
if [[ "$args" =~ (-login) ]]
then
login=1;
fi
if [[ "$args" =~ (-local) ]]
then
local=1;
FC_ADMIN='guest'
FC_SMTP='local'
FC_PORT='1977'
FC_HOSTNAME='localhost'
FC_DIR="$HOME/.family-companion"
fi
echo -e "\e[1m\e[100m";
......@@ -54,7 +71,7 @@ echo -e "portal_port=$FC_PORT\n" >> $FC_DIR/data/cfg/env.cfg;
if [ $error -ne 1 ]
then
interactive=' -d ';
if [[ "$login" =~ (-login)$ ]]
if [ $login -eq 1 ]
then
interactive=' -i ';
fi
......
......@@ -12,7 +12,7 @@
SetEnv FC_HOME /var/www/family-companion
ScriptAlias "/family-companion/cgi" "/var/www/family-companion/cgi"
RedirectMatch "^/family-companion/*$" "/family-companion/web/"
RedirectMatch "^/family-companion/*$" "/family-companion/web/index_prod.html"
RewriteRule ^/family-companion/ws/(\w+)$ /family-companion/cgi/index.cgi?$1=1 [T=application/x-httpd-cgi]
RewriteCond %{QUERY_STRING} ^(.*)$
......
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