Hamiltonians for a general dilaton gravity theory on a spacetime with a non-orthogonal, timelike or spacelike outer boundary