Title: [157990] trunk/Websites/test-results
Revision
157990
Author
[email protected]
Date
2013-10-24 22:17:56 -0700 (Thu, 24 Oct 2013)

Log Message

Add an instruction on how to setup test-results app
https://bugs.webkit.org/show_bug.cgi?id=123321

Rubber-stamped by Stephanie Lewis.

Added Install.md and updated config.json accordingly.

Also moved init-database.sql out of public/include since it doesn't need to be accessible via httpd.

* Install.md: Added.
* config.json:
* init-database.sql: Moved from public/include/init-database.sql.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Websites/test-results/ChangeLog (157989 => 157990)


--- trunk/Websites/test-results/ChangeLog	2013-10-25 04:43:19 UTC (rev 157989)
+++ trunk/Websites/test-results/ChangeLog	2013-10-25 05:17:56 UTC (rev 157990)
@@ -1,5 +1,20 @@
 2013-10-24  Ryosuke Niwa  <[email protected]>
 
+        Add an instruction on how to setup test-results app
+        https://bugs.webkit.org/show_bug.cgi?id=123321
+
+        Rubber-stamped by Stephanie Lewis.
+
+        Added Install.md and updated config.json accordingly.
+
+        Also moved init-database.sql out of public/include since it doesn't need to be accessible via httpd.
+
+        * Install.md: Added.
+        * config.json:
+        * init-database.sql: Moved from public/include/init-database.sql.
+
+2013-10-24  Ryosuke Niwa  <[email protected]>
+
         Move everything except ChangeLog and config.json into public directory.
         https://bugs.webkit.org/show_bug.cgi?id=123319
 

Added: trunk/Websites/test-results/Install.md (0 => 157990)


--- trunk/Websites/test-results/Install.md	                        (rev 0)
+++ trunk/Websites/test-results/Install.md	2013-10-25 05:17:56 UTC (rev 157990)
@@ -0,0 +1,79 @@
+# Checking Out the Code and Installing Required Applications
+
+Note: These instructions assume you're using Mac OS X Mavericks as the host server, and assume that we're installing
+this application at `/Volumes/Data/test-results`.
+
+1. Install Server (DO NOT launch the Server app)
+2. Install Xcode with command line tools (only needed for svn); On Mavericks, simply run svn to trigger the installation.
+3. `svn co https://svn.webkit.org/repository/webkit/trunk/Websites/test-results /Volumes/Data/test-results`
+
+# Configuring Apache
+
+Always use apachectl instead of the Server App to start or stop Apache.
+ - Starting httpd: `sudo apachectl stop`
+ - Stopping httpd: `sudo apachectl restart`
+
+## Edit /private/etc/apache2/httpd.conf
+
+1. Uncomment `"LoadModule php5_module libexec/apache2/libphp5.so"`
+2. Update ServerAdmin to `[email protected]`
+2. Set ServerName.
+3. Change DocumentRoot to `/Volumes/Data/test-results/public/`
+4. Change the directives for the document root and / to point to `/Volumes/Data/test-results/public/`
+5. Add Add the following directives to enable zlib compression and MultiViews:
+
+        Options Indexes MultiViews
+        php_flag zlib.output_compression on
+
+6. Delete or comment out directives on CGI-Executables
+7. Add the following directives to enable gzip:
+
+        <IfModule mod_deflate.c>
+            AddOutputFilterByType DEFLATE text/html text/xml text/plain application/json application/xml application/xhtml+xml
+        </IfModule>
+
+Note: If you've accidentally turned on the Server app, httpd.conf is located at `/Library/Server/Web/Config/apache2/` instead.
+Delete the Web Sharing related stuff and include `/private/etc/apache2/httpd.conf` at the very end.
+
+By default, the Apache error log will be located at `/private/var/log/apache2/error_log`.
+
+
+# Protecting the Administrative Pages to Prevent Execution of Arbitrary Code
+
+By default, the application gives the administrative privilege to everyone. Anyone can add, remove, or edit tests,
+builders, and other entities in the database and may even execute arbitrary _javascript_ on the server via aggregators.
+
+We recommend protection via Digest Auth on https connection.
+
+Generate a password file via `htdigest -c <path> <realm> <username>`, and then add the following directive:
+
+        <Directory "/Volumes/Data/test-results/public/admin/">
+        	AuthType Digest
+        	AuthName "<realm>"
+        	AuthDigestProvider file
+        	AuthUserFile "<path>"
+        	Require valid-user
+        </Directory>
+
+where <realm> is replaced with the realm of your choice.
+
+
+# Configuring PostgreSQL
+
+1. Create database: `/Applications/Server.app/Contents/ServerRoot/usr/bin/initdb /Volumes/Data/test-results/database`
+2. Start database:
+   `/Applications/Server.app/Contents/ServerRoot/usr/bin/pg_ctl -D /Volumes/Data/test-results/database
+   -l logfile -o "-k /Volumes/Data/test-results/database" start`
+
+## Creating a Database and a User
+
+1. Create a database: `/Applications/Server.app/Contents/ServerRoot/usr/bin/createdb test-results-db -h localhost`
+2. Create a user: `/Applications/Server.app/Contents/ServerRoot/usr/bin/createuser -P -S -e test-results-user -h localhost`
+3. Connect to database: `/Applications/Server.app/Contents/ServerRoot/usr/bin/psql test-results-db -h localhost`
+4. Grant all permissions to the new user: `grant all privileges on database "test-results-db" to "test-results-user";`
+5. Update database/config.json.
+
+## Initializing the Database
+
+Run `database/init-database.sql` in psql as `test-results-user`:
+`/Applications/Server.app/Contents/ServerRoot/usr/bin/psql test-results-db -h localhost --username test-results-user -f init-database.sql`

Modified: trunk/Websites/test-results/config.json (157989 => 157990)


--- trunk/Websites/test-results/config.json	2013-10-25 04:43:19 UTC (rev 157989)
+++ trunk/Websites/test-results/config.json	2013-10-25 05:17:56 UTC (rev 157990)
@@ -5,9 +5,9 @@
     "database": {
         "host": "localhost",
         "port": "5432",
-        "username": "safari-test-history",
+        "username": "test-results-user",
         "password": "password",
-        "name": "safari-test-history-db"
+        "name": "test-results-db"
     },
     "masters": [
         "build.webkit.org",

Copied: trunk/Websites/test-results/init-database.sql (from rev 157989, trunk/Websites/test-results/public/include/init-database.sql) (0 => 157990)


--- trunk/Websites/test-results/init-database.sql	                        (rev 0)
+++ trunk/Websites/test-results/init-database.sql	2013-10-25 05:17:56 UTC (rev 157990)
@@ -0,0 +1,60 @@
+DROP TABLE results CASCADE;
+DROP TABLE tests CASCADE;
+DROP TABLE build_revisions CASCADE;
+DROP TABLE builds CASCADE;
+DROP TABLE slaves CASCADE;
+DROP TABLE repositories CASCADE;
+DROP TABLE builders CASCADE;
+
+CREATE TABLE builders (
+    id serial PRIMARY KEY,
+    master varchar(64) NOT NULL,
+    name varchar(64) NOT NULL UNIQUE,
+    build_url varchar(1024));
+
+CREATE TABLE repositories (
+    id serial PRIMARY KEY,
+    name varchar(64) NOT NULL,
+    url varchar(1024),
+    blame_url varchar(1024));
+
+CREATE TABLE slaves (
+    id serial PRIMARY KEY,
+    name varchar(128) NOT NULL UNIQUE);
+
+CREATE TABLE builds (
+    id serial PRIMARY KEY,
+    builder integer REFERENCES builders ON DELETE CASCADE,
+    number integer NOT NULL,
+    start_time timestamp,
+    end_time timestamp,
+    slave integer REFERENCES slaves ON DELETE CASCADE,
+    CONSTRAINT builder_and_build_number_must_be_unique UNIQUE(builder, number));
+CREATE INDEX build_builder_index ON builds(builder);
+CREATE INDEX build_slave_index ON builds(slave);
+
+CREATE TABLE build_revisions (
+    build integer NOT NULL REFERENCES builds ON DELETE CASCADE,
+    repository integer NOT NULL REFERENCES repositories ON DELETE CASCADE,
+    value varchar(64) NOT NULL,
+    time timestamp,
+    PRIMARY KEY (repository, build));
+CREATE INDEX revision_build_index ON build_revisions(build);
+CREATE INDEX revision_repository_index ON build_revisions(repository);
+
+CREATE TABLE tests (
+    id serial PRIMARY KEY,
+    name varchar(1024) NOT NULL UNIQUE,
+    category varchar(64) NOT NULL,
+    reftest_type varchar(64));
+
+CREATE TABLE results (
+    id serial PRIMARY KEY,
+    test integer REFERENCES tests ON DELETE CASCADE,
+    build integer REFERENCES builds ON DELETE CASCADE,
+    expected varchar(64) NOT NULL,
+    actual varchar(64) NOT NULL,
+    modifiers varchar(64) NOT NULL,
+    time integer);
+CREATE INDEX results_test ON results(test);
+CREATE INDEX results_build ON results(build);

Deleted: trunk/Websites/test-results/public/include/init-database.sql (157989 => 157990)


--- trunk/Websites/test-results/public/include/init-database.sql	2013-10-25 04:43:19 UTC (rev 157989)
+++ trunk/Websites/test-results/public/include/init-database.sql	2013-10-25 05:17:56 UTC (rev 157990)
@@ -1,60 +0,0 @@
-DROP TABLE results CASCADE;
-DROP TABLE tests CASCADE;
-DROP TABLE build_revisions CASCADE;
-DROP TABLE builds CASCADE;
-DROP TABLE slaves CASCADE;
-DROP TABLE repositories CASCADE;
-DROP TABLE builders CASCADE;
-
-CREATE TABLE builders (
-    id serial PRIMARY KEY,
-    master varchar(64) NOT NULL,
-    name varchar(64) NOT NULL UNIQUE,
-    build_url varchar(1024));
-
-CREATE TABLE repositories (
-    id serial PRIMARY KEY,
-    name varchar(64) NOT NULL,
-    url varchar(1024),
-    blame_url varchar(1024));
-
-CREATE TABLE slaves (
-    id serial PRIMARY KEY,
-    name varchar(128) NOT NULL UNIQUE);
-
-CREATE TABLE builds (
-    id serial PRIMARY KEY,
-    builder integer REFERENCES builders ON DELETE CASCADE,
-    number integer NOT NULL,
-    start_time timestamp,
-    end_time timestamp,
-    slave integer REFERENCES slaves ON DELETE CASCADE,
-    CONSTRAINT builder_and_build_number_must_be_unique UNIQUE(builder, number));
-CREATE INDEX build_builder_index ON builds(builder);
-CREATE INDEX build_slave_index ON builds(slave);
-
-CREATE TABLE build_revisions (
-    build integer NOT NULL REFERENCES builds ON DELETE CASCADE,
-    repository integer NOT NULL REFERENCES repositories ON DELETE CASCADE,
-    value varchar(64) NOT NULL,
-    time timestamp,
-    PRIMARY KEY (repository, build));
-CREATE INDEX revision_build_index ON build_revisions(build);
-CREATE INDEX revision_repository_index ON build_revisions(repository);
-
-CREATE TABLE tests (
-    id serial PRIMARY KEY,
-    name varchar(1024) NOT NULL UNIQUE,
-    category varchar(64) NOT NULL,
-    reftest_type varchar(64));
-
-CREATE TABLE results (
-    id serial PRIMARY KEY,
-    test integer REFERENCES tests ON DELETE CASCADE,
-    build integer REFERENCES builds ON DELETE CASCADE,
-    expected varchar(64) NOT NULL,
-    actual varchar(64) NOT NULL,
-    modifiers varchar(64) NOT NULL,
-    time integer);
-CREATE INDEX results_test ON results(test);
-CREATE INDEX results_build ON results(build);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to