Skip to content

Commit

Permalink
simpleid/openid migrated. closes #14
Browse files Browse the repository at this point in the history
  • Loading branch information
Sumit Khanna committed Feb 15, 2018
1 parent 7de883f commit 493b773
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dockerfiles/HAProxySetup/haproxy-config.py
Expand Up @@ -41,8 +41,6 @@
acl is_letsencrypt path_beg -i /.well-known/acme-challenge/
# SSL Redirect
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Proto https if {{ ssl_fc }}
redirect scheme https if !{{ ssl_fc }} !is_letsencrypt
use_backend bk_letsencrypt if is_letsencrypt
Expand All @@ -52,6 +50,9 @@
bind :::443 v4v6 ssl crt /etc/letsencrypt/live
mode http
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Proto https if {{ ssl_fc }}
# Awstats
acl is_awstats path_beg -i /stats/
use_backend bk_awstats if is_awstats
Expand Down
13 changes: 13 additions & 0 deletions dockerfiles/SimpleID/000-default.conf
@@ -0,0 +1,13 @@
<VirtualHost *:8080>

DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

<Directory /var/www/html>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>

</VirtualHost>
36 changes: 36 additions & 0 deletions dockerfiles/SimpleID/Dockerfile
@@ -0,0 +1,36 @@
FROM php:7.2.2-apache-stretch

ENV SIMPLEID_VERSION 1.0.2
ENV DOMAIN openid.example.com
ENV APP_DIR /var/www/html

# Apache Setup
RUN a2enmod rewrite
RUN sed -i "s/80/8080/g" /etc/apache2/ports.conf
COPY 000-default.conf /etc/apache2/sites-available/000-default.conf
EXPOSE 8080

# PHP Extensions
RUN docker-php-ext-install bcmath
RUN apt-get update && apt-get install -y libgmp-dev \
&& docker-php-ext-install gmp \
&& rm -rf /var/lib/apt/lists/*

# State
RUN mkdir -p /simpleid/identities
RUN mkdir -p /simpleid/cache
RUN mkdir -p /simpleid/store
VOLUME ["/simpleid"]

# SimpleID
WORKDIR /opt
RUN mkdir simpleid
RUN curl -L https://downloads.sourceforge.net/project/simpleid/simpleid/$SIMPLEID_VERSION/simpleid-$SIMPLEID_VERSION.tar.gz -o r.tgz
RUN tar xfz r.tgz
RUN mv simpleid/www/.htaccess.dist $APP_DIR/.htaccess
RUN mv simpleid/www/* $APP_DIR
COPY config.php $APP_DIR

# Cleanup
RUN rm -rf /opt/simpleid
RUN rm -rf /opt/r.tgz
17 changes: 17 additions & 0 deletions dockerfiles/SimpleID/config.php
@@ -0,0 +1,17 @@
<?php
$DOMAINS = explode(' ', $_ENV['DOMAINS']);
define('SIMPLEID_BASE_URL', 'https://' . $DOMAINS[0]);
define('SIMPLEID_CLEAN_URL', true);
define('SIMPLEID_IDENTITIES_DIR', '/simpleid/identities');
define('SIMPLEID_CACHE_DIR', '/simpleid/cache');
define('SIMPLEID_STORE', 'filesystem');
define('SIMPLEID_STORE_DIR', '/simpleid/store');
define('SIMPLEID_ALLOW_LEGACY_LOGIN', false);
define('SIMPLEID_ALLOW_AUTOCOMPLETE', false);
define('SIMPLEID_VERIFY_RETURN_URL_USING_REALM', true);
define('SIMPLEID_DATE_TIME_FORMAT', '%Y-%m-%d %H:%M:%S %Z');
define('SIMPLEID_ASSOC_EXPIRES_IN', 3600);
define('SIMPLEID_EXTENSIONS', 'sreg,ui');
define('SIMPLEID_LOGFILE', 'php://stdout');
define('SIMPLEID_LOGLEVEL', 4);
?>

0 comments on commit 493b773

Please sign in to comment.