{"id":13571198,"url":"https://github.com/kiranandcode/ocamlot","last_synced_at":"2025-03-16T14:30:45.218Z","repository":{"id":143469753,"uuid":"601220622","full_name":"kiranandcode/ocamlot","owner":"kiranandcode","description":"An Activitypub server in OCaml!","archived":false,"fork":false,"pushed_at":"2023-04-29T06:10:00.000Z","size":2019,"stargazers_count":67,"open_issues_count":3,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-29T14:18:39.103Z","etag":null,"topics":["activitypub","dream","ocaml","social-media","social-network"],"latest_commit_sha":null,"homepage":"https://ocamlot.xyz","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kiranandcode.png","metadata":{"files":{"readme":"README.md","changelog":"history.org","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}},"created_at":"2023-02-13T16:05:54.000Z","updated_at":"2024-08-30T14:08:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"ad440334-2e52-49ad-bc39-0f56ce59ae31","html_url":"https://github.com/kiranandcode/ocamlot","commit_stats":{"total_commits":318,"total_committers":7,"mean_commits":45.42857142857143,"dds":0.289308176100629,"last_synced_commit":"d677ae6b208074660811dc9120e6b90353e7f338"},"previous_names":["kiranandcode/ocamlot","gopiandcode/ocamlot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiranandcode%2Focamlot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiranandcode%2Focamlot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiranandcode%2Focamlot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiranandcode%2Focamlot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiranandcode","download_url":"https://codeload.github.com/kiranandcode/ocamlot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243725633,"owners_count":20337670,"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":["activitypub","dream","ocaml","social-media","social-network"],"created_at":"2024-08-01T14:00:59.745Z","updated_at":"2025-03-16T14:30:44.860Z","avatar_url":"https://github.com/kiranandcode.png","language":"OCaml","funding_links":[],"categories":["OCaml"],"sub_categories":[],"readme":"# OCamlot - An OCaml Activitypub Server\n\nOCamlot is an activitypub server written in OCaml!\n\nAs with most non-mainstream activitypub servers, it's currently in very experimental status!\n\nFeatures:\n\n - Creating posts\n - Replying to posts\n - Custom profiles\n - Liking posts (we call them `toasts`)\n - Reboosting posts (we call them `cheers`)\n - Replying to posts\n\nScreenshot:\n\n![screenshot.png](https://raw.githubusercontent.com/Gopiandcode/ocamlot/master/screenshot.png)\n\nYou can see a running instance of the server at [ocamlot.xyz](https://ocamlot.xyz)!\n\n## Deploying OCamlot\n\nThe rest of this guide will be assuming that you have a server with\nOCaml installed, and nginx, setup with letsencrypt, such that an\nappropriate internal port is accessible via a public domain.\n\nYour nginx config may look something like as follows (using PORT\n`7331` and DOMAIN `ocamlot.xyz`):\n```\nserver {\n    server_name ocamlot.xyz;\n\n    listen 443 ssl; # managed by Certbot\n\n    location / {\n        proxy_pass http://localhost:7331;\n    }\n    ssl_certificate /etc/letsencrypt/live/ocamlot.xyz/fullchain.pem; # managed by Certbot\n    ssl_certificate_key /etc/letsencrypt/live/ocamlot.xyz/privkey.pem; # managed by Certbot\n    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot\n    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot\n}\n\nserver {\n    if ($host = ocamlot.xyz) {\n        return 301 https://$host$request_uri;\n   } # managed by Certbot\n\n   listen 80 default_server;\n   listen [::]:80 default_server;\n\n   return 404; # managed by Certbot\n}\n\n```\n\nTo deploy the server, do the following:\n\n1. Create a new user to run the ocamlot process\n\n```\n$ sudo useradd -r -s /bin/false -m -d /var/lib/ocamlot -U ocamlot\n```\n\n2. Create a new postgres user and database:\n\n```bash\n$ sudo -Hu postgres psql\n\npostgres=# CREATE ROLE ocamlot WITH password = '\u003cpassword\u003e';\nCREATE ROLE\n\npostgres=# ALTER ROLE ocamlot WITH login;\nALTER ROLE\n\npostgres=# CREATE DATABASE ocamlot WITH OWNER ocamlot;\nCREATE DATABASE\n```\n\n3. Clone the development repository:\n\n```\n$ sudo mkdir -p /opt/ocamlot\n$ sudo chown -R ocamlot:ocamlot /opt/ocamlot\n$ sudo -Hu ocamlot git clone https://codeberg.org/gopiandcode/ocamlot /opt/ocamlot\n```\n\n4. Switch user to the ocamlot user:\n\n```\n$ sudo -Hu ocamlot bash\n```\n\n5. Setup opam:\n\n```\n$ opam init\n\n$ eval $(opam env)\n\n$ opam update\n```\n\n6. Install dev dependencies:\n\n```\n$ cd /var/lib/ocamlot\n\n$ git clone https://github.com/gopiandcode/petrol\n\n$ cd ./petrol\n\n$ opam pin .\n```\n\n7. Build the project\n\n```\n$ cd /opt/ocamlot\n\n$ opam update \u0026\u0026 opam install --deps-only .\n\n$ dune build\n```\n\n8. Modify `./scripts/run.sh` with domain and port:\n\n```\n# file: ./scripts/run.sh\n\n#!/bin/bash\n/opt/ocamlot/_build/default/bin/main.exe -u 'ocamlot:\u003cpassword\u003e@localhost:5432' -d \"ocamlot.xyz\" -p 7331 -D\n```\n\n9. Create an account via the web UI, with username `\u003cusername\u003e`\n\n10. Promote user `\u003cusername\u003e` to admin\n\n```\n/opt/ocamlot/_build/default/bin/main.exe -u 'ocamlot:\u003cpassword\u003e@localhost:5432' -d \"ocamlot.xyz\" --promote-to-admin=\u003cusername\u003e\n```\n\n11. Copy over `./scripts/ocamlot.service` to `etc/systemd/system/ocamlot.service`:\n\n```\nsudo cp /opt/ocamlot/scripts/ocamlot.service /etc/systemd/system/ocamlot.service\n```\n12. Enable and start `ocamlot.service`:\n\n```\nsudo systemctl enable --now ocamlot.service\n```\n\n## Development Setup\n\nTo develop OCamlot locally, we provide a docker-compose file for\nsetting up a network with a running OCamlot (port 7331) and pleroma\n(port 4000) instance. The two containers are connected through a\nnetwork in which the OCamlot server can be found under the domain name\n`testing.ocamlot.xyz` and the Pleroma server can be found under the\ndomain name `pleroma.ocamlot.xyz`. (Note: because there is no easy way\nof updating the CA store that elixir uses, you will need to patch your\nlocal copy of pleroma to disable certification verification for\ninteraction between the two containers to work).\n\n*You will need docker-compose and docker*\n\n1. Clone a copy of pleroma to the `tests/integration_test/` directory:\n\n```bash\ngit clone -b  v2.5.0 --single-branch https://git.pleroma.social/pleroma/pleroma ./tests/integration_tests/pleroma\n```\n\n2. Apply patch to pleroma to disable TLS validation (required for local testing)\n\n```bash\n(cd ./tests/integration_tests/pleroma \u0026\u0026 git apply ../pleroma.patch)\n```\n\n3. Change directory into the `tests/integration_test/` directory:\n\n```bash\ncd ./tests/integration_tests/\n```\n\n4. Run `docker-compose build` with the local docker-compose file:\n\n```bash\ndocker-compose -f ./docker-compose.local.yml build\n```\n\n5. Run `docker-compose up` with the local docker-compose file:\n\n```bash\ndocker-compose -f ./docker-compose.local.yml up\n```\nNow pleroma will be available at `https://localhost:4000` and ocamlot at `https://localhost:7331`\n\n6. (optional), if you want to update the OCamlot server after making some changes locally, do the following:\n\n   - 6.1. Find out the name of the OCamlot server container using `docker container list`\n   - 6.2. Attach to the OCamlot container using `docker container exec -it \u003ccontainer-id\u003e bash`\n   - 6.3. Kill the running OCamlot process using `pkill -9 main.exe`\n   - 6.4. Run `eval $(opam env)`, then `dune build` then `dune exec -- ./bin/main.exe -d testing.ocamlot.xyz -D`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiranandcode%2Focamlot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiranandcode%2Focamlot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiranandcode%2Focamlot/lists"}