Giter Site home page Giter Site logo

epilys / sic Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 1.0 2.55 MB

link aggregator community organised by tags (with no javascript)

Home Page: https://sic.pm

License: GNU Affero General Public License v3.0

Python 66.46% CSS 5.39% HTML 22.16% Rust 3.41% JavaScript 2.55% Makefile 0.03%
link-aggregator forum discussion-forum discussion django sqlite3 tags no-javascript python

sic's Introduction

[sic] link aggregator organised by tags AGPL-3.0 python3 django3 sqlite3

Public instance at https://sic.pm | Tor hidden service | IRC: #sic on Libera Chat | [sic] bot on Mastodon

frontpage screenshot frontpage on mobile screenshot

In a nutshell

  • No Javascript necessary. An HTML5 compliant browser is enough; it even runs on w3m, the text web browser.
  • Lightweight, requires only a python3 environment and stores its database in a sqlite3 file.
  • Can be deployed with WSGI compatible servers (Apache/NGINX) or even django's development server if need be.

✒️ Forum features

  • Posts can be text and/or URLs.
  • Posts can optionally have any number of tags.
  • Latest stories RSS and Atom feeds are provided.
  • Post and comment text content support commonmark Markdown syntax.
  • Posts and comments can only be upvoted. Support for flagging (downvoting) will be added soon.
  • Posts can be pinned to the top with a time limit or indefinitely.

🏷️ Tag and 🗂️ Aggregation system

  • Tags can optionally have any number of parent tags (but cycles are not allowed)
  • Tags can optionally be organised in Aggregations, which are collections of tags with a common theme. A user's frontpage can be either all stories or their subscribed aggregations' stories.
  • Aggregations can optionally be private, public or discoverable by other users.
  • Aggregations can be set as "default" by moderators. New users are subscribed to default aggregations.
  • Users can create their own aggregations at any time.
  • Tags, users and domains can be excluded from an Aggregation via exclude filters.

🔍 Search system

  • Comments and posts are automatically indexed in a separate sqlite database file using the fts5 (full text search) virtual table extension.
  • Posts with URLs can optionally have their remote content fetched and indexed with a django management command (e.g. from within a cron job).

🎛️ Permission and moderation system

  • Users can be inactive, active or banned.
  • Moderators can set the number of days for which an account is considered new. New accounts cannot add tags or perform other potentially destructive actions.
  • Public moderation log.

📨 Notification and email system

  • Mentioning other users in comments notifies them.
  • Users can choose when they receive each kind of notification via email
  • Users can optionally enable a weekly digest email.

👥 Account system

  • Users can either freely sign-up or have to be invited to.
  • Users can optionally request for an invitation (this feature can be turned off).
  • Users can save any story, comment to their bookmarks along with personal notes and export them at any time.
  • Users can add personal metadata in their profile, including an avatar.
  • Users can add "hats" to their account, which are decorations that can optionally be added to a comment. For example a moderator user wanting to comment as a moderator and not as a user would use a hat.
  • Users have a personalised Atom or RSS feed that shows only their subscriptions.

🌐 Web standards

Setup / Deployment

cp sic/local/secret_settings.py{.template,}
vim sic/local/secret_settings.py # REQUIRED: add secret token
vim sic/local/settings_local.py # OPTIONAL: local settings (SMTP etc)
python3 -m venv # OPTIONAL: setup virtual python enviroment in 'venv' directory
python3 -m pip install -r requirements.txt # Or 'pip3' install...
python3 manage.py migrate #sets up database
python3 manage.py createsuperuser #selfexplanatory
python3 manage.py runserver # run at 127.0.0.1:8000
python3 manage.py runserver 8001 # or run at 127.0.0.1:8001
python3 manage.py runserver 0.0.0.0:8000 # or run at public-ip:8000

For macos you will need to provide paths for headers and libraries like so:

$ python3 -m pip install pygraphviz
$ python3 -m pip install \
    --global-option=build_ext \
    --global-option="-I$(brew --prefix graphviz)/include/" \
    --global-option="-L$(brew --prefix graphviz)/lib/" \
    -r requirements.txt

See DEPLOY.md for deployment instructions.

Code style

See CODE_STYLE.md.

sic's People

Contributors

epilys avatar geoffbeier avatar klvebunc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

irregulator

sic's Issues

Error with setup

python3 -m pip install -r requirements.txt # Or 'pip3' install...
The above install step has problems with cmake. I tried setting environment variables, but still get the same result.
I am running this from gitbash in the directory I cloned:
I get the same error from VSCode. My cmake install is new (never used).
The path to CMakeOutput.log does not exist (so I couldn't check it).

pip3 install -r requirements.txt
Collecting Django<3.3,>=3.2
Using cached Django-3.2.16-py3-none-any.whl (7.9 MB)
Requirement already satisfied: Wand<0.7,>=0.6.6 in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from -r requirements.txt (line 2)) (0.6.11)
Collecting linkify-it-py==1.0
Using cached linkify_it_py-1.0.0-py3-none-any.whl (19 kB)
Collecting markdown-it-py==1.1.0
Using cached markdown_it_py-1.1.0-py3-none-any.whl (83 kB)
Collecting matplotlib==3.3.4
Using cached matplotlib-3.3.4.tar.gz (37.9 MB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting pdfminer.six==20200726
Using cached pdfminer.six-20200726-py3-none-any.whl (5.6 MB)
Collecting pygraphviz==1.7
Using cached pygraphviz-1.7.zip (118 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting python-igraph==0.9.6
Using cached python-igraph-0.9.6.tar.gz (3.6 MB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: uc-micro-py in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from linkify-it-py==1.0->-r requirements.txt (line 3)) (1.0.1)
Collecting attrs<22,>=19
Using cached attrs-21.4.0-py2.py3-none-any.whl (60 kB)
Collecting cycler>=0.10
Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting kiwisolver>=1.0.1
Using cached kiwisolver-1.4.4-cp310-cp310-win_amd64.whl (55 kB)
Requirement already satisfied: numpy>=1.15 in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from matplotlib==3.3.4->-r requirements.txt (line 6)) (1.23.4)
Collecting pillow>=6.2.0
Using cached Pillow-9.4.0-cp310-cp310-win_amd64.whl (2.5 MB)
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3
Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
Requirement already satisfied: python-dateutil>=2.1 in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from matplotlib==3.3.4->-r requirements.txt (line 6)) (2.8.2)
Requirement already satisfied: sortedcontainers in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from pdfminer.six==20200726->-r requirements.txt (line 7)) (2.4.0)
Collecting chardet
Using cached chardet-5.1.0-py3-none-any.whl (199 kB)
Collecting cryptography
Using cached cryptography-39.0.0-cp36-abi3-win_amd64.whl (2.5 MB)
Requirement already satisfied: texttable>=1.6.2 in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from python-igraph==0.9.6->-r requirements.txt (line 9)) (1.6.7)
Requirement already satisfied: asgiref<4,>=3.3.2 in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from Django<3.3,>=3.2->-r requirements.txt (line 1)) (3.5.2)
Requirement already satisfied: pytz in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from Django<3.3,>=3.2->-r requirements.txt (line 1)) (2022.6)
Requirement already satisfied: sqlparse>=0.2.2 in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from Django<3.3,>=3.2->-r requirements.txt (line 1)) (0.4.3)
Requirement already satisfied: six>=1.5 in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from python-dateutil>=2.1->matplotlib==3.3.4->-r requirements.txt (line 6)) (1.16.0)
Collecting cffi>=1.12
Using cached cffi-1.15.1-cp310-cp310-win_amd64.whl (179 kB)
Collecting pycparser
Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Installing collected packages: python-igraph, pyparsing, pygraphviz, pycparser, pillow, linkify-it-py, kiwisolver, Django, cycler, chardet, attrs, matplotlib, markdown-it-py, cffi, cryptography, pdfminer.six
DEPRECATION: python-igraph is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at pypa/pip#8559
Running setup.py install for python-igraph: started
Running setup.py install for python-igraph: finished with status 'error'
error: subprocess-exited-with-error

Running setup.py install for python-igraph did not run successfully.
exit code: 1

[67 lines of output]
running install
C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-310
creating build\lib.win-amd64-cpython-310\igraph
copying src\igraph\clustering.py -> build\lib.win-amd64-cpython-310\igraph
copying src\igraph\configuration.py -> build\lib.win-amd64-cpython-310\igraph
copying src\igraph\cut.py -> build\lib.win-amd64-cpython-310\igraph
copying src\igraph\datatypes.py -> build\lib.win-amd64-cpython-310\igraph
copying src\igraph\formula.py -> build\lib.win-amd64-cpython-310\igraph
copying src\igraph\layout.py -> build\lib.win-amd64-cpython-310\igraph
copying src\igraph\matching.py -> build\lib.win-amd64-cpython-310\igraph
copying src\igraph\operators.py -> build\lib.win-amd64-cpython-310\igraph
copying src\igraph\sparse_matrix.py -> build\lib.win-amd64-cpython-310\igraph
copying src\igraph\statistics.py -> build\lib.win-amd64-cpython-310\igraph
copying src\igraph\summary.py -> build\lib.win-amd64-cpython-310\igraph
copying src\igraph\utils.py -> build\lib.win-amd64-cpython-310\igraph
copying src\igraph\version.py -> build\lib.win-amd64-cpython-310\igraph
copying src\igraph_init_.py -> build\lib.win-amd64-cpython-310\igraph
creating build\lib.win-amd64-cpython-310\igraph\app
copying src\igraph\app\shell.py -> build\lib.win-amd64-cpython-310\igraph\app
copying src\igraph\app_init_.py -> build\lib.win-amd64-cpython-310\igraph\app
creating build\lib.win-amd64-cpython-310\igraph\drawing
copying src\igraph\drawing\baseclasses.py -> build\lib.win-amd64-cpython-310\igraph\drawing
copying src\igraph\drawing\colors.py -> build\lib.win-amd64-cpython-310\igraph\drawing
copying src\igraph\drawing\coord.py -> build\lib.win-amd64-cpython-310\igraph\drawing
copying src\igraph\drawing\edge.py -> build\lib.win-amd64-cpython-310\igraph\drawing
copying src\igraph\drawing\graph.py -> build\lib.win-amd64-cpython-310\igraph\drawing
copying src\igraph\drawing\metamagic.py -> build\lib.win-amd64-cpython-310\igraph\drawing
copying src\igraph\drawing\shapes.py -> build\lib.win-amd64-cpython-310\igraph\drawing
copying src\igraph\drawing\text.py -> build\lib.win-amd64-cpython-310\igraph\drawing
copying src\igraph\drawing\utils.py -> build\lib.win-amd64-cpython-310\igraph\drawing
copying src\igraph\drawing\vertex.py -> build\lib.win-amd64-cpython-310\igraph\drawing
copying src\igraph\drawing_init_.py -> build\lib.win-amd64-cpython-310\igraph\drawing
creating build\lib.win-amd64-cpython-310\igraph\remote
copying src\igraph\remote\gephi.py -> build\lib.win-amd64-cpython-310\igraph\remote
copying src\igraph\remote_init_.py -> build\lib.win-amd64-cpython-310\igraph\remote
running build_ext
running build_c_core
-- Building for: NMake Makefiles
-- Setting build type to 'Release' as none was specified.
-- Version number: 0.9.4
CMake Error at CMakeLists.txt:30 (project):
Running

 'nmake' '-?'

failed with:

 The system cannot find the file specified

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/admin/AppData/Local/Temp/pip-install-gyfbttfz/python-igraph_95190f8b1e4d4b949adde94d9c65927d/vendor/build/igraph/CMakeFiles/CMakeOutput.log".
We are going to build the C core of igraph.
Source folder: vendor\source\igraph
Build folder: vendor\build\igraph
Install folder: vendor\install\igraph

Configuring build...
Build failed for the C core of igraph.

[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

Encountered error while trying to install package.

python-igraph

Hide votes

Votes will stlll be used for calculating "hotness".

Extend max comment length

Right now it looks like comments are limited to 500 characters in length. Some restriction is good for the database and making sure users don't write their novel inline. But I ran into the 500 character limit super quickly when trying to reply to a post.

It looks like in the Lobsters rails schema the db field used is a MySQL medium text which would mean there's a limit of 16,777,215 bytes. A 16+ megabyte comment is pretty excessive. I looked through the code and couldn't find any other restrictions on it, though it wouldn't surprise me if I missed something.

If left up to me I'd make the limit 2,000 characters (or really 2,048 because I'm a nerd), since I'd want to encourage more indepth discussion. But figured I'd raise this issue here for discussion. There might be downsides to inlining values that large into sqlite but probably not for a while?

Implement "suggest tag" feature

Enable users to suggest tags for stories they didn't post, and automatically set the tags somehow

User should have a minimum standing in order to be able to suggest tags.

Perhaps there could also be a hidden "suggestion" score that indicates how often a user's tags suggestions are accepted by moderators or story posters and use the score in order to automatically set tags.

Auto-fetch URL title upon story submit form request if title field is empty

If title field in the submit form is empty, auto fill it with url title upon form submission.

example screenshots

Screen Shot 2021-07-15 at 10 02 45

Screen Shot 2021-07-15 at 10 04 13

location in codebase

Submitting a story is handled in this view:

sic/sic/views/__init__.py

Lines 206 to 215 in 4ca05ee

def submit_story(request):
user = request.user
if request.method == "POST":
form = SubmitStoryForm(request.POST)
if form.is_valid():
title = form.cleaned_data["title"]
description = form.cleaned_data["description"]
url = form.cleaned_data["url"]
publish_date = form.cleaned_data["publish_date"]
user_is_author = form.cleaned_data["user_is_author"]

problems

  • Field is "required" in HTML, the html attribute must go and instead have the title presence validated in the server response.
  • Need to timeout properly when attempting to fetch a title so as not to slow down server.

Can't access the site due to DNS

sic's nameserver, hosted by njal.la apparently has some issues with AFNIC the french TLD registrar (.fr/.re etc) which also manages .pm domains. It's been 5-6 days at the time of writing and still no resolution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.