Browse Source

Rename the binaries to yarn and yarnd

logo_rebranding
James Mills 3 months ago
parent
commit
98e88bb5a3
Signed by: prologic GPG Key ID: AC4C014F1440EBD6
  1. 8
      .dockerignore
  2. 4
      .gitignore
  3. 6
      Dockerfile
  4. 4
      Dockerfile.dev
  5. 12
      Makefile
  6. 22
      README.md
  7. 18
      README_ZH.md
  8. 42
      Taskfile.yml
  9. 0
      cmd/yarn/login.go
  10. 0
      cmd/yarn/main.go
  11. 0
      cmd/yarn/post.go
  12. 0
      cmd/yarn/root.go
  13. 0
      cmd/yarn/stats.go
  14. 0
      cmd/yarn/timeline.go
  15. 0
      cmd/yarn/ui.go
  16. 0
      cmd/yarn/utils.go
  17. 0
      cmd/yarnd/main.go

8
.dockerignore

@ -8,11 +8,11 @@ Dockerfile
/dist
/twt
/twtd
/yarn
/yarnd
/cmd/twt/twt
/cmd/twtd/twtd
/cmd/yarn/yarn
/cmd/yarnd/yarnd
/data/cache
/data/feeds/*

4
.gitignore

@ -14,8 +14,8 @@
/twtd
/.envrc
/cmd/twt/twt
/cmd/twtd/twtd
/cmd/yarn/yarn
/cmd/yarnd/yarnd
/data/msgs
/data/cache

6
Dockerfile

@ -42,7 +42,7 @@ COPY ./internal/webmention/*.go ./internal/webmention/
COPY ./types/*.go ./types/
COPY ./types/retwt/*.go ./types/retwt/
COPY ./types/lextwt/*.go ./types/lextwt/
COPY ./cmd/twtd/*.go ./cmd/twtd/
COPY ./cmd/yarnd/*.go ./cmd/yarnd/
# Version/Commit (there there is no .git in Docker build context)
# NOTE: This is fairly low down in the Dockerfile instructions so
@ -66,7 +66,7 @@ VOLUME /data
# force cgo resolver
ENV GODEBUG=netdns=cgo
COPY --from=build /src/twtd /twtd
COPY --from=build /src/yarnd /yarnd
ENTRYPOINT ["/twtd"]
ENTRYPOINT ["/yarnd"]
CMD [""]

4
Dockerfile.dev

@ -38,7 +38,7 @@ COPY ./internal/passwords/*.go ./internal/passwords/
COPY ./internal/webmention/*.go ./internal/webmention/
COPY ./types/*.go ./types/
COPY ./types/retwt/*.go ./types/retwt/
COPY ./cmd/twtd/*.go ./cmd/twtd/
COPY ./cmd/yarnd/*.go ./cmd/yarnd/
# Build server binary
RUN make server DEBUG=1
@ -48,4 +48,4 @@ VOLUME /src/data
# force cgo resolver
ENV GODEBUG=netdns=cgo
CMD ["./twtd", "-D", "-O", "-R"]
CMD ["./yarnd", "-D", "-O", "-R"]

12
Makefile

@ -14,22 +14,22 @@ deps:
dev : DEBUG=1
dev : build
@./twt -v
./twtd -D -O -R $(FLAGS)
@./yarn -v
./yarnd -D -O -R $(FLAGS)
cli:
@$(GOCMD) build -tags "netgo static_build" -installsuffix netgo \
-ldflags "-w \
-X $(shell go list).Version=$(VERSION) \
-X $(shell go list).Commit=$(COMMIT)" \
./cmd/twt/...
./cmd/yarn/...
server: generate
@$(GOCMD) build -tags "netgo static_build" -installsuffix netgo \
-ldflags "-w \
-X $(shell go list).Version=$(VERSION) \
-X $(shell go list).Commit=$(COMMIT)" \
./cmd/twtd/...
./cmd/yarnd/...
build: cli server
@ -42,8 +42,8 @@ generate:
fi
install: build
@$(GOCMD) install ./cmd/twt/...
@$(GOCMD) install ./cmd/twtd/...
@$(GOCMD) install ./cmd/yarn/...
@$(GOCMD) install ./cmd/yarnd/...
ifeq ($(PUBLISH), 1)
image:

22
README.md

@ -69,7 +69,7 @@ available on the [Releases](https://git.mills.io/yarnsocial/yarn/releases) page.
### Using Homebrew
We provide [Homebrew](https://brew.sh) formulae for macOS users for both the
command-line client (`twt`) as well as the server (`twtd`).
command-line client (`yarn`) as well as the server (`yarnd`).
```console
brew tap jointwt/twtxt
@ -79,13 +79,13 @@ brew install twtxt
Run the server:
```console
twtd
yarnd
```
Run the command-line client:
```console
twt
yarn
```
### Building from source
@ -137,7 +137,7 @@ gmake
1. Login to your [Twt.social](https://twt.social) pod:
```#!console
$ ./twt login
$ ./yarn login
INFO[0000] Using config file: /Users/prologic/.twt.yaml
Username:
```
@ -145,7 +145,7 @@ Username:
2. Viewing your timeline
```#!console
$ ./twt timeline
$ ./yarn timeline
INFO[0000] Using config file: /Users/prologic/.twt.yaml
> prologic (50 minutes ago)
Hey @rosaelefanten 👋 Nice to see you have a Twtxt feed! Saw your [Tweet](https://twitter.com/koehr_in/status/1326914925348982784?s=20) (_or at least I assume it was yours?_). Never heard of `aria2c` till now! 🤣 TIL
@ -157,9 +157,9 @@ Angry Techn Writers ‣ https://dilbert.com/strip/2020-11-14
3. Making a Twt (_post_):
```#!console
$ ./twt post
$ ./yarn post
INFO[0000] Using config file: /Users/prologic/.twt.yaml
Testing `twt` the command-line client
Testing `yarn` the command-line client
INFO[0015] posting twt...
INFO[0016] post successful
```
@ -176,10 +176,10 @@ Then visit: http://localhost:8000/
### Web App
Run twtd:
Run yarnd:
```console
twtd -R
yarnd -R
```
__NOTE:__ Registrations are disabled by default so hence the `-R` flag above.
@ -189,8 +189,8 @@ Then visit: http://localhost:8000/
You can configure other options by specifying them on the command-line:
```console
$ ./twtd --help
Usage of ./twtd:
$ ./yarnd --help
Usage of ./yarnd:
-E, --admin-email string default admin user email (default "support@twt.social")
-N, --admin-name string default admin user name (default "Administrator")
-A, --admin-user string default admin user to use (default "admin")

18
README_ZH.md

@ -63,7 +63,7 @@ Goryon for Twt可在App Store和Play商店中使用。
### 使用 Homebrew
我们为 MacOS 用户提供了 [Homebrew](https://brew.sh) 包, 包含命令行客户(`twt`)和服务端(`twtd`)程序
我们为 MacOS 用户提供了 [Homebrew](https://brew.sh) 包, 包含命令行客户(`yarn`)和服务端(`yarnd`)程序
```console
brew tap jointwt/twtxt
@ -73,7 +73,7 @@ brew install twtxt
运行服务端:
```console
twtd
yarnd
```
运行客户端:
@ -137,7 +137,7 @@ Username:
2. 查看您的时间线
```#!console
$ ./twt timeline
$ ./yarn timeline
INFO[0000] Using config file: /Users/prologic/.twt.yaml
> prologic (50 minutes ago)
Hey @rosaelefanten 👋 Nice to see you have a Twtxt feed! Saw your [Tweet](https://twitter.com/koehr_in/status/1326914925348982784?s=20) (_or at least I assume it was yours?_). Never heard of `aria2c` till now! 🤣 TIL
@ -149,9 +149,9 @@ Angry Techn Writers ‣ https://dilbert.com/strip/2020-11-14
3. 发表推文 (_post_):
```#!console
$ ./twt post
$ ./yarn post
INFO[0000] Using config file: /Users/prologic/.twt.yaml
Testing `twt` the command-line client
Testing `yarn` the command-line client
INFO[0015] posting twt...
INFO[0016] post successful
```
@ -168,10 +168,10 @@ docker-compose up -d
### Web App
运行 twtd:
运行 yarnd:
```console
twtd -R
yarnd -R
```
__NOTE:__ 默认是禁止用户注册的, 使用 `-R` 标记打开注册选项
@ -181,8 +181,8 @@ __NOTE:__ 默认是禁止用户注册的, 使用 `-R` 标记打开注册选项
下面是一些命令行客户端的配置项:
```console
$ ./twtd --help
Usage of ./twtd:
$ ./yarnd --help
Usage of ./yarnd:
-E, --admin-email string default admin user email (default "support@twt.social")
-N, --admin-name string default admin user name (default "Administrator")
-A, --admin-user string default admin user to use (default "admin")

42
Taskfile.yml

@ -5,8 +5,8 @@ version: '3'
output: 'prefixed'
vars:
TwtdSvc: twtd
TwtdExe: twtd{{exeExt}}
YarnSvc: yard
YarnExe: yard{{exeExt}}
tasks:
default:
@ -14,21 +14,21 @@ tasks:
- task -l
silent: true
twtd:
desc: run twtd service
yard:
desc: run yard service
cmds:
- task: run-twtd
- task: run-yard
build-twtd:
desc: build twtd service
deps: [twtd-css, twtd-js, tr-merge]
build-yard:
desc: build yard service
deps: [yard-css, yard-js, tr-merge]
cmds:
- echo "{{.TwtdExe}} building..."
- go build -v -o {{.TwtdExe}} -ldflags "-w -X {{.Module}}.Version={{.Version}} -X {{.Module}}.Commit={{.Commit}}" cmd/{{.TwtdSvc}}/main.go
- echo "{{.TwtdExe}} built."
- echo "{{.YarnExe}} building..."
- go build -v -o {{.YarnExe}} -ldflags "-w -X {{.Module}}.Version={{.Version}} -X {{.Module}}.Commit={{.Commit}}" cmd/{{.YarnSvc}}/main.go
- echo "{{.YarnExe}} built."
generates:
- '{{.TwtdExe}}'
- '{{.YarnExe}}'
sources:
- '**/*.go'
method: none
@ -41,14 +41,14 @@ tasks:
sh: go list
silent: false
run-twtd:
run-yard:
cmds:
- ./twtd --cookie-secret abc --magiclink-secret abc --api-signing-key abc -R --debug --base-url http://localhost:8000 --bind 127.0.0.1:8000 --twts-per-page 5 --name twtxt.cc
deps: [build-twtd]
desc: run twtd service
- ./yard --cookie-secret abc --magiclink-secret abc --api-signing-key abc -R --debug --base-url http://localhost:8000 --bind 127.0.0.1:8000 --twts-per-page 5 --name twtxt.cc
deps: [build-yard]
desc: run yard service
silent: false
twtd-css:
yard-css:
cmds:
- minify -b -o ./internal/static/css/twtxt.min.css ./internal/static/css/[0-9]*-*.css
sources:
@ -56,7 +56,7 @@ tasks:
generates:
- internal/static/css/twtxt.min.css
twtd-js:
yard-js:
cmds:
- minify -b -o ./internal/static/js/twtxt.min.js ./internal/static/js/[0-9]*-*.js
sources:
@ -78,15 +78,15 @@ tasks:
release:
desc: release
deps: [build-twtd]
deps: [build-yard]
cmds:
# - mkdir -pv ./release/internal/{static,langs}
- mkdir -pv ./release/internal/static/{css,js}
- cp -Rpfv ./{{.TwtdExe}} ./release/
- cp -Rpfv ./{{.YarnExe}} ./release/
- cp -Rpfv ./internal/static/css/twtxt.min.css ./release/internal/static/css/
- cp -Rpfv ./internal/static/js/twtxt.min.js ./release/internal/static/js/
# - cp -Rpfv ./internal/langs/active.*.toml ./release/internal/langs/
- ./release/{{.TwtdExe}} --cookie-secret abc --magiclink-secret abc --api-signing-key abc -R --base-url http://localhost:8000 --bind 127.0.0.1:8000 --name twtxt.cc
- ./release/{{.YarnExe}} --cookie-secret abc --magiclink-secret abc --api-signing-key abc -R --base-url http://localhost:8000 --bind 127.0.0.1:8000 --name twtxt.cc
clean:
desc: clean

0
cmd/twt/login.go → cmd/yarn/login.go

0
cmd/twt/main.go → cmd/yarn/main.go

0
cmd/twt/post.go → cmd/yarn/post.go

0
cmd/twt/root.go → cmd/yarn/root.go

0
cmd/twt/stats.go → cmd/yarn/stats.go

0
cmd/twt/timeline.go → cmd/yarn/timeline.go

0
cmd/twt/ui.go → cmd/yarn/ui.go

0
cmd/twt/utils.go → cmd/yarn/utils.go

0
cmd/twtd/main.go → cmd/yarnd/main.go

Loading…
Cancel
Save