misc updates
This commit is contained in:
parent
326051097c
commit
0d6c37d0f8
10
Dockerfile
10
Dockerfile
|
@ -1,15 +1,15 @@
|
||||||
FROM ubuntu:bionic
|
FROM ubuntu:bionic
|
||||||
|
|
||||||
RUN apt-get update && \
|
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
|
ADD . /tmp/code
|
||||||
|
|
||||||
RUN cd /tmp/code && \
|
RUN cd /tmp/code && \
|
||||||
pip3 install -r requirements.txt && \
|
pip3 install -r requirements.txt && \
|
||||||
python3 setup.py install && \
|
python3 setup.py install
|
||||||
useradd repobot
|
|
||||||
|
|
||||||
USER repobot
|
USER artifact
|
||||||
|
|
||||||
ENTRYPOINT ["repobotd"]
|
ENTRYPOINT ["artifactd"]
|
||||||
|
|
|
@ -84,6 +84,7 @@ Todo
|
||||||
|
|
||||||
* CLI tool (for adding packages only)
|
* CLI tool (for adding packages only)
|
||||||
* 'Simple' cli tool (shell script fetchable from the server for adding packages)
|
* 'Simple' cli tool (shell script fetchable from the server for adding packages)
|
||||||
|
* Centralize deleting packages
|
||||||
* Rpm Support
|
* Rpm Support
|
||||||
* Auth
|
* Auth
|
||||||
* Support using existing GPG keys for apt
|
* Support using existing GPG keys for apt
|
||||||
|
@ -100,3 +101,5 @@ Todo
|
||||||
* Standardize what is returned from provider's web_addpkg
|
* Standardize what is returned from provider's web_addpkg
|
||||||
* Standardize some fields of provider's schema (name, version)
|
* Standardize some fields of provider's schema (name, version)
|
||||||
* Delete repos if empty (with option to disable per provider)
|
* 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)
|
raise cherrypy.HTTPError(404)
|
||||||
|
|
||||||
dpath = os.path.join(self.base.basepath, package.blobpath)
|
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)
|
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():
|
def stream():
|
||||||
while True:
|
while True:
|
||||||
data = response["Body"].read(65535)
|
data = response["Body"].read(65535)
|
||||||
|
@ -436,6 +441,9 @@ class AptFiles(object):
|
||||||
return
|
return
|
||||||
yield data
|
yield data
|
||||||
|
|
||||||
|
cherrypy.response.headers["Content-Type"] = "application/x-debian-package"
|
||||||
|
cherrypy.response.headers["Content-Length"] = response["ContentLength"]
|
||||||
|
|
||||||
return stream()
|
return stream()
|
||||||
|
|
||||||
__call__._cp_config = {'response.stream': True}
|
__call__._cp_config = {'response.stream': True}
|
||||||
|
|
3
setup.py
3
setup.py
|
@ -17,7 +17,8 @@ setup(name='repobot',
|
||||||
packages=['repobot'],
|
packages=['repobot'],
|
||||||
entry_points={
|
entry_points={
|
||||||
"console_scripts": [
|
"console_scripts": [
|
||||||
"repobotd = repobot.server:main",
|
"repobotd = repobot.server:main", # legacy
|
||||||
|
"artifactd = repobot.server:main",
|
||||||
"rpcli = repobot.cli:main"
|
"rpcli = repobot.cli:main"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue