Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
name: Bug Report
about: Report a bug or unexpected behaviour in Jasmin Web Panel
title: "[BUG] "
labels: ["bug", "needs-triage"]
assignees: []
---

## Bug Description

A clear and concise description of the bug.

## Steps to Reproduce

1. Go to '...'
2. Click on '...'
3. Observe '...'

## Expected Behaviour

What did you expect to happen?

## Actual Behaviour

What actually happened?

## Screenshots / Logs

If applicable, add screenshots or paste relevant log output here.

```
Paste logs here
```

## Environment

| Item | Value |
|------|-------|
| OS | e.g., Ubuntu 22.04 |
| Python version | e.g., 3.11.9 |
| Jasmin Web Panel version | e.g., 3.0.3 |
| Jasmin SMS Gateway version | e.g., 0.10.8 |
| Deployment method | Docker / Manual |
| Database | PostgreSQL 15 / MySQL 8.0 |
| Browser (if UI issue) | e.g., Chrome 124 |

## Additional Context

Any other context about the problem (e.g., specific Jasmin configuration, network setup).

## Checklist

- [ ] I have searched existing issues and this is not a duplicate
- [ ] I have provided sufficient information to reproduce the bug
- [ ] I am using a [supported version](../SECURITY.md#supported-versions)
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Feature Request
about: Suggest a new feature or enhancement for Jasmin Web Panel
title: "[FEATURE] "
labels: ["enhancement"]
assignees: []
---

## Feature Summary

A clear and concise description of the feature you'd like to see.

## Problem / Motivation

What problem does this feature solve? What use case does it enable?

_Example: "I'm always frustrated when I have to manually filter submit logs because there's no way to..."_

## Proposed Solution

Describe how you envision this feature working. Include UI mockups, API designs, or configuration examples if applicable.

## Alternatives Considered

Have you considered any alternative approaches or workarounds? Why is this the preferred solution?

## Additional Context

Any other context, screenshots, or examples that help explain the feature.

## Checklist

- [ ] I have searched existing issues and this feature has not been requested before
- [ ] This feature is relevant to the Jasmin Web Panel project scope
- [ ] I am willing to help implement this feature (optional)
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Question / Support
about: Ask a question or get help with your Jasmin Web Panel setup
title: "[QUESTION] "
labels: ["question"]
assignees: []
---

## Question

What would you like to know or get help with?

## Context

Please provide as much relevant context as possible:

- Your deployment setup (Docker / manual)
- Relevant configuration (redact sensitive values)
- What you have already tried

## Environment

| Item | Value |
|------|-------|
| OS | e.g., Ubuntu 22.04 |
| Jasmin Web Panel version | e.g., 3.0.3 |
| Deployment method | Docker / Manual |

> 💡 **Tip:** For real-time help, join our Telegram community: [https://t.me/jasminwebpanel](https://t.me/jasminwebpanel)
52 changes: 52 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
## Description

<!-- Describe your changes clearly. What does this PR do? Why? -->

Closes #<!-- issue number -->

## Type of Change

- [ ] 🐛 Bug fix (non-breaking change that fixes an issue)
- [ ] ✨ New feature (non-breaking change that adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to change)
- [ ] 📚 Documentation update
- [ ] 🔧 Maintenance / chore (dependency updates, refactoring, CI changes)
- [ ] 🔒 Security fix

## Changes Made

<!-- List the key changes made in this PR -->

-
-
-

## Testing

<!-- Describe the tests you ran and how to reproduce them -->

- [ ] I have added tests for my changes
- [ ] All existing tests pass (`make test`)
- [ ] I have manually tested the changes

**Test configuration:**

| Item | Value |
|------|-------|
| Python version | |
| Database | |
| Deployment | Docker / Manual |

## Screenshots (if applicable)

<!-- Add screenshots for UI changes -->

## Checklist

- [ ] My code follows the project's [coding standards](../CONTRIBUTING.md#coding-standards)
- [ ] I have performed a self-review of my code
- [ ] I have added/updated comments for complex logic
- [ ] I have updated documentation as needed
- [ ] The CHANGELOG has been updated (for user-facing changes)
- [ ] No sensitive data (passwords, API keys) is included in the code
- [ ] I have read the [Contributing Guide](../CONTRIBUTING.md)
98 changes: 98 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: CI

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip

- name: Install linting tools
run: |
pip install --upgrade pip wheel uv
uv pip install --system -r pyproject.toml --extra=dev

- name: Run ruff
run: ruff check main/ config/ tests/ --select E,W,F --ignore E501

test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]

env:
DJANGO_SETTINGS_MODULE: config.settings.dev
SECRET_KEY: ci-test-secret-key-not-for-production
DEVDB_URL: sqlite:///test_db.sqlite3
SUBMIT_LOG: "False"
ALLOWED_HOSTS: "*"

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Install dependencies
run: |
pip install --upgrade pip wheel uv
uv pip install --system -r pyproject.toml --extra=dev

- name: Copy sample env
run: cp sample.env .env

- name: Run migrations
run: python manage.py migrate --run-syncdb

- name: Run tests
run: pytest tests/ -v --tb=short

docker-build:
name: Docker Build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
file: config/docker/slim/Dockerfile
push: false
tags: jasmin-web-panel:test
cache-from: type=gha
cache-to: type=gha,mode=max
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Change history

## Unreleased

Changes

1. **Open Source Enhancements**
- Added `CONTRIBUTING.md` with detailed contributor guide
- Added `SECURITY.md` with security policy and responsible disclosure process
- Added `CODE_OF_CONDUCT.md` (Contributor Covenant 2.1)
- Added GitHub issue templates (bug report, feature request, question)
- Added GitHub pull request template
- Added GitHub Actions CI workflow alongside existing Travis CI configuration
2. **Testing Infrastructure**
- Added `pytest` and `pytest-django` as dev dependencies
- Added initial test suite covering core utilities, models, web views, and REST API
- Tests run without requiring Redis or a live Jasmin gateway (use LocMemCache in tests)
3. **API Security**
- Added configurable rate limiting to the REST API (`API_THROTTLE_ANON`, `API_THROTTLE_USER`)
- Rate limits configurable via environment variables
4. **Bug Fixes**
- Fixed `UserAgentMiddleware` crash when `HTTP_USER_AGENT` header is absent
- Fixed `user_agent.py` module-level cache initialization to use lazy evaluation, respecting runtime settings overrides (benefits testing and deployments that reconfigure the cache)

## 3.0.1
Changes
1. JavaScript fixes
Expand Down
77 changes: 77 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# 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 e-mail 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 [tarek.it.eng@gmail.com](mailto:tarek.it.eng@gmail.com). 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](https://www.contributor-covenant.org), version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html).

Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).

For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are available at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations).
Loading