misc updates
This commit is contained in:
parent
326051097c
commit
0d6c37d0f8
10
Dockerfile
10
Dockerfile
@ -1,15 +1,15 @@
|
||||
FROM ubuntu:bionic
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y python3-pip gpgv1 gnupg1 gpg sudo wget git
|
||||
apt-get install -y python3-pip gpgv1 gnupg1 gpg sudo wget git && \
|
||||
useradd artifactd
|
||||
|
||||
ADD . /tmp/code
|
||||
|
||||
RUN cd /tmp/code && \
|
||||
pip3 install -r requirements.txt && \
|
||||
python3 setup.py install && \
|
||||
useradd repobot
|
||||
python3 setup.py install
|
||||
|
||||
USER repobot
|
||||
USER artifact
|
||||
|
||||
ENTRYPOINT ["repobotd"]
|
||||
ENTRYPOINT ["artifactd"]
|
||||
|
@ -84,6 +84,7 @@ Todo
|
||||
|
||||
* CLI tool (for adding packages only)
|
||||
* 'Simple' cli tool (shell script fetchable from the server for adding packages)
|
||||
* Centralize deleting packages
|
||||
* Rpm Support
|
||||
* Auth
|
||||
* Support using existing GPG keys for apt
|
||||
@ -100,3 +101,5 @@ Todo
|
||||
* Standardize what is returned from provider's web_addpkg
|
||||
* Standardize some fields of provider's schema (name, version)
|
||||
* Delete repos if empty (with option to disable per provider)
|
||||
* Centralize the jinja template environment
|
||||
* need a way for providers to register jinja filters though
|
||||
|
@ -422,13 +422,18 @@ class AptFiles(object):
|
||||
raise cherrypy.HTTPError(404)
|
||||
|
||||
dpath = os.path.join(self.base.basepath, package.blobpath)
|
||||
|
||||
if cherrypy.request.method == "DELETE":
|
||||
db().delete(package)
|
||||
self.base.s3.delete_object(Bucket=self.base.bucket, Key=dpath)
|
||||
db().commit()
|
||||
return
|
||||
|
||||
elif cherrypy.request.method not in ("GET", "HEAD"):
|
||||
raise cherrypy.HTTPError(405)
|
||||
|
||||
response = self.base.s3.get_object(Bucket=self.base.bucket, Key=dpath)
|
||||
|
||||
print("reading ", dpath)
|
||||
|
||||
cherrypy.response.headers["Content-Type"] = "application/x-debian-package"
|
||||
cherrypy.response.headers["Content-Length"] = response["ContentLength"]
|
||||
|
||||
def stream():
|
||||
while True:
|
||||
data = response["Body"].read(65535)
|
||||
@ -436,6 +441,9 @@ class AptFiles(object):
|
||||
return
|
||||
yield data
|
||||
|
||||
cherrypy.response.headers["Content-Type"] = "application/x-debian-package"
|
||||
cherrypy.response.headers["Content-Length"] = response["ContentLength"]
|
||||
|
||||
return stream()
|
||||
|
||||
__call__._cp_config = {'response.stream': True}
|
||||
|
Loading…
Reference in New Issue
Block a user