Skip to content

Commit 28d7864

Browse files
author
Michel Casabianca
committed
Release 1.3.0: Added configuration file
2 parents 02a28e8 + f7876af commit 28d7864

12 files changed

+228
-89
lines changed

Diff for: CHANGELOG.yml

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Semantic changelog: https://github.com/c4s4/changelog
22

3+
- version: 1.3.0
4+
date: 2015-07-29
5+
summary: Added configuration file
6+
added:
7+
- "Added configuration file."
8+
- "Added configuration file sample to run as a service."
9+
removed:
10+
- "No more options on command line (you can only pass the path to
11+
configuration file."
12+
fixed:
13+
- "Added URL path to redirection shop (thus defaults to
14+
*http://pypi.python.org/simple* instead of *http://pypi.python.org*)."
15+
316
- version: 1.2.0
417
date: 2015-07-28
518
summary: Added basic authentication

Diff for: Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ build:
3131
sed -e s/UNKNOWN/$(VERSION)/ $(NAME).go > $(BUILD_DIR)/$(NAME).go
3232
cd $(BUILD_DIR) && go build $(NAME).go
3333

34-
run: build
34+
run: clean build
3535
@echo "$(YELLOW)Run Cheese Shop$(CLEAR)"
36-
$(BUILD_DIR)/$(NAME)
36+
$(BUILD_DIR)/$(NAME) etc/cheeseshop.yml
3737

3838
compile: clean
3939
@echo "$(YELLOW)Generating binaries for all platforms$(CLEAR)"
40-
mkdir -p $(BUILD_DIR)/$(NAME)-$(VERSION)
40+
mkdir -p $(BUILD_DIR)/$(NAME)-$(VERSION)/bin
4141
sed -e s/UNKNOWN/$(VERSION)/ $(NAME).go > $(BUILD_DIR)/$(NAME).go
42-
cd $(BUILD_DIR) && gox -output=$(NAME)-$(VERSION)/$(NAME)-{{.OS}}-{{.Arch}}
42+
cd $(BUILD_DIR) && gox -output=$(NAME)-$(VERSION)/bin/$(NAME)-{{.OS}}-{{.Arch}}
4343

4444
archive: compile
4545
@echo "$(YELLOW)Generating distribution archive$(CLEAR)"
46-
cp LICENSE.txt $(BUILD_DIR)/$(NAME)-$(VERSION)
46+
cp -r LICENSE.txt etc/ $(BUILD_DIR)/$(NAME)-$(VERSION)
4747
md2pdf README.md && mv README.pdf $(BUILD_DIR)/$(NAME)-$(VERSION)
4848
changelog to html style > $(BUILD_DIR)/$(NAME)-$(VERSION)/CHANGELOG.html
4949
cd $(BUILD_DIR) && tar cvf $(NAME)-$(VERSION).tar $(NAME)-$(VERSION)/*

Diff for: README.md

+53-15
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,82 @@ CheeseShop is a Python package repository.
99
Installation
1010
------------
1111

12-
Download binary archive at <https://github.com/c4s4/cheeseshop/releases>, unzip it and copy the binary executable for your platform (named *cheeseshop*) somewhere in yout *PATH* and rename it *cheeseshop*. This executable doesn't need any dependency or virtual machine to run.
12+
Download binary archive at <https://github.com/c4s4/cheeseshop/releases>, unzip it and copy the binary executable for your platform (named *cheeseshop-system-platform* in the *bin* directory) somewhere in yout *PATH* and rename it *cheeseshop*. This executable doesn't need any dependency or virtual machine to run.
1313

1414
There are binaries for following platforms:
1515

1616
- Linux 386, amd64 and arm.
1717
- FreeBSD 386, amd64 and arm.
1818
- NetBSD 386, amd64 and arm.
1919
- OpenBSD 386 and amd64.
20-
- Darwin 386 and amd64.
20+
- Darwin (MacOSX) 386 and amd64.
2121
- Windows 386 and amd64.
22-
- Plan9 386 and amd64.
2322

2423
Usage
2524
-----
2625

27-
To run the server, type on command line :
26+
To run CheeseShop, type on command line:
2827

29-
cheeseshop -port 8000 -path simple -root . -shop http://pypi.python.org
28+
$ cheeseshop
3029

31-
Options on command line :
30+
It will look for a configuration file at following locations:
3231

33-
- *-port* to set the port the server is litening (default to *8000*).
34-
- *-path* to set the URL path (defaults to *simple*).
35-
- *-root* to set the directory where packages are living (defaults to current directory).
36-
- *-shop* to set the URL of the shop for packages that are not found.
37-
- *-auth* to set the path to the authentication file
32+
- *~/.cheeseshop.yml*
33+
- */etc/cheeseshop.yml*
3834

39-
The server outputs logs on the terminal. To get help on the console, type `cheeseshop -help`.
35+
You may also pass the path to the configuration file on the command line:
4036

41-
The authentication file is made of lines with the username and the MD5 sum of the password separated with a space, such as (for user *foo* with password *bar*):
37+
$ cheeseshop /path/to/cheeseshop.yml
4238

43-
foo 37b51d194a7513e45b56f6524f2d51f2
39+
This configuration file should look like this:
40+
41+
# The port CheeseShop is listening
42+
port: 8000
43+
# The URL path
44+
path: simple
45+
# The root directory for packages
46+
root: repo
47+
# Redirection when not found
48+
shop: http://pypi.python.org/simple
49+
# List of users and their MD5 hashed password
50+
# To get MD5 sum for password foo, type 'echo -n foo | md5sum'
51+
# To disable auth when uploading packages, set auth to ~
52+
auth:
53+
spam: acbd18db4cc2f85cedef654fccc4a4d8
54+
eggs: 37b51d194a7513e45b56f6524f2d51f2
4455

4556
To compute MD5 sum for a given password, in order to fill the authentication file, you may type following command :
4657

58+
$ echo -n foo | md5sum
59+
acbd18db4cc2f85cedef654fccc4a4d8 -
4760
$ echo -n bar | md5sum
4861
37b51d194a7513e45b56f6524f2d51f2 -
4962

50-
If no *-auth* option is set on command line, you won't have to authenticate to upload a package to *CheeseShop*.
63+
There is a sample configuration file in *etc* directory of the archive.
64+
65+
Service
66+
-------
67+
68+
To install CheeseShop as a System V service, edit sample init script in *etc/cheeseshop.init* file. You should edit *SCRIPT* variable to set the path to the *cheeseshop* command. Then copy this file as */etc/init.d/cheeseshop*.
69+
70+
You must also edit configuration file *etc/cheeseshop.yml* to set the repository location in the *root* variable. Copy this file in */etc/cheeseshop.yml* location.
71+
72+
You can then start the service with:
73+
74+
$ sudo service cheeseshop start
75+
76+
And stop it with:
77+
78+
$ sudo service cheeseshop stop
79+
80+
You can view the logs in */var/log/cheeseshop.log* file.
81+
82+
To start the service at boot, you should type:
83+
84+
$ sudo update-rc.d cheeseshop defaults
85+
86+
And to disable start at boot:
87+
88+
$ sudo update-rc.d -f cheeseshop remove
5189

5290
*Enjoy!*

0 commit comments

Comments
 (0)