GithubHelp home page GithubHelp logo

neurosnap / lists.sh Goto Github PK

View Code? Open in Web Editor NEW
227.0 5.0 6.0 438 KB

a microblog for lists

Home Page: https://lists.sh

License: MIT License

Dockerfile 1.24% Makefile 5.04% Go 86.66% CSS 6.65% Shell 0.41%
blog-platform

lists.sh's Introduction

lists.sh

A microblog for lists.

comms

setup

  • golang v1.18

You'll also need some environment variables

export POSTGRES_PASSWORD="secret"
export DATABASE_URL="postgresql://postgres:secret@db/lists?sslmode=disable"
export LISTS_SSH_PORT=2222
export LISTS_WEB_PORT=3000
export LISTS_DOMAIN="lists.sh"
export LISTS_EMAIL="[email protected]"
export LISTS_PROTOCOL="http"

I just use direnv which will load my .env file.

development

db

I use docker-compose to standup a postgresql server. If you already have a server running you can skip this step.

Copy example .env

cp .env.example .env

Then run docker compose.

docker-compose up -d

Then create the database and migrate

make create
make migrate

build the apps

make build

run the apps

There are two apps: an ssh and web server.

./build/ssh

Default port for ssh server is 2222.

./build/web

Default port for web server is 3000.

subdomains

Since we use subdomains for blogs, you'll need to update your /etc/hosts file to accommodate.

# /etc/hosts
127.0.0.1 lists.test
127.0.0.1 erock.lists.test

Wildcards are not support in /etc/hosts so you'll have to add a subdomain for each blog in development. For this example you'll also want to change the domain env var to LISTS_DOMAIN=lists.test.

deployment

I use docker-compose for deployment. First you need .env.prod.

cp .env.example .env.prod

The production.yml file in this repo uses my docker hub images for deployment.

docker-compose -f production.yml up -d

If you want to deploy using your own domain then you'll need to edit the Caddyfile with your domain.

lists.sh's People

Contributors

antoniomika avatar marcuse avatar meowgorithm avatar neurosnap avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

lists.sh's Issues

Should images not be in the list?

I received some feedback that placing an image in the list is counter-intuitive. My inclination is to limit the number of special features that "break out" of a list. However, I did make the exception for headers so theoretically we could do the same for images. My concern is that this is a microblog for lists and we should be trying to stay true to the list style rendering, but I'm open to alternative ideas.

Trouble logging in with warp terminal

I had trouble logging in with warp. (It works fine with iTerm2).

ssh lists.sh
Connection to lists.sh closed.

It may be particular to my machine, so feel free to close, but wanted to document (here is verbose mode):

debug1: Offering public key: /Users/bbt/.ssh/id_rsa RSA SHA256:B78q7Sgg2PGBr5WxKYQgVgFZtpJG0TzraXbW4cb9WsQ
debug1: Server accepts key: /Users/bbt/.ssh/id_rsa RSA SHA256:B78q7Sgg2PGBr5WxKYQgVgFZtpJG0TzraXbW4cb9WsQ
debug1: Authentication succeeded (publickey).
Authenticated to lists.sh ([143.198.19.169]:22).
debug1: setting up multiplex master socket
debug1: channel 0: new [/Users/bbt/.ssh/165103009231089]
debug1: channel 1: new [client-session]
debug1: Entering interactive session.
debug1: pledge: id
debug1: Sending environment.
debug1: channel 1: setting env LC_ALL = "en_US.UTF-8"
debug1: Sending command:
                         printf '\033P$d{"hook": "SSH", "value": {"socket_path": "~/.ssh/165103009231089", "user": "%s", "machine": "%s", "remote_shell": "%s"}}\234' $(whoami) $(hostname) ${SHELL##*/}

                                                                                        if test "${SHELL##*/}" != "bash" -a "${SHELL##*/}" != "zsh"; then
                                           exec $SHELL
                                                      fi

                                                        case ${SHELL##*/} in
                                                                              bash) exec -a bash bash --rcfile <(echo 'set -o vi; set +o vi; HISTCONTROL=ignorespace; printf '\\''\033P$d{"hook": "InitShell", "value": {"shell": "bash"}}\234'\\''')
                            ;;
                                zsh) WARP_TMP_DIR=$(mktemp -d warptmp.XXXXXX)
                                                                             if [[ $? == 0 ]]; then
                                                                                                   echo '756e7365746f7074205a4c453b20756e736574205243533b20756e736574
                                                     20474c4f42414c5f5243533b207072696e746620275c7831625c7835305c
 7832345c7836347b22686f6f6b223a2022496e69745368656c6c222c2022
                                                             76616c7565223a207b227368656c6c223a20227a7368227d7d5c78396327' | command xxd -ps -r > $WARP_TMP_DIR/.zshenv
                                                       else
                                                           echo "Failed to bootstrap warp. Continuing with a non-bootstrapped shell."
                     fi
                       T
debug1: client_input_channel_req: channel 1 rtype exit-status reply 0
debug1: channel 1: free: client-session, nchannels 2
debug1: channel 0: free: /Users/bbt/.ssh/165103009231089, nchannels 1
Connection to lists.sh closed.
Transferred: sent 4520, received 1348 bytes, in 0.1 seconds
Bytes per second: sent 89192.3, received 26599.8
debug1: Exit status 0

style update: indent lists

From my email:

You said you wanted feedback: my only initial dislike is that you don’t intend the bullet items, i.e. the bullet is “in the margin”, which is increasingly common, but looks awful in my opinion.

Markdown rendering?

What's your opinion on potentially supporting markdown in the "lists" / "posts" files?

I'm a frontend web developer by day, I could definitely help you build it into your frontend 👍

Better error handling and logging when uploading posts

We are not providing proper logging for users when a file cannot be uploaded. We receive an error message in the SSH logs but it is not presented to the user which leads people to think that their post was published successfully when it wasn't.

https://news.ycombinator.com/item?id=31178054

Hi qudat, first of all, this is an awesome work! I've tried ssh and scp successfully, but my blog is still empty. Would you mind checking it? Really appreciate it, thank you!
https://lists.sh/mataherry

Blogs as subdomains

I want writers to feel like they have their "own space" to post without it feeling like part of some other website. In an effort to support that, I think having blogs as subdomains makes a lot of sense.

It definitely adds complexity to the app, but subdomains would provide a more self-contained user experience.

Future addition of code/monospace block?

Love the idea and execution of lists, definitely see myself mirroring my main blog on here (especially if gemini support is on the roadmap). I think a good minor addition to the syntax would be some way to create a code/monospace block similar to <pre/> in HTML or ``` in markdown.

I've tried to do it with > but that seems to create multiple quote blocks with spacing between lines. If there's already a way to do this or it's out of the scope of the project, please let me know!

Functionally, I think the way gemini defines ``` to "toggle" preformatted mode would make for a simple implementation while appealing to people used to both markdown and gemtext syntax.

Update docs to ask users to provide the username for the service when using our CMS

I think we should suggest users provide their username for this service when SSH'ing into our CMS. This will allow two things:

  • their local username doesn't leak into our logs
  • we can allow the same public key to be used by multiple accounts

https://news.ycombinator.com/item?id=31178373

Really cool. But obviously this will leak ssh private keys and your username to lists.sh
To prevent this I guess you have specify a username and create a specific key and use that: ssh -i key [email protected]

Special format to "break out" of a list

Another user submitted feedback that they would like to have a special flag to "break out" of a list. I fear this does not stay true to the nature of a microblog for lists but I'm open to alternative ideas.

Basically we would provide the ability for the user to close a list. We already allow something similar with headers.

Can page past the end of the discover list a couple of times

I was digging through the "discover interesting lists" list (heyo) and paged past the end into a couple of blank pages.

This page has a list of lists: https://lists.sh/read?page=8

Hitting next shows a blank page with only prev and next links. Those probably shouldn't be there if there aren't results to show for the page. I can keep hitting next a couple of times and it continues to show blank pages. Eventually I can get to where it only shows prev.

As of today, this URL leads to a mostly blank page with prev and next links: https://lists.sh/read?page=11

This page only has a prev but is still blank: https://lists.sh/read?page=12

This link leads to a page with only prev as well: https://lists.sh/read?page=10000

Good work, man! I'm super digging the Charm libs and I think this is a great use of them to build a rich, SSH-able experience for techies.

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.