{"id":20206282,"url":"https://github.com/sleede/openlab-projects","last_synced_at":"2025-04-10T12:33:03.844Z","repository":{"id":15236901,"uuid":"57880286","full_name":"sleede/openlab-projects","owner":"sleede","description":"Connect multiple Fab-managers to share projects documentation","archived":false,"fork":false,"pushed_at":"2023-03-08T23:55:09.000Z","size":191,"stargazers_count":5,"open_issues_count":7,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-24T11:12:55.344Z","etag":null,"topics":["documentation","fablab"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/sleede.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"MIT-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-05-02T09:59:41.000Z","updated_at":"2024-11-23T21:57:57.000Z","dependencies_parsed_at":"2024-11-23T14:16:34.825Z","dependency_job_id":null,"html_url":"https://github.com/sleede/openlab-projects","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sleede%2Fopenlab-projects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sleede%2Fopenlab-projects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sleede%2Fopenlab-projects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sleede%2Fopenlab-projects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sleede","download_url":"https://codeload.github.com/sleede/openlab-projects/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248217124,"owners_count":21066633,"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":["documentation","fablab"],"created_at":"2024-11-14T05:22:45.930Z","updated_at":"2025-04-10T12:33:03.805Z","avatar_url":"https://github.com/sleede.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"## README\n\n## Setup a development environment\n\n1. Install RVM, with the ruby version specified in the [.ruby-version file](../.ruby-version).\n   For more details about the process, please read the [official RVM documentation](http://rvm.io/rvm/install)\n\n2.Install docker and docker-compose.\nYour system may provide a pre-packaged version of docker in its repositories, but this version may be outdated.\nPlease refer to the [official docker documentation](https://docs.docker.com/engine/install/) to set up a recent version of docker.\n\n3. Add your current user to the docker group, to allow using docker without `sudo`.\n\n   ```bash\n   # add the docker group if it doesn't already exist\n   sudo groupadd docker\n   # add the current user to the docker group\n   sudo usermod -aG docker $(whoami)\n   # restart to validate changes\n   sudo reboot\n   ```\n\n4. Retrieve the project from Git\n\n   ```bash\n   git clone https://github.com/sleede/openlab-projects.git\n   ```\n\n\n5. Move into the project directory and install the docker-based dependencies.\n   \u003e ⚠ If you are using Mac OS X, you must *first* edit the docker-compose.yml to use port binding instead of ip-based binding.\n   \u003e This can be achieved by uncommenting the \"port\" directives and commenting the \"networks\" directives in the docker-compose.yml file.\n   \u003e The hosts file must be modified too, accordingly.\n\n   \u003e ⚠ `ERROR: Pool overlaps with other one on this address space`\n   \u003e In this case, you must modify the /etc/hosts and docker-compose.yml files to change the network from 172.19.y.z to 172.x.y.z, where x is a new unused network.\n\n   ```bash\n   cd openlab-projects\n   cd .docker\n   cat hosts | sudo tee -a /etc/hosts\n   docker-compose up -d\n   cd -\n   ```\n\n6. Init the RVM instance and check it's correctly configured\n\n   ```bash\n   rvm current | grep -q `cat .ruby-version`@openlab \u0026\u0026 echo \"ok\"\n   # Must print ok, otherwise try \"rvm use\"\n   ```\n\n7. Install bundler in the current RVM gemset\n\n   ```bash\n   gem install bundler\n   ```\n\n8. Install the required ruby gems\n\n   ```bash\n   bundle install\n   ```\n\n9. Create the default configuration file\n\n   ```bash\n   cp config/database.yml.default config/database.yml\n   ```\n\n10. Build the databases.\n\n\u003e **🛈 Please note**: Your password length must be between 8 and 72 characters, otherwise db:setup will be rejected. This is configured in [config/initializers/devise.rb](config/initializers/devise.rb)\n\n   ```bash\n   ADMIN_EMAIL='youradminemail' ADMIN_PASSWORD='youradminpassword' rails db:setup\n   ```\n\n11. Create the pids folder used by Sidekiq. If you want to use a different location, you can configure it in [config/sidekiq.yml](config/sidekiq.yml)\n\n   ```bash\n   mkdir -p tmp/pids\n   ```\n\n12. Start the development web server\n\n   ```bash\n   foreman s\n   ```\n\n13. You should now be able to access your local development Fab-manager instance by accessing `http://localhost:3300` in your web browser.\n\n14. You can log in as the default administrator using the credentials defined previously.\n\n#### Emails\n\nAccess `http://localhost:3300/letter_opener` to see the emails received. \nThis interface is available only in development.\n\n### prod env\n\nWe use docker-compose to run the app in production.\nSee [docker/README.md](docker/README.md) for more details.\n```bash\nmkdir -p /apps/openlab-projects/config/nginx/ssl\ncd /apps/openlab-projects\ncurl -sSL https://raw.githubusercontent.com/sleede/openlab-projects/dev/docker/docker-compose.yml \u003e docker-compose.yml\ncurl -sSL https://raw.githubusercontent.com/sleede/openlab-projects/dev/docker/env.example \u003e config/env\ncurl -sSL https://raw.githubusercontent.com/sleede/openlab-projects/dev/docker/nginx.conf \u003e config/nginx/nginx.conf\ndocker-compose pull\n```\n\n- Build the certificate with let's encrypt or copy an existing one on the server folder.\n- Change the docker-compose.yml file accordingly to bind the certificate directory to the nginx service.\n- Change the nginx configuration to use the certificate.\n\n```bash\ncurl -sSL https://raw.githubusercontent.com/sleede/openlab-projects/dev/docker/nginx.ssl.conf \u003e config/nginx/nginx.conf\n```\n\n- Restart nginx\n\nIf any asset has changed, recompile them\n```bash \nrm -rf public/assets/\ndocker-compose run --rm openlab-projects bundle exec rake assets:precompile\n```\n\nIf the database has changed (migration) or any other change occurred, run the specific commands like the \"asset precompile\" one (eg. bundle exec rake db:migrate).\n\nFinally, restart the container\n```bash\ndocker-compose down\ndocker-compose up -d\n```\n\n### tests\n\nto run the test suite:\n```bash\nbundle exec rails test\n```\n\n### Migrate from elastic to pg\n\n- go on old server with old app code (with elastic)\n- open rails c\n- run\n```ruby\nFile.write(\"#{Rails.root}/_____CHEMIN____/projects.yml\", YAML.dump(Project.find_each.map(\u0026:attributes)))\n```\n- save the file in some place\n- upgrades openlab app\n- enter in the container\n- create folder data\n- move the projects.yml into /app/data\n- run rails openlab:projects:import_from_yml_dump task\n- open rails console and check that everything is OK\n- remove file","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsleede%2Fopenlab-projects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsleede%2Fopenlab-projects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsleede%2Fopenlab-projects/lists"}