Commit Graph

141 Commits

Author SHA1 Message Date
Robin Malley 68561443a5 Mark unlisted posts
There was a bug where unlisted posts would not have a marker next to
them to show they are unlisted.
2021-10-11 01:01:18 +00:00
Robin Malley 069c75b72e Add a delete button.
Add a delete button to posts that will show up if the user is logged in
and is the owner of a post. If javascript is enabled, the user will be
prompted for conformation before deleting a post.
2021-10-11 00:59:50 +00:00
Robin Malley 81ad49ae80 Fix warnings
Compileing should happen without warnings, even with extra warnings.
2021-10-11 00:57:11 +00:00
Robin Malley c00903505b Remove debugging statement 2021-09-12 01:53:34 +00:00
Robin Malley 9dcc743199 Reset session correctly
Sometimes logging in doesn't work correctly, fix it.
2021-09-12 01:53:06 +00:00
Robin Malley 6398e97498 Add a logout button
Add a button that only shows when users are logged in, allowing
them to log out.
2021-09-12 01:47:40 +00:00
Robin Malley 9444d300b8 Allow logged in users to use their session immediately.
Fix a bug where unit tests are attempting to log in and use their
session key in the same second that the session key was created.
2021-09-11 21:50:23 +00:00
Robin Malley 3bd07ebf6a Fix search parser
Allow + or - in the search string as long as it is not preceeded by
a space. If it is preceeded by a space, it starts a new search
constraint.
2021-09-11 21:49:15 +00:00
Robin Malley d11695b5eb Remove extra prints 2021-08-27 01:08:51 +00:00
Robin Malley eac2a38c6c Add a logout button
Add a button so users know if they're logged in.
2021-08-27 01:08:30 +00:00
Robin Malley 4913e7765e Extra cache dirtying
Some pages weren't getting dirtied appropriately on change.
2021-08-27 01:08:02 +00:00
Robin Malley f88ec0e22a Use database from config
Use the database file that came from the config file.
2021-08-27 01:06:55 +00:00
Robin Malley 7e5e38c3f2 Add database to config
Add the database to the config file so we can override it for
unittests.
2021-08-27 01:06:24 +00:00
Robin Malley 3db891800b Improve cacheing
Caches domain/a and author.domain/a as the same page.
2021-07-28 00:39:04 +00:00
Robin Malley 3b6a631dc4 hotfix 2021-04-09 20:15:01 +00:00
Robin Malley e5d1904b1f Try to hint reader mode better.
Line breaks in the imageboard parser now use an empty paragraph tag
to try to hint that the page should use reader mode.
2021-04-09 20:03:24 +00:00
Robin Malley 7cc5e8d0ef Add information to failed api requests
Add addition information when requests for tag suggestions fail.
2021-04-09 19:17:22 +00:00
Robin Malley 9e51de6c8e Fix CSRF
Domain name was hardcoded, use the config file instead.
2021-04-09 19:16:36 +00:00
Robin Malley fd87cf95ee Add bookmark script.
Add a script that saves the position on read pages to localstorage, and
restores the page position when the page is reloaded.
2021-04-04 06:11:55 +00:00
Robin Malley fdf0b67f3a Remove prints.
Remove some extranious prints.
2021-04-04 06:11:14 +00:00
Robin Malley 33a23ef20c Set samesite on cookies.
Set the SameSite attribute on all cookies issed to Lax.
2021-04-04 06:03:03 +00:00
Robin Malley 73df8d400e Updates to imageboard parser 2021-04-04 05:13:09 +00:00
Robin Malley 53b1a19c05 Fix hangups in imageboard parser
Fix some hangups in the imageboard parser by allowing multiple
markup characters in a row to immediately close the markup
segment instead of going forward to try to find a non-markup
segment to include.
2021-03-20 06:39:46 +00:00
Robin Malley 8cf7344e7b Minor fixups
Add dark theme to tag suggestions, and remove printf() call.
2021-02-22 07:08:50 +00:00
Robin Malley 701800cfe2 Finish adding tag suggestions
Lots of changes, did an inital wack at adding tag suggestions.
2021-02-22 06:59:51 +00:00
Robin Malley 9d2c95bb33 fix 2021-02-14 07:56:28 +00:00
Robin Malley 896f452fa6 Start work on tag suggestions
Start working on getting tag suggestions for pasteing and editing pages.
2021-02-14 07:30:20 +00:00
Robin Malley 67de40c02b Actually fix the url generation 2021-02-13 18:40:17 +00:00
Robin Malley 0f17393cd8 Fix id<->url decoding
Some urls should have been url-encoded, fix this issue in a way
that won't break old urls
2021-02-09 02:40:57 +00:00
Robin Malley 45e1ba3fcb Stop using unsafe characters
Several characters used for short path generation are unsafe to
use without escaping. Remove those.
2021-02-03 05:23:28 +00:00
Robin Malley 879e89fa8d Do more refactoring
Start merging the error pages into a single standardized error page
Lessen log spew when site is being crawled by robots
2021-02-03 04:09:12 +00:00
Robin Malley 7462b1e7ac Add an archive 2021-02-03 03:41:22 +00:00
Robin Malley c173fae026 Throw a more descriptive error temporarily 2021-01-26 02:12:42 +00:00
Robin Malley 4a99441008 Fix the Unlisted checkbox always being checked
Fixed a bug where the unlisted checkbox was always checked when
ending a post.
2021-01-26 01:20:40 +00:00
Robin Malley 1f5b113daa Remove globals
Clean up a bunch of places where the global namespace was being
polluted by accident.
2021-01-17 05:10:16 +00:00
Robin Malley 6cd786be1a Fix dependencies 2021-01-16 21:02:34 +00:00
Robin Malley 18d1f3ea87 Remove debugging prints 2021-01-16 21:02:20 +00:00
Robin Malley 861e53cc29 Add a comment 2021-01-16 20:59:56 +00:00
Robin Malley ff2e560a2c Remove debug prints from hash function 2021-01-16 20:58:57 +00:00
Robin Malley 1a2244b686 Finished up unlisted posts
Why does anon even want this feature?
2021-01-11 03:34:22 +00:00
Robin Malley 18f47bf708 Merge branch 'hotfix_tag_list' into master 2021-01-10 21:52:24 +00:00
Robin Malley 7001b992d9 fix not showing the correct number of extra tags 2021-01-10 21:42:19 +00:00
Robin Malley 85a730ebcb started working on unlisted posts 2021-01-10 21:34:13 +00:00
Robin Malley 7d71b119c1 Fix plain parser 2021-01-04 03:48:36 +00:00
Robin Malley ac24c97d24 Clean up prints 2021-01-04 03:20:55 +00:00
Robin Malley 01448dbe34 Update readme 2021-01-04 03:05:50 +00:00
Robin Malley 44ad323f31 Refactored pages
Added a dependency on "spp", simple preprocessor to do some
preprocessing around the templates. This will hopefully
allow the changes to be made in one place and propagate to
all the right pages.
2021-01-04 02:48:29 +00:00
Robin Malley 663da16a75 Fix the problem that caused the last crash.
In certain cases, the imageboard parser will have exponential time
complexity. While this patch fixes that particular problem, the
correct solution is to implement a timeout for particularly gnarly
parts of the code.
2020-12-29 20:19:05 +00:00
Robin Malley dae0f7b4bf Add search bar
Add a search bar to the index page.
2020-12-29 19:10:35 +00:00
Robin Malley f58e7b958c Merge branch 'testing' into master
Started working on unit tests,
also cleaned up some of the sql row iteration.
2020-12-28 04:32:23 +00:00
Robin Malley a169c68575 Merge branch 'refactor' into master 2020-12-28 04:28:26 +00:00
Robin Malley 8b0642ae46 clean up comments 2020-12-28 04:28:18 +00:00
Robin Malley 8cbc1497c9 Clean up unused files 2020-12-28 04:26:19 +00:00
Robin Malley 3a22c15dcd Add a search utility
Add a search utility
Implement a dark theme
Add an FAQ page with some info
2020-12-28 04:01:07 +00:00
Robin Malley 8a60675236 Remove extranious prints
Remove extra print statements that were cluttering up stdout
2020-12-27 05:56:03 +00:00
Robin Malley 41aecc8bc1 Approximate tab characters 2020-12-24 18:43:19 +00:00
Robin Malley 68bac839ab Allow more syscalls 2020-12-24 05:02:22 +00:00
Robin Malley fa72d1065a Fix plain parser 2020-12-24 04:36:52 +00:00
Robin Malley 9fb67b2e1e Remove extra prints 2020-12-24 04:11:05 +00:00
Robin Malley a144c25ab8 Major refactor
Moved all code into seperate endpoints folder
Various bugfixes
2020-12-23 06:38:17 +00:00
Robin Malley 1236271834 Remove extra prints
Remove extra prints so the testing branch dosen't have it's test
results cluttered up
2020-12-23 06:07:00 +00:00
Robin Malley b1b7b45e80 Started testing 2020-12-23 06:02:02 +00:00
Robin Malley a45d0787a2 Organize lua endpoints
Move all endpoints under the src/lua/endpoints folder, and
delete the previous location.
2020-12-21 23:32:29 +00:00
Robin Malley a640096bdd More work on refactor 2020-12-21 04:22:22 +00:00
Robin Malley 2cd10b6968 Started work on refactor
Started work on moveing each endpoint into it's own file.
2020-12-20 08:16:23 +00:00
Robin Malley 86a14e9d62 Prevent invalid names from registering
For some reason the kore validators are broken.
It's nice to have proper error messages anyway I guess.
2020-10-17 20:03:40 +00:00
Robin Malley 3742a9d5c4 Throw an error message if the user enters a bad username
For some reason kore isn't checking parameters anymore, so check
them lua-side.
2020-10-13 18:10:55 +00:00
Robin Malley 709a5c9bad Add some hints for mobile users
Added hints to html to prevent mobile browsers from capitalizing
or autocorrecting usersnames on the login page.
2020-10-12 22:44:20 +00:00
Robin Malley 25fa8d9f0c Bold text on sign up page 2020-10-12 15:44:30 +00:00
Robin Malley fce26b2fde Don't require tags
Don't require tags to make a paste
2020-10-12 15:07:26 +00:00
Robin Malley 4c65fc3692 Allow logged in users to "hit" their own paste
Increments the view counter in an edge case where the logged in
user is viewing their own paste.
2020-10-12 00:15:38 +00:00
Robin Malley 5e922719bd Relabed views to hits
Relabled the views so it's more consistent with other websites.
"Views" seems to imply we track unique views, while "hits" confers
that we only track requests.
2020-10-11 23:56:10 +00:00
Robin Malley 81a116d3d5 Added buttons
Added buttons for new paste, login, and register.
2020-10-11 23:55:46 +00:00
Robin Malley b1f7a6d09f Fixed search bug
Fixed a bug where the first search would be repeated for all
following searches (stmt:reset() strikes agains).
2020-10-11 23:55:02 +00:00
Robin Malley e6b1b7a8a1 Various updates
+ Added tags to stories
+ Added a view counter to stories
+ Added a very basic search by tag function
~ Modified imageboard parser so that blank lines are preserved
~ Raised the minimum cache time from 2 seconds to 20 seconds
2020-10-10 23:28:39 +00:00
Robin Malley 55c56969ea Added preview
Added a preview button the the paste page that allows users to
preview their paste before submitting.

Various additions to the imageboard parser to make it more robust
and accept more inputs.
2020-08-24 21:38:24 +00:00
Robin Malley 496066e3aa Hotfix
Fix comments showing up on the wrong stories.
2020-08-24 17:46:11 +00:00
Robin Malley bcb48bae3d Add more information to errors
Add more information when cacheing breaks, and when people requests
stories that don't exist (probably robots)
2020-08-24 17:20:33 +00:00
Robin Malley e061d1d8a3 Modified style
Greentexts now appear correctly, without "reddit spaceing"
2020-08-18 22:40:09 +00:00
Robin Malley bce0788b62 Add comments
Add comments for each paste,
Also add a "Download TXT" button.
2020-08-13 17:59:33 +00:00
Robin Malley 0ba9e22f70 Make the anonymous account id = -1
This change also simplifies the site index query.
2020-05-19 20:14:22 -04:00
Robin Malley 03d4779129 Enable reader mode
Various fixes to enable reader mode on most platforms. I tested on
firefox, google chrome, and microsoft edge, I don't have an iphone, so
let me know if it's still broken.
2020-05-19 20:13:30 -04:00
Robin Malley 2e735282ec Fix cacheing
Fix some cache invalidation bugs that would cause the index and author
pages to not update correctly when new pastes were made.
2020-05-19 20:11:11 -04:00
Robin Malley d2e2f41dfb Remove error from login page
A global variable might show up on the login page, remove it.
2020-05-19 17:12:44 -04:00
Robin Malley 226580f088 Minor bugfix
Create the raw_text table corretly
2020-05-19 14:06:10 -04:00
Robin Malley 2722b1e282 Allow uploaded files to have embedded nulls
Minor bugfix that correctly passes uploaded files to the lua runtime
when they have embedded nulls.
2020-05-19 14:04:39 -04:00
Robin Malley a5293ae7a6 minor bugfix 2020-05-18 10:41:27 -04:00
Robin Malley 37e1b0a6c0 Minor bugfix 2020-05-17 13:17:15 -04:00
Robin Malley 1863e14b34 Add a loggging utility
adds a function to the global namespace, log() as well as constants
from syslog(3) for logging messages.
2020-05-17 13:16:29 -04:00
Robin Malley 6c18829de6 Move sql files into their own directory
Moved all the of the sql out of the init file and into it's own
directory.
2020-05-17 12:05:00 -04:00
Linux User 48b4173a7a Inital commit 2020-05-15 19:10:20 -04:00