Skip to content

Commit b3eaffb

Browse files
horahoradevGabenGarravihidayat
authored
Dev -> Master (#97)
* fix(webapp): dockerfile and dependencies * fix: remove prepare * chore(webapp): move header component * chore(header): rename component file * fix(webapp): header imports * chore(webapp): format header component * style(webapp): fix header search * chore: wrangle vscode workspaces * chore: webapp settings * chore: move home and archival pages * chore: move audit page * chore: move login page * chore: logout page * chore: register page * chore: video page * chore: user page * chore: password reset page * fix: import errors * fix flaky CI tests * Fix non-inline rating display * chore: hide yarn files * fix: broken layout * Remove redis, remove port exposures, harden access to minio * Fix tests * remove redis log print * publish among us impostor images on every branch commit * feat: basic env vars schema * feat: compose env vars * Remove mp4box stage * refactor(webapp): dependencies (#50) * chore: remove yarn * chore: add npm lockfile * chore: change dockerfile * chore: remove craco * chore: thin out deps * chore: tailwind update * fix: docker setup * chore: eslint vscode extension * chore: fiddling with tailwind theme * chore: remove react css theme switcher * chore: tailwind styling * chore: video list dark theme * chore: footer dark theme * chore: login form dark theme * chore: register page dark theme * chore: global search dark theme * fix: webapp ports * fix: videoservice build crash * fix: tailwind baseline dark theme * fix: usernav dark theme * chore: archival page dark theme * chore: video page dark theme * chore: password reset dark mode * feat: theme lib * feat: theme swticher component Co-authored-by: OtoMAN <65930041+horahoradev@users.noreply.github.com> * next webpack ws route, nginx debug logs * refactor(webapp): nextjs migration (#53) * chore: basic nextjs migration as per https://nextjs.org/docs/migrating/from-create-react-app * chore: env vars, readme and configs * feat: eslint support * chore: eslint fixes * chore: remove react-router-dom * fix: build errors * chore: postcss config tweak * chore: icon fixes * fix: docker issues * fix: home page fetch * feat: basic typescript configuration * chore: typescript migration start * chore: header component * chore: footer * chore: pagination component * chore: theme switcher * chore: video list component * chore: dom lib * chore: theme lib * chore: api * chore: user page * chore: video page * chore: archival page * chore: audits page * chore: home page * chore: login page * chore: logout page * chore: password reset page * chore: regsiter page * chore: cookei store module * chore: remove command * fix: style errors * chore: config * Add front_api image publish * feat: docker compose env separation (#54) * chore: gitignore * chore: env examples * chore: basic compose config * chore: prod compose * chore: more config fiddling * fix: frontend api image * feat: dev compose setup * docs: migration guide * feat(webapp): upload page (#55) * feat: page component * feat: basic upload form schema * feat: upload form markup * feat: upload logic * feat: form component * feat: input components markup * feat: link component markup * feat: icon component * feat: label component * style: inputs * style: form * refactor: text input * style: label * feat: button component * fix: form issues * Fixed CI build with a hack * Update main.go * Update .env.example * feat(cli): cli tool (#60) * chore: hello world * chore: cobra carcass * chore: command descriptions * chore: env init progress * chore: util lib carcass * feat: fs utils * feat: json lib * refactor: pacakge imports * feat: basic viper setup * chore: file restructure * feat: env init * chore: thin out env vars schema * fix: deps * chore: rename cli tool * fix: paths * docs: install and usage instructions * feat(webapp): link components (#57) * chore: sass * chore: sass base styles * chore: eof newlines * feat: base link component * chore: base link tweak * feat: external link component don't need its styling yet because the base link is assumed external * feat: internal link component * style: internal link colours * feat: local link component * chore(webapp): baseline sass support (#56) * chore: sass * chore: sass base styles * chore: eof newlines Co-authored-by: OtoMAN <65930041+horahoradev@users.noreply.github.com> * refactor(webapp): links (#58) * chore: sass * chore: sass base styles * chore: eof newlines * feat: base link component * chore: base link tweak * feat: external link component don't need its styling yet because the base link is assumed external * feat: internal link component * style: internal link colours * feat: local link component * refactor: register page * refactor: login page * chore: misc lib changes * refactor: header component * refactor: theme switcher * refactor: videolist component * fix: build errors * style: header and footer tweaks * refactor: video page Co-authored-by: OtoMAN <65930041+horahoradev@users.noreply.github.com> * fix: build crash (#62) * refactor: development compose config (#65) * chore: vscode stuff * feat: front_api dev dockerfile compose file was renamed as per spec: https://docs.docker.com/compose/compose-file/#compose-file * feat: scheduler dev image * feat: stomp proxy dev image * feat: user service dev image * feat: video service dev image * chore: restart directives * feat: database dev image * feat: activemq dev iamge * feat: webapp and minio dev images * chore: build errors * fix: build errors * feat(cli): codegen (#64) * feat: metaschema codegen * chore: format result * chore: move codegen into CLI * chore: store generated schema as bytes * feat: cli codegen * feat(webapp): input components (#63) * chore: sass * chore: sass base styles * chore: eof newlines * feat: base link component * chore: base link tweak * feat: external link component don't need its styling yet because the base link is assumed external * feat: internal link component * style: internal link colours * feat: local link component * refactor: register page * refactor: login page * chore: misc lib changes * refactor: header component * refactor: theme switcher * refactor: videolist component * fix: build errors * style: header and footer tweaks * refactor: video page * refactor: form and input components * feat: urls lib * fix: urls lib types * feat: search select components * feat: fieldset component * feat: radio component * style: select input * style: radio input * feat: email input plus radio group styling * feat: password component * chore: form client props * chore: clean test form * fix: stomp proxy image (#66) * fix: stomp proxy image * chore: delete broken symlink * fix: create proper symlink * feat(schema): public API schemas (#67) * chore: current user profile * chore: archival request * chore: archival event * chore: video detail * chore: profile data * chore: audit event * chore: comment data * feat: webapp codegen (#69) * feat: folder reducer * chore: workspace example file * feat: codegen lib * feat: multiline strings lib * feat: prettier codegen * chore: metaschema codegen * feat: metas chema codegen * feat: metaschema codegen * feat: json collection function * feat: inlined schemas and their interfaces * chore: format index * fix: schema def * chore: validator lib * feat: schema map gen * feat: interface gen * feat: validator functon gen * refactor(webapp): inputs (#68) * chore: audit fix * refactor: register page * chore: move pages * refactor: login page * refactor: logout page * refactor: password reset * refactor: archive requests page a minor one beause the page is busy and in need of decomposition * chore: user page * chore: video page * refactor: video page * chore: archives page * chore: remove formik from dependencies * fix: stomp proxy image * chore: more types * chore: split videolist further * chore: delete broken symlink * fix: create proper symlink * chore: login form * fix: login * fix: auth pages * fix: new comment form * fix: new comment form * chore: admin controls todo Co-authored-by: OtoMAN <65930041+horahoradev@users.noreply.github.com> * docs: codegen (#70) * chore: codegen docs * feat: codegen docs * feat(cli): json schema map gen (#71) * chore: move mulitiline func * chore: gen prep * chore: shema collection * feat: schema collection * feat: schema variables * feat: schema map * feat(webapp): list components (#72) * feat: base list components * feat: details list component * feat: card list component * feat: heading component * feat: article component * style: card list * style: article * User uploads mostly working * refactor(webapp): archive requests page (#73) * refactor: stomp client class move it into a separate module * refactor: separate archive requests page * refactor: archival event page * refactor: downloads in progress page * fix: build errors * style: misc fixes * refactor: global header component * refactor: archives root page * feat(webapp): account hook (#74) * chore: hook skeleton * feat: local store module * feat: useAccount hook * refactor: account schema * fix: codegen skipping formattable files * feat: account lib * feat: useAccount hook * chore: hook comments * refactor(webapp): page layout (#75) * chore: move files * chore :restore meta * chore: global header * refactor: account fetches * chore: account nav * refactor: account nav * refactor: theme switcher * chore: move theme switcher * refactor: antd buttons * feat: page component * style: global header * style: base font-size * style: account nav * refactor: pages layout * fix: build errors * chore: video page * chore: update new pages * feat: register page context * feat: login account context * feat: logout context * chore : build errors * fix: build errors * refactor(webapp): video post card and its list (#77) * feat: video card * chore: card stuff * fix: header account nav * fix: accoutn fetch url * fix: card style * chore: post list * fix: account hook state * feat: image components * feat: link image component * feat: card preview link * style: link image * feat: post video card * Update required fields for json schmema public api * fix(webapp): account-related fixes (#76) * fix: header account nav * fix: accoutn fetch url * fix: hook init * fix(webapp): codegen (#78) * chore: ajv formats package * fix: prettier formatting * feat: format support * feat: deferred validator compilation * chore: typescript directive * Impose memory limits, optimize scheduler memory * minor memory tweaks, build time improvements WIP * Fix syntax for actions * yaml pro * Split docker secret extraction to separate stage * correct dockerfile location * Env file integration * trying something different * indentation * Extension * Update version * remove matrix * test * bruh * woooow * buster * latest * name labels * Correct labels * Switch release tags * go mod tidy, small optimizations * Violated the DRY principle * refactor(webapp): api module rewrite (#79) * feat: api fetch lib * chore: deps cleanup * chore: env cleanup * chore: update lockfile * fix: build errors * refactor: websocker URL * fix my garbage * Correct docker builds * feat: headless mode (#80) * chore: move nginx config * feat: cors config * feat: api fetch lib * chore: deps cleanup * chore: env cleanup * chore: update lockfile * fix: build errors * refactor: websocker URL * chore: comments * chore: configs * fix: volume mount * fix: config * feat: nginx config template * chore: mroe config fiddle * chore: fetch with creds * chore: nginx config * refactor(webapp): audit logs page (#81) * chore: move nginx config * feat: cors config * feat: api fetch lib * chore: deps cleanup * chore: env cleanup * chore: update lockfile * fix: build errors * refactor: websocker URL * chore: comments * chore: configs * fix: volume mount * fix: config * feat: nginx config template * chore: mroe config fiddle * chore: fetch with creds * chore: nginx config * refactor: audot logs page * refactor(webapp): profile page (#82) * chore: move nginx config * feat: cors config * feat: api fetch lib * chore: deps cleanup * chore: env cleanup * chore: update lockfile * fix: build errors * refactor: websocker URL * chore: comments * chore: configs * fix: volume mount * fix: config * feat: nginx config template * chore: mroe config fiddle * chore: fetch with creds * chore: nginx config * chore: proper styles ordering * refactor: archive request status tags * chore: profile page * chore: list component * chore: lsit component * refactor: profile page * refactor(webapp): video post page (#84) * chore: move nginx config * feat: cors config * feat: api fetch lib * chore: deps cleanup * chore: env cleanup * chore: update lockfile * fix: build errors * refactor: websocker URL * chore: comments * chore: configs * fix: volume mount * fix: config * feat: nginx config template * chore: mroe config fiddle * chore: fetch with creds * chore: nginx config * chore: proper styles ordering * refactor: archive request status tags * chore: profile page * chore: list component * chore: lsit component * refactor: profile page * chore: move post entity * chore: moving around * chore: video detail interface * chore: post rating * feat: psot rating * chore: dynamic title * chore: page title * chore: tags list * chore: post article * refactor: video page * refactor: post comments * style: card max width * fix: build errors * feat(webapp): pagination component (#85) * feat: pagination interfaces * feat: pagination info * chore: tweak * chore: internal pagination * chore: number input * chore: input component ref * feat: number input * feat: internal pagination * chore: move old pagination * feat: local pagination component * feat: local pagination * fix: index page * refactor: audit events list (#86) * refactor(webapp): archival events list (#87) * refactor: archival events page * fix: formatting * refactor: archival request list (#88) * refactor: downloads list (#89) * refactor(webapp): global search (#90) * style: search input * refactor: global search * feat: search page * refactor(webapp): new pagination (#91) * style: article * refactor: search page pagination * style: adaptive article * refacto: audit pagination * refactor: profile page pagination * chore: remove antd pagination * chore: remove antd styles * style: mobile global header * chore(webapp): remove tailwind and antd (#92) * chore: remove antd * chore: merge tailwind reset file * chore: remove tailwind * chore: 403 handling * fix: build errors * fix: postgres image env var * Video origin validation + other stuff (#94) * container host resolution * Minor improvements to video page style * Check for origin video existence before upload succeeds * fixed logout, removed erroneous logs, fixed archival card display, fixed archival delete/retry responsiveness * envoy protobuf validation * Implement Validators (#95) * Proto bump * Implement delete * Attempt to fix validator.proto import issues Co-authored-by: horahoradev <horahora1567@gmail.com> * Generation working * Commit validation code * very basic implementation of proto validation * improved quality selection * scheduler proto bump * per-url event logs * reorganized archival index * Card display looks mostly ok * card improvements * tabular dls in progress * Tabbed view for archives * proto bump * added general log tail, did bad things * More resilient startup, follow API redirects * Proto bump, etc * Author links on home page * Update README.md * Delete rate limiting Co-authored-by: gabengar <gabengar@protonmail.com> Co-authored-by: GabenGar <87906913+GabenGar@users.noreply.github.com> Co-authored-by: ravihidayat <naufalravi@graduate.utm.my>
1 parent df26b72 commit b3eaffb

File tree

372 files changed

+28969
-15005
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

372 files changed

+28969
-15005
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
videos/*

.github/workflows/test.yml

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,6 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
13-
- name: Log in to the Container registry
14-
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
15-
with:
16-
registry: ${{ env.REGISTRY }}
17-
username: ${{ github.actor }}
18-
password: ${{ secrets.GITHUB_TOKEN }}
19-
- name: Extract metadata (tags, labels) for Docker
20-
id: meta
21-
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
22-
with:
23-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
2413
- name: Build the stack
2514
run: ./up.sh
2615
- name: Run integration tests
@@ -35,36 +24,41 @@ jobs:
3524
- name: print relevant logs (scheduler)
3625
run: docker logs $(docker ps | grep "scheduler" | awk '{print $1}')
3726
if: always()
38-
- name: print relevant logs (redis)
39-
run: docker logs $(docker ps | grep "redis" | awk '{print $1}')
40-
if: always()
4127
- name: print relevant logs (postgres)
4228
run: docker logs $(docker ps | grep "postgres" | awk '{print $1}')
4329
if: always()
4430
- name: print relevant logs (frontapi)
4531
run: docker logs $(docker ps | grep "frontapi" | awk '{print $1}')
4632
if: always()
47-
- name: Build and push Docker image for userservice
48-
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
33+
release:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v2
37+
- name: Log in to the Container registry
38+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
4939
with:
50-
context: user_service
51-
push: true
52-
tags: ${{ steps.meta.outputs.tags }}_userservice
53-
labels: ${{ steps.meta.outputs.labels }}_userservice
54-
if: github.ref == 'refs/heads/master'
55-
- name: Build and push Docker image for videoservice
56-
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
40+
registry: ${{ env.REGISTRY }}
41+
username: ${{ github.actor }}
42+
password: ${{ secrets.GITHUB_TOKEN }}
43+
- name: Extract metadata (tags, labels) for Docker
44+
id: meta
45+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
5746
with:
58-
context: video_service
59-
push: true
60-
tags: ${{ steps.meta.outputs.tags }}_videoservice
61-
labels: ${{ steps.meta.outputs.labels }}_videoservice
62-
if: github.ref == 'refs/heads/master'
63-
- name: Build and push Docker image for scheduler
64-
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
47+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
48+
- name: copy
49+
run: cp ./configs/.env.dev.example .env
50+
- name: copy
51+
run: cp ./configs/.env.dev.example .env.dev
52+
- name: publish
53+
uses: pennsignals/publish_docker-compose@v0.2.5
54+
with:
55+
version: dev
56+
docker_compose: 'compose.dev.yaml' # required
57+
- name: copy env
58+
run: cp ./configs/.env.example .env
59+
if: always()
60+
- name: publish
61+
uses: pennsignals/publish_docker-compose@v0.2.5
6562
with:
66-
context: scheduler
67-
push: true
68-
tags: ${{ steps.meta.outputs.tags }}_scheduler
69-
labels: ${{ steps.meta.outputs.labels }}_scheduler
70-
if: github.ref == 'refs/heads/master'
63+
version: main
64+
docker_compose: 'docker-compose.yml' # required

.gitignore

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1+
# CLI build output
2+
/horahora
3+
# CLI windows build output
4+
/horahora.exe
5+
6+
# vscode files
7+
*.code-workspace
8+
9+
# temporary folders created by golang watcher
10+
**/tmp/*
11+
112
youtube-dl*
213
packer/vpn_conf*
314
data*
415
secrets.env
5-
docker-compose.yml
616
sql/backup*
7-
/videos
17+
/videos
18+
19+
# env file is used for the docker compose
20+
/.env
21+
/.env*

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
// https://go.dev/doc/editors#options
4+
"golang.go",
5+
]
6+
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"folders": [
3+
{
4+
"name": "horahora",
5+
"path": "."
6+
},
7+
{
8+
"name": "front_api",
9+
"path": "front_api"
10+
},
11+
{
12+
"name": "backup_service",
13+
"path": "backup_service"
14+
},
15+
{
16+
"name": "scheduler",
17+
"path": "scheduler"
18+
},
19+
{
20+
"name": "stomp_proxy",
21+
"path": "stomp_proxy"
22+
},
23+
{
24+
"name": "tests",
25+
"path": "tests"
26+
},
27+
{
28+
"name": "user_service",
29+
"path": "user_service"
30+
},
31+
{
32+
"name": "video_service",
33+
"path": "video_service"
34+
},
35+
{
36+
"name": "webapp",
37+
"path": "webapp"
38+
},
39+
{
40+
"name": "cli",
41+
"path": "cli"
42+
},
43+
{
44+
"name": "schema",
45+
"path": "schema"
46+
}
47+
],
48+
"settings": {
49+
"files.exclude": {
50+
"**/.git": true,
51+
"**/.svn": true,
52+
"**/.hg": true,
53+
"**/CVS": true,
54+
"**/.DS_Store": true,
55+
"**/Thumbs.db": true,
56+
"**/node_modules": true,
57+
"front_api": true,
58+
"backup_service": true,
59+
"scheduler": true,
60+
"stomp_proxy": true,
61+
"tests": true,
62+
"user_service": true,
63+
"video_service": true,
64+
"webapp": true,
65+
"schema": true,
66+
"cli": true
67+
},
68+
"files.associations": {
69+
// syntax highlight for example env files
70+
"**/.env*": "dotenv",
71+
// syntax highlight for example workspace files
72+
"**/*.code-workspace*": "jsonc"
73+
},
74+
// remove text 3 options if you've set them up in global editor settings
75+
"files.trimTrailingWhitespace": true,
76+
"files.insertFinalNewline": true,
77+
"files.trimFinalNewlines": true
78+
},
79+
"extensions": {
80+
"recommendations": [
81+
// `.env` syntax highlight
82+
"mikestead.dotenv",
83+
// docker-related features plus highlight in dockerfiles and compose configs
84+
"ms-azuretools.vscode-docker",
85+
// lots of QoL git features
86+
"eamodio.gitlens",
87+
// nginx config highlight
88+
"ahmadalli.vscode-nginx-conf",
89+
// `.sql` formatter
90+
"bradymholt.pgformatter",
91+
// `.proto3` syntax highlight
92+
"zxh404.vscode-proto3"
93+
]
94+
}
95+
}

.vscode/settings.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"gopls": {
3+
"ui.semanticTokens": true
4+
},
5+
"[json]": {
6+
"editor.tabSize": 2
7+
},
8+
"[jsonc]": {
9+
"editor.tabSize": 2
10+
},
11+
"json.schemas": [
12+
{
13+
"fileMatch": ["schema/**/*schema.json"],
14+
"url": "./schema/meta.schema.json"
15+
}
16+
],
17+
"files.trimTrailingWhitespace": true,
18+
"files.insertFinalNewline": true,
19+
"files.trimFinalNewlines": true
20+
}

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Thank you for your interest in contributing to Horahora! Think you can do better
55
![](https://raw.githubusercontent.com/horahoradev/horahora/master/Architectural_Drawing.png)
66

77
Horahora's architecture is microservice-based. The main microservices are:
8-
- front_api: which is the RESTful API to the rest of the services
9-
- userservice: which does all authentication and handles user storage/permissions
10-
- videoservice: which does all video storage, uploads to the origin (e.g. s3/backblaze), queries, transcoding, etc
11-
- scheduler: which handles content archival requests and downloads
8+
- `front_api`: which is the RESTful API to the rest of the services
9+
- `userservice`: which does all authentication and handles user storage/permissions
10+
- `videoservice`: which does all video storage, uploads to the origin (e.g. s3/backblaze), queries, transcoding, etc
11+
- `scheduler`: which handles content archival requests and downloads
1212
Communication between userservice, videosercvice, and scheduler is GRPC-based. For more details on individual microservice architecture, see the README for whichever microservice.
1313

1414
Postgresql is used as the database for each service, but Redis is also used for very specific purposes (e.g. distributed locking). Schema migrations can be found within the "migrations" directory within each service. As an example, [here's the migrations directory for Videoservice](https://github.com/horahoradev/horahora/tree/master/video_service/migrations). Migrations are applied using Flyway as a means of providing schema versioning.

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
FROM golang
1+
FROM golang:1.17
22

33
RUN apt-get update && \
44
apt install -y protobuf-compiler && \
55
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26 && \
66
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1
77

8+
RUN go env -w GO111MODULE="off" && \
9+
go get github.com/envoyproxy/protoc-gen-validate && \
10+
go env -w GO111MODULE=""
11+
12+
RUN go install github.com/envoyproxy/protoc-gen-validate@v0.6.7
13+
814
COPY gen_all.sh /bin/gen_all.sh
915

1016
WORKDIR /
1117

12-
ENTRYPOINT ["/bin/gen_all.sh"]
18+
ENTRYPOINT ["/bin/gen_all.sh"]

Dockerfile.postgres.dev

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
postgres/Dockerfile.dev

README.md

Lines changed: 69 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,87 @@ It allows you to:
1111

1212
Join our Discord: https://discord.gg/vfwfpctJRZ
1313

14-
![](https://raw.githubusercontent.com/horahoradev/horahora-designs/master/video_page_dark.png)
14+
![](https://github.com/horahoradev/horahora-designs/blob/master/Screenshot%20from%202022-10-09%2011-56-34.png?raw=true)
1515

16-
![](https://raw.githubusercontent.com/horahoradev/horahora-designs/master/homepage_dark.png)
16+
![](https://github.com/horahoradev/horahora-designs/blob/master/Screenshot%20from%202022-10-09%2011-54-48.png?raw=true)
1717

18-
![](https://raw.githubusercontent.com/horahoradev/horahora-designs/master/archival_page_dark.png)
18+
![](https://github.com/horahoradev/horahora-designs/blob/master/Screenshot%20from%202022-10-09%2011-57-35.png?raw=true)
19+
20+
![](https://github.com/horahoradev/horahora-designs/blob/master/Screenshot%20from%202022-10-09%2011-57-52.png?raw=true)
1921

2022
Archival capabilities are provided by yt-dlp (a fork of youtube-dl).
2123

2224
## Local Use Instructions (START HERE)
2325

2426
1. Install docker and docker-compose
25-
2. Run: sudo ./up.sh
26-
3. Wait a minute, then visit localhost:80
27-
4. Login as admin/admin
27+
2. Generate private key:
28+
```sh
29+
openssl genrsa 2048
30+
```
31+
3. Create env vars file:
32+
```sh
33+
cp configs/.env.example .env
34+
```
35+
4. Save the private key into `JWT_KEYPAIR` value:
36+
```sh
37+
JWT_KEYPAIR="-----BEGIN RSA PRIVATE KEY-----
38+
...
39+
-----END RSA PRIVATE KEY-----"
40+
```
41+
The value should be double-quoted.
42+
5. Start up the stack:
43+
```sh
44+
sudo ./up.sh
45+
```
46+
6. Wait a minute, then visit localhost:80
47+
7. Login as admin/admin
2848
- note that with the current video approval workflow, non-admin users won't be able to view unapproved videos
2949
- it's recommended to visit /password-reset immediately to change the admin user's default password if using in an untrusted environment
30-
5. navigate to the archival requests page from the hamburger menu, add a link, and wait a few minutes
31-
50+
8. navigate to the archival requests page from the hamburger menu, add a link, and wait a few minutes
51+
3252
That's it for basic usage, and should work. If that doesn't work, bug me on Discord.
3353
54+
## Develop
55+
**DO NOT RUN THIS SETUP IN ANY PUBLIC CONTEXT.**
56+
57+
### Requirements
58+
59+
Golang - 1.18+
60+
61+
### Docker stack
62+
1. Copy example env file:
63+
```sh
64+
cp ./configs/.env.dev.example .env.dev
65+
```
66+
67+
2. Build the local images:
68+
```sh
69+
docker-compose --env-file .env.dev build
70+
```
71+
72+
3. Start the dev stack:
73+
```sh
74+
docker-compose --env-file .env.dev up --build
75+
```
76+
77+
4. Tear down the dev stack:
78+
```sh
79+
docker-compose --env-file .env.dev down
80+
```
81+
82+
### CLI (experimental)
83+
84+
1. Build CLI tool in the project root:
85+
```sh
86+
cd cli && go build -o ../horahora . && cd ..
87+
```
88+
89+
2. Use CLI tool:
90+
```sh
91+
./horahora
92+
```
93+
Instructions and available commands will be shown within it.
94+
3495
## Contributing
3596
Contributions are always welcome. Please see [CONTRIBUTING.md](https://github.com/horahoradev/horahora/blob/master/CONTRIBUTING.md) for details, including an architectural rundown.
3697

0 commit comments

Comments
 (0)