Skip to content

Commit

Permalink
Updated Sample Config Files
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaiahJTurner committed Jun 17, 2014
1 parent bd371f1 commit f8a5e42
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
19 changes: 16 additions & 3 deletions config.sample.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
{
"selectQuery" : "SELECT i.id, i.title, i.description, i.file, i.content, COALESCE(SUM(CASE WHEN a.isUpvote THEN 1 ELSE -1 END),0) AS rating FROM submissions AS i LEFT JOIN votes AS a ON i.id = a.post GROUP BY i.id",
"updateQuery" : "SELECT i.id, i.title, i.description, i.file, i.content, COALESCE(SUM(CASE WHEN a.isUpvote THEN 1 ELSE -1 END),0) AS rating FROM submissions AS i LEFT JOIN votes AS a ON i.id = a.post WHERE i.updated > _$ GROUP BY i.id",
"selectQuery" : "SELECT `i`.`id`, `i`.`type`,`i`.`title`,`i`.`lastVote`, `i`.`file`,
CONCAT(IFNULL(`i`.`description`, ''), ' ', IFNULL(`i`.`content`,'')) AS content,
COALESCE(SUM(CASE WHEN `a`.`isUpvote` THEN 1 ELSE -1 END),0) AS rating
FROM `submissions` AS i
LEFT JOIN `votes` AS a
ON `i`.`id` = `a`.`post`
GROUP BY `i`.`id`",
"updateQuery" : "SELECT `i`.`id`, `i`.`type`,`i`.`title`,`i`.`lastVote`, `i`.`file`,
CONCAT(IFNULL(`i`.`description`, ''), ' ', IFNULL(`i`.`content`,'')) AS content,
COALESCE(SUM(CASE WHEN `a`.`isUpvote` THEN 1 ELSE -1 END),0) AS rating
FROM `submissions` AS i
LEFT JOIN `votes` AS a
ON `i`.`id` = `a`.`post`
WHERE `i`.`lastVote` > _$
GROUP BY `i`.`id`",
"primaryField" : "id",
"updatedAtField": "updated",
"updatedAtField": "lastVote",
"source" : "jdbc:mysql://HostnameOfYourDatabase/YourDatabaseName",
"username" : "Your MYSQL Username",
"password" : "Your MYSQL Password",
Expand Down
4 changes: 1 addition & 3 deletions config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
define("DB_HOSTNAME", "localhost");
define("DB_NAME", "homeworkhunt");

// This should be very complex as it allows direct database modification on the server. If this is leaked, it would be very easy to modify `submissions.content` in the database. No other data can be modified with this key. I personally use an RSA 4096 key but going to https://api.wordpress.org/secret-key/1.1/salt/ & copying one of the keys should work. This key will be passed over HTTP.
define("CLOUDCONVERT_SECRET", "^m8++KBZ(&n%!g:VF?z-Gg]e=8[Pjb)l4LM[T_eMi[kl:f5*e:=ei(^HR_3!D%m1");
// This is the CloudConvert API key that can be attained by visiting their website and signing up.
define("CLOUDCONVERT_KEY", "w-YyInHEiCGpCRpBUsxi8M_vKxkodZ9mNjQLqOUWllI8gmuSk3pvb9w2ZGHMaIdRWTve0ivTF2ijizKyFhJmLA");

// Where is your server hosted? This is used for callbacks (such as CloudConvert's) and must be accessable remotely.
define("SERVER_HOSTNAME", "homeworkhunt.com");
// Does the above hostname allow for https connections?
define("SERVER_USE_HTTPS", false);
define("SERVER_PROTOCOL", "HTTP");

0 comments on commit f8a5e42

Please sign in to comment.