Commit Graph

8960 Commits

Author SHA1 Message Date
Girish Ramakrishnan 8c28871b76 typo 2024-12-14 23:25:14 +01:00
Girish Ramakrishnan 83adcd73a9 sqlite3: images.base is gone 2024-12-14 21:40:47 +01:00
Girish Ramakrishnan 8e6890b4d6 docker: rework image pruning
with our new retagging approach, the Digest ID remains <null> because
this is only set by docker if truly fetched from the registry.

this means that redis container always gets removed...
2024-12-14 20:47:35 +01:00
Girish Ramakrishnan bd107e849b infra: no more images.base 2024-12-14 20:18:07 +01:00
Girish Ramakrishnan 5893f53b43 typo 2024-12-14 19:05:32 +01:00
Girish Ramakrishnan 96b715de8e apptask: try install via ipv4
our ci app images are not pushed to quay and the tests fail on
ipv6 servers
2024-12-14 18:55:55 +01:00
Girish Ramakrishnan 6b7edbd552 docker: fallback to quay if docker hub does not work 2024-12-14 15:22:12 +01:00
Girish Ramakrishnan 12f19299a8 docker: only send credentials when registry matches 2024-12-14 14:21:15 +01:00
Girish Ramakrishnan 0008e5a83b docker: parse registry also 2024-12-14 14:10:29 +01:00
Girish Ramakrishnan 0bd1aac0ef refactor 2024-12-14 14:05:53 +01:00
Girish Ramakrishnan 5145344987 docker: do not use auth for cloudron namespace 2024-12-14 14:04:40 +01:00
Girish Ramakrishnan cc980fbc0c add note on manifest id 2024-12-14 14:02:49 +01:00
Girish Ramakrishnan 5ce82d6794 docker: parseImageRef 2024-12-14 14:00:05 +01:00
Girish Ramakrishnan d456f91921 tasks: fix active status 2024-12-12 19:09:55 +01:00
Girish Ramakrishnan 3be77fc634 fix link 2024-12-12 15:21:05 +01:00
Johannes Zellner 8d3b9685a1 Update postgres addon version 2024-12-12 12:01:57 +01:00
Girish Ramakrishnan be340580d4 various notification fixes 2024-12-11 23:58:17 +01:00
Girish Ramakrishnan f59837f7c3 spurious console 2024-12-11 22:44:04 +01:00
Girish Ramakrishnan d0d0913c70 notifications: add context field 2024-12-11 22:29:00 +01:00
Girish Ramakrishnan 701c25d07a notifications: add back app down and app oom mails 2024-12-11 20:56:15 +01:00
Girish Ramakrishnan 8fd9324048 Fix crash 2024-12-11 19:17:44 +01:00
Girish Ramakrishnan 6004cd17bf notifications: per user email prefs 2024-12-11 19:12:20 +01:00
Girish Ramakrishnan 746e694d7e notifications: rename alert to pin and unpin 2024-12-11 17:31:32 +01:00
Girish Ramakrishnan ead419003b notifications: rename ALERT_ to TYPE_ 2024-12-11 15:29:20 +01:00
Girish Ramakrishnan 6141db8f34 Update ubuntu check to bionic 2024-12-11 15:03:59 +01:00
Girish Ramakrishnan 96f2c6e2aa archive: add button to download the config 2024-12-11 09:50:54 +01:00
Girish Ramakrishnan 65f507bc75 clone: read custom icon from downloaded backup
the backups table does not have icon to save space. only the
archives table has it for the moment.
2024-12-10 22:47:21 +01:00
Girish Ramakrishnan 05d6484d27 clone: label should be from dolly 2024-12-10 21:07:59 +01:00
Girish Ramakrishnan 41bc08a07e backup: move appConfig to backups table
this is useful for clone also to copy notes, operators, checklist
of the time when the backup was made (as opposed to current)

at this point, it's not clear why we need a archives table. it's
an optimization to not have to store icon for every backup.
2024-12-10 21:04:37 +01:00
Girish Ramakrishnan 41b302b0b9 apps: unarchive can call add() on it's own
all this because the sso flag is not allowed with optionalSso :/
2024-12-10 19:09:29 +01:00
Girish Ramakrishnan fbe334e7d7 install/unarchive: add support for various fields 2024-12-10 18:39:16 +01:00
Girish Ramakrishnan 9a155491cb move unarchive to apps model 2024-12-10 17:19:12 +01:00
Girish Ramakrishnan ab8ec07f2f clone/unarchive: handle notes and checklist 2024-12-10 17:16:06 +01:00
Girish Ramakrishnan 3e1c886b17 clone: copy devices 2024-12-10 16:49:25 +01:00
Girish Ramakrishnan 21c3d16db5 archive: proxy app cannot be archived 2024-12-10 16:49:25 +01:00
Girish Ramakrishnan 0e181cdc82 archive: implement unarchive
made a separate route instead of reusing install route. this was
because we want to copy over all the old app config as much as
possible.
2024-12-10 16:49:19 +01:00
Girish Ramakrishnan 30b0d4cced archives: add listing 2024-12-10 12:30:10 +01:00
Girish Ramakrishnan f973536f7f archives: add eventlog 2024-12-10 11:10:35 +01:00
Girish Ramakrishnan 490840b71d archives: use separate table
Cleaner to separate things from the backups table.

* icon, appConfig, appStoreIcon etc are only valid for archives
* older version cloudron does not have appConfig in backups table (so it
  cannot be an archive entry)
2024-12-10 10:36:44 +01:00
Girish Ramakrishnan 2ad93c114e archive: add appConfig, icon and appStoreIcon 2024-12-09 23:25:31 +01:00
Girish Ramakrishnan 9200e6fc63 add archives api 2024-12-09 22:39:28 +01:00
Girish Ramakrishnan 710bd270d7 apps: add archive action 2024-12-09 18:51:49 +01:00
Girish Ramakrishnan 147e014205 backup: add archive flag 2024-12-09 16:25:31 +01:00
Girish Ramakrishnan 65a7f5f1c6 Use subarray instead of slice
says it's deprecated
2024-12-09 16:14:49 +01:00
Girish Ramakrishnan cfc3a4217d platform: mark apps early
this gives some UI feedback when the platform is starting
2024-12-09 15:04:14 +01:00
Girish Ramakrishnan 35be854997 apptaskmanager: do not schedule tasks until infra ready 2024-12-09 14:46:03 +01:00
Johannes Zellner 58af890abe Do not crash on assert if backup task failed 2024-12-09 13:09:51 +01:00
Girish Ramakrishnan cc759a8427 Add waiting for lock message 2024-12-09 08:40:54 +01:00
Girish Ramakrishnan bb392207ea remove global lock
Currently, the update/apptask/fullbackup/platformstart take a
global lock and cannot run in parallel. This causes situations
where when a user tries to trigger an apptask, it says "waiting for
backup to finish..." etc

The solution is to let them run in parallel. We need a lock at the
app level as app operations running in parallel would be bad (tm).
In addition, the update task needs a lock just for the update part.
We also need multi-process locks. Running tasks as processes is core
to our "kill" strategy.

Various inter process locks were explored:

* node's IPC mechanism with process.send(). But this only works for direct node.js
children. taskworker is run via sudo and the IPC does not work.

* File lock using O_EXCL. Basic ideas to create lock files. While file creation
can be done atomically, it becomes complicated to clean up lock files when
the tasks crash. We need a way to know what locks were held by the crashing task.
flock and friends are not built-into node.js

* sqlite/redis were options but introduce additional deps

* Settled on MySQL based locking. Initial plan was to have row locks
or table locks. Each row is a kind of lock. While implementing, it was found that
we need many types of locks (and not just update lock and app locks). For example,
we need locks for each task type, so that only one task type is active at a time.

* Instead of rows, we can just lock table and have a json blob in it. This hit a road
block that LOCK TABLE is per session and our db layer cannot handle this easily! i.e
when issing two db.query() it might use two different connections from the pool. We have to
expose the connection, release connection etc.

* Next idea was atomic blob update of the blob checking if old blob was same. This approach,
was finally refined into a version field.

Phew!
2024-12-07 20:41:22 +01:00
Johannes Zellner 146afce934 Improve devices error handling 2024-12-06 13:35:52 +01:00