Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next Version #228

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
696 changes: 0 additions & 696 deletions contrib/data/www/web/assets/index-ChP2LRih.js

This file was deleted.

696 changes: 696 additions & 0 deletions contrib/data/www/web/assets/index-hOMdQY-i.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contrib/data/www/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
-->
<link rel="manifest" href="/web/manifest.json" />
<title>TeddyCloud</title>
<script type="module" crossorigin src="/web/assets/index-ChP2LRih.js"></script>
<script type="module" crossorigin src="/web/assets/index-hOMdQY-i.js"></script>
<link rel="stylesheet" crossorigin href="/web/assets/index-BU1Nt4kW.css">
</head>
<body>
Expand Down
2 changes: 2 additions & 0 deletions contrib/data/www/web/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,8 @@
"sourceSetSuccessful": "Quelle auf {{selectedFile}} gesetzt!"
},
"navigationTitle": "Tonies",
"noData": "Keine Tonies/benutzerdefinierten Tags gefunden.",
"noDataText": "Tonies/benutzerdefinierte Tags erscheinen erst, nachdem eine Toniebox eine erfolgreiche Verbindung hergestellt hat und bereits Tonies/benutzerdefinierte Tags auf ihrer SD-Karte hat. Stelle sicher, dass deine Toniebox korrekt verbunden ist und bereits einige Tonies/benutzerdefinierte Tags darauf hat, oder platziere deinen ersten Tonie/benutzerdefinierten Tag auf deiner Toniebox und aktualisiere diese Seite.",
"selectFileModal": {
"cancel": "Abbrechen",
"ok": "OK",
Expand Down
2 changes: 2 additions & 0 deletions contrib/data/www/web/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,8 @@
"sourceSetSuccessful": "Source set to {{selectedFile}}!"
},
"navigationTitle": "Tonies",
"noData": "No Tonies/Custom tags found.",
"noDataText": "Tonies/Custom tags will only appear after a Toniebox has establishing a successful connection and already has Tonies/Custom tags on its SD card. Ensure your Toniebox is connected properly and has some Tonies/Custom tags on it or place your first Tonie/Custom tag on your Toniebox and refresh this site.",
"selectFileModal": {
"cancel": "Cancel",
"ok": "OK",
Expand Down
2 changes: 2 additions & 0 deletions contrib/data/www/web/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,8 @@
"sourceSetSuccessful": "Fuente configurada como {{selectedFile}}."
},
"navigationTitle": "Tonies",
"noData": "No se encontraron Tonies/Tags personalizados.",
"noDataText": "Los Tonies/Tags personalizados solo aparecerán después de que una Toniebox haya establecido una conexión exitosa y ya tenga Tonies/Tags personalizados en su tarjeta SD. Asegúrate de que tu Toniebox esté correctamente conectada y tenga algunos Tonies/Tags personalizados, o coloca tu primer Tonie/Tag personalizado en tu Toniebox y actualiza este sitio.",
"selectFileModal": {
"cancel": "Cancelar",
"ok": "OK",
Expand Down
2 changes: 2 additions & 0 deletions contrib/data/www/web/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,8 @@
"sourceSetSuccessful": "Source définie sur {{selectedFile}} !"
},
"navigationTitle": "Tonies",
"noData": "Aucun Tonies/Tags personnalisés trouvé.",
"noDataText": "Les Tonies/Tags personnalisés n'apparaîtront qu'après qu'une Toniebox ait établi une connexion réussie et ait déjà des Tonies/Tags personnalisés sur sa carte SD. Assure-toi que ta Toniebox est correctement connectée et contient quelques Tonies/Tags personnalisés, ou place ton premier Tonie/Tag personnalisé sur ta Toniebox et rafraîchis cette page.",
"selectFileModal": {
"cancel": "Annuler",
"ok": "OK",
Expand Down
6 changes: 3 additions & 3 deletions contrib/data/www/web/web_version.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"web_version": "vX.X.X",
"web_gitDirty": "0",
"web_gitTag": "undefined",
"web_gitDateTime": "2024-10-26 06:25:22 +0200",
"web_gitSha": "e4d9fc19e493933c2020be2d40ee5de2f07d7eef",
"web_gitDateTime": "2024-10-26 22:06:37 +0200",
"web_gitSha": "96b8844b56a3957d42602cff67c152f649fb3dd5",
"web_gitTagPrefix": "undefined",
"web_gitShortSha": "e4d9fc1",
"web_gitShortSha": "96b8844",
"_eof":""
}
41 changes: 24 additions & 17 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,13 @@ void set_settings(const char *option)
}
}

void exit_cleanup(int exit_code)
{
platform_deinit();
settings_deinit();
exit(exit_code);
}

int_t main(int argc, char *argv[])
{
char cwd[PATH_LEN] = {0};
Expand Down Expand Up @@ -382,28 +389,28 @@ int_t main(int argc, char *argv[])
if (!options.destination)
{
TRACE_ERROR("Missing --destination\r\n");
exit(-1);
exit_cleanup(-1);
}

if (osStrlen(options.generate_client_cert) != 12)
{
TRACE_ERROR("MAC address must be in format 001122334455\r\n");
exit(-1);
exit_cleanup(-1);
}
if (!fsDirExists(options.destination))
{
TRACE_ERROR("Destination directory must exist\r\n");
exit(-1);
exit_cleanup(-1);
}

int_t error = cert_generate_mac(options.generate_client_cert, options.destination);
exit(error);
exit_cleanup(error);
}

if (options.generate_server_certs)
{
int_t error = cert_generate_default();
exit(error);
exit_cleanup(error);
}

if (options.encode)
Expand All @@ -413,12 +420,12 @@ int_t main(int argc, char *argv[])
if (options.multisource_size == 0)
{
TRACE_ERROR("Missing source files\r\n");
exit(-1);
exit_cleanup(-1);
}
else if (options.multisource_size > 99)
{
TRACE_ERROR("Not more than 99 source files allowed!\r\n");
exit(-1);
exit_cleanup(-1);
}

for (size_t i = 0; i < options.multisource_size; i++)
Expand All @@ -444,7 +451,7 @@ int_t main(int argc, char *argv[])
if (!options.hostname)
{
TRACE_ERROR("Missing --hostname\r\n");
exit(-1);
exit_cleanup(-1);
}
if (options.oldrtnlhost)
{
Expand All @@ -460,13 +467,13 @@ int_t main(int argc, char *argv[])
{
error = esp32_fixup(options.esp32_hostpatch, true);
}
exit(error);
exit_cleanup(error);
}

if (options.esp32_fixup)
{
int_t error = esp32_fixup(options.esp32_fixup, true);
exit(error);
exit_cleanup(error);
}

if (options.esp32_inject)
Expand All @@ -477,18 +484,18 @@ int_t main(int argc, char *argv[])
exit(-1);
}
int_t error = esp32_fat_inject(options.esp32_inject, "CERT", options.source);
exit(error);
exit_cleanup(error);
}

if (options.esp32_extract)
{
if (!options.destination)
{
TRACE_ERROR("Missing --destination\r\n");
exit(-1);
exit_cleanup(-1);
}
int_t error = esp32_fat_extract(options.esp32_extract, "CERT", options.destination);
exit(error);
exit_cleanup(error);
}

if (options.url_test)
Expand All @@ -510,7 +517,7 @@ int_t main(int argc, char *argv[])

if (!parse_url(options.url_test, &hostname, &port, &uri, &protocol))
{
exit(EXIT_FAILURE);
exit_cleanup(EXIT_FAILURE);
}

TRACE_WARNING("Hostname: %s\n", hostname);
Expand All @@ -533,7 +540,7 @@ int_t main(int argc, char *argv[])

free(hostname);
free(uri);
exit(error);
exit_cleanup(error);
}

if (options.cloud_test)
Expand All @@ -551,7 +558,7 @@ int_t main(int argc, char *argv[])
tls_init();

int_t error = cloud_request_get(NULL, 0, options.cloud_test, "", (uint8_t *)options.hash, NULL);
exit(error);
exit_cleanup(error);
}

if (options.encode_test)
Expand Down Expand Up @@ -593,7 +600,7 @@ int_t main(int argc, char *argv[])
}
toniefile_close(taf);

exit(1);
exit_cleanup(1);
}

tls_init();
Expand Down
Loading