Curls carefully tucked into their bonnets, their bras, corsets and belts checked for metal and pockets scanned for matches, a brave generation of unsung heroes marched to the frontline.

At a sprawling factory on the border between Scotland and England – many miles from the Western Front - young women worked elbow deep in toxic chemicals that made their teeth wobble and hair drop out, gave them pounding headaches and, in some cases, exploded in their faces.

There were lost limbs, broken bones, burns – and a carefully controlled life of searches, restrictions and definitely no canoodling allowed.

More than 30,000 people worked at HM Factory Gretna, most employed in the treacherous task of stirring the ‘devil’s porridge’ – the name given by Sherlock Holmes creator Sir Arthur Conan Doyle to the explosive paste made there and destined to fill countless First World War shells.

As well as almost 12,000 women who had travelled from around the United Kingdom to ‘do their bit’ for the war effort, there were more than 10,000 navvies who built the huge factory and workers’ homes – laying the foundations for the community of Gretna in the process.

Alongside were hundreds of explosive experts, engineers, chemists and medics, drafted from across the Commonwealth to oversee the production of up to 800 tons of cordite RDB a week at the largest munitions factory on the planet.

The task was vital to victory but unlike the soldiers, politicians and military leaders, the sacrifices made behind the gates of the highly-controlled factory would scarcely be acknowledged: details of those who worked there were not even recorded and kept.

Now, however, the names and lives of more than 1,200 of the Gretna factory’s brave workers have been uncovered by a massive research project that has spanned the world and, in some cases, uncovered moving – and some bizarre - stories behind its unsung heroes.

They include the unexpected link between the factory and one of Australia’s best-known products, Vegemite, courtesy of Gretna chemist, Cyril Callister.

Born in the tiny community of Chute, in central Victoria, Australia, Callister had completed his chemistry BSc and was working for a soap and household product manufacturer in early 1915, when he enlisted with the Australian Imperial Force to fight in the First World War.

Instead of the excitement of the trenches, he found himself posted to southwest Scotland.

“A lot of men who ended up at the munitions factory came from Australia and Canada,” explains Dr Laura Noakes, Research Assistant at The Devil’s Porridge Museum in Eastrigg, dedicated to telling the story of HM Factory, Gretna.

“When it was found they had a science or chemistry background, they were diverted to Ministry of Munitions where it was felt their skills were more suited.

“It’s possible a lot really wanted to fight and would have been disappointed to end up in Greta.”

The Miracle Workers project was launched last March and has so far involved more than 50 amateur detectives dotted around the world, trawling countless online records, letters and documents in the hope of matching them with scant details salvaged from HM Factory Gretna.

The volunteers’ research uncovered details of Cyril working at Gretna in 1918. While there, he met and married local girl, Katherine Hope Mundell.

The newlyweds returned to Australia. Trade had been disrupted due to hostilities and with Marmite supplies severely affected, Cyril was tasked with finding a solution.

He went on to develop the famed Australian yeast extract, Vegemite, and a new preserved cheese, Kraft Walker.

Construction of HM Factory, Gretna had been ordered by David Lloyd George, Minister of Munitions, amid concerns of a serious lack of ammunition for British soldiers in France.

The supersize factory stretched over nine miles from Dornock near Annan to Mossband in Cumbria, and was built during a manic 15 months.

Alongside were homes for workers, recreation facilities and two cinemas – which showed nothing too romantic for fear it could spark inappropriate relations between the male and female workers.

To be doubly sure, adds Dr Noakes, security staff would check side streets and lanes near the cinemas for anyone who might dare indulge in “canoodling”.

Just as big an issue was the demand on local pubs and breweries from hardworking, hard drinking navvies which led to a government takeover of hostelries, a ban on buying rounds and watered down drinks.

The museum had already uncovered some stories from the factory, including flimsy details of the women’s football team, the Mossband Swifts.

However, Dr Noakes says it’s hoped more can be found of the brave people whose wartime effort was far from a safe alternative to the frontline.

“There were extensive medical facilities at the factory because of explosions,” she says. “We have records from after WW1 of Gretna workers whose teeth and hair were falling out, one woman’s eyes went yellow and remained yellow her whole life.

“When you first came into contact with cordite, it would give you cracking headaches and if you stopped coming into contact it also gave you headaches.

“We know that some people ate cordite. An article in the British Medical Journal told how soldiers used cordite to light cigarettes and were eating and chewing it.

“There was almost opium style addiction to it.”

Some Gretna girls suffered miscarriages or lung issues from breathing toxic fumes. Others fell victim to horrible accidents caused by fires and explosions.

Victoria May McIver, from Cumbria, was just 17 years old and working in the Cotton Preparation Department when she lost her left hand and part of her arm in an accident.

While her colleague, Maud Bruce epitomised the spirit of the age: she was awarded the British Empire Medal and an OBE after bravely tackling two blazes which threatened to cause a devastating explosion at the factory.

“We knew her name and that she was very brave, but the project has allowed us to find out what happened after she left Gretna,” adds Dr Noakes.

“She married a WW1 war veteran, moved back to County Durham then worked in a munitions factory there.

“She was injured in 1943 when explosive blew up in her face, and spent five and a half months in Hospital.

“We think she was one of the first women in the UK to have plastic surgery.

“Maud worked in munitions factories throughout two world wars, her husband died by suicide in the 1950s and she lost one of her sons.

“She lived through remarkable times before she passed away in 1995 aged 100.”

The research has also uncovered details of some of the army of men and women charged with keeping the factory safe and caring for the workers’ health.

They included women police officers, who would search the staff daily, including checking the women’s clothes and underwear for metal which might cause even the tiniest spark.

“There was a push from middle class reformers to focus on the welfare of factory workers, particularly young single women who were seen as vulnerable to moral deterioration,” adds Dr Noakes.

“There was a whole welfare system at Gretna, staffed by middle class women, a lot older and educated.

“One, Florence Catnach, came from distinguished family. She went on to make the welfare of women factory workers her life’s work.”

Paisley-born Agnes Barr Auchencloss, meanwhile, worked as a medical officer while her chemist husband, Gosta Lundholm – claimed to be the secret illegitimate son of the Swedish King–King Charles XIV John - was in the nitro-glycerine section.

Part of the project will examine the role of disabled workers: men rejected for military service due to disabilities are thought to have ‘done their bit’ at the factory, while accidents also left others with life-changing injuries.

The Miracle Workers project forms an exhibition at the museum, along with a short film which tells the stories of some of the workers.

The project aims to upload details of individual factory workers to Wikipedia, to ensure their contribution to the war effort is no longer hidden from view.