ishtargate: sabey.co/ishtargate Index | Files | Directories

package ishtargate

import "sabey.co/ishtargate"

Index

Package Files

build.go build_firewall-iptables.go build_firewall.go build_hostname.go build_hosts.go build_ssh.go firewall.go firewall_rule.go firewall_variables.go ishtargate.go network.go server.go service.go settings.go ssh.go

Constants

const (
    FIREWALL_IPTABLES = iota + 1
)

type Firewall_Rule Uses

type Firewall_Rule struct {
    Rule string `json:"rule,omitempty"`
}

func (*Firewall_Rule) IsValid Uses

func (self *Firewall_Rule) IsValid() bool

func (*Firewall_Rule) ParseNetwork Uses

func (self *Firewall_Rule) ParseNetwork(
    w io.Writer,
    vars *Firewall_Variables_Network,
) error

func (*Firewall_Rule) ParseServer Uses

func (self *Firewall_Rule) ParseServer(
    w io.Writer,
    vars *Firewall_Variables_Server,
) error

func (*Firewall_Rule) ParseServiceAcquirable Uses

func (self *Firewall_Rule) ParseServiceAcquirable(
    w io.Writer,
    vars *Firewall_Variables_Service_Acquirable,
) error

func (*Firewall_Rule) ParseServiceDependencies Uses

func (self *Firewall_Rule) ParseServiceDependencies(
    w io.Writer,
    vars *Firewall_Variables_Service_Dependencies,
) error

func (*Firewall_Rule) ParseServicePassive Uses

func (self *Firewall_Rule) ParseServicePassive(
    w io.Writer,
    vars *Firewall_Variables_Service_Passive,
) error

type Firewall_Variables_Network Uses

type Firewall_Variables_Network struct {
    ServerName  string      `json:"server-name,omitempty"`
    Server      *Server     `json:"server,omitempty"`
    NetworkName string      `json:"network-name,omitempty"`
    Network     *Network    `json:"network,omitempty"`
    IshtarGate  *IshtarGate `json:"ishtargate,omitempty"`
}

func (*Firewall_Variables_Network) IsValid Uses

func (self *Firewall_Variables_Network) IsValid() bool

type Firewall_Variables_Server Uses

type Firewall_Variables_Server struct {
    ServerName string      `json:"server-name,omitempty"`
    Server     *Server     `json:"server,omitempty"`
    IshtarGate *IshtarGate `json:"ishtargate,omitempty"`
}

func (*Firewall_Variables_Server) IsValid Uses

func (self *Firewall_Variables_Server) IsValid() bool

type Firewall_Variables_Service_Acquirable Uses

type Firewall_Variables_Service_Acquirable struct {
    ServiceName            string      `json:"service-name,omitempty"`
    SourceServerName       string      `json:"source-server-name,omitempty"`
    SourceServer           *Server     `json:"source-server,omitempty"`
    SourceNetworkName      string      `json:"source-network-name,omitempty"`
    SourceNetwork          *Network    `json:"source-network,omitempty"`
    SourceService          *Service    `json:"source-service,omitempty"`
    DestinationServerName  string      `json:"destination-server-name,omitempty"`
    DestinationServer      *Server     `json:"destination-server,omitempty"`
    DestinationNetworkName string      `json:"destination-network-name,omitempty"`
    DestinationNetwork     *Network    `json:"destination-network,omitempty"`
    DestinationService     *Service    `json:"destination-service,omitempty"`
    IshtarGate             *IshtarGate `json:"ishtargate,omitempty"`
}

func (*Firewall_Variables_Service_Acquirable) IsValid Uses

func (self *Firewall_Variables_Service_Acquirable) IsValid() bool

type Firewall_Variables_Service_Dependencies Uses

type Firewall_Variables_Service_Dependencies struct {
    ServiceName            string      `json:"service-name,omitempty"`
    SourceServerName       string      `json:"source-server-name,omitempty"`
    SourceServer           *Server     `json:"source-server,omitempty"`
    SourceNetworkName      string      `json:"source-network-name,omitempty"`
    SourceNetwork          *Network    `json:"source-network,omitempty"`
    SourceService          *Service    `json:"source-service,omitempty"`
    DestinationServerName  string      `json:"destination-server-name,omitempty"`
    DestinationServer      *Server     `json:"destination-server,omitempty"`
    DestinationNetworkName string      `json:"destination-network-name,omitempty"`
    DestinationNetwork     *Network    `json:"destination-network,omitempty"`
    DestinationService     *Service    `json:"destination-service,omitempty"`
    IshtarGate             *IshtarGate `json:"ishtargate,omitempty"`
}

func (*Firewall_Variables_Service_Dependencies) IsValid Uses

func (self *Firewall_Variables_Service_Dependencies) IsValid() bool

type Firewall_Variables_Service_Passive Uses

type Firewall_Variables_Service_Passive struct {
    ServerName  string      `json:"server-name,omitempty"`
    Server      *Server     `json:"server,omitempty"`
    NetworkName string      `json:"network-name,omitempty"`
    Network     *Network    `json:"network,omitempty"`
    ServiceName string      `json:"service-name,omitempty"`
    Service     *Service    `json:"service,omitempty"`
    IshtarGate  *IshtarGate `json:"ishtargate,omitempty"`
}

func (*Firewall_Variables_Service_Passive) IsValid Uses

func (self *Firewall_Variables_Service_Passive) IsValid() bool

type IshtarGate Uses

type IshtarGate struct {
    // Servers
    // [ServerName]*ServerObject
    Servers map[string]*Server `json:"servers,omitempty"`
    // Global Firewall Rules
    // list of types can be found in `firewall.go`
    // 1 can be used for iptables
    FirewallType int `json:"firewall-type,omitempty"`
    // Before Server.FirewallRulesBefore
    FirewallRulesBefore []*Firewall_Rule `json:"firewall-rules-before,omitempty"`
    // After Server.FirewallRulesAfter
    FirewallRulesAfter []*Firewall_Rule `json:"firewall-rules-after,omitempty"`
    // Global Variables
    Vars map[string]interface{} `json:"vars,omitempty"`
}

func (*IshtarGate) Build Uses

func (self *IshtarGate) Build(
    settings *Settings,
) bool

func (*IshtarGate) BuildServer Uses

func (self *IshtarGate) BuildServer(
    settings *Settings,
    server string,
) bool

func (*IshtarGate) IsValid Uses

func (self *IshtarGate) IsValid() bool

type Network Uses

type Network struct {
    // Accessible IP
    IP  string `json:"ip,omitempty"`
    // []Host
    // Hosts are referenced by other Servers
    // if referenced, hosts are appended to their /etc/hosts
    Hosts []string `json:"hosts,omitempty"`
    // Passive Services
    // passive services will always be available in the firewall rules
    // [ServiceName]Service
    ServicesPassive map[string]*Service `json:"services-passive,omitempty"`
    // Acquirable Services
    // acquirable services will only be available in firewall rules if acquired
    // [ServiceName]Service
    ServicesAcquirable map[string]*Service `json:"services-acquirable,omitempty"`
    // Optional Service Dependencies
    // Acquired Services will set firewall rules in the acquirable Servers firewall rules
    // this Service object here is optional and will be included in this Servers rules
    // [ServerName][NetworkName][ServiceName]Service
    ServiceDependencies map[string]map[string]map[string]*Service `json:"service-dependencies,omitempty"`
    // Before Server.FirewallRulesBefore
    FirewallRulesBefore []*Firewall_Rule `json:"firewall-rules-before,omitempty"`
    // After Server.FirewallRulesAfter
    FirewallRulesAfter []*Firewall_Rule `json:"firewall-rules-after,omitempty"`
    // Network Variables
    Vars map[string]interface{} `json:"vars,omitempty"`
}

func (*Network) IsValid Uses

func (self *Network) IsValid() bool

type SSH Uses

type SSH struct {
    User  string   `json:"user,omitempty"`
    Host  string   `json:"host,omitempty"`
    Port  uint16   `json:"port,omitempty"`
    Key   string   `json:"key,omitempty"`
    Flags []string `json:"flags,omitempty"`
    // Tunnel Settings
    Tunnel        bool `json:"tunnel,omitempty"`
    TunnelReverse bool `json:"tunnel-reverse,omitempty"`
    // For a regular Tunnel use:
    // ssh -L LocalPort:RemoteHost:RemotePort
    // For a Reverse Tunnel use:
    // ssh -R RemotePort:LocalHost:LocalPort
    LocalHost  string `json:"local-host,omitempty"`
    LocalPort  uint16 `json:"local-port,omitempty"`
    RemoteHost string `json:"remote-host,omitempty"`
    RemotePort uint16 `json:"remote-port,omitempty"`
}

func (*SSH) IsValid Uses

func (self *SSH) IsValid() bool

type Server Uses

type Server struct {
    // Hostname is used for our /etc/hostname and /etc/hosts
    Hostname string `json:"hostname,omitempty"`
    // Additional Local Hosts are appended to our /etc/hosts
    // this appears locally only
    // [IP][]Host
    Hosts map[string][]string `json:"hosts,omitempty"`
    // Hosts Custom Blob of Text Before
    // this appears locally only
    HostsBefore string `json:"hosts-before,omitempty"`
    // Hosts Custom Blob of Text After
    // this appears locally only
    HostsAfter string `json:"hosts-after,omitempty"`
    // Optional Hosts Dependencies
    // Additional referenced Hosts are appended to our /etc/hosts
    // if we reference another Servers Network, we will include that Networks /etc/hosts locally and point the hosts to that Networks IP
    // [ServerName][]Network
    HostsDependencies map[string][]string `json:"hosts-dependencies,omitempty"`
    // SSH
    // this will generate a list of ssh commands for possible local or remote tunnels
    // this appears locally only
    // ssh service name are arbitrary and aren't currently referenced
    // [Service]SSH
    SSH map[string]*SSH `json:"ssh,omitempty"`
    // Firewall Rules
    // Before Services
    FirewallRulesBefore []*Firewall_Rule `json:"firewall-before,omitempty"`
    // After Services
    FirewallRulesAfter []*Firewall_Rule `json:"firewall-after,omitempty"`
    // List of our Accessible Networks and their available Services
    // our Firewall rules will be built from our Network relations
    // NetworkName can be used in place of the Interface name
    // the Interface name can be referenced for specific firewall rules
    // [NetworkName]Network
    Networks map[string]*Network `json:"networks,omitempty"`
    // Server Variables
    Vars map[string]interface{} `json:"vars,omitempty"`
}

func (*Server) IsValid Uses

func (self *Server) IsValid() bool

type Service Uses

type Service struct {
    Port          uint16           `json:"port,omitempty"`
    FirewallRules []*Firewall_Rule `json:"rules,omitempty"`
    // Service Variables
    Vars map[string]interface{} `json:"vars,omitempty"`
}

func (*Service) IsValid Uses

func (self *Service) IsValid() bool

type Settings Uses

type Settings struct {
    // Build Options
    BuildPath                 string `json:"build-path,omitempty"`
    BuildRemoveFolderHostname bool   `json:"build-remove-folder-hostname,omitempty"`
    BuildRemoveFolderHosts    bool   `json:"build-remove-folder-hosts,omitempty"`
    BuildRemoveFolderSSH      bool   `json:"build-remove-folder-ssh,omitempty"`
    BuildRemoveFolderFirewall bool   `json:"build-remove-folder-firewall,omitempty"`
}

func (*Settings) IsValid Uses

func (self *Settings) IsValid() bool

Directories

PathSynopsis
ishtargate

Package ishtargate imports 9 packages (graph) and is imported by 2 packages. Updated 2017-05-25. Refresh now. Tools for package owners.