Browse Source

Add agora app (#1282)

Co-authored-by: Luke Childs <lukechilds123@gmail.com>
0.4.17
Jonathan Zernik 3 years ago
committed by GitHub
parent
commit
ed7e04a6b8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      apps/agora/data/entrypoint.sh
  2. 14
      apps/agora/data/www/admin/index.html
  3. 0
      apps/agora/database/filebrowser.db
  4. 49
      apps/agora/docker-compose.yml
  5. 0
      apps/agora/files/.gitkeep
  6. 26
      apps/agora/nginx/nginx.conf
  7. 25
      apps/registry.json
  8. 4
      scripts/configure
  9. 2
      templates/.env-sample
  10. 4
      templates/torrc-server-sample

8
apps/agora/data/entrypoint.sh

@ -0,0 +1,8 @@
#!/usr/bin/env sh
# Update configs
/filebrowser config init
/filebrowser config set --branding.name "Agora Admin"
/filebrowser users add umbrel ${APP_PASSWORD}
exec /filebrowser -p 8080 --baseurl "/admin/files"

14
apps/agora/data/www/admin/index.html

@ -0,0 +1,14 @@
<!doctype html>
<html>
<head>
<title>Agora Admin</title>
</head>
<body>
<h1>Welcome to Agora Admin!</h1>
<ul>
<li><a href="/">Download files</a></li>
<li><a href="/admin/files">Manage files</a></li>
<li><a href="https://github.com/agora-org/agora#access-configuration">Agora Configuration Docs</a></li>
</ul>
</body>
</html>

0
apps/agora/database/filebrowser.db

49
apps/agora/docker-compose.yml

@ -0,0 +1,49 @@
version: "3.7"
services:
filebrowser:
image: filebrowser/filebrowser:v2.21.1@sha256:6da71bfffc1345075a5cc06e0a7ae270098186407c62f4f71994e079677364d0
user: 1000:1000
restart: on-failure
stop_grace_period: 1m
volumes:
- ${APP_DATA_DIR}/files:/srv
- ${APP_DATA_DIR}/database/filebrowser.db:/database.db
- ${APP_DATA_DIR}/data:/data
environment:
APP_PASSWORD: "$APP_PASSWORD"
entrypoint: /data/entrypoint.sh
agora:
image: ghcr.io/agora-org/agora:sha-48d3205@sha256:35eda120a8d868c7fa3b9cbdcad7cc2245b9fe7e0c5356c8091bb0bf9a65222d
restart: on-failure
stop_grace_period: 1m
volumes:
- ${APP_DATA_DIR}/files:/files
- ${LND_DATA_DIR}:/lnd:ro
user: "1000:1000"
environment:
# LND environment variables
LND_RPC_AUTHORITY: "$LND_IP:$LND_GRPC_PORT"
TLS_CERT_PATH: "/lnd/tls.cert"
INVOICES_MACAROON_PATH: "/lnd/data/chain/bitcoin/$BITCOIN_NETWORK/invoice.macaroon"
# App specific environment variables
FILES_DIR: "/files"
AGORA_PORT: 8080
nginx:
image: nginx:1.19-alpine@sha256:c2ce58e024275728b00a554ac25628af25c54782865b3487b11c21cafb7fabda
init: true
restart: on-failure
volumes:
- ${APP_DATA_DIR}/nginx/nginx.conf:/etc/nginx/nginx.conf
- ${APP_DATA_DIR}/data/www:/usr/share/nginx/html
ports:
- "$APP_AGORA_PORT:80"
depends_on:
- agora
- filebrowser
networks:
default:
ipv4_address: $APP_AGORA_IP

0
apps/agora/files/.gitkeep

26
apps/agora/nginx/nginx.conf

@ -0,0 +1,26 @@
events { }
http {
server {
listen 80;
server_name _;
location / {
proxy_pass http://agora:8080;
}
location /admin {
root /usr/share/nginx/html;
index index.html;
}
location /admin/files {
client_max_body_size 0;
proxy_pass http://filebrowser:8080;
}
}
}

25
apps/registry.json

@ -1015,5 +1015,30 @@
"path": "",
"deterministicPassword": true,
"torOnly": false
},
{
"id": "agora",
"category": "Files",
"name": "Agora",
"version": "v0.1.2",
"tagline": "Earn Bitcoin for hosting files",
"description": "Agora is a project that allows anyone to sell files on the web for bitcoin using the Lightning Network.\n\nAgora serves the contents of a local directory, providing file listings and downloads over HTTP. For example, you can point it at a directory full of PDFs, allowing users to browse and view the PDFs in their web browser. If agora is connected to an LND node, it can be configured to require Lightning Network payments for downloads.",
"developer": "Casey Rodarmor & Sönke Hahn",
"website": "https://agora-org.github.io/agora/",
"dependencies": [
"lnd"
],
"repo": "https://github.com/agora-org/agora",
"support": "https://t.me/agoradiscussion",
"port": 12080,
"gallery": [
"1.jpg",
"2.jpg",
"3.jpg"
],
"path": "/admin/",
"deterministicPassword": true,
"defaultUsername": "umbrel",
"torOnly": false
}
]

4
scripts/configure

@ -256,6 +256,8 @@ APP_JAM_PORT="5002"
APP_BLESKOMAT_SERVER_PORT="3333"
APP_BLESKOMAT_SERVER_IP="10.21.21.85"
APP_BLESKOMAT_SERVER_DB_IP="10.21.21.86"
APP_AGORA_IP="10.21.21.87"
APP_AGORA_PORT="12080"
# Generate RPC credentials
if [[ -z ${BITCOIN_RPC_USER+x} ]] || [[ -z ${BITCOIN_RPC_PASS+x} ]] || [[ -z ${BITCOIN_RPC_AUTH+x} ]]; then
@ -512,6 +514,8 @@ for template in "${NGINX_CONF_FILE}" "${BITCOIN_CONF_FILE}" "${LND_CONF_FILE}" "
sed -i "s/<app-bleskomat-server-port>/${APP_BLESKOMAT_SERVER_PORT}/g" "${template}"
sed -i "s/<app-bleskomat-server-ip>/${APP_BLESKOMAT_SERVER_IP}/g" "${template}"
sed -i "s/<app-bleskomat-server-db-ip>/${APP_BLESKOMAT_SERVER_DB_IP}/g" "${template}"
sed -i "s/<app-agora-ip>/${APP_AGORA_IP}/g" "${template}"
sed -i "s/<app-agora-port>/${APP_AGORA_PORT}/g" "${template}"
done
##########################################################

2
templates/.env-sample

@ -154,3 +154,5 @@ APP_JAM_PORT=<app-jam-port>
APP_BLESKOMAT_SERVER_PORT=<app-bleskomat-server-port>
APP_BLESKOMAT_SERVER_IP=<app-bleskomat-server-ip>
APP_BLESKOMAT_SERVER_DB_IP=<app-bleskomat-server-db-ip>
APP_AGORA_IP=<app-agora-ip>
APP_AGORA_PORT=<app-agora-port>

4
templates/torrc-server-sample

@ -225,3 +225,7 @@ HiddenServicePort 80 <app-jam-ip>:80
# bleskomat-server Hidden Service
HiddenServiceDir /data/app-bleskomat-server
HiddenServicePort 80 <app-bleskomat-server-ip>:<app-bleskomat-server-port>
# agora Hidden Service
HiddenServiceDir /data/app-agora
HiddenServicePort 80 <app-agora-ip>:80

Loading…
Cancel
Save