Skip to content

Commit

Permalink
Rename smoothie -> soft-serve
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Aug 31, 2021
1 parent e47e9a9 commit 2cc93be
Show file tree
Hide file tree
Showing 15 changed files with 59 additions and 59 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SMOOTHIE_REPO_KEYS: "${{ secrets.SMOOTHIE_REPO_KEYS }}"
SOFT_SERVE_REPO_KEYS: "${{ secrets.SOFT_SERVE_REPO_KEYS }}"

steps:
- name: Install Go
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
aws_region = "$AWS_DEFAULT_REGION"
app_image = "$CONTAINER_REPO:$GITHUB_SHA-snapshot"
authorization_keys = <<EOT
$SMOOTHIE_REPO_KEYS
$SOFT_SERVE_REPO_KEYS
EOT
EOF
TF_VARS="-var-file=live.auto.tfvars"
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
smoothie
soft-serve
.ssh
.repos
dist
Expand Down
16 changes: 8 additions & 8 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project_name: smoothie
project_name: soft-serve

env:
- GO111MODULE=on
Expand All @@ -9,8 +9,8 @@ before:
- go mod download

builds:
- id: "smoothie"
binary: "smoothie"
- id: "soft-serve"
binary: "soft-serve"
ldflags: -s -w -X main.Version={{ .Commit }}-snapshot -X main.CommitSHA={{ .Commit }}
goos:
- linux
Expand All @@ -19,16 +19,16 @@ builds:

dockers:
- image_templates:
- "ghcr.io/charmbracelet/smoothie-internal:snapshot"
- "ghcr.io/charmbracelet/smoothie-internal:{{ .Commit }}-snapshot"
ids: [smoothie]
- "ghcr.io/charmbracelet/soft-serve-internal:snapshot"
- "ghcr.io/charmbracelet/soft-serve-internal:{{ .Commit }}-snapshot"
ids: [soft-serve]
goarch: amd64
build_flag_templates:
- --platform=linux/amd64
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://github.com/charmbracelet/smoothie-internal
- --label=org.opencontainers.image.source=https://github.com/charmbracelet/smoothie-internal
- --label=org.opencontainers.image.url=https://github.com/charmbracelet/soft-serve-internal
- --label=org.opencontainers.image.source=https://github.com/charmbracelet/soft-serve-internal
- --label=org.opencontainers.image.version={{ .Commit }}-snapshot
- --label=org.opencontainers.image.created={{ .Date }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
Expand Down
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ FROM alpine:latest

RUN apk update && apk add --update nfs-utils git && rm -rf /var/cache/apk/*

COPY smoothie /usr/local/bin/smoothie
COPY soft-serve /usr/local/bin/soft-serve

# Create directories
WORKDIR /smoothie
WORKDIR /soft-serve
# Expose data volume
VOLUME /smoothie
VOLUME /soft-serve

# Environment variables
ENV SMOOTHIE_KEY_PATH "/smoothie/ssh/smoothie_server_ed25519"
ENV SMOOTHIE_REPO_KEYS ""
ENV SMOOTHIE_REPO_KEYS_PATH "/smoothie/ssh/smoothie_git_authorized_keys"
ENV SMOOTHIE_REPO_PATH "/smoothie/repos"
ENV SOFT_SERVE_KEY_PATH "/soft-serve/ssh/soft_serve_server_ed25519"
ENV SOFT_SERVE_REPO_KEYS ""
ENV SOFT_SERVE_REPO_KEYS_PATH "/soft-serve/ssh/soft_serve_git_authorized_keys"
ENV SOFT_SERVE_REPO_PATH "/soft-serve/repos"

# Expose ports
# SSH
EXPOSE 23231/tcp

# Set the default command
ENTRYPOINT [ "/usr/local/bin/smoothie" ]
ENTRYPOINT [ "/usr/local/bin/soft-serve" ]
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# Smoothie
# Soft-Serve

Distribute your software on the command line with SSH and Git.

## What is it

Smoothie is a SSH server that hosts a Git server and interactive TUI built from
the repos you push to it. Authors can easily push their projects to Smoothie by
adding it as a remote and users can clone repos from Smoothie and stay up to
Soft-Serve is a SSH server that hosts a Git server and interactive TUI built from
the repos you push to it. Authors can easily push their projects to Soft-Serve by
adding it as a remote and users can clone repos from Soft-Serve and stay up to
date with the TUI as you push commits.

## Pushing a repo

1. Run `smoothie`
2. Add smoothie as a remote on any git repo: `git remote add smoothie ssh://git@localhost:23231/smoothie`
3. Push stuff: `git push smoothie main`
1. Run `soft-serve`
2. Add soft-serve as a remote on any git repo: `git remote add soft-serve ssh://git@localhost:23231/soft-serve`
3. Push stuff: `git push soft-serve main`

## Cloning a repo

1. You'll need to know the name (for now, it's not listed anywhere): `git clone ssh://git@localhost:23231/smoothie`
1. You'll need to know the name (for now, it's not listed anywhere): `git clone ssh://git@localhost:23231/soft-serve`

## Smoothie TUI
## Soft-Serve TUI

If you `ssh localhost -p 23231` you'll see a list of the latest commits to the repos you've pushed.

Expand All @@ -28,4 +28,4 @@ If you `ssh localhost -p 23231` you'll see a list of the latest commits to the r
By default anyone can push or pull from the Git repositories. This is mainly
for testing, you can also whitelist public keys that have Git write access by
creating an authorized keys file with the public key for each author. By
default this file is expected to be at `./.ssh/smoothie_git_authorized_keys`.
default this file is expected to be at `./.ssh/soft_serve_git_authorized_keys`.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module smoothie
module soft-serve

go 1.16

Expand Down
14 changes: 7 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"
"log"
"smoothie/tui"
"soft-serve/tui"
"time"

"github.com/charmbracelet/wish"
Expand All @@ -15,12 +15,12 @@ import (
)

type Config struct {
Port int `env:"SMOOTHIE_PORT" default:"23231"`
Host string `env:"SMOOTHIE_HOST" default:""`
KeyPath string `env:"SMOOTHIE_KEY_PATH" default:".ssh/smoothie_server_ed25519"`
RepoAuth string `env:"SMOOTHIE_REPO_KEYS" default:""`
RepoAuthFile string `env:"SMOOTHIE_REPO_KEYS_PATH" default:".ssh/smoothie_git_authorized_keys"`
RepoPath string `env:"SMOOTHIE_REPO_PATH" default:".repos"`
Port int `env:"SOFT_SERVE_PORT" default:"23231"`
Host string `env:"SOFT_SERVE_HOST" default:""`
KeyPath string `env:"SOFT_SERVE_KEY_PATH" default:".ssh/soft_serve_server_ed25519"`
RepoAuth string `env:"SOFT_SERVE_REPO_KEYS" default:""`
RepoAuthFile string `env:"SOFT_SERVE_REPO_KEYS_PATH" default:".ssh/soft_serve_git_authorized_keys"`
RepoPath string `env:"SOFT_SERVE_REPO_PATH" default:".repos"`
}

func main() {
Expand Down
14 changes: 7 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
backend "s3" {
bucket = "charm-terraform-backend"
key = "smoothie-development"
key = "soft-serve-development"
region = "us-east-1"
}
}
Expand All @@ -15,7 +15,7 @@ variable "aws_region" {
}

variable "app_image" {
default = "ghcr.io/charmbracelet/smoothie-internal:snapshot"
default = "ghcr.io/charmbracelet/soft-serve-internal:snapshot"
}

variable "force_new_deployment" {
Expand All @@ -26,14 +26,14 @@ variable "authorization_keys" {
default = ""
}

module "smoothie" {
/* source = "../terraform-aws-smoothie" */
source = "app.terraform.io/charm/smoothie/aws"
version = "0.2.1"
module "soft_serve" {
# source = "../terraform-aws-soft-serve"
source = "app.terraform.io/charm/soft-serve/aws"
version = "0.3.0"

environment = var.environment
aws_region = var.aws_region
ecs_task_execution_role_name = "smoothieEcsTaskExecutionRole-${var.environment}"
ecs_task_execution_role_name = "softServeEcsTaskExecutionRole-${var.environment}"
app_image = var.app_image
app_count = 2
app_ssh_port = 23231
Expand Down
8 changes: 4 additions & 4 deletions tui/bubble.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package tui

import (
"fmt"
"smoothie/git"
"smoothie/tui/bubbles/repo"
"smoothie/tui/bubbles/selection"
"smoothie/tui/style"
"soft-serve/git"
"soft-serve/tui/bubbles/repo"
"soft-serve/tui/bubbles/selection"
"soft-serve/tui/style"
"strings"

tea "github.com/charmbracelet/bubbletea"
Expand Down
2 changes: 1 addition & 1 deletion tui/bubbles/commits/bubble.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package commits

import (
"smoothie/git"
"soft-serve/git"
"strings"

"github.com/charmbracelet/bubbles/viewport"
Expand Down
4 changes: 2 additions & 2 deletions tui/bubbles/repo/bubble.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package repo
import (
"bytes"
"fmt"
"smoothie/git"
"smoothie/tui/style"
"soft-serve/git"
"soft-serve/tui/style"
"strconv"
"text/template"

Expand Down
2 changes: 1 addition & 1 deletion tui/bubbles/selection/bubble.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package selection

import (
"smoothie/tui/style"
"soft-serve/tui/style"

tea "github.com/charmbracelet/bubbletea"
)
Expand Down
4 changes: 2 additions & 2 deletions tui/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package tui

import (
"fmt"
"smoothie/tui/bubbles/repo"
"smoothie/tui/bubbles/selection"
"soft-serve/tui/bubbles/repo"
"soft-serve/tui/bubbles/selection"

tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
Expand Down
8 changes: 4 additions & 4 deletions tui/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ package tui
import (
"os"
"path/filepath"
"smoothie/git"
"soft-serve/git"

gg "github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing/object"
)

const defaultReadme = "# Smoothie\n\n Welcome! You can configure your Smoothie server by cloning this repo and pushing changes.\n\n## Repos\n\n{{ range .Menu }}* {{ .Name }}{{ if .Note }} - {{ .Note }} {{ end }}\n - `git clone ssh://{{$.Host}}:{{$.Port}}/{{.Repo}}`\n{{ end }}"
const defaultReadme = "# Soft-Serve\n\n Welcome! You can configure your Soft-Serve server by cloning this repo and pushing changes.\n\n## Repos\n\n{{ range .Menu }}* {{ .Name }}{{ if .Note }} - {{ .Note }} {{ end }}\n - `git clone ssh://{{$.Host}}:{{$.Port}}/{{.Repo}}`\n{{ end }}"

const defaultConfig = `{
"name": "Smoothie",
"name": "Soft-Serve",
"show_all_repos": true,
"host": "localhost",
"port": 23231,
Expand Down Expand Up @@ -73,7 +73,7 @@ func createDefaultConfigRepo(rs *git.RepoSource) error {
_, err = wt.Commit("Default init", &gg.CommitOptions{
All: true,
Author: &object.Signature{
Name: "Smoothie Server",
Name: "Soft-Serve Server",
Email: "[email protected]",
},
})
Expand Down
2 changes: 1 addition & 1 deletion tui/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"
"log"
"smoothie/git"
"soft-serve/git"
"time"

tea "github.com/charmbracelet/bubbletea"
Expand Down

0 comments on commit 2cc93be

Please sign in to comment.