Stacker.news
moderating forums with money
Install / Use
/learn @stackernews/Stacker.newsREADME
- Stacker News moderates forums with money
- What You See is What We Ship (look ma, I invented an initialism)
- 100% FOSS
- We pay bitcoin for PRs, issues, documentation, code reviews and more
- Next.js, postgres, graphql, and lnd
Getting started
Launch a fully featured SN development environment in a single command.
$ ./sndev start
Go to localhost:3000.
<br>Installation
- Clone the repo
- ssh:
git clone git@github.com:stackernews/stacker.news.git - https:
git clone https://github.com/stackernews/stacker.news.git
- ssh:
- Install docker
- If you're running MacOS or Windows, I highly recommend using OrbStack instead of Docker Desktop
- Please make sure that at least 10 GB of free space is available, otherwise you may encounter issues while setting up the development environment.
GitHub Codespaces
You can run Stacker News on Github Codespaces
Setup
- Open the repository on GitHub and click the "Code" button
- Select the Codespaces tab and create a new codespace.
- You can also configure your codespace to run select services based on
COMPOSE_PROFILESas well as in a different region and machine type by clicking "..." and selecting "New with options...". Check Modifying services for more information onCOMPOSE_PROFILES
- You can also configure your codespace to run select services based on
- Wait for the environment to set up (this may take several minutes the first time)
- Once ready, you'll see a terminal with the environment initialized
Usage
After the codespace is created, the development environment will be automatically set up and services started.
Access your running application at the URL shown in the forwarded ports panel (typically https://your-codespace-name-3000.app.github.dev).
Port Configuration
⚠️ Important: For various internal services and external access to work properly, you must set forwarded ports to Public in the Ports tab:
- In your codespace, look for the "PORTS" tab in the bottom panel
- Click the lock icon to change visibility from "Private" to "Public" <br>
Usage
Start the development environment
$ ./sndev start
View all available commands
$ ./sndev help
888
888
888
.d8888b 88888b. .d88888 .d88b. 888 888
88K 888 '88b d88' 888 d8P Y8b 888 888
'Y8888b. 888 888 888 888 88888888 Y88 88P
X88 888 888 Y88b 888 Y8b. Y8bd8P
88888P' 888 888 'Y88888 'Y8888 Y88P
manages a docker based stacker news development environment
USAGE
$ sndev [COMMAND]
$ sndev help [COMMAND]
COMMANDS
help show help
env:
start start env
stop stop env
restart restart env
status status of env
logs logs from env
delete delete env
sn:
login login as a nym
set_balance set the balance of a nym
lightning:
fund pay a bolt11 for funding
withdraw create a bolt11 for withdrawal
db:
psql open psql on db
prisma run prisma commands
domains:
domains custom domains dev management
dev:
pr fetch and checkout a pr
lint run linters
test run tests
other:
cli service cli passthrough
open open service GUI in browser
onion service onion address
cert service tls cert
compose docker compose passthrough
Modifying services
Running specific services
By default all services will be run. If you want to exclude specific services from running, set COMPOSE_PROFILES in a .env.local file to one or more of minimal,images,search,payments,wallets,email,capture. To only run mininal necessary without things like payments in .env.local:
COMPOSE_PROFILES=minimal
To run with images and payments services:
COMPOSE_PROFILES=images,payments
Merging compose files
By default sndev start will merge docker-compose.yml with docker-compose.override.yml. Specify any overrides you want to merge with docker-compose.override.yml.
For example, if you want to replace the db seed with a custom seed file located in docker/db/another.sql, you'd create a docker-compose.override.yml file with the following:
services:
db:
volumes:
- ./docker/db/another.sql:/docker-entrypoint-initdb.d/seed.sql
You can read more about docker compose override files.
Enabling semantic search
Semantic search is now enabled automatically in dev when the search profile is active.
-
Ensure
searchis inCOMPOSE_PROFILES:COMPOSE_PROFILES=...,search,... -
Start your environment with
./sndev start. -
On first boot, OpenSearch downloads and deploys the embedding model, then creates a neural-ready index. This can take a couple minutes.
No manual script run or container restart is required for the default setup.
If you need to manually repair or recreate semantic search resources, restart from a fresh dev volume with ./sndev delete and then run ./sndev start.
Local DNS via dnsmasq
To enable dnsmasq:
-
domains should be enabled in
COMPOSE_PROFILES:COMPOSE_PROFILES=...,domains,...
To add/remove DNS records you can now use ./sndev domains dns. More on this here.
Table of Contents
- Getting started
- Contributing
- Contribution extras
- Development Tips
- Internals
- Need help?
- Responsible Disclosure
- License
Contributing
We want your help.
<br>We pay bitcoin for contributions
- pull requests closing existing issues
- code review
- issue specification whether for bugs, features, or enhancements
- discovery of security vulnerabilities
- discovery of privacy vulnerabilities
- improvements to development documentation
- helpfulness
View a current list of granted awards
<br>Just in case
This document in no way legally entitles you to payments for contributions, entitles you to being a contributor, or entitles you to the attention of other contributors. This document lays out the system we can use to determine contribution awards which we generally intend to abide by but importantly we reserve the right to refuse payments or contributions, modify rules and award amounts, make exceptions to rules or reward amounts, and withhold awards for any reason at anytime, even just for the heck of it, at our sole discretion. If you need more certainty than what I've just described, don't participate. We provide awards as an experiment to make FOSS less sucky.
<br>Pull request awards
Rules
- PRs closing an issue will be awarded according to the
difficultytag on an issue, e.g.difficulty:easypays 100k sats. - Issues are occasionally marked with a
prioritytag which multiplies the award of a PR closing an issue, e.g. an issue marked withpriority:highanddifficulty:hardawards 2m sats. - An award is reduced by 10% of the award amount for each substantial change requested to the PR on code review, e.g. if two changes are requested on a PR closing an issue tagged with
difficulty:hard, 800k sats will be awarded.- Reductions are applied before
prioritymultipliers, e.g. a PR closing apriority:highanddifficulty:hardissue that's approved after two changes are requested awards 1.6m sats. - You are responsible for understanding the issue and
- Reductions are applied before
