From e196ee1b70b5dbc98bdb56f43cc26b788c35940b Mon Sep 17 00:00:00 2001 From: Jason Jackson Date: Mon, 15 Apr 2024 13:50:13 -0400 Subject: [PATCH 1/2] Remove vagrant --- .gitignore | 5 --- README.md | 17 +++------- Vagrantfile | 98 ----------------------------------------------------- 3 files changed, 4 insertions(+), 116 deletions(-) delete mode 100644 Vagrantfile diff --git a/.gitignore b/.gitignore index 970c0565..8ee91626 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -# Vagrant folder -.vagrant/ - # phpstorm project files .idea/ /nbproject/ @@ -19,8 +16,6 @@ vendor/ api.html -dockercfg - # These folders are intended to offer a way to add logging for toubleshooting purposes serverless-mfa-api/override/*.go serverless-mfa-api/override/server/*.go diff --git a/README.md b/README.md index cf74def8..573712a1 100644 --- a/README.md +++ b/README.md @@ -2,26 +2,17 @@ ## Requirements ## -Linux, macOS -1. Docker - -or - -Windows (not actively maintained as a development platform) -1. VirtualBox -2. Vagrant +- Docker ## Setup ## 1. Clone this repo -2. (Vagrant users only) Edit Vagrantfile to specify whatever IP address you want, and adjust the synced folder - that gets mounted as /data if you need to -3. Copy ```local.env.dist``` to ```local.env``` and fill in the required variable values. -4. Set the following environment variables on your host (dev) machine: +2. Copy ```local.env.dist``` to ```local.env``` and fill in the required variable values. +3. Set the following environment variables on your host (dev) machine: - `COMPOSER_CACHE_DIR`: the path where composer should cache packages. This makes composer installs and updates much faster. Typically `/home/user/.composer` - `DOCKER_UIDGID`: user ID and group ID. Use `1000:1000` if you are the primary user on a Linux computer. Otherwise, run `id -u` and `id -g` and use the resulting numbers in place of `1000`. -5. Run `make start`, or if using Vagrant, run `vagrant up` +4. Run `make start` ## Configuration By default, configuration is read from environment variables. These are documented diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index 7742f4ba..00000000 --- a/Vagrantfile +++ /dev/null @@ -1,98 +0,0 @@ -#@IgnoreInspection BashAddShebang -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# All Vagrant configuration is done below. The "2" in Vagrant.configure -# configures the configuration version (we support older styles for -# backwards compatibility). Please don't change it unless you know what -# you're doing. -Vagrant.configure(2) do |config| - # The most common configuration options are documented and commented below. - # For a complete reference, please see the online documentation at - # https://docs.vagrantup.com. - - # Every Vagrant development environment requires a box. You can search for - # boxes at https://atlas.hashicorp.com/search. - config.vm.box = "ubuntu/trusty64" - - # Create a private network, which allows host-only access to the machine - # using a specific IP. - config.vm.network "private_network", ip: "192.168.37.60" - - # Provider-specific configuration so you can fine-tune various - # backing providers for Vagrant. These expose provider-specific options. - # Example for VirtualBox: - # - config.vm.provider "virtualbox" do |vb| - # Customize the amount of memory on the VM: - vb.memory = "1536" - - # A fix for speed issues with DNS resolution: - # http://serverfault.com/questions/453185/vagrant-virtualbox-dns-10-0-2-3-not-working?rq=1 - vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] - - # Set the timesync threshold to 59 seconds, instead of the default 20 minutes. - # 59 seconds chosen to ensure SimpleSAML never gets too far out of date. - vb.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 59000] - end - # - # View the documentation for the provider you are using for more - # information on available options. - - # Set synced folder permissions - config.vm.synced_folder "./", "/vagrant" - - # This provisioner runs on the first `vagrant up`. - config.vm.provision "install", type: "shell", inline: <<-SHELL - # Add Docker apt repository - sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D - sudo sh -c 'echo deb https://apt.dockerproject.org/repo ubuntu-trusty main > /etc/apt/sources.list.d/docker.list' - sudo apt-get update -y - # Uninstall old lxc-docker - apt-get purge lxc-docker - apt-cache policy docker-engine - # Install docker and dependencies - sudo apt-get install -y linux-image-extra-$(uname -r) - sudo apt-get install -y docker-engine - # Add user vagrant to docker group - sudo groupadd docker - sudo usermod -aG docker vagrant - # Install Docker Compose - curl -LsS https://github.com/docker/compose/releases/download/1.10.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose - chmod +x /usr/local/bin/docker-compose - - # Create /home/vagrant/.bash_profile for env vars - cat << EOF > /home/vagrant/.bash_profile -#!/bin/bash -COMPOSER_HOME=/home/vagrant/.composer; export COMPOSER_HOME -COMPOSER_CONFIG_FILE="${COMPOSER_HOME}/config.json"; export COMPOSER_CONFIG_FILE -COMPOSER_CACHE_DIR="${COMPOSER_HOME}/cache"; export COMPOSER_CACHE_DIR -# Get GID for DOCKER_UIDGID env var -GID=`id -g` -DOCKER_UIDGID="${UID}:${GID}"; export DOCKER_UIDGID -EOF - - chown vagrant:vagrant /home/vagrant/.bash_profile - chmod +x /home/vagrant/.bash_profile - - # Run docker-compose (which will update preloaded images, and - # pulls any images not preloaded) - cd /vagrant - - SHELL - - # This provisioner runs on every `vagrant reload' (as well as the first - # `vagrant up`), reinstalling from local directories - config.vm.provision "recompose", type: "shell", - run: "always", inline: <<-SHELL - - # Run docker-compose (which will update preloaded images, and - # pulls any images not preloaded) - cd /vagrant - - # Ensure env vars are loaded from bash_profile - source /home/vagrant/.bash_profile - - SHELL - -end \ No newline at end of file From 1b36f9dbe0f9cc0de354ce26f1923f63f2021ba6 Mon Sep 17 00:00:00 2001 From: Jason Jackson Date: Mon, 15 Apr 2024 14:07:28 -0400 Subject: [PATCH 2/2] continue to ignore dockercfg, just in case --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 8ee91626..543c5c16 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,8 @@ vendor/ api.html +dockercfg + # These folders are intended to offer a way to add logging for toubleshooting purposes serverless-mfa-api/override/*.go serverless-mfa-api/override/server/*.go