Errors
3173
Comment:
|
3281
|
Deletions are marked like this. | Additions are marked like this. |
Line 26: | Line 26: |
Then put the values for oauth_token ('NewOAuthTokenHex') and oauth_token_secret ('NewOAuthTokenSecretHex') in local_config.py in your branch of lp:daisy you create in the steps below. | Then put the values for oauth_token ('NewOAuthTokenHex') and oauth_token_secret ('NewOAuthTokenSecretHex') in local_config.py (as lp_oauth_token and lp_oauth_secret) in your branch of lp:daisy you create in the steps below. |
Line 63: | Line 63: |
Thanks to our CSRF protection this should now return Unauthorized. |
This page should get you up and running with your own branch of lp:errors, the code that powers the web view of the Ubuntu Error Tracker, https://errors.ubuntu.com.
Setting up Postgres for caching OAuth credentials
TODO
Creating OAuth tokens for use with Launchpad
curl --dump-header - -H "Content-Type: application/x-www-form-urlencoded" -X POST --data 'oauth_consumer_key=testing&oauth_signature_method=PLAINTEXT&oauth_signature=%26' https://qastaging.launchpad.net/+request-token
That will return something like:
oauth_token=OAuthTokenHex&oauth_token_secret=OAuthTokenSecretHex
Then authorize it:
https://qastaging.launchpad.net/+authorize-token?oauth_token=OAuthTokenHex
Then accept it:
curl --dump-header - -H "Content-Type: application/x-www-form-urlencoded" -X POST --data 'oauth_consumer_key=testing&oauth_token=OAuthTokenHex&oauth_signature_method=PLAINTEXT&oauth_signature=%26OAuthTokenSecretHex' https://qastaging.launchpad.net/+access-token
Which returns:
oauth_token=NewOAuthTokenHex&oauth_token_secret=NewOAuthTokenSecretHex&lp.context=None
Then put the values for oauth_token ('NewOAuthTokenHex') and oauth_token_secret ('NewOAuthTokenSecretHex') in local_config.py (as lp_oauth_token and lp_oauth_secret) in your branch of lp:daisy you create in the steps below.
Setting up your environment
This assumes that you keep your bzr branches in ~/bzr. Adapt to suit your needs.
Create a branch of daisy for its configuration: bzr branch lp:daisy ~/bzr/daisy. Copy ~/bzr/daisy/configuration.py to ~/bzr/daisy/local_config.py. Put the values you obtained for oauth_token and oauth_token_secret in the steps above. Put in the values for the postgres database you created in the steps above.
Create ~/bzr/errors.your-branch-name/. Then run bzr branch lp:errors ~/bzr/errors.your-branch-name/errors.
Next, copy the sample configuration in place: sudo cp ~/bzr/errors.your-branch-name/errors/000-default /etc/apache2/sites-enabled/000-default. Modify this to point at your branch:
<VirtualHost *:80> DocumentRoot /home/you/bzr/errors.your-branch-name/errors WSGIDaemonProcess localhost python-path=/home/you/bzr/errors.your-branch-name:/home/you/bzr WSGIProcessGroup localhost WSGIScriptAlias / /home/you/bzr/errors.your-branch-name/errors/wsgi.py Alias /static /home/you/bzr/errors.your-branch-name/errors/static Alias /oops-local /home/you/bzr/errors.your-branch-name/errors/oops-local ServerAdmin webmaster@localhost ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Restart Apache: sudo /etc/init.d/apache2 restart
Testing
Bug creation
Thanks to our CSRF protection this should now return Unauthorized.
curl --dump-header - -H "Content-Type: application/json" -X POST --data '{"signature": "/usr/lib/unity-scope-video-remote/unity-scope-video-remote:GError:<module>:main:function"}' http://localhost/api/1.0/create-bug-report/
ErrorTracker/Contributing/Errors (last edited 2021-09-08 23:01:06 by brian-murray)