mirror of
https://github.com/lone-cloud/prism
synced 2026-06-03 19:54:44 -07:00
more docker release updates
This commit is contained in:
parent
5c837a7103
commit
69c854f401
7 changed files with 118 additions and 71 deletions
10
.env.example
10
.env.example
|
|
@ -1,11 +1,7 @@
|
||||||
# Optional: Protect endpoint registration with an API key (recommended for public deployments)
|
# Optional: Protect endpoint registration with an API key (recommended for public deployments)
|
||||||
|
# Default: unset (no authentication required)
|
||||||
# API_KEY=your-secret-key-here
|
# API_KEY=your-secret-key-here
|
||||||
|
|
||||||
# Optional: Enable verbose signal-cli logging
|
# Optional: Enable verbose signal-cli logging
|
||||||
# SIGNAL_CLI_VERBOSE=true
|
# Default: false
|
||||||
|
# VERBOSE=true
|
||||||
# Android release signing (only needed for building production APKs)
|
|
||||||
# KEYSTORE_FILE=./android/release.keystore
|
|
||||||
# KEYSTORE_PASSWORD=<generated-password>
|
|
||||||
# KEY_ALIAS=sup-release
|
|
||||||
# KEY_PASSWORD=<generated-password>
|
|
||||||
|
|
|
||||||
79
README.md
79
README.md
|
|
@ -49,33 +49,29 @@ After adding yourself to the docker group, **logout and login** for it to take e
|
||||||
**Without ProtonMail** (just UnifiedPush):
|
**Without ProtonMail** (just UnifiedPush):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Clone the repo
|
# Download docker-compose.yml
|
||||||
git clone https://github.com/lone-cloud/sup.git
|
curl -L -O https://raw.githubusercontent.com/lone-cloud/sup/master/docker-compose.yml
|
||||||
cd sup
|
|
||||||
|
|
||||||
# Create .env file
|
# Create .env file
|
||||||
cat > .env << 'EOF'
|
cat > .env << 'EOF'
|
||||||
# Required: API key for securing your server
|
# Optional: API key for remote access
|
||||||
|
# Set this to protect your server when accessing it from outside your home network
|
||||||
|
# (e.g., registering UnifiedPush apps while away from home)
|
||||||
|
# Default: unset (no authentication required)
|
||||||
API_KEY=your-random-secret-key-here
|
API_KEY=your-random-secret-key-here
|
||||||
|
|
||||||
# Optional: Enable verbose logging
|
# Optional: Enable verbose logging
|
||||||
|
# Default: false
|
||||||
VERBOSE=false
|
VERBOSE=false
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Build and start SUP server only
|
# Start SUP server
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
|
|
||||||
# Link your Signal account (one-time setup)
|
# Link your Signal account (one-time setup)
|
||||||
# Visit http://localhost:8080/link and scan QR code with Signal app
|
# Visit http://localhost:8080/link and scan QR code with Signal app
|
||||||
```
|
```
|
||||||
|
|
||||||
**With ProtonMail** (UnifiedPush + email notifications):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Same setup as above, then start with protonmail profile
|
|
||||||
docker compose --profile protonmail up -d
|
|
||||||
```
|
|
||||||
|
|
||||||
### ProtonMail Integration (Optional)
|
### ProtonMail Integration (Optional)
|
||||||
|
|
||||||
To receive ProtonMail notifications via Signal:
|
To receive ProtonMail notifications via Signal:
|
||||||
|
|
@ -91,6 +87,7 @@ To receive ProtonMail notifications via Signal:
|
||||||
- Enter your ProtonMail email
|
- Enter your ProtonMail email
|
||||||
- Enter your ProtonMail password
|
- Enter your ProtonMail password
|
||||||
- Enter your 2FA code
|
- Enter your 2FA code
|
||||||
|
- Wait (potentially a long time) for ProtonMail Bridge to sync emails
|
||||||
|
|
||||||
3. **Get IMAP credentials**:
|
3. **Get IMAP credentials**:
|
||||||
- Run: `info`
|
- Run: `info`
|
||||||
|
|
@ -113,57 +110,21 @@ To receive ProtonMail notifications via Signal:
|
||||||
|
|
||||||
Your phone will now receive Signal notifications when ProtonMail receives new emails.
|
Your phone will now receive Signal notifications when ProtonMail receives new emails.
|
||||||
|
|
||||||
### Checking Logs
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Without ProtonMail
|
|
||||||
docker compose logs -f
|
|
||||||
|
|
||||||
# With ProtonMail
|
|
||||||
docker compose --profile protonmail logs -f
|
|
||||||
|
|
||||||
# View specific service
|
|
||||||
docker compose logs -f sup-server
|
|
||||||
docker compose --profile protonmail logs -f email-monitor
|
|
||||||
docker compose --profile protonmail logs -f protonmail-bridge
|
|
||||||
```
|
|
||||||
|
|
||||||
### Stopping Services
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Without ProtonMail
|
|
||||||
docker compose down
|
|
||||||
|
|
||||||
# With ProtonMail
|
|
||||||
docker compose --profile protonmail down
|
|
||||||
|
|
||||||
# Stop and remove volumes (warning: deletes Signal/ProtonMail data)
|
|
||||||
docker compose --profile protonmail down -v
|
|
||||||
```
|
|
||||||
|
|
||||||
### Development
|
### Development
|
||||||
|
|
||||||
|
For local development, use the dev compose file to build from source:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose -f docker-compose.dev.yml up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
Or run services directly with Bun:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bun install
|
bun install
|
||||||
bun dev
|
bun --filter sup-server dev
|
||||||
```
|
```
|
||||||
|
|
||||||
Visit `http://localhost:8080/link` to link your Signal account.
|
|
||||||
|
|
||||||
## API Endpoints
|
|
||||||
|
|
||||||
### UnifiedPush Protocol
|
|
||||||
|
|
||||||
- `POST /up/{app_id}` - Register new endpoint
|
|
||||||
- `DELETE /up/{app_id}` - Unregister endpoint
|
|
||||||
- `GET /up` - Discovery endpoint
|
|
||||||
- `POST /_matrix/push/v1/notify/{endpoint_id}` - Push notification
|
|
||||||
|
|
||||||
### Management
|
|
||||||
|
|
||||||
- `GET /health` - Health check
|
|
||||||
- `GET /endpoints` - List registered endpoints
|
|
||||||
|
|
||||||
## How It Works
|
## How It Works
|
||||||
|
|
||||||
1. Android app registers with server via `/up/{app_id}`
|
1. Android app registers with server via `/up/{app_id}`
|
||||||
|
|
@ -180,10 +141,8 @@ Download the latest APK from [GitHub Releases](https://github.com/lone-cloud/sup
|
||||||
|
|
||||||
**Install via Obtainium:** [obtainium://add/https://github.com/lone-cloud/sup](obtainium://add/https://github.com/lone-cloud/sup)
|
**Install via Obtainium:** [obtainium://add/https://github.com/lone-cloud/sup](obtainium://add/https://github.com/lone-cloud/sup)
|
||||||
|
|
||||||
**Certificate Fingerprint for Obtainium verification:**
|
**Certificate Fingerprint:**
|
||||||
|
|
||||||
```text
|
```text
|
||||||
0D:3C:99:15:0E:12:1A:DE:0D:AE:05:CB:16:46:5E:65:31:56:DC:D6:98:87:59:4E:79:B1:0D:AE:1E:56:F2:E8
|
0D:3C:99:15:0E:12:1A:DE:0D:AE:05:CB:16:46:5E:65:31:56:DC:D6:98:87:59:4E:79:B1:0D:AE:1E:56:F2:E8
|
||||||
```
|
```
|
||||||
|
|
||||||
Verify this fingerprint when installing via Obtainium to ensure authenticity.
|
|
||||||
|
|
|
||||||
40
docker-compose.dev.yml
Normal file
40
docker-compose.dev.yml
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
services:
|
||||||
|
sup-server:
|
||||||
|
build: ./server
|
||||||
|
ports:
|
||||||
|
- '8080:8080'
|
||||||
|
environment:
|
||||||
|
- PORT=8080
|
||||||
|
- API_KEY=${API_KEY:-}
|
||||||
|
- VERBOSE=${VERBOSE:-false}
|
||||||
|
volumes:
|
||||||
|
- signal-data:/root/.local/share/signal-cli
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
protonmail-bridge:
|
||||||
|
image: shenxn/protonmail-bridge:build
|
||||||
|
container_name: protonmail-bridge
|
||||||
|
profiles: ['protonmail']
|
||||||
|
volumes:
|
||||||
|
- proton-bridge-data:/root
|
||||||
|
- /tmp/bridge-updates:/root/.local/share/protonmail/bridge-v3/updates:ro # Disable auto-updates
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
sup-proton-bridge:
|
||||||
|
build: ./proton-bridge
|
||||||
|
container_name: sup-proton-bridge
|
||||||
|
profiles: ['protonmail']
|
||||||
|
depends_on:
|
||||||
|
- sup-server
|
||||||
|
- protonmail-bridge
|
||||||
|
environment:
|
||||||
|
- BRIDGE_IMAP_USERNAME=${BRIDGE_IMAP_USERNAME}
|
||||||
|
- BRIDGE_IMAP_PASSWORD=${BRIDGE_IMAP_PASSWORD}
|
||||||
|
- SUP_API_KEY=${API_KEY}
|
||||||
|
- SUP_TOPIC=${SUP_TOPIC:-Proton Mail}
|
||||||
|
- VERBOSE=${VERBOSE:-false}
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
signal-data:
|
||||||
|
proton-bridge-data:
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
services:
|
services:
|
||||||
sup-server:
|
sup-server:
|
||||||
build: ./server
|
image: ghcr.io/lone-cloud/sup-server:latest
|
||||||
ports:
|
ports:
|
||||||
- '8080:8080'
|
- '8080:8080'
|
||||||
environment:
|
environment:
|
||||||
|
|
@ -21,7 +21,7 @@ services:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
sup-proton-bridge:
|
sup-proton-bridge:
|
||||||
build: ./proton-bridge
|
image: ghcr.io/lone-cloud/sup-proton-bridge:latest
|
||||||
container_name: sup-proton-bridge
|
container_name: sup-proton-bridge
|
||||||
profiles: ['protonmail']
|
profiles: ['protonmail']
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,8 @@
|
||||||
"android:build": "bun run scripts/test-android-build.ts",
|
"android:build": "bun run scripts/test-android-build.ts",
|
||||||
"android:release": "bun run scripts/release-android.ts",
|
"android:release": "bun run scripts/release-android.ts",
|
||||||
"android:deps": "bun run scripts/check-android-deps.ts",
|
"android:deps": "bun run scripts/check-android-deps.ts",
|
||||||
"android:lockfile": "bun run scripts/update-android-lockfile.ts"
|
"android:lockfile": "bun run scripts/update-android-lockfile.ts",
|
||||||
|
"docker:release": "bun run scripts/release-docker.ts"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "^2.3.11",
|
"@biomejs/biome": "^2.3.11",
|
||||||
|
|
|
||||||
51
scripts/release-docker.ts
Normal file
51
scripts/release-docker.ts
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
import { $ } from 'bun';
|
||||||
|
|
||||||
|
const service = process.argv[2];
|
||||||
|
|
||||||
|
if (!service || !['server', 'bridge'].includes(service)) {
|
||||||
|
console.error('Usage: bun run docker:release <service>');
|
||||||
|
console.error('Example: bun run docker:release server');
|
||||||
|
console.error(' bun run docker:release bridge');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const registry = 'ghcr.io/lone-cloud';
|
||||||
|
const config = service === 'server'
|
||||||
|
? { name: 'sup-server', path: './server' }
|
||||||
|
: { name: 'sup-proton-bridge', path: './proton-bridge' };
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Read version from package.json
|
||||||
|
const packageJson = await Bun.file(`${config.path}/package.json`).json();
|
||||||
|
const version = `v${packageJson.version}`;
|
||||||
|
|
||||||
|
console.log(`🚀 Releasing ${config.name} ${version}...`);
|
||||||
|
|
||||||
|
const fullName = `${registry}/${config.name}`;
|
||||||
|
|
||||||
|
console.log(`\n📦 Building ${config.name}...`);
|
||||||
|
await $`docker build -t ${fullName}:${version} -t ${fullName}:latest ${config.path}`;
|
||||||
|
console.log(`✓ Built ${config.name}`);
|
||||||
|
|
||||||
|
console.log(`📤 Pushing ${fullName}:${version}...`);
|
||||||
|
await $`docker push ${fullName}:${version}`;
|
||||||
|
console.log(`✓ Pushed ${fullName}:${version}`);
|
||||||
|
|
||||||
|
console.log(`📤 Pushing ${fullName}:latest...`);
|
||||||
|
await $`docker push ${fullName}:latest`;
|
||||||
|
console.log(`✓ Pushed ${fullName}:latest`);
|
||||||
|
|
||||||
|
console.log(`
|
||||||
|
✨ ${config.name} ${version} released successfully!
|
||||||
|
|
||||||
|
Images pushed:
|
||||||
|
- ${fullName}:${version}
|
||||||
|
- ${fullName}:latest
|
||||||
|
|
||||||
|
Users can now pull with:
|
||||||
|
docker compose pull
|
||||||
|
`);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('❌ Release failed:', error);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
@ -11,7 +11,7 @@ RUN bun build --compile src/server.ts --outfile sup-server
|
||||||
|
|
||||||
FROM alpine:3.21
|
FROM alpine:3.21
|
||||||
|
|
||||||
RUN apk add --no-cache openjdk25-jre
|
RUN apk add --no-cache openjdk21-jre
|
||||||
|
|
||||||
COPY --from=builder /app/sup-server /usr/local/bin/sup-server
|
COPY --from=builder /app/sup-server /usr/local/bin/sup-server
|
||||||
COPY --from=builder /app/signal-cli /usr/local/bin/signal-cli
|
COPY --from=builder /app/signal-cli /usr/local/bin/signal-cli
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue