{"id":21697422,"url":"https://github.com/figome/festung","last_synced_at":"2026-05-19T02:55:46.673Z","repository":{"id":140256308,"uuid":"57376939","full_name":"figome/festung","owner":"figome","description":"Remote multi-db SQLCipher Server","archived":false,"fork":false,"pushed_at":"2018-12-18T11:14:18.000Z","size":204,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":19,"default_branch":"develop","last_synced_at":"2025-01-25T14:23:07.956Z","etag":null,"topics":["haskell","sqlcipher"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/figome.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-29T10:32:40.000Z","updated_at":"2019-03-12T16:07:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"42be16f4-37ee-44ac-b456-72519c6dc175","html_url":"https://github.com/figome/festung","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/figome%2Ffestung","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/figome%2Ffestung/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/figome%2Ffestung/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/figome%2Ffestung/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/figome","download_url":"https://codeload.github.com/figome/festung/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244637099,"owners_count":20485446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["haskell","sqlcipher"],"created_at":"2024-11-25T19:27:44.315Z","updated_at":"2026-05-19T02:55:46.644Z","avatar_url":"https://github.com/figome.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Festung\n\nRemote multi-db SQLCipher server exposing a REST API\n\n![](https://upload.wikimedia.org/wikipedia/commons/c/c1/SenjNehajgrad0.jpg)\n\n## Build\n\nThe `festung` container is built with the help of an auxiliary container called `steinmetz`.\nThe `steinmetz` container gathers and compiles all build dependencies, so that build process\nof `festung` itself is faster. You can build both containers by invoking `make` with no\ntarget.\n\n```sh\n$ make\n```\n\n## Run\n\nTo spin up a festung instance do\n\n```sh\n$ docker run --rm --tty --interactive --publish 127.0.0.1:2728:2728 --name festung festung\n```\n\nor just do\n\n```sh\n$ make start\n```\n\nIf you want to persist the vaults between multiple runs, you either have to mount a directory\nfrom the host system or create a docker volume. The latter could be done by doing\n\n```sh\n$ docker volume create vaults\n```\n\nand then run festung like so\n\n```sh\n$ docker run --rm -it -p 127.0.0.1:2728:2728 --mount source=vaults,target=/var/festung --name festung festung\n```\n\n## Interact\n\nOnce you have a festung instance running you can interact with the API by using `curl`, `httpie` or an\nHTTP client of your choice.\n\nThe databases that are handled by festung are encrypted. The key is provided through the Authorization\nheader whose value is base64 encoded\n\n```sh\n$ echo foo | base64\nZm9vCg==\n```\n\nThe request body for issuing queries against festung contains the fields `sql` and `params`. To create a\nnew table `foo` in the database `1` (encrypted with the password `\"foo\"`) you can issue the following \nrequest:\n\n```json\n# http localhost:2728/1 Authorization:Zm9vCg== sql='CREATE TABLE foo (id INT, b VARCHAR)' params:='[]'\n{\n    \"data\": [],\n    \"headers\": [],\n    \"last_row_id\": 0,\n    \"rows_changed\": 0\n}\n```\n\nThe `params` paramter can be used for parametrizing queries. Let's say we insterted some data in our\ntable\n\n```json\n# http localhost:2728/1 Authorization:Zm9vCg== sql='INSERT INTO foo VALUES (1, \"b\")' params:='[]'\n{\n    \"data\": [],\n    \"headers\": [],\n    \"last_row_id\": 0,\n    \"rows_changed\": 0\n}\n```\n\nthen we could use `params` as follows:\n\n```json\n# http localhost:2728/1 Authorization:Zm9vCg== sql='SELECT * FROM foo WHERE id IN (?)' params:='[1]'\n{\n    \"data\": [\n        [\n            1,\n            \"b\"\n        ]\n    ],\n    \"headers\": [\n        {\n            \"name\": \"id\",\n            \"type\": \"INT\"\n        },\n        {\n            \"name\": \"b\",\n            \"type\": \"VARCHAR\"\n        }\n    ],\n    \"last_row_id\": 0,\n    \"rows_changed\": -1\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffigome%2Ffestung","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffigome%2Ffestung","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffigome%2Ffestung/lists"}