Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Clivern committed Jan 9, 2022
1 parent f36193d commit 6dbeec4
Show file tree
Hide file tree
Showing 74 changed files with 704 additions and 680 deletions.
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
APP_NAME=Winkie
APP_NAME=Cattle
APP_DESCRIPTION=Run and Share Code
APP_KEY=)lj2@3@y&5ofgoekbt2c-4$$w2bedn@-(hr&i^!#%wype&wp6d
APP_DEBUG_MODE=true
APP_URL=https://winkie.sh
APP_URL=https://cattle.sh
APP_EMAIL=[email protected]

CURRENT_THEME=default

DB_CONNECTION=sqlite
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=winkie
DB_DATABASE=cattle
DB_USERNAME=root
DB_PASSWORD=root

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GUNICORN ?= gunicorn

help: Makefile
@echo
@echo " Choose a command run in Winkie:"
@echo " Choose a command run in Cattle:"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<p align="center">
<img alt="Winkie Logo" src="/assets/img/logo.png" height="150" />
<h3 align="center">Winkie</h3>
<img alt="Cattle Logo" src="/assets/img/logo.png" height="150" />
<h3 align="center">Cattle</h3>
<p align="center">A Platform to Run and Share Code.</p>
<p align="center">
<a href="https://github.com/Clivern/Winkie/actions/workflows/ci.yml">
<img src="https://github.com/Clivern/Winkie/actions/workflows/ci.yml/badge.svg"/>
<a href="https://github.com/Clivern/Cattle/actions/workflows/ci.yml">
<img src="https://github.com/Clivern/Cattle/actions/workflows/ci.yml/badge.svg"/>
</a>
</p>
</p>


## Versioning

For transparency into our release cycle and in striving to maintain backward compatibility, Winkie is maintained under the [Semantic Versioning guidelines](https://semver.org/) and release process is predictable and business-friendly.
For transparency into our release cycle and in striving to maintain backward compatibility, Cattle is maintained under the [Semantic Versioning guidelines](https://semver.org/) and release process is predictable and business-friendly.

See the [Releases section of our GitHub project](https://github.com/clivern/winkie/releases) for changelogs for each release version of Winkie. It contains summaries of the most noteworthy changes made in each release. Also see the [Milestones section](https://github.com/clivern/winkie/milestones) for the future roadmap.
See the [Releases section of our GitHub project](https://github.com/clivern/cattle/releases) for changelogs for each release version of Cattle. It contains summaries of the most noteworthy changes made in each release. Also see the [Milestones section](https://github.com/clivern/cattle/milestones) for the future roadmap.

## Bug tracker

If you have any suggestions, bug reports, or annoyances please report them to our issue tracker at https://github.com/clivern/winkie/issues
If you have any suggestions, bug reports, or annoyances please report them to our issue tracker at https://github.com/clivern/cattle/issues


## Security Issues

If you discover a security vulnerability within Winkie, please send an email to [[email protected]](mailto:[email protected])
If you discover a security vulnerability within Cattle, please send an email to [[email protected]](mailto:[email protected])


## Contributing
Expand All @@ -45,6 +45,6 @@ Shoutout to these open source projects and their maintainers.

## License

© 2021, Winkie. Released under [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
© 2021, Cattle. Released under [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).

**Winkie** is authored and maintained by [@Clivern](https://github.com/clivern).
**Cattle** is authored and maintained by [@Clivern](https://github.com/clivern).
10 changes: 5 additions & 5 deletions api_definition.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
openapi: 3.0.1
info:
title: Winkie
title: Cattle
description: 🐺 Platform to Run and Share Code.
contact:
email: [email protected]
license:
name: Apache License 2.0
url: https://github.com/Clivern/Winkie/blob/main/LICENSE
url: https://github.com/Clivern/Cattle/blob/main/LICENSE
version: 0.2.0
externalDocs:
description: Find out more about winkie
url: https://github.com/Clivern/Winkie
description: Find out more about cattle
url: https://github.com/Clivern/Cattle
servers:
- url: https://winkie.sh/
- url: https://cattle.sh/
paths:
/_health:
get:
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/web/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def handler404(request, exception=None, template_name="templates/index.html"):
))

context = {
"title": _("404 | {}").format(get_config("app_name", "Winkie")),
"title": _("404 | {}").format(get_config("app_name", "Cattle")),
"description": get_config("app_description", ""),
"base_url": get_config("app_url", ""),
}
Expand All @@ -51,7 +51,7 @@ def handler500(request, exception=None, template_name="templates/index.html"):
))

context = {
"title": _("500 | {}").format(get_config("app_name", "Winkie")),
"title": _("500 | {}").format(get_config("app_name", "Cattle")),
"description": get_config("app_description", ""),
"base_url": get_config("app_url", ""),
}
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/web/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Home(View, Controller):

def get(self, request):
return render(request, self.template_name, {
"title": get_config("app_name", "Winkie"),
"title": get_config("app_name", "Cattle"),
"description": get_config("app_description", ""),
"base_url": get_config("app_url", ""),
})
2 changes: 1 addition & 1 deletion app/helpers/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def record_metric(metric, count):
return

# Report the metric
metric = "{}/{}".format(get_config("app_name", "Winkie"), metric)
metric = "{}/{}".format(get_config("app_name", "Cattle"), metric)
logger.info("Push metric with key {} and value {}".format(metric, str(count)))

newrelic.agent.record_custom_metric(metric, count, newrelic.agent.application())
2 changes: 1 addition & 1 deletion app/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Django settings for Winkie.
Django settings for Cattle.
Generated by 'django-admin startproject' using Django 3.0.8.
Expand Down
2 changes: 1 addition & 1 deletion deployment/ubuntu/configure/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PYTHON ?= python

help: Makefile
@echo
@echo " Choose a command run in Winkie:"
@echo " Choose a command run in Cattle:"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo
Expand Down
2 changes: 1 addition & 1 deletion deployment/ubuntu/configure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
1. Setup servers

```bash
$ echo "[winkie_server]
$ echo "[cattle_server]
x.x.x.x ansible_connection=ssh ansible_user=root ansible_python_interpreter=/usr/bin/python3" > hosts.prod
```

Expand Down
2 changes: 1 addition & 1 deletion deployment/ubuntu/configure/hosts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[winkie_server]
[cattle_server]
127.0.0.1 ansible_connection=ssh ansible_user=root ansible_python_interpreter=/usr/bin/python3
4 changes: 2 additions & 2 deletions deployment/ubuntu/configure/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

---
- hosts: winkie_server
- hosts: cattle_server

vars_files:
- ./vars/default.yml
Expand Down Expand Up @@ -56,7 +56,7 @@

- name: "app_db_name"
prompt: "Application MySQL Database Name"
default: "winkie"
default: "cattle"
private: no

- name: "app_db_username"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
# app_user: appmgt
# app_group: appmgt
# app_version: 0.1.0
git_repo: https://github.com/Clivern/Winkie.git
git_repo: https://github.com/Clivern/Cattle.git
# newrelic_license_key: xxxx-xxxx-xxxx-xxxx
# workers_counts: 3
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
name: nginx
state: reloaded

- name: reload winkie service
- name: reload cattle service
systemd:
state: restarted
daemon_reload: yes
name: winkie
name: cattle

- name: reload workers service
systemd:
Expand Down
22 changes: 11 additions & 11 deletions deployment/ubuntu/configure/roles/application/tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,17 @@
executable: /bin/bash
tags: [ deploy ]

- name: Create winkie service file
- name: Create cattle service file
template:
src: winkie.service.j2
dest: /etc/systemd/system/winkie.service
src: cattle.service.j2
dest: /etc/systemd/system/cattle.service
mode: "0750"
notify: reload winkie service
notify: reload cattle service
tags: [ deploy ]

- name: Enable and start winkie service
- name: Enable and start cattle service
systemd:
name: winkie
name: cattle
state: started
enabled: yes
tags: [ deploy ]
Expand All @@ -134,21 +134,21 @@
pause:
seconds: 2

- name: restart winkie service
- name: restart cattle service
systemd:
state: restarted
name: winkie
name: cattle
tags: [ deploy ]

- name: Create winkie workers service file
- name: Create cattle workers service file
template:
src: worker.service.j2
dest: /etc/systemd/system/[email protected]
mode: "0750"
notify: reload workers service
tags: [ deploy ]

- name: Enable and start winkie workers service
- name: Enable and start cattle workers service
systemd:
name: worker@{{ item }}
state: started
Expand All @@ -160,7 +160,7 @@
pause:
seconds: 2

- name: restart winkie workers service
- name: restart cattle workers service
systemd:
state: restarted
name: worker@{{ item }}
Expand Down
8 changes: 4 additions & 4 deletions deployment/ubuntu/configure/roles/application/tasks/nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

- name: Create the nginx configuration file
template:
src: winkie.sh.j2
dest: /etc/nginx/sites-available/winkie.sh
src: cattle.sh.j2
dest: /etc/nginx/sites-available/cattle.sh
backup: yes
mode: '0644'
notify: reload nginx
Expand All @@ -37,8 +37,8 @@

- name: Ensure that the application site is enabled
file:
src: /etc/nginx/sites-available/winkie.sh
dest: /etc/nginx/sites-enabled/winkie.sh
src: /etc/nginx/sites-available/cattle.sh
dest: /etc/nginx/sites-enabled/cattle.sh
state: link
notify: reload nginx
tags: [ nginx ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=Gunicorn Instance to Serve Winkie API
Description=Gunicorn Instance to Serve Cattle API
After=network.target

StartLimitIntervalSec=500
Expand All @@ -12,7 +12,7 @@ WorkingDirectory=/srv/app/current
Restart=on-failure
RestartSec=5s
Environment=NEW_RELIC_CONFIG_FILE=/srv/app/current/newrelic.ini
ExecStart=/srv/app/current/venv/bin/newrelic-admin run-program /srv/app/current/venv/bin/gunicorn --workers 3 --bind unix:/run/winkie.sock app.wsgi
ExecStart=/srv/app/current/venv/bin/newrelic-admin run-program /srv/app/current/venv/bin/gunicorn --workers 3 --bind unix:/run/cattle.sock app.wsgi
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
server {
listen 80;
listen [::]:80;
server_name www.winkie.sh;
server_name www.cattle.sh;
set $base /srv/app/current;

location / {
include proxy_params;
proxy_pass http://unix:/run/winkie.sock;
proxy_pass http://unix:/run/cattle.sock;
uwsgi_param Host $host;
uwsgi_param X-Real-IP $remote_addr;
uwsgi_param X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down Expand Up @@ -46,6 +46,6 @@ server {
server {
listen 80;
listen [::]:80;
server_name .winkie.sh;
return 301 http://www.winkie.sh$request_uri;
server_name .cattle.sh;
return 301 http://www.cattle.sh$request_uri;
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
APP_NAME=Winkie
APP_NAME=Cattle
APP_DESCRIPTION=Run and Share Code
APP_KEY={{ app_key }}
APP_DEBUG_MODE=false
APP_URL=https://winkie.sh
APP_URL=https://cattle.sh
[email protected]

CURRENT_THEME=default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ license_key = {{ newrelic_license_key }}
# application as you would like it to show up in New Relic UI.
# The UI will then auto-map instances of your application into a
# entry on your home dashboard page.
app_name = Winkie
app_name = Cattle

# New Relic offers distributed tracing for monitoring and analyzing modern
# distributed systems.Enable distributed tracing.
Expand Down Expand Up @@ -201,7 +201,7 @@ monitor_mode = false
monitor_mode = false

[newrelic:staging]
app_name = Winkie (Staging)
app_name = Cattle (Staging)
monitor_mode = true

[newrelic:production]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=Gunicorn Instance to Run Winkie Worker %i
Description=Gunicorn Instance to Run Cattle Worker %i
After=network.target

StartLimitIntervalSec=500
Expand Down
4 changes: 2 additions & 2 deletions deployment/ubuntu/configure/roles/common/templates/motd.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<[--------------------]>

Server is Managed by Winkie Ansible Playbook
Server is Managed by Cattle Ansible Playbook

* Link: https://github.com/Clivern/Winkie
* Link: https://github.com/Clivern/Cattle
* Version: v0.1.0
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
---
# root_username: root
# root_password: root_R2ZBmTR6nED6a71AxeTO2DSc
# app_db_name: winkie
# app_db_name: cattle
# app_db_username: admin
# app_db_password: secret
# allow_access_from: "127.0.0.1"
4 changes: 2 additions & 2 deletions deployment/ubuntu/configure/roles/logrotate/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ logrotate_scripts:
- create 0644 root www-data
scripts:
postrotate: "/bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true"
- name: winkie
- name: cattle
log_dir: '/srv/app/shared/logs'
log_extension: 'log'
options:
Expand All @@ -37,4 +37,4 @@ logrotate_scripts:
- compress
- create 0644 root www-data
scripts:
postrotate: "systemctl restart winkie.service > /dev/null 2>&1 || true"
postrotate: "systemctl restart cattle.service > /dev/null 2>&1 || true"
Loading

0 comments on commit 6dbeec4

Please sign in to comment.