diff --git a/.gitignore b/.gitignore index 7dd1c1b..3f4a225 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ target *.dat log/* +config/* diff --git a/config/application.yaml b/config/application.yaml deleted file mode 100644 index 54b497b..0000000 --- a/config/application.yaml +++ /dev/null @@ -1,135 +0,0 @@ -# -# Copyright (C) 2011-2022 Red Hat, Inc. (https://github.com/Commonjava/indy-repository-service) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -quarkus: - http: - port: 8080 - read-timeout: 30m - limits: - max-body-size: 500m - resteasy: - gzip: - enabled: true - max-input: 64M - keycloak: - policy-enforcer: - enable: false - oidc: - enabled: true - auth-server-url: "https://localhost:8543/realms/indyreposervice" - client-id: indy - credentials: - secret: secret - tls: - verification: none - token: - issuer: any - opentelemetry: - enabled: true - tracer: - sampler: - ratio: 0.05 - exporter: - otlp: - endpoint: http://localhost:4317 - headers: - - "header1=value1" - "resource-attributes": - - "service.name=indy-repository-service" - - "sample.rate=0.05" - - # Logging (disable console on prod) - log: - level: DEBUG - min-level: TRACE - category: - "org.jboss": - level: WARN - "org.apache.kafka": - level: WARN - "io.quarkus": - level: WARN -# min-level: DEBUG - "io.undertow": - level: WARN - "io.vertx": - level: WARN - "io.smallrye": - level: WARN - "org.eclipse": - level: WARN - "io.netty": - level: WARN - "io.grpc": - level: WARN - "org.infinispan": - level: WARN - "com.datastax": - level: INFO - "io.agroal": - level: WARN - "io.opentelemetry": - level: TRACE - "org.commonjava.indy.service": - level: INFO - min-level: DEBUG - console: - enable: true - level: DEBUG - file: - enable: true - level: DEBUG - path: "log/indy-repository-service.log" - format: "%d{HH:mm:ss} %-5p [%c{2.}] (%t) %s%e%n" - rotation: - max-backup-index: 5 - max-file-size: 10M - - swagger-ui: - always-include: true - -indy_security: - enabled: True - security_bindings_yaml: config/security-bindings.yaml - -repository: - data-storage: cassandra - affectedGroupsExclude: "^build-.+|^g-.+-build-.+" - -kafka: - bootstrap: - servers: "localhost:9092" - -mp: - messaging: - emitter: - # the default buffer size for emitter's OnOverflow buffer strategy of back-pressure control - default-buffer-size: 1024 - outgoing: - store-event: - connector: "smallrye-kafka" - topics: "store-event" - value: - serializer: "io.quarkus.kafka.client.serialization.ObjectMapperSerializer" - -cassandra: - enabled: true - host: localhost - port: 9042 - user: cassandra - pass: cassandra - keyspace: indyreposervice - keyspaceReplicas: 1 diff --git a/config/security-bindings.yaml b/config/security-bindings.yaml deleted file mode 100644 index de81c9b..0000000 --- a/config/security-bindings.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# -# Copyright (C) 2011-2022 Red Hat, Inc. (https://github.com/Commonjava/indy-repository-service) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -constraints: - - role: admin - urlPattern: "/api/admin/.*" - methods: - - POST - - PUT - - DELETE - - role: user - urlPattern: "/api/.*" - methods: - - POST - - PUT - - DELETE - - role: power-user - urlPattern: "/api/admin/stores/.*" - methods: - - POST - - PUT - - DELETE diff --git a/src/main/java/org/commonjava/indy/service/repository/jaxrs/RepositoryMaintenanceResources.java b/src/main/java/org/commonjava/indy/service/repository/jaxrs/RepositoryMaintenanceResources.java index 88c49f1..b107089 100644 --- a/src/main/java/org/commonjava/indy/service/repository/jaxrs/RepositoryMaintenanceResources.java +++ b/src/main/java/org/commonjava/indy/service/repository/jaxrs/RepositoryMaintenanceResources.java @@ -77,6 +77,8 @@ public Response getRepoBundle() } } + @Operation( description = "Import a ZIP-compressed file containing repository definitions into the repository management database." ) + @APIResponse( responseCode = "200", description = "All repository definitions which are imported successfully." ) @POST @Path( "/import" ) @Consumes( MEDIATYPE_APPLICATION_ZIP ) diff --git a/src/main/java/org/commonjava/indy/service/repository/model/ArtifactStore.java b/src/main/java/org/commonjava/indy/service/repository/model/ArtifactStore.java index 48efc3c..2375d7b 100644 --- a/src/main/java/org/commonjava/indy/service/repository/model/ArtifactStore.java +++ b/src/main/java/org/commonjava/indy/service/repository/model/ArtifactStore.java @@ -64,8 +64,6 @@ public abstract class ArtifactStore public static final String TRACKING_ID = "trackingId"; - // @ApiModelProperty( required = true, dataType = "string", - // value = "Serialized store key, of the form: '[hosted|group|remote]:name'" ) private StoreKey key; private String description; @@ -77,8 +75,6 @@ public abstract class ArtifactStore private boolean disabled; - // @ApiModelProperty( required = false, dataType = "int", - // value = "Integer time in seconds which is used for repo automatically re-enable when set disable by errors, positive value means time in seconds, -1 means never disable, empty or 0 means use default timeout." ) @JsonProperty( "disable_timeout" ) private int disableTimeout; diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 03075d1..5ac5d7e 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -1,9 +1,25 @@ +# +# Copyright (C) 2011-2022 Red Hat, Inc. (https://github.com/Commonjava/indy-repository-service) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + quarkus: http: port: 8080 read-timeout: 30m limits: - max-body-size: 500M + max-body-size: 500m package: type: uber-jar application: @@ -22,6 +38,8 @@ quarkus: security: auth: enabled-in-dev-mode: false + opentelemetry: + enabled: true log: level: INFO min-level: TRACE @@ -56,8 +74,19 @@ quarkus: max-file-size: 10M swagger-ui: always-include: true - opentelemetry: - enabled: false + +indy_security: + enabled: True + +repository: + data-storage: mem + affectedGroupsExclude: "^build-.+|^g-.+-build-.+" + query: + cache: + enabled: false + +cassandra: + enabled: false kafka: bootstrap: @@ -75,18 +104,6 @@ mp: value: serializer: "io.quarkus.kafka.client.serialization.ObjectMapperSerializer" -repository: - data-storage: cassandra - affectedGroupsExclude: "^build-.+|^g-.+-build-.+" - query: - cache: - enabled: false - -cassandra: - enabled: false - -indy_security: - enabled: True "%dev": quarkus: @@ -127,6 +144,3 @@ indy_security: ispn: configDir: /tmp - - cassandra: - enabled: false diff --git a/src/main/resources/security-bindings.yaml b/src/main/resources/security-bindings.yaml index 1b6548d..de81c9b 100644 --- a/src/main/resources/security-bindings.yaml +++ b/src/main/resources/security-bindings.yaml @@ -1,3 +1,19 @@ +# +# Copyright (C) 2011-2022 Red Hat, Inc. (https://github.com/Commonjava/indy-repository-service) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + constraints: - role: admin urlPattern: "/api/admin/.*"