From d4dda2c93ad171ec471bae082251265bdf363504 Mon Sep 17 00:00:00 2001 From: Jeff Wong Date: Tue, 2 Aug 2022 17:12:25 -0700 Subject: [PATCH] REFACTOR: Update fastly URLs in tests to generic example URLs --- .../javascripts/discourse/tests/fixtures/search-fixtures.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/tests/fixtures/search-fixtures.js b/app/assets/javascripts/discourse/tests/fixtures/search-fixtures.js index 0855839ba35..78747bbaeb0 100644 --- a/app/assets/javascripts/discourse/tests/fixtures/search-fixtures.js +++ b/app/assets/javascripts/discourse/tests/fixtures/search-fixtures.js @@ -159,7 +159,7 @@ export default { uploaded_avatar_id: 3281, created_at: "2014-04-12T22:22:07.930Z", cooked: - '

So you want to set up Discourse on Ubuntu to hack on and develop with?

\n\n

We\'ll assume that you don\'t have Ruby/Rails/Postgre/Redis installed on your Ubuntu system. Let\'s begin!

\n\n

Although 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\n

Install Discourse Dependencies

\n\n

Run this script in terminal, to setup Rails development environment:

\n\n
bash <(wget -qO- https://raw.githubusercontent.com/techAPJ/install-rails/master/linux)
\n\n

\n\n

This will install following new packages on your system:

\n\n\n\n

Install Phantomjs:

\n\n

For 32 bit machine:

\n\n
cd /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\n

For 64 bit machine:

\n\n
cd /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\n

In 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\n

Now that we have installed Discourse dependencies, let\'s move on to install Discourse itself.

\n\n

Clone Discourse

\n\n

Clone the Discourse repository in ~/discourse folder:

\n\n
git clone https://github.com/discourse/discourse.git ~/discourse
\n\n

\n\n

Setup Database

\n\n

Open psql prompt as postgre user

\n\n
sudo -u postgres psql postgres
\n\n

\n\n

Create role with the same name as your ubuntu system username with discourse as password:

\n\n
CREATE ROLE discourse WITH LOGIN ENCRYPTED PASSWORD \'discourse\' CREATEDB SUPERUSER;
\n\n

In 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\n

Check that you have successfully created discourse role:

\n\n
\\du
\n\n

\n\n

Create discourse_development and discourse_test database:

\n\n
CREATE DATABASE discourse_development WITH OWNER discourse ENCODING \'UTF8\' TEMPLATE template0;\nCREATE DATABASE discourse_test WITH OWNER discourse ENCODING \'UTF8\' TEMPLATE template0;
\n\n

\n\n

Exit psql prompt by pressing ctrld

\n\n

Now access psql prompt in discourse_development database as discourse user:

\n\n
psql -d discourse_development -U discourse -h localhost
\n\n

When 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\n

Run following commands, separately:

\n\n
CREATE EXTENSION pg_trgm;\nCREATE EXTENSION hstore;
\n\n

\n\n

Exit psql prompt by pressing ctrld

\n\n

Now access psql prompt in discourse_test database as discourse user:

\n\n
psql -d discourse_test -U discourse -h localhost
\n\n

When 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\n

Run following commands, separately:

\n\n
CREATE EXTENSION pg_trgm;\nCREATE EXTENSION hstore;
\n\n

\n\n

Exit psql prompt by pressing ctrld

\n\n

You have set-up the database successfully!

\n\n

Bootstrap Discourse

\n\n

Switch to your Discourse folder:

\n\n
cd ~/discourse
\n\n

Install the needed gems

\n\n
bundle install
\n\n

\n\n

Now that you have successfully configured database connection, run this command:

\n\n
bundle exec rake db:migrate db:test:prepare db:seed_fu
\n\n

Now, try running the specs:

\n\n
bundle exec rake autospec
\n\n

\n\n

Start rails server:

\n\n
bundle exec rails server
\n\n

\n\n

You should now be able to connect to discourse app on http://localhost:3000 - try it out!

\n\n

\n\n

Configure Mail and Create New Account

\n\n

We will use MailCatcher to serve emails in development environment. Install and run MailCatcher:

\n\n
gem install mailcatcher\nmailcatcher --http-ip 0.0.0.0
\n\n

Create new account:

\n\n

\n\n

Check confirmation email by going to MailCatcher web interface at http://localhost:1080/

\n\n

\n\n

If you did not receive the email, try running this in console: bundle exec sidekiq -q default

\n\n

Click the confirmation link and your account will be activated!

\n\n

\n\n

Access Admin

\n\n

Now, to make your account as admin, run the following commands in rails console:

\n\n
RAILS_ENV=development bundle exec rails c\nu = User.last\nu.admin = true\nu.save
\n\n

\n\n

Once you execute the above commands successfully, check out your Discourse account again:

\n\n

\n\n

Congratulations! You are now the admin of your own Discourse installation!

\n\n

Happy hacking!

\n\n

If 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\n

We\'ll assume that you don\'t have Ruby/Rails/Postgre/Redis installed on your Ubuntu system. Let\'s begin!

\n\n

Although 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\n

Install Discourse Dependencies

\n\n

Run this script in terminal, to setup Rails development environment:

\n\n
bash <(wget -qO- https://raw.githubusercontent.com/techAPJ/install-rails/master/linux)
\n\n

\n\n

This will install following new packages on your system:

\n\n\n\n

Install Phantomjs:

\n\n

For 32 bit machine:

\n\n
cd /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\n

For 64 bit machine:

\n\n
cd /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\n

In 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\n

Now that we have installed Discourse dependencies, let\'s move on to install Discourse itself.

\n\n

Clone Discourse

\n\n

Clone the Discourse repository in ~/discourse folder:

\n\n
git clone https://github.com/discourse/discourse.git ~/discourse
\n\n

\n\n

Setup Database

\n\n

Open psql prompt as postgre user

\n\n
sudo -u postgres psql postgres
\n\n

\n\n

Create role with the same name as your ubuntu system username with discourse as password:

\n\n
CREATE ROLE discourse WITH LOGIN ENCRYPTED PASSWORD \'discourse\' CREATEDB SUPERUSER;
\n\n

In 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\n

Check that you have successfully created discourse role:

\n\n
\\du
\n\n

\n\n

Create discourse_development and discourse_test database:

\n\n
CREATE DATABASE discourse_development WITH OWNER discourse ENCODING \'UTF8\' TEMPLATE template0;\nCREATE DATABASE discourse_test WITH OWNER discourse ENCODING \'UTF8\' TEMPLATE template0;
\n\n

\n\n

Exit psql prompt by pressing ctrld

\n\n

Now access psql prompt in discourse_development database as discourse user:

\n\n
psql -d discourse_development -U discourse -h localhost
\n\n

When 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\n

Run following commands, separately:

\n\n
CREATE EXTENSION pg_trgm;\nCREATE EXTENSION hstore;
\n\n

\n\n

Exit psql prompt by pressing ctrld

\n\n

Now access psql prompt in discourse_test database as discourse user:

\n\n
psql -d discourse_test -U discourse -h localhost
\n\n

When 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\n

Run following commands, separately:

\n\n
CREATE EXTENSION pg_trgm;\nCREATE EXTENSION hstore;
\n\n

\n\n

Exit psql prompt by pressing ctrld

\n\n

You have set-up the database successfully!

\n\n

Bootstrap Discourse

\n\n

Switch to your Discourse folder:

\n\n
cd ~/discourse
\n\n

Install the needed gems

\n\n
bundle install
\n\n

\n\n

Now that you have successfully configured database connection, run this command:

\n\n
bundle exec rake db:migrate db:test:prepare db:seed_fu
\n\n

Now, try running the specs:

\n\n
bundle exec rake autospec
\n\n

\n\n

Start rails server:

\n\n
bundle exec rails server
\n\n

\n\n

You should now be able to connect to discourse app on http://localhost:3000 - try it out!

\n\n

\n\n

Configure Mail and Create New Account

\n\n

We will use MailCatcher to serve emails in development environment. Install and run MailCatcher:

\n\n
gem install mailcatcher\nmailcatcher --http-ip 0.0.0.0
\n\n

Create new account:

\n\n

\n\n

Check confirmation email by going to MailCatcher web interface at http://localhost:1080/

\n\n

\n\n

If you did not receive the email, try running this in console: bundle exec sidekiq -q default

\n\n

Click the confirmation link and your account will be activated!

\n\n

\n\n

Access Admin

\n\n

Now, to make your account as admin, run the following commands in rails console:

\n\n
RAILS_ENV=development bundle exec rails c\nu = User.last\nu.admin = true\nu.save
\n\n

\n\n

Once you execute the above commands successfully, check out your Discourse account again:

\n\n

\n\n

Congratulations! You are now the admin of your own Discourse installation!

\n\n

Happy hacking!

\n\n

If 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",