{"id":29894224,"url":"https://github.com/juxt/site","last_synced_at":"2026-03-05T22:08:11.636Z","repository":{"id":37439605,"uuid":"300200809","full_name":"juxt/site","owner":"juxt","description":"A web and API server, powered by xtdb.com","archived":false,"fork":false,"pushed_at":"2024-04-02T13:36:29.000Z","size":106494,"stargazers_count":138,"open_issues_count":9,"forks_count":16,"subscribers_count":36,"default_branch":"master","last_synced_at":"2025-11-05T11:32:18.380Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juxt.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-10-01T08:15:21.000Z","updated_at":"2025-09-09T15:59:43.000Z","dependencies_parsed_at":"2023-12-12T16:48:38.755Z","dependency_job_id":"76b826e1-b63c-45b1-af5c-1cc494b5d912","html_url":"https://github.com/juxt/site","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/juxt/site","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juxt%2Fsite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juxt%2Fsite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juxt%2Fsite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juxt%2Fsite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juxt","download_url":"https://codeload.github.com/juxt/site/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juxt%2Fsite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30152075,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T21:15:50.531Z","status":"ssl_error","status_checked_at":"2026-03-05T21:15:11.173Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2025-08-01T04:45:51.383Z","updated_at":"2026-03-05T22:08:11.611Z","avatar_url":"https://github.com/juxt.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"IMPORTANT: This is the repository for Site 1.0. If you are looking for the latest version (Site 2.0), it is at https://github.com/juxt-site/site.\n\n= Site\n\nimage:https://circleci.com/gh/juxt/site/tree/master.svg?style=svg[\"CircleCI\", link=\"https://circleci.com/gh/juxt/site/tree/master\"]\n\nSite is a project from https://juxt.pro[JUXT] to build a Resource Server out of\nour open-source https://xtdb.com[XTDB] database.\n\nSite supports web content, and https://www.openapis.org/[OpenAPI]. You can use\nSite as a versioned\nhttps://en.wikipedia.org/wiki/Content_management_system[Content Management\nSystem].\n\nAn official (work in progress) documentation website can be found https://juxtsite.netlify.app/[here].\n\nNOTE: A new version of Site is being developed here: https://github.com/juxt-site/site\n\n== What is Site?\n\nSite is a Resource Server, built on the XTDB database.\n\nYou can put things into Site with (HTTP) PUT requests. When you do this, Site\nwill put (the representation of) your thing (document, image, video, data…) into\nthe database. You can get these later with a (HTTP) GET request with the same\nURI. In this way, Site behaves like a web server, with an immutable bitemporal\ncontent store.\n\n=== APIs\n\nIf you PUT a JSON document with a `Content-Type` of\n`application/vnd.oai.openapi+json;version=3.0.2`, Site will treat this as an\nhttps://www.openapis.org/[OpenAPI] API definition, and serve that API for\nyou. This OpenAPI API definition will contain the API endpoints, and provide\nschemas for the data transferred by the API. This tells the server how to\nvalidate data coming in to the API, and how to construct data on the way out.\n\nAPIs served from Site are good web citizens. They implement HTTP method\nsemantics properly, with support for content negotiation, conditional requests,\nrange requests and authentication.\n\nAPIs are also able to benefit from Site's authorization module, Pass, providing\nPolicy-Based Access Control, loosely based on XACML.\n\n== Test drive\n\n=== Requirements\n\nBefore you start, you'll need to have the following installed:\n\n* Java 9+ (Site is not compatible with Java 8 and below!)\n* https://clojure.org/guides/getting_started[Clojure] and\n* https://github.com/babashka/babashka[Babashka] installed on your system.\n\n=== Clone this repo\n\n----\n$ git clone https://github.com/juxt/site\n----\n\n====  macOS (\u003e= 10.15)\nIt is recommended to install `openssl` and `openjdk` and make sure `JAVA_HOME`\nis set correctly. At the time of writing brew installs openjdk 17.02 and openssl\n3.0.1:\n----\n$ brew install openssl\n$ echo export JAVA_HOME=/usr/local/Cellar/openjdk/17.0.2/libexec/openjdk.jdk/Contents/Home \u003e\u003e ~/.zshrc\n$ exec zsh -l\n----\n\nCheck that Java can find `libcrypto`:\n----\n$ cd site # (if needed)\n$ clojure -A:dev -M:test -m kaocha.runner --focus juxt.site.authz-test\n----\n\nThe test should run just fine. If instead $JAVA_HOME/bin/java aborts (signal 6)\nwith the message:\n----\n$ ...\n$ ... WARNING: ${JAVA_HOME}/bin/java is loading libcrypto in an unsafe way\n----\n\nyou need to make libcrypto visible to $JAVA_HOME/bin/java by running e.g.:\n----\n$ ln -s  /usr/local/Cellar/openssl@3/3.0.1/lib/libcrypto.dylib $JAVA_HOME/lib\n----\n\n=== Configure\n\nThere's a sample configuration in `etc` you should copy to `$HOME/.config/site/config.edn`.\n\n----\n$ mkdir -p $HOME/.config/site\n$ cp site/etc/config.edn $HOME/.config/site/config.edn\n----\n\n=== Configure a password\n\n[TIP]\n--\nIf you have `pass` installed, this is a good time to configure a password for\nyour superuser. We'll assume the superuser will be named `admin`, but feel free\nto choose your own username here.\n\n----\n$ pass generate -n site/local/admin\n----\n--\n\n=== Start the server\n\nStart the Site server:\n\n----\n$ site/bin/site-server\n----\n\nNOTE: Alternatively, if you're familiar with Clojure development, you can start\nthe server via the `deps.edn` file and simply 'jack-in' with your editor or IDE\nas normal.\n\n=== Start multiple instances of the server\n\nIf you require multiple Site servers to coexist on the same machine, you can start site passing a different configuration file as follows:\n\n----\n$ SITE_CONFIG=/absolute/path/custom-site-config.edn site/bin/site-server\n----\n\nIn this case please be sure to change the configuration so ports are different and XTDB files are stored in a separate folder than the ones specified in the example configuration file. You'll also need to specify Site host:port when using site commands, for example:\n\n----\n$ SITE_BASE_URI=http://localhost:5509 site/bin/site get-token -u admin\n----\n\n=== Start the server from the provided Docker image\n\nOptionally, you can also get Site up and running using the provided Docker image. You need Docker installed in your system, then execute the following from the command line (`sudo` might not be necessary depending on your installation):\n\n```\nsudo docker build -t juxt/site:latest .\nsudo docker run -p 2021:2021 -p 50505:50505 -d juxt/site:latest\n```\n\n=== The REPL\n\nIf you've run Site via your development environment and 'jacked-in' you'll\nalready have a REPL. Proceed to the next step.\n\nIf you're running Site with `site/bin/site-server`, you'll need to connect a\nterminal to Site to access the REPL. You can do this via port 50505, which is a\nsocket REPL that Site starts by default.\n\nHow you connect to this port is up to you. One way is via `ncat`, but you can replace `ncat` with `telnet`, or `netcat`, depending on what's available for your system.\n\n[NOTE]\n--\nArch users can install `ncat` by installing the `nmap` package:\n\n----\n$ sudo pacman -Sy nmap\n----\n--\n\n----\n$ ncat localhost 50505\n----\n\n[TIP]\n--\nPrefix the command with `rlwrap` if you have it installed.\n\n----\n$ rlwrap ncat localhost 50505\n----\n--\n\n=== Bootstrap\n\nBootstrap the new system by adding the minimum resources that are required to allow remote access.\n\n----\nSite by JUXT. Copyright (c) 2021, JUXT LTD.\nType :repl/quit to exit\n\n[ ]  Site API not installed.  Enter (put-site-api!) to fix this.\n[ ]  Authentication resources not installed.  Enter (put-auth-resources!) to fix this.\n[ ]  Role of superuser not yet created. Enter (put-superuser-role!) to fix this.\n[ ]  No superusers exist. Enter (put-superuser! \u003cusername\u003e \u003cfullname\u003e)\n     or (put-superuser! \u003cusername\u003e \u003cfullname\u003e \u003cpassword\u003e) to fix this.\nsite\u003e\n----\n\nInstall the Site API:\n\n----\nsite\u003e (put-site-api!)\n----\n\nInstall the authentication rules:\n\n----\nsite\u003e (put-auth-resources!)\n----\n\nInstall the superuser role:\n\n----\nsite\u003e (put-superuser-role!)\n----\n\nFinally, create a superuser. If you have `pass` installed, this will fetch the password directly:\n\n----\nsite\u003e (put-superuser! \"admin\" \"Administrator\")\n----\n\nNOTE: We recommend that you generate a password with `pass`.\n\nIf you don't have `pass` installed, you can add a password as a final argument to `put-superuser!`.\n\n----\nsite\u003e (put-superuser! \"admin\" \"Administrator\" \"admin\")\n----\n\nReplace `\"admin\"`, `\"Administrator\"` and `\"admin\"` with your own username, full name and password respectively.\n\nQuit the REPL, for example, with `Ctrl-C` or by typing `:repl/quit`.\n\n=== Run the site tool\n\nThe site tool is a command-line utility that allows you to remotely administer site.\n\nIf you're on MacOS, you will need to install the gnu version of `readlink`. You can do so with brew:\n```\nbrew install coreutils\nln -s /usr/local/bin/greadlink /usr/local/bin/readlink\n```\n\nWe must first get a token that we can use for API access. This process authenticates to the site server using your password.\n\n.Here, replace `admin` with your username (or let it default to your OS username)\n----\n$ site/bin/site get-token -u admin\n----\n\nNow we can use the site tool for remote administration. Try the following:\n\n----\n$ site/bin/site list-users\n----\n\n== Configure the expiry time for tokens\n\nBy default, tokens last for an hour. That can sometimes mean they expire during\nwork sessions. You can set the expiry time of new tokens via the REPL.\n\n----\n(put! (assoc (e \"http://localhost:2021/_site/token\")  ::pass/expires-in (* 24 3600)))\n----\n\n== License\n\nThe MIT License (MIT)\n\nCopyright © 2020-2021 JUXT LTD.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuxt%2Fsite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuxt%2Fsite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuxt%2Fsite/lists"}