GithubHelp home page GithubHelp logo

simplerisk / docker Goto Github PK

View Code? Open in Web Editor NEW
23.0 23.0 19.0 534 KB

SimpleRisk Docker Repository

Home Page: https://www.simplerisk.com

License: Mozilla Public License 2.0

Dockerfile 27.89% Shell 68.44% Nix 3.66%

docker's People

Contributors

dasimp avatar jsokol avatar wolfangaukang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

docker's Issues

Entrypoint error when using hyphen on database name (`simplerisk-minimal`)

The entrypoint executes some commands on MySQL:

    print_log "initial_setup:info" "Applying changes to MySQL database... (MySQL error will be printed to console as guidance)"
    exec_cmd "mysql --protocol=socket -u $AUTO_DB_SETUP_USER -p$AUTO_DB_SETUP_PASS -h$SIMPLERISK_DB_HOSTNAME -P$SIMPLERISK_DB_PORT <<EOSQL
    CREATE DATABASE `${SIMPLERISK_DB_DATABASE}`;
    USE `${SIMPLERISK_DB_DATABASE}`;
    \. ${SCHEMA_FILE}
    CREATE USER ${SIMPLERISK_DB_USERNAME}@'%' IDENTIFIED BY '${SIMPLERISK_DB_PASSWORD}';
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER ON `${SIMPLERISK_DB_DATABASE}`.* TO ${SIMPLERISK_DB_USERNAME}@'%';
EOSQL" "Was not able to apply settings on database. Check error above. Exiting."

The problem is that, as this is a bash script, the content inside the backticks are being interpreted as commands.

Add SIMPLERISK_INSTALLED environment variable to DockerFile

I've installed SimpleRisk with the FIRST_TIME_SETUP parameter, everything runs okay.
But after I kill the container and start it again, this varible in config.php is set the "false" again and when I access the application, it goes back to installation page.
This shouldn't happen and it should let me in the application instead.
Can you add another parameter like SIMPLERISK_INSTALLED and set the value in config.php

CVE-2020-36694

NVD Info

First detection

Local scan (get only critical, discard CVEs with "Won't fix" status):

> grype -q simplerisk/simplerisk-minimal | grep Critical | grep -v "won't fix"
linux-libc-dev             5.10.178-3                            deb     CVE-2020-36694       Critical
> grype -q php:8.1-apache | grep Critical | grep -v "won't fix"
linux-libc-dev             5.10.178-3                            deb     CVE-2020-36694    Critical

Docker container crashes on subsequent runs

Environment:

  • Ubuntu 20.04 (x86_64)
  • Docker version 20.10.17, build 100c701
  • Container: simplerisk/simplerisk:latest (d074297a490c)

To reproduce:

  • Pull docker image
  • Start container
  • Stop container
  • Start container

Expected result:

Container remains running

Observed behavior:

Container crashes after about 10-15s with the following logs:

 * Starting MySQL database server mysqld
su: warning: cannot change directory to /nonexistent: No such file or directory
   ...done.
 * Starting periodic command scheduler cron
   ...done.
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
 * Starting MySQL database server mysqld
su: warning: cannot change directory to /nonexistent: No such file or directory
   ...fail!
sed: no input files

Possible issue

It seems as though the MySQL process is dying due to not having a homedir set for the mysql user.

Suggested Solution

Add a line to the dockerfile to create the expected homedir. I'll submit a PR which seems to rectify this issue.

The container can't be started by using the new image

version: '3'

services:
simplerisktest:
image: phsa-simplerisknew:v1.0
hostname: risktest

ports:

- 80:80

- 443:443

 volumes:
   - "./bashrc:/root/.bashrc:rw"
   - "html:/var/www/simplerisk:rw"
   - "html-etc-ssl:/etc/apache2/ssl:rw"
   - "mysql-data:/var/lib/mysql:rw"
   - "mysql-etc:/etc/mysql:rw"
   - "var-log:/var/log:rw"
   - "config:/configurations:rw"
   - "pw:/passwords:rw"
   - /etc/localtime:/etc/localtime:ro

phpmyadmintest:
image: phpmyadmin/phpmyadmin
container_name: phpmyadmintest
environment:
- PMA_ARBITRARY=1
- PMA_ABSOLUTE_URI= https://phsarisktest.phsabc.ehcnet.ca/phpmyadmin/
- PMA_HOST=simplerisktest
restart: always

ports:

- 8080:80

- 443:443

 volumes:
  - /sessions
  - "./config.inc.php:/etc/phpmyadmin/config.inc.php:rw"
  - ./ssl-cert:/ssl-cert
  - ./nginx.conf:/etc/nginx.conf

volumes:
html:
html-etc-ssl:
mysql-data:
mysql-etc:
var-log:
config:
pw:

Image is incompatible with deployment to Kubernetes

Kubernetes Ingress expects TLS to terminate at the ingress controller, all communication from that point on is plaintext (port 80). The rewrite rule included in the common/000-default.conf files causes a redirect loop when deployed to a kubernetes cluster with an ingress controller.

The image bug

This image can’t be compatible with the user having the extras folder (for those paid features) under /var/www/simple risk. It will failed to upgrade process after importing the DB backup from old system. Dorian knows more details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.