Skip to content

Commit

Permalink
First run done
Browse files Browse the repository at this point in the history
  • Loading branch information
LeKovr committed Mar 10, 2023
1 parent 5236dd5 commit c59695d
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.env
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 dopos
Copyright (c) 2023 Alexey Kovrizhkin <lekovr+dopos@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
70 changes: 70 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# app custom Makefile

# Docker repo & image name without version
IMAGE ?= superseriousbusiness/gotosocial
# Hostname for external access
APP_SITE ?= fedi.dev.lan
# App names (db/user name etc)
APP_NAME ?= gts

# PgSQL used as DB
USE_DB = yes

# Sample admin user data
ADD_USER = yes

# ------------------------------------------------------------------------------
# app custom config

IMAGE_VER ?= latest

DCAPE_ROOT ?= /opt/dcape/var

DATA_PATH ?= $(APP_NAME)

DCAPE_GTS_UID ?= 1000
DCAPE_GTS_GID ?= 1000

CONTAINER_ID ?= $(APP_TAG)_app_1

# ------------------------------------------------------------------------------
# .env template (custom part)
# inserted in .env.sample via 'make config'
define CONFIG_CUSTOM
# ------------------------------------------------------------------------------
# app custom config, generated by make config
# db:$(USE_DB) user:$(ADD_USER)

# Path to /opt/dcape/var. Used only outside drone
DCAPE_ROOT=$(DCAPE_ROOT)

DATA_PATH=$(DATA_PATH)

endef

# ------------------------------------------------------------------------------
# Find and include DCAPE/apps/drone/dcape-app/Makefile
DCAPE_COMPOSE ?= dcape-compose
DCAPE_MAKEFILE ?= $(shell docker inspect -f "{{.Config.Labels.dcape_app_makefile}}" $(DCAPE_COMPOSE))
ifeq ($(shell test -e $(DCAPE_MAKEFILE) && echo -n yes),yes)
include $(DCAPE_MAKEFILE)
else
include /opt/dcape-app/Makefile
endif


## create user
user-add:
@docker exec -it $(CONTAINER_ID) /gotosocial/gotosocial admin account create \
--username $(USER_NAME) \
--email $(USER_EMAIL) \
--password '$(USER_PASS)'

## promote user to admin
user-admin:
@docker exec -it $(CONTAINER_ID) /gotosocial/gotosocial admin account promote --username $(USER_NAME)

## create file storage with perms
storage:
@path=$(DCAPE_ROOT)/$(DATA_PATH) ; \
[ -d $$path ] || sudo install -o $(DCAPE_GTS_UID) -g $(DCAPE_GTS_GID) -d $$path
40 changes: 38 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,38 @@
# dcape-app-gotosocial
GoToSocial application package for dcape
# dcape-app-GoToSocial

[![GitHub Release][1]][2] [![GitHub code size in bytes][3]]() [![GitHub license][4]][5]

[1]: https://img.shields.io/github/release/dopos/dcape-app-gotosocial.svg
[2]: https://github.com/dopos/dcape-app-gotosocial/releases
[3]: https://img.shields.io/github/languages/code-size/dopos/dcape-app-gotosocial.svg
[4]: https://img.shields.io/github/license/dopos/dcape-app-gotosocial.svg
[5]: LICENSE

[GoToSocial](https://gotosocial.org/) application package for [dcape](https://github.com/dopos/dcape).

## Docker image used

* [gotosocial/gotosocial](https://hub.docker.com/r/superseriousbusiness/gotosocial/)

## Requirements

* linux 64bit (git, make, wget, gawk, openssl)
* [docker](http://docker.io)
* [dcape](https://github.com/dopos/dcape)
* Git service ([github](https://github.com), [gitea](https://gitea.io) or [gogs](https://gogs.io))

## Usage

* Fork this repo in your Git service
* Setup deploy hook
* Run "Test delivery" (config sample will be created in dcape)
* Edit and save config (enable deploy etc)
* Run "Test delivery" again (app will be installed and started on webhook host)

See also: [Deploy setup](https://github.com/dopos/dcape/blob/master/DEPLOY.md) (in Russian)

## License

The MIT License (MIT), see [LICENSE](LICENSE).

Copyright (c) 2023 Alexey Kovrizhkin <[email protected]>
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# custom app config
# overrides DCAPE/apps/drone/dcape-app/docker-compose.yml

version: '2'

services:
app:
labels:
- traefik.http.services.${APP_TAG}.loadbalancer.server.port=8080
environment:
- GTS_HOST=${APP_SITE}
- GTS_DB_TYPE=postgres
- GTS_DB_ADDRESS=db
- GTS_DB_DATABASE=${PGDATABASE}
- GTS_DB_USER=${PGUSER}
- GTS_DB_PASSWORD=${PGPASSWORD}
- GTS_DB_TLS_MODE=false
- GTS_LETSENCRYPT_ENABLED=false
- GTS_PROTOCOL=http
## For reverse proxy setups:
# GTS_TRUSTED_PROXIES: "172.x.x.x"
volumes:
- ${DCAPE_ROOT}/${DATA_PATH}:/gotosocial/storage

0 comments on commit c59695d

Please sign in to comment.