Normal view

There are new articles available, click to refresh the page.
Yesterday — 29 May 2026Main stream

Inside the Room Where War Insurance Is Bought and Sold

29 May 2026 at 22:30
Many of the ships stranded in the Persian Gulf depend on coverage negotiated at Lloyd’s, the center of marine insurance for more than 300 years.

© Joseph Horton for The New York Times

The 200-foot-tall atrium in the Underwriting Room, where brokers negotiate policies for ships carrying oil, gas and other goods around the world.

Bari Weiss Names Nick Bilton to Lead CBS’s ‘60 Minutes’ in Major Shake-Up

Bari Weiss, CBS’s editor in chief, named Nick Bilton, a tech journalist and filmmaker, as the show’s executive producer. The network also fired two on-air correspondents.

© Matt Winkelmeyer/Getty Images

Nick Bilton is a filmmaker and former New York Times columnist.
Before yesterdayMain stream

Paintings of Beatrice Portinari: after 1862

By: hoakley
10 May 2026 at 19:30

Beata Beatrix was Dante Gabriel Rossetti’s next step, started in earnest in 1864, two years after Lizzie’s death, and completed in 1870, although he had been making preliminary studies when she was still alive. The background sets this in Florence, with its distinctive Ponte Vecchio over the River Arno, and the sundial sets the time as nine o’clock in the morning, the time of Beatrice Portinari’s death.

Beata Beatrix c.1864-70 by Dante Gabriel Rossetti 1828-1882
Dante Gabriel Rossetti (1828–1882), Beata Beatrix (c 1864–70), oil on canvas, 86.4 x 66 cm, The Tate Gallery (Presented by Georgiana, Baroness Mount-Temple in memory of her husband, Francis, Baron Mount-Temple 1889), London. Photographic Rights © Tate 2018, CC-BY-NC-ND 3.0 (Unported), https://www.tate.org.uk/art/artworks/rossetti-beata-beatrix-n01279

Behind the ecstatic figure of Beatrice are Dante (right) with his cap, and the angelic figure of Love at the left. Beatrice is pale and her death is approaching. Her eyes are closed, waiting for release. A red bird with a halo has brought her a poppy flower, a direct association with sleep and laudanum. Beatrice is unmistakably Lizzie.

For once, we have the artist’s account of the reading of his own painting, in a letter Rossetti wrote to its first owner in 1871. He establishes that his literary reference is Vita Nuova, and the work embodies “symbolically the death of Beatrice as treated in that work.” But it doesn’t represent death as such, rather ‘renders’ it “under the semblance of a trance”, in which she is suddenly “rapt” from Earth to Heaven.

The red bird is the messenger of death, who drops a poppy flower into Beatrice’s hands, as she has closed her eyes to see the face of God. This could equally have referred to Lizzie rather than Beatrice.

Rossetti never worked this obsession out of his system. In 1871, he returned to the theme in what proved to be his largest painting ever, based on an original watercolour study, now in the Tate Gallery, he had made as early as 1856.

rossettidantesdream
Dante Gabriel Rossetti (1828–1882), Dante’s Dream on the Day of the Death of Beatrice (1880), oil on canvas, 135.2 x 200.6 cm, Dundee Art Galleries and Museums Collection, Dundee, Scotland. Wikimedia Commons.

A decade after Lizzie’s death, Rossetti wove the more complex Dante’s Dream on the Day of the Death of Beatrice, of which this is the artist’s 1880 copy of his 1871 original. There are references to Beata Beatrix, in the red birds at the left and right edges, and his model for Beatrice was Jane Morris, wife of William Morris, designer and close friend. Jane Burden, as she was before her marriage to William Morris, had a similar background to Lizzie Siddall, from humble origins to artists’ model, then into the Pre-Raphaelite circle. Jane and Rossetti became lovers in around 1865 when he was still working on Beata Beatrix, but their relationship cooled later.

Rossetti casts the dream insert in red, for love, showing a red and winged angel of love kissing the dying Beatrice. He clutches not a flower – there are red roses strewn all over the floor – but an arrow of love. The model for the woman on the right was Marie Spartali Stillman, and her husband William James Stillman modelled for Dante’s face.

rossettisalutationbeatrice1880
Dante Gabriel Rossetti (1828–1882), The Salutation of Beatrice (1880-82), oil on canvas, 154.3 x 91.4 cm, Toledo Museum of Art, Toledo, OH. Wikimedia Commons.

The finest among Rossetti’s last paintings of Beatrice is The Salutation of Beatrice (1880-82), painted in the last couple of years of his life. It is drawn in part from the figure of Beatrice in the left panel of his earlier Salutation of Beatrice, again using Jane Morris as his model. Sat on a well in the distance are the figures of Dante and the same red angel of Love, or maybe death after all.

In that couple of years before his death, as Rossetti was working on his last paintings of Dante’s beloved Beatrice, two other artists associated with the Pre-Raphaelites were also at work on their depictions of her. Henry Holiday was researching for his 1883 painting Dante meets Beatrice at Ponte Santa Trinita, and Marie Spartali Stillman painted the first of her several watercolours of Dante and Beatrice.

holidaydantebeatrice
Henry Holiday (1839–1927), Dante meets Beatrice at Ponte Santa Trinita (1883), oil on canvas, 140 x 199 cm, Walker Art Gallery, Liverpool, England. Wikimedia Commons.

The year after Rossetti’s death, Henry Holiday completed his painting of the second occasion on which Dante claimed he had met with his beloved, in Dante meets Beatrice at Ponte Santa Trinita (1883). Holiday devoted great effort to making this view as authentic as possible. In 1881, the year before Rossetti’s death, he travelled to Florence to make studies, and researched the buildings at the time, which he turned into clay models for a 3D reference. He also got John Trivett Nettleship, a noted animal painter, to paint the pigeons so that they were faithful.

Marie Spartali, as she was before her marriage in 1871, was one of a trio of beautiful young women from Greek migrant families in London who had become known as the Three Graces. Her father, then a wealthy merchant, entertained Pre-Raphaelite painters including Rossetti, who referred to Marie as a “stunner”.

The Three Graces modelled for the artists of the day, and Marie appears as one of the figures in Rossetti’s painting of Dante’s Dream on the Day of the Death of Beatrice (1871, 1880). She learned to paint in private lessons from Ford Madox Brown, and was soon making her own images based on the writings of Dante, and Rossetti’s translations of them into English.

stillmandantecertainladies
Marie Spartali Stillman (1844–1927), “Certain ladies of her companionship gathered themselves unto Beatrice…” (1880), watercolour and gouache over traces of graphite on paper on backing, 85.1 x 63.5 cm, Private collection. Wikimedia Commons.

The full title of her “Certain ladies of her companionship gathered themselves unto Beatrice…” (1880) actually quotes even more from Dante’s Vita Nuova: “Certain ladies of her companionship gathered themselves unto Beatrice where she kept alone in weeping. And as they passed in and out, I would hear them speak concerning her, how she wept.”

This refers to the ladies of Florence who paid their respects to Beatrice as she kept vigil following her father’s death. Dante is shown sat outside the house, wearing his customary chaperon hat, his head bowed, and being comforted by two of the women who had visited Beatrice inside.

stillmanbeatrice1896
Marie Spartali Stillman (1844–1927), Beatrice (1896), watercolour and gouache on paper mounted on board, 57.6 × 43.2 cm, Delaware Art Museum, Wilmington, DE. Wikimedia Commons.

In 1896, Marie Spartali Stillman revisited Dante’s Vita Nuova through Dante Gabriel Rossetti’s popular translation into English. Her earlier version of Beatrice (1896) shows Dante’s beloved Beatrice lost in contemplation while reading, an intimate insight set firmly in the Pre-Raphaelite mediaeval, also seen in detail below.

stillmanbeatrice1896det
Marie Spartali Stillman (1844–1927), Beatrice (detail) (1896), watercolour and gouache on paper mounted on board, 57.6 × 43.2 cm, Delaware Art Museum, Wilmington, DE. Wikimedia Commons.
stillmanbeatrice1898
Marie Spartali Stillman (1844–1927), Beatrice (1898), watercolour, gouache and graphite, 54.6 x 36.9 cm, Private collection. Wikimedia Commons.

Her second treatment of Beatrice (1898) employs similar floral language, perhaps emphasising innocence in its lilies, but is less contemplative and more sensual, in a manner perhaps more typical of Rossetti.

stillmanpilgrimfolk
Marie Spartali Stillman (1844–1927), The Pilgrim Folk (1914), watercolor and gouache on paper, 56.8 × 70.3 cm, Delaware Art Museum, Wilmington, DE. Wikimedia Commons.

In the months before the outbreak of the First World War, she painted The Pilgrim Folk (1914), which may well have been a double valediction, as both her last major painting and her farewell to Italy. It again refers to Dante’s Vita Nuova via Rossetti, a quotation from which was shown with the painting. This passage contains Dante’s account of Beatrice’s death to a group of newly-arrived pilgrims.

Dante leans out from a window at the left, addressing three pilgrims below. At the lower left corner, the winged figure of Love crouches in grief, poppies scattered in front of him, a reference to Rossetti’s paintings. Pilgrims around the well are taking refreshment after their travels, and more are arriving through the alley beyond. Black crows fly in flocks above, symbolising death. The landscape behind is very Italian, and the whole has a fairy-tale unreality about its mediaeval details.

Stillman had used Rossetti’s symbols elsewhere too, including in one of her finest paintings, Love’s Messenger completed in 1885, three years after his death.

stillmanlovesmessenger
Marie Spartali Stillman (1844–1927), Love’s Messenger (1885), watercolor, tempera and gold paint on paper mounted on wood, 81.3 × 66 cm, Delaware Art Museum, Wilmington, DE. Wikimedia Commons.

A young woman stands by her embroidery at an outside window. On her right hand is a messenger dove/pigeon, to which a letter is attached. She clutches that letter to her breast with her left hand, implying that its contents relate to matters of the heart. The dove is being fed corn, which could either be its reward for having reached its destination (thus the woman is the recipient of the message), or preparation for its departure (she is the sender).

On balance, the presence of corn on the windowsill implies that it is more likely that the dove has just arrived, and the woman is the recipient. But look closely at the embroidery, and she is making an image of one of Rossetti’s angels of love, complete with red wings and a bow and arrow.

There’s another artist who is perhaps the most surprising of all those who painted Beatrice: Odilon Redon (1840–1916), a contemporary of Stillman, who is perhaps as different as you could get in terms of background and style.

redonbeatrice
Odilon Redon (1840–1916), Beatrice (1885), pastel on paper, dimensions not known, Private collection. Wikimedia Commons.

Redon’s pastel portrait of Beatrice from 1885 was turned into a print a decade or so later, and appears to have been laid down in pure gold. Like so many other portraits of her, it contains no literary references to indicate whether she is the possibly physical Beatrice from Vita Nuova, or the spiritual guide from the Divine Comedy.

martindantebeatrice
Henri-Jean Guillaume Martin (1860–1943), Dante Meeting Beatrice (1898), colour lithograph, 25.5 x 31 cm, The British Museum, London. Wikimedia Commons.

Throughout his career, Henri-Jean Guillaume Martin painted scenes from Dante’s Divine Comedy. This colour lithograph refers to the end of the middle book Purgatory, in which Dante is reunited with his beloved Beatrice, who leads him through the final book, Paradise.

redondantebeatrice
Odilon Redon (1840–1916), Dante and Beatrice (1914), oil on canvas, 50 x 65.3 cm, Fujikawa Galleries Inc., Tokyo, Japan. Wikimedia Commons.

At the same time that Stillman was painting her Pilgrim Folk above, Redon painted one of his relatively few works in oils, of Dante and Beatrice (1914). Their heads, with eyes closed so they can see their God, are among the clouds above the cliffs of a coastline suggestive of Purgatory.

So who was Beatrice Portinari?

Born in Florence in about 1265, making her about the same age as Dante, she was the daughter of a rich banker. By the time she was about 22, she had married another banker, Simone dei Bardi. She is mentioned in the will that her father made in 1287, and is thought to have died in Florence on 8 June 1290, at the age of about 25.

Beyond that, and Dante’s non-specific references to a Beatrice, who could quite easily be someone completely different, or a symbolic figure, there seems nothing to tell. But there are so many wonderful paintings of such an unknown woman.

Painting Pandora and her box: 1883-1919

By: hoakley
26 April 2026 at 19:30

The ancient Greek myth of Pandora had been almost unknown in paintings until the nineteenth century. During the 1870s it suddenly became a popular theme for European paintings, but its narrative had altered from the original in showing the first woman in Greek mythology with a box containing the ills of the world, rather than a large earthenware storage pot, and only one artist had depicted its crux.

churchopenedpandorasbox
Frederick Stuart Church (1842–1924), Pandora (1883), pencil and ink wash on paper, 30.2 x 45.7 cm, Private collection. Wikimedia Commons.

The story broke out of Europe by 1883, when the American painter and illustrator Frederick Stuart Church painted his more illustrative Pandora. Dressed more modestly (presumably for a wider audience), she is shown as an innocent young woman kneeling on a large golden chest as she tries to close its lid and stop the emerging stream of red demons. I suspect this was intended as an illustration for a printed collection of classical myths.

Walter Crane (1845–1915), Pandora (1885), watercolour on paper, 53.3 x 73.6 cm, location not known. Wikimedia Commons.

The following year Walter Crane, a British painter and illustrator, painted Pandora in an unusual interpretation that’s only loosely connected with the original myth. She is here draped in grief over a substantial casket, and on its side panel are the figures of the three Fates. At the corners of the casket are guardian winged sphinxes, each clasping a sphere.

bouguereaupandora
William-Adolphe Bouguereau (1825–1905), Pandora (1890), oil on canvas, 92.5 × 64.5 cm, location not known. Wikimedia Commons.

In his later years, William-Adolphe Bouguereau chose an oddly androgynous model for his depiction of Pandora in 1890, but has rather lost the narrative. Her neutral expression, body language, and the closed box tell little of what is imminent.

waterhousepandora
John William Waterhouse (1849–1917), Pandora (1896), oil on canvas, 152 × 91 cm, Private collection. Wikimedia Commons.

One of his lesser-known paintings, John William Waterhouse’s Pandora from 1896 is a major depiction of this myth, and one of the most complete. Set by a small brook in a dark, primeval forest, her box has become a large gold chest encrusted with precious stones and decorated with mythological motifs. Pandora kneels by its side, peeking inside as she carefully raises its lid, but even this tentative glimpse is sufficient to release its stream of ills, of which she appears unaware.

normandpandora
Ernest Normand (1857-1923), Pandora (1899), further details not known. The Athenaeum.

Ernest Normand is one of few painters to show a later moment, in which Pandora (1899) bends low to duck beneath the swirling grey clouds of evils as they spread out into the idyllic world beyond, causing blossom to fall as petals to the ground. Her jar is only hinted at, behind her billowing white robes, almost depriving the viewer of this vital clue to the original story.

rackhampandora
Arthur Rackham (1867–1939), Pandora (date not known), further details not known. Wikimedia Commons.

I have been unable to find a date for this presumed illustration by the great Arthur Rackham of Pandora, but suspect it was made around the turn of the twentieth century, and intended to accompany a British English retelling of this myth. As with Church before, Pandora is young and innocent in her nakedness. She gazes up in awe at the batlike demons as they escape from the open lid of her large wooden chest, seemingly unaware of what she is unleashing in her curiosity.

kenningtonpandora
Thomas Benjamin Kennington (1856–1916), Pandora (1908), oil on canvas, 166.3 × 113 cm, Private collection. Wikimedia Commons.

Thomas Benjamin Kennington shows Pandora (1908) in the final phase of regret and sorrow, after the evils have all been released. Her box, now empty, with no sign of the remaining Hope, rests on her thigh. She hangs her head in shame, resting it on her right hand as she weeps at what she has done. Unfortunately, the released demons shown at the left edge are so dark that they are hard to see.

Over this period, other artists had also been painting the story of the creation of Pandora, a theme I have avoided so far. I will, though, show one of its more unusual depictions, a painting lost for forty years.

battenpandora
John Dixon Batten (1860-1932), The Creation of Pandora (1913), tempera on fresco, 128 x 168 cm, Reading University, Reading, England. Wikimedia Commons.

John Dixon Batten’s The Creation of Pandora was painted anachronistically in egg tempera on a fresco ground by 1913. Batten was one of the late adherents of the Pre-Raphaelite movement, and now almost forgotten. It had been exhibited in a commercial gallery, and was acquired by the University of Reading, England, shortly before the First World War. Deemed unfashionable in 1949, it was put into storage and quietly forgotten until its rediscovery in 1990.

Pandora is at the centre, having just been fashioned out of earth by Hephaestus, who stands at the left, his foot on his anvil. Behind them, other blacksmiths work metal in his forge. At the right, Athena is about to place her gift of a robe about Pandora’s figure, and other gods queue behind her to offer their contributions.

Just before the start of the First World War, Odilon Redon made a series of studies leading to a radically different presentation of Pandora’s story.

redonpandorahouston
Odilon Redon (1840–1916), Pandora (date not known), pastel and charcoal on board, 22.1 x 29.1 cm, Museum of Fine Arts, Houston, TX. Wikimedia Commons.

Redon’s undated pastel study of Pandora shows her clasping her box close in the midst of huge floral images.

redonpandoramet
Odilon Redon (1840–1916), Pandora (c 1914), oil on canvas, 143.5 x 62.2 cm, The Metropolitan Museum of Art (Bequest of Alexander M. Bing, 1959), New York, NY. Courtesy of The Metropolitan Museum of Art.

Redon’s finished oil painting of Pandora from about 1914 shows her more clearly, surrounded by a garden of exquisite and exotic blooms, referring to Eve’s Paradise before the Fall. She holds her box to her bosom, as she succumbs to the temptation to open it, but Redon stops just short of showing its evils pouring out.

gregorypandora
Yvonne Gregory (Park) (1889-1970), Pandora (1919), photograph, published in ‘Photograms of the Year’, 1919, further details not known. Wikimedia Commons.

My final representation of the myth of Pandora is a photograph from 1919 by the society portrait photographer Yvonne Gregory (who also worked under her married surname of Park): Pandora. The box lies wide open by her knees, as Pandora is bent double in distress over it, her left arm over her head to shelter her from the demons that have been released, and in grief at what she has done.

Given the disasters that had struck the world in the years immediately preceding this photograph – the mass carnage of the war, and the influenza pandemic which followed it – it must have had great impact when it was published in 1919. Much as these images have today. For despite the story’s underlying misogyny, I can’t help thinking that Pandora’s box has been opened yet again.

Reference

Wikipedia on the myth of Pandora.

Medium and Message: Stained glass

By: hoakley
21 April 2026 at 19:30

Colouring glass is ancient in origin, and in Europe its use in church windows reached its height during the Middle Ages. As a craft it has tended to develop independently of fine art painting, but since the nineteenth century’s revivals of better integrated arts and crafts, some painters have designed stained glass windows. At the same time, other painters have been depicting them.

In the Italian Renaissance, several artists best-known as painters, among them Paolo Uccello and Donatello, designed stained glass windows for Florence Cathedral and other churches. In the nineteenth century revival of the craft, contemporary arts and crafts movements drew established painters from the Pre-Raphaelite movement in Britain, and Art Nouveau across much of Europe. Among those who created successful designs are Edward Burne-Jones, Alfonse Mucha, Koloman Moser and Marc Chagall.

moserart
Koloman Moser (1868–1918), Art, design sketch for a round window (1897), India ink and watercolor on paper, 20.9 x 22.8 cm, Österreichisches Museum für angewandte Kunst (MAK), Vienna, Austria. Wikimedia Commons.

Koloman Moser’s Art is one of his design sketches from 1897 intended for a round stained glass window in the new Secession Building in the centre of Vienna.

moserottowagnerkirche
Koloman Moser (1868–1918) (design) and Leopold Forstner (1878-1936) (execution), The Physical Virtues (1905-07), stained glass, Kirche am Steinhof (Otto-Wagner-Kirche), Vienna, Austria. Image by Haeferl, via Wikimedia Commons.

In 1905-07, Moser collaborated with Leopold Forstner (1878-1936), already famous for making mosaics and stained glass, in the design and production of windows and mosaics for the Kirche am Steinhof (also known as Otto-Wagner-Kirche) in Vienna. Most impressive among these is this window of The Physical Virtues.

Am Steinhof, as it was widely known then, is a large psychiatric and neurological hospital complex planned by the architect Otto Koloman Wagner (1841-1918), and built between 1904-07 in a suburb to the west of Vienna. Its architecture is Art Nouveau, and it contains several of the finest examples of that style, particularly its Roman Catholic oratory: Wikipedia has an excellent article about it here, and an extensive library of images in Wikimedia Commons.

At the same time, artists started featuring stained glass windows in their paintings.

Mariana 1851 by Sir John Everett Millais, Bt 1829-1896
Sir John Everett Millais (1829–1896), Mariana (1851), oil on mahogany, 59.7 x 49.5 cm, The Tate Gallery (Accepted by HM Government in lieu of tax and allocated to the Tate Gallery 1999), London. © The Tate Gallery and Photographic Rights © Tate (2016), CC-BY-NC-ND 3.0 (Unported), http://www.tate.org.uk/art/artworks/millais-mariana-t07553

John Everett Millais’ final version of Mariana (1851) was first shown at the Royal Academy in 1851, and refers to Tennyson’s poem of the same name. This richly-coloured painting is full of symbols: fallen leaves to indicate the passage of time, her embroidery as a means of passing that time, the Annunciation in the stained glass contrasting her with the Virgin’s fulfilment, the motto ‘in coelo quies’ (in heaven is rest), and the snowdrop flower in the glass meaning consolation. Mariana’s posture is intended to indicate her yearning for her lover Angelo.

helleusaintdenis
Paul César Helleu (1859–1927), The Interior of the Abbey Church of Saint Denis (c 1891), oil on canvas, dimensions not known, The Isabella Stewart Gardner Museum, Boston, MA. The Athenaeum.

Paul César Helleu’s Interior of the Basilica of Saint-Denis (c 1891) is an example of his interest in churches and their stained glass, which included Reims Cathedral. The Basilica of Saint-Denis was the burial place for almost every French king between the tenth and eighteenth centuries, and it now lies within the north of the city of Paris, although Saint-Denis was formerly its own city. The window shown is that of the north transept, featuring the tree of Jesse; a south transept rose shows the Creation.

redongrandvitrail
Odilon Redon (1840–1916), Le grand vitrail (The Large Window) (1904), charcoal, pastel and stumping on cardboard, 87 x 68 cm, Musée d’Orsay, Paris. Image EHN & DIJ Oakley.

Odilon Redon’s The Large Window, from 1904, is one of the most remarkable pastel paintings that I have seen. Framed by carved masonry shown in the dull greys of charcoal, a mediaeval stained glass window dazzles with its bright, rich colours, the pure pigment of pastel at its best.

sichulskispring
Kazimierz Sichulski (1879–1942), Spring Triptych (1909), tempera and pastel on cardboard, 145 x 231 cm Source National Museum, Warsaw, Muzeum Narodowe w Warszawie, Warsaw, Poland. Wikimedia Commons.

Three years after Kazimierz Sichulski painted his first triptychs, he used mixed media of tempera and pastel to create some that look as if they’re stained glass. His Spring Triptych from 1909 bridges the religious and secular, with the centre panel showing a woman and child.

lhermittechurchsaintbonnet
Léon Augustin Lhermitte (1844–1925), The Prayer, the Church of Saint-Bonnet (before 1920), pastel on stretched paper, 49.8 × 57.5 cm, location not known. Wikimedia Commons.

Léon Augustin Lhermitte had painted a few religious works earlier in his career, but his late pastel of The Prayer, the Church of Saint-Bonnet (before 1920) is probably the most moving.

rochegrosseinteriorofthecathedral
Georges Rochegrosse (1859–1938), Interior of the Cathedral of Reims in Flames (1915), oil on canvas, 100 x 73 cm, Musée des beaux-arts, Reims, France. By G.Garitan, via Wikimedia Commons.

At the start of the First World War, the cathedral of Notre-Dame de Reims, where the Kings of France were once crowned, had been commissioned as a hospital and demilitarised. German shells hit the cathedral during opening engagements on 20 September 1914, setting alight scaffolding, and destroying some of the stonework. The fire spread through woodwork, melting the lead on the roof, and destroying the bishop’s palace. The French accused the Germans of the deliberate destruction of part of its national and cultural heritage.

Georges Rochegrosse’s Interior of the Cathedral of Reims in Flames (1915) casts this in a curious combination of the physical reality of the shattered masonry and fire, the ancient glory of the cathedral’s stained glass, and an Arthurian figure (possibly the Madonna herself) reaching up to seek divine intervention.

伦敦三月赏花之旅 2026年3月14日,星期六

By: 10year
15 March 2026 at 06:56
趁着周六的好天气,我在伦敦开启了一场赏花之旅,主要看玉兰花和樱花。三月中旬花已全开,想看的朋友一定要抓紧,别错 […]

Mastodon: 将媒体文件存放在本地(docker 版)

By: fivestone
30 August 2023 at 05:12

本攻略适用于——

  • 自建 mastodon(非大站)
  • 使用 docker compose
  • 将媒体文件直接保存在服务器上,而不使用 s3 外部存储

这个搭配虽然不多见,但其实用起来满爽的。很多人用的 s3 服务都是在薅羊毛,而 mastodon 那个变态的,把别人家的媒体文件缓存到自家的架构,流量的吞吐其实很大的(开了 relay 就更夸张),薅羊毛时很容易就超出了。反而是 vps 本身的流量上限很高。对于个人建站而言,媒体文件总量通常 <50GB,某些 vps 自带 200GB 硬盘,足够用了。

缺点是,除了数据库定期备份外,也要考虑媒体文件的异地备份问题。但其实只需要备份存储本地附件的 media_attachments,而 cache 是不需要备份的,所以工作量也不大。

两年前我把媒体文件转移到本地时,参照了 antisocial science 的设置。但因为我用 docker,官方默认的设置,docker 内外权限不一致,无法将媒体文件写到本地。于是匆匆又在本地建了个 minio s3 来中转……这样其实很浪费资源了,minio 的开销也不小。所以最近趁着搬家,又试了一下,终于把 docker + 本地存储 跑通了。


1. 在 docker-compose.yml 里,

web 和 sidekiq 容器中,已经预设了媒体文件的卷映射

volumes:
- ./public/system:/mastodon/public/system

这个不用动。——也可以改成其它的路径,但要和后面的设置一致(本文用相同的颜色标明)。

2. 修改 .env.production

S3_ENABLED=false
PAPERCLIP_ROOT_PATH=/mastodon/public/system
PAPERCLIP_ROOT_URL=/fivestone-mastodon-media

PAPERCLIP_ROOT_URL 是服务器的所有媒体文件链接的子文件夹名称,形如:

https://mastodon.fivest.one/fivestone-mastodon-media/media_attachments/.../x.jpg

默认值是 /system;但是建议改成独特一些的名字,而且建议和 S3_BUCKET 一致。以后需要在本地存储和 s3 之间转换时,可以省一点心。(所以要独特一些,防止回头在 s3 上和别人撞名)

3. 修改 nginx 的域名配置文件

参照官方的配置,把域名文件夹里的 proxy_pass ,直接改成本地的 alias

server 
{
  server_name mastodon.fivest.one;
# ......

  location /fivestone-mastodon-media/
  {
    alias /path-to...docker-compose-folder/public/system/ ;

    proxy_cache CACHE;
    proxy_cache_valid 200 48h;
    proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
    proxy_cache_lock on;

    expires 1y;
    add_header Cache-Control public;
    add_header 'Access-Control-Allow-Origin' '*';
    add_header X-Cache-Status $upstream_cache_status;
    add_header X-Content-Type-Options nosniff;
    add_header Content-Security-Policy "default-src 'none'; form-action 'none'";
  }
}

然后重启 nginx

sudo systemctl reload nginx.service

4. 通过 docker 设置媒体文件夹的权限

在 docker 内部,是以 mastodon 用户的身份,来运行程序的,所以要把媒体文件夹的所有者改成(docker 内部的)mastodon:

sudo docker-compose run --user=root --rm web chown -R mastodon /mastodon/public/system

如果是从 s3 迁移到本地,把媒体文件移入这个本地文件夹(/path-to…docker-compose-folder/public/system/)后,也要再执行一遍上面这条命令。

或者在 mastodon docker 服务已经启动的情况下,执行:

sudo docker exec -u 0 mastodon_container_web chown -R mastodon /mastodon/public/system

但在这条命令执行结束之前,mastodon 在后台写入媒体文件时,仍然可能出现文件夹权限不足,无法写入的问题。

❌
❌