Compare commits
	
		
			3 Commits
		
	
	
		
			2610c48a79
			...
			c8d0014a8a
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | c8d0014a8a | ||
|  | f17177cf47 | ||
|  | 849f81fabd | 
| @ -15,4 +15,5 @@ COPY ./main.py ./list.tpl ./ | |||||||
| # I juste wanted to change the socket owner but it turned out I needed to change thu uwsgi user | # I juste wanted to change the socket owner but it turned out I needed to change thu uwsgi user | ||||||
| #CMD uwsgi --exec-asap 'chown $UID:$UID /tmp/uwsgi/ ; mkdir -p $BASE_PATH && chown $UID:$UID $BASE_PATH' -s /tmp/uwsgi/uwsgi.sock --uid $UID --manage-script-name --mount /=server:app | #CMD uwsgi --exec-asap 'chown $UID:$UID /tmp/uwsgi/ ; mkdir -p $BASE_PATH && chown $UID:$UID $BASE_PATH' -s /tmp/uwsgi/uwsgi.sock --uid $UID --manage-script-name --mount /=server:app | ||||||
| # --log-master makes 500 error on 30s timeout for every valid http request | # --log-master makes 500 error on 30s timeout for every valid http request | ||||||
| CMD uwsgi --chown-socket $UID -s /tmp/uwsgi/uwsgi.sock --manage-script-name --mount $MOUNT=main:app --master --hook-master-start "unix_signal:15 gracefully_kill_them_all" --need-app --die-on-term --show-config --log-master | CMD uwsgi --chown-socket $UID -s /tmp/uwsgi/uwsgi.sock --manage-script-name --mount $MOUNT=main:prod_app --http-timeout 10 --master --hook-master-start "unix_signal:15 gracefully_kill_them_all" --need-app --die-on-term --show-config --log-master --strict --vacuum --single-interpreter | ||||||
|  | #--logto /dev/stderr --logto2 /dev/stderr | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| set -e | set -e | ||||||
| version=2.0.1 | version=2.0.1 | ||||||
| docker build -t registry.jean-cloud.net/contact-mailer:latest -t registry.jean-cloud.net/contact-mailer:$version . | docker build -t jeancloud/contact-mailer:latest -t jeancloud/contact-mailer:$version . | ||||||
| docker push registry.jean-cloud.net/contact-mailer:latest | docker push jeancloud/contact-mailer:latest | ||||||
| docker push registry.jean-cloud.net/contact-mailer:$version | docker push jeancloud/contact-mailer:$version | ||||||
|  | |||||||
							
								
								
									
										1
									
								
								main.py
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								main.py
									
									
									
									
									
								
							| @ -37,6 +37,7 @@ app = application = bottle.Bottle(catchall=False) | |||||||
| 
 | 
 | ||||||
| ##################################################### Configuration ############################################$ | ##################################################### Configuration ############################################$ | ||||||
| def get_env(var, default=None): | def get_env(var, default=None): | ||||||
|  |     """var is an env var name, default is the value to return if var does not exist. If no default and no value, an exception is raised.""" | ||||||
|     if var in os.environ: |     if var in os.environ: | ||||||
|         return os.environ[var] |         return os.environ[var] | ||||||
|     elif default is not None: |     elif default is not None: | ||||||
|  | |||||||
							
								
								
									
										11
									
								
								readme.md
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								readme.md
									
									
									
									
									
								
							| @ -66,3 +66,14 @@ ADMIN_PASSWORD=test | |||||||
| UID=1000 | UID=1000 | ||||||
| ``` | ``` | ||||||
| You can store them in a `.env` file. The python app will read it or you can pass it to the docker container with `run` option `--env-file`. | You can store them in a `.env` file. The python app will read it or you can pass it to the docker container with `run` option `--env-file`. | ||||||
|  | 
 | ||||||
|  | ## Roadmap | ||||||
|  | ### Near future | ||||||
|  | - go on docker hub | ||||||
|  | - use a standart logger (used by bottle and uwsgi) to log error on mail fail | ||||||
|  | - [unit tests](https://bottlepy.org/docs/dev/recipes.html#unit-testing-bottle-applications) | ||||||
|  | - add redirection urls to form config | ||||||
|  | 
 | ||||||
|  | ### Ameliorations | ||||||
|  | - Use real user/passwords accounts | ||||||
|  | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user