nuxsmin / docker-syspass

Docker stuff for running sysPass on Docker
GNU General Public License v3.0
39 stars 21 forks source link

Switch between default HTTPS/HTTP (v3.1) #29

Closed byt3pool closed 5 years ago

byt3pool commented 5 years ago

In v3.1 HTTPs is set as default in the apache config.

To avoid that I copy in a custom syspass.conf file where I changed the default VirtualHost and removed the RewriteEngine.

docker-compose.yml

...
  volumes:
      - syspass-config:/var/www/html/sysPass/app/config
      - syspass-backup:/var/www/html/sysPass/app/backup
      - ./syspass.conf:/etc/apache2/sites-available/syspass.conf
...

Custom syspass.conf

...
<VirtualHost _default_:80>
  ServerAdmin webmaster@localhost
  DocumentRoot /var/www/html/sysPass

  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

<IfModule mod_ssl.c>
  <VirtualHost *:443>
    ...
  </VirtualHost>
</IfModule>

Question Am I missing a simpler way to change the default behaviour to HTTP, e.g. in an (Docker) environment variable?

services:
  app:
    container_name: syspass-app
    image: syspass/syspass:3.1.0-rc4
    ...
    environment:
      - SSL = TRUE|FALSE # Whether to use SSL or not
    ports:
      ...
    volumes:
      ...
nuxsmin commented 5 years ago

Hello, sorry for the late reply...

I'll try to find out a way to dynamically run a condition if a given environment var is set. It would be useful when sysPass is behind of an LB

Thanks for the feedback!

nuxsmin commented 5 years ago

Solved :wink: