{"id":34638817,"url":"https://github.com/generoi/genero-conf","last_synced_at":"2026-05-23T13:34:02.801Z","repository":{"id":35587931,"uuid":"39860679","full_name":"generoi/genero-conf","owner":"generoi","description":"Vagrant + Drupal configs","archived":false,"fork":false,"pushed_at":"2022-06-17T22:50:09.000Z","size":85,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-12-26T06:16:25.437Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/generoi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-28T22:24:50.000Z","updated_at":"2020-08-13T11:28:26.000Z","dependencies_parsed_at":"2022-08-31T17:50:45.077Z","dependency_job_id":null,"html_url":"https://github.com/generoi/genero-conf","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/generoi/genero-conf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fgenero-conf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fgenero-conf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fgenero-conf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fgenero-conf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/generoi","download_url":"https://codeload.github.com/generoi/genero-conf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fgenero-conf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33398390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T04:15:53.637Z","status":"ssl_error","status_checked_at":"2026-05-23T04:15:53.242Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-24T17:13:23.666Z","updated_at":"2026-05-23T13:34:02.770Z","avatar_url":"https://github.com/generoi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Development environment\n-----------------------\n\n\u003e Located on your own machine but running inside a virtual machine. All the\n\u003e development is done on the host machine, while mysql, apache etc are on the\n\u003e guest machine.\n\n#### Dependencies:\n\n**These you must install by yourself.**\n\n###### OSX\n\n```\n# Install some UNIX tools\nbrew tap homebrew/dupes\nbrew install coreutils\nbrew install gnupg\nbrew install gnu-sed --with-default-names\nbrew install rsync\nbrew install grep --with-default-names\nbrew install ssh-copy-id\n\n# Install additional dependencies\nbrew install git\nbrew install homebrew/php/php56\nbrew install ansible\nbrew install Caskroom/cask/vagrant\n\n# Configure git\ngit config --global github.user \"\u003cusername\u003e\"\ngit config --global user.name \"\u003cYour Name\u003e\"\ngit config --global user.email \"\u003cyouremail@domain.com\u003e\"\n\n# Install Composer\ncurl -sS https://getcomposer.org/installer | php\nmv composer.phar /usr/local/bin/composer\n\n# Install Drush\ncomposer global require drush/drush:6.*\n\n# Install some vagrant plugins\nvagrant plugin install vagrant-gatling-rsync\nvagrant plugin install vagrant-hostsupdater\n```\n\n###### LInux\n\n```sh\n# Git\nsudo apt-get install git\ngit config --global github.user \"\u003cusername\u003e\"\ngit config --global user.name \"\u003cYour Name\u003e\"\ngit config --global user.email \"\u003cyouremail@domain.com\u003e\"\n\n# Create a key that you can add to your GitHub account\nssh-keygen\ncat ~/.ssh/id_rsa.pub\n\n# PHP \u0026 Curl\nsudo apt-get install php5 php5-cli curl libcurl3 libcurl3-dev php5-curl\n\n# Ansible\nsudo apt-get install software-properties-common\nsudo apt-add-repository ppa:ansible/ansible\nsudo apt-get update\nsudo apt-get install ansible\n\n# Vagrant \u0026 Virtualbox\n# For Vagrant 1.7.4 or later and Virtualbox 5 or later, download the installation files\n# from the linkes below and install with your systems package manager\n# https://www.virtualbox.org/wiki/Linux_Downloads\n# http://www.vagrantup.com/downloads.html\nvagrant plugin install vagrant-gatling-rsync\nvagrant plugin install vagrant-auto_network\n\n# Composer\ncurl -sS https://getcomposer.org/installer | php\nsudo mv composer.phar /usr/local/bin/composer\n# Add the following line to ~/.bashrc\nexport PATH=\"$HOME/.composer/vendor/bin:$PATH\"\nsource ~/.bashrc\n\n# Drush (using Composer)\ncomposer global require drush/drush:6.*\n```\n\n#### Setup\n\nFetch the code from github, the files and the latest database from production.\n\n_Note that all of these tasks should run on your local machine._\n\n```sh\ngit clone --recursive git@github.com:generoi/\u003cPROJECT\u003e.git\ncd \u003cPROJECT\u003e\n\n# Setup git hooks\n./lib/git-hooks/install.sh\n\n# Install dependencies\nbundle\nnpm install\nbower install\n\n# Add your key to the authorization agent for connecting to production.\neval $(ssh-agent -s)\nssh-add\n\n# Authenticate the production servers key fingerprint locally.\n# If you run this before `vagrant up` the fingerprint will be copied to the VM as well.\ndrush @production status\n\n# Setup the local settings file (pre-configured for the VM)\ncp sites/default/example.settings.local.php sites/default/settings.local.php\n\n# Setup the VM folder\nmake vm\n\n# Fetch ansible roles used by Drupal VM\nsudo ansible-galaxy install -r lib/drupal-vm/provisioning/requirements.yml --force\n\n# Build the VM\nvagrant up --provision\n\n# Import the database from the production environment.\n# NOTE you cannot use @self here, as MySQL isn't installed on your local\n# computer. Instead you need to reference the VM with @dev.\ndrush sql-sync @production @dev\n\n# Import the files from the production environment.\n# NOTE that you cannot use @dev here, as rsync requires one of the targets be\n# local. Instead we first SSH into the @dev box and then issue it locally.\ndrush @dev ssh 'drush core-rsync @production:%files @self:%files'\n\n# Begin watching with rsync (one-way and only if this command is running)\nvagrant gatling-rsync-auto\n```\n\n#### Start coding\n\n\u003e All development should be done on your local machine.\n\n1. Make sure your VM is running: `vagrant up`\n2. Make sure files are being synced by running `vagrant gatling-rsync-auto`\n3. Open the git project in your favorit editor (locally,\n   the files will be synced to the VM automatically).\n4. Install a [livereload extension](http://livereload.com/extensions/).\n5. Run `grunt watch` or `gulp watch` to automatically compile assets and\n   refresh your browser when a file changes.\n   This task also takes care of rsyncing the changed files to the guest machine\n   (much faster than vagrants rsync).\n6. Start coding by opening http://`\u003cPROJECT\u003e.dev` in your browser.\n\n_All git, cap, and drush commands should ideally run on your own machine. Most\ntasks do work on the virtual machine, but not all of them. Note that drush\ncommands should use @dev as a target (eg. drush @dev status)._\n\n##### XDebug with Sublime Text 3\n\n1. Make sure you have [Package Control](https://packagecontrol.io/installation) installed.\n2. Install `xdebug client` by going to `tools \u003e command palette \u003e install package \u003e xdebug client`.\n3. Configure xdebug in sublime for the project with the following `*.sublime-project` settings.\n\n    ```json\n    {\n      \"folders\": [\n        {\n          \"follow_symlinks\": true,\n          \"path\": \".\"\n        }\n      ],\n      \"settings\": {\n        \"xdebug\": {\n          \"url\": \"http://\u003cPROJECT\u003e.dev/\",\n          \"path_mapping\": {\n            \"/var/www/drupal\": \"/Users/oxy/Projects/Genero/\u003cPROJECT\u003e\"\n          }\n        }\n      }\n    }\n    ```\n\n4. Add a breakpoint and start debugging.\n\n##### XHProf\n\n1. Visit `/admin/config/development/` and enable XHProf.\n2. Visit any page you want to profile and look for the XHProf link at the bottom of the page.\n\nXHProf results are at: `http://xhprof.\u003cproject\u003e.dev`.\n\n##### LiveReload\n\n1. Install the [browser extension](http://go.livereload.com/extensions).\n2. Enable the extension on said page.\n3. Run `grunt watch` or `gulp watch` to trigger livereload when css/js/images changes.\n\nIn case you want to use live reloading on mobile devices, look into using the\n[LiveReload Drupal module](https://www.drupal.org/project/livereload).\n\n##### Share your local webserver on the internet\n\nMaybe you want to test out the site on your mobile, or have someo PM take a\nlook at how everything is coming along.\n\nSimply ssh into the VM (`vagrant ssh`) and run `ngrok 80`. You will be given a\nunique address which you can share to anyone you want.\n\n##### Remote mobile debugging\n\nYou can access your mobiles chrome windows through developers tools on your\ndesktop using the [following tutorial](https://developer.chrome.com/devtools/docs/remote-debugging).\n\n1. Connect your phone to your computer\n2. Enable USB debugging in settings on your phone\n3. Go to `chrome://inspect#devices` on your desktop browser, and select your phone\n4. Allow the connection on your phone\n5. Choose inspect and start debugging.\n\n##### Update/Install Drupal modules.\n\nAs `drush pm-update` and `drush pm-install` run within the VM and rsync is\none-way, the files created will be one the host only. So you have two options:\n\n1. Fetch the modules locally with `drush dl foobar`\n2. Let them be resynced to the VM.\n3. Run the updates on the VM using `drush @dev updatedb`\n\nAlternatively\n\n1. Exit the `vagrant gatling-rsync-auto` process if you have it running, this\nmight override the new code before you can act.\n2. Run the `drush` commands.\n3. Run `make rsync-pull` to fetch the files from the guest VM to your host machine\n4. Commit the code and restart `vagrant gatling-rsync-auto`.\n\n##### Using Browserstack Live\n\n[Browserstack](https://www.browserstack.com/local-testing)\nallows for local testing so you can easily access the VM through their service.\n\n1. Open the page on browserstack live.\n2. Click the settings wheel and tick the box for resolving all network URLs.\n3. Profit\n\n##### Remote mobile debugging using weinre\n\n[Weinre](http://people.apache.org/~pmuellr/weinre/docs/1.x/1.5.0/Home.html) is\na remote web inspector, allowing you to inspect a remote\nclient such as a browserstack session.\n\n1. Run `vagrant ssh -c 'weinre --boundHost -all- --httpPort 80'` and keep it running.\n2. Open the page you want to inspect and add `?debug` at the end of the URL.\n3. Go to `http://\u003cproject\u003e.dev:9090` in your own browser and start inspecting\n\n_Unfortunately weinre does not display the CSS of media queries._\n\n##### VM services\n\n```\nAdminer    http://adminer.{{ vagrant_hostname }}\nMailHog    http://{{ vagrant_hostname }}:8025/\nPimpMyLog  http://pimpmylog.{{ vagrant_hostname }}/\nSolr       http://{{ vagrant_hostname  }}:8983/solr/\nXHProf     http://xhprof.{{ vagrant_hostname }}/\n```\n\n#### Deploy\n\n```sh\n# Deploy to the production environment\ncap production deploy\n\n# Deploy to our staging environment\ncap staging deploy\n\n# Simply sync our compiled assets (these might be overriden on next deploy)\ncap staging assets:push\n\n# Push our local files to staging environment, overriding older files, but\n# leaving untouched/unexisting files.\ncap staging files:push\n\n# Push git staged files to staging environment. This is simply rsynced and will\n# be removed with the next proper deploy. It only exists for you to stop making\n# repetitive fix commits. LEARN NOT TO NEED THIS!\ncap staging deploy:temporary\n```\n\n#### Drupal\n\n```sh\n# Maintenance mode\ncap production drush:offline\ncap production drush:online\n\n# Backup database (on the remote host)\ncap production drush:backupdb\n\n# Interactively import database (on the remote host)\ncap production drush:importdb\n\n# Run database updates\ncap production drush:updatedb\n```\n\n#### Drush\n\n```sh\n# Check the status of the production site.\ndrush @production status\n\n# Set the production site into maintenance mode.\ndrush @production offline\ndrush @production online\n\n# Import the production database into the virtualmachine.\ndrush sql-sync @production @dev\n\n# Import the production environment files into the staging environment.\n# NOTE: Drush rsync requires that one of the target be local, which is why we\n# ssh into staging first (production wouldn't have access to the staging\n# environment).\ndrush @staging ssh 'drush core-rsync @production:%files @self:%files'\n\n# Save a dump of the production database to the local machine.\ndrush sql-dump @production \u003e| dump.sql\n```\n\n#### Clear caches\n\n```sh\n# Clear all caches on production.\ncap production cache\n\n# Clear all Drupal caches on production.\ncap production cache:all\n\n# Clear the varnish cache on production.\ncap production cache:varnish\n\n# Clear the APC cache on production (some weird php bugs).\ncap production cache:apc\n\n# Clear the asset caches on production.\ncap production cache:cssjs\n```\n\n#### Logs and services\n\n```sh\n# Tail some logs\ncap production logs:apache_access\ncap production logs:apache_error\ncap production logs:varnish\ncap production logs:htop\n\n# Display summary of running services (if monit is setup)\ncap production monit:summary\ncap production monit:status\n\n# Control services\ncap staging service:apache:graceful\ncap staging service:mysql:start\ncap staging service:varnish:restart\n\n# Open a SSH connectino to production.\ncap production ssh\n```\n\nStaging environment\n-------------------\n\n\u003e Located on _minasanor.genero.fi_, within /var/www/staging/`\u003cPROJECT\u003e` as a\n\u003e capistrano target (setup using `current`, `release`, etc folders).\n\n#### Setup\n\n1. Configure the capistrano settings for staging in `config/deploy/staging.rb`\n2. Todo have a look at this outdated [make task](https://github.com/generoi/genero-conf/blob/4f1bd8bc9da56847e691238b3b5c8228e14617b3/make/staging.mk#L10:L26).\n\nProduction\n----------\n\n\u003e Located on the live server.\n\n#### Setup\n\n1. Setup the environment (apache, php, apc/opcache, varnish, squid, memcached, etc.)\n2. Setup the deploy user according to [Capistrano's guides](http://capistranorb.com/documentation/getting-started/authentication-and-authorisation/)\n3. Configure the capistrano settings for production: `config/deploy/production.rb`\n4. Scaffold the capistrano folder structure by running the following from **your own development machine**.\n\n    ```sh\n    cap production setup\n    ```\n\n5. Probably not done, you should probably update this readme with whatever\n   issues you found :)\n\nCommon issues\n-------------\n\n- If you're trying to communicate with production, make sure you have an SSH\n  agent running with your key.\n\n- If drush can't find an alias, check `drush site-alias`, if it's not there it\n  most likely means you don't have the `sites/all/drush/aliases.drushrc.php`\n  file.\n\n- \u003e Vagrant cannot forward the specified ports on this VM, since they\n  \u003e would collide with some other application that is already listening\n  \u003e on these ports. The forwarded port to 2222 is already in use\n  \u003e on the host machine.\n\n  This is a Vagrant issue that will occur when you have a suspended VM that used\n  a port that a now-running VM is using. Simply run `vagrant halt` followed by\n  `vagrant up`.\n\n- \u003e Host key verification failed when staging is trying to communicate with production.\n\n  `ssh deploy@minasanor 'ssh-keygen -R \u003cproduction\u003e'`\n\n- \u003e Keep getting random `Error: Call to undefined function ctools_include()` etc.\n\n  Is memcached used, it might have failed somehow, restart it with:\n  `drush @dev ssh 'sudo service memcached restart`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneroi%2Fgenero-conf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeneroi%2Fgenero-conf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneroi%2Fgenero-conf/lists"}