mirror of
https://github.com/pockethost/pockethost.git
synced 2025-07-09 14:22:31 +00:00
Prod fixes
This commit is contained in:
parent
72057c6934
commit
82fce63dce
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,4 +2,5 @@
|
|||||||
node_modules
|
node_modules
|
||||||
.secret
|
.secret
|
||||||
.vscode
|
.vscode
|
||||||
|
*.out
|
||||||
.env
|
.env
|
72
development.md
Normal file
72
development.md
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
# Developer instructions
|
||||||
|
|
||||||
|
|
||||||
|
## Deployment
|
||||||
|
|
||||||
|
### Clone
|
||||||
|
```bash
|
||||||
|
git clone git@github.com:benallfree/pockethost.git
|
||||||
|
cd pockethost
|
||||||
|
```
|
||||||
|
|
||||||
|
### Build custom PockeBase
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd packages/pocketbase
|
||||||
|
yarn build
|
||||||
|
```
|
||||||
|
|
||||||
|
### Build daemon
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd packages/daemon
|
||||||
|
yarn build
|
||||||
|
```
|
||||||
|
|
||||||
|
### Build web app
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd packages/pockethost.io
|
||||||
|
cp .env-template .env
|
||||||
|
nano .env
|
||||||
|
```
|
||||||
|
|
||||||
|
Edit vars as needed
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn build
|
||||||
|
```
|
||||||
|
|
||||||
|
### Prepare Docker
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd docker
|
||||||
|
cp .env.template .env
|
||||||
|
nano .env
|
||||||
|
```
|
||||||
|
|
||||||
|
Edit `APP_DOMAIN` and `CORE_PB_PASSWORD` (needed by daemon)
|
||||||
|
|
||||||
|
|
||||||
|
Ensure that your ssl files are present there.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ../docker
|
||||||
|
ls ssl
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo certbot --server https://acme-v02.api.letsencrypt.org/directory -d *.pockethost.io -d pockethost.io --manual --preferred-challenges dns-01 certonly
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nano nginx-conf/nginx.conf
|
||||||
|
```
|
||||||
|
|
||||||
|
Edit as needed
|
||||||
|
|
||||||
|
## Run
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo docker-compose up
|
||||||
|
```
|
@ -16,10 +16,10 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- pbproxy
|
- pbproxy
|
||||||
env_file:
|
env_file:
|
||||||
- ../.env
|
- ./.env
|
||||||
pbproxy:
|
pbproxy:
|
||||||
env_file:
|
env_file:
|
||||||
- ../.env
|
- ./.env
|
||||||
image: node:18
|
image: node:18
|
||||||
container_name: pbproxy
|
container_name: pbproxy
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
1
docker/mount/ssl/.gitignore
vendored
Normal file
1
docker/mount/ssl/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.pem
|
@ -3,7 +3,7 @@
|
|||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "esbuild src/server.ts --bundle --platform=node > dist/server.js",
|
"build": "mkdir -p dist && esbuild src/server.ts --bundle --platform=node > dist/server.js",
|
||||||
"watch": "chokidar 'src/**' -c 'yarn build' --initial",
|
"watch": "chokidar 'src/**' -c 'yarn build' --initial",
|
||||||
"serve": "node dist/server.js"
|
"serve": "node dist/server.js"
|
||||||
},
|
},
|
||||||
|
@ -5,6 +5,7 @@ import { ChildProcessWithoutNullStreams, spawn } from 'child_process'
|
|||||||
import getPort from 'get-port'
|
import getPort from 'get-port'
|
||||||
import fetch from 'node-fetch'
|
import fetch from 'node-fetch'
|
||||||
import {
|
import {
|
||||||
|
APP_DOMAIN,
|
||||||
CORE_PB_PASSWORD,
|
CORE_PB_PASSWORD,
|
||||||
CORE_PB_PORT,
|
CORE_PB_PORT,
|
||||||
CORE_PB_SUBDOMAIN,
|
CORE_PB_SUBDOMAIN,
|
||||||
@ -98,7 +99,12 @@ export const createInstanceManger = async () => {
|
|||||||
heartbeat: () => {},
|
heartbeat: () => {},
|
||||||
}
|
}
|
||||||
await tryFetch(coreInternalUrl)
|
await tryFetch(coreInternalUrl)
|
||||||
await client.adminAuthViaEmail(CORE_PB_USERNAME, CORE_PB_PASSWORD)
|
try {
|
||||||
|
await client.adminAuthViaEmail(CORE_PB_USERNAME, CORE_PB_PASSWORD)}
|
||||||
|
catch(e) {
|
||||||
|
console.error(`***WARNING*** CANNOT AUTHENTICATE TO https://${CORE_PB_SUBDOMAIN}.${APP_DOMAIN}/_/`)
|
||||||
|
console.error(`***WARNING*** LOG IN MANUALLY, ADJUST .env, AND RESTART DOCKER`)
|
||||||
|
}
|
||||||
|
|
||||||
const limiter = new Bottleneck({ maxConcurrent: 1 })
|
const limiter = new Bottleneck({ maxConcurrent: 1 })
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build"
|
"build:arm64": "GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build",
|
||||||
|
"build:386": "GOOS=linux GOARCH=386 CGO_ENABLED=0 go build"
|
||||||
}
|
}
|
||||||
}
|
}
|
2
packages/pockethost.io/.env-template
Normal file
2
packages/pockethost.io/.env-template
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
PUBLIC_APP_DOMAIN = pockethost.local
|
||||||
|
PUBLIC_CORE_PB_SUBDOMAIN = pockethost-central
|
Loading…
x
Reference in New Issue
Block a user