Backend Setup¶
Before you can sync your .env files, you need a place to sync with that isn't one of your personal machines. For this we provide the Senf Backend.
Requirements¶
- Linux Server
- .NET 10 or higher
- Git
Installation¶
- Clone the backend repository
- Restore and build the solution
cd Senf
mkdir -p publish
dotnet restore
dotnet publish ./Senf.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -o publish
- Create a Systemd Service
senf.service:
[Unit]
Description=Senf Backend
After=network.target
[Service]
WorkingDirectory=[Path/To/Your/Senf/Installation]
ExecStart=[Path/To/Your/Dotnet] [Path/To/Your/Senf/Installation]/publish/Senf.dll run
Restart=always
RestartSec=5
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DATABASE_PATH=~/.local/share/senf/senf.db
Environment=PORT=5000 # You may configure a different port here if this one is already used by another application
[Install]
WantedBy=multi-user.targetroot
- Reload systemd and activate the service:
- Verify
Watch for any errors or warnings about permission issues. Incorrect permissions may cause dotnet to store encryption keys as plaintext
Initial User Setup¶
Once the backend has been setup, you must create your first user through the backend CLI.
- Stop the service
- Create a new user
username: The username that will be associated with your SSH Keys in the Senf backend. Recommended characters: [a-zA-Z0-9-.]
public-key: The content of a *.pub file, usually located in ~/.ssh. If you do not have any SSH keys or want a separate key for Senf, you can follow these instructions
key-name: A unique name to make it easier to identify which key belongs to which machine.
- Start the service
- Verify
To verify your login, you must first setup SenfCLI