mirror of
https://github.com/lone-cloud/prism
synced 2026-06-03 19:54:44 -07:00
clean up emoji
This commit is contained in:
parent
a201ea6dc5
commit
f584cf97bb
12 changed files with 59 additions and 54 deletions
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
* text=auto eol=lf
|
||||||
4
.github/workflows/android-ci.yml
vendored
4
.github/workflows/android-ci.yml
vendored
|
|
@ -33,10 +33,10 @@ jobs:
|
||||||
chmod +x gradlew
|
chmod +x gradlew
|
||||||
./gradlew dependencies --write-locks
|
./gradlew dependencies --write-locks
|
||||||
if ! git diff --exit-code app/gradle.lockfile; then
|
if ! git diff --exit-code app/gradle.lockfile; then
|
||||||
echo "❌ Lockfile is out of date. Run: cd android && ./gradlew dependencies --write-locks"
|
echo "Lockfile is out of date. Run: cd android && ./gradlew dependencies --write-locks"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "✅ Lockfile is up-to-date"
|
echo "Lockfile is up-to-date"
|
||||||
|
|
||||||
- name: Decode keystore
|
- name: Decode keystore
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
|
|
@ -141,14 +141,14 @@ async function main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!latestVersion) {
|
if (!latestVersion) {
|
||||||
console.log(`❌ ${dep}: Could not check`);
|
console.log(`${dep}: Could not check`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (latestVersion === currentVersion) {
|
if (latestVersion === currentVersion) {
|
||||||
console.log(`✓ ${dep}: ${currentVersion} (latest)`);
|
console.log(`${dep}: ${currentVersion} (latest)`);
|
||||||
} else if (compareVersions(currentVersion, latestVersion) < 0) {
|
} else if (compareVersions(currentVersion, latestVersion) < 0) {
|
||||||
console.log(`⚠ ${dep}: ${currentVersion} → ${latestVersion}`);
|
console.log(` ${dep}: ${currentVersion} → ${latestVersion}`);
|
||||||
hasUpdates = true;
|
hasUpdates = true;
|
||||||
} else {
|
} else {
|
||||||
console.log(`ℹ ${dep}: ${currentVersion} (newer than Maven: ${latestVersion})`);
|
console.log(`ℹ ${dep}: ${currentVersion} (newer than Maven: ${latestVersion})`);
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ async function installSignalCli() {
|
||||||
|
|
||||||
await chmod(`${SIGNAL_CLI_DIR}/bin/signal-cli`, 0o755);
|
await chmod(`${SIGNAL_CLI_DIR}/bin/signal-cli`, 0o755);
|
||||||
|
|
||||||
console.log('✓ signal-cli installed successfully');
|
console.log('signal-cli installed successfully');
|
||||||
}
|
}
|
||||||
|
|
||||||
await installSignalCli();
|
await installSignalCli();
|
||||||
|
|
|
||||||
|
|
@ -9,35 +9,33 @@ if (!version) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!version.startsWith('v')) {
|
if (!version.startsWith('v')) {
|
||||||
console.error('❌ Version must start with "v" (e.g., v0.1.0)');
|
console.error('Version must start with "v" (e.g., v0.1.0)');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const status = await $`git status --porcelain`.text();
|
const status = await $`git status --porcelain`.text();
|
||||||
if (status.trim()) {
|
if (status.trim()) {
|
||||||
console.error('❌ You have uncommitted changes. Commit or stash them first.');
|
console.error('You have uncommitted changes. Commit or stash them first.');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await $`git rev-parse ${version}`.quiet();
|
await $`git rev-parse ${version}`.quiet();
|
||||||
console.error(`❌ Tag ${version} already exists`);
|
console.error(`Tag ${version} already exists`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
} catch {
|
} catch {}
|
||||||
// Tag doesn't exist, good
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`🚀 Creating release ${version}...`);
|
console.log(`Creating release ${version}...`);
|
||||||
|
|
||||||
await $`git tag ${version}`;
|
await $`git tag ${version}`;
|
||||||
console.log(`✓ Created tag ${version}`);
|
console.log(`Created tag ${version}`);
|
||||||
|
|
||||||
await $`git push origin ${version}`;
|
await $`git push origin ${version}`;
|
||||||
console.log(`✓ Pushed tag to GitHub`);
|
console.log(`Pushed tag to GitHub`);
|
||||||
|
|
||||||
console.log(`
|
console.log(`
|
||||||
✓ Release ${version} triggered!
|
Release ${version} triggered!
|
||||||
|
|
||||||
GitHub Actions will now:
|
GitHub Actions will now:
|
||||||
1. Build signed Android APK
|
1. Build signed Android APK
|
||||||
|
|
|
||||||
|
|
@ -7,21 +7,21 @@ try {
|
||||||
const packageJson = await Bun.file(`${config.path}/package.json`).json();
|
const packageJson = await Bun.file(`${config.path}/package.json`).json();
|
||||||
const version = `v${packageJson.version}`;
|
const version = `v${packageJson.version}`;
|
||||||
|
|
||||||
console.log(`🚀 Releasing ${config.name} ${version}...`);
|
console.log(`Releasing ${config.name} ${version}...`);
|
||||||
|
|
||||||
const fullName = `${registry}/${config.name}`;
|
const fullName = `${registry}/${config.name}`;
|
||||||
|
|
||||||
console.log(`\n📦 Building ${config.name}...`);
|
console.log(`\nBuilding ${config.name}...`);
|
||||||
await $`docker build -t ${fullName}:${version} -t ${fullName}:latest ${config.path}`;
|
await $`docker build -t ${fullName}:${version} -t ${fullName}:latest ${config.path}`;
|
||||||
console.log(`✓ Built ${config.name}`);
|
console.log(`Built ${config.name}`);
|
||||||
|
|
||||||
console.log(`📤 Pushing ${fullName}:${version}...`);
|
console.log(`Pushing ${fullName}:${version}...`);
|
||||||
await $`docker push ${fullName}:${version}`;
|
await $`docker push ${fullName}:${version}`;
|
||||||
console.log(`✓ Pushed ${fullName}:${version}`);
|
console.log(`Pushed ${fullName}:${version}`);
|
||||||
|
|
||||||
console.log(`📤 Pushing ${fullName}:latest...`);
|
console.log(`Pushing ${fullName}:latest...`);
|
||||||
await $`docker push ${fullName}:latest`;
|
await $`docker push ${fullName}:latest`;
|
||||||
console.log(`✓ Pushed ${fullName}:latest`);
|
console.log(`Pushed ${fullName}:latest`);
|
||||||
|
|
||||||
console.log(`
|
console.log(`
|
||||||
✨ ${config.name} ${version} released successfully!
|
✨ ${config.name} ${version} released successfully!
|
||||||
|
|
@ -34,6 +34,6 @@ Users can now pull with:
|
||||||
docker compose pull
|
docker compose pull
|
||||||
`);
|
`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('❌ Release failed:', error);
|
console.error('Release failed:', error);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ console.log('Building signed release APK...\n');
|
||||||
const requiredEnvVars = ['KEYSTORE_FILE', 'KEYSTORE_PASSWORD', 'KEY_ALIAS', 'KEY_PASSWORD'];
|
const requiredEnvVars = ['KEYSTORE_FILE', 'KEYSTORE_PASSWORD', 'KEY_ALIAS', 'KEY_PASSWORD'];
|
||||||
const missing = requiredEnvVars.filter((v) => !process.env[v]);
|
const missing = requiredEnvVars.filter((v) => !process.env[v]);
|
||||||
if (missing.length > 0) {
|
if (missing.length > 0) {
|
||||||
console.error(`❌ Missing required environment variables: ${missing.join(', ')}`);
|
console.error(`Missing required environment variables: ${missing.join(', ')}`);
|
||||||
console.error('\nSee android/RELEASE.md for setup instructions');
|
console.error('\nSee android/RELEASE.md for setup instructions');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
@ -22,11 +22,11 @@ try {
|
||||||
|
|
||||||
const apkExists = await Bun.file(APK_PATH).exists();
|
const apkExists = await Bun.file(APK_PATH).exists();
|
||||||
if (!apkExists) {
|
if (!apkExists) {
|
||||||
console.error(`\n❌ APK not found at ${APK_PATH}`);
|
console.error(`\nAPK not found at ${APK_PATH}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`\n✓ APK built successfully: ${APK_PATH}`);
|
console.log(`\nAPK built successfully: ${APK_PATH}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Build failed:', error);
|
console.error('Build failed:', error);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ console.log('Regenerating Android dependency lockfiles...');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await $`cd android && ./gradlew dependencies --write-locks`;
|
await $`cd android && ./gradlew dependencies --write-locks`;
|
||||||
console.log('✓ Lockfiles regenerated successfully');
|
console.log('Lockfiles regenerated successfully');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('✗ Failed to regenerate lockfiles');
|
console.error('✗ Failed to regenerate lockfiles');
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|
|
||||||
|
|
@ -22,18 +22,18 @@ try {
|
||||||
const hasAccount = isLinked && (await initSignal({}));
|
const hasAccount = isLinked && (await initSignal({}));
|
||||||
|
|
||||||
if (hasAccount) {
|
if (hasAccount) {
|
||||||
logSuccess('✓ Signal account linked');
|
logSuccess('Signal account linked');
|
||||||
} else {
|
} else {
|
||||||
logWarn('⚠ No Signal account linked');
|
logWarn('No Signal account linked');
|
||||||
logInfo(` Visit http://localhost:${PORT}/link to link your device`);
|
logInfo(`Visit http://localhost:${PORT}/link to link your device`);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logError(` ${error instanceof Error ? error.message : String(error)}`);
|
logError(` ${error instanceof Error ? error.message : String(error)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!API_KEY) {
|
if (!API_KEY) {
|
||||||
logWarn('⚠️ Server running without API_KEY');
|
logWarn('Server running without API_KEY');
|
||||||
console.warn(' Set API_KEY env var for production deployments.');
|
console.warn('Set API_KEY env var for production deployments.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BRIDGE_IMAP_USERNAME && BRIDGE_IMAP_PASSWORD) {
|
if (BRIDGE_IMAP_USERNAME && BRIDGE_IMAP_PASSWORD) {
|
||||||
|
|
@ -41,8 +41,8 @@ if (BRIDGE_IMAP_USERNAME && BRIDGE_IMAP_PASSWORD) {
|
||||||
const { startProtonMonitor } = await import('./modules/protonmail');
|
const { startProtonMonitor } = await import('./modules/protonmail');
|
||||||
await startProtonMonitor();
|
await startProtonMonitor();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logError('❌ Failed to start ProtonMail monitor:', err);
|
logError('Failed to start ProtonMail monitor:', err);
|
||||||
logWarn('⚠️ Continuing without ProtonMail integration');
|
logWarn('Continuing without ProtonMail integration');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -107,4 +107,4 @@ const server = Bun.serve({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
logInfo(`\n🚀 SUP running on http://localhost:${server.port}`);
|
logInfo(`\nSUP running on http://localhost:${server.port} 🚀`);
|
||||||
|
|
|
||||||
|
|
@ -47,9 +47,9 @@ export async function startProtonMonitor() {
|
||||||
: '';
|
: '';
|
||||||
await sendGroupMessage(groupId, `${prefix}**${title}**\n${message}`);
|
await sendGroupMessage(groupId, `${prefix}**${title}**\n${message}`);
|
||||||
|
|
||||||
logSuccess(`✅ Notification sent: ${title}`);
|
logSuccess(`Notification sent: ${title}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logError('❌ Failed to send notification:', error);
|
logError('Failed to send notification:', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -60,7 +60,7 @@ export async function startProtonMonitor() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logVerbose(`✅ Connected to inbox (${box.messages.total} messages)`);
|
logVerbose(`Connected to inbox (${box.messages.total} messages)`);
|
||||||
|
|
||||||
imap.on('mail', async (numNewMsgs: number) => {
|
imap.on('mail', async (numNewMsgs: number) => {
|
||||||
logVerbose(`📬 ${numNewMsgs} new message(s) received`);
|
logVerbose(`📬 ${numNewMsgs} new message(s) received`);
|
||||||
|
|
@ -94,17 +94,17 @@ export async function startProtonMonitor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
imap.once('ready', () => {
|
imap.once('ready', () => {
|
||||||
logVerbose('✅ IMAP connection ready');
|
logVerbose('IMAP connection ready');
|
||||||
openInbox();
|
openInbox();
|
||||||
});
|
});
|
||||||
|
|
||||||
imap.once('error', (err: Error) => {
|
imap.once('error', (err: Error) => {
|
||||||
logError('❌ IMAP error:', err);
|
logError('IMAP error:', err);
|
||||||
logWarn('⚠️ ProtonMail integration disabled due to connection error');
|
logWarn('ProtonMail integration disabled due to connection error');
|
||||||
});
|
});
|
||||||
|
|
||||||
imap.once('end', () => {
|
imap.once('end', () => {
|
||||||
logVerbose('⚠️ IMAP connection ended, reconnecting...');
|
logVerbose('IMAP connection ended, reconnecting...');
|
||||||
setTimeout(() => imap.connect(), 5000);
|
setTimeout(() => imap.connect(), 5000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ export async function finishLink() {
|
||||||
},
|
},
|
||||||
account,
|
account,
|
||||||
);
|
);
|
||||||
logSuccess('✓ Device linked successfully');
|
logSuccess('Device linked successfully');
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,12 +71,12 @@ export async function unlinkDevice() {
|
||||||
currentLinkUri = null;
|
currentLinkUri = null;
|
||||||
|
|
||||||
if (await Bun.file(SIGNAL_CLI_DATA).exists()) {
|
if (await Bun.file(SIGNAL_CLI_DATA).exists()) {
|
||||||
logWarn('⚠ Unlinking device and removing account data...');
|
logWarn('Unlinking device and removing account data...');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await rm(SIGNAL_CLI_DATA, { recursive: true, force: true });
|
await rm(SIGNAL_CLI_DATA, { recursive: true, force: true });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logWarn('❌ Failed to remove account data directory:', error);
|
logWarn('Failed to remove account data directory:', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -131,11 +131,11 @@ export async function startDaemon() {
|
||||||
let authError = false;
|
let authError = false;
|
||||||
let cleaned = false;
|
let cleaned = false;
|
||||||
|
|
||||||
if (await Bun.file(SIGNAL_CLI_SOCKET).exists()) {
|
try {
|
||||||
try {
|
await unlink(SIGNAL_CLI_SOCKET);
|
||||||
await unlink(SIGNAL_CLI_SOCKET);
|
logVerbose('Removed stale socket file');
|
||||||
logVerbose('Removed stale socket file');
|
} catch (error: any) {
|
||||||
} catch (error) {
|
if (error.code !== 'ENOENT') {
|
||||||
logError('Failed to remove stale socket file:', error);
|
logError('Failed to remove stale socket file:', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -158,6 +158,12 @@ export async function startDaemon() {
|
||||||
|
|
||||||
if (trimmed.includes('ConcurrentModificationException')) continue;
|
if (trimmed.includes('ConcurrentModificationException')) continue;
|
||||||
|
|
||||||
|
if (
|
||||||
|
trimmed.includes('Accepted new client connection') ||
|
||||||
|
(trimmed.includes('Connection') && trimmed.includes('closed'))
|
||||||
|
)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (VERBOSE) {
|
if (VERBOSE) {
|
||||||
if (trimmed.includes('ERROR')) {
|
if (trimmed.includes('ERROR')) {
|
||||||
logError('[signal-cli]', trimmed);
|
logError('[signal-cli]', trimmed);
|
||||||
|
|
@ -187,11 +193,11 @@ export async function startDaemon() {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
socket.end();
|
socket.end();
|
||||||
logSuccess('✓ signal-cli daemon started');
|
logSuccess('signal-cli daemon started');
|
||||||
return proc;
|
return proc;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (authError && !cleaned) {
|
if (authError && !cleaned) {
|
||||||
logWarn('⚠ Detected stale account data, cleaning up and retrying...');
|
logWarn(' Detected stale account data, cleaning up and retrying...');
|
||||||
proc.kill();
|
proc.kill();
|
||||||
await unlinkDevice();
|
await unlinkDevice();
|
||||||
cleaned = true;
|
cleaned = true;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<link rel="icon" type="image/png" href="/favicon.png">
|
<link rel="icon" type="image/png" href="/favicon.png">
|
||||||
</head>
|
</head>
|
||||||
<body style="font-family: system-ui; max-width: 600px; margin: 50px auto; padding: 20px;">
|
<body style="font-family: system-ui; max-width: 600px; margin: 50px auto; padding: 20px;">
|
||||||
<h1>✓ Signal Linked</h1>
|
<h1>Signal Linked</h1>
|
||||||
<p>Your Signal account is already linked to this server.</p>
|
<p>Your Signal account is already linked to this server.</p>
|
||||||
|
|
||||||
<details style="margin-top: 20px;">
|
<details style="margin-top: 20px;">
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue