Compare commits
6 commits
Author | SHA1 | Date | |
---|---|---|---|
Enrique Barcelli | 559063ac26 | ||
Enrique Barcelli | 713d40a99c | ||
Enrique Barcelli | 4ff0577bd9 | ||
Enrique Barcelli | 79240557a1 | ||
Enrique Barcelli | 15614329c4 | ||
Enrique Barcelli | d20c1f5672 |
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,5 +1,7 @@
|
||||||
# Sensitive files
|
# Sensitive files
|
||||||
config.py
|
config.py
|
||||||
|
*.json
|
||||||
|
*.JSON
|
||||||
|
|
||||||
# ---> Python
|
# ---> Python
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
|
|
132
CODE_OF_CONDUCT.md
Normal file
132
CODE_OF_CONDUCT.md
Normal file
|
@ -0,0 +1,132 @@
|
||||||
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
We as members, contributors, and leaders pledge to make participation in our
|
||||||
|
community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||||
|
identity and expression, level of experience, education, socio-economic status,
|
||||||
|
nationality, personal appearance, race, caste, color, religion, or sexual
|
||||||
|
identity and orientation.
|
||||||
|
|
||||||
|
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||||
|
diverse, inclusive, and healthy community.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to a positive environment for our
|
||||||
|
community include:
|
||||||
|
|
||||||
|
* Demonstrating empathy and kindness toward other people
|
||||||
|
* Being respectful of differing opinions, viewpoints, and experiences
|
||||||
|
* Giving and gracefully accepting constructive feedback
|
||||||
|
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||||
|
and learning from the experience
|
||||||
|
* Focusing on what is best not just for us as individuals, but for the overall
|
||||||
|
community
|
||||||
|
|
||||||
|
Examples of unacceptable behavior include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery, and sexual attention or advances of
|
||||||
|
any kind
|
||||||
|
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing others' private information, such as a physical or email address,
|
||||||
|
without their explicit permission
|
||||||
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
## Enforcement Responsibilities
|
||||||
|
|
||||||
|
Community leaders are responsible for clarifying and enforcing our standards of
|
||||||
|
acceptable behavior and will take appropriate and fair corrective action in
|
||||||
|
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||||
|
or harmful.
|
||||||
|
|
||||||
|
Community leaders have the right and responsibility to remove, edit, or reject
|
||||||
|
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||||
|
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||||
|
decisions when appropriate.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies within all community spaces, and also applies when
|
||||||
|
an individual is officially representing the community in public spaces.
|
||||||
|
Examples of representing our community include using an official email address,
|
||||||
|
posting via an official social media account, or acting as an appointed
|
||||||
|
representative at an online or offline event.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported to the community leaders responsible for enforcement at [kiko@barcelli.net](mailto:kiko@barcelli.net).
|
||||||
|
|
||||||
|
All complaints will be reviewed and investigated promptly and fairly.
|
||||||
|
|
||||||
|
All community leaders are obligated to respect the privacy and security of the
|
||||||
|
reporter of any incident.
|
||||||
|
|
||||||
|
## Enforcement Guidelines
|
||||||
|
|
||||||
|
Community leaders will follow these Community Impact Guidelines in determining
|
||||||
|
the consequences for any action they deem in violation of this Code of Conduct:
|
||||||
|
|
||||||
|
### 1. Correction
|
||||||
|
|
||||||
|
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||||
|
unprofessional or unwelcome in the community.
|
||||||
|
|
||||||
|
**Consequence**: A private, written warning from community leaders, providing
|
||||||
|
clarity around the nature of the violation and an explanation of why the
|
||||||
|
behavior was inappropriate. A public apology may be requested.
|
||||||
|
|
||||||
|
### 2. Warning
|
||||||
|
|
||||||
|
**Community Impact**: A violation through a single incident or series of
|
||||||
|
actions.
|
||||||
|
|
||||||
|
**Consequence**: A warning with consequences for continued behavior. No
|
||||||
|
interaction with the people involved, including unsolicited interaction with
|
||||||
|
those enforcing the Code of Conduct, for a specified period of time. This
|
||||||
|
includes avoiding interactions in community spaces as well as external channels
|
||||||
|
like social media. Violating these terms may lead to a temporary or permanent
|
||||||
|
ban.
|
||||||
|
|
||||||
|
### 3. Temporary Ban
|
||||||
|
|
||||||
|
**Community Impact**: A serious violation of community standards, including
|
||||||
|
sustained inappropriate behavior.
|
||||||
|
|
||||||
|
**Consequence**: A temporary ban from any sort of interaction or public
|
||||||
|
communication with the community for a specified period of time. No public or
|
||||||
|
private interaction with the people involved, including unsolicited interaction
|
||||||
|
with those enforcing the Code of Conduct, is allowed during this period.
|
||||||
|
Violating these terms may lead to a permanent ban.
|
||||||
|
|
||||||
|
### 4. Permanent Ban
|
||||||
|
|
||||||
|
**Community Impact**: Demonstrating a pattern of violation of community
|
||||||
|
standards, including sustained inappropriate behavior, harassment of an
|
||||||
|
individual, or aggression toward or disparagement of classes of individuals.
|
||||||
|
|
||||||
|
**Consequence**: A permanent ban from any sort of public interaction within the
|
||||||
|
community.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||||
|
version 2.1, available at
|
||||||
|
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
||||||
|
|
||||||
|
Community Impact Guidelines were inspired by
|
||||||
|
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
||||||
|
|
||||||
|
For answers to common questions about this code of conduct, see the FAQ at
|
||||||
|
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
||||||
|
[https://www.contributor-covenant.org/translations][translations].
|
||||||
|
|
||||||
|
[homepage]: https://www.contributor-covenant.org
|
||||||
|
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
||||||
|
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||||
|
[FAQ]: https://www.contributor-covenant.org/faq
|
||||||
|
[translations]: https://www.contributor-covenant.org/translations
|
0
JSON files/__init__.py
Normal file
0
JSON files/__init__.py
Normal file
8
JSON files/default_address.json.sample
Normal file
8
JSON files/default_address.json.sample
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"default_delivery_name" : "Lisa Doe",
|
||||||
|
"default_delivery_number" : "87654321",
|
||||||
|
"default_delivery_email" : "",
|
||||||
|
"default_delivery_address" : "2 Orchard Turn, Singapore 238801",
|
||||||
|
"default_delivery_pincode" : "238801",
|
||||||
|
"default_delivery_remark" : ""
|
||||||
|
}
|
|
@ -12,7 +12,10 @@ These Python scripts allow to place, track and delete delivery requests using th
|
||||||
|
|
||||||
* Copy the file `config-sample.py` to `config.py`.
|
* Copy the file `config-sample.py` to `config.py`.
|
||||||
* Edit `config.py` with your credentials and defaults.
|
* Edit `config.py` with your credentials and defaults.
|
||||||
* To place a delivery request, run `python3 req_delivery.py` and follow the instructions of the script.
|
* Inside the folder `JSON files` copy the `default_address.json.sample` to `default_address.json`.
|
||||||
|
* Edit `default_address.json` with your defaults for the delivery address.
|
||||||
|
* Using `default_address.json` as a template, you may create personalised `.json` files for your frequent delivery addresses.
|
||||||
|
* To place a delivery request, run `python3 req_delivery.py <address.json>` and follow the instructions of the script. If you leave the parameter `<address.json>` blank, the script will use the data from `default_address.json`.
|
||||||
* To track the status of a delivery request, run `python3 track.py <track_id>`, where `<track_id>` is the uParcel trucking code of your delivery.
|
* To track the status of a delivery request, run `python3 track.py <track_id>`, where `<track_id>` is the uParcel trucking code of your delivery.
|
||||||
* To cancel a delivery request, run `python3 cancel_delivery.py <order_id>`, where `<order_id>` is the Order ID you provided when you made the request *(note that this is NOT the `<track_id>`)*.
|
* To cancel a delivery request, run `python3 cancel_delivery.py <order_id>`, where `<order_id>` is the Order ID you provided when you made the request *(note that this is NOT the `<track_id>`)*.
|
||||||
|
|
||||||
|
|
16
SECURITY.md
Normal file
16
SECURITY.md
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
| Version | Supported |
|
||||||
|
| ------- | ------------------ |
|
||||||
|
| 0.2.x | :heavy_check_mark: |
|
||||||
|
| 0.1.x | :heavy_check_mark: |
|
||||||
|
|
||||||
|
## Reporting
|
||||||
|
|
||||||
|
We take Security seriously, so if you have discovered a security risk report it by email to [kiko@barcelli.net](mailto:kiko@barcelli.net) preferably using end-to-end encrypted messages with the following PGP key: [0x70c7d0901133471df2e6e9a8006c13a68e25d3b7](https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x70c7d0901133471df2e6e9a8006c13a68e25d3b7).
|
||||||
|
|
||||||
|
Our team will assess and handle it accordingly. Please don't disclose security risks publicly until they have been handled by our team.
|
||||||
|
|
||||||
|
Your email will be acknowledged within 24 hours, and you will receive a more detailed email response about the actions to be taken to handle your report within 1 week.
|
0
__init__.py
Normal file
0
__init__.py
Normal file
|
@ -22,10 +22,4 @@ default_pickup_address = "1 Scotts Road, Singapore 228208"
|
||||||
default_pickup_pincode = "228208"
|
default_pickup_pincode = "228208"
|
||||||
default_pickup_remark = ""
|
default_pickup_remark = ""
|
||||||
default_vehicle = "all"
|
default_vehicle = "all"
|
||||||
default_delivery_name = "Lisa Doe"
|
|
||||||
default_delivery_number = "87654321"
|
|
||||||
default_delivery_email = ""
|
|
||||||
default_delivery_address = "2 Orchard Turn, Singapore 238801"
|
|
||||||
default_delivery_pincode = "238801"
|
|
||||||
default_delivery_remark = ""
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,16 @@ from push import *
|
||||||
import sys
|
import sys
|
||||||
import base64
|
import base64
|
||||||
|
|
||||||
def req_delivery():
|
def req_delivery(address_file='default_address.json'):
|
||||||
|
f = open("JSON files/"+address_file)
|
||||||
|
address = json.load(f)
|
||||||
|
f.close()
|
||||||
|
default_delivery_name = address['default_delivery_name']
|
||||||
|
default_delivery_number = address['default_delivery_number']
|
||||||
|
default_delivery_email = address['default_delivery_email']
|
||||||
|
default_delivery_address = address['default_delivery_address']
|
||||||
|
default_delivery_pincode = address['default_delivery_pincode']
|
||||||
|
default_delivery_remark = address['default_delivery_remark']
|
||||||
order_id = int(input('Enter the Order ID: ') or '1')
|
order_id = int(input('Enter the Order ID: ') or '1')
|
||||||
url = base_url + "api/merchant/auth/"
|
url = base_url + "api/merchant/auth/"
|
||||||
payload = json.dumps({
|
payload = json.dumps({
|
||||||
|
@ -114,6 +123,7 @@ def req_delivery():
|
||||||
"api_response_url": web_hook
|
"api_response_url": web_hook
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
push(json.loads(payload))
|
||||||
response = requests.request("POST", url, headers=headers, data=payload)
|
response = requests.request("POST", url, headers=headers, data=payload)
|
||||||
print(response.text)
|
print(response.text)
|
||||||
push(json.loads(json.dumps({
|
push(json.loads(json.dumps({
|
||||||
|
@ -122,5 +132,8 @@ def req_delivery():
|
||||||
})))
|
})))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
if len(sys.argv) == 1:
|
||||||
req_delivery()
|
req_delivery()
|
||||||
|
else:
|
||||||
|
req_delivery(sys.argv[1])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue