From aa12d12c0be4821928f68338558964fdad35ff4c Mon Sep 17 00:00:00 2001
From: Michael Brown So you want to set up Discourse on Ubuntu to hack on and develop with? We\'ll assume that you don\'t have Ruby/Rails/Postgre/Redis installed on your Ubuntu system. Let\'s begin! Although this guide assumes that you are using Ubuntu, but the set-up instructions will work fine for any Debian based distribution. (If you want to install Discourse for production use, see our install guide) Run this script in terminal, to setup Rails development environment:Install Discourse Dependencies
\n\n
\n\n bash <(wget -qO- https://raw.githubusercontent.com/techAPJ/install-rails/master/linux)
This will install following new packages on your system:
\n\nInstall Phantomjs:
\n\nFor 32 bit machine:
\n\ncd /usr/local/share\nsudo wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-i686.tar.bz2\nsudo tar xvf phantomjs-1.9.8-linux-i686.tar.bz2\nsudo rm phantomjs-1.9.8-linux-i686.tar.bz2\nsudo ln -s /usr/local/share/phantomjs-1.9.8-linux-i686/bin/phantomjs /usr/local/bin/phantomjs\ncd
\n\nFor 64 bit machine:
\n\ncd /usr/local/share\nsudo wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2\nsudo tar xvf phantomjs-1.9.8-linux-x86_64.tar.bz2\nsudo rm phantomjs-1.9.8-linux-x86_64.tar.bz2\nsudo ln -s /usr/local/share/phantomjs-1.9.8-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs\ncd
\n\n \n\nIn case you have any of this package pre-installed and don\'t want to run entire script, see the script and pick the packages you don\'t have currently installed. The script is fine-tuned for Discourse, and includes all the packages required for Discourse installation.
\n\nNow that we have installed Discourse dependencies, let\'s move on to install Discourse itself.
\n\nClone the Discourse repository in ~/discourse
folder:
git clone https://github.com/discourse/discourse.git ~/discourse
\n\n \n\nOpen psql prompt as postgre user
\n\nsudo -u postgres psql postgres
\n\n \n\nCreate role with the same name as your ubuntu system username with discourse as password:
\n\nCREATE ROLE discourse WITH LOGIN ENCRYPTED PASSWORD \'discourse\' CREATEDB SUPERUSER;
\n\nIn the above command, I named the role as discourse, this means that my ubuntu system username is discourse. (It is necessary for role name to be same as system username, otherwise migrations will not run)
\n\nCheck that you have successfully created discourse role:
\n\n\\du
\n\n \n\nCreate discourse_development and discourse_test database:
\n\nCREATE DATABASE discourse_development WITH OWNER discourse ENCODING \'UTF8\' TEMPLATE template0;\nCREATE DATABASE discourse_test WITH OWNER discourse ENCODING \'UTF8\' TEMPLATE template0;
\n\n \n\nExit psql prompt by pressing ctrld
\n\nNow access psql prompt in discourse_development database as discourse user:
\n\npsql -d discourse_development -U discourse -h localhost
\n\nWhen prompted for password, provide the password which you set at the time of creating role, if you followed the guide as is, the password is discourse
\n\nRun following commands, separately:
\n\nCREATE EXTENSION pg_trgm;\nCREATE EXTENSION hstore;
\n\n\n\nExit psql prompt by pressing ctrld
\n\nNow access psql prompt in discourse_test database as discourse user:
\n\npsql -d discourse_test -U discourse -h localhost
\n\nWhen prompted for password, provide the password which you set at the time of creating role, if you followed the guide as is, the password is discourse
\n\nRun following commands, separately:
\n\nCREATE EXTENSION pg_trgm;\nCREATE EXTENSION hstore;
\n\n \n\nExit psql prompt by pressing ctrld
\n\nYou have set-up the database successfully!
\n\nSwitch to your Discourse folder:
\n\ncd ~/discourse
\n\nInstall the needed gems
\n\nbundle install
\n\n \n\nNow that you have successfully configured database connection, run this command:
\n\nbundle exec rake db:migrate db:test:prepare db:seed_fu
\n\nNow, try running the specs:
\n\nbundle exec rake autospec
\n\n \n\nStart rails server:
\n\nbundle exec rails server
\n\n \n\nYou should now be able to connect to discourse app on http://localhost:3000 - try it out!
\n\n \n\nWe will use MailCatcher to serve emails in development environment. Install and run MailCatcher:
\n\ngem install mailcatcher\nmailcatcher --http-ip 0.0.0.0
\n\nCreate new account:
\n\n \n\nCheck confirmation email by going to MailCatcher web interface at http://localhost:1080/
\n\n \n\nIf you did not receive the email, try running this in console: bundle exec sidekiq -q default
Click the confirmation link and your account will be activated!
\n\n \n\nNow, to make your account as admin, run the following commands in rails console:
\n\nRAILS_ENV=development bundle exec rails c\nu = User.last\nu.admin = true\nu.save
\n\n \n\nOnce you execute the above commands successfully, check out your Discourse account again:
\n\n \n\nCongratulations! You are now the admin of your own Discourse installation!
\n\nHappy hacking!
\n\nIf anything needs to be improved in this guide, feel free to ask on meta.discourse.org, or even better, submit a pull request.
', + 'So you want to set up Discourse on Ubuntu to hack on and develop with?
\n\nWe\'ll assume that you don\'t have Ruby/Rails/Postgre/Redis installed on your Ubuntu system. Let\'s begin!
\n\nAlthough this guide assumes that you are using Ubuntu, but the set-up instructions will work fine for any Debian based distribution.
\n\n(If you want to install Discourse for production use, see our install guide)
\n\nRun this script in terminal, to setup Rails development environment:
\n\nbash <(wget -qO- https://raw.githubusercontent.com/techAPJ/install-rails/master/linux)
\n\n \n\nThis will install following new packages on your system:
\n\nInstall Phantomjs:
\n\nFor 32 bit machine:
\n\ncd /usr/local/share\nsudo wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-i686.tar.bz2\nsudo tar xvf phantomjs-1.9.8-linux-i686.tar.bz2\nsudo rm phantomjs-1.9.8-linux-i686.tar.bz2\nsudo ln -s /usr/local/share/phantomjs-1.9.8-linux-i686/bin/phantomjs /usr/local/bin/phantomjs\ncd
\n\nFor 64 bit machine:
\n\ncd /usr/local/share\nsudo wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2\nsudo tar xvf phantomjs-1.9.8-linux-x86_64.tar.bz2\nsudo rm phantomjs-1.9.8-linux-x86_64.tar.bz2\nsudo ln -s /usr/local/share/phantomjs-1.9.8-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs\ncd
\n\n \n\nIn case you have any of this package pre-installed and don\'t want to run entire script, see the script and pick the packages you don\'t have currently installed. The script is fine-tuned for Discourse, and includes all the packages required for Discourse installation.
\n\nNow that we have installed Discourse dependencies, let\'s move on to install Discourse itself.
\n\nClone the Discourse repository in ~/discourse
folder:
git clone https://github.com/discourse/discourse.git ~/discourse
\n\n \n\nOpen psql prompt as postgre user
\n\nsudo -u postgres psql postgres
\n\n \n\nCreate role with the same name as your ubuntu system username with discourse as password:
\n\nCREATE ROLE discourse WITH LOGIN ENCRYPTED PASSWORD \'discourse\' CREATEDB SUPERUSER;
\n\nIn the above command, I named the role as discourse, this means that my ubuntu system username is discourse. (It is necessary for role name to be same as system username, otherwise migrations will not run)
\n\nCheck that you have successfully created discourse role:
\n\n\\du
\n\n \n\nCreate discourse_development and discourse_test database:
\n\nCREATE DATABASE discourse_development WITH OWNER discourse ENCODING \'UTF8\' TEMPLATE template0;\nCREATE DATABASE discourse_test WITH OWNER discourse ENCODING \'UTF8\' TEMPLATE template0;
\n\n \n\nExit psql prompt by pressing ctrld
\n\nNow access psql prompt in discourse_development database as discourse user:
\n\npsql -d discourse_development -U discourse -h localhost
\n\nWhen prompted for password, provide the password which you set at the time of creating role, if you followed the guide as is, the password is discourse
\n\nRun following commands, separately:
\n\nCREATE EXTENSION pg_trgm;\nCREATE EXTENSION hstore;
\n\n\n\nExit psql prompt by pressing ctrld
\n\nNow access psql prompt in discourse_test database as discourse user:
\n\npsql -d discourse_test -U discourse -h localhost
\n\nWhen prompted for password, provide the password which you set at the time of creating role, if you followed the guide as is, the password is discourse
\n\nRun following commands, separately:
\n\nCREATE EXTENSION pg_trgm;\nCREATE EXTENSION hstore;
\n\n \n\nExit psql prompt by pressing ctrld
\n\nYou have set-up the database successfully!
\n\nSwitch to your Discourse folder:
\n\ncd ~/discourse
\n\nInstall the needed gems
\n\nbundle install
\n\n \n\nNow that you have successfully configured database connection, run this command:
\n\nbundle exec rake db:migrate db:test:prepare db:seed_fu
\n\nNow, try running the specs:
\n\nbundle exec rake autospec
\n\n \n\nStart rails server:
\n\nbundle exec rails server
\n\n \n\nYou should now be able to connect to discourse app on http://localhost:3000 - try it out!
\n\n \n\nWe will use MailCatcher to serve emails in development environment. Install and run MailCatcher:
\n\ngem install mailcatcher\nmailcatcher --http-ip 0.0.0.0
\n\nCreate new account:
\n\n \n\nCheck confirmation email by going to MailCatcher web interface at http://localhost:1080/
\n\n \n\nIf you did not receive the email, try running this in console: bundle exec sidekiq -q default
Click the confirmation link and your account will be activated!
\n\n \n\nNow, to make your account as admin, run the following commands in rails console:
\n\nRAILS_ENV=development bundle exec rails c\nu = User.last\nu.admin = true\nu.save
\n\n \n\nOnce you execute the above commands successfully, check out your Discourse account again:
\n\n \n\nCongratulations! You are now the admin of your own Discourse installation!
\n\nHappy hacking!
\n\nIf anything needs to be improved in this guide, feel free to ask on meta.discourse.org, or even better, submit a pull request.
', post_number: 1, post_type: 1, updated_at: "2015-06-22T17:24:20.607Z", @@ -249,7 +249,7 @@ export default { uploaded_avatar_id: 3281, created_at: "2014-05-19T16:59:51.082Z", cooked: - 'So you want to set up Discourse on Mac OS X to hack on and develop with?
\n\nWe\'ll assume that you don\'t have Ruby/Rails/Postgre/Redis installed on your Mac. Let\'s begin!
\n\n(If you want to install Discourse for production use, see our install guide)
\n\nRun this script in terminal, to setup Rails development environment:
\n\nbash <(curl -s https://raw.githubusercontent.com/techAPJ/install-rails/master/mac)
\n\nThis script will install following new packages on your system:
\n\nIn case you have any of this package pre-installed and don\'t want to run entire script, see the script and pick the packages you don\'t have currently installed. The script is fine-tuned for Discourse, and includes all the packages required for Discourse installation.
\n\nNow that we have installed Discourse dependencies, let\'s move on to install Discourse itself.
\n\nClone the Discourse repository in ~/discourse
folder:
git clone https://github.com/discourse/discourse.git ~/discourse
\n\n
~
indicates home folder, so Discourse source code will be available in your home folder.
Open psql prompt:
\n\npsql postgres
\n\n
Create discourse_development and discourse_test database with your account short name specified as role:
\n\nCREATE DATABASE discourse_development WITH OWNER techapj ENCODING \'UTF8\' TEMPLATE template0;\nCREATE DATABASE discourse_test WITH OWNER techapj ENCODING \'UTF8\' TEMPLATE template0;
\n\nNote that in above commands I specified the role as techapj, this means that my short name is techapj, replace this with your own short name.
\n\n
Exit psql prompt by pressing controld
\n\nNow access psql prompt in discourse_development database as your short name user:
\n\npsql -d discourse_development -U techapj -h localhost
\n\nRun following commands, separately:
\n\nCREATE EXTENSION pg_trgm;\nCREATE EXTENSION hstore;
\n\n
Exit psql prompt by pressing controld
\n\nNow access psql prompt in discourse_test database as your short name user:
\n\npsql -d discourse_test -U techapj -h localhost
\n\nRun following commands, separately:
\n\nCREATE EXTENSION pg_trgm;\nCREATE EXTENSION hstore;
\n\n
Exit psql prompt by pressing controld
\n\nYou have set-up the database successfully!
\n\nSwitch to your Discourse folder:
\n\ncd ~/discourse
\n\nInstall the needed gems
\n\nbundle install
\n\n
Now that you have successfully installed gems, run this command:
\n\nbundle exec rake db:migrate db:test:prepare db:seed_fu
\n\nTry running the specs:
\n\nbundle exec rake autospec
\n\n
All the tests should pass.
\n\nStart rails server:
\n\nbundle exec rails server
\n\n
You should now be able to connect with your Discourse app on http://localhost:3000 - try it out!
\n\n \n\nTo create a new admin, run the following commands in rails console:
\n\nRAILS_ENV=development bundle exec rake admin:create
\n\nJust enter your input as suggested, you can create an admin account.
\n\n \n\n \n\nHappy hacking!
', + 'So you want to set up Discourse on Mac OS X to hack on and develop with?
\n\nWe\'ll assume that you don\'t have Ruby/Rails/Postgre/Redis installed on your Mac. Let\'s begin!
\n\n(If you want to install Discourse for production use, see our install guide)
\n\nRun this script in terminal, to setup Rails development environment:
\n\nbash <(curl -s https://raw.githubusercontent.com/techAPJ/install-rails/master/mac)
\n\nThis script will install following new packages on your system:
\n\nIn case you have any of this package pre-installed and don\'t want to run entire script, see the script and pick the packages you don\'t have currently installed. The script is fine-tuned for Discourse, and includes all the packages required for Discourse installation.
\n\nNow that we have installed Discourse dependencies, let\'s move on to install Discourse itself.
\n\nClone the Discourse repository in ~/discourse
folder:
git clone https://github.com/discourse/discourse.git ~/discourse
\n\n
~
indicates home folder, so Discourse source code will be available in your home folder.
Open psql prompt:
\n\npsql postgres
\n\n
Create discourse_development and discourse_test database with your account short name specified as role:
\n\nCREATE DATABASE discourse_development WITH OWNER techapj ENCODING \'UTF8\' TEMPLATE template0;\nCREATE DATABASE discourse_test WITH OWNER techapj ENCODING \'UTF8\' TEMPLATE template0;
\n\nNote that in above commands I specified the role as techapj, this means that my short name is techapj, replace this with your own short name.
\n\n
Exit psql prompt by pressing controld
\n\nNow access psql prompt in discourse_development database as your short name user:
\n\npsql -d discourse_development -U techapj -h localhost
\n\nRun following commands, separately:
\n\nCREATE EXTENSION pg_trgm;\nCREATE EXTENSION hstore;
\n\n
Exit psql prompt by pressing controld
\n\nNow access psql prompt in discourse_test database as your short name user:
\n\npsql -d discourse_test -U techapj -h localhost
\n\nRun following commands, separately:
\n\nCREATE EXTENSION pg_trgm;\nCREATE EXTENSION hstore;
\n\n
Exit psql prompt by pressing controld
\n\nYou have set-up the database successfully!
\n\nSwitch to your Discourse folder:
\n\ncd ~/discourse
\n\nInstall the needed gems
\n\nbundle install
\n\n
Now that you have successfully installed gems, run this command:
\n\nbundle exec rake db:migrate db:test:prepare db:seed_fu
\n\nTry running the specs:
\n\nbundle exec rake autospec
\n\n
All the tests should pass.
\n\nStart rails server:
\n\nbundle exec rails server
\n\n
You should now be able to connect with your Discourse app on http://localhost:3000 - try it out!
\n\n \n\nTo create a new admin, run the following commands in rails console:
\n\nRAILS_ENV=development bundle exec rake admin:create
\n\nJust enter your input as suggested, you can create an admin account.
\n\n \n\n \n\nHappy hacking!
', post_number: 1, post_type: 1, updated_at: "2015-04-26T06:51:23.549Z", @@ -339,7 +339,7 @@ export default { uploaded_avatar_id: null, created_at: "2014-01-24T15:08:06.111Z", cooked: - 'Continuing the discussion from Log of setting up Docker in Virtualbox:
\n\n\n\nWhat is the preferred development environment these days? I have Vagrant up and running as recommended in Discourse as Your First Rails App and Discourse Vagrant Developer Guide, but much of the recent discussion has been about Discourse Docker (which I freely admit I haven\'t really looked at for lack of time).
\n\nFor development purposes, should I carry on using Vagrant for the time being? Or should I be setting up a VM with Ubuntu and then installing Docker and Discourse Docker?
\n\n(As a related side issue, my current production environment was built by following the Discourse Install Guide. Would it be prudent to switch that over to Docker at some point as well? Meaning, is version 1.0 likely to recommend Docker instead of a raw installation? This question deserves a topic of its own in some other category, but it seems best to see what people have to say about development environments before launching a second, better-informed discussion about production environments.)
\n\nSo, for development, Vagrant or Docker?
', + 'Continuing the discussion from Log of setting up Docker in Virtualbox:
\n\n\n\nWhat is the preferred development environment these days? I have Vagrant up and running as recommended in Discourse as Your First Rails App and Discourse Vagrant Developer Guide, but much of the recent discussion has been about Discourse Docker (which I freely admit I haven\'t really looked at for lack of time).
\n\nFor development purposes, should I carry on using Vagrant for the time being? Or should I be setting up a VM with Ubuntu and then installing Docker and Discourse Docker?
\n\n(As a related side issue, my current production environment was built by following the Discourse Install Guide. Would it be prudent to switch that over to Docker at some point as well? Meaning, is version 1.0 likely to recommend Docker instead of a raw installation? This question deserves a topic of its own in some other category, but it seems best to see what people have to say about development environments before launching a second, better-informed discussion about production environments.)
\n\nSo, for development, Vagrant or Docker?
', post_number: 1, post_type: 1, updated_at: "2014-01-24T15:08:06.111Z", diff --git a/spec/fixtures/onebox/githubfolder-discourse-root.response b/spec/fixtures/onebox/githubfolder-discourse-root.response index 23075c565b4..d88ba433af0 100644 --- a/spec/fixtures/onebox/githubfolder-discourse-root.response +++ b/spec/fixtures/onebox/githubfolder-discourse-root.response @@ -111,7 +111,7 @@ - + @@ -578,7 +578,7 @@If you're familiar with how Rails works and are comfortable setting up your own environment, you can also try out the Discourse Advanced Developer Guide, which is aimed primarily at Ubuntu and macOS environments.
-Before you get started, ensure you have the following minimum versions: Ruby 2.6+, PostgreSQL 10+, Redis 4.0+. If you're having trouble, please see our TROUBLESHOOTING GUIDE first!
+If you're familiar with how Rails works and are comfortable setting up your own environment, you can also try out the Discourse Advanced Developer Guide, which is aimed primarily at Ubuntu and macOS environments.
+Before you get started, ensure you have the following minimum versions: Ruby 2.6+, PostgreSQL 10+, Redis 4.0+. If you're having trouble, please see our TROUBLESHOOTING GUIDE first!
If you want to set up a Discourse forum for production use, see our Discourse Install Guide.
+If you want to set up a Discourse forum for production use, see our Discourse Install Guide.
If you're looking for business class hosting, see discourse.org/buy.
Discourse is built for the next 10 years of the Internet, so our requirements are high.
@@ -1988,7 +1988,7 @@Plus lots of Ruby Gems, a complete list of which is at /master/Gemfile.
+Plus lots of Ruby Gems, a complete list of which is at /master/Gemfile.
Discourse is 100% free and open source. We encourage and support an active, healthy community that @@ -1997,15 +1997,15 @@ accepts contributions from the public – including you!
We look forward to seeing your pull requests!
We take security very seriously at Discourse; all our code is 100% open source and peer reviewed. Please read our security guide for an overview of security measures in Discourse, or if you wish to report a security issue.
+We take security very seriously at Discourse; all our code is 100% open source and peer reviewed. Please read our security guide for an overview of security measures in Discourse, or if you wish to report a security issue.
The original Discourse code contributors can be found in AUTHORS.MD. For a complete list of the many individuals that contributed to the design and implementation of Discourse, please refer to the official Discourse blog and GitHub's list of contributors.
+The original Discourse code contributors can be found in AUTHORS.MD. For a complete list of the many individuals that contributed to the design and implementation of Discourse, please refer to the official Discourse blog and GitHub's list of contributors.
Copyright 2014 - 2020 Civilized Discourse Construction Kit, Inc.
Licensed under the GNU General Public License Version 2.0 (or later); @@ -2078,7 +2078,7 @@ limitations under the License.