Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
homebase-calendar-sync
Advanced tools
A simple web scraper that reads gethomebase.com's schedule and updates Google Calendar.
* 1. [Prerequisites](#Prerequisites)
* 2. [Google API Setup](#GoogleAPISetup)
* 3. [Installation](#Installation)
* 3.1. [Using pip](#Usingpip)
* 3.2. [From Source](#FromSource)
* 4. [Configuration](#Configuration)
* 5. [Running the Tool](#RunningtheTool)
* 5.1. [Command Line](#CommandLine)
* 5.2. [Using Docker](#UsingDocker)
setup.sh
)
homebase_calendar_sync --help
usage: homebase_calendar_sync [-h] [--version] [--import-secret [IMPORT_SECRET]] [--reset-remote] [--reset-db] [--reset-events]
[--reset-auth] [--reset-local] [--reset-all]
Homebase/Google Calendar Sync CLI
options:
-h, --help show this help message and exit
--version print package version to console.
--import-secret [IMPORT_SECRET]
Path to 'client_secret.json'
--reset-remote Remove all homebase events from Google Calendar for current user and calendar
--reset-db reset the events database
--reset-events reset both local and remote events
--reset-auth reset the authentication cache
--reset-local reset local files and configuration
--reset-all reset auth config and events database
Before you begin, ensure you have the following installed on your machine:
Create a New Google Developer Project:
Activate the Google Calendar API:
Create an OAuth Consent Screen:
Create OAuth 2.0 Client IDs:
client_secret.json
file and save it in your working directory.pip install homebase_calendar_sync
Alternatively, you can install the tool from the source code. Follow these steps:
Clone the repository (optional):
git clone https://github.com/your-username/homebase_calendar_sync.git
cd homebase_calendar_sync
Install the dependencies:
pip install .
Before running the tool, you need to configure it. The configuration file should include your Google API credentials and Homebase login details.
Create a configuration file:
Create a .env
file in your working directory with the necessary configurations.
touch .env
.env
CC_HOMEBASE_USERNAME = ""
CC_HOMEBASE_PASSWORD = ""
CC_HOMEBASE_EMPLOYEE_FIRSTNAME = ""
CC_HOMEBASE_EMPLOYEE_LASTNAME = ""
CC_HOMEBASE_START_DATE = "today"
CC_HOMEBASE_END_DATE = "today"
CC_HOMEBASE_DAYS_LOOKAHEAD = "14"
CC_HOMEBASE_LOOKAHEAD = "True"
CC_HOMEBASE_TIMEZONE = "America/Chicago"
You can run the tool in two ways: directly via command line or using Docker.
Run the tool:
homebase_calendar_sync
Dockerfile
and docker-compose.yml
are deployment versions and install via pip install homebase
. Docker is not used for development, use the venv
module instead.Build the Docker image:
docker build -t homebase_calendar_sync .
Run the Docker container:
docker-compose up
This guide provides instructions to deploy the homebase_calendar_sync
project using Docker. Ensure you have Docker and Docker Compose installed on your machine.
Before you begin, ensure you have the following:
.env
, .homebase_calendar_sync
, and .homebase_calendar_sync_meta
files from the Google OAuth setup.Create the working directory: Create a directory on your remote machine where you will place the necessary files and run the Docker container.
mkdir -p ~/homebase_calendar_sync_deployment
cd ~/homebase_calendar_sync_deployment
Transfer the necessary files:
Copy the .env
, .homebase_calendar_sync
, and .homebase_calendar_sync_meta
files from your local machine (where you completed the Google OAuth flow) to the remote machine's working directory.
scp /path/to/.env user@remote_machine:~/homebase_calendar_sync_deployment/
scp /path/to/.homebase_calendar_sync user@remote_machine:~/homebase_calendar_sync_deployment/
scp /path/to/.homebase_calendar_sync_meta user@remote_machine:~/homebase_calendar_sync_deployment/
Verify the directory structure: Ensure your working directory on the remote machine contains the necessary files:
tree ~/homebase_calendar_sync_deployment
The output should look something like this:
~/homebase_calendar_sync_deployment
├── .env
├── .homebase_calendar_sync
└── .homebase_calendar_sync_meta
Create the Dockerfile:
Create a Dockerfile
in the working directory with the following content:
FROM python:3.12.3-alpine
ENV PYTHONUNBUFFERED=1
WORKDIR /app
RUN apk add --no-cache gcc musl-dev libffi-dev
RUN pip install --upgrade pip
RUN pip install --no-cache-dir homebase_calendar_sync
CMD homebase_calendar_sync
Create the docker-compose.yml file:
Create a docker-compose.yml
file in the working directory with the following content:
version: '3'
services:
homebase_calendar_sync:
build: .
volumes:
- .:/app
Build the Docker image: Navigate to the working directory and build the Docker image.
docker-compose build
Run the Docker container: Start the Docker container using Docker Compose.
docker-compose up
Once the Docker container is running, you can verify that the homebase_calendar_sync
tool is working correctly by checking the logs or running commands inside the container.
Check the logs: View the logs of the running container to ensure there are no errors.
docker-compose logs -f
Run commands inside the container: Open a shell inside the running container to run additional commands or checks.
docker-compose exec homebase_calendar_sync sh
By following these steps, you have set up and deployed the homebase_calendar_sync
project using Docker. Ensure your .env
, .homebase_calendar_sync
, and .homebase_calendar_sync_meta
files are correctly placed in the working directory for the tool to function properly. You can now manage and synchronize your Homebase and Google Calendar events seamlessly.
This guide provides instructions for developers to set up and manage the homebase_calendar_sync
project.
Ensure you have the following installed on your system:
The project structure is as follows:
.
├── Dockerfile
├── README.md
├── docker-compose.yml
├── events.db
├── pyproject.toml
├── setup.sh
└── src
└── homebase_calendar_sync
├── __init__.py
├── __main__.py
├── config.py
├── db
│ ├── __init__.py
│ ├── __main__.py
│ └── models.py
├── google_client
│ ├── __init__.py
│ ├── __main__.py
│ ├── auth.py
│ ├── drive_types.py
│ └── google_client.py
└── homebase_calendar_sync.py
setup.sh
)The setup.sh
script is used for setting up the development environment, building the project, and testing deployments. Below are the different commands available in the script.
Run the script with the appropriate argument to perform the desired action. For example:
./setup.sh dev
dev
: Set up the development environment.
./setup.sh dev
build
: Build the project using build
and twine
.
./setup.sh build
pypi
: Build the project and upload it to PyPI.
./setup.sh pypi
testpypi
: Build the project and upload it to TestPyPI.
./setup.sh testpypi
testpypi_install
: Set up a test environment, install the project from TestPyPI, run tests, and then destroy the environment.
./setup.sh testpypi_install
pypi_install
: Set up a test environment, install the project from PyPI, run tests, and then destroy the environment.
./setup.sh pypi_install
pypi_pre_docker
: Prepare the environment for Docker, install the project from PyPI, run tests, and then destroy the environment.
./setup.sh pypi_pre_docker
dev
: Uninstalls homebase_calendar_sync
, installs necessary development dependencies, and installs the package in editable mode.build
: Cleans the build directories, installs necessary build dependencies, and builds the project.buildenv
: Sets up a virtual environment for testing, copies environment variables, and activates the environment.buildenv_pre_docker
: Similar to buildenv
but moves certain configuration files before setting up the environment.destroyenv
: Destroys the test environment and reactivates the original environment.destroyenv_pre_docker
: Moves back configuration files after destroying the test environment.homebase_calendar_sync_test
: Runs a series of tests on the homebase_calendar_sync
package to ensure it is working correctly.The homebase_calendar_sync_test
function is designed to test the package installation and functionality. It performs the following tests:
--reset-events
option.To run these tests, use one of the installation commands (testpypi_install
or pypi_install
).
Set up the development environment:
./setup.sh dev
Build the project:
./setup.sh build
Upload to TestPyPI and install for testing:
./setup.sh testpypi_install
Upload to PyPI:
./setup.sh pypi
Prepare the environment for Docker:
./setup.sh pypi_pre_docker
FAQs
A simple web scraper that reads gethomebase.com's schedule and updates Google Calendar.
We found that homebase-calendar-sync demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.