{"id":30275475,"url":"https://github.com/landscapegeoinformatics/geoserver_config_ex","last_synced_at":"2025-08-16T09:39:10.290Z","repository":{"id":301590177,"uuid":"1000972263","full_name":"LandscapeGeoinformatics/geoserver_config_ex","owner":"LandscapeGeoinformatics","description":"A GeoServer Configuration Elixir Client","archived":false,"fork":false,"pushed_at":"2025-08-12T08:44:09.000Z","size":37,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-12T10:27:06.504Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/LandscapeGeoinformatics.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-06-12T15:52:52.000Z","updated_at":"2025-08-12T08:44:12.000Z","dependencies_parsed_at":"2025-06-27T17:36:52.152Z","dependency_job_id":"384b5085-52cb-4770-afb2-6a73a4d8b1dc","html_url":"https://github.com/LandscapeGeoinformatics/geoserver_config_ex","commit_stats":null,"previous_names":["landscapegeoinformatics/geoserver_config_ex"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LandscapeGeoinformatics/geoserver_config_ex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LandscapeGeoinformatics%2Fgeoserver_config_ex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LandscapeGeoinformatics%2Fgeoserver_config_ex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LandscapeGeoinformatics%2Fgeoserver_config_ex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LandscapeGeoinformatics%2Fgeoserver_config_ex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LandscapeGeoinformatics","download_url":"https://codeload.github.com/LandscapeGeoinformatics/geoserver_config_ex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LandscapeGeoinformatics%2Fgeoserver_config_ex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270695662,"owners_count":24629787,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"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":[],"created_at":"2025-08-16T09:39:08.645Z","updated_at":"2025-08-16T09:39:10.253Z","avatar_url":"https://github.com/LandscapeGeoinformatics.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"```markdown\n# GeoServer Configuration Elixir Client\n\nThis Elixir application provides a convenient way to interact with GeoServer's REST API to manage workspaces, datastores, and coveragestores.\n\n## Prerequisites\n\n- Elixir 1.12+ installed\n- Req HTTP client (included in mix.exs dependencies)\n- GeoServer instance with REST API enabled\n- Valid GeoServer credentials\n\n## Setup\n\n1. Clone the repository\n2. Install dependencies:\n\n   ```bash\n   mix deps.get\n   ```\n3. Set environment variables:\n   ```bash\n   export GEOSERVER_USERNAME=\"your_username\"\n   export GEOSERVER_PASSWORD=\"your_password\"\n   export GEOSERVER_BASE_URL=\"your_geoserver_base_url\"\n   ```\n\n## Workspace Operations\n\n### List All Workspaces\n```elixir\nGeoserverConfig.Workspaces.fetch_workspaces()\n```\n\n### Create a Workspace\n```elixir\nGeoserverConfig.Workspaces.create_workspace(\"new_workspace_name\")\n```\n\n### Update a Workspace (ineffective - renaming is unauthorized)\n```elixir\nGeoserverConfig.Workspaces.update_workspace(\"old_name\", \"new_name\")\n```\n\n### Delete a Workspace\n```elixir\nGeoserverConfig.Workspaces.delete_workspace(\"workspace_to_delete\")\n```\n\n## Datastore Operations\n\n### List Datastores in a Workspace\n```elixir\nGeoserverConfig.Datastores.list_datastores(\"workspace_name\")\n```\n\n### Create Datastore (Shapefile)\n```elixir\nGeoserverConfig.Datastores.create_datastore(\n  \"workspace_name\",\n  \"datastore_name\",\n  \"shapefile\",\n  %{url: \"file:///path/to/shapefile_directory\"}\n)\n```\n\n### Create Datastore (PostGIS)\n```elixir\nGeoserverConfig.Datastores.create_datastore(\n  \"workspace_name\",\n  \"datastore_name\",\n  \"postgis\",\n  %{\n    host: \"localhost\",\n    port: 5432,\n    database: \"db_name\",\n    user: \"db_user\",\n    passwd: \"db_password\"\n  }\n)\n```\n\n### Create Datastore (GeoPackage)\n```elixir\nGeoserverConfig.Datastores.create_datastore(\n  \"workspace_name\",\n  \"datastore_name\",\n  \"geopkg\",\n  %{database: \"file:///path/to/file.gpkg\"}\n)\n```\n\n### Update Datastore\n```elixir\nGeoserverConfig.Datastores.update_datastore(\n  \"workspace_name\",\n  \"old_datastore_name\",\n  \"shapefile\", # or \"postgis\", \"geopkg\"\n  %{\n    description: \"New description\",\n    url: \"file:///new/path\" # or PostGIS/GeoPackage params\n  }\n)\n```\n\n### Delete Datastore\n```elixir\nGeoserverConfig.Datastores.delete_datastore(\n  \"workspace_name\",\n  \"datastore_name\",\n  true # set to false if you don't want recursive delete\n)\n```\n\n## Coveragestore Operations\n\n### List Coveragestores in a Workspace\n```elixir\nGeoserverConfig.Coveragestores.list_coveragestores(\"workspace_name\")\n```\n\n### Create Coveragestore (Local GeoTIFF)\n```elixir\nGeoserverConfig.Coveragestores.create_coveragestore(\n  \"workspace_name\",\n  \"coveragestore_name\",\n  \"file:///path/to/geotiff.tif\",\n  \"Optional description\"\n)\n```\n\n### Create COG GeoTIFF Coverage Store in GeoServer\n```\nGeoserverConfig.Coveragestores.create_coveragestore(\n  \"workspace_name\",\n  \"coveragestore_name\",\n  \"cog://https://path.to/your/cog_geotiff_cog.tif\",\n  \"Description of your coverage store\",\n  %{\n    connectionParameters: \"\",\n    metadata: %{\n      \"entry\" =\u003e %{\n        \"@key\" =\u003e \"CogSettings.Key\",\n        \"cogSettings\" =\u003e %{\n          \"useCachingStream\" =\u003e false,\n          \"rangeReaderSettings\" =\u003e \"HTTP\"\n        }\n      }\n    },\n    disableOnConnFailure: false\n  }\n)\n```\n\n### Update Coveragestore\n```elixir\nGeoserverConfig.Coveragestores.update_coveragestore(\n  \"workspace_name\",\n  \"store_name\",\n  %{\n    type: \"GeoTIFF\",\n    enabled: true,\n    url: \"file:///new/path/to/file.tif\",\n    description: \"Updated description\"\n  }\n)\n```\n\n### Delete Coveragestore\n```elixir\nGeoserverConfig.Coveragestores.delete_coveragestore(\n  \"workspace_name\",\n  \"coveragestore_name\"\n)\n```\n\n## Coverage Layer Operations\n\n### List Coverages\n\n```elixir\nGeoserverConfig.list_coverages(\"workspace_name\", \"coveragestore_name\")\n```\n\n### Create Coverage Layer\n\n```elixir\nGeoserverConfig.Coverages.create_coverage(\n  \"workspace_name\",\n  \"coveragestore_name\",\n  \"coverage_layer_name\",\n  %{\n    title: \"Layer Title\",\n    description: \"Layer Description\",\n    abstract: \"Abstract info\",\n    srs: \"EPSG:3301\",\n    native_crs: \"EPSG:3301\",\n    native_bbox: %{minx: ..., maxx: ..., miny: ..., maxy: ...},\n    latlon_bbox: %{minx: ..., maxx: ..., miny: ..., maxy: ...},\n    grid: %{\n      dimension: [width, height],\n      transform: [scale_x, 0.0, translate_x, 0.0, scale_y, translate_y]\n    },\n    metadata: %{\n      \"cacheAgeMax\" =\u003e 3600,\n      \"cachingEnabled\" =\u003e true\n    }\n  },\n  \"file:///path/to/geotiff.tif\"\n)\n```\n\n### Delete Coverage Layer\n\n```elixir\nGeoserverConfig.delete_coverage(\"workspace_name\", \"coveragestore_name\", \"coverage_layer_name\", \"true\")\n```\n\n## Style Operations\n\n### List All Styles\n```elixir\nGeoserverConfig.list_styles()\n```\n\n### List Workspace Specific Styles\n```elixir\nGeoserverConfig.list_styles_workspace_specific(\"workspace_name\")\n```\n\n### Create Style\n```elixir\nGeoserverConfig.Styles.create_style(%{\n  name: \"style_name\",\n  sld_content: \"\u003cStyledLayerDescriptor\u003e...\u003c/StyledLayerDescriptor\u003e\",\n  filename: \"style.sld\",\n  # Optional: workspace: \"workspace_name\"\n})\n```\n\n### Update Style\n```elixir\nGeoserverConfig.Styles.update_style(%{\n  name: \"style_name\",\n  sld_content: \"\u003cUpdatedSLD\u003e...\u003c/UpdatedSLD\u003e\",\n  filename: \"updated_style.sld\",\n  workspace: \"workspace_name\"\n})\n```\n\n### Delete Style\n```elixir\nGeoserverConfig.delete_style(\"style_name\", \"workspace_name\", recurse: true)\n```\n\n## Assign Style to Layer\n```elixir\nGeoserverConfig.assign_style_to_layer(\n  \"workspace_name\",\n  \"layer_name\",\n  \"style_name\",\n  \"workspace_name\" # style workspace if applicable\n)\n```\n\n\n## Error Handling\n\nAll functions return either:\n- Success tuple `{:ok, message}` for 200/201 responses\n- Error tuple `{:error, reason}` for failures\n\nYou can pattern match on these responses to handle success/failure cases.\n\n## Configuration\n\nThe application uses the following environment variables:\n- `GEOSERVER_USERNAME`: Your GeoServer username\n- `GEOSERVER_PASSWORD`: Your GeoServer password\n- `GEOSERVER_BASE_URL`: Base URL of your GeoServer instance\n\n## Notes\n\n1. For file paths, use `file://` prefix for GeoServer compatibility\n2. When deleting resources, set `recurse=true` to delete all dependent resources\n3. Coverage layer creation requires detailed bounding box and CRS info\n4. Supports both local and cloud-based COG files (cog:// scheme)\n5. Compatible with styles scoped globally or per workspace\n\n## License\n\n[MIT License](LICENSE)\n```\n\nThis README provides:\n1. Clear setup instructions\n2. Comprehensive usage examples for all CRUD operations\n3. Error handling information\n4. Configuration details\n5. Notes about important considerations\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flandscapegeoinformatics%2Fgeoserver_config_ex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flandscapegeoinformatics%2Fgeoserver_config_ex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flandscapegeoinformatics%2Fgeoserver_config_ex/lists"}