Giter Club home page Giter Club logo

crystalvulpine / saidit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from libertysoft3/saidit

6.0 1.0 2.0 67.55 MB

The reddit open source fork powering SaidIt

Home Page: https://saidit.net

License: Other

Shell 0.99% JavaScript 22.91% Ruby 0.01% Python 46.97% C 0.28% Objective-C 0.48% Java 0.07% MATLAB 8.65% Forth 0.01% M 0.13% CSS 0.71% Mathematica 0.02% PigLatin 0.19% Makefile 0.09% Thrift 0.02% HTML 9.56% Cython 0.54% Dockerfile 0.07% Less 7.90% SCSS 0.41%

saidit's Introduction

SaidIt

SaidIt is a reddit open source continuation and fork with:

  • critical bug fixes and documentation
  • configurable site branding and home page
  • enhanced expandos/embeds: more media providers, direct media links, expandos in comments/sidebars/wiki pages
  • admin user bans and ip bans

Optional SaidIt features include:

  • two dimensional voting and content sorting where insightful is +2 and fun is +1
  • public moderator logs
  • web IRC chat integration

There are two supported installation methods- Docker or an Ubuntu 14 LTS server. Docker is recommended for production use and comes pre-configured for maximum performance. Running Ubuntu 14 LTS in a virtual machine is more flexible and is recommended for development use. Both approaches can be accomplished with Windows, MacOS, or Linux. Both approaches require that you make DNS changes to your machine to resolve https://reddit.local to your server.

Docker installation

The instructions assume that you are using Ubuntu 20 LTS as your Docker host.

Prepare host OS

$ sudo apt update && sudo apt -y upgrade
$ sudo apt install nginx docker docker-compose git
$ sudo usermod -a -G docker $USER
$ sudo systemctl enable docker && sudo systemctl restart docker
# or logout and login again to reload your group permissions
$ exec su -l $USER

Optionally fix any DNS timeout issues, for virtual machines (warning is Google DNS)

$ sudo apt install resolvconf
$ sudo sed -i "1i nameserver 8.8.4.4" /etc/resolv.conf && sudo sed -i "1i nameserver 8.8.8.8" /etc/resolv.conf
$ sudo systemctl enable resolvconf.service && sudo systemctl restart resolvconf.service

Install reddit open source

$ cd ~
$ git clone https://github.com/libertysoft3/saidit.git
$ cp saidit/docker-compose.yml . && cp -r saidit/docker .
$ rm -rf saidit
$ docker-compose up -d

Configure host OS's nginx

$ sudo cp docker/host/nginx/reddit-ssl /etc/nginx/sites-available/reddit-ssl
$ sudo ln -s /etc/nginx/sites-available/reddit-ssl /etc/nginx/sites-enabled/reddit-ssl
$ sudo openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout /etc/ssl/private/key.pem -out /etc/ssl/certs/cert.pem
$ sudo openssl dhparam -out /etc/ssl/dhparam.pem 2048
$ sudo nginx -t
$ sudo service nginx restart

Ubuntu 14 installation

These instructions assume that you have setup a VirtualBox virtual machine running Ubuntu 14.04 with 2+ CPU cores, 4GB of RAM, 30GB of disk space, user 'reddit' and OpenSSH server. Connecting to your virtual machine using SSH is recommended for easy copy and paste.

Install reddit open source

Run the installer

$ wget --no-check-certificate https://raw.github.com/libertysoft3/saidit/master/install-reddit.sh
$ chmod +x install-reddit.sh
$ sudo ./install-reddit.sh

The installer should complete with success message "Congratulations! reddit is now installed". Do not proceed unless you see this message.

Option A: start with an empty reddit

$ cd ~/src/reddit
$ reddit-run scripts/inject_test_data.py -c 'inject_configuration_data()'
$ sudo start reddit-job-update_reddits

Option B: populate sample user data including posts, comments, and subs

$ cd ~/src/reddit
$ reddit-run scripts/inject_test_data.py -c 'inject_test_data()'
$ sudo start reddit-job-update_reddits

Install search

Install Solr

$ cd ~
$ sudo apt-get install tomcat7 tomcat7-admin software-properties-common
$ wget http://archive.apache.org/dist/lucene/solr/4.10.4/solr-4.10.4.tgz
$ tar -xvzf solr-4.10.4.tgz
$ sudo mv solr-4.10.4 /usr/share/solr
$ sudo chown -R tomcat7:tomcat7 /usr/share/solr/example

Setup Solr and schema

$ sudo cp /usr/share/solr/example/webapps/solr.war /usr/share/solr/example/solr/
$ sudo cp /usr/share/solr/example/lib/ext/* /usr/share/tomcat7/lib/
$ sudo cp /usr/share/solr/example/resources/log4j.properties /usr/share/tomcat7/lib/
$ sudo cp ~/src/reddit/solr/schema4.xml /usr/share/solr/example/solr/collection1/conf/schema.xml
$ sudo chown tomcat7:tomcat7 /usr/share/solr/example/solr/collection1/conf/schema.xml

Setup Tomcat for Solr

$ sudo sed -i "s/^solr.log=.*$/solr.log=\/usr\/share\/solr/" /usr/share/tomcat7/lib/log4j.properties

$ sudo nano /etc/tomcat7/Catalina/localhost/solr.xml
# add content:
<Context docBase="/usr/share/solr/example/solr/solr.war" debug="0" crossContext="true">
  <Environment name="solr/home" type="java.lang.String" value="/usr/share/solr/example/solr" override="true" />
</Context>

# have tomcat use port 8983 ('solr_port' in example.ini), port 8080 is haproxy
sudo nano /etc/tomcat7/server.xml
# edit to set:
<Connector port="8983" protocol="HTTP/1.1"

# Solr is missing some required stuff:
$ sudo touch /usr/share/solr/solr.log
$ sudo mkdir /usr/share/tomcat7/temp
$ sudo chown tomcat7:tomcat7 /usr/share/solr/solr.log
$ sudo chown tomcat7:tomcat7 /usr/share/tomcat7/temp

# verify tomcat all good (ignore warnings):
$ /usr/share/tomcat7/bin/configtest.sh

Start solr

$ sudo service tomcat7 restart
# any errors logged must be fixed
$ sudo cat /var/log/tomcat7/catalina.out
# verify working, these should return html pages:
$ wget 127.0.0.1:8983
$ wget 127.0.0.1:8983/solr

Index site content

$ sudo start reddit-job-solr_subreddits
$ sudo start reddit-job-solr_links

Configure DNS for reddit.local

To access your reddit open source app, you must be able to resolve https://reddit.local to your Docker host or virtual machine. First, find the ip address of your Docker host or virtual machine. Then update your 'hosts' file (on your desktop or wherever your web browser is running). On linux, update /etc/hosts, on Windows and MacOS, see https://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/

Next steps

See also

Image of Saidit logo

saidit's People

Contributors

13steinj avatar ajacksified avatar alienth avatar andre-d avatar bboe avatar bsimpson63 avatar chrisst avatar chromakode avatar crystalvulpine avatar deimos avatar doriangray avatar dwick avatar jedberg avatar jordanmilne avatar kemitche avatar ketralnis avatar keysersosa avatar kjoconnor avatar libertysoft3 avatar melissacole avatar paradox460 avatar powerlanguage avatar rram avatar scamcast avatar shlurbee avatar spez avatar spladug avatar umbrae avatar xiongchiamiov avatar zeantsoi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

rdpgo riotcoke123

saidit's Issues

Having issues getting reddit.local to point to domain

Hi there,

I installed the reddit archive repo from here https://github.com/theorangedit/open-source-reddit that had the docker changes made for 2023 which was modified by saidit, I experienced no errors and is running on server, but I have changed the domain both public and private, internally and externally and bound the 'reddit.local' host with the private IP address and it is still redirecting to reddit.local instead of the domain on web. Any way you can help? I noticed he wrote scripts to dynamically clone the repos involved and that he modified everything to be inside of the docker container. Everything is running and logs show no errors but when I go to the domain I am pointing to, it still redirects to 'reddit.local.' My email is [email protected]. I would greatly appreciate if you could help me with this? The repo in question is https://github.com/subsapp/subist

Cassandra is missing

On https://github.com/CrystalVulpine/saidit/blob/master/docker-compose.yml , the referenced version of Cassandra ("cassandra:single-1.2.19-v1" ) no longer exists on https://github.com/reddit/docker-cassandra . It is saying "Not Found". This file version is nowhere to be found online other than the apache cassandra directory here https://archive.apache.org/dist/cassandra/1.2.19/, but it is unclear how to install this. A new container would need to be created for this and ran, but it is having compatibility issues for some reason when I try to run cassandra using multiple ports

It initially produces permission errors which I fixed, but then I get a lot of this:

nc: getaddrinfo: Name or service not known
Waiting for Cassandra...
nc: getaddrinfo: Name or service not known
Waiting for Cassandra...
nc: getaddrinfo: Name or service not known
Waiting for Cassandra...
nc: connect to cassandra port 9160 (tcp) failed: Connection refused
Waiting for Cassandra...
nc: connect to cassandra port 9160 (tcp) failed: Connection refused
Waiting for Cassandra...

Firewall is completely open for testing purposes, so that is not the issue. Changed listen_address and rpc_address to 0.0.0.0 and also the local container IP, network private IP, and network public IP, and nothing worked.

I restarted the containers for cassandra and 'reddit' after editing cassandra.yaml to ensure it didn't re-build and revert back to 'localhost', and still got this issue.

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.