Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distinguish 'done' from 'configuring' in 2FA #35555

Closed
wants to merge 12 commits into from

Commits on Apr 19, 2023

  1. Proposed change to in-build docker-compose.yml and Dockerfile. The cu…

    …rrent implementation uses php 7.4, which is no longer compatible with the required PHP version of the server. I upped this to PHP 8.1
    
    List of changes:
    - Upped PHP Version to 8.1
    - Added Apache Webserver so the Container works "out of the box" after docker-compose up -d
    - Mounting whole project as volume to /var/www/html in docker-compose.yml (and set WORKDIR to /var/www/html)
    
    Tested in a Docker for Windows environment.
    
    Signed-off-by: MohammadReza vahedi <34796044+mrvahedi68@users.noreply.github.com>
    Stephan authored and mrvahedi68 committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    944187b View commit details
    Browse the repository at this point in the history
  2. Minor improvements for devcontainer

    * Autostart apache2
    * Apply occ installation on start
    * Autostart Xdebug on request
    * Add DevContainer Xdebug profile
    
    Signed-off-by: GitHub <noreply@github.com>
    Signed-off-by: MohammadReza vahedi <34796044+mrvahedi68@users.noreply.github.com>
    R0Wi authored and mrvahedi68 committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    0046cd8 View commit details
    Browse the repository at this point in the history
  3. Use ubuntu jammy and cleanup Dockerfile

    Signed-off-by: GitHub <noreply@github.com>
    Signed-off-by: MohammadReza vahedi <34796044+mrvahedi68@users.noreply.github.com>
    R0Wi authored and mrvahedi68 committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    df0ba7d View commit details
    Browse the repository at this point in the history
  4. Minor DevContainer adjustments

    * Add gnupg2 to be able to sign commits
    * Make sure /var/www/html always belongs to www-data
    * Add Git-History plugin
    * Introduce dedicated entrypoint script
    * Store Postgres database data in volume to be persistent
    * Cleaner check if NC is already installed in setup.sh
    * Add composer to DevContainer
    
    Signed-off-by: GitHub <noreply@github.com>
    Signed-off-by: MohammadReza vahedi <34796044+mrvahedi68@users.noreply.github.com>
    R0Wi authored and mrvahedi68 committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    483a775 View commit details
    Browse the repository at this point in the history
  5. Dedicated DevContainer user + NVM

    * Use dedicated DevContainer user to run Apache (ensure file permissions)
    * Install NVM for node
    
    Signed-off-by: GitHub <noreply@github.com>
    Signed-off-by: MohammadReza vahedi <34796044+mrvahedi68@users.noreply.github.com>
    R0Wi authored and mrvahedi68 committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    6677e22 View commit details
    Browse the repository at this point in the history
  6. Configure line ending to let shell scripts work in Windows ENV

    Signed-off-by: GitHub <noreply@github.com>
    Signed-off-by: MohammadReza vahedi <34796044+mrvahedi68@users.noreply.github.com>
    R0Wi authored and mrvahedi68 committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    f3046ed View commit details
    Browse the repository at this point in the history
  7. Move git safe.directory to earlier stage

    Signed-off-by: GitHub <noreply@github.com>
    Signed-off-by: MohammadReza vahedi <34796044+mrvahedi68@users.noreply.github.com>
    R0Wi authored and mrvahedi68 committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    ec4f3ff View commit details
    Browse the repository at this point in the history
  8. Add .vscode to expected files list

    Signed-off-by: MohammadReza vahedi <34796044+mrvahedi68@users.noreply.github.com>
    R0Wi authored and mrvahedi68 committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    b4372f6 View commit details
    Browse the repository at this point in the history
  9. Enbale apcu in devcontainer CLI

    Signed-off-by: MohammadReza vahedi <34796044+mrvahedi68@users.noreply.github.com>
    R0Wi authored and mrvahedi68 committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    b35db66 View commit details
    Browse the repository at this point in the history
  10. Move launch.json to .devcontainer and copy on start

    Signed-off-by: MohammadReza vahedi <34796044+mrvahedi68@users.noreply.github.com>
    R0Wi authored and mrvahedi68 committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    0867c66 View commit details
    Browse the repository at this point in the history
  11. Distinguish 'done' from 'configuring' in 2FA

    When there is a token in the session for which the user is still [setting up 2FA](https://raw.githubusercontent.com/nextcloud/twofactor_totp/master/screenshots/settings.png), setting `self::SESSION_UID_DONE` ("two_factor_auth_passed") is a misnomer.
    
    AFAICT, everything works fine if you set nothing into the session and just return 'false' from this if-statement, but in case there is some code (now or in the future) that needs to know if the user is configuring 2FA, to play it safe I would suggest storing `self::SESSION_UID_CONFIGURING` ("two_factor_auth_configuring") into the session.
    
    Signed-off-by: Michiel de Jong <michiel@unhosted.org>
    Signed-off-by: MohammadReza vahedi <34796044+mrvahedi68@users.noreply.github.com>
    michielbdejong authored and mrvahedi68 committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    d9c66ba View commit details
    Browse the repository at this point in the history
  12. fix test failing in drone

    Signed-off-by: MohammadReza vahedi <34796044+mrvahedi68@users.noreply.github.com>
    mrvahedi68 committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    9bad67e View commit details
    Browse the repository at this point in the history