| Crates.io | snac2nex |
| lib.rs | snac2nex |
| version | 0.6.1 |
| created_at | 2025-07-01 14:40:13.775726+00 |
| updated_at | 2025-07-13 13:25:53.154944+00 |
| description | Convert Snac profiles to the Nex blog format |
| homepage | |
| repository | https://codeberg.org/postscriptum/snac2nex |
| max_upload_size | |
| id | 1733274 |
| size | 57,307 |
Convert Snac profiles to the Nex blog format. Useful as a mirroring tool for an existing fediverse instance or for migrating the data once.
cargo install snac2nex
snac2nex -s /path/to/snac/storage -t /path/to/nex -u user1 -u user2
-s, --source <SOURCE>
Path to the Snac2 profile directory
-t, --target <TARGET>
Target directory for public data export
-u, --user <USER>
Username(s) to export
-a, --attachment <ATTACHMENT>
Include attachment files export
Supported values:
* `c` (`copy`) - copy files
* `h` (`hard`) - create hard links
* `s` (`soft`) - create soft links (macos, linux, windows only)
-r, --rotate <ROTATE>
Keep running as the daemon, renew every `n` seconds
-f, --format-content <FORMAT_CONTENT>
Post template pattern
[default: {content}{attachments}{link}{tags}{updated}]
--format-filename <FORMAT_FILENAME>
Post filenames format
* append trailing slash to parse documents as the directory
* append `.gmi` or `.gemtext` extension to format documents as Gemtext
* escape with `%%` when using in `systemd` context
* be careful when removing the seconds part, as it may cause overwrite collisions!
[default: %H-%M-%S]
--format-updated <FORMAT_UPDATED>
Post `{updated}` time format
* escaped with `%%`
[default: "%Y/%m/%d %H:%M:%S"]
--filesystem-sync-time
Sync file meta with Snac entry time (e.g. time modified)
--filesystem-dir-permissions <FILESYSTEM_DIR_PERMISSIONS>
Set new directory permissions (macos, linux only)
--filesystem-file-permissions <FILESYSTEM_FILE_PERMISSIONS>
Set new file permissions (macos, linux only)
-k, --keep
Keep Nex entry on Snac post was removed
-d, --daemon
Disables some debug output
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
To use snac2nex as the systemd service, install binary to the canonical system location:
git clone https://codeberg.org/postscriptum/snac2nex.git && cd snac2nexcargo build --releasesudo install target/release/snac2nex /usr/local/bin/snac2nex
snac2nex sources folder to free up disk spaceSetup shared access permissions:
useradd -m snac2nex - create new user with home dir (for log files)usermod -aG snac snac2nex - replace snac with the systemd group for your Snac server
chmod -R g+r /path/to/snac/storage - give the group read permissions to Snac directoriesusermod -aG nexy snac2nex - replace nexy with the systemd group for your your Nex protocol server (e.g. Nexy)
chmod -R g+rw /path/to/nex - give the group read/write permissions to Nex directoriesCreate new systemd configuration file /etc/systemd/system/snac2nex.service:
[Unit]
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=snac2nex
Group=snac2nex
# Uncomment if your Snac or Nex unit has ExecStartPre timeout option
# ExecStartPre=/bin/sleep 15
ExecStart=/usr/local/bin/snac2nex -s /path/to/snac/storage -t /path/to/nex -u user1 -u user2 -r 3600 -d
StandardOutput=file:/home/snac2nex/debug.log
StandardError=file:/home/snac2nex/error.log
[Install]
WantedBy=multi-user.target
ExecStart arguments with your values, where:
-s - Snac storage location-u - Snac user(s) to sync-t - Nex server target location for public files-r - is rotate every hour (3600 seconds) to apply Snac instance updates (instead of export once)-d - enable daemon mode, which disables some debug output, to prevent extra write operations-a (attachment) as c (copy) | h (hard link) | s (soft link)systemctl daemon-reload - apply new systemd configurationsystemctl enable snac2nex - auto-start snac2nex sync on system bootsystemctl start snac2nex - start snac2nex sync now