fully selfhosted multi-user web app for externally storing Reddit items (saved, created, upvoted, downvoted, hidden) to bypass Reddit's 1000-item listing limits

Overview

expanse

fully selfhosted multi-user web app for externally storing Reddit items (saved, created, upvoted, downvoted, hidden) to bypass Reddit's 1000-item listing limits

  • features::
    • new items auto-sync
    • synced items not affected by Reddit deletion
    • search for items
    • filter by subreddit
    • unsave/delete/unvote/unhide items from Reddit directly on expanse
    • import csv data from Reddit data request
    • export data as json
  • demo
  • prereqs::
    • git
    • docker
    • docker compose
  • setup::
    1. clone repo: git clone https://github.com/jc9108/expanse.git
    2. cd into repo: cd ./expanse/
    3. create environment variables file: cp ./backend/.env_example ./backend/.env_prod
    4. fill out the values in the ./backend/.env_prod file
  • usage::
    1. cd into repo
    2. start: sh ./run.sh prod up (stop: sh ./run.sh prod down)
    3. go to http://localhost:1301
  • updating::
    1. cd into repo
    2. update: sh ./run.sh prod update
  • or, automatic startup and update via systemd::
    1. cd into repo
    2. update repo path in service file: sed -i "s./opt/expanse.$PWD.g" ./expanse.service
    3. allow executing ./run.sh: chmod +x ./run.sh
    4. enable and start service: systemctl enable ./expanse.service --now
  • hosted version
Comments
  • Expanse data is not beeing updated

    Expanse data is not beeing updated

    After some time I've run into an issue where the data is not getting updated anymore: last updated: 15h ago. I've imported my Reddit data with csv files which lead to an overall saved count of 4410. Also, my pihole fetched about 38000 requests to oauth.reddit.com. In the console I got this error while it's trying to update the data:

    RequestError: Error: ETIMEDOUT
        at new RequestError (/backend/node_modules/request-promise-core/lib/errors.js:14:15)
        at Request.plumbing.callback (/backend/node_modules/request-promise-core/lib/plumbing.js:87:29)
        at Request.RP$callback [as _callback] (/backend/node_modules/request-promise-core/lib/plumbing.js:46:31)
        at self.callback (/backend/node_modules/request/request.js:185:22)
        at Request.emit (node:events:513:28)
        at Timeout.<anonymous> (/backend/node_modules/request/request.js:851:16)
        at listOnTimeout (node:internal/timers:559:17)
        at processTimers (node:internal/timers:502:7) {
      cause: Error: ETIMEDOUT
          at Timeout.<anonymous> (/backend/node_modules/request/request.js:848:19)
          at listOnTimeout (node:internal/timers:559:17)
          at processTimers (node:internal/timers:502:7) {
        code: 'ETIMEDOUT',
        connect: true
      },
      error: Error: ETIMEDOUT
          at Timeout.<anonymous> (/backend/node_modules/request/request.js:848:19)
          at listOnTimeout (node:internal/timers:559:17)
          at processTimers (node:internal/timers:502:7) {
        code: 'ETIMEDOUT',
        connect: true
      },
          
      options: {
        gzip: true,
        json: true,
        headers: { 'user-agent': 'web:expanse:v=1.0.0 (hosted by u/myusername)' },
        baseUrl: 'https://oauth.reddit.com',
          
    {
          raw_json: 1,
          count: 9999,
          limit: 9007199254740991,
          before: 't3_xazslb'
        },
        auth: { bearer: 'hidden for privacy' },
        resolveWithFullResponse: true,
        timeout: 30000,
        transform: [Function: transform],
        uri: 'user/myusername/upvoted',
        method: 'GET',
        callback: [Function: RP$callback],
        simple: true,
        transform2xxOnly: false
      },
      response: undefined
    }
    

    At the moment I try to recreate the error:

    I've imported csv files to it (I think all of the possible ones). After that it didn't updated anymore.

    bug invalid 
    opened by Z0pyrus 18
  • After some time I get a 401 error and I need to relogin and reimport everything

    After some time I get a 401 error and I need to relogin and reimport everything

    When I'm not visiting my expanse instance in a while I get an 401 error and I have to login again. After logging back in all my before saved posts are gone. These are the logs from the console:

    getting user (myusername)
    deserialize error (myusername)
    Error: user (myusername) dne
        at Module.get (file:///backend/model/user.mjs:572:9)
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
        at async file:///backend/controller/server.mjs:60:13
    Error: user (myusername) dne
        at Module.get (file:///backend/model/user.mjs:572:9)
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
        at async file:///backend/controller/server.mjs:60:13
    destroyed session (myusername)
    

    I haven't changed my password in the meantime or changed anything else on my reddit account. This is also not the first time that this is happening

    bug 
    opened by Z0pyrus 10
  • Content isn't getting updated

    Content isn't getting updated

    The content of my user accounts stopped getting updated after a day. I set it up on Wednesday and the last update occurred on Thursday. Here's an excerpt of the logs:

    last Thursday at 9:49:37 PM updating user (Keagel)
    last Thursday at 9:49:39 PM updated user (Keagel)
    last Friday at 11:40:53 AM backed up db to file (23-09-2022_09꞉40꞉53꞉AM_UTC.sql)
    last Saturday at 11:40:53 AM backed up db to file (24-09-2022_09꞉40꞉53꞉AM_UTC.sql)
    yesterday at 11:40:53 AM backed up db to file (25-09-2022_09꞉40꞉53꞉AM_UTC.sql)
    today at 11:27:37 AM socket (1W4pcrj0y8-iKP_OAACZ) connected
    today at 11:27:37 AM getting user (Keagel)
    today at 11:27:37 AM deserialized user (Keagel)
    

    Restarting the container forces the updates though.

    Originally posted by @Keagel in https://github.com/jc9108/expanse/issues/1#issuecomment-1257775758

    bug no repro 
    opened by Keagel 8
  • Configure @db and @port

    Configure @db and @port

    Hello, Is it possible to make the connectionString configurable with environnement variable to specify db address and db port if we want to use an existing postgres database ?

    Regards

    request 
    opened by gTamatea 6
  • fix bugs and add new sorting functionality

    fix bugs and add new sorting functionality

    • replace querySelector with getElementById because it can handle ids that start with numbers
    • add functionality to sort by date asc or desc

    I wanted to improve on the current implementation and implement sorting by date ascending or descending. While testing my solution i noticed, that the list would fail to load if there are list elements with ids that begin with a number. This is because document.querySelector does not know how to handle this and throws an unhandled exception. If all ids in the current view contain a number at the first index, it will result in the list "buffering" indefinitely. It also prevented deletion of said list elements.

    > document.querySelector(`#4r5fyd`)
    
    > VM8380:1 Uncaught DOMException: Failed to execute 'querySelector' on 'Document': '#4r5fyd' is not a valid selector.
        at <anonymous>:1:10
    

    Feel free to give me suggestions for improvements of the new functionality.

    I tested this implementation multiple times and have not found issues with it.

    opened by Mrwebente 4
  • Error in backend

    Error in backend

    Getting error while opening localhost:1301

    expanse_frontend_1 exited with code 0
    backend_1   |
    backend_1   | > prod
    backend_1   | > node ./controller/server.mjs
    backend_1   |
    backend_1   | update all completed
    backend_1   | server (expanse) started on (localhost:1301)
    backend_1   | [Error: ENOENT: no such file or directory, stat '/backend/build/index.html'] {
    backend_1   |   errno: -2,
    backend_1   |   code: 'ENOENT',
    backend_1   |   syscall: 'stat',
    backend_1   |   path: '/backend/build/index.html',
    backend_1   |   expose: false,
    backend_1   |   statusCode: 404,
    backend_1   |   status: 404
    backend_1   | }
    backend_1   | TypeError: Cannot read properties of undefined (reading 'user')
    backend_1   |     at file:///backend/controller/server.mjs:74:42
    backend_1   |     at Layer.handle_error (/backend/node_modules/express/lib/router/layer.js:71:5)
    backend_1   |     at trim_prefix (/backend/node_modules/express/lib/router/index.js:326:13)
    backend_1   |     at /backend/node_modules/express/lib/router/index.js:286:9
    backend_1   |     at Function.process_params (/backend/node_modules/express/lib/router/index.js:346:12)
    backend_1   |     at next (/backend/node_modules/express/lib/router/index.js:280:10)
    backend_1   |     at /backend/node_modules/express/lib/response.js:455:7
    backend_1   |     at SendStream.onerror (/backend/node_modules/express/lib/response.js:1071:5)
    backend_1   |     at SendStream.emit (node:events:513:28)
    backend_1   |     at SendStream.error (/backend/node_modules/send/index.js:270:17)
    backend_1   |     at SendStream.onStatError (/backend/node_modules/send/index.js:417:12)
    backend_1   |     at onstat (/backend/node_modules/send/index.js:722:26)
    backend_1   |     at FSReqCallback.oncomplete (node:fs:206:21)
    
    
    bug invalid 
    opened by subzero355 4
  • Embedded database support

    Embedded database support

    While browsing this repo I noticed from the compose.prod.yaml that expanse is a node.js application who's only dependency outside the NodeJS ecosystem is postgres, a database application. It looks to me like docker is used to run an instance of postgres as a dependency of expanse, but npm also has various embedded database libraries, and there's even embedded-postgres. Using one of these would allow the removal of docker as a requirement, which opens up many more options for packaging expanse, especially using existing automated tools for nodejs packaging. Using an embedded database by default and allowing the user to configure an external database at their preference provides a much higher degree of portability to the software that self-hosters like myself would much appreciate.

    request 
    opened by sugoidogo 3
  • Use same api structure as reddit

    Use same api structure as reddit

    I know this is a tall order but...

    If you refactored the backend api endpoints to mirror the existing reddit api, at least as a subset of the api, developers could use your application as a proxy. Basically as a cache using the same api. Would enable existing applications to leverage your app with only a URL change.

    request 
    opened by FoxxMD 3
  • Frontend Container never runs

    Frontend Container never runs

    Just tried to clone the repo and follow the steps in your readme, however the frontend container never seems to come up.

    I've tried resetting and manually running commands from your run.sh script but it still is not successful. The frontend container never starts and shows no logs. The build and run process using your script has the error. Different line numbers are shown based on the run.sh command you use

    ./run.sh: line 30: return: can only `return' from a function or sourced script

    bug invalid 
    opened by tomtom215 2
  • Unable to authenticate with Reddit

    Unable to authenticate with Reddit

    Super excited to try this out! Thanks for making this happen! I have, though, run into a setup issue...

    1. Visit https://local.domain.com/
    2. Click Login with Reddit
    3. Click allow from Reddit
    4. Returned to https://local.domain.com/logout#_

    Some notes on my configuration

    • My user is in the approved list in the .env_prod file.
    • I am using a subdomain on a domain that I own that is proxied through Nginx Proxy Manager, which is also listed in the config file for the callback URL and is used on Reddit as the callback URL. This domain name is not accessible to the external network.

    I am seeing the following in the logs

    From the database:

    2022-09-11 20:50:17.781 UTC [69] LOG:  incomplete startup packet,
    2022-09-11 20:50:17.450 UTC [1] LOG:  database system is ready to accept connections,
    2022-09-11 20:50:17.446 UTC [62] LOG:  database system was shut down at 2022-09-11 20:50:17 UTC,
    2022-09-11 20:50:17.440 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432",
    2022-09-11 20:50:17.437 UTC [1] LOG:  listening on IPv6 address "::", port 5432,
    2022-09-11 20:50:17.437 UTC [1] LOG:  starting PostgreSQL 14.5 (Debian 14.5-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit,
    2022-09-11 20:50:17.437 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
    

    From the app:

    server (expanse) started on (localhost:1301)
    saved user (reddituser),
    checking if user (reddituser) exists,
    purged user (reddituser),
    denied user (reddituser),
    socket (WDZoBrdZVFDhSc-1AAAL) connected,
    new user (reddituser),
    socket (tk5NIOso-aftuQw4AAAJ) connected,
    

    I've tried to figure out where localhost:1301 is being set, but can't find it. I have found that that can cause issues if it doesn't match the domain that I a using on the network. It is updated in the .env_prod file. This may not be related to this particular issue, but thought it wroth mentioning.

    Let me know what other questions you have. At the moment, this is all the info that I can find on the issue. And I fully recognize that this very well could be a pebkac errror. Any help is greatly appreciated.

    bug invalid 
    opened by rickcecil 2
  • Container exiting

    Container exiting

    When I try to run the container, it will stop with the following log:

    > docker
    > node -r dotenv/config controller/server.mjs dotenv_config_path=/data/.env_prod
    node:internal/process/esm_loader:108
        internalBinding('errors').triggerUncaughtException(
                                  ^
    Error: getaddrinfo ENOTFOUND undefined
        at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
      errno: -3008,
      code: 'ENOTFOUND',
      syscall: 'getaddrinfo',
      hostname: 'undefined'
    }
    Node.js v19.2.0
    

    Database is up & reachable, volume & env-file are available & readable, too. Am I missing something here?

    bug invalid 
    opened by micha-kaiser 1
  • [Feature] Store post content

    [Feature] Store post content

    Storing post content would protect against loosing access to deleted media, 3rd party sites taking down content etc.

    Ideally it would be based on a plugin system where its quite easy to create a content extractor for new types of links/posts, with default ones for text and Reddit images/galleries.

    Alternatively, or ideally as a plugin for the proposed content storage: Ability to Internet Archive/Wayback Machine links from posts and comments.

    request 
    opened by laundmo 7
Owner
J Chan
ヽʕ •ᴥ•ʔノ ♪
J Chan
Automagically bypass hcaptcha challenges with http api, with puppeteer, selenium, playwright browser automation scripts to bypass hCaptcha programmatically

Automagically bypass hcaptcha challenges with http api, with puppeteer, selenium, playwright browser automation scripts to bypass hCaptcha programmatically. For help you can message on discord server with the bellow link. You can also create an issue.

Shimul 199 Jan 2, 2023
A to-do list set up using webpack. It allows the user to add, remove, edit and check items on the list. All the data is saved in local storage.

Project Name: Webpack-Project: To-Do-List Description of the project: A simple to-do-list app created using webpack. Built With Major languages: HTML

Tracey Kadenyi 7 Aug 5, 2022
Reddit Place Tracer is a browser based userscript for the 2022 Reddit /r/Place project

Reddit Place Tracer is a browser based userscript for the 2022 Reddit /r/Place project which adds a transparent image on top of the canvas to aid communities with drawing the same image. It shows how the canvas should look, where each pixel goes, and what color. The user must manually click on these spots. It is not an automated bot and does not break any rules.

null 3 Apr 3, 2022
Select creates a dropdown list of items with the selected item in closed view.

Native Base Select ?? This module includes a customizable multi-select and a single select component for Native Base. The package is both Android and

Blump Tech 3 Dec 25, 2022
List of 1000 JavaScript Interview Questions

JavaScript Interview Questions & Answers Click ⭐ if you like the project. Pull Requests are highly appreciated. Follow me @SudheerJonna for technical

Sudheer Jonna 13.3k Dec 31, 2022
A Minimalist to do list website where user can add, remove and edit multiple tasks and All the changes user makes in his to do list is saved in browser local storage so that it can be accessed later.

Testing for Add Remove function in To Do List App Jest framework is used for testing. Created (addremove.test.js) for a file containing the add item a

Krishna Prasad Acharya 8 Aug 15, 2022
A simple app that helps a user monitor daily activities by adding, storing and deleting activities.Built with HTML,CSS and JavaScript

To-do-list A simple list app that allows a user to add and remove tasks. Built With HTML CSS JS Webpack Live Demo Click To-do-list to see the page. Ge

Catherine K 7 Apr 8, 2022
This is a little script that shows how to ddos a website. Can bypass cloudfare & ddos-guard. Ip switcher and random user agent

This is a little script that shows how to ddos a website. Can bypass cloudfare & ddos-guard. Ip switcher and random user agent

null 13 Dec 17, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Tumaini Maganiko 7 May 9, 2023
The app helps you to add todo items to your list, mark completed ones and also delete finished items. Its a handy tool for your day today activies. Check out the live demo.

Todo List App The app helps you to add todo items to your list, mark completed ones and also delete finished items. Its a handy tool for your day toda

Atugonza ( Billions ) Joel 14 Apr 22, 2022
A small web app that tries to imitate the desktop web version of amazon site, you can add items to the basket, delete them, and have your user authentication feature thanks to Firebase.

Features Here's the feature's included in this project ??‍??‍??‍?? Login Page ?? Products Page ?? Cart and Checkout Page ?? Sign up function with Goog

Murad Rahmanzada 16 Aug 22, 2022
The /r/place Atlas is a project aiming to catalog all the artworks created during Reddit's 2022 /r/place event.

The 2022 Place Atlas The /r/place Atlas is a project aiming to catalog all the artworks created during Reddit's 2022 /r/place event. This project was

Place Atlas 397 Dec 28, 2022
With this script you can bypass both root detection and ssl pinning for your android app.

frida_rootansslbypas ██████╗ ██████╗ ██████╗ ████████╗ █████╗ ███╗ ██╗██████╗ ███████╗███████╗██╗ ██████╗ ██╗ ██╗██████╗ █████╗

themalwarenews 14 Dec 24, 2022
Bypass YouTube ads! (Web Extensions)

bytads Bypass YouTube ads! Supported YouTube Advertising Formats Skippable video ads, Overlay ads! Other ad formats will be supported soon. Usage Inst

Binit Ghimire 9 Apr 3, 2022