wrappd.sh, wrapped tool for all the guys living in a b&w world
Go to file
2024-12-05 14:14:20 +01:00
assets Initial commit 2024-12-05 14:01:14 +01:00
cmd/web Initial commit 2024-12-05 14:01:14 +01:00
internal/web Add: mastodon instance env var 2024-12-05 14:14:01 +01:00
results Initial commit 2024-12-05 14:01:14 +01:00
uploads Initial commit 2024-12-05 14:01:14 +01:00
.air.toml Initial commit 2024-12-05 14:01:14 +01:00
.gitignore Initial commit 2024-12-05 14:01:14 +01:00
docker-compose.yml Initial commit 2024-12-05 14:01:14 +01:00
Dockerfile Initial commit 2024-12-05 14:01:14 +01:00
env-sample Add: mastodon instance env var 2024-12-05 14:14:01 +01:00
go.mod Initial commit 2024-12-05 14:01:14 +01:00
go.sum Initial commit 2024-12-05 14:01:14 +01:00
Makefile Initial commit 2024-12-05 14:01:14 +01:00
README.md Imp: README 2024-12-05 14:14:20 +01:00

wrappd.sh

Wrapped tool for the guys living in a b&w world.

Config

Copy the env.sample in .env and set up the variables:

$ cp env.sample .env
# Docker
DOCKER_ENV=production
BASE_URL=https://wrap.sh
SERVER_PORT=8080
UPLOAD_DIR=uploads
TOP_N_COMMANDS=10
MASTODON_INSTANCE_FOR_SHARING=mastodon.social

Docker

This project can be easily run on Docker:

$ make build
$ make rebuild
$ make start
$ make stop

The Makefile has been configured to facilitate the build and execution of Docker with the --build-arg argument, which passes the DOCKER_ENV environment variable to determine the environment. This variable is read from the .env file:

--build-arg DOCKER_ENV=${DOCKER_ENV}: This variable is used to determine the execution environment (local or production), affecting both the binary build process and the container's behavior.

If DOCKER_ENV is set to production it should execute the binary, whereas if set to local it will install and run with air to enable reloads during development, among other things.

Comands

$ go run cmd/web/main.go

Dependencies

Ensure your dependencies are installed:

$ go mod tidy

Skel project

.
├── cmd/
│   ├── web/            # Command for the web to init
├── internal/
│   ├── web/            # Web logic (routes, controller...)
├── result/             # Place for storing the results
├── upload/             # Temporal place for storing the uploads (inmediately removed)
├── .env.sample         # Sample environment file
└── README.md           # This file
└── Dockerfile          # Requirement for the docker container to be built
└── docker-compose.yml  # Docker orchestration file
└── Makefile            # Helper for the project to be run/build/stop...

Contribs

TBD