Time Dilation + Length Contraction Scenario 
I was bored today and went on a random learning binge (I haven't touched this topic before today in a good decade since high school), and got stuck with this scenario I created for myself:
[I let myself assume c = 100m/s so the numbers would be "nicer" and make things easier to digest... I believe that doesn't invalidate the math if you stay consistent]
As in the picture, assume there is a long, 100 meter long tube that emits light at one end, and then detects it at the other. Since we assume c=100m/s for simplicity, it'll take 1 second for a pulse of light to traverse the tube.
But now we find out that relative to some observer on the ground, the tube is flying by at $0.8c = 80m/s$.
My goal was to try and find all measurements from the other reference frame and show myself that the Lorentz transformations end up preserving the speed of light in both reference frames.
So I figured:
the Earthbound observer would see more time pass than someone in the tube's frame of reference. Applying the Lorentz factor, I got that if the tube works and spends 1 second doing its thing, at 0.8c, the Earthbound observer would see a time of 1.67seconds pass.
Lorentz factor $(\gamma) = \frac{1}{\sqrt( 1 - 80^2/100^2 )} = 1.66666666 $
Since the Earthbound observer is watching the tube move at 0.8c = 80m/s, and sees it doing so for 1.67 seconds, they'd conclude the tube traveled a distance of about 133.6 meters.
On top of this, the Earthbound observer would see the tube be length contracted, from 100m to 60m.
From these things, I come to the conclusion that from the Earthbound observer's frame, the pulse of light has 1.67 seconds to leave one end of the tube and make contact with the other end, which at that point would be 133.6 + 60 = 193.6 meters away.
But that gives a speed for the light pulse of $\frac{ 193.6 }{ 1.67} = 116m/s$
If I did things right and understood the scenario, I should have gotten 100m/s again, since that's what I set as the "speed of light".
I didn't get that, so I'm messing something up, and as random and irrelevant as it is to my life, if I can't figure out why I don't understand, it'll never leave me alone.
Any help would be greatly appreciated!
 A: @JEB's answer is perfectly correct, I'd just like to add my own way of thinking about this problem.
It's a good idea to always start off with Lorentz Transformations when solving such problems in Special Relativity, as blindly using the formulae for length-contraction and time-dilation will lead to such "paradoxes" which arise from not clearly taking into account the assumptions made that lead us to the formulae for length-contraction and time-dilation.
Suppose we call the frame in which the tube is at rest $S^\prime$, and the "Earth" frame $S$. Given two events in $S$, $(x_2, t_2)$ and $(x_1, t_1)$, if we want to find the corresponding events in $S^\prime$,
\begin{equation}
\begin{aligned}
\Delta x^\prime &= \gamma \left(\Delta x - v \Delta t\right),\\
  \Delta t^\prime &= \gamma \left(\Delta t - \frac{v}{c^2}\Delta x\right).
\end{aligned}
\end{equation}
In your problem, however, you are given the events in $S^\prime$ and would like to find the corresponding events in $S$. As a result, we need to use the "inverse" Lorentz Transformations:
\begin{equation}
\begin{aligned}
\Delta x &= \gamma \left(\Delta x^\prime + v \Delta t^\prime\right),\\
  \Delta t &= \gamma \left(\Delta t^\prime + \frac{v}{c^2}\Delta x^\prime\right),
\end{aligned}
\end{equation}
which can be obtained by algebraically manipulating the earlier equations.
Now let's consider the events:

*

*Event 1: Light leaves the emitter.

*Event 2: Light arrives at the detector.

Clearly, from the point of view of someone in $S^\prime$, these two events are separated by a spatial distance of $\Delta x^\prime = 100$m, and occur after an interval $\Delta t^\prime = 1$s.
Thus, the spatial and temporal intervals as observed by someone in $S$ are:
\begin{equation}
\begin{aligned}
\Delta x &= \gamma \left(100 + 80 \times 1\right) = \gamma \times 180 \text{m},\\
  \Delta t &= \gamma \left(1 + \frac{80}{100^2}\times 100\right) = \gamma \times 1.8 \text{s},
\end{aligned}
\end{equation}
IMPORTANT: Notice that $\Delta t \neq \gamma \Delta t^\prime$, and $\Delta x \neq \Delta x^\prime/\gamma$! We'll come back to why this is the case below, but it's the reason for your erroneous answer.
At any rate, using these values of $\Delta x$ and $\Delta t$, we can see that
$$c = \frac{\Delta x}{\Delta t} = \frac{\gamma\times 180}{\gamma \times 1.8} = 100 \text{m/s}$$

Why can't we use the standard length-contraction and time-dilation formulae here?

*

*For an explanation about the assumptions implicit in the time dilation formula see my answer here.


*Similarly, for an explanation about the assumptions in the length contraction formula, see my answer here.
A: Let's name the ends of tube: $L$ ($R$) for the transmission (receiving) end. Let's name the temporal events: Tx (Rx) for the time of transmission (reception).
There are 4 relevant space-time events, which I will show in the tube frame as $(t'/{\rm s}, x'/{\rm m})'$ (primed is for the moving frame that moves along with the tube).
The 1st three relevant events are:

*

*$(0, 0)'$:   $L$ at Tx

*$(1, 100)'$: $R$ at Rx

*$(1, 0)'$:   $L$ at Rx

To compute the speed of light, you need to calculate the differences between (1) and (2):
$$ c' = \frac{100{\rm m}}{1 {\rm s}} = 100 {\rm m/s} $$
Now let's boost those into the stationary frame with coincident origins:

*

*$(0, 0)$:   $L$ at Tx

*$(3, 300)$: $R$ at Rx

*$(1.67, 133.3)'$:   $L$ at Rx

The unprimed speed of light is:
$$ c = \frac{300{\rm m}}{3 {\rm s}} = 100\, {\rm m/s} $$
which works.
Note the unprimed coordinates of (3), which is where the left end of the tube is when the light is received in the tube (primed) frame. This is what you calculated in the 1st part of your process. Note also that it is not simultaneous with reception in the Earth frame, which means you stopped your clock too soon and got too high a speed after adding the contracted tube distance.
If you look at a 4th event, the position of the right end of the tube ($R$) a mere $\frac 1 {5^{th}}$ of a second into the experiment:


*$(0.2, 1)'$: R at the same unprimed time as (3)

in the Earth (unprimed) frame is:


*$(1.67, 1.93)$: R at the same unprimed time as (3)

is exactly what you computed.
And that was: The time between the transmission of the light and the position of the receiver at the Earth time that was coincident at the position of the transmitter in the Tube time that was coincident with final detection of the light.
Obviously, a Minkowski diagram would be quite useful to really understand the hyperbolic geometry of what is going on.
Finally: when a special relativity paradox or conundrum like this pops up, it is most often caused by the relativity of simultaneity. Spatial separated events are not simultaneous in all frames.
