Skip to content

Instantly share code, notes, and snippets.

View rthallisey's full-sized avatar

Ryan Hallisey rthallisey

View GitHub Profile
#!/bin/bash
set -e
QUAY_USERNAME="${1:-}"
QUAY_PASSWORD="${2:-}"
APP_REGISTRY_NAMESPACE="${3:-redhat-operators-stage}"
if [ -z "${QUAY_USERNAME}" ]; then
echo "QUAY_USERNAME not set"
@rthallisey
rthallisey / getbadguys.sh
Created February 8, 2020 23:10 — forked from JeremyMorgan/getbadguys.sh
Get a list of IP addresses trying to attack your CentOS server
#/usr/bin/bash
# strings to look for in our file
# Note: you could just parse the whole file. But if you put in a bad password your IP
# could end up on the bad guy list
declare -a badstrings=("Failed password for invalid user"
"input_userauth_request: invalid user"
"pam_unix(sshd:auth): check pass; user unknown"
"input_userauth_request: invalid user"
"does not map back to the address"
"pam_unix(sshd:auth): authentication failure"
@rthallisey
rthallisey / token.sh
Created January 28, 2020 19:14
tools/token.sh
#!/bin/bash
set -e
QUAY_USERNAME="${1:-}"
QUAY_PASSWORD="${2:-}"
APP_REGISTRY_NAMESPACE="${APP_REGISTRY_NAMESPACE:-rh-osbs-operators}"
if [ -z "${QUAY_USERNAME}" ]; then
echo "QUAY_USERNAME"
@rthallisey
rthallisey / Dockerfile
Created January 28, 2020 19:11
$PROJECT_ROOT/tools/Dockerfile
FROM quay.io/openshift/origin-operator-registry:latest
COPY deploy/olm-catalog /registry
# Initialize the database
RUN initializer --manifests /registry/$APP_NAME-operator --output bundles.db
ENTRYPOINT ["registry-server"]
CMD ["--database", "bundles.db"]
@rthallisey
rthallisey / push.sh
Last active January 28, 2020 19:35
$PROJECT_ROOT/operator-courier/push.sh
#!/usr/bin/env bash
set -e
PROJECT_ROOT="$(readlink -e $(dirname "$BASH_SOURCE[0]")/../../)"
QUAY_REPOSITORY="${QUAY_REPOSITORY:-$APP_NAME-operator}"
PACKAGE_NAME="${PACKAGE_NAME:-$APP_NAME-operator}"
SOURCE_DIR="${SOURCE_DIR:-/manifests}"
REPO_DIR="${QUAY_REPOSITORY:-$APP_NAME-operator}"
NAMESPACE="${PACKAGE_NAME:-$APP_NAME-operator}"
@rthallisey
rthallisey / Dockerfile
Created January 28, 2020 19:09
$PROJECT_ROOT/tools/operator-courier/Dockerfile
FROM registry.access.redhat.com/ubi8/python-36
RUN pip3 install operator-courier
COPY deploy/olm-catalog/$APP_NAME-operator /manifests
RUN operator-courier verify --ui_validate_io /manifests
ENTRYPOINT ["operator-courier"]
CMD ["--help"]
---
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
annotations:
alm-examples: '[{"apiVersion":"app.io/v1alpha1","kind":"App","metadata":{"name":"myapp","namespace":"myapp"},"spec":{}}]'
capabilities: Basic Install
categories: OpenShift Optional
certified: "false"
containerImage: quay.io/rthallisey/myapp:latest
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: apps.app.io
spec:
additionalPrinterColumns:
- JSONPath: .metadata.creationTimestamp
name: Age
type: date
packageName: myapp
channels:
- name: "Y-stream"
currentCSV: myapp.v0.0.1
defaultChannel: "Y-stream"
@rthallisey
rthallisey / CNV-2.1-prod-yaml
Last active October 31, 2019 17:43
CNV 2.1 production yaml
---
apiVersion: v1
kind: Namespace
metadata:
name: openshift-cnv
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata: