{"id":26924978,"url":"https://github.com/abdellaui/free-oracle-cloud-infrastructure-setup","last_synced_at":"2026-05-05T07:32:26.213Z","repository":{"id":285548889,"uuid":"958514965","full_name":"abdellaui/free-oracle-cloud-infrastructure-setup","owner":"abdellaui","description":"[LIVE-DEMO] provides a streamlined and reproducible setup for a free Oracle Cloud Infrastructure (OCI) instance using GitHub CI/CD pipelines. The instance is secured via Cloudflare and features an Nginx reverse proxy for exposing APIs or web services with optional OAuth 2.0 authentication.","archived":false,"fork":false,"pushed_at":"2025-04-01T10:32:18.000Z","size":102,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T11:31:13.267Z","etag":null,"topics":["cicd","cloudflare","infrastructure-management","oauth2","oci","opensource","opensource-projects","oracle","oracle-cloud-infrastructure"],"latest_commit_sha":null,"homepage":"https://kutu.stream/","language":"Shell","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/abdellaui.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}},"created_at":"2025-04-01T10:19:56.000Z","updated_at":"2025-04-01T10:36:20.000Z","dependencies_parsed_at":"2025-04-01T11:41:32.566Z","dependency_job_id":null,"html_url":"https://github.com/abdellaui/free-oracle-cloud-infrastructure-setup","commit_stats":null,"previous_names":["abdellaui/free-oracle-cloud-infrastructure-setup"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abdellaui/free-oracle-cloud-infrastructure-setup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdellaui%2Ffree-oracle-cloud-infrastructure-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdellaui%2Ffree-oracle-cloud-infrastructure-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdellaui%2Ffree-oracle-cloud-infrastructure-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdellaui%2Ffree-oracle-cloud-infrastructure-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abdellaui","download_url":"https://codeload.github.com/abdellaui/free-oracle-cloud-infrastructure-setup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdellaui%2Ffree-oracle-cloud-infrastructure-setup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32640533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cicd","cloudflare","infrastructure-management","oauth2","oci","opensource","opensource-projects","oracle","oracle-cloud-infrastructure"],"created_at":"2025-04-02T02:20:24.410Z","updated_at":"2026-05-05T07:32:26.197Z","avatar_url":"https://github.com/abdellaui.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Free \u0026 Open Source Oracle Cloud Infrastructure (OCI) Instance Setup\n\nThis repository provides a streamlined and reproducible setup for a free Oracle Cloud Infrastructure (OCI) instance using GitHub CI/CD pipelines. The instance is secured via Cloudflare and features an Nginx reverse proxy for exposing APIs or web services with optional OAuth 2.0 authentication. Additionally, RHEL Linux Cockpit enables web-based administration of the instance.\n\n## Prerequisites\nTo use this setup, you will need the following:\n- **Cloudflare Account** (Free Plan)\n- **GitHub Account** (Free Plan)\n- **Oracle Cloud Infrastructure (OCI) Account** (Always Free Resources)\n\n## Architecture\n![Architecture illustration](./docs/architecture.drawio.png)\n\n## Technology Stack\nThis project leverages the following technologies and tools:\n- **[RHEL Linux Cockpit](https://github.com/cockpit-project/cockpit)** – Web-based server administration\n- **[OAuth2-Proxy](https://github.com/oauth2-proxy/oauth2-proxy)** – Reverse proxy with OAuth authentication\n- **[Nginx](https://github.com/nginx/nginx)** – Reverse proxy for web services\n- **[Systemd](https://github.com/systemd/systemd)** – Service and application runtime management\n- **[Qodana](https://github.com/JetBrains/Qodana)** – Static code analysis for CI/CD pipelines\n- **[GitHub Actions](https://github.com/solutions/use-case/ci-cd)** – CI/CD pipeline for deployment\n- **[Oracle Cloud Infrastructure (OCI)](https://www.oracle.com/cloud/)** – Cloud provider\n- **[Cloudflare](https://www.cloudflare.com/)** – DNS management, TLS termination, monitoring, and security\n- **[Bash/Shell Scripting](https://en.wikipedia.org/wiki/Bash_(Unix_shell))** – Automation via CI/CD pipelines\n- **[Python](https://en.wikipedia.org/wiki/Python_(programming_language))** – Sample web service implementation\n\n## Setup Instructions\nTo deploy this infrastructure, follow these steps:\n\n### 1. Configure Your Domain in Cloudflare\n- Ensure your top-level domain (TLD) is correctly set up in Cloudflare.\n\n### 2. Create an OCI Instance\n- Manually create a free-tier instance in OCI.\n- Alternatively, use Terraform to automate this step.\n\n### 3. Clone or Fork the Repository\n- Clone or fork this repository to your GitHub account.\n\n### 4. Adjust Configuration Files\n- **Modify Cloud Init Script:** Update `./src/cloud-init.sh` to match your application's requirements.\n- **Update CI/CD Pipeline:** Modify `./.github/run-ssh.yml` to fit your deployment workflow.\n\n### 5. Set Repository Secrets\nAdd the following secrets to your GitHub repository for `.env` generation:\n\n```\nREPLACE_SECRET_SSH_USER: ${{ secrets.SSH_USER }}\nREPLACE_SECRET_SSH_HOST: ${{ secrets.SSH_HOST }}\nREPLACE_SECRET_PUBLIC_HOST: ${{ secrets.PUBLIC_HOST }}\nREPLACE_SECRET_CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }}\nREPLACE_SECRET_CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}\nREPLACE_SECRET_CLOUDFLARE_RECORD_ID: ${{ secrets.CLOUDFLARE_RECORD_ID }}\nREPLACE_SECRET_COCKPIT_PASSWORD: ${{ secrets.COCKPIT_PASSWORD }}\nREPLACE_SECRET_GITHUB_USER: ${{ secrets.P_GITHUB_USER }}\nREPLACE_SECRET_GITHUB_TOKEN: ${{ secrets.P_GITHUB_TOKEN }}\nREPLACE_SECRET_GITHUB_CLIENT_ID: ${{ secrets.P_GITHUB_CLIENT_ID }}\nREPLACE_SECRET_GITHUB_CLIENT_SECRET: ${{ secrets.P_GITHUB_CLIENT_SECRET }}\nREPLACE_SECRET_GITHUB_COOKIE_SECRET: ${{ secrets.P_GITHUB_COOKIE_SECRET }}\nREPLACE_SECRET_MY_EMAIL_ADDRESS: ${{ secrets.MY_EMAIL_ADDRESS }}\nREPLACE_SECRET_MY_OAUTH_EMAIL_HOST: ${{ secrets.MY_OAUTH_EMAIL_HOST }}\n```\n\n### 6. Execute the GitHub Action Pipeline\n- Trigger a GitHub Action pipeline to deploy your instance.\n\n## Administration Cheat Sheet\n\n### Remove All Service Definitions\n```shell\nsystemctl list-units --all | awk '{print $2}' | grep demo-service | xargs -I{} sudo systemctl stop {}\nsystemctl list-units --all | awk '{print $2}' | grep demo-service | xargs -I{} sudo systemctl disable {}\n\nfind /usr/lib/systemd/system/ -name '*demo-service*' -exec sudo rm -f {} +\nfind /etc/systemd/system/ -name '*demo-service*' -exec sudo rm -f {} +\nsudo systemctl daemon-reload\nsudo systemctl reset-failed\n```\n\n```shell\nsudo systemctl stop demo-service-* \u0026\u0026 \\\nsudo rm -rf /usr/lib/systemd/system/demo-service-* \u0026\u0026 \\\nsudo rm -rf /etc/systemd/system/demo-service-* \u0026\u0026 \\\nsudo systemctl daemon-reload \u0026\u0026 \\\nsudo systemctl reset-failed \u0026\u0026 \\\nsudo journalctl --rotate \u0026\u0026 \\\nsudo journalctl --vacuum-time=1s \u0026\u0026 \\\necho \"Cleanup completed\"\n```\n\n### Manage Service Instances\n**Stop all instances:**\n```shell\nsudo systemctl stop demo-service-*\n```\n**Restart all instances:**\n```shell\nsudo systemctl restart demo-service-*\n```\n**Enable all instances:**\n```shell\nsudo systemctl enable demo-service-*\n```\n**Disable all instances:**\n```shell\nsudo systemctl disable demo-service-*\n```\n\n## Local Development of a Web Service\n\n### 1. Build the Docker Image\n```shell\ndocker build -t demo-microservice .\n```\n\n### 2. Run the Docker Container\n```shell\ndocker run -d \\\n  --name demo-microservice-instance \\\n  -v $(pwd)/.env:/app/.env:ro \\\n  demo-microservice\n```\n\n### Alternative Deployment Without Mounting .env\n```shell\ndocker run -d \\\n  --name demo-microservice-instance \\\n  -e ENVIRONMENT_VARIABLE_NAME=\"your-value\" \\\n  -e APP_VARIABLE_NAME=\"-123456789\" \\\n  -e ENV_USERNAMES=\"user1,user2\" \\\n  demo-microservice\n```\n\n### Debugging Inside the Container\n```shell\ndocker run -it demo-microservice /bin/bash\n```\n```shell\ndocker run -it \\\n  -v $(pwd)/.env:/app/.env:ro \\\n  -v $(pwd)/logs:/app/logs \\\n  -v $(pwd)/records:/app/records \\\n  demo-microservice \\\n  /bin/bash\n```\n\nTo manually run the Python service inside the container:\n```shell\nexport $(cat .env | xargs) \u0026\u0026 LOG_LEVEL=INFO python main.py\n```\n\n## Examples\n- [kutu.stream](https://kutu.stream/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdellaui%2Ffree-oracle-cloud-infrastructure-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdellaui%2Ffree-oracle-cloud-infrastructure-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdellaui%2Ffree-oracle-cloud-infrastructure-setup/lists"}