-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (52 loc) · 1.87 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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