Commit a250d785 authored by Frank Greguska's avatar Frank Greguska
Browse files

more work on slcs

parent 2ef3fa16
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -84,8 +84,8 @@ services:
      - "8983"
      - "8984"
    ports:
      - "8983:8983"
      - "8984:8984" 
      - "8985:8983"
      - "8986:8984" 
    volumes:
     - solr_data:/esg/solr-index
    networks:
+9 −12
Original line number Diff line number Diff line
@@ -16,23 +16,20 @@ RUN yum -y install ansible
WORKDIR /usr/local/esgf-slcs-server

COPY production_all.yml /usr/local/esgf-slcs-server
COPY development.yml /usr/local/esgf-slcs-server
ENV SERVER_FQDN=www.my-slcs-server.com \
    APPLICATION_USER=waitress

VOLUME ["/usr/local/esgf-slcs-server/ca"]

RUN git clone https://github.com/cedadev/esgf-slcs-server-playbook.git && \
    ansible-playbook -i esgf-slcs-server-playbook/playbook/inventories/localhost -e "@/usr/local/esgf-slcs-server/production_all.yml" -e "application_user=${APPLICATION_USER}" -e "server_name=${SERVER_FQDN}" esgf-slcs-server-playbook/playbook/playbook.yml
    
# RUN mkdir /etc/ansible/
# RUN echo '[local]\nlocalhost\n' > /etc/ansible/hosts
# RUN mkdir /opt/ansible/
# RUN git clone http://github.com/ansible/ansible.git /opt/ansible/ansible
# WORKDIR /opt/ansible/ansible
# RUN git submodule update --init
# ENV PATH /opt/ansible/ansible/bin:/bin:/usr/bin:/sbin:/usr/sbin
# ENV PYTHONPATH /opt/ansible/ansible/lib
# ENV ANSIBLE_LIBRARY /opt/ansible/ansible/library
# RUN git clone https://github.com/cedadev/esgf-slcs-server-playbook.git && \
#     ansible-playbook -i esgf-slcs-server-playbook/playbook/inventories/localhost -e "@/usr/local/esgf-slcs-server/production_all.yml" -e "application_user=${APPLICATION_USER}" -e "server_name=${SERVER_FQDN}" esgf-slcs-server-playbook/playbook/playbook.yml

WORKDIR /code
RUN git clone https://github.com/cedadev/esgf-slcs-server.git && chmod -R 777 /code
WORKDIR /usr/local/esgf-slcs-server
# RUN git clone https://github.com/cedadev/esgf-slcs-server-playbook.git && \
#     ansible-playbook -i esgf-slcs-server-playbook/playbook/inventories/localhost -e "@/usr/local/esgf-slcs-server/development.yml" esgf-slcs-server-playbook/playbook/playbook.yml


CMD ["/bin/bash"]
 No newline at end of file
+31 −0
Original line number Diff line number Diff line
docker run -it --rm -p 5000:5000 -p 5001:5001 slcs-server
git clone https://github.com/cedadev/esgf-slcs-server-playbook.git
ansible-playbook -i esgf-slcs-server-playbook/playbook/inventories/localhost -e "@/usr/local/esgf-slcs-server/development.yml" esgf-slcs-server-playbook/playbook/playbook.yml
su - vagrant
venv/bin/python /code/esgf-slcs-server/manage.py runserver 0.0.0.0:5000




docker run -it --rm --network container:pensive_fermat centos
yum upgrade -y
yum install -y epel-release
yum install -y python34 python34-devel python34-pip openssl openssl-devel gcc git
pip3 install install flask requests-oauthlib pyopenssl
mkdir /usr/local/esgf
cd /usr/local/esgf
git clone https://github.com/cedadev/esgf-slcs-client-example.git
vi esgf_slcs_client_example.py
    esgf_slcs_server = 'http://127.0.0.1:5000'
    client_id = "i1qx9KmQuIj8rWhrmSlR5wJQOkyU0c4HD0OQsm0R"
    client_secret = "Qme5lP8zpbZ2pHR73GnEBSmW0nktPzUCZCKNZclfQdok6sdIMI9yMgE3vrJeZLH7b5FrY4uI2yf5Tv95tliZ5ASxncbUbHZRWL4CBJUBXXrTvpfEt2fIqTbc2ggZrOgS"
    scope = ['https://172.28.128.7/oauth/certificate/']
    redirect_uri = 'http://127.0.0.1:5001/oauth_callback'
    app.run(debug = True, port=5001, host='0.0.0.0')



Application: esgf-slcs-client-example
User: another
Client id: i1qx9KmQuIj8rWhrmSlR5wJQOkyU0c4HD0OQsm0R
Client secret: Qme5lP8zpbZ2pHR73GnEBSmW0nktPzUCZCKNZclfQdok6sdIMI9yMgE3vrJeZLH7b5FrY4uI2yf5Tv95tliZ5ASxncbUbHZRWL4CBJUBXXrTvpfEt2fIqTbc2ggZrOgS
 No newline at end of file
+114 −0
Original line number Diff line number Diff line
#####
## This file contains variable definitions for a development install
## Because OAuth expects to run over HTTP, this still uses Nginx, but expects
## the Django development server to be started on port 5000
#####

#####
## Server variables

# The name of the server
#   This should be the domain name by which the machine will be accessed over HTTP
server_name: 172.28.128.7

# The email address to use for emails sent by the application
server_email: no-reply@{{ server_name }}

#####
## Python installation

# Distribution for IUS community repository (required for Python 2.7 installation)
#   Valid values are 'rhel6', 'centos6'
ius_distro: centos6

# To use an existing Python 2.7 installation, set this variable instead
#  virtualenv_command: /path/to/virtualenv-2.7

#####
## Nginx installation

# If true, configure nginx proxy
#   The Nginx proxy assumes it can find a WSGI server internally on port 5000
#   This can be either Waitress or the Django development server
use_nginx_proxy: true

# Distribution for the Nginx repository
#   Valid values are 'rhel' or 'centos'
nginx_distro: centos

# If true, generate and use a self-signed SSL certificate for Nginx
#   Only used if use_nginx_proxy = true
use_self_signed_ssl_cert: true

# The subject of the self-signed certificate
#   Only used if use_self_signed_ssl_cert = true
ssl_cert_subject: /O=ESGF/CN={{ server_name }}

#####
## Waitress and supervisord installation

# If true, use the Waitress WSGI server to run the Django app
#   The Waitress processes are managed using supervisord
use_waitress_wsgi: false

# NOTE: Set this to 1 so Nginx still looks for a worker
waitress_instances: 1

#####
## Application installation

# The user to install and run the application as
#   This should be an unpriveleged user
#   If the user doesn't exist, they will be created
application_user: vagrant

# The directory in which to install application code
#   If not given, this defaults to the home directory of the application_user
#   Must be readable and writable by the application_user
# application_home: /path/to/application/home

# The installation mode
#   Valid values are 'production' and 'development'
#   Development mode assumes the esgf-slcs-server code is available at
#   /code/esgf-slcs-server, and is designed primarily for use with the Vagrant box
install_mode: development

#####
## Database setup and configuration

# If true, configure a new local database for the SLCS Django app and optionally
#   configure a dummy ESGF user database (see use_dummy_userdb below)
# If false, esgf_slcsdb and esgf_userdb dictionaries must be manually configured
configure_databases: true

# Only used if configure_databases = true
# If true, install and populate a dummy ESGF user database
use_dummy_userdb: true

#####
## CA setup and configuration

# If true, install the test CA
install_test_ca: true

# Template for the subject of certificates issued by the SLCS server
#   $OPENID is replaced with the user's OpenID
onlineca_cert_subject_template: "/DC=esgf/CN=$OPENID"

#####
## Application configuration

# If true, run Django in debug mode
#   Should (obviously!) be false in production
django_debug_mode: true

# The location where static files should be collected
static_root: /var/www/static

# The username in the ESGF user table of the user that should be the Django superuser
#   This user gets full access to the Django admin
django_superuser: another

# The IP range that is allowed access to the Django admin
#   Filtering is done with Nginx, so this is only used if Nginx is enabled
admin_ip_range: all