6 Commits

Author SHA1 Message Date
37e1c5d97b core: Use crypto_generichash. We don't need to roll our own FNV32a.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 36m37s
2025-06-25 21:10:05 -04:00
cef526bcf3 ssb: Fix the tab cycling order.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 37m34s
2025-06-25 20:23:01 -04:00
6af36cafa9 ssb: Wait, I don't think we need to close any connections here.
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled
2025-06-25 20:10:22 -04:00
fca859d93d ssb: Are we inadvertantly closing connections when an inner tunnel request ends?
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled
2025-06-25 20:00:44 -04:00
2178300d8d welcome: +PeachCloud.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 36m44s
2025-06-25 18:49:43 -04:00
636bdcce6b build: Start work on 0.0.33. nix => 0.0.32.
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled
2025-06-25 18:34:59 -04:00
16 changed files with 42 additions and 47 deletions

View File

@ -16,9 +16,9 @@ MAKEFLAGS += --no-builtin-rules
## LD := Linker.
## ANDROID_SDK := Path to the Android SDK.
VERSION_CODE := 38
VERSION_CODE_IOS := 14
VERSION_NUMBER := 0.0.32
VERSION_CODE := 39
VERSION_CODE_IOS := 15
VERSION_NUMBER := 0.0.33-wip
VERSION_NAME := This program kills fascists.
IPHONEOS_VERSION_MIN=14.0
@ -650,6 +650,7 @@ SODIUM_SOURCES := \
deps/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/core_hsalsa20_ref2.c \
deps/libsodium/src/libsodium/crypto_core/salsa/ref/core_salsa_ref.c \
deps/libsodium/src/libsodium/crypto_core/softaes/softaes.c \
deps/libsodium/src/libsodium/crypto_generichash/crypto_generichash.c \
deps/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ref.c \
deps/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c \
deps/libsodium/src/libsodium/crypto_generichash/blake2b/ref/generichash_blake2b.c \

View File

@ -1,5 +1,5 @@
{
"type": "tildefriends-app",
"emoji": "🦀",
"previous": "&Rn4Eg5ev5qhrYRnwxPB0DiEwO7VdGMDGp7tL/W7bRZo=.sha256"
"previous": "&fVXd+mdbqIz9h7nKYnoFkCyfOKDeCUaAJG2/i7h/5hs=.sha256"
}

View File

@ -131,8 +131,8 @@ class TfElement extends LitElement {
let channel_names = [
'',
'@',
'🔐',
'👍',
'🔐',
...this.channels.map((x) => '#' + x),
];
let index = channel_names.indexOf(this.hash.substring(1));

View File

@ -1,5 +1,5 @@
{
"type": "tildefriends-app",
"emoji": "👋",
"previous": "&fY3YUKPuH/wqOgKPVNJu1vWEHCXf5fToL2qiVXMRmxc=.sha256"
"previous": "&3puDxDNnf6C+YXpFysYLgxFMAy54/AO9V7Xpja6qO/k=.sha256"
}

View File

@ -76,7 +76,7 @@
<h2>First-time user checklist:</h2>
<ol type="1" style="text-align: left">
<li>
<a href="https://dev.tildefriends.net/cory/tildefriends/releases"
<a href="https://dev.tildefriends.net/cory/tildefriends/releases/latest"
>Download</a
>
Tilde Friends or use
@ -84,7 +84,7 @@
>https://www.tildefriends.net/</a
>.
<div class="w3-cell-row">
<div class="w3-container w3-cell">
<div class="w3-container w3-cell w3-mobile">
<h3>Mobile</h3>
<p>
<a
@ -113,7 +113,7 @@
</p>
<p>Just launch the app.</p>
</div>
<div class="w3-container w3-cell">
<div class="w3-container w3-cell w3-mobile">
<h3>Web</h3>
<p>
<a
@ -128,8 +128,19 @@
>
to take it for a spin right away.
</p>
<h3>PeachCloud</h3>
<p>
Tilde Friends is also a part of 🍑☁️<a
href="https://peach-docs.commoninternet.net/"
>PeachCloud</a
>, which is available on
<a href="https://apps.yunohost.org/app/peachpub"
>YunoHost</a
>
for accessible self-hosting.
</p>
</div>
<div class="w3-container w3-cell">
<div class="w3-container w3-cell w3-mobile">
<h3>Desktop</h3>
<p>
<a

View File

@ -25,14 +25,14 @@
}:
pkgs.stdenv.mkDerivation rec {
pname = "tildefriends";
version = "0.0.31";
version = "0.0.32";
src = pkgs.fetchFromGitea {
domain = "dev.tildefriends.net";
owner = "cory";
repo = "tildefriends";
rev = "v${version}";
hash = "sha256-c2ZKVNikI5jN5GQuvp7S53qqnRZniSrJMF1FUZdVNPI=";
hash = "sha256-Dk0NOEQIg2LeENySK0+MgpZEtfsClGq6dZL+eOOpE0U=";
fetchSubmodules = true;
};

8
flake.lock generated
View File

@ -20,16 +20,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1748037224,
"narHash": "sha256-92vihpZr6dwEMV6g98M5kHZIttrWahb9iRPBm1atcPk=",
"lastModified": 1750622754,
"narHash": "sha256-kMhs+YzV4vPGfuTpD3mwzibWUE6jotw5Al2wczI0Pv8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f09dede81861f3a83f7f06641ead34f02f37597f",
"rev": "c7ab75210cb8cb16ddd8f290755d9558edde7ee1",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.11",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}

View File

@ -2,7 +2,7 @@
description = "Tilde Friends is a platform for making, running, and sharing web applications.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
flake-utils.url = "github:numtide/flake-utils";
};

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.unprompted.tildefriends"
android:versionCode="38"
android:versionName="0.0.32">
android:versionCode="39"
android:versionName="0.0.33-wip">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application

View File

@ -13,13 +13,13 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.0.32</string>
<string>0.0.33</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>iPhoneOS</string>
</array>
<key>CFBundleVersion</key>
<string>14</string>
<string>15</string>
<key>DTPlatformName</key>
<string>iphoneos</string>
<key>LSRequiresIPhoneOS</key>

View File

@ -3,6 +3,7 @@
#include "util.js.h"
#include "quickjs.h"
#include "sodium/crypto_generichash.h"
#include "sqlite3.h"
#include "uv.h"
@ -154,11 +155,11 @@ static void _tf_mem_summarize(void* ptr, size_t size, int frames_count, void* co
{
summary_t* summary = user_data;
tf_mem_allocation_t allocation = {
.stack_hash = tf_util_fnv32a(frames, sizeof(void*) * frames_count, 0),
.count = 1,
.size = size,
.frames_count = frames_count,
};
crypto_generichash((void*)&allocation.stack_hash, sizeof(allocation.stack_hash), (const void*)frames, sizeof(void*) * frames_count, NULL, 0);
memcpy(allocation.frames, frames, sizeof(void*) * frames_count);
int index = tf_util_insert_index(&allocation, summary->allocations, summary->count, sizeof(tf_mem_allocation_t), _tf_mem_hash_stack_compare);

View File

@ -332,8 +332,6 @@ static void _tf_ssb_rpc_tunnel_callback(tf_ssb_connection_t* connection, uint8_t
JS_FreeValue(context, stack_val);
JS_FreeValue(context, message_val);
tf_ssb_connection_close(tun->connection, buffer);
}
else
{

View File

@ -22,6 +22,7 @@
#include "ares.h"
#include "backtrace.h"
#include "quickjs.h"
#include "sodium/crypto_generichash.h"
#include "sqlite3.h"
#include "unzip.h"
#include "uv.h"
@ -1255,6 +1256,8 @@ static void _tf_task_free_promise(tf_task_t* task, promiseid_t id)
JSValue tf_task_allocate_promise(tf_task_t* task, promiseid_t* out_promise)
{
uint32_t stack_hash = 0;
crypto_generichash_state state;
crypto_generichash_init(&state, NULL, 0, sizeof(stack_hash));
if (task->_promise_stack_debug)
{
JSValue error = JS_ThrowInternalError(task->_context, "promise callstack");
@ -1262,16 +1265,17 @@ JSValue tf_task_allocate_promise(tf_task_t* task, promiseid_t* out_promise)
JSValue stack_value = JS_GetPropertyStr(task->_context, exception, "stack");
size_t length = 0;
const char* stack = JS_ToCStringLen(task->_context, &length, stack_value);
stack_hash = tf_util_fnv32a((const void*)stack, (int)length, 0);
crypto_generichash_update(&state, (const void*)stack, (int)length);
void* buffer[31];
int count = tf_util_backtrace(buffer, sizeof(buffer) / sizeof(*buffer));
stack_hash = tf_util_fnv32a((const void*)buffer, sizeof(void*) * count, stack_hash);
crypto_generichash_update(&state, (const void*)buffer, sizeof(void*) * count);
_add_promise_stack(task, stack_hash, stack, buffer, count);
JS_FreeCString(task->_context, stack);
JS_FreeValue(task->_context, stack_value);
JS_FreeValue(task->_context, exception);
JS_FreeValue(task->_context, error);
}
crypto_generichash_final(&state, (void*)&stack_hash, sizeof(stack_hash));
promiseid_t promise_id;
do

View File

@ -691,17 +691,6 @@ bool tf_util_is_mobile()
return TF_IS_MOBILE != 0;
}
uint32_t tf_util_fnv32a(const void* buffer, int length, uint32_t start)
{
uint32_t result = 0x811c9dc5;
for (int i = 0; i < length; i++)
{
result ^= ((const uint8_t*)buffer)[i];
result += (result << 1) + (result << 4) + (result << 7) + (result << 8) + (result << 24);
}
return result;
}
size_t tf_string_set(char* buffer, size_t size, const char* string)
{
size_t length = string ? strlen(string) : 0;

View File

@ -224,15 +224,6 @@ void tf_util_document_settings(const char* line_prefix);
*/
bool tf_util_is_mobile();
/**
** Compute a 32-bit hash of a buffer.
** @param buffer The data.
** @param length The size of the buffer in bytes.
** @param start The hash seed.
** @return The computed hash.
*/
uint32_t tf_util_fnv32a(const void* buffer, int length, uint32_t start);
/**
** Populate a string buffer, truncating if necessary.
** @param buffer The buffer.

View File

@ -1,2 +1,2 @@
#define VERSION_NUMBER "0.0.32"
#define VERSION_NUMBER "0.0.33-wip"
#define VERSION_NAME "This program kills fascists."