{"id":29599446,"url":"https://github.com/codenlighten/ubuntu-ai-server","last_synced_at":"2025-07-20T11:07:01.046Z","repository":{"id":295521084,"uuid":"990326964","full_name":"codenlighten/ubuntu-ai-server","owner":"codenlighten","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-26T00:22:42.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-26T01:30:09.749Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/codenlighten.png","metadata":{"files":{"readme":"README.md","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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-26T00:21:07.000Z","updated_at":"2025-05-26T00:22:45.000Z","dependencies_parsed_at":"2025-05-26T01:30:12.327Z","dependency_job_id":"acb57ea5-55b9-4387-8b6d-44ba6d4950a5","html_url":"https://github.com/codenlighten/ubuntu-ai-server","commit_stats":null,"previous_names":["codenlighten/ubuntu-ai-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codenlighten/ubuntu-ai-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenlighten%2Fubuntu-ai-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenlighten%2Fubuntu-ai-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenlighten%2Fubuntu-ai-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenlighten%2Fubuntu-ai-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codenlighten","download_url":"https://codeload.github.com/codenlighten/ubuntu-ai-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenlighten%2Fubuntu-ai-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266112314,"owners_count":23878022,"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":[],"created_at":"2025-07-20T11:07:00.523Z","updated_at":"2025-07-20T11:07:01.025Z","avatar_url":"https://github.com/codenlighten.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Automated Ubuntu Server Setup\n\nThis repository provides a Node.js script (`setup.js`) that automates the provisioning of an Ubuntu server based on a structured JSON specification generated by your AI-driven `StructuredResponseGenerator`.\n\n## Features\n\n* **Profile-based configuration**: Define multiple setup profiles (e.g., `web-node`, `docker-host`, `ci-runner`) and generate tailored JSON specs.\n* **Package installation**: Installs required packages via `apt-get`.\n* **Custom commands**: Executes arbitrary shell commands.\n* **Configuration files**: Creates and writes configuration files at specified paths.\n* **Service management**: Enables and restarts systemd services.\n\n## Prerequisites\n\n* **Ubuntu 20.04+** (or compatible Debian-based distro)\n* **Node.js v18+**\n* **npm**\n* An **OpenAI API key** with access to your `StructuredResponseGenerator` model.\n\n## Installation\n\n1. Clone this repository:\n\n   ```bash\n   git clone \u003cyour-repo-url\u003e\n   cd \u003cyour-repo-directory\u003e\n   ```\n\n2. Install Node.js dependencies:\n\n   ```bash\n   npm install\n   ```\n\n3. Set your OpenAI API key as an environment variable:\n\n   ```bash\n   export OPENAI_API_KEY=\"sk-...\"\n   ```\n\n## Usage\n\n1. Make the setup script executable:\n\n   ```bash\n   chmod +x setup.js\n   ```\n\n2. Run the script with a profile name:\n\n   ```bash\n   ./setup.js --profile web-node\n   ```\n\n   * The script will prompt the `StructuredResponseGenerator` to produce a JSON spec for the given profile.\n   * It will then:\n\n     1. Update `apt-get` and install all listed packages.\n     2. Execute any additional shell commands.\n     3. Write configuration files to their target paths.\n     4. Enable and restart specified services.\n\n## Defining New Profiles\n\nProfiles are defined by passing a different `--profile` argument. Under the hood, the script:\n\n1. Constructs a prompt asking for a JSON spec for that profile\n2. Uses your AI model to generate an object with these keys:\n\n   * `packages: string[]`\n   * `commands: string[]`\n   * `files: { path: string; content: string }[]`\n   * `services: string[]`\n\nYou can modify the prompt schema in `setup.js` to add or remove properties as needed.\n\n## Extending the Script\n\n* **Change prompt**: Adjust the `prompt` variable in `setup.js` for custom instructions.\n* **Add validation**: Integrate JSON schema validation before executing `response` content.\n* **Dry-run mode**: Add a flag to print actions without executing them.\n\n## Contributing\n\n1. Fork the repository.\n2. Create a feature branch: `git checkout -b feature/awesome-profile`.\n3. Commit your changes: `git commit -m \"Add awesome profile schema\"`.\n4. Push to your branch: `git push origin feature/awesome-profile`.\n5. Open a pull request.\n\n## License\n\nThis project is MIT‑licensed. See the [LICENSE](LICENSE) file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodenlighten%2Fubuntu-ai-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodenlighten%2Fubuntu-ai-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodenlighten%2Fubuntu-ai-server/lists"}