Changeset 190645 in webkit
- Timestamp:
- Oct 6, 2015 2:04:03 PM (9 years ago)
- Location:
- trunk/Websites/perf.webkit.org
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Websites/perf.webkit.org/ChangeLog
r186797 r190645 1 2015-10-06 Ryosuke Niwa <rniwa@webkit.org> 2 3 Perf dashboard should have the capability to test local UI with production data 4 https://bugs.webkit.org/show_bug.cgi?id=149834 5 6 Reviewed by Chris Dumez. 7 8 Added tools/run-with-remote-server.py which runs a local httpd server and pulls data from a remote server. 9 10 * Install.md: Added the instruction on how to use the script. Also updated the remaining instructions 11 for El Capitan. 12 * config.json: Added remote server configurations. 13 * public/admin/fetch-from-remote.php: Added. This script fetches JSON from the remote server specified in 14 config.json and caches the results in the location specified as "cacheDirectory" in config.json. 15 (main): 16 (fetch_remote): 17 * public/include/db.php: 18 (config_path): Extracted from generate_data_file. 19 (generate_data_file): 20 * tools/remote-server-relay.conf: Added. Apache 2.4 configuration file for a local http server launched by 21 run-with-remote-server.py. 22 * tools/run-with-remote-server.py: Added. Launches Apache with the right set of directives. 23 (main): 24 (abspath_from_root): 25 1 26 2015-07-13 Ryosuke Niwa <rniwa@webkit.org> 2 27 -
trunk/Websites/perf.webkit.org/Install.md
r185676 r190645 1 1 # Checking Out the Code and Installing Required Applications 2 2 3 The instructions assume you're using Mac OS X (Mavericks for Server.app case and Mountain Lion without Server.app) as the 4 host server, and assume that we're installing this application at `/Volumes/Data/perf.webkit.org`. 3 The instructions assume you're using Mac OS X as the host server and installing this application at `/Volumes/Data/perf.webkit.org`. 5 4 6 5 You can choose between using Server.app or install the required tools separately … … 10 9 3. Install Xcode with command line tools (only needed for svn) 11 10 4. `svn co https://svn.webkit.org/repository/webkit/trunk/Websites/perf.webkit.org /Volumes/Data/perf.webkit.org` 12 5. Inside `/Volumes/Data/perf.webkit.org`, run `npm install pg`. 11 5. Inside `/Volumes/Data/perf.webkit.org`, run `npm install pg` and `mkdir -m 755 public/data/` 12 13 # Testing Local UI Changes with Production Data 14 15 The front end has the capability to pull data from a production server without replicating the database locally on OS X (Yosemite and later). 16 To use this feature, modify `config.json`'s `remoteServer` entry so that "remoteServer.url" points to your production server, 17 and "remoteServer.basicAuth" specifies the username and the password that is used by the production sever. 18 19 Remove "basicAuth" entry for production servers that doesn't require a basic authentication (e.g. perf.webkit.org). 20 21 ```json 22 { 23 "url": "http://perf.webkit.org", 24 "basicAuth": { 25 "username": "webkitten", 26 "password": "webkitten's secret password" 27 } 28 } 29 ``` 30 31 Then run `tools/run-with-remote-server.py`. This launches a httpd server on port 8080. 32 33 The initial few page loads after starting the script could take as much as a few minutes depending on your production sever's configurations 34 since Apache needs to start a pool of processes. Reloading the dashboards few times should bring the load time under control. 35 36 The script caches remote server's responses under `public/data/remote-cache` and never revalidates them (to allow offline work). 37 If you needed the latest content, delete caches stored in this directory by running `rm -rf public/data/remote-cache`. 13 38 14 39 … … 21 46 - Restarting httpd: `sudo apachectl restart` 22 47 48 The apache logs are located at `/private/var/log/apache2`. 49 23 50 ## Instructions if you're using Server.app 24 51 25 52 - Enable PHP web applications 26 - Go to Server Website / Store Site Files In, change it to /Volumes/Data/perf.webkit.org/public/`53 - Go to Server Website / Store Site Files In, change it to `/Volumes/Data/perf.webkit.org/public/` 27 54 - Go to Server Website / Edit advanced settings, enable Allow overrides using .htaccess files 55 - httpd config file is located at `/Library/Server/Web/Config/apache2/sites/0000_any_80.conf` (and/or 0000_any_`PORT#`.conf) 28 56 29 57 ## Instructions if you're not using Server.app … … 32 60 33 61 1. Change DocumentRoot to `/Volumes/Data/perf.webkit.org/public/` 34 2. Uncomment `"LoadModule php5_module libexec/apache2/libphp5.so"` 62 2. Uncomment `LoadModule php5_module libexec/apache2/libphp5.so` 63 3. Uncomment `LoadModule rewrite_module libexec/apache2/mod_rewrite.so` 64 4. Uncomment `LoadModule deflate_module libexec/apache2/mod_deflate.so` 35 65 36 66 - In Mavericks and later, copy php.ini to load pdo_pgsql.so pgsql.so. 37 67 `sudo cp /Applications/Server.app/Contents/ServerRoot/etc/php.ini /etc/` 68 - In El Capitan and later, comment out the `LockFile` directive in `/private/etc/apache2/extra/httpd-mpm.conf` 69 since the directive has been superseded by `Mutex` directive. 38 70 39 40 ## Common directives for the related apache config file 41 42 httpd config file is located at: 43 44 - With Server.app: /Library/Server/Web/Config/apache2/sites/0000_any_80.conf (and/or 0000_any_`PORT#`.conf) 45 - Without: /private/etc/apache2/httpd.conf 71 ## Production Configurations 46 72 47 73 1. Update ServerAdmin to your email address … … 57 83 php_flag zlib.output_compression on 58 84 59 The apache logs are located at `/private/var/log/apache2`. 60 61 62 # Protecting the Administrative Pages to Prevent Execution of Arbitrary Code 85 ### Protecting the Administrative Pages to Prevent Execution of Arbitrary Code 63 86 64 87 By default, the application gives the administrative privilege to everyone. Anyone can add, remove, or edit tests, 65 builders, and other entities in the database and may even execute arbitrary JavaScript on the server via aggregators.88 builders, and other entities in the database. 66 89 67 90 We recommend protection via Digest Auth on https connection. … … 98 121 `/Applications/Server.app/Contents/ServerRoot/usr/bin/psql webkit-perf-db -h localhost --username webkit-perf-db-user -f init-database.sql` 99 122 100 ## Making a Backup of the Database123 ## Making a Backup and Restoring 101 124 102 125 Run `/Applications/Server.app/Contents/ServerRoot/usr/bin/pg_dump -h localhost --no-owner -f <filepath> webkit-perf-db | gzip > backup.gz` 103 126 104 To restore, setup a new database and run `gunzip backup.gz | /Applications/Server.app/Contents/ServerRoot/usr/bin/psql webkit-perf-db -h localhost --username webkit-perf-db-user` 127 To restore, setup a new database and run 128 `gunzip backup.gz | /Applications/Server.app/Contents/ServerRoot/usr/bin/psql webkit-perf-db -h localhost --username webkit-perf-db-user` -
trunk/Websites/perf.webkit.org/config.json
r182651 r190645 14 14 "port": 80 15 15 }, 16 "cacheDirectory": "public/data/remote-cache/", 17 "remoteServer": { 18 "httpdConfig": "tools/remote-server-relay.conf", 19 "httpdPID": "tools/remote-server-relay.pid", 20 "httpdErroLog": "tools/remote-server-relay.log", 21 "url": "http://perf.webkit.org", 22 "basicAuth": { 23 "username": "username", 24 "password": "password" 25 } 26 }, 16 27 "defaultDashboard": [[]], 17 28 "dashboards": {} -
trunk/Websites/perf.webkit.org/public/include/db.php
r183041 r190645 37 37 } 38 38 39 function config_path($key, $path) { 40 return CONFIG_DIR . config($key) . '/' . $path; 41 } 42 39 43 function generate_data_file($filename, $content) { 40 44 if (!assert(ctype_alnum(str_replace(array('-', '_', '.'), '', $filename)))) 41 45 return FALSE; 42 return file_put_contents( CONFIG_DIR . config('dataDirectory') . '/' . $filename, $content);46 return file_put_contents(config_path('dataDirectory'. $filename), $content); 43 47 } 44 48
Note: See TracChangeset
for help on using the changeset viewer.