-
Notifications
You must be signed in to change notification settings - Fork 1
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
Nov 2022 pi_news tutorial not functioning #1
Comments
Sorry for the trouble. I'll get on this as soon as I get back in town and can run through the whole thing with a fresh Pi. |
Hi @paulwratt, |
Thanks for your comments. Here are a few things we need to do:
This is the short version of the order of getting it to work as a non-root user (should work regardless of platform):
After that, you should be able to navigate to http://(pi-ip-addr):8088/ and see the results. For your other comments:
Thanks for giving us a try. We'll get to work on the fixes and I'll close this when they are done. Let me know if I missed anything. |
Hey guys, thanks for looking into things. By the lack of Issues I would say its just a lack of exposure, so there are just situations that had not been tried yet (BTW I came here from a Google News article on my phone, if you wondered how I found out about the project).
I would say "add a piece to the end of tut about what is expected and from where" (ie the urls/paths/config) including "run agregator, wait", "start server", and "what url to use" I think you guys did a pretty good job overall, considering that you have already updated it 6-7 months ago, and the in-code documentation was a "god-send" which explained alot both related and unrelated to the Tut, for someone who has not read any other part of the Docs yet. BTW has anyone tested EDIT: I would clarify why you need those empty "chat" files at the opening of the Tut, and what if the Chat Tut had already been performed, and like me you on going to run single instances as needed (but with max functionality) Maybe a note that the current "full text search" does_not_ apply to the Title (seen while watching the aggrigator doing its thing) - an excersize for the user - I got results with "pico" and "hackaday" but not with "hackerspace" (which is present in alot of RPi url Titles - at the end - they have lots of "MagPi" and "WireFrame" too ) maybe a comment on whats expected without I noticed the I forgot to mention, I played with Nodejs when it first came out, it seems you guys have captured that simplicity, while adding the functionality, without incurring the Bloat that has caused Nodejs to become a Security risk. |
I'm not sure why the demo does not index the title but you can fix that by changing the following: in pi_news_aggregator.js and in apps/pi_news/search.js See the section on Compound Indexes in the docs here: |
Thanks for that, I had not attempted any code change yet. My only question at this point is, having followed the Tut, do I need to rather use the Tut repo files to get the urls to work? With the copied file (from the demo website) into EDIT: I presume the reason noone has mentioned anything regarding this is that a copy from the Tut repo does work without changes .. yes? Is there any way to reparse the fulltext index on the current database without using |
I'm not specifically familiar with the pi_news app but I am familiar with Rampart overall. What I noticed is that the tutorial provides its own fairly replete directory tree, and this may be the source of some confusion. I can only provide generic answers here because I don't know the specifics of where you installed things on your machine. I created a virgin AWS lightsail instance and installed Rampart as the user "rampart" this is what your tree should look like:
All pathing issues for the web server are controlled by the
Have a look at structure of the Rampart website at https://www.rampart.dev/apps/editor/ and its web I'm flummoxed by your question about "reparse the fulltext index on the current database." In the pi news application. The
Fulltext indexes are much like any other standard SQL index. They are assistive in speeding things up by avoiding a linear scan of the records in a table. An index is never "reparsed", it is the new or modified data in a table that gets parsed and added to the index. In the aggregator.js script there's a function called Hope this helps clarify. |
Based on the Tut, I unzipped rampart to I did not install rampart. I ran the The "reparse the fulltext index on the current database" is based on the above amendments to the code. Without knowing how the rampart fulltext index functionality works, I just presumed that it is like other fulltext db functionality and builds a seperate "index db", and I would guess thats where the confusion is, Rampart fulltext index does not function so, but rather dynamically based of the changes outlined above (maybe, maybe not based on comments about Anyway, at this point, it seems I need to try a few things, including redoing the Tut in a couple of different ways (with and without the Tut Repo), and see how the above mentioned Title search affects results. On my setup |
The reason first-run takes a long time is because it is getting pages from the sites. Everything else is pretty fast. :) |
my internet is slow too, and although it gets the initial pages from just 3 sites, it total there are well over a couple of hundred articles to process .. (hence the "slow" reference ;) |
It's also because theres a rate limiter built into the page scraper. This avoids making the site owners angry.
|
hmm. seems those edits are only enough for a new the db knows that the indexing has changed :
as far as I can tell, the only way to "drop unique index" is to physically delete it, but there is probably other meta-data saying the pi_news table has a unique index in one of the other main db files (the CAPS files in I think I'll just post a PR to add the above code to the Tut Repo, and have a look at the Docs Repo and make sure that tut matches the Tut Repo and post any matching PR for the Docs Repo .. after I have tested everything, again, from scratch, again .. EDIT: actually, there does seem to be a possible way (using "alter"):
but I still think the "unique index" needs to be dropped first, so again, the simple-est way is still to run a new |
As an aside, Aaron (@aflin) told me that the title text was in-fact included in the main text field as a part of the page parsing and that including it with a compound index (field\field) was not needed in this case. DO NOT MANUALLY DELETE AN INDEX with a file-system command, it'll mess up the SYSTABLES in the database and effectively trash the whole DB. Use SQL's "drop index INDEXNAME". Some knowledge of SQL general precepts would be useful. Again, fulltext index creation time for the amount of data you have isn't that long in this case. Dropping and recreating the index should be a relatively trivial matter. The unique index is present on the URL field to ensure that replicate articles are not inserted. There should be no need to drop that index unless you intend to fully re-crawl all the data (--first-run). If we start this whole thread anew, there is NOTHING wrong with the application as provided on the site. The main issue and almost all subsequent issues were , I believe, caused by some confusion because the tutorial's files were installed in a different file tree than the main install. Aaron and I had a discussion about this and why it was done this way. His reasoning was that he wanted the tutorials to be self-contained, and I see his point. Had we included all tutorials in the main tarball this problem would not have happened. However, I argued against putting superfluous files in the main tarball because I wanted the installs to be as lean as possible, and to err on the side of no-bloat. You've used the term "PR" a couple times, I don't know its meaning. |
Hey @paulwratt , did you ever resolve your issue? |
I am using the RPi Debian 10 download (32bit Buster) from the latest (rampart-0.1.1)
I used it in-place based on the output of
./install.js
, and use a. rampart
source file with the mentioned explicit PATH set, as I first manually read the file but didn't find any install options I liked for my use case.https://rampart.dev/docs/tutorial-pi_news.html
I followed the above tut to test out rampart and give me something useful at the same time
There is no mention of how to start the server, even tho the tut mention that the config is pulled from
web_server/web_server_conf.js
(which is where I found the server start/stop scripts)The server Starts up ok-ish but its not running right:
There is an error trying to set owner of the PID file at startup.
There is no path to "/images/*" in the 404 output page.
Both
directoryFunc: true/dirlist
produce 500 Internal error(BTW that is the only setting I changed, nothing else in the file, even though I read the whole thing a couple of times, comparing it to my console output of the server startup script)
there are things in the tut that are not very clear, or not done (in the initial console output)
like not setting
chmod a+w pi_news_aggregator.js
and the#!
path is wrong for any type of installation besides/usr/local/bin/rampart
- I got it to work with. ../rampart ; rampart ./pi_news_aggregator.js --first-run
The
/apps/pi_news/search.js
does not work. in this repo I found and copied/html/index.html
which redirects to/apps/pi_nesw/search.html/
which also does not work, giving a 404 error.Based on the docs tut , accessing
/app/pi_news
gives a 404 error and/app/pi_news/
gives a 500 error (mentioned above). On the website (not the docs tut) there is a view source link to an editor that shows the code and location for/apps/pi_news.js
which I downloaded (from the editor) and that works (sort-of), at least it brings up HTML in a browser when I access either of those URLS, but the search functionality does not work (there are no results EDIT: for hackerspace - I just tried pico and that works) - During the initial update I noticed there are some items in the title that I wanted to search for (like hackerspace, but that is not how the search functions.NOTES:
I figured out which "search" page was producing the HTML output by comparing the file sources. It appears that the source code in this repo is (mostly) inline with the docs tut, and much newer that that used in the demo (does not use Bootstrap)
I could post the
500 Internal error
text, but its really related torampart
and not any of the tutorials, so I did not post it here atm.I forked the relevant repos but I didn't want to PR anything yet and I think there is a better way to
#!
(like perl does) but it needs testing in the other (and default) installation (some of which I can test), so I'd like some input on the above before I start doing anything else ..The text was updated successfully, but these errors were encountered: