Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added cron to docker image #436

Merged
merged 12 commits into from
Sep 29, 2021
Merged

Added cron to docker image #436

merged 12 commits into from
Sep 29, 2021

Conversation

dale-wahl
Copy link
Member

This is a simple fix that installs cron to the docker image which allows the controller.php to run. I also added a blank config that a user can just add their API credentials to. It should resolve issue 433 and I believe would have helped with issue 417.

Docker caveat: Data persists within the docker image, but if that image is rebuilt, it will be lost. You can thus stop and start the container with no issues and can run and update software within the container. But if we were to make any changes to the docker image that would require it to be rebuilt, collected data would not persist.

The solution seems to be to use docker's volumes. I attempted a few ways to store the database in a volume, but could not get it to reliable persist after a rebuild. The best solution would likely be to have the database in it's own container, but that would require a bit more knowledge on how the rest of the application communicates with the database. Perhaps we can sit down and go through that at some point in the future.

@dale-wahl dale-wahl requested a review from ErikBorra May 5, 2021 11:00
@@ -129,6 +129,10 @@


<?php
$dataset = htmlentities($dataset);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is necessary and baffled me until I found this bit of code in analysis.common.functions.php. It looks like this will always pick up query parameters for analysis. I think we could apply htmlentities or htmlspecialchars to all the $_GET calls there.

The validate_all_variables function ought to be catching anything that could go into the database, but it does still allow someone to pull @stijn-uva's little ?dataset="><script src="data:text/javascript;charset=utf-8;base64,YWxlcnQoJ2hhY2tlZC4uLiBieSB0aGUgaWxsdW1pbmF0aScp"type="text/javascript" language="javascript"></script><input name="fake" type="hidden" value=" trick.

Copy link
Member Author

@dale-wahl dale-wahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested Docker deployment on Mac and Linux servers (tools). Does not work on Windows due to TokuDB.
Also tested Linux 20.04 direct installation and noted no issues with core functions (tweet collection, some analysis).
Updated echo's missing html special characters.

@dale-wahl dale-wahl merged commit 6310326 into master Sep 29, 2021
@dale-wahl dale-wahl mentioned this pull request Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Base table or view not found: 1146 Table 'twittercapture.tcat_query_bins' doesn't exist (docker)
1 participant